VirtualBox

source: vbox/trunk/include/VBox/vmm/pdmapi.h@ 46512

Last change on this file since 46512 was 45965, checked in by vboxsync, 12 years ago

VMM: Facility for getting the highest-priority pending interrupt from the APIC device.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 10.5 KB
Line 
1/** @file
2 * PDM - Pluggable Device Manager, Core API.
3 *
4 * The 'Core API' has been put in a different header because everyone
5 * is currently including pdm.h. So, pdm.h is for including all of the
6 * PDM stuff, while pdmapi.h is for the core stuff.
7 */
8
9/*
10 * Copyright (C) 2006-2013 Oracle Corporation
11 *
12 * This file is part of VirtualBox Open Source Edition (OSE), as
13 * available from http://www.virtualbox.org. This file is free software;
14 * you can redistribute it and/or modify it under the terms of the GNU
15 * General Public License (GPL) as published by the Free Software
16 * Foundation, in version 2 as it comes in the "COPYING" file of the
17 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
18 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
19 *
20 * The contents of this file may alternatively be used under the terms
21 * of the Common Development and Distribution License Version 1.0
22 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
23 * VirtualBox OSE distribution, in which case the provisions of the
24 * CDDL are applicable instead of those of the GPL.
25 *
26 * You may elect to license modified versions of this file under the
27 * terms and conditions of either the GPL or the CDDL or both.
28 */
29
30#ifndef ___VBox_vmm_pdmapi_h
31#define ___VBox_vmm_pdmapi_h
32
33#include <VBox/vmm/pdmcommon.h>
34#include <VBox/sup.h>
35
36
37RT_C_DECLS_BEGIN
38
39/** @defgroup grp_pdm The Pluggable Device Manager API
40 * @{
41 */
42
43VMMDECL(int) PDMGetInterrupt(PVMCPU pVCpu, uint8_t *pu8Interrupt);
44VMMDECL(int) PDMIsaSetIrq(PVM pVM, uint8_t u8Irq, uint8_t u8Level, uint32_t uTagSrc);
45VMM_INT_DECL(int) PDMIoApicSetIrq(PVM pVM, uint8_t u8Irq, uint8_t u8Level, uint32_t uTagSrc);
46VMM_INT_DECL(int) PDMIoApicSendMsi(PVM pVM, RTGCPHYS GCAddr, uint32_t uValue, uint32_t uTagSrc);
47VMM_INT_DECL(bool) PDMHasIoApic(PVM pVM);
48VMM_INT_DECL(int) PDMApicHasPendingIrq(PVM pVM, bool *pfPending);
49VMMDECL(int) PDMApicSetBase(PVMCPU pVCpu, uint64_t u64Base);
50VMMDECL(int) PDMApicGetBase(PVMCPU pVCpu, uint64_t *pu64Base);
51VMMDECL(int) PDMApicSetTPR(PVMCPU pVCpu, uint8_t u8TPR);
52VMMDECL(int) PDMApicGetTPR(PVMCPU pVCpu, uint8_t *pu8TPR, bool *pfPending, uint8_t *pu8PendingIrq);
53VMM_INT_DECL(int) PDMApicWriteMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value);
54VMM_INT_DECL(int) PDMApicReadMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value);
55VMM_INT_DECL(int) PDMVmmDevHeapR3ToGCPhys(PVM pVM, RTR3PTR pv, RTGCPHYS *pGCPhys);
56VMM_INT_DECL(bool) PDMVmmDevHeapIsEnabled(PVM pVM);
57
58
59/** @defgroup grp_pdm_r3 The PDM Host Context Ring-3 API
60 * @ingroup grp_pdm
61 * @{
62 */
63
64VMMR3_INT_DECL(int) PDMR3InitUVM(PUVM pUVM);
65VMMR3_INT_DECL(int) PDMR3LdrLoadVMMR0U(PUVM pUVM);
66VMMR3_INT_DECL(int) PDMR3Init(PVM pVM);
67VMMR3DECL(void) PDMR3PowerOn(PVM pVM);
68VMMR3_INT_DECL(void) PDMR3ResetCpu(PVMCPU pVCpu);
69VMMR3_INT_DECL(void) PDMR3Reset(PVM pVM);
70VMMR3_INT_DECL(void) PDMR3MemSetup(PVM pVM, bool fAtReset);
71VMMR3_INT_DECL(void) PDMR3Suspend(PVM pVM);
72VMMR3_INT_DECL(void) PDMR3Resume(PVM pVM);
73VMMR3DECL(void) PDMR3PowerOff(PVM pVM);
74VMMR3_INT_DECL(void) PDMR3Relocate(PVM pVM, RTGCINTPTR offDelta);
75VMMR3_INT_DECL(int) PDMR3Term(PVM pVM);
76VMMR3_INT_DECL(void) PDMR3TermUVM(PUVM pUVM);
77
78/**
79 * Module enumeration callback function.
80 *
81 * @returns VBox status.
82 * Failure will stop the search and return the return code.
83 * Warnings will be ignored and not returned.
84 * @param pVM VM Handle.
85 * @param pszFilename Module filename.
86 * @param pszName Module name. (short and unique)
87 * @param ImageBase Address where to executable image is loaded.
88 * @param cbImage Size of the executable image.
89 * @param fRC Set if raw-mode context, clear if host context.
90 * @param pvArg User argument.
91 */
92typedef DECLCALLBACK(int) FNPDMR3ENUM(PVM pVM, const char *pszFilename, const char *pszName,
93 RTUINTPTR ImageBase, size_t cbImage, bool fRC, void *pvArg);
94/** Pointer to a FNPDMR3ENUM() function. */
95typedef FNPDMR3ENUM *PFNPDMR3ENUM;
96VMMR3DECL(int) PDMR3LdrEnumModules(PVM pVM, PFNPDMR3ENUM pfnCallback, void *pvArg);
97VMMR3_INT_DECL(void) PDMR3LdrRelocateU(PUVM pUVM, RTGCINTPTR offDelta);
98VMMR3_INT_DECL(int) PDMR3LdrGetSymbolR3(PVM pVM, const char *pszModule, const char *pszSymbol, void **ppvValue);
99VMMR3DECL(int) PDMR3LdrGetSymbolR0(PVM pVM, const char *pszModule, const char *pszSymbol, PRTR0PTR ppvValue);
100VMMR3DECL(int) PDMR3LdrGetSymbolR0Lazy(PVM pVM, const char *pszModule, const char *pszSearchPath, const char *pszSymbol, PRTR0PTR ppvValue);
101VMMR3DECL(int) PDMR3LdrLoadRC(PVM pVM, const char *pszFilename, const char *pszName);
102VMMR3DECL(int) PDMR3LdrGetSymbolRC(PVM pVM, const char *pszModule, const char *pszSymbol, PRTRCPTR pRCPtrValue);
103VMMR3DECL(int) PDMR3LdrGetSymbolRCLazy(PVM pVM, const char *pszModule, const char *pszSearchPath, const char *pszSymbol,
104 PRTRCPTR pRCPtrValue);
105VMMR3_INT_DECL(int) PDMR3LdrQueryRCModFromPC(PVM pVM, RTRCPTR uPC,
106 char *pszModName, size_t cchModName, PRTRCPTR pMod,
107 char *pszNearSym1, size_t cchNearSym1, PRTRCPTR pNearSym1,
108 char *pszNearSym2, size_t cchNearSym2, PRTRCPTR pNearSym2);
109VMMR3_INT_DECL(int) PDMR3LdrQueryR0ModFromPC(PVM pVM, RTR0PTR uPC,
110 char *pszModName, size_t cchModName, PRTR0PTR pMod,
111 char *pszNearSym1, size_t cchNearSym1, PRTR0PTR pNearSym1,
112 char *pszNearSym2, size_t cchNearSym2, PRTR0PTR pNearSym2);
113VMMR3_INT_DECL(int) PDMR3LdrGetInterfaceSymbols(PVM pVM, void *pvInterface, size_t cbInterface,
114 const char *pszModule, const char *pszSearchPath,
115 const char *pszSymPrefix, const char *pszSymList,
116 bool fRing0OrRC);
117
118VMMR3DECL(int) PDMR3QueryDevice(PUVM pUVM, const char *pszDevice, unsigned iInstance, PPPDMIBASE ppBase);
119VMMR3DECL(int) PDMR3QueryDeviceLun(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPPDMIBASE ppBase);
120VMMR3DECL(int) PDMR3QueryLun(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPPDMIBASE ppBase);
121VMMR3DECL(int) PDMR3QueryDriverOnLun(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun,
122 const char *pszDriver, PPPDMIBASE ppBase);
123VMMR3DECL(int) PDMR3DeviceAttach(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, uint32_t fFlags,
124 PPDMIBASE *ppBase);
125VMMR3DECL(int) PDMR3DeviceDetach(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, uint32_t fFlags);
126VMMR3_INT_DECL(PPDMCRITSECT) PDMR3DevGetCritSect(PVM pVM, PPDMDEVINS pDevIns);
127VMMR3DECL(int) PDMR3DriverAttach(PUVM pUVM, const char *pszDevice, unsigned iDevIns, unsigned iLun, uint32_t fFlags,
128 PPPDMIBASE ppBase);
129VMMR3DECL(int) PDMR3DriverDetach(PUVM pUVM, const char *pszDevice, unsigned iDevIns, unsigned iLun,
130 const char *pszDriver, unsigned iOccurance, uint32_t fFlags);
131VMMR3DECL(int) PDMR3DriverReattach(PUVM pVM, const char *pszDevice, unsigned iDevIns, unsigned iLun,
132 const char *pszDriver, unsigned iOccurance, uint32_t fFlags, PCFGMNODE pCfg,
133 PPPDMIBASE ppBase);
134VMMR3DECL(void) PDMR3DmaRun(PVM pVM);
135VMMR3_INT_DECL(int) PDMR3LockCall(PVM pVM);
136VMMR3_INT_DECL(int) PDMR3VmmDevHeapRegister(PVM pVM, RTGCPHYS GCPhys, RTR3PTR pvHeap, unsigned cbSize);
137VMMR3_INT_DECL(int) PDMR3VmmDevHeapUnregister(PVM pVM, RTGCPHYS GCPhys);
138VMMR3_INT_DECL(int) PDMR3VmmDevHeapAlloc(PVM pVM, size_t cbSize, RTR3PTR *ppv);
139VMMR3_INT_DECL(int) PDMR3VmmDevHeapFree(PVM pVM, RTR3PTR pv);
140VMMR3_INT_DECL(int) PDMR3TracingConfig(PVM pVM, const char *pszName, size_t cchName, bool fEnable, bool fApply);
141VMMR3_INT_DECL(bool) PDMR3TracingAreAll(PVM pVM, bool fEnabled);
142VMMR3_INT_DECL(int) PDMR3TracingQueryConfig(PVM pVM, char *pszConfig, size_t cbConfig);
143/** @} */
144
145
146
147/** @defgroup grp_pdm_rc The PDM Raw-Mode Context API
148 * @ingroup grp_pdm
149 * @{
150 */
151/** @} */
152
153
154
155/** @defgroup grp_pdm_r0 The PDM Ring-0 Context API
156 * @ingroup grp_pdm
157 * @{
158 */
159
160/**
161 * Request buffer for PDMR0DriverCallReqHandler / VMMR0_DO_PDM_DRIVER_CALL_REQ_HANDLER.
162 * @see PDMR0DriverCallReqHandler.
163 */
164typedef struct PDMDRIVERCALLREQHANDLERREQ
165{
166 /** The header. */
167 SUPVMMR0REQHDR Hdr;
168 /** The driver instance. */
169 PPDMDRVINSR0 pDrvInsR0;
170 /** The operation. */
171 uint32_t uOperation;
172 /** Explicit alignment padding. */
173 uint32_t u32Alignment;
174 /** Optional 64-bit integer argument. */
175 uint64_t u64Arg;
176} PDMDRIVERCALLREQHANDLERREQ;
177/** Pointer to a PDMR0DriverCallReqHandler / VMMR0_DO_PDM_DRIVER_CALL_REQ_HANDLER
178 * request buffer. */
179typedef PDMDRIVERCALLREQHANDLERREQ *PPDMDRIVERCALLREQHANDLERREQ;
180
181VMMR0_INT_DECL(int) PDMR0DriverCallReqHandler(PVM pVM, PPDMDRIVERCALLREQHANDLERREQ pReq);
182
183/**
184 * Request buffer for PDMR0DeviceCallReqHandler / VMMR0_DO_PDM_DEVICE_CALL_REQ_HANDLER.
185 * @see PDMR0DeviceCallReqHandler.
186 */
187typedef struct PDMDEVICECALLREQHANDLERREQ
188{
189 /** The header. */
190 SUPVMMR0REQHDR Hdr;
191 /** The device instance. */
192 PPDMDEVINSR0 pDevInsR0;
193 /** The request handler for the device. */
194 PFNPDMDEVREQHANDLERR0 pfnReqHandlerR0;
195 /** The operation. */
196 uint32_t uOperation;
197 /** Explicit alignment padding. */
198 uint32_t u32Alignment;
199 /** Optional 64-bit integer argument. */
200 uint64_t u64Arg;
201} PDMDEVICECALLREQHANDLERREQ;
202/** Pointer to a PDMR0DeviceCallReqHandler /
203 * VMMR0_DO_PDM_DEVICE_CALL_REQ_HANDLER request buffer. */
204typedef PDMDEVICECALLREQHANDLERREQ *PPDMDEVICECALLREQHANDLERREQ;
205
206VMMR0_INT_DECL(int) PDMR0DeviceCallReqHandler(PVM pVM, PPDMDEVICECALLREQHANDLERREQ pReq);
207
208/** @} */
209
210RT_C_DECLS_END
211
212/** @} */
213
214#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette