pdmdev.h revision 6c83eb6b98d1dd1b1d9795c16801ee2f53d2cc31
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * PDM - Pluggable Device Manager, Devices.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * available from http://www.virtualbox.org. This file is free software;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * you can redistribute it and/or modify it under the terms of the GNU
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * General Public License (GPL) as published by the Free Software
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * The contents of this file may alternatively be used under the terms
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * of the Common Development and Distribution License Version 1.0
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * VirtualBox OSE distribution, in which case the provisions of the
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * CDDL are applicable instead of those of the GPL.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * You may elect to license modified versions of this file under the
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * terms and conditions of either the GPL or the CDDL or both.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * additional information or have any questions.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** @defgroup grp_pdm_device Devices
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @ingroup grp_pdm
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * Construct a device instance for a VM.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @returns VBox status.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param pDevIns The device instance data.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * If the registration structure is needed, pDevIns->pDevReg points to it.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * @param iInstance Instance number. Use this to figure out which registers and such to use.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * The instance number is also found in pDevIns->iInstance, but since it's
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * likely to be freqently used PDM passes it as parameter.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pCfgHandle Configuration node handle for the device. Use this to obtain the configuration
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * of the device instance. It's also found in pDevIns->pCfgHandle, but since it's
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * primary usage will in this function it's passed as a parameter.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef DECLCALLBACK(int) FNPDMDEVCONSTRUCT(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfgHandle);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to a FNPDMDEVCONSTRUCT() function. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Destruct a device instance.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * Most VM resources are freed by the VM. This callback is provided so that any non-VM
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * resources can be freed correctly.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * @returns VBox status.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * @param pDevIns The device instance data.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsynctypedef DECLCALLBACK(int) FNPDMDEVDESTRUCT(PPDMDEVINS pDevIns);
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync/** Pointer to a FNPDMDEVDESTRUCT() function. */
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * Device relocation callback.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * When this callback is called the device instance data, and if the
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * device have a GC component, is being relocated, or/and the selectors
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * have been changed. The device must use the chance to perform the
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * necessary pointer relocations and data updates.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * Before the GC code is executed the first time, this function will be
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * called with a 0 delta so GC pointer calculations can be one in one place.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Pointer to the device instance.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param offDelta The relocation delta relative to the old location.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @remark A relocation CANNOT fail.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef DECLCALLBACK(void) FNPDMDEVRELOCATE(PPDMDEVINS pDevIns, RTGCINTPTR offDelta);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to a FNPDMDEVRELOCATE() function. */
ffb50166c9adb4ae583b914d405197035cf890advboxsync * Device I/O Control interface.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * This is used by external components, such as the COM interface, to
ffb50166c9adb4ae583b914d405197035cf890advboxsync * communicate with devices using a class wide interface or a device
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * specific interface.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns VBox status code.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Pointer to the device instance.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param uFunction Function to perform.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pvIn Pointer to input data.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param cbIn Size of input data.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pvOut Pointer to output data.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param cbOut Size of output data.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pcbOut Where to store the actual size of the output data.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef DECLCALLBACK(int) FNPDMDEVIOCTL(PPDMDEVINS pDevIns, RTUINT uFunction,
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to a FNPDMDEVIOCTL() function. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Power On notification.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns VBox status.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns The device instance data.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef DECLCALLBACK(void) FNPDMDEVPOWERON(PPDMDEVINS pDevIns);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to a FNPDMDEVPOWERON() function. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Reset notification.
248c89033c87fed7229aa29bbbc4f4698fb13687vboxsync * @returns VBox status.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * @param pDevIns The device instance data.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef DECLCALLBACK(void) FNPDMDEVRESET(PPDMDEVINS pDevIns);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to a FNPDMDEVRESET() function. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Suspend notification.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns VBox status.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns The device instance data.
b4d7b4dbcc45b8bde7502aa129440d92d7ffd038vboxsynctypedef DECLCALLBACK(void) FNPDMDEVSUSPEND(PPDMDEVINS pDevIns);
b4d7b4dbcc45b8bde7502aa129440d92d7ffd038vboxsync/** Pointer to a FNPDMDEVSUSPEND() function. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Resume notification.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns VBox status.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns The device instance data.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsynctypedef DECLCALLBACK(void) FNPDMDEVRESUME(PPDMDEVINS pDevIns);
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync/** Pointer to a FNPDMDEVRESUME() function. */
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * Power Off notification.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * @param pDevIns The device instance data.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsynctypedef DECLCALLBACK(void) FNPDMDEVPOWEROFF(PPDMDEVINS pDevIns);
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync/** Pointer to a FNPDMDEVPOWEROFF() function. */
3fb3de312d1ff675e0f7cc62a7d46cbb1d5d9353vboxsync * Attach command.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * This is called to let the device attach to a driver for a specified LUN
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * at runtime. This is not called during VM construction, the device
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * constructor have to attach to all the available drivers.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * This is like plugging in the keyboard or mouse after turning on the PC.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * @returns VBox status code.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * @param pDevIns The device instance.
cd5df721f068659172f3bf95de8fedeb465f057dvboxsync * @param iLUN The logical unit which is being detached.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsynctypedef DECLCALLBACK(int) FNPDMDEVATTACH(PPDMDEVINS pDevIns, unsigned iLUN);
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync/** Pointer to a FNPDMDEVATTACH() function. */
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * Detach notification.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * This is called when a driver is detaching itself from a LUN of the device.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * The device should adjust it's state to reflect this.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * This is like unplugging the network cable to use it for the laptop or
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * something while the PC is still running.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * @param pDevIns The device instance.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * @param iLUN The logical unit which is being detached.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsynctypedef DECLCALLBACK(void) FNPDMDEVDETACH(PPDMDEVINS pDevIns, unsigned iLUN);
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync/** Pointer to a FNPDMDEVDETACH() function. */
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * Query the base interface of a logical unit.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * @returns VBOX status code.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * @param pDevIns The device instance.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * @param iLUN The logicial unit to query.
3fb3de312d1ff675e0f7cc62a7d46cbb1d5d9353vboxsync * @param ppBase Where to store the pointer to the base interface of the LUN.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsynctypedef DECLCALLBACK(int) FNPDMDEVQUERYINTERFACE(PPDMDEVINS pDevIns, unsigned iLUN, PPDMIBASE *ppBase);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to a FNPDMDEVQUERYINTERFACE() function. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef FNPDMDEVQUERYINTERFACE *PFNPDMDEVQUERYINTERFACE;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Init complete notification.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * This can be done to do communication with other devices and other
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * initialization which requires everything to be in place.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns VBOX status code.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns The device instance.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef DECLCALLBACK(int) FNPDMDEVINITCOMPLETE(PPDMDEVINS pDevIns);
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to a FNPDMDEVINITCOMPLETE() function. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef FNPDMDEVINITCOMPLETE *PFNPDMDEVINITCOMPLETE;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** PDM Device Registration Structure,
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * This structure is used when registering a device from
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * VBoxInitDevices() in HC Ring-3. PDM will continue use till
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * the VM is terminated.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef struct PDMDEVREG
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Structure version. PDM_DEVREG_VERSION defines the current version. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Device name. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Name of guest context module (no path).
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Only evalutated if PDM_DEVREG_FLAGS_GC is set. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Name of guest context module (no path).
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Only evalutated if PDM_DEVREG_FLAGS_GC is set. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** The description of the device. The UTF-8 string pointed to shall, like this structure,
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * remain unchanged from registration till VM destruction. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Flags, combination of the PDM_DEVREG_FLAGS_* \#defines. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Device class(es), combination of the PDM_DEVREG_CLASS_* \#defines. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Maximum number of instances (per VM). */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Size of the instance data. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Construct instance - required. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Destruct instance - optional. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Relocation command - optional. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** I/O Control interface - optional. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Power on notification - optional. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Reset notification - optional. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Suspend notification - optional. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Resume notification - optional. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Attach command - optional. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Detach notification - optional. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Query a LUN base interface - optional. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Init complete notification - optional. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Power off notification - optional. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to a PDM Device Structure. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Const pointer to a PDM Device Structure. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Current DEVREG version number. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** PDM Device Flags.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** This flag is used to indicate that the device has a GC component. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** This flag is used to indicate that the device has a R0 component. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** @def PDM_DEVREG_FLAGS_HOST_BITS_DEFAULT
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * The bit count for the current host. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync# define PDM_DEVREG_FLAGS_HOST_BITS_DEFAULT 0x00000002
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync# define PDM_DEVREG_FLAGS_HOST_BITS_DEFAULT 0x00000004
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** The host bit count mask. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** The device support only 32-bit guests. */
5c9a5681751a936cd9fe7e98d9f30de34bc99372vboxsync/** The device support only 64-bit guests. */
5c9a5681751a936cd9fe7e98d9f30de34bc99372vboxsync/** The device support both 32-bit & 64-bit guests. */
cd5df721f068659172f3bf95de8fedeb465f057dvboxsync#define PDM_DEVREG_FLAGS_GUEST_BITS_32_64 0x00000018
cd5df721f068659172f3bf95de8fedeb465f057dvboxsync/** @def PDM_DEVREG_FLAGS_GUEST_BITS_DEFAULT
5c9a5681751a936cd9fe7e98d9f30de34bc99372vboxsync * The guest bit count for the current compilation. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync# define PDM_DEVREG_FLAGS_GUEST_BITS_DEFAULT PDM_DEVREG_FLAGS_GUEST_BITS_32
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync# define PDM_DEVREG_FLAGS_GUEST_BITS_DEFAULT PDM_DEVREG_FLAGS_GUEST_BITS_32_64
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync/** The guest bit count mask. */
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync/** Indicates that the devices support PAE36 on a 32-bit guest. */
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync/** PDM Device Classes.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * The order is important, lower bit earlier instantiation.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync/** Architecture device. */
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync/** Architecture BIOS device. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** PCI bus brigde. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** ISA bus brigde. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Input device (mouse, keyboard, joystick,..). */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Interrupt controller (PIC). */
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync/** Interval controoler (PIT). */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** DMA controller. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** VMM Device. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Graphics device, like VGA. */
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync/** Storage controller device. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Network interface controller. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Audio. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** USB HIC. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** ACPI. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Serial controller device. */
ebe46865faa75932265b29148843c6c54ffcb6a4vboxsync/** Parallel controller device */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Misc devices (always last). */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** @name IRQ Level for use with the *SetIrq APIs.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Assert the IRQ (can assume value 1). */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Deassert the IRQ (can assume value 0). */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** flip-flop - assert and then deassert it again immediately. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync#define PDM_IRQ_LEVEL_FLIP_FLOP (RT_BIT(1) | PDM_IRQ_LEVEL_HIGH)
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * PCI Bus registration structure.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * All the callbacks, except the PCIBIOS hack, are working on PCI devices.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef struct PDMPCIBUSREG
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Structure version number. PDM_PCIBUSREG_VERSION defines the current version. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Registers the device with the default PCI bus.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @returns VBox status code.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the PCI Bus.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pPciDev The PCI device structure.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Any PCI enabled device must keep this in it's instance data!
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * Fill in the PCI data config before registration, please.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pszName Pointer to device name (permanent, readonly). For debugging, not unique.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param iDev The device number ((dev << 3) | function) the device should have on the bus.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * If negative, the pci bus device will assign one.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR3CALLBACKMEMBER(int, pfnRegisterR3,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, const char *pszName, int iDev));
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * Registers a I/O region (memory mapped or I/O ports) for a PCI device.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns VBox status code.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param pDevIns Device instance of the PCI Bus.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param pPciDev The PCI device structure.
b8bb9c9f6b8ebfd0a7d6df0c0289f9fe80241750vboxsync * @param iRegion The region number.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param cbRegion Size of the region.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param iType PCI_ADDRESS_SPACE_MEM, PCI_ADDRESS_SPACE_IO or PCI_ADDRESS_SPACE_MEM_PREFETCH.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param pfnCallback Callback for doing the mapping.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync DECLR3CALLBACKMEMBER(int, pfnIORegionRegisterR3,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, int iRegion, uint32_t cbRegion, PCIADDRESSSPACE enmType, PFNPCIIOREGIONMAP pfnCallback));
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * Register PCI configuration space read/write callbacks.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param pDevIns Device instance of the PCI Bus.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param pPciDev The PCI device structure.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pfnRead Pointer to the user defined PCI config read function.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param ppfnReadOld Pointer to function pointer which will receive the old (default)
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * PCI config read function. This way, user can decide when (and if)
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * to call default PCI config read function. Can be NULL.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pfnWrite Pointer to the user defined PCI config write function.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pfnWriteOld Pointer to function pointer which will receive the old (default)
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * PCI config write function. This way, user can decide when (and if)
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * to call default PCI config write function. Can be NULL.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @thread EMT
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR3CALLBACKMEMBER(void, pfnSetConfigCallbacksR3,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PFNPCICONFIGREAD pfnRead, PPFNPCICONFIGREAD ppfnReadOld,
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync PFNPCICONFIGWRITE pfnWrite, PPFNPCICONFIGWRITE ppfnWriteOld));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Set the IRQ for a PCI device.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the PCI Bus.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pPciDev The PCI device structure.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param iIrq IRQ number to set.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param iLevel IRQ level. See the PDM_IRQ_LEVEL_* \#defines.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR3CALLBACKMEMBER(void, pfnSetIrqR3,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, int iIrq, int iLevel));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Saves a state of the PCI device.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns VBox status code.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the PCI Bus.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pPciDev Pointer to PCI device.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pSSMHandle The handle to save the state to.
b730e944aef2382d2306995521834f0f13b6d7bcvboxsync DECLR3CALLBACKMEMBER(int, pfnSaveExecR3,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PSSMHANDLE pSSMHandle));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Loads a saved PCI device state.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns VBox status code.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the PCI Bus.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pPciDev Pointer to PCI device.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pSSMHandle The handle to the saved state.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR3CALLBACKMEMBER(int, pfnLoadExecR3,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PSSMHANDLE pSSMHandle));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Called to perform the job of the bios.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * This is only called for the first PCI Bus - it is expected to
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * service all the PCI buses.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @returns VBox status.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param pDevIns Device instance of the first bus.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR3CALLBACKMEMBER(int, pfnFakePCIBIOSR3,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** The name of the SetIrq RC entry point. */
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync /** The name of the SetIrq R0 entry point. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to a PCI bus registration structure. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Current PDMPCIBUSREG version number. */
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * PCI Bus RC helpers.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsynctypedef struct PDMPCIHLPRC
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync /** Structure version. PDM_PCIHLPRC_VERSION defines the current version. */
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * Set an ISA IRQ.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns PCI device instance.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param iIrq IRQ number to set.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param iLevel IRQ level. See the PDM_IRQ_LEVEL_* \#defines.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @thread EMT only.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLRCCALLBACKMEMBER(void, pfnIsaSetIrq,(PPDMDEVINS pDevIns, int iIrq, int iLevel));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Set an I/O-APIC IRQ.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns PCI device instance.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param iIrq IRQ number to set.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param iLevel IRQ level. See the PDM_IRQ_LEVEL_* \#defines.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @thread EMT only.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync DECLRCCALLBACKMEMBER(void, pfnIoApicSetIrq,(PPDMDEVINS pDevIns, int iIrq, int iLevel));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Acquires the PDM lock.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns VINF_SUCCESS on success.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns rc if we failed to acquire the lock.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns The PCI device instance.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param rc What to return if we fail to acquire the lock.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLRCCALLBACKMEMBER(int, pfnLock,(PPDMDEVINS pDevIns, int rc));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Releases the PDM lock.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns The PCI device instance.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLRCCALLBACKMEMBER(void, pfnUnlock,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Just a safety precaution. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to PCI helpers. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to const PCI helpers. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef RCPTRTYPE(const PDMPCIHLPRC *) PCPDMPCIHLPRC;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Current PDMPCIHLPR3 version number. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * PCI Bus R0 helpers.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef struct PDMPCIHLPR0
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Structure version. PDM_PCIHLPR0_VERSION defines the current version. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Set an ISA IRQ.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns PCI device instance.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param iIrq IRQ number to set.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param iLevel IRQ level. See the PDM_IRQ_LEVEL_* \#defines.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @thread EMT only.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR0CALLBACKMEMBER(void, pfnIsaSetIrq,(PPDMDEVINS pDevIns, int iIrq, int iLevel));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Set an I/O-APIC IRQ.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns PCI device instance.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param iIrq IRQ number to set.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param iLevel IRQ level. See the PDM_IRQ_LEVEL_* \#defines.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @thread EMT only.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR0CALLBACKMEMBER(void, pfnIoApicSetIrq,(PPDMDEVINS pDevIns, int iIrq, int iLevel));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Acquires the PDM lock.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns VINF_SUCCESS on success.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns rc if we failed to acquire the lock.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns The PCI device instance.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param rc What to return if we fail to acquire the lock.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR0CALLBACKMEMBER(int, pfnLock,(PPDMDEVINS pDevIns, int rc));
4fc4c719ffba45eb4136c34ad713ef9b21f69e3bvboxsync * Releases the PDM lock.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param pDevIns The PCI device instance.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR0CALLBACKMEMBER(void, pfnUnlock,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Just a safety precaution. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to PCI helpers. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to const PCI helpers. */
c99b597540585068d22dde4c9f74730305f24097vboxsynctypedef R0PTRTYPE(const PDMPCIHLPR0 *) PCPDMPCIHLPR0;
c99b597540585068d22dde4c9f74730305f24097vboxsync/** Current PDMPCIHLPR0 version number. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * PCI device helpers.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef struct PDMPCIHLPR3
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Structure version. PDM_PCIHLPR3_VERSION defines the current version. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Set an ISA IRQ.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns The PCI device instance.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param iIrq IRQ number to set.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param iLevel IRQ level. See the PDM_IRQ_LEVEL_* \#defines.
4171ffb38eb8720b2ae9a8d13e95103ab26cfd12vboxsync * @thread EMT only.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR3CALLBACKMEMBER(void, pfnIsaSetIrq,(PPDMDEVINS pDevIns, int iIrq, int iLevel));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Set an I/O-APIC IRQ.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns The PCI device instance.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param iIrq IRQ number to set.
c99b597540585068d22dde4c9f74730305f24097vboxsync * @param iLevel IRQ level. See the PDM_IRQ_LEVEL_* \#defines.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @thread EMT only.
cd5df721f068659172f3bf95de8fedeb465f057dvboxsync DECLR3CALLBACKMEMBER(void, pfnIoApicSetIrq,(PPDMDEVINS pDevIns, int iIrq, int iLevel));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Checks if the given address is an MMIO2 base address or not.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @returns true/false accordingly.
b8bb9c9f6b8ebfd0a7d6df0c0289f9fe80241750vboxsync * @param pDevIns The PCI device instance.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param pOwner The owner of the memory, optional.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param GCPhys The address to check.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync DECLR3CALLBACKMEMBER(bool, pfnIsMMIO2Base,(PPDMDEVINS pDevIns, PPDMDEVINS pOwner, RTGCPHYS GCPhys));
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * Gets the address of the RC PCI Bus helpers.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * This should be called at both construction and relocation time
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * to obtain the correct address of the RC helpers.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns RC pointer to the PCI Bus helpers.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the PCI Bus.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @thread EMT only.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR3CALLBACKMEMBER(PCPDMPCIHLPRC, pfnGetRCHelpers,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Gets the address of the R0 PCI Bus helpers.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * This should be called at both construction and relocation time
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * to obtain the correct address of the R0 helpers.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @returns R0 pointer to the PCI Bus helpers.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param pDevIns Device instance of the PCI Bus.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @thread EMT only.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync DECLR3CALLBACKMEMBER(PCPDMPCIHLPR0, pfnGetR0Helpers,(PPDMDEVINS pDevIns));
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * Acquires the PDM lock.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @returns VINF_SUCCESS on success.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @returns Fatal error on failure.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param pDevIns The PCI device instance.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param rc Dummy for making the interface identical to the RC and R0 versions.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync DECLR3CALLBACKMEMBER(int, pfnLock,(PPDMDEVINS pDevIns, int rc));
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * Releases the PDM lock.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param pDevIns The PCI device instance.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync DECLR3CALLBACKMEMBER(void, pfnUnlock,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Just a safety precaution. */
510567648d46488f4166e5f69ffffe3eeeeec4d9vboxsync/** Pointer to PCI helpers. */
510567648d46488f4166e5f69ffffe3eeeeec4d9vboxsync/** Pointer to const PCI helpers. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef R3PTRTYPE(const PDMPCIHLPR3 *) PCPDMPCIHLPR3;
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync/** Current PDMPCIHLPR3 version number. */
b8bb9c9f6b8ebfd0a7d6df0c0289f9fe80241750vboxsync * Programmable Interrupt Controller registration structure.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsynctypedef struct PDMPICREG
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync /** Structure version number. PDM_PICREG_VERSION defines the current version. */
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * Set the an IRQ.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param pDevIns Device instance of the PIC.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param iIrq IRQ number to set.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param iLevel IRQ level. See the PDM_IRQ_LEVEL_* \#defines.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR3CALLBACKMEMBER(void, pfnSetIrqR3,(PPDMDEVINS pDevIns, int iIrq, int iLevel));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Get a pending interrupt.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns Pending interrupt number.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the PIC.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR3CALLBACKMEMBER(int, pfnGetInterruptR3,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** The name of the RC SetIrq entry point. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** The name of the RC GetInterrupt entry point. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** The name of the R0 SetIrq entry point. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** The name of the R0 GetInterrupt entry point. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to a PIC registration structure. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Current PDMPICREG version number. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * PIC RC helpers.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef struct PDMPICHLPRC
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Structure version. PDM_PICHLPRC_VERSION defines the current version. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Set the interrupt force action flag.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param pDevIns Device instance of the PIC.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLRCCALLBACKMEMBER(void, pfnSetInterruptFF,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Clear the interrupt force action flag.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the PIC.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLRCCALLBACKMEMBER(void, pfnClearInterruptFF,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Acquires the PDM lock.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns VINF_SUCCESS on success.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns rc if we failed to acquire the lock.
5c9a5681751a936cd9fe7e98d9f30de34bc99372vboxsync * @param pDevIns The PIC device instance.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param rc What to return if we fail to acquire the lock.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLRCCALLBACKMEMBER(int, pfnLock,(PPDMDEVINS pDevIns, int rc));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Releases the PDM lock.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns The PIC device instance.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLRCCALLBACKMEMBER(void, pfnUnlock,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Just a safety precaution. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to PIC RC helpers. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to const PIC RC helpers. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef RCPTRTYPE(const PDMPICHLPRC *) PCPDMPICHLPRC;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Current PDMPICHLPRC version number. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * PIC R0 helpers.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef struct PDMPICHLPR0
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Structure version. PDM_PICHLPR0_VERSION defines the current version. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Set the interrupt force action flag.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the PIC.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR0CALLBACKMEMBER(void, pfnSetInterruptFF,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Clear the interrupt force action flag.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the PIC.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR0CALLBACKMEMBER(void, pfnClearInterruptFF,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Acquires the PDM lock.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns VINF_SUCCESS on success.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns rc if we failed to acquire the lock.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns The PIC device instance.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param rc What to return if we fail to acquire the lock.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR0CALLBACKMEMBER(int, pfnLock,(PPDMDEVINS pDevIns, int rc));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Releases the PDM lock.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns The PCI device instance.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR0CALLBACKMEMBER(void, pfnUnlock,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Just a safety precaution. */
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync/** Pointer to PIC R0 helpers. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to const PIC R0 helpers. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef R0PTRTYPE(const PDMPICHLPR0 *) PCPDMPICHLPR0;
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync/** Current PDMPICHLPR0 version number. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * PIC R3 helpers.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef struct PDMPICHLPR3
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Structure version. PDM_PICHLP_VERSION defines the current version. */
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync * Set the interrupt force action flag.
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync * @param pDevIns Device instance of the PIC.
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync DECLR3CALLBACKMEMBER(void, pfnSetInterruptFF,(PPDMDEVINS pDevIns));
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync * Clear the interrupt force action flag.
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync * @param pDevIns Device instance of the PIC.
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync DECLR3CALLBACKMEMBER(void, pfnClearInterruptFF,(PPDMDEVINS pDevIns));
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync * Acquires the PDM lock.
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync * @returns VINF_SUCCESS on success.
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync * @returns Fatal error on failure.
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync * @param pDevIns The PIC device instance.
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync * @param rc Dummy for making the interface identical to the RC and R0 versions.
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync DECLR3CALLBACKMEMBER(int, pfnLock,(PPDMDEVINS pDevIns, int rc));
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync * Releases the PDM lock.
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync * @param pDevIns The PIC device instance.
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync DECLR3CALLBACKMEMBER(void, pfnUnlock,(PPDMDEVINS pDevIns));
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync * Gets the address of the RC PIC helpers.
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync * This should be called at both construction and relocation time
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync * to obtain the correct address of the RC helpers.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns RC pointer to the PIC helpers.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the PIC.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR3CALLBACKMEMBER(PCPDMPICHLPRC, pfnGetRCHelpers,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Gets the address of the R0 PIC helpers.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * This should be called at both construction and relocation time
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * to obtain the correct address of the R0 helpers.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns R0 pointer to the PIC helpers.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the PIC.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR3CALLBACKMEMBER(PCPDMPICHLPR0, pfnGetR0Helpers,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Just a safety precaution. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to PIC R3 helpers. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Pointer to const PIC R3 helpers. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef R3PTRTYPE(const PDMPICHLPR3 *) PCPDMPICHLPR3;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Current PDMPICHLPR3 version number. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Advanced Programmable Interrupt Controller registration structure.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef struct PDMAPICREG
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** Structure version number. PDM_APICREG_VERSION defines the current version. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Get a pending interrupt.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns Pending interrupt number.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the APIC.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR3CALLBACKMEMBER(int, pfnGetInterruptR3,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Check if the APIC has a pending interrupt/if a TPR change would active one
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns Pending interrupt yes/no
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the APIC.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR3CALLBACKMEMBER(bool, pfnHasPendingIrqR3,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Set the APIC base.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the APIC.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param u64Base The new base.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR3CALLBACKMEMBER(void, pfnSetBaseR3,(PPDMDEVINS pDevIns, uint64_t u64Base));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Get the APIC base.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * @returns Current base.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * @param pDevIns Device instance of the APIC.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR3CALLBACKMEMBER(uint64_t, pfnGetBaseR3,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Set the TPR (task priority register).
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the APIC.
ffb50166c9adb4ae583b914d405197035cf890advboxsync * @param u8TPR The new TPR.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR3CALLBACKMEMBER(void, pfnSetTPRR3,(PPDMDEVINS pDevIns, uint8_t u8TPR));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Get the TPR (task priority register).
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * @returns The current TPR.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * @param pDevIns Device instance of the APIC.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * @param pfPending Pending interrupt state (out).
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync DECLR3CALLBACKMEMBER(uint8_t, pfnGetTPRR3,(PPDMDEVINS pDevIns));
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * Private interface between the IOAPIC and APIC.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * This is a low-level, APIC/IOAPIC implementation specific interface
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * which is registered with PDM only because it makes life so much
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * simpler right now (GC bits). This is a bad bad hack! The correct
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * way of doing this would involve some way of querying GC interfaces
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * and relocating them. Perhaps doing some kind of device init in GC...
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @returns The current TPR.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param pDevIns Device instance of the APIC.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param u8Dest See APIC implementation.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param u8DestMode See APIC implementation.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * @param u8DeliveryMode See APIC implementation.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param iVector See APIC implementation.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param u8Polarity See APIC implementation.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param u8TriggerMode See APIC implementation.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR3CALLBACKMEMBER(void, pfnBusDeliverR3,(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
ebe46865faa75932265b29148843c6c54ffcb6a4vboxsync uint8_t iVector, uint8_t u8Polarity, uint8_t u8TriggerMode));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** The name of the RC GetInterrupt entry point. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** The name of the RC HasPendingIrq entry point. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** The name of the RC SetBase entry point. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** The name of the RC GetBase entry point. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** The name of the RC SetTPR entry point. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** The name of the RC GetTPR entry point. */
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync /** The name of the RC BusDeliver entry point. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** The name of the R0 GetInterrupt entry point. */
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync /** The name of the R0 HasPendingIrq entry point. */
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync /** The name of the R0 SetBase entry point. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** The name of the R0 GetBase entry point. */
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync /** The name of the R0 SetTPR entry point. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** The name of the R0 GetTPR entry point. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync /** The name of the R0 BusDeliver entry point. */
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync/** Pointer to an APIC registration structure. */
d3b1b01528fe21777281edf167f8deca06f86e39vboxsync/** Current PDMAPICREG version number. */
d3b1b01528fe21777281edf167f8deca06f86e39vboxsync * APIC RC helpers.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsynctypedef struct PDMAPICHLPRC
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync /** Structure version. PDM_APICHLPRC_VERSION defines the current version. */
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync * Set the interrupt force action flag.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the APIC.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync DECLRCCALLBACKMEMBER(void, pfnSetInterruptFF,(PPDMDEVINS pDevIns, VMCPUID cpuid));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Clear the interrupt force action flag.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the APIC.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLRCCALLBACKMEMBER(void, pfnClearInterruptFF,(PPDMDEVINS pDevIns, VMCPUID cpuid));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Sets or clears the APIC bit in the CPUID feature masks.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the APIC.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param fEnabled If true the bit is set, else cleared.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLRCCALLBACKMEMBER(void, pfnChangeFeature,(PPDMDEVINS pDevIns, bool fEnabled));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Acquires the PDM lock.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns VINF_SUCCESS on success.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @returns rc if we failed to acquire the lock.
0dd3967035b8a02985920baa57f948dc542b9388vboxsync * @param pDevIns The APIC device instance.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param rc What to return if we fail to acquire the lock.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLRCCALLBACKMEMBER(int, pfnLock,(PPDMDEVINS pDevIns, int rc));
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * Releases the PDM lock.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param pDevIns The APIC device instance.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync DECLRCCALLBACKMEMBER(void, pfnUnlock,(PPDMDEVINS pDevIns));
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * Get the virtual CPU id corresponding to the current EMT.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param pDevIns The APIC device instance.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLRCCALLBACKMEMBER(uint32_t, pfnGetCpuId,(PPDMDEVINS pDevIns));
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync /** Just a safety precaution. */
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync/** Pointer to APIC GC helpers. */
0dd3967035b8a02985920baa57f948dc542b9388vboxsync/** Pointer to const APIC helpers. */
0dd3967035b8a02985920baa57f948dc542b9388vboxsynctypedef RCPTRTYPE(const PDMAPICHLPRC *) PCPDMAPICHLPRC;
0dd3967035b8a02985920baa57f948dc542b9388vboxsync/** Current PDMAPICHLPRC version number. */
0dd3967035b8a02985920baa57f948dc542b9388vboxsync * APIC R0 helpers.
6475559a7e0e52892efbab4fbdedc879f6866109vboxsynctypedef struct PDMAPICHLPR0
6475559a7e0e52892efbab4fbdedc879f6866109vboxsync /** Structure version. PDM_APICHLPR0_VERSION defines the current version. */
0dd3967035b8a02985920baa57f948dc542b9388vboxsync * Set the interrupt force action flag.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param pDevIns Device instance of the APIC.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync DECLR0CALLBACKMEMBER(void, pfnSetInterruptFF,(PPDMDEVINS pDevIns, VMCPUID cpuid));
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * Clear the interrupt force action flag.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param pDevIns Device instance of the APIC.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync DECLR0CALLBACKMEMBER(void, pfnClearInterruptFF,(PPDMDEVINS pDevIns, VMCPUID cpuid));
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * Sets or clears the APIC bit in the CPUID feature masks.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param pDevIns Device instance of the APIC.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param fEnabled If true the bit is set, else cleared.
0dd3967035b8a02985920baa57f948dc542b9388vboxsync DECLR0CALLBACKMEMBER(void, pfnChangeFeature,(PPDMDEVINS pDevIns, bool fEnabled));
02651f98b4320e70a300ba1ebe95270096ebfd4dvboxsync * Acquires the PDM lock.
0dd3967035b8a02985920baa57f948dc542b9388vboxsync * @returns VINF_SUCCESS on success.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @returns rc if we failed to acquire the lock.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param pDevIns The APIC device instance.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param rc What to return if we fail to acquire the lock.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync DECLR0CALLBACKMEMBER(int, pfnLock,(PPDMDEVINS pDevIns, int rc));
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * Releases the PDM lock.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param pDevIns The APIC device instance.
f75c6db919d277952ca03b7acf643e5e3ac96cafvboxsync DECLR0CALLBACKMEMBER(void, pfnUnlock,(PPDMDEVINS pDevIns));
f75c6db919d277952ca03b7acf643e5e3ac96cafvboxsync * Get the virtual CPU id corresponding to the current EMT.
f75c6db919d277952ca03b7acf643e5e3ac96cafvboxsync * @param pDevIns The APIC device instance.
f75c6db919d277952ca03b7acf643e5e3ac96cafvboxsync DECLR0CALLBACKMEMBER(uint32_t, pfnGetCpuId,(PPDMDEVINS pDevIns));
f75c6db919d277952ca03b7acf643e5e3ac96cafvboxsync /** Just a safety precaution. */
f75c6db919d277952ca03b7acf643e5e3ac96cafvboxsync/** Pointer to APIC GC helpers. */
0c80e8c5ac4249337af378ff41c60033c9fff59fvboxsync/** Pointer to const APIC helpers. */
f75c6db919d277952ca03b7acf643e5e3ac96cafvboxsynctypedef R0PTRTYPE(const PDMAPICHLPR0 *) PCPDMAPICHLPR0;
f75c6db919d277952ca03b7acf643e5e3ac96cafvboxsync/** Current PDMAPICHLPR0 version number. */
805a319b88bdf29b369da48402c58897a5e8b65dvboxsync * APIC R3 helpers.
805a319b88bdf29b369da48402c58897a5e8b65dvboxsynctypedef struct PDMAPICHLPR3
805a319b88bdf29b369da48402c58897a5e8b65dvboxsync /** Structure version. PDM_APICHLPR3_VERSION defines the current version. */
805a319b88bdf29b369da48402c58897a5e8b65dvboxsync * Set the interrupt force action flag.
0c80e8c5ac4249337af378ff41c60033c9fff59fvboxsync * @param pDevIns Device instance of the APIC.
805a319b88bdf29b369da48402c58897a5e8b65dvboxsync DECLR3CALLBACKMEMBER(void, pfnSetInterruptFF,(PPDMDEVINS pDevIns, VMCPUID cpuid));
805a319b88bdf29b369da48402c58897a5e8b65dvboxsync * Clear the interrupt force action flag.
805a319b88bdf29b369da48402c58897a5e8b65dvboxsync * @param pDevIns Device instance of the APIC.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync DECLR3CALLBACKMEMBER(void, pfnClearInterruptFF,(PPDMDEVINS pDevIns, VMCPUID cpuid));
3c6306a66deef467e3c13483dd6529e1e1c6b822vboxsync * Sets or clears the APIC bit in the CPUID feature masks.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param pDevIns Device instance of the APIC.
3c6306a66deef467e3c13483dd6529e1e1c6b822vboxsync * @param fEnabled If true the bit is set, else cleared.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync DECLR3CALLBACKMEMBER(void, pfnChangeFeature,(PPDMDEVINS pDevIns, bool fEnabled));
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * Acquires the PDM lock.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @returns VINF_SUCCESS on success.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @returns Fatal error on failure.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param pDevIns The APIC device instance.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param rc Dummy for making the interface identical to the GC and R0 versions.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync DECLR3CALLBACKMEMBER(int, pfnLock,(PPDMDEVINS pDevIns, int rc));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Releases the PDM lock.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns The APIC device instance.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync DECLR3CALLBACKMEMBER(void, pfnUnlock,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Get the virtual CPU id corresponding to the current EMT.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns The APIC device instance.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR3CALLBACKMEMBER(uint32_t, pfnGetCpuId,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Gets the address of the RC APIC helpers.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * This should be called at both construction and relocation time
3c6306a66deef467e3c13483dd6529e1e1c6b822vboxsync * to obtain the correct address of the RC helpers.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns GC pointer to the APIC helpers.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * @param pDevIns Device instance of the APIC.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync DECLR3CALLBACKMEMBER(PCPDMAPICHLPRC, pfnGetRCHelpers,(PPDMDEVINS pDevIns));
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * Gets the address of the R0 APIC helpers.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * This should be called at both construction and relocation time
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * to obtain the correct address of the R0 helpers.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @returns R0 pointer to the APIC helpers.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param pDevIns Device instance of the APIC.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync DECLR3CALLBACKMEMBER(PCPDMAPICHLPR0, pfnGetR0Helpers,(PPDMDEVINS pDevIns));
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync /** Just a safety precaution. */
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync/** Pointer to APIC helpers. */
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync/** Pointer to const APIC helpers. */
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsynctypedef R3PTRTYPE(const PDMAPICHLPR3 *) PCPDMAPICHLPR3;
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync/** Current PDMAPICHLP version number. */
3c6306a66deef467e3c13483dd6529e1e1c6b822vboxsync * I/O APIC registration structure.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsynctypedef struct PDMIOAPICREG
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync /** Struct version+magic number (PDM_IOAPICREG_VERSION). */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Set the an IRQ.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the I/O APIC.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param iIrq IRQ number to set.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param iLevel IRQ level. See the PDM_IRQ_LEVEL_* \#defines.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync DECLR3CALLBACKMEMBER(void, pfnSetIrqR3,(PPDMDEVINS pDevIns, int iIrq, int iLevel));
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync /** The name of the GC SetIrq entry point. */
ffb50166c9adb4ae583b914d405197035cf890advboxsync /** The name of the R0 SetIrq entry point. */
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync/** Pointer to an APIC registration structure. */
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync/** Current PDMAPICREG version number. */
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * IOAPIC RC helpers.
5050fc8de0b121eab1b738d7c1007cde4903284dvboxsync /** Structure version. PDM_IOAPICHLPRC_VERSION defines the current version. */
ffb50166c9adb4ae583b914d405197035cf890advboxsync * Private interface between the IOAPIC and APIC.
ffb50166c9adb4ae583b914d405197035cf890advboxsync * See comments about this hack on PDMAPICREG::pfnBusDeliverR3.
3c6306a66deef467e3c13483dd6529e1e1c6b822vboxsync * @returns The current TPR.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * @param pDevIns Device instance of the IOAPIC.
ffb50166c9adb4ae583b914d405197035cf890advboxsync * @param u8Dest See APIC implementation.
ffb50166c9adb4ae583b914d405197035cf890advboxsync * @param u8DestMode See APIC implementation.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param u8DeliveryMode See APIC implementation.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param iVector See APIC implementation.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param u8Polarity See APIC implementation.
f75c6db919d277952ca03b7acf643e5e3ac96cafvboxsync * @param u8TriggerMode See APIC implementation.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync DECLRCCALLBACKMEMBER(void, pfnApicBusDeliver,(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync uint8_t iVector, uint8_t u8Polarity, uint8_t u8TriggerMode));
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * Acquires the PDM lock.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @returns VINF_SUCCESS on success.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @returns rc if we failed to acquire the lock.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param pDevIns The IOAPIC device instance.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param rc What to return if we fail to acquire the lock.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync DECLRCCALLBACKMEMBER(int, pfnLock,(PPDMDEVINS pDevIns, int rc));
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * Releases the PDM lock.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param pDevIns The IOAPIC device instance.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync DECLRCCALLBACKMEMBER(void, pfnUnlock,(PPDMDEVINS pDevIns));
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync /** Just a safety precaution. */
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync/** Pointer to IOAPIC RC helpers. */
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsynctypedef RCPTRTYPE(PDMIOAPICHLPRC *) PPDMIOAPICHLPRC;
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync/** Pointer to const IOAPIC helpers. */
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsynctypedef RCPTRTYPE(const PDMIOAPICHLPRC *) PCPDMIOAPICHLPRC;
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync/** Current PDMIOAPICHLPRC version number. */
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * IOAPIC R0 helpers.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync /** Structure version. PDM_IOAPICHLPR0_VERSION defines the current version. */
ffb50166c9adb4ae583b914d405197035cf890advboxsync * Private interface between the IOAPIC and APIC.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * See comments about this hack on PDMAPICREG::pfnBusDeliverR3.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @returns The current TPR.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param pDevIns Device instance of the IOAPIC.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param u8Dest See APIC implementation.
ffb50166c9adb4ae583b914d405197035cf890advboxsync * @param u8DestMode See APIC implementation.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param u8DeliveryMode See APIC implementation.
b4d7b4dbcc45b8bde7502aa129440d92d7ffd038vboxsync * @param iVector See APIC implementation.
b4d7b4dbcc45b8bde7502aa129440d92d7ffd038vboxsync * @param u8Polarity See APIC implementation.
b4d7b4dbcc45b8bde7502aa129440d92d7ffd038vboxsync * @param u8TriggerMode See APIC implementation.
ffb50166c9adb4ae583b914d405197035cf890advboxsync DECLR0CALLBACKMEMBER(void, pfnApicBusDeliver,(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
ffb50166c9adb4ae583b914d405197035cf890advboxsync uint8_t iVector, uint8_t u8Polarity, uint8_t u8TriggerMode));
ffb50166c9adb4ae583b914d405197035cf890advboxsync * Acquires the PDM lock.
ffb50166c9adb4ae583b914d405197035cf890advboxsync * @returns VINF_SUCCESS on success.
ffb50166c9adb4ae583b914d405197035cf890advboxsync * @returns rc if we failed to acquire the lock.
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync * @param pDevIns The IOAPIC device instance.
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync * @param rc What to return if we fail to acquire the lock.
2e4df4fd9eace3c61be68bb5eb12a93f9a79334dvboxsync DECLR0CALLBACKMEMBER(int, pfnLock,(PPDMDEVINS pDevIns, int rc));
ffb50166c9adb4ae583b914d405197035cf890advboxsync * Releases the PDM lock.
ffb50166c9adb4ae583b914d405197035cf890advboxsync * @param pDevIns The IOAPIC device instance.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync DECLR0CALLBACKMEMBER(void, pfnUnlock,(PPDMDEVINS pDevIns));
ffb50166c9adb4ae583b914d405197035cf890advboxsync /** Just a safety precaution. */
ffb50166c9adb4ae583b914d405197035cf890advboxsync/** Pointer to IOAPIC R0 helpers. */
ffb50166c9adb4ae583b914d405197035cf890advboxsynctypedef R0PTRTYPE(PDMIOAPICHLPR0 *) PPDMIOAPICHLPR0;
ffb50166c9adb4ae583b914d405197035cf890advboxsync/** Pointer to const IOAPIC helpers. */
ffb50166c9adb4ae583b914d405197035cf890advboxsynctypedef R0PTRTYPE(const PDMIOAPICHLPR0 *) PCPDMIOAPICHLPR0;
3c6306a66deef467e3c13483dd6529e1e1c6b822vboxsync/** Current PDMIOAPICHLPR0 version number. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * IOAPIC R3 helpers.
ffb50166c9adb4ae583b914d405197035cf890advboxsync /** Structure version. PDM_IOAPICHLPR3_VERSION defines the current version. */
ffb50166c9adb4ae583b914d405197035cf890advboxsync * Private interface between the IOAPIC and APIC.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * See comments about this hack on PDMAPICREG::pfnBusDeliverR3.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * @returns The current TPR.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param pDevIns Device instance of the IOAPIC.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * @param u8Dest See APIC implementation.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param u8DestMode See APIC implementation.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param u8DeliveryMode See APIC implementation.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param iVector See APIC implementation.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param u8Polarity See APIC implementation.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * @param u8TriggerMode See APIC implementation.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync DECLR3CALLBACKMEMBER(void, pfnApicBusDeliver,(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync uint8_t iVector, uint8_t u8Polarity, uint8_t u8TriggerMode));
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * Acquires the PDM lock.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * @returns VINF_SUCCESS on success.
ffb50166c9adb4ae583b914d405197035cf890advboxsync * @returns Fatal error on failure.
ffb50166c9adb4ae583b914d405197035cf890advboxsync * @param pDevIns The IOAPIC device instance.
ffb50166c9adb4ae583b914d405197035cf890advboxsync * @param rc Dummy for making the interface identical to the GC and R0 versions.
ffb50166c9adb4ae583b914d405197035cf890advboxsync DECLR3CALLBACKMEMBER(int, pfnLock,(PPDMDEVINS pDevIns, int rc));
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * Releases the PDM lock.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns The IOAPIC device instance.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync DECLR3CALLBACKMEMBER(void, pfnUnlock,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Gets the address of the RC IOAPIC helpers.
ffb50166c9adb4ae583b914d405197035cf890advboxsync * This should be called at both construction and relocation time
ffb50166c9adb4ae583b914d405197035cf890advboxsync * to obtain the correct address of the RC helpers.
ffb50166c9adb4ae583b914d405197035cf890advboxsync * @returns RC pointer to the IOAPIC helpers.
ffb50166c9adb4ae583b914d405197035cf890advboxsync * @param pDevIns Device instance of the IOAPIC.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync DECLR3CALLBACKMEMBER(PCPDMIOAPICHLPRC, pfnGetRCHelpers,(PPDMDEVINS pDevIns));
ffb50166c9adb4ae583b914d405197035cf890advboxsync * Gets the address of the R0 IOAPIC helpers.
c89333d3e41e439ed9e74768000edc399d3e72e6vboxsync * This should be called at both construction and relocation time
ffb50166c9adb4ae583b914d405197035cf890advboxsync * to obtain the correct address of the R0 helpers.
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync * @returns R0 pointer to the IOAPIC helpers.
ffb50166c9adb4ae583b914d405197035cf890advboxsync * @param pDevIns Device instance of the IOAPIC.
ffb50166c9adb4ae583b914d405197035cf890advboxsync DECLR3CALLBACKMEMBER(PCPDMIOAPICHLPR0, pfnGetR0Helpers,(PPDMDEVINS pDevIns));
ffb50166c9adb4ae583b914d405197035cf890advboxsync /** Just a safety precaution. */
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync/** Pointer to IOAPIC R3 helpers. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsynctypedef R3PTRTYPE(PDMIOAPICHLPR3 *) PPDMIOAPICHLPR3;
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsync/** Pointer to const IOAPIC helpers. */
750df3fe104e01cadbc3d5bd20243055d283d4e5vboxsynctypedef R3PTRTYPE(const PDMIOAPICHLPR3 *) PCPDMIOAPICHLPR3;
ffb50166c9adb4ae583b914d405197035cf890advboxsync/** Current PDMIOAPICHLPR3 version number. */
6475559a7e0e52892efbab4fbdedc879f6866109vboxsync * DMA Transfer Handler.
6475559a7e0e52892efbab4fbdedc879f6866109vboxsync * @returns Number of bytes transferred.
6475559a7e0e52892efbab4fbdedc879f6866109vboxsync * @param pDevIns Device instance of the DMA.
6475559a7e0e52892efbab4fbdedc879f6866109vboxsync * @param pvUser User pointer.
6475559a7e0e52892efbab4fbdedc879f6866109vboxsync * @param uChannel Channel number.
6475559a7e0e52892efbab4fbdedc879f6866109vboxsync * @param off DMA position.
6475559a7e0e52892efbab4fbdedc879f6866109vboxsync * @param cb Block size.
6475559a7e0e52892efbab4fbdedc879f6866109vboxsynctypedef DECLCALLBACK(uint32_t) FNDMATRANSFERHANDLER(PPDMDEVINS pDevIns, void *pvUser, unsigned uChannel, uint32_t off, uint32_t cb);
6475559a7e0e52892efbab4fbdedc879f6866109vboxsync/** Pointer to a FNDMATRANSFERHANDLER(). */
ffb50166c9adb4ae583b914d405197035cf890advboxsynctypedef FNDMATRANSFERHANDLER *PFNDMATRANSFERHANDLER;
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync * DMA Controller registration structure.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsynctypedef struct PDMDMAREG
ffb50166c9adb4ae583b914d405197035cf890advboxsync /** Structure version number. PDM_DMACREG_VERSION defines the current version. */
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Execute pending transfers.
6475559a7e0e52892efbab4fbdedc879f6866109vboxsync * @returns A more work indiciator. I.e. 'true' if there is more to be done, and 'false' if all is done.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the DMAC.
462e60a19d02a99b2b1a5c08dff74bb0808d707cvboxsync DECLR3CALLBACKMEMBER(bool, pfnRun,(PPDMDEVINS pDevIns));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Register transfer function for DMA channel.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the DMAC.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param uChannel Channel number.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pfnTransferHandler Device specific transfer function.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pvUSer User pointer to be passed to the callback.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR3CALLBACKMEMBER(void, pfnRegister,(PPDMDEVINS pDevIns, unsigned uChannel, PFNDMATRANSFERHANDLER pfnTransferHandler, void *pvUser));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Read memory
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns Number of bytes read.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the DMAC.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pvBuffer Pointer to target buffer.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param off DMA position.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param cbBlock Block size.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync DECLR3CALLBACKMEMBER(uint32_t, pfnReadMemory,(PPDMDEVINS pDevIns, unsigned uChannel, void *pvBuffer, uint32_t off, uint32_t cbBlock));
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * Write memory
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @returns Number of bytes written.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pDevIns Device instance of the DMAC.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param pvBuffer Memory to write.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param off DMA position.
553a2f0d8ef91a6dad8de4eef206ff093af53a5dvboxsync * @param cbBlock Block size.
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 PDMDEVHLP
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));
DECLR3CALLBACKMEMBER(int, pfnROMRegister,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, bool fShadow, 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, bool fFatal, const char *pszErrorID, const char *pszFormat, ...));
DECLR3CALLBACKMEMBER(int, pfnVMSetRuntimeErrorV,(PPDMDEVINS pDevIns, bool fFatal, 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));
* @param enmVisibility Visibility type specifying whether unused statistics should be visible or not.
DECLR3CALLBACKMEMBER(void, pfnSTAMRegisterF,(PPDMDEVINS pDevIns, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility,
* @param enmVisibility Visibility type specifying whether unused statistics should be visible or not.
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(void, pfnPhysRead,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead));
DECLR3CALLBACKMEMBER(void, pfnPhysWrite,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite));
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, pfnPhysReserve,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTUINT cbRange, const char *pszDesc));
* @remark Do not use the mapping after you return to the caller! (it could get invalidated/changed)
DECLR3CALLBACKMEMBER(int, pfnObsoletePhys2HCVirt,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTUINT cbRange, PRTHCPTR ppvHC));
* @remark Do not use the mapping after you return to the caller! (it could get invalidated/changed)
DECLR3CALLBACKMEMBER(int, pfnObsoletePhysGCPtr2HCPtr,(PPDMDEVINS pDevIns, RTGCPTR GCPtr, PRTHCPTR pHCPtr));
DECLR3CALLBACKMEMBER(bool, pfnAssertVMLock,(PPDMDEVINS pDevIns, const char *pszFile, unsigned iLine, const char *pszFunction));
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));
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,
} PDMDEVHLP;
typedef struct PDMDEVHLPGC
DECLRCCALLBACKMEMBER(void, pfnPhysRead,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead));
DECLRCCALLBACKMEMBER(void, 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, bool fFatal, const char *pszErrorID, const char *pszFormat, ...));
DECLRCCALLBACKMEMBER(int, pfnVMSetRuntimeErrorV,(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list va));
DECLRCCALLBACKMEMBER(int, pfnPATMSetMMIOPatchInfo,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTGCPTR pCachedData));
} PDMDEVHLPGC;
typedef struct PDMDEVHLPR0
DECLR0CALLBACKMEMBER(void, pfnPhysRead,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead));
DECLR0CALLBACKMEMBER(void, 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, bool fFatal, const char *pszErrorID, const char *pszFormat, ...));
DECLR0CALLBACKMEMBER(int, pfnVMSetRuntimeErrorV,(PPDMDEVINS pDevIns, bool fFatal, 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->pDevHlp->pfnAssertEMT(pDevIns, __FILE__, __LINE__, __FUNCTION__)
#ifdef VBOX_STRICT
# define PDMDEV_ASSERT_OTHER(pDevIns) pDevIns->pDevHlp->pfnAssertOther(pDevIns, __FILE__, __LINE__, __FUNCTION__)
#ifdef VBOX_STRICT
# define PDMDEV_ASSERT_VMLOCK_OWNER(pDevIns) pDevIns->pDevHlp->pfnAssertVMLock(pDevIns, __FILE__, __LINE__, __FUNCTION__)
#define PDMDEVINS_2_RCPTR(pDevIns) ( (RCPTRTYPE(PPDMDEVINS))((RTGCUINTPTR)(pDevIns)->pvInstanceDataGC - 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->pDevHlp->pfnIOPortRegister(pDevIns, Port, cPorts, pvUser, pfnOut, pfnIn, pfnOutStr, pfnInStr, pszDesc);
DECLINLINE(int) PDMDevHlpIOPortRegisterGC(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTRCPTR pvUser,
return pDevIns->pDevHlp->pfnIOPortRegisterGC(pDevIns, Port, cPorts, pvUser, pszOut, pszIn, pszOutStr, pszInStr, pszDesc);
DECLINLINE(int) PDMDevHlpIOPortRegisterR0(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTR0PTR pvUser,
return pDevIns->pDevHlp->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->pDevHlp->pfnMMIORegister(pDevIns, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc);
DECLINLINE(int) PDMDevHlpMMIORegisterGC(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser,
return pDevIns->pDevHlp->pfnMMIORegisterGC(pDevIns, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
DECLINLINE(int) PDMDevHlpMMIORegisterR0(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
return pDevIns->pDevHlp->pfnMMIORegisterR0(pDevIns, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
DECLINLINE(int) PDMDevHlpROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, bool fShadow, const char *pszDesc)
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) 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)
DECLINLINE(void) PDMDevHlpPCISetConfigCallbacks(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PFNPCICONFIGREAD pfnRead, PPFNPCICONFIGREAD ppfnReadOld,
pDevIns->pDevHlp->pfnPCISetConfigCallbacks(pDevIns, pPciDev, pfnRead, ppfnReadOld, pfnWrite, ppfnWriteOld);
DECLINLINE(int) PDMDevHlpDriverAttach(PPDMDEVINS pDevIns, RTUINT iLun, PPDMIBASE pBaseInterface, PPDMIBASE *ppBaseInterface, const char *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->pDevHlp->pfnSTAMRegisterV(pDevIns, pvSample, enmType, enmVisibility, enmUnit, pszDesc, pszName, va);
DECLINLINE(int) PDMDevHlpPDMQueueCreate(PPDMDEVINS pDevIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
return pDevIns->pDevHlp->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) PDMDevHlpPhysReserve(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTUINT cbRange, const char *pszDesc)
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)
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->pDevHlp->pfnPDMThreadCreate(pDevIns, ppThread, pvUser, pfnThread, pfnWakeup, cbStack, enmType, pszName);
#ifdef IN_GC
#ifdef IN_GC
#ifdef IN_GC
#ifdef IN_GC
#ifdef IN_GC
DECLINLINE(void) PDMDevHlpPhysWrite(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite)
#ifdef IN_GC
#ifdef IN_GC
DECLINLINE(int) PDMDevHlpVMSetError(PPDMDEVINS pDevIns, const int rc, RT_SRC_POS_DECL, const char *pszFormat, ...)
#ifdef IN_GC
return rc;
DECLINLINE(int) PDMDevHlpVMSetRuntimeError(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...)
int rc;
#ifdef IN_GC
return rc;
typedef struct PDMDEVREGCB
} PDMDEVREGCB;