VirtualBox

Changeset 914 in vbox for trunk/src/VBox/HostDrivers


Ignore:
Timestamp:
Feb 14, 2007 11:23:08 PM (18 years ago)
Author:
vboxsync
Message:

PVMR0 changes for darwin.

Location:
trunk/src/VBox/HostDrivers/Support
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDRVIOC.h

    r912 r914  
    300300{
    301301    /** The address of the ring-0 mapping of the allocated memory. */
    302     void       *pvR0;
     302    RTR0PTR     pvR0;
    303303    /** The address of the ring-3 mapping of the allocated memory. */
    304     void       *pvR3;
     304    RTR3PTR     pvR3;
    305305    /** The physical address of the allocation. */
    306306    RTHCPHYS    HCPhys;
     
    458458    uint32_t    u32SessionCookie;
    459459    /** The VM handle. */
    460     PVM         pVM;
     460    PVMR0       pVMR0;
    461461    /** Which operation to execute. */
    462462    uint32_t    uOperation;
  • trunk/src/VBox/HostDrivers/Support/SUPDRVShared.c

    r679 r914  
    11451145             * Execute.
    11461146             */
    1147             pOut->rc = pDevExt->pfnVMMR0Entry(pIn->pVM, pIn->uOperation, pIn->pvArg);
     1147            pOut->rc = pDevExt->pfnVMMR0Entry(pIn->pVMR0, pIn->uOperation, pIn->pvArg);
    11481148            *pcbReturned = sizeof(*pOut);
    11491149            return 0;
     
    18371837 * @param   pHCPhys     Where to put the physical address of allocated memory.
    18381838 */
    1839 SUPR0DECL(int) SUPR0ContAlloc(PSUPDRVSESSION pSession, unsigned cb, void **ppvR0, void **ppvR3, PRTHCPHYS pHCPhys)
     1839SUPR0DECL(int) SUPR0ContAlloc(PSUPDRVSESSION pSession, unsigned cb, void **ppvR0, PRTR3PTR ppvR3, PRTHCPHYS pHCPhys)
    18401840{
    18411841    int             rc;
     
    28322832    *u.pb++ = 0xf8;
    28332833
    2834     /* 
     2834    /*
    28352835     * Call VMMR0Entry
    2836      *      We don't have to push the arguments here, but we have to 
     2836     *      We don't have to push the arguments here, but we have to
    28372837     *      reserve some stack space for the interrupt forwarding.
    28382838     */
  • trunk/src/VBox/HostDrivers/Support/SUPLib.cpp

    r874 r914  
    7979*   Structures and Typedefs                                                    *
    8080*******************************************************************************/
    81 typedef DECLCALLBACK(int) FNCALLVMMR0(PVM pVM, unsigned uOperation, void *pvArg);
     81typedef DECLCALLBACK(int) FNCALLVMMR0(PVMR0 pVMR0, unsigned uOperation, void *pvArg);
    8282typedef FNCALLVMMR0 *PFNCALLVMMR0;
    8383
     
    356356}
    357357
    358 SUPR3DECL(int) SUPCallVMMR0Ex(PVM pVM, unsigned uOperation, void *pvArg, unsigned cbArg)
     358SUPR3DECL(int) SUPCallVMMR0Ex(PVMR0 pVMR0, unsigned uOperation, void *pvArg, unsigned cbArg)
    359359{
    360360    /*
     
    364364    In.u32Cookie        = g_u32Cookie;
    365365    In.u32SessionCookie = g_u32SessionCookie;
    366     In.pVM              = pVM;
     366    In.pVMR0            = pVMR0;
    367367    In.uOperation       = uOperation;
    368368    In.cbArg            = cbArg;
     
    377377
    378378
    379 SUPR3DECL(int) SUPCallVMMR0(PVM pVM, unsigned uOperation, void *pvArg)
     379SUPR3DECL(int) SUPCallVMMR0(PVMR0 pVMR0, unsigned uOperation, void *pvArg)
    380380{
    381381#ifndef VBOX_WITHOUT_IDT_PATCHING
    382     return g_pfnCallVMMR0(pVM, uOperation, pvArg);
     382    return g_pfnCallVMMR0(pVMR0, uOperation, pvArg);
    383383
    384384#else
    385     if (uOperation == VMMR0_DO_RAW_RUN)
     385    if (RT_LIKELY(uOperation == VMMR0_DO_RAW_RUN))
    386386    {
    387387        Assert(!pvArg);
    388388        return suplibOSIOCtlFast(SUP_IOCTL_FAST_DO_RAW_RUN);
    389389    }
    390     if (uOperation == VMMR0_DO_HWACC_RUN)
     390    if (RT_LIKELY(uOperation == VMMR0_DO_HWACC_RUN))
    391391    {
    392392        Assert(!pvArg);
     
    398398        return suplibOSIOCtlFast(SUP_IOCTL_FAST_DO_NOP);
    399399    }
    400     return SUPCallVMMR0Ex(pVM, uOperation, pvArg, pvArg ? sizeof(pvArg) : 0);
     400    return SUPCallVMMR0Ex(pVMR0, uOperation, pvArg, pvArg ? sizeof(pvArg) : 0);
    401401#endif
    402402}
     
    478478SUPR3DECL(void *) SUPContAlloc(unsigned cb, PRTHCPHYS pHCPhys)
    479479{
    480     return SUPContAlloc2(cb, NULL, pHCPhys);
    481 }
    482 
    483 
    484 SUPR3DECL(void *) SUPContAlloc2(unsigned cb, void **ppvR0, PRTHCPHYS pHCPhys)
     480    return SUPContAlloc2(cb, NIL_RTR0PTR, pHCPhys);
     481}
     482
     483
     484SUPR3DECL(void *) SUPContAlloc2(unsigned cb, PRTR0PTR pR0Ptr, PRTHCPHYS pHCPhys)
    485485{
    486486    /*
     
    490490    AssertPtr(pHCPhys);
    491491    *pHCPhys = NIL_RTHCPHYS;
     492    AssertPtrNull(pR0Ptr);
     493    if (pR0Ptr)
     494        *pR0Ptr = NIL_RTR0PTR;
    492495
    493496    /*
     
    506509        rc = SUPPageAlloc(In.cb >> PAGE_SHIFT, &Out.pvR3);
    507510        Out.HCPhys = (uintptr_t)Out.pvR3 + (PAGE_SHIFT * 1024);
    508         Out.pvR0 = Out.pvR3;
     511        Out.pvR0 = (uintptr_t)Out.pvR3;
    509512    }
    510513    if (VBOX_SUCCESS(rc))
    511514    {
    512515        *pHCPhys = (RTHCPHYS)Out.HCPhys;
    513         if (ppvR0)
    514             *ppvR0 = Out.pvR0;
     516        if (pR0Ptr)
     517            *pR0Ptr = Out.pvR0;
    515518        return Out.pvR3;
    516519    }
     
    717720     * reg params:
    718721     *      <GCC>   <MSC>   <argument>
    719      *      rdi     rcx     pVM
     722     *      rdi     rcx     pVMR0
    720723     *      esi     edx     uOperation
    721724     *      rdx     r8      pvArg
  • trunk/src/VBox/HostDrivers/Support/testcase/tstInt.cpp

    r913 r914  
    8989            PVMR0 pVMR0;
    9090            RTHCPHYS HCPhysVM;
    91             PVM pVM = (PVM)SUPContAlloc2(sizeof(*pVM), (void **)&pVMR0, &HCPhysVM);
     91            PVM pVM = (PVM)SUPContAlloc2(sizeof(*pVM), &pVMR0, &HCPhysVM);
    9292            if (pVM)
    9393            {
    9494                pVM->pVMGC = 0;
    95                 pVM->pVMHC = pVM;
     95                pVM->pVMR3 = pVM;
     96                pVM->pVMR0 = pVMR0;
    9697                pVM->HCPhysVM = HCPhysVM;
    9798                pVM->pSession = pSession;
     
    108109                    for (i = cIterations; i > 0; i--)
    109110                    {
    110                         rc = SUPCallVMMR0((PVM)pVMR0, VMMR0_DO_NOP, NULL);
     111                        rc = SUPCallVMMR0(pVMR0, VMMR0_DO_NOP, NULL);
    111112                        if (rc != VINF_SUCCESS)
    112113                        {
     
    130131                        {
    131132                            uint64_t OneStartTick = ASMReadTSC();
    132                             rc = SUPCallVMMR0((PVM)pVMR0, VMMR0_DO_NOP, NULL);
     133                            rc = SUPCallVMMR0(pVMR0, VMMR0_DO_NOP, NULL);
    133134                            uint64_t Ticks = ASMReadTSC() - OneStartTick;
    134135                            if (Ticks < MinTicks)
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