pdmapi.h revision c1d279fc0865b91a40b30eda02ed14f6533fe1a4
/** @file
* PDM - Pluggable Device Manager, Core API.
*
* The 'Core API' has been put in a different header because everyone
* PDM stuff, while pdmapi.h is for the core stuff.
*/
/*
* Copyright (C) 2006-2015 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
#ifndef ___VBox_vmm_pdmapi_h
#define ___VBox_vmm_pdmapi_h
/** @defgroup grp_pdm The Pluggable Device Manager API
* @{
*/
/** @defgroup grp_pdm_r3 The PDM Host Context Ring-3 API
* @{
*/
/** PDM loader context indicator. */
typedef enum PDMLDRCTX
{
/** Invalid zero value. */
PDMLDRCTX_INVALID = 0,
/** Ring-0 context. */
/** Ring-3 context. */
/** Raw-mode context. */
/** End of valid context values. */
/** 32-bit type hack. */
PDMLDRCTX_32BIT_HACK = 0x7fffffff
} PDMLDRCTX;
/**
* Module enumeration callback function.
*
* @returns VBox status.
* Failure will stop the search and return the return code.
* Warnings will be ignored and not returned.
* @param pVM VM Handle.
* @param pszFilename Module filename.
* @param pszName Module name. (short and unique)
* @param ImageBase Address where to executable image is loaded.
* @param cbImage Size of the executable image.
* @param enmCtx The context the module is loaded into.
* @param pvArg User argument.
*/
/** Pointer to a FNPDMR3ENUM() function. */
typedef FNPDMR3ENUM *PFNPDMR3ENUM;
VMMR3_INT_DECL(int) PDMR3LdrGetSymbolR3(PVM pVM, const char *pszModule, const char *pszSymbol, void **ppvValue);
VMMR3DECL(int) PDMR3LdrGetSymbolR0(PVM pVM, const char *pszModule, const char *pszSymbol, PRTR0PTR ppvValue);
VMMR3DECL(int) PDMR3LdrGetSymbolR0Lazy(PVM pVM, const char *pszModule, const char *pszSearchPath, const char *pszSymbol, PRTR0PTR ppvValue);
VMMR3DECL(int) PDMR3LdrGetSymbolRC(PVM pVM, const char *pszModule, const char *pszSymbol, PRTRCPTR pRCPtrValue);
VMMR3DECL(int) PDMR3LdrGetSymbolRCLazy(PVM pVM, const char *pszModule, const char *pszSearchPath, const char *pszSymbol,
const char *pszModule, const char *pszSearchPath,
const char *pszSymPrefix, const char *pszSymList,
bool fRing0OrRC);
VMMR3DECL(int) PDMR3QueryDevice(PUVM pUVM, const char *pszDevice, unsigned iInstance, PPPDMIBASE ppBase);
VMMR3DECL(int) PDMR3QueryDeviceLun(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPPDMIBASE ppBase);
VMMR3DECL(int) PDMR3QueryLun(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPPDMIBASE ppBase);
VMMR3DECL(int) PDMR3QueryDriverOnLun(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun,
VMMR3DECL(int) PDMR3DeviceAttach(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, uint32_t fFlags,
VMMR3DECL(int) PDMR3DeviceDetach(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, uint32_t fFlags);
VMMR3DECL(int) PDMR3DriverAttach(PUVM pUVM, const char *pszDevice, unsigned iDevIns, unsigned iLun, uint32_t fFlags,
VMMR3DECL(int) PDMR3DriverReattach(PUVM pVM, const char *pszDevice, unsigned iDevIns, unsigned iLun,
VMMR3_INT_DECL(int) PDMR3VmmDevHeapRegister(PVM pVM, RTGCPHYS GCPhys, RTR3PTR pvHeap, unsigned cbSize);
VMMR3_INT_DECL(int) PDMR3TracingConfig(PVM pVM, const char *pszName, size_t cchName, bool fEnable, bool fApply);
/** @} */
/** @defgroup grp_pdm_rc The PDM Raw-Mode Context API
* @{
*/
/** @} */
/** @defgroup grp_pdm_r0 The PDM Ring-0 Context API
* @{
*/
/**
* Request buffer for PDMR0DriverCallReqHandler / VMMR0_DO_PDM_DRIVER_CALL_REQ_HANDLER.
* @see PDMR0DriverCallReqHandler.
*/
typedef struct PDMDRIVERCALLREQHANDLERREQ
{
/** The header. */
/** The driver instance. */
/** The operation. */
/** Explicit alignment padding. */
/** Optional 64-bit integer argument. */
/** Pointer to a PDMR0DriverCallReqHandler / VMMR0_DO_PDM_DRIVER_CALL_REQ_HANDLER
* request buffer. */
/**
* Request buffer for PDMR0DeviceCallReqHandler / VMMR0_DO_PDM_DEVICE_CALL_REQ_HANDLER.
* @see PDMR0DeviceCallReqHandler.
*/
typedef struct PDMDEVICECALLREQHANDLERREQ
{
/** The header. */
/** The device instance. */
/** The request handler for the device. */
/** The operation. */
/** Explicit alignment padding. */
/** Optional 64-bit integer argument. */
/** Pointer to a PDMR0DeviceCallReqHandler /
* VMMR0_DO_PDM_DEVICE_CALL_REQ_HANDLER request buffer. */
/** @} */
/** @} */
#endif