pdmapi.h revision 7b913e0458e6ba9d92338354a08af5082ba3b217
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/** @file
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * PDM - Pluggable Device Manager, Core API.
5b281ba489ca18f0380d7efc7a5108b606cce449vboxsync *
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * The 'Core API' has been put in a different header because everyone
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * is currently including pdm.h. So, pdm.h is for including all of the
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * PDM stuff, while pdmapi.h is for the core stuff.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/*
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync *
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * available from http://www.virtualbox.org. This file is free software;
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * you can redistribute it and/or modify it under the terms of the GNU
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * General Public License (GPL) as published by the Free Software
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync *
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * The contents of this file may alternatively be used under the terms
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * of the Common Development and Distribution License Version 1.0
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * VirtualBox OSE distribution, in which case the provisions of the
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * CDDL are applicable instead of those of the GPL.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync *
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * You may elect to license modified versions of this file under the
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * terms and conditions of either the GPL or the CDDL or both.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync *
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * additional information or have any questions.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#ifndef ___VBox_pdmapi_h
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#define ___VBox_pdmapi_h
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync#include <VBox/types.h>
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync__BEGIN_DECLS
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/** @defgroup grp_pdm The Pluggable Device Manager API
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * @{
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMDECL(int) PDMGetInterrupt(PVMCPU pVCpu, uint8_t *pu8Interrupt);
c889bbab784ba8552102ce776b6c67b982017861vboxsyncVMMDECL(int) PDMIsaSetIrq(PVM pVM, uint8_t u8Irq, uint8_t u8Level);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMDECL(int) PDMIoApicSetIrq(PVM pVM, uint8_t u8Irq, uint8_t u8Level);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMDECL(bool) PDMHasIoApic(PVM pVM);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMDECL(int) PDMApicHasPendingIrq(PVM pVM, bool *pfPending);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMDECL(int) PDMApicSetBase(PVM pVM, uint64_t u64Base);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMDECL(int) PDMApicGetBase(PVM pVM, uint64_t *pu64Base);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMDECL(int) PDMApicSetTPR(PVM pVM, uint8_t u8TPR);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMDECL(int) PDMApicGetTPR(PVM pVM, uint8_t *pu8TPR, bool *pfPending);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMDECL(int) PDMApicWriteMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMDECL(int) PDMApicReadMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMDECL(int) PDMVMMDevHeapR3ToGCPhys(PVM pVM, RTR3PTR pv, RTGCPHYS *pGCPhys);
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync#ifdef IN_RING3
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync/** @defgroup grp_pdm_r3 The PDM Host Context Ring-3 API
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * @ingroup grp_pdm
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * @{
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync */
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMR3DECL(int) PDMR3InitUVM(PUVM pUVM);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMR3DECL(int) PDMR3LdrLoadVMMR0U(PUVM pUVM);
5b281ba489ca18f0380d7efc7a5108b606cce449vboxsyncVMMR3DECL(int) PDMR3Init(PVM pVM);
ee6e48c229ef52aee5e968d956ebd066073811abvboxsyncVMMR3DECL(void) PDMR3PowerOn(PVM pVM);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMR3DECL(void) PDMR3Reset(PVM pVM);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMR3DECL(void) PDMR3Suspend(PVM pVM);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMR3DECL(void) PDMR3Resume(PVM pVM);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMR3DECL(void) PDMR3PowerOff(PVM pVM);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMR3DECL(void) PDMR3Relocate(PVM pVM, RTGCINTPTR offDelta);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMR3DECL(int) PDMR3Term(PVM pVM);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMR3DECL(void) PDMR3TermUVM(PUVM pUVM);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync/**
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * Module enumeration callback function.
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync *
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync * @returns VBox status.
ee6e48c229ef52aee5e968d956ebd066073811abvboxsync * Failure will stop the search and return the return code.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * Warnings will be ignored and not returned.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * @param pVM VM Handle.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * @param pszFilename Module filename.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * @param pszName Module name. (short and unique)
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync * @param ImageBase Address where to executable image is loaded.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * @param cbImage Size of the executable image.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * @param fRC Set if raw-mode context, clear if host context.
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync * @param pvArg User argument.
ee6e48c229ef52aee5e968d956ebd066073811abvboxsync */
ee6e48c229ef52aee5e968d956ebd066073811abvboxsynctypedef DECLCALLBACK(int) FNPDMR3ENUM(PVM pVM, const char *pszFilename, const char *pszName, RTUINTPTR ImageBase, size_t cbImage, bool fRC, void *pvArg);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/** Pointer to a FNPDMR3ENUM() function. */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsynctypedef FNPDMR3ENUM *PFNPDMR3ENUM;
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsyncVMMR3DECL(int) PDMR3LdrEnumModules(PVM pVM, PFNPDMR3ENUM pfnCallback, void *pvArg);
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsyncVMMR3DECL(void) PDMR3LdrRelocateU(PUVM pUVM, RTGCINTPTR offDelta);
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsyncVMMR3DECL(int) PDMR3LdrGetSymbolR3(PVM pVM, const char *pszModule, const char *pszSymbol, void **ppvValue);
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsyncVMMR3DECL(int) PDMR3LdrGetSymbolR0(PVM pVM, const char *pszModule, const char *pszSymbol, PRTR0PTR ppvValue);
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsyncVMMR3DECL(int) PDMR3LdrGetSymbolR0Lazy(PVM pVM, const char *pszModule, const char *pszSymbol, PRTR0PTR ppvValue);
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsyncVMMR3DECL(int) PDMR3LdrLoadRC(PVM pVM, const char *pszFilename, const char *pszName);
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsyncVMMR3DECL(int) PDMR3LdrGetSymbolRC(PVM pVM, const char *pszModule, const char *pszSymbol, PRTRCPTR pRCPtrValue);
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsyncVMMR3DECL(int) PDMR3LdrGetSymbolRCLazy(PVM pVM, const char *pszModule, const char *pszSymbol, PRTRCPTR pRCPtrValue);
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsyncVMMR3DECL(int) PDMR3LdrQueryRCModFromPC(PVM pVM, RTRCPTR uPC,
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync char *pszModName, size_t cchModName, PRTRCPTR pMod,
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync char *pszNearSym1, size_t cchNearSym1, PRTRCPTR pNearSym1,
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync char *pszNearSym2, size_t cchNearSym2, PRTRCPTR pNearSym2);
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsyncVMMR3DECL(int) PDMR3QueryDevice(PVM pVM, const char *pszDevice, unsigned iInstance, PPPDMIBASE ppBase);
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsyncVMMR3DECL(int) PDMR3QueryDeviceLun(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPPDMIBASE ppBase);
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsyncVMMR3DECL(int) PDMR3QueryLun(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPPDMIBASE ppBase);
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsyncVMMR3DECL(int) PDMR3DeviceAttach(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPPDMIBASE ppBase);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMR3DECL(int) PDMR3DeviceDetach(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMR3DECL(void) PDMR3DmaRun(PVM pVM);
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsyncVMMR3DECL(int) PDMR3LockCall(PVM pVM);
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsyncVMMR3DECL(int) PDMR3RegisterVMMDevHeap(PVM pVM, RTGCPHYS GCPhys, RTR3PTR pvHeap, unsigned cbSize);
445661c86e95894713da707c6c9787b7507dfce6vboxsyncVMMR3DECL(int) PDMR3VMMDevHeapAlloc(PVM pVM, unsigned cbSize, RTR3PTR *ppv);
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsyncVMMR3DECL(int) PDMR3VMMDevHeapFree(PVM pVM, RTR3PTR pv);
445661c86e95894713da707c6c9787b7507dfce6vboxsyncVMMR3DECL(int) PDMR3UnregisterVMMDevHeap(PVM pVM, RTGCPHYS GCPhys);
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
445661c86e95894713da707c6c9787b7507dfce6vboxsyncVMMR3DECL(void) PDMR3ReleaseOwnedLocks(PVM pVM);
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync/** @} */
445661c86e95894713da707c6c9787b7507dfce6vboxsync#endif
445661c86e95894713da707c6c9787b7507dfce6vboxsync
445661c86e95894713da707c6c9787b7507dfce6vboxsync
445661c86e95894713da707c6c9787b7507dfce6vboxsync#ifdef IN_RC
445661c86e95894713da707c6c9787b7507dfce6vboxsync/** @defgroup grp_pdm_gc The PDM Guest Context API
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync * @ingroup grp_pdm
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync * @{
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync */
445661c86e95894713da707c6c9787b7507dfce6vboxsync/** @} */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync#endif
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync__END_DECLS
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync
833f83ce101b6e9168f519decc0dc7a1079d35f7vboxsync/** @} */
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync#endif
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync
d60d5da33bb93fc7a8717802f21b13aa37914799vboxsync