pdmapi.h revision 675f16ba1814ff54bdf00391a6d126a25963f88a
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * PDM - Pluggable Device Manager, Core API.
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * The 'Core API' has been put in a different header because everyone
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * is currently including pdm.h. So, pdm.h is for including all of the
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * PDM stuff, while pdmapi.h is for the core stuff.
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * available from http://www.virtualbox.org. This file is free software;
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * you can redistribute it and/or modify it under the terms of the GNU
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * General Public License (GPL) as published by the Free Software
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * The contents of this file may alternatively be used under the terms
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * of the Common Development and Distribution License Version 1.0
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * VirtualBox OSE distribution, in which case the provisions of the
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * CDDL are applicable instead of those of the GPL.
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * You may elect to license modified versions of this file under the
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * terms and conditions of either the GPL or the CDDL or both.
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * additional information or have any questions.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync/** @defgroup grp_pdm The Pluggable Device Manager API
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * Gets the pending interrupt.
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * @returns VBox status code.
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * @param pVM VM handle.
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * @param pu8Interrupt Where to store the interrupt on success.
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsyncPDMDECL(int) PDMGetInterrupt(PVM pVM, uint8_t *pu8Interrupt);
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * Sets the pending ISA interrupt.
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * @returns VBox status code.
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * @param pVM VM handle.
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * @param u8Irq The IRQ line.
3609dfc9f2733f4dc836c6a6bb3745398f280fcevboxsync * @param u8Level The new level. See the PDM_IRQ_LEVEL_* \#defines.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsyncPDMDECL(int) PDMIsaSetIrq(PVM pVM, uint8_t u8Irq, uint8_t u8Level);
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * Sets the pending I/O APIC interrupt.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @returns VBox status code.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @param pVM VM handle.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @param u8Irq The IRQ line.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @param u8Level The new level. See the PDM_IRQ_LEVEL_* \#defines.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsyncPDMDECL(int) PDMIoApicSetIrq(PVM pVM, uint8_t u8Irq, uint8_t u8Level);
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * Check if the APIC has a pending interrupt/if a TPR change would active one
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @returns Pending interrupt yes/no
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @param pDevIns Device instance of the APIC.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @param pfPending Pending state (out)
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsyncPDMDECL(int) PDMApicHasPendingIrq(PVM pVM, bool *pfPending);
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * Set the APIC base.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @returns VBox status code.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @param pVM VM handle.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @param u64Base The new base.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsyncPDMDECL(int) PDMApicSetBase(PVM pVM, uint64_t u64Base);
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * Get the APIC base.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @returns VBox status code.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @param pVM VM handle.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @param pu64Base Where to store the APIC base.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsyncPDMDECL(int) PDMApicGetBase(PVM pVM, uint64_t *pu64Base);
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * Set the TPR (task priority register?).
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @returns VBox status code.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @param pVM VM handle.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @param u8TPR The new TPR.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * Get the TPR (task priority register?).
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @returns The current TPR.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @param pVM VM handle.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @param pu8TPR Where to store the TRP.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsyncPDMDECL(int) PDMApicGetTPR(PVM pVM, uint8_t *pu8TPR);
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync/** @defgroup grp_pdm_r3 The PDM Host Context Ring-3 API
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @ingroup grp_pdm
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * Initializes the PDM.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @returns VBox status code.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @param pVM The VM to operate on.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * This function will notify all the devices and their
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * attached drivers about the VM now being powered on.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * @param pVM VM Handle.
611910c4ba57eb6db5c0d508ca7b923efd654aecvboxsync * This function will notify all the devices and their
PDMR3DECL(int) PDMR3GetSymbolR3(PVM pVM, const char *pszModule, const char *pszSymbol, void **ppvValue);
PDMR3DECL(int) PDMR3GetSymbolR0(PVM pVM, const char *pszModule, const char *pszSymbol, PRTR0PTR ppvValue);
PDMR3DECL(int) PDMR3GetSymbolR0Lazy(PVM pVM, const char *pszModule, const char *pszSymbol, PRTR0PTR ppvValue);
PDMR3DECL(int) PDMR3GetSymbolGC(PVM pVM, const char *pszModule, const char *pszSymbol, PRTGCPTR32 pGCPtrValue);
PDMR3DECL(int) PDMR3GetSymbolGCLazy(PVM pVM, const char *pszModule, const char *pszSymbol, PRTGCPTR32 pGCPtrValue);
typedef DECLCALLBACK(int) FNPDMR3ENUM(PVM pVM, const char *pszFilename, const char *pszName, RTUINTPTR ImageBase, size_t cbImage, bool fGC);
PDMR3DECL(int) PDMR3QueryDevice(PVM pVM, const char *pszDevice, unsigned iInstance, PPPDMIBASE ppBase);
PDMR3DECL(int) PDMR3QueryDeviceLun(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPPDMIBASE ppBase);
PDMR3DECL(int) PDMR3QueryLun(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPPDMIBASE ppBase);
PDMR3DECL(int) PDMR3DeviceAttach(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPPDMIBASE ppBase);
PDMR3DECL(int) PDMR3DeviceDetach(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun);
#ifdef IN_GC