VirtualBox

Changeset 44351 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Jan 24, 2013 12:04:39 PM (12 years ago)
Author:
vboxsync
Message:

PDM,++: Change APIs used by Main from PVM to PUVM.

Location:
trunk/src/VBox/VMM
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PDMAll.cpp

    r43971 r44351  
    205205 * @param   pVM             Pointer to the VM.
    206206 */
    207 VMMDECL(bool) PDMHasIoApic(PVM pVM)
     207VMM_INT_DECL(bool) PDMHasIoApic(PVM pVM)
    208208{
    209209    return pVM->pdm.s.IoApic.CTX_SUFF(pDevIns) != NULL;
     
    272272 * @param   pfPending       Pending state (out).
    273273 */
    274 VMMDECL(int) PDMApicHasPendingIrq(PVMCPU pVCpu, bool *pfPending)
     274VMM_INT_DECL(int) PDMApicHasPendingIrq(PVMCPU pVCpu, bool *pfPending)
    275275{
    276276    PVM pVM = pVCpu->CTX_SUFF(pVM);
     
    347347 * @param   u64Value        Value to write.
    348348 */
    349 VMMDECL(int) PDMApicWriteMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value)
     349VMM_INT_DECL(int) PDMApicWriteMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t u64Value)
    350350{
    351351    if (pVM->pdm.s.Apic.CTX_SUFF(pDevIns))
     
    367367 * @param   pu64Value       Value read.
    368368 */
    369 VMMDECL(int) PDMApicReadMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value)
     369VMM_INT_DECL(int) PDMApicReadMSR(PVM pVM, VMCPUID iCpu, uint32_t u32Reg, uint64_t *pu64Value)
    370370{
    371371    if (pVM->pdm.s.Apic.CTX_SUFF(pDevIns))
     
    431431 * @param   pGCPhys         GC phys address (out).
    432432 */
    433 VMMDECL(int) PDMVMMDevHeapR3ToGCPhys(PVM pVM, RTR3PTR pv, RTGCPHYS *pGCPhys)
     433VMM_INT_DECL(int) PDMVmmDevHeapR3ToGCPhys(PVM pVM, RTR3PTR pv, RTGCPHYS *pGCPhys)
    434434{
    435435    /* Don't assert here as this is called before we can catch ring-0 assertions. */
    436436    if (RT_UNLIKELY((RTR3UINTPTR)pv - (RTR3UINTPTR)pVM->pdm.s.pvVMMDevHeap >= pVM->pdm.s.cbVMMDevHeap))
    437437    {
    438         Log(("PDMVMMDevHeapR3ToGCPhys: pv=%p pvVMMDevHeap=%p cbVMMDevHeap=%#x\n",
     438        Log(("PDMVmmDevHeapR3ToGCPhys: pv=%p pvVMMDevHeap=%p cbVMMDevHeap=%#x\n",
    439439             pv, pVM->pdm.s.pvVMMDevHeap, pVM->pdm.s.cbVMMDevHeap));
    440440        return VERR_PDM_DEV_HEAP_R3_TO_GCPHYS;
     
    451451 * @param   pVM             Pointer to the VM.
    452452 */
    453 VMMDECL(bool)   PDMVMMDevHeapIsEnabled(PVM pVM)
     453VMM_INT_DECL(bool) PDMVmmDevHeapIsEnabled(PVM pVM)
    454454{
    455455    return (pVM->pdm.s.pvVMMDevHeap != NULL);
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r44269 r44351  
    18131813
    18141814            /* We convert it here every time as PCI regions could be reconfigured. */
    1815             rc = PDMVMMDevHeapR3ToGCPhys(pVM, pVM->hm.s.vmx.pRealModeTSS, &GCPhys);
     1815            rc = PDMVmmDevHeapR3ToGCPhys(pVM, pVM->hm.s.vmx.pRealModeTSS, &GCPhys);
    18161816            AssertRC(rc);
    18171817
     
    20642064
    20652065                /* We convert it here every time as PCI regions could be reconfigured. */
    2066                 rc = PDMVMMDevHeapR3ToGCPhys(pVM, pVM->hm.s.vmx.pNonPagingModeEPTPageTable, &GCPhys);
     2066                rc = PDMVmmDevHeapR3ToGCPhys(pVM, pVM->hm.s.vmx.pNonPagingModeEPTPageTable, &GCPhys);
    20672067                AssertMsgRC(rc, ("pNonPagingModeEPTPageTable = %RGv\n", pVM->hm.s.vmx.pNonPagingModeEPTPageTable));
    20682068
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r44275 r44351  
    11731173            {
    11741174                /* Allocate three pages for the TSS we need for real mode emulation. (2 pages for the IO bitmap) */
    1175                 rc = PDMR3VMMDevHeapAlloc(pVM, HM_VTX_TOTAL_DEVHEAP_MEM, (RTR3PTR *)&pVM->hm.s.vmx.pRealModeTSS);
     1175                rc = PDMR3VmmDevHeapAlloc(pVM, HM_VTX_TOTAL_DEVHEAP_MEM, (RTR3PTR *)&pVM->hm.s.vmx.pRealModeTSS);
    11761176                if (RT_SUCCESS(rc))
    11771177                {
     
    12021202
    12031203                    /* We convert it here every time as pci regions could be reconfigured. */
    1204                     rc = PDMVMMDevHeapR3ToGCPhys(pVM, pVM->hm.s.vmx.pRealModeTSS, &GCPhys);
     1204                    rc = PDMVmmDevHeapR3ToGCPhys(pVM, pVM->hm.s.vmx.pRealModeTSS, &GCPhys);
    12051205                    AssertRC(rc);
    12061206                    LogRel(("HM: Real Mode TSS guest physaddr  = %RGp\n", GCPhys));
    12071207
    1208                     rc = PDMVMMDevHeapR3ToGCPhys(pVM, pVM->hm.s.vmx.pNonPagingModeEPTPageTable, &GCPhys);
     1208                    rc = PDMVmmDevHeapR3ToGCPhys(pVM, pVM->hm.s.vmx.pNonPagingModeEPTPageTable, &GCPhys);
    12091209                    AssertRC(rc);
    12101210                    LogRel(("HM: Non-Paging Mode EPT CR3       = %RGp\n", GCPhys));
     
    16231623    if (pVM->hm.s.vmx.pRealModeTSS)
    16241624    {
    1625         PDMR3VMMDevHeapFree(pVM, pVM->hm.s.vmx.pRealModeTSS);
     1625        PDMR3VmmDevHeapFree(pVM, pVM->hm.s.vmx.pRealModeTSS);
    16261626        pVM->hm.s.vmx.pRealModeTSS       = 0;
    16271627    }
     
    23622362           || (!pVM->hm.s.vmx.fUnrestrictedGuest && pVM->hm.s.vmx.pRealModeTSS));
    23632363
    2364     bool fSupportsRealMode = pVM->hm.s.vmx.fUnrestrictedGuest || PDMVMMDevHeapIsEnabled(pVM);
     2364    bool fSupportsRealMode = pVM->hm.s.vmx.fUnrestrictedGuest || PDMVmmDevHeapIsEnabled(pVM);
    23652365    if (!pVM->hm.s.vmx.fUnrestrictedGuest)
    23662366    {
     
    25322532        &&  !pVM->hm.s.vmx.fUnrestrictedGuest
    25332533        &&  !CPUMIsGuestInPagedProtectedModeEx(pCtx)
    2534         &&  !PDMVMMDevHeapIsEnabled(pVM)
     2534        &&  !PDMVmmDevHeapIsEnabled(pVM)
    25352535        &&  (pVM->hm.s.fNestedPaging || CPUMIsGuestInRealModeEx(pCtx)))
    25362536        return true;
  • trunk/src/VBox/VMM/VMMR3/PDM.cpp

    r43472 r44351  
    337337 * @param   pUVM        Pointer to the user mode VM structure.
    338338 */
    339 VMMR3DECL(int) PDMR3InitUVM(PUVM pUVM)
     339VMMR3_INT_DECL(int) PDMR3InitUVM(PUVM pUVM)
    340340{
    341341    AssertCompile(sizeof(pUVM->pdm.s) <= sizeof(pUVM->pdm.padding));
     
    353353 * @param   pVM         Pointer to the VM.
    354354 */
    355 VMMR3DECL(int) PDMR3Init(PVM pVM)
     355VMMR3_INT_DECL(int) PDMR3Init(PVM pVM)
    356356{
    357357    LogFlow(("PDMR3Init\n"));
     
    445445 *          early in the relocation phase.
    446446 */
    447 VMMR3DECL(void) PDMR3Relocate(PVM pVM, RTGCINTPTR offDelta)
     447VMMR3_INT_DECL(void) PDMR3Relocate(PVM pVM, RTGCINTPTR offDelta)
    448448{
    449449    LogFlow(("PDMR3Relocate\n"));
     
    617617 * @param   pVM         Pointer to the VM.
    618618 */
    619 VMMR3DECL(int) PDMR3Term(PVM pVM)
     619VMMR3_INT_DECL(int) PDMR3Term(PVM pVM)
    620620{
    621621    LogFlow(("PDMR3Term:\n"));
     
    712712 * @param   pUVM        Pointer to the user mode VM structure.
    713713 */
    714 VMMR3DECL(void) PDMR3TermUVM(PUVM pUVM)
     714VMMR3_INT_DECL(void) PDMR3TermUVM(PUVM pUVM)
    715715{
    716716    /*
     
    14051405 * @param   pVCpu               Pointer to the VMCPU.
    14061406 */
    1407 VMMR3DECL(void) PDMR3ResetCpu(PVMCPU pVCpu)
     1407VMMR3_INT_DECL(void) PDMR3ResetCpu(PVMCPU pVCpu)
    14081408{
    14091409    VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_INTERRUPT_APIC);
     
    14201420 * @param   pVM     Pointer to the VM.
    14211421 */
    1422 VMMR3DECL(void) PDMR3Reset(PVM pVM)
     1422VMMR3_INT_DECL(void) PDMR3Reset(PVM pVM)
    14231423{
    14241424    LogFlow(("PDMR3Reset:\n"));
     
    16541654 * @thread  EMT(0)
    16551655 */
    1656 VMMR3DECL(void) PDMR3Suspend(PVM pVM)
     1656VMMR3_INT_DECL(void) PDMR3Suspend(PVM pVM)
    16571657{
    16581658    LogFlow(("PDMR3Suspend:\n"));
     
    18151815 * @param   pVM     Pointer to the VM.
    18161816 */
    1817 VMMR3DECL(void) PDMR3Resume(PVM pVM)
     1817VMMR3_INT_DECL(void) PDMR3Resume(PVM pVM)
    18181818{
    18191819    LogFlow(("PDMR3Resume:\n"));
     
    20942094 *
    20952095 * @returns VBox status code.
    2096  * @param   pVM             Pointer to the VM.
     2096 * @param   pUVM            The user mode VM handle.
    20972097 * @param   pszDevice       Device name.
    20982098 * @param   iInstance       Device instance.
     
    21012101 *          device chain is known to be updated.
    21022102 */
    2103 VMMR3DECL(int) PDMR3QueryDevice(PVM pVM, const char *pszDevice, unsigned iInstance, PPDMIBASE *ppBase)
     2103VMMR3DECL(int) PDMR3QueryDevice(PUVM pUVM, const char *pszDevice, unsigned iInstance, PPDMIBASE *ppBase)
    21042104{
    21052105    LogFlow(("PDMR3DeviceQuery: pszDevice=%p:{%s} iInstance=%u ppBase=%p\n", pszDevice, pszDevice, iInstance, ppBase));
     2106    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     2107    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
    21062108
    21072109    /*
     
    21092111     */
    21102112    size_t cchDevice = strlen(pszDevice);
    2111     for (PPDMDEV pDev = pVM->pdm.s.pDevs; pDev; pDev = pDev->pNext)
     2113    for (PPDMDEV pDev = pUVM->pVM->pdm.s.pDevs; pDev; pDev = pDev->pNext)
    21122114    {
    21132115        if (    pDev->cchName == cchDevice
     
    21502152 *
    21512153 * @returns VBox status code.
    2152  * @param   pVM             Pointer to the VM.
     2154 * @param   pUVM            The user mode VM handle.
    21532155 * @param   pszDevice       Device name.
    21542156 * @param   iInstance       Device instance.
     
    21582160 *          device chain is known to be updated.
    21592161 */
    2160 VMMR3DECL(int) PDMR3QueryDeviceLun(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPDMIBASE *ppBase)
     2162VMMR3DECL(int) PDMR3QueryDeviceLun(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPDMIBASE *ppBase)
    21612163{
    21622164    LogFlow(("PDMR3QueryLun: pszDevice=%p:{%s} iInstance=%u iLun=%u ppBase=%p\n",
    21632165             pszDevice, pszDevice, iInstance, iLun, ppBase));
     2166    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     2167    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
    21642168
    21652169    /*
     
    21672171     */
    21682172    PPDMLUN pLun;
    2169     int rc = pdmR3DevFindLun(pVM, pszDevice, iInstance, iLun, &pLun);
     2173    int rc = pdmR3DevFindLun(pUVM->pVM, pszDevice, iInstance, iLun, &pLun);
    21702174    if (RT_SUCCESS(rc))
    21712175    {
     
    21832187 *
    21842188 * @returns VBox status code.
    2185  * @param   pVM             Pointer to the VM.
     2189 * @param   pUVM            The user mode VM handle.
    21862190 * @param   pszDevice       Device name.
    21872191 * @param   iInstance       Device instance.
     
    21912195 *          device chain is known to be updated.
    21922196 */
    2193 VMMR3DECL(int) PDMR3QueryLun(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPDMIBASE *ppBase)
     2197VMMR3DECL(int) PDMR3QueryLun(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPDMIBASE *ppBase)
    21942198{
    21952199    LogFlow(("PDMR3QueryLun: pszDevice=%p:{%s} iInstance=%u iLun=%u ppBase=%p\n",
    21962200             pszDevice, pszDevice, iInstance, iLun, ppBase));
     2201    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     2202    PVM pVM = pUVM->pVM;
    21972203    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    21982204
     
    22242230 *
    22252231 * @returns VBox status code.
    2226  * @param   pVM             Pointer to the VM.
     2232 * @param   pUVM            The user mode VM handle.
    22272233 * @param   pszDevice       Device name.
    22282234 * @param   iInstance       Device instance.
     
    22342240 *          device chain is known to be updated.
    22352241 */
    2236 VMMR3DECL(int) PDMR3QueryDriverOnLun(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, const char *pszDriver, PPPDMIBASE ppBase)
     2242VMMR3DECL(int) PDMR3QueryDriverOnLun(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, const char *pszDriver, PPPDMIBASE ppBase)
    22372243{
    22382244    LogFlow(("PDMR3QueryDriverOnLun: pszDevice=%p:{%s} iInstance=%u iLun=%u pszDriver=%p:{%s} ppBase=%p\n",
    22392245             pszDevice, pszDevice, iInstance, iLun, pszDriver, pszDriver, ppBase));
     2246    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     2247    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
    22402248
    22412249    /*
     
    22432251     */
    22442252    PPDMLUN pLun;
    2245     int rc = pdmR3DevFindLun(pVM, pszDevice, iInstance, iLun, &pLun);
     2253    int rc = pdmR3DevFindLun(pUVM->pVM, pszDevice, iInstance, iLun, &pLun);
    22462254    if (RT_SUCCESS(rc))
    22472255    {
     
    22952303 * @param   pVM     Pointer to the VM.
    22962304 */
    2297 VMMR3DECL(int) PDMR3LockCall(PVM pVM)
     2305VMMR3_INT_DECL(int) PDMR3LockCall(PVM pVM)
    22982306{
    22992307    return PDMR3CritSectEnterEx(&pVM->pdm.s.CritSect, true /* fHostCall */);
     
    23102318 * @param   cbSize          Size of the heap.
    23112319 */
    2312 VMMR3DECL(int) PDMR3RegisterVMMDevHeap(PVM pVM, RTGCPHYS GCPhys, RTR3PTR pvHeap, unsigned cbSize)
     2320VMMR3_INT_DECL(int) PDMR3VmmDevHeapRegister(PVM pVM, RTGCPHYS GCPhys, RTR3PTR pvHeap, unsigned cbSize)
    23132321{
    23142322    Assert(pVM->pdm.s.pvVMMDevHeap == NULL);
    23152323
    2316     Log(("PDMR3RegisterVMMDevHeap %RGp %RHv %x\n", GCPhys, pvHeap, cbSize));
     2324    Log(("PDMR3VmmDevHeapRegister %RGp %RHv %x\n", GCPhys, pvHeap, cbSize));
    23172325    pVM->pdm.s.pvVMMDevHeap     = pvHeap;
    23182326    pVM->pdm.s.GCPhysVMMDevHeap = GCPhys;
     
    23302338 * @param   GCPhys          The physical address.
    23312339 */
    2332 VMMR3DECL(int) PDMR3UnregisterVMMDevHeap(PVM pVM, RTGCPHYS GCPhys)
     2340VMMR3_INT_DECL(int) PDMR3VmmDevHeapUnregister(PVM pVM, RTGCPHYS GCPhys)
    23332341{
    23342342    Assert(pVM->pdm.s.GCPhysVMMDevHeap == GCPhys);
    23352343
    2336     Log(("PDMR3UnregisterVMMDevHeap %RGp\n", GCPhys));
     2344    Log(("PDMR3VmmDevHeapUnregister %RGp\n", GCPhys));
    23372345    pVM->pdm.s.pvVMMDevHeap     = NULL;
    23382346    pVM->pdm.s.GCPhysVMMDevHeap = NIL_RTGCPHYS;
     
    23512359 * @param   pv              Ring-3 pointer. (out)
    23522360 */
    2353 VMMR3DECL(int) PDMR3VMMDevHeapAlloc(PVM pVM, unsigned cbSize, RTR3PTR *ppv)
     2361VMMR3_INT_DECL(int) PDMR3VmmDevHeapAlloc(PVM pVM, size_t cbSize, RTR3PTR *ppv)
    23542362{
    23552363#ifdef DEBUG_bird
     
    23602368#endif
    23612369
    2362     Log(("PDMR3VMMDevHeapAlloc %x\n", cbSize));
    2363 
    2364     /** @todo not a real heap as there's currently only one user. */
     2370    Log(("PDMR3VMMDevHeapAlloc: %#zx\n", cbSize));
     2371
     2372    /** @todo Not a real heap as there's currently only one user. */
    23652373    *ppv = pVM->pdm.s.pvVMMDevHeap;
    23662374    pVM->pdm.s.cbVMMDevHeapLeft = 0;
     
    23762384 * @param   pv              Ring-3 pointer.
    23772385 */
    2378 VMMR3DECL(int) PDMR3VMMDevHeapFree(PVM pVM, RTR3PTR pv)
    2379 {
    2380     Log(("PDMR3VMMDevHeapFree %RHv\n", pv));
     2386VMMR3_INT_DECL(int) PDMR3VmmDevHeapFree(PVM pVM, RTR3PTR pv)
     2387{
     2388    Log(("PDMR3VmmDevHeapFree: %RHv\n", pv));
    23812389
    23822390    /** @todo not a real heap as there's currently only one user. */
  • trunk/src/VBox/VMM/VMMR3/PDMDevHlp.cpp

    r44340 r44351  
    21672167             pDevIns->iInstance, rc));
    21682168    return rc;
     2169}
     2170
     2171
     2172/** @interface_method_impl{PDMDEVHLPR3,pfnGetUVM} */
     2173static DECLCALLBACK(PUVM) pdmR3DevHlp_GetUVM(PPDMDEVINS pDevIns)
     2174{
     2175    PDMDEV_ASSERT_DEVINS(pDevIns);
     2176    LogFlow(("pdmR3DevHlp_GetUVM: caller='%s'/%d: returns %p\n", pDevIns->pReg->szName, pDevIns->iInstance, pDevIns->Internal.s.pVMR3));
     2177    return pDevIns->Internal.s.pVMR3->pUVM;
    21692178}
    21702179
     
    31003109    VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
    31013110
    3102     int rc = PDMR3RegisterVMMDevHeap(pDevIns->Internal.s.pVMR3, GCPhys, pvHeap, cbSize);
     3111    int rc = PDMR3VmmDevHeapRegister(pDevIns->Internal.s.pVMR3, GCPhys, pvHeap, cbSize);
    31033112    return rc;
    31043113}
     
    31133122    VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
    31143123
    3115     int rc = PDMR3UnregisterVMMDevHeap(pDevIns->Internal.s.pVMR3, GCPhys);
     3124    int rc = PDMR3VmmDevHeapUnregister(pDevIns->Internal.s.pVMR3, GCPhys);
    31163125    return rc;
    31173126}
     
    34103419    0,
    34113420    0,
    3412     0,
     3421    pdmR3DevHlp_GetUVM,
    34133422    pdmR3DevHlp_GetVM,
    34143423    pdmR3DevHlp_GetVMCPU,
     
    34293438
    34303439
     3440
     3441
     3442/** @interface_method_impl{PDMDEVHLPR3,pfnGetUVM} */
     3443static DECLCALLBACK(PUVM) pdmR3DevHlp_Untrusted_GetUVM(PPDMDEVINS pDevIns)
     3444{
     3445    PDMDEV_ASSERT_DEVINS(pDevIns);
     3446    AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pReg->szName, pDevIns->iInstance));
     3447    return NULL;
     3448}
    34313449
    34323450
     
    36313649    0,
    36323650    0,
    3633     0,
     3651    pdmR3DevHlp_Untrusted_GetUVM,
    36343652    pdmR3DevHlp_Untrusted_GetVM,
    36353653    pdmR3DevHlp_Untrusted_GetVMCPU,
  • trunk/src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp

    r41965 r44351  
    615615    {
    616616        PPDMIBASE pBase;
    617         rc = PDMR3QueryDevice(pDevIns->Internal.s.pVMR3, "i8254", 0, &pBase);
     617        rc = PDMR3QueryDevice(pDevIns->Internal.s.pVMR3->pUVM, "i8254", 0, &pBase);
    618618        if (RT_SUCCESS(rc))
    619619        {
  • trunk/src/VBox/VMM/VMMR3/PDMDevice.cpp

    r41965 r44351  
    3232#include <VBox/vmm/dbgf.h>
    3333#include <VBox/vmm/vm.h>
     34#include <VBox/vmm/uvm.h>
    3435#include <VBox/vmm/vmm.h>
    3536
     
    776777 *
    777778 * @returns VBox status code.
    778  * @param   pVM             Pointer to the VM.
     779 * @param   pUVM            The user mode VM handle.
    779780 * @param   pszDevice       Device name.
    780781 * @param   iInstance       Device instance.
     
    784785 * @thread  EMT
    785786 */
    786 VMMR3DECL(int) PDMR3DeviceAttach(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, uint32_t fFlags, PPPDMIBASE ppBase)
    787 {
     787VMMR3DECL(int) PDMR3DeviceAttach(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, uint32_t fFlags, PPPDMIBASE ppBase)
     788{
     789    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     790    PVM pVM = pUVM->pVM;
     791    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    788792    VM_ASSERT_EMT(pVM);
    789793    LogFlow(("PDMR3DeviceAttach: pszDevice=%p:{%s} iInstance=%d iLun=%d fFlags=%#x ppBase=%p\n",
     
    835839 *
    836840 * @returns VBox status code.
    837  * @param   pVM             Pointer to the VM.
     841 * @param   pUVM            The user mode VM handle.
    838842 * @param   pszDevice       Device name.
    839843 * @param   iInstance       Device instance.
     
    842846 * @thread  EMT
    843847 */
    844 VMMR3DECL(int) PDMR3DeviceDetach(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, uint32_t fFlags)
    845 {
    846     return PDMR3DriverDetach(pVM, pszDevice, iInstance, iLun, NULL, 0, fFlags);
     848VMMR3DECL(int) PDMR3DeviceDetach(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, uint32_t fFlags)
     849{
     850    return PDMR3DriverDetach(pUVM, pszDevice, iInstance, iLun, NULL, 0, fFlags);
    847851}
    848852
     
    880884 *
    881885 * @returns VBox status code.
    882  * @param   pVM             Pointer to the VM.
     886 * @param   pUVM            The user mode VM handle.
    883887 * @param   pszDevice       Device name.
    884888 * @param   iInstance       Device instance.
     
    889893 * @thread  EMT
    890894 */
    891 VMMR3DECL(int) PDMR3DriverAttach(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, uint32_t fFlags, PPPDMIBASE ppBase)
    892 {
    893     VM_ASSERT_EMT(pVM);
     895VMMR3DECL(int) PDMR3DriverAttach(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, uint32_t fFlags, PPPDMIBASE ppBase)
     896{
    894897    LogFlow(("PDMR3DriverAttach: pszDevice=%p:{%s} iInstance=%d iLun=%d fFlags=%#x ppBase=%p\n",
    895898             pszDevice, pszDevice, iInstance, iLun, fFlags, ppBase));
     899    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     900    PVM pVM = pUVM->pVM;
     901    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     902    VM_ASSERT_EMT(pVM);
    896903
    897904    if (ppBase)
     
    962969 *
    963970 * @returns VBox status code.
    964  * @param   pVM             Pointer to the VM.
     971 * @param   pUVM            The user mode VM handle.
    965972 * @param   pszDevice       Device name.
    966973 * @param   iDevIns         Device instance.
     
    973980 * @thread  EMT
    974981 */
    975 VMMR3DECL(int) PDMR3DriverDetach(PVM pVM, const char *pszDevice, unsigned iDevIns, unsigned iLun,
     982VMMR3DECL(int) PDMR3DriverDetach(PUVM pUVM, const char *pszDevice, unsigned iDevIns, unsigned iLun,
    976983                                 const char *pszDriver, unsigned iOccurance, uint32_t fFlags)
    977984{
    978985    LogFlow(("PDMR3DriverDetach: pszDevice=%p:{%s} iDevIns=%u iLun=%u pszDriver=%p:{%s} iOccurance=%u fFlags=%#x\n",
    979986             pszDevice, pszDevice, iDevIns, iLun, pszDriver, iOccurance, fFlags));
     987    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     988    PVM pVM = pUVM->pVM;
     989    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    980990    VM_ASSERT_EMT(pVM);
    981991    AssertPtr(pszDevice);
     
    10331043 *
    10341044 * @returns VBox status code.
    1035  * @param   pVM             Pointer to the VM.
     1045 * @param   pUVM            The user mode VM handle.
    10361046 * @param   pszDevice       Device name.
    10371047 * @param   iDevIns         Device instance.
     
    10541064 * @thread  Any thread. The EMTs will be involved at some point though.
    10551065 */
    1056 VMMR3DECL(int)  PDMR3DriverReattach(PVM pVM, const char *pszDevice, unsigned iDevIns, unsigned iLun,
     1066VMMR3DECL(int)  PDMR3DriverReattach(PUVM pUVM, const char *pszDevice, unsigned iDevIns, unsigned iLun,
    10571067                                    const char *pszDriver, unsigned iOccurance, uint32_t fFlags,
    10581068                                    PCFGMNODE pCfg, PPPDMIBASE ppBase)
    10591069{
    1060     NOREF(pVM); NOREF(pszDevice); NOREF(iDevIns); NOREF(iLun); NOREF(pszDriver); NOREF(iOccurance);
     1070    NOREF(pUVM); NOREF(pszDevice); NOREF(iDevIns); NOREF(iLun); NOREF(pszDriver); NOREF(iOccurance);
    10611071    NOREF(fFlags); NOREF(pCfg); NOREF(ppBase);
    10621072    return VERR_NOT_IMPLEMENTED;
  • trunk/src/VBox/VMM/VMMR3/PDMLdr.cpp

    r43387 r44351  
    7878 * @param   pUVM            Pointer to the user mode VM structure.
    7979 */
    80 VMMR3DECL(int) PDMR3LdrLoadVMMR0U(PUVM pUVM)
     80VMMR3_INT_DECL(int) PDMR3LdrLoadVMMR0U(PUVM pUVM)
    8181{
    8282    return pdmR3LoadR0U(pUVM, NULL, VMMR0_MAIN_MODULE_NAME, NULL);
     
    178178 * @param   offDelta    Relocation delta relative to old location.
    179179 */
    180 VMMR3DECL(void) PDMR3LdrRelocateU(PUVM pUVM, RTGCINTPTR offDelta)
     180VMMR3_INT_DECL(void) PDMR3LdrRelocateU(PUVM pUVM, RTGCINTPTR offDelta)
    181181{
    182182#ifdef VBOX_WITH_RAW_MODE
     
    720720 * @param   ppvValue        Where to store the symbol value.
    721721 */
    722 VMMR3DECL(int) PDMR3LdrGetSymbolR3(PVM pVM, const char *pszModule, const char *pszSymbol, void **ppvValue)
     722VMMR3_INT_DECL(int) PDMR3LdrGetSymbolR3(PVM pVM, const char *pszModule, const char *pszSymbol, void **ppvValue)
    723723{
    724724    /*
     
    13591359 * @param   pNearSym2   The address of pszNearSym2.
    13601360 */
    1361 VMMR3DECL(int) PDMR3LdrQueryRCModFromPC(PVM pVM, RTRCPTR uPC,
    1362                                         char *pszModName,  size_t cchModName,  PRTRCPTR pMod,
    1363                                         char *pszNearSym1, size_t cchNearSym1, PRTRCPTR pNearSym1,
    1364                                         char *pszNearSym2, size_t cchNearSym2, PRTRCPTR pNearSym2)
     1361VMMR3_INT_DECL(int) PDMR3LdrQueryRCModFromPC(PVM pVM, RTRCPTR uPC,
     1362                                             char *pszModName,  size_t cchModName,  PRTRCPTR pMod,
     1363                                             char *pszNearSym1, size_t cchNearSym1, PRTRCPTR pNearSym1,
     1364                                             char *pszNearSym2, size_t cchNearSym2, PRTRCPTR pNearSym2)
    13651365{
    13661366    RTUINTPTR AddrMod   = 0;
     
    14031403 * @param   pNearSym2   The address of pszNearSym2. Optional.
    14041404 */
    1405 VMMR3DECL(int) PDMR3LdrQueryR0ModFromPC(PVM pVM, RTR0PTR uPC,
    1406                                         char *pszModName,  size_t cchModName,  PRTR0PTR pMod,
    1407                                         char *pszNearSym1, size_t cchNearSym1, PRTR0PTR pNearSym1,
    1408                                         char *pszNearSym2, size_t cchNearSym2, PRTR0PTR pNearSym2)
     1405VMMR3_INT_DECL(int) PDMR3LdrQueryR0ModFromPC(PVM pVM, RTR0PTR uPC,
     1406                                             char *pszModName,  size_t cchModName,  PRTR0PTR pMod,
     1407                                             char *pszNearSym1, size_t cchNearSym1, PRTR0PTR pNearSym1,
     1408                                             char *pszNearSym2, size_t cchNearSym2, PRTR0PTR pNearSym2)
    14091409{
    14101410    RTUINTPTR AddrMod   = 0;
     
    15521552 *                          it's raw-mode context interface.
    15531553 */
    1554 VMMR3DECL(int) PDMR3LdrGetInterfaceSymbols(PVM pVM, void *pvInterface, size_t cbInterface,
    1555                                            const char *pszModule, const char *pszSearchPath,
    1556                                            const char *pszSymPrefix, const char *pszSymList,
    1557                                            bool fRing0)
     1554VMMR3_INT_DECL(int) PDMR3LdrGetInterfaceSymbols(PVM pVM, void *pvInterface, size_t cbInterface,
     1555                                                const char *pszModule, const char *pszSearchPath,
     1556                                                const char *pszSymPrefix, const char *pszSymList,
     1557                                                bool fRing0)
    15581558{
    15591559    /*
  • trunk/src/VBox/VMM/VMMR3/PDMUsb.cpp

    r43814 r44351  
    2929#include <VBox/sup.h>
    3030#include <VBox/vmm/vm.h>
     31#include <VBox/vmm/uvm.h>
    3132#include <VBox/version.h>
    3233#include <VBox/err.h>
     
    850851 *
    851852 * @returns VBox status code.
    852  * @param   pVM             Pointer to the VM.
     853 * @param   pUVM            The user mode VM handle.
    853854 * @param   pUuid           The UUID to be associated with the device.
    854855 * @param   fRemote         Whether it's a remove or local device.
     
    858859 * @param   fMaskedIfs      The interfaces to hide from the guest.
    859860 */
    860 VMMR3DECL(int) PDMR3USBCreateProxyDevice(PVM pVM, PCRTUUID pUuid, bool fRemote, const char *pszAddress, void *pvBackend,
     861VMMR3DECL(int) PDMR3UsbCreateProxyDevice(PUVM pUVM, PCRTUUID pUuid, bool fRemote, const char *pszAddress, void *pvBackend,
    861862                                         uint32_t iUsbVersion, uint32_t fMaskedIfs)
    862863{
     
    864865     * Validate input.
    865866     */
     867    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     868    PVM pVM = pUVM->pVM;
     869    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    866870    VM_ASSERT_EMT(pVM);
    867871    AssertPtrReturn(pUuid, VERR_INVALID_POINTER);
     
    876880    if (!pUsbDev)
    877881    {
    878         LogRel(("PDMR3USBCreateProxyDevice: The USBProxy device class wasn't found\n"));
     882        LogRel(("PDMR3UsbCreateProxyDevice: The USBProxy device class wasn't found\n"));
    879883        return VERR_PDM_NO_USBPROXY;
    880884    }
     
    911915    {
    912916        CFGMR3RemoveNode(pConfig);
    913         LogRel(("PDMR3USBCreateProxyDevice: failed to setup CFGM config, rc=%Rrc\n", rc));
     917        LogRel(("PDMR3UsbCreateProxyDevice: failed to setup CFGM config, rc=%Rrc\n", rc));
    914918        return rc;
    915919    }
     
    10221026 *
    10231027 * @returns VBox status code.
    1024  * @param   pVM             Pointer to the VM.
     1028 * @param   pUVM            The user mode VM handle.
    10251029 * @param   pUuid           The UUID associated with the device to detach.
    10261030 * @thread  EMT
    10271031 */
    1028 VMMR3DECL(int) PDMR3USBDetachDevice(PVM pVM, PCRTUUID pUuid)
     1032VMMR3DECL(int) PDMR3UsbDetachDevice(PUVM pUVM, PCRTUUID pUuid)
    10291033{
    10301034    /*
    10311035     * Validate input.
    10321036     */
     1037    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     1038    PVM pVM = pUVM->pVM;
     1039    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    10331040    VM_ASSERT_EMT(pVM);
    10341041    AssertPtrReturn(pUuid, VERR_INVALID_POINTER);
    1035     AssertPtrReturn(pVM, VERR_INVALID_POINTER);
    10361042
    10371043    /*
     
    10771083 *
    10781084 * @returns true / false accordingly.
    1079  * @param   pVM     Pointer to the VM.
    1080  */
    1081 VMMR3DECL(bool) PDMR3USBHasHub(PVM pVM)
    1082 {
     1085 * @param   pUVM        The user mode VM handle.
     1086 */
     1087VMMR3DECL(bool) PDMR3UsbHasHub(PUVM pUVM)
     1088{
     1089    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
     1090    PVM pVM = pUVM->pVM;
     1091    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
    10831092    return pVM->pdm.s.pUsbHubs != NULL;
    10841093}
Note: See TracChangeset for help on using the changeset viewer.

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