VirtualBox

source: vbox/trunk/include/VBox/pdmapi.h@ 28425

最後變更 在這個檔案從28425是 28425,由 vboxsync 提交於 15 年 前

Added PDMDRVHLP::pfnCallR0 / PDMDrvHlpCallR0 / PFNPDMDRVREQHANDLERR0 for making it possible for a driver to call it's ring-0 side via a private interface.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 7.9 KB
 
1/** @file
2 * PDM - Pluggable Device Manager, Core API. (VMM)
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-2007 Sun Microsystems, Inc.
11 *
12 * This file is part of VirtualBox Open Source Edition (OSE), as
13 * available from http://www.alldomusa.eu.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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
30 * Clara, CA 95054 USA or visit http://www.sun.com if you need
31 * additional information or have any questions.
32 */
33
34#ifndef ___VBox_pdmapi_h
35#define ___VBox_pdmapi_h
36
37#include <VBox/types.h>
38#include <VBox/sup.h>
39
40RT_C_DECLS_BEGIN
41
42/** @defgroup grp_pdm The Pluggable Device Manager API
43 * @{
44 */
45
46VMMDECL(int) PDMGetInterrupt(PVMCPU pVCpu, uint8_t *pu8Interrupt);
47VMMDECL(int) PDMIsaSetIrq(PVM pVM, uint8_t u8Irq, uint8_t u8Level);
48VMMDECL(int) PDMIoApicSetIrq(PVM pVM, uint8_t u8Irq, uint8_t u8Level);
49VMMDECL(bool) PDMHasIoApic(PVM pVM);
50VMMDECL(int) PDMApicHasPendingIrq(PVM pVM, bool *pfPending);
51VMMDECL(int) PDMApicSetBase(PVM pVM, uint64_t u64Base);
52VMMDECL(int) PDMApicGetBase(PVM pVM, uint64_t *pu64Base);
53VMMDECL(int) PDMApicSetTPR(PVMCPU pVCpu, uint8_t u8TPR);
54VMMDECL(int) PDMApicGetTPR(PVMCPU pVCpu, uint8_t *pu8TPR, bool *pfPending);
55VMMDECL(int) PDMApicWriteMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value);
56VMMDECL(int) PDMApicReadMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value);
57VMMDECL(int) PDMVMMDevHeapR3ToGCPhys(PVM pVM, RTR3PTR pv, RTGCPHYS *pGCPhys);
58VMMDECL(bool) PDMVMMDevHeapIsEnabled(PVM pVM);
59
60
61/** @defgroup grp_pdm_r3 The PDM Host Context Ring-3 API
62 * @ingroup grp_pdm
63 * @{
64 */
65
66VMMR3DECL(int) PDMR3InitUVM(PUVM pUVM);
67VMMR3DECL(int) PDMR3LdrLoadVMMR0U(PUVM pUVM);
68VMMR3DECL(int) PDMR3Init(PVM pVM);
69VMMR3DECL(void) PDMR3PowerOn(PVM pVM);
70VMMR3DECL(void) PDMR3ResetCpu(PVMCPU pVCpu);
71VMMR3DECL(void) PDMR3Reset(PVM pVM);
72VMMR3DECL(void) PDMR3Suspend(PVM pVM);
73VMMR3DECL(void) PDMR3Resume(PVM pVM);
74VMMR3DECL(void) PDMR3PowerOff(PVM pVM);
75VMMR3DECL(void) PDMR3Relocate(PVM pVM, RTGCINTPTR offDelta);
76VMMR3DECL(int) PDMR3Term(PVM pVM);
77VMMR3DECL(void) PDMR3TermUVM(PUVM pUVM);
78
79/**
80 * Module enumeration callback function.
81 *
82 * @returns VBox status.
83 * Failure will stop the search and return the return code.
84 * Warnings will be ignored and not returned.
85 * @param pVM VM Handle.
86 * @param pszFilename Module filename.
87 * @param pszName Module name. (short and unique)
88 * @param ImageBase Address where to executable image is loaded.
89 * @param cbImage Size of the executable image.
90 * @param fRC Set if raw-mode context, clear if host context.
91 * @param pvArg User argument.
92 */
93typedef DECLCALLBACK(int) FNPDMR3ENUM(PVM pVM, const char *pszFilename, const char *pszName,
94 RTUINTPTR ImageBase, size_t cbImage, bool fRC, void *pvArg);
95/** Pointer to a FNPDMR3ENUM() function. */
96typedef FNPDMR3ENUM *PFNPDMR3ENUM;
97VMMR3DECL(int) PDMR3LdrEnumModules(PVM pVM, PFNPDMR3ENUM pfnCallback, void *pvArg);
98VMMR3DECL(void) PDMR3LdrRelocateU(PUVM pUVM, RTGCINTPTR offDelta);
99VMMR3DECL(int) PDMR3LdrGetSymbolR3(PVM pVM, const char *pszModule, const char *pszSymbol, void **ppvValue);
100VMMR3DECL(int) PDMR3LdrGetSymbolR0(PVM pVM, const char *pszModule, const char *pszSymbol, PRTR0PTR ppvValue);
101VMMR3DECL(int) PDMR3LdrGetSymbolR0Lazy(PVM pVM, const char *pszModule, const char *pszSymbol, PRTR0PTR ppvValue);
102VMMR3DECL(int) PDMR3LdrLoadRC(PVM pVM, const char *pszFilename, const char *pszName);
103VMMR3DECL(int) PDMR3LdrGetSymbolRC(PVM pVM, const char *pszModule, const char *pszSymbol, PRTRCPTR pRCPtrValue);
104VMMR3DECL(int) PDMR3LdrGetSymbolRCLazy(PVM pVM, const char *pszModule, const char *pszSymbol, PRTRCPTR pRCPtrValue);
105VMMR3DECL(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);
109VMMR3DECL(int) PDMR3LdrGetInterfaceSymbols(PVM pVM, void *pvInterface, size_t cbInterface,
110 const char *pszModule, const char *pszSymPrefix,
111 const char *pszSymList, bool fRing0OrRC);
112
113VMMR3DECL(int) PDMR3QueryDevice(PVM pVM, const char *pszDevice, unsigned iInstance, PPPDMIBASE ppBase);
114VMMR3DECL(int) PDMR3QueryDeviceLun(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPPDMIBASE ppBase);
115VMMR3DECL(int) PDMR3QueryLun(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPPDMIBASE ppBase);
116VMMR3DECL(int) PDMR3DeviceAttach(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, uint32_t fFlags, PPDMIBASE *ppBase);
117VMMR3DECL(int) PDMR3DeviceDetach(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, uint32_t fFlags);
118VMMR3DECL(int) PDMR3DriverAttach(PVM pVM, const char *pszDevice, unsigned iDevIns, unsigned iLun, uint32_t fFlags, PPPDMIBASE ppBase);
119VMMR3DECL(int) PDMR3DriverDetach(PVM pVM, const char *pszDevice, unsigned iDevIns, unsigned iLun,
120 const char *pszDriver, unsigned iOccurance, uint32_t fFlags);
121VMMR3DECL(int) PDMR3DriverReattach(PVM pVM, const char *pszDevice, unsigned iDevIns, unsigned iLun,
122 const char *pszDriver, unsigned iOccurance, uint32_t fFlags, PCFGMNODE pCfg, PPPDMIBASE ppBase);
123VMMR3DECL(void) PDMR3DmaRun(PVM pVM);
124VMMR3DECL(int) PDMR3LockCall(PVM pVM);
125VMMR3DECL(int) PDMR3RegisterVMMDevHeap(PVM pVM, RTGCPHYS GCPhys, RTR3PTR pvHeap, unsigned cbSize);
126VMMR3DECL(int) PDMR3VMMDevHeapAlloc(PVM pVM, unsigned cbSize, RTR3PTR *ppv);
127VMMR3DECL(int) PDMR3VMMDevHeapFree(PVM pVM, RTR3PTR pv);
128VMMR3DECL(int) PDMR3UnregisterVMMDevHeap(PVM pVM, RTGCPHYS GCPhys);
129
130VMMR3DECL(void) PDMR3ReleaseOwnedLocks(PVM pVM);
131/** @} */
132
133
134
135/** @defgroup grp_pdm_rc The PDM Raw-Mode Context API
136 * @ingroup grp_pdm
137 * @{
138 */
139/** @} */
140
141
142
143/** @defgroup grp_pdm_r0 The PDM Ring-0 Context API
144 * @ingroup grp_pdm
145 * @{
146 */
147
148/**
149 * Request buffer for PDMR0DriverCallReqHandler / VMMR0_DO_PDM_DRIVER_CALL_REQ_HANDLER.
150 * @see PDMR0DriverCallReqHandler.
151 */
152typedef struct PDMDRIVERCALLREQHANDLERREQ
153{
154 /** The header. */
155 SUPVMMR0REQHDR Hdr;
156 /** The driver instance. */
157 PPDMDRVINSR0 pDrvInsR0;
158 /** The operation. */
159 uint32_t uOperation;
160 /** Explicit alignment padding. */
161 uint32_t u32Alignment;
162 /** Optional 64-bit integer argument. */
163 uint64_t u64Arg;
164} PDMDRIVERCALLREQHANDLERREQ;
165/** Pointer to a PDMR0DriverCallReqHandler / VMMR0_DO_PDM_DRIVER_CALL_REQ_HANDLER
166 * request buffer. */
167typedef PDMDRIVERCALLREQHANDLERREQ *PPDMDRIVERCALLREQHANDLERREQ;
168
169VMMR0_INT_DECL(int) PDMR0DriverCallReqHandler(PVM pVM, PPDMDRIVERCALLREQHANDLERREQ pReq);
170
171/** @} */
172
173RT_C_DECLS_END
174
175/** @} */
176
177#endif
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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