VirtualBox

Changeset 44346 in vbox


Ignore:
Timestamp:
Jan 23, 2013 11:39:39 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
83304
Message:

TM: PVM -> PUVM in two APIs used by Main. VMReq: Validate pUVM properly for external acalls as well.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/tm.h

    r37517 r44346  
    8888VMMR3DECL(int)          TMR3NotifySuspend(PVM pVM, PVMCPU pVCpu);
    8989VMMR3DECL(int)          TMR3NotifyResume(PVM pVM, PVMCPU pVCpu);
    90 VMMR3DECL(int)          TMR3SetWarpDrive(PVM pVM, uint32_t u32Percent);
    91 #endif
    92 VMMDECL(uint32_t)       TMGetWarpDrive(PVM pVM);
     90VMMR3DECL(int)          TMR3SetWarpDrive(PUVM pUVM, uint32_t u32Percent);
     91VMMR3DECL(uint32_t)     TMR3GetWarpDrive(PUVM pUVM);
     92#endif
    9393VMM_INT_DECL(uint32_t)  TMCalcHostTimerFrequency(PVM pVM, PVMCPU pVCpu);
    9494#ifdef IN_RING3
  • trunk/src/VBox/Main/src-client/MachineDebuggerImpl.cpp

    r44340 r44346  
    786786        hrc = ptrVM.rc();
    787787        if (SUCCEEDED(hrc))
    788             *a_puPct = TMGetWarpDrive(ptrVM.raw());
     788            *a_puPct = TMR3GetWarpDrive(ptrVM.rawUVM());
    789789    }
    790790
     
    816816            if (SUCCEEDED(hrc))
    817817            {
    818                 int vrc = TMR3SetWarpDrive(ptrVM.raw(), a_uPct);
     818                int vrc = TMR3SetWarpDrive(ptrVM.rawUVM(), a_uPct);
    819819                if (RT_FAILURE(vrc))
    820820                    hrc = setError(VBOX_E_VM_ERROR, tr("TMR3SetWarpDrive(, %u) failed with rc=%Rrc"), a_uPct, vrc);
  • trunk/src/VBox/VMM/VMMAll/TMAll.cpp

    r41965 r44346  
    7272# define TMTIMER_ASSERT_CRITSECT(pTimer) do { } while (0)
    7373#endif
    74 
    75 
    76 /**
    77  * Gets the current warp drive percent.
    78  *
    79  * @returns The warp drive percent.
    80  * @param   pVM         Pointer to the VM.
    81  */
    82 VMMDECL(uint32_t) TMGetWarpDrive(PVM pVM)
    83 {
    84     return pVM->tm.s.u32VirtualWarpDrivePercentage;
    85 }
    8674
    8775
  • trunk/src/VBox/VMM/VMMR3/TM.cpp

    r42493 r44346  
    135135#include "TMInternal.h"
    136136#include <VBox/vmm/vm.h>
     137#include <VBox/vmm/uvm.h>
    137138
    138139#include <VBox/vmm/pdmdev.h>
     
    171172static void                 tmR3TimerQueueRun(PVM pVM, PTMTIMERQUEUE pQueue);
    172173static void                 tmR3TimerQueueRunVirtualSync(PVM pVM);
    173 static DECLCALLBACK(int)    tmR3SetWarpDrive(PVM pVM, uint32_t u32Percent);
     174static DECLCALLBACK(int)    tmR3SetWarpDrive(PUVM pUVM, uint32_t u32Percent);
    174175#ifndef VBOX_WITHOUT_NS_ACCOUNTING
    175176static DECLCALLBACK(void)   tmR3CpuLoadTimer(PVM pVM, PTMTIMER pTimer, void *pvUser);
     
    27192720 * @param   u32Percent  The new percentage. 100 means normal operation.
    27202721 */
    2721 VMMDECL(int) TMR3SetWarpDrive(PVM pVM, uint32_t u32Percent)
    2722 {
    2723     return VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)tmR3SetWarpDrive, 2, pVM, u32Percent);
     2722VMMDECL(int) TMR3SetWarpDrive(PUVM pUVM, uint32_t u32Percent)
     2723{
     2724    return VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)tmR3SetWarpDrive, 2, pUVM, u32Percent);
    27242725}
    27252726
     
    27292730 *
    27302731 * @returns VBox status code.
    2731  * @param   pVM         Pointer to the VM.
     2732 * @param   pUVM        The user mode VM handle.
    27322733 * @param   u32Percent  See TMR3SetWarpDrive().
    27332734 * @internal
    27342735 */
    2735 static DECLCALLBACK(int) tmR3SetWarpDrive(PVM pVM, uint32_t u32Percent)
    2736 {
     2736static DECLCALLBACK(int) tmR3SetWarpDrive(PUVM pUVM, uint32_t u32Percent)
     2737{
     2738    PVM    pVM = pUVM->pVM;
     2739    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    27372740    PVMCPU pVCpu = VMMGetCpu(pVM);
    27382741
     
    27652768    TM_UNLOCK_TIMERS(pVM);
    27662769    return VINF_SUCCESS;
     2770}
     2771
     2772
     2773/**
     2774 * Gets the current warp drive percent.
     2775 *
     2776 * @returns The warp drive percent.
     2777 * @param   pVM         Pointer to the VM.
     2778 */
     2779VMMR3DECL(uint32_t) TMR3GetWarpDrive(PUVM pUVM)
     2780{
     2781    UVM_ASSERT_VALID_EXT_RETURN(pUVM, UINT32_MAX);
     2782    PVM pVM = pUVM->pVM;
     2783    VM_ASSERT_VALID_EXT_RETURN(pVM, UINT32_MAX);
     2784    return pVM->tm.s.u32VirtualWarpDrivePercentage;
    27672785}
    27682786
  • trunk/src/VBox/VMM/VMMR3/VMReq.cpp

    r44340 r44346  
    465465     */
    466466    AssertPtrReturn(pfnFunction, VERR_INVALID_POINTER);
    467     AssertPtrReturn(pUVM, VERR_INVALID_POINTER);
     467    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
    468468    AssertReturn(!(fFlags & ~(VMREQFLAGS_RETURN_MASK | VMREQFLAGS_NO_WAIT | VMREQFLAGS_POKE | VMREQFLAGS_PRIORITY)), VERR_INVALID_PARAMETER);
    469469    if (!(fFlags & VMREQFLAGS_NO_WAIT) || ppReq)
  • trunk/src/VBox/VMM/testcase/tstAnimate.cpp

    r44340 r44346  
    861861                    if (u32WarpDrive != 100)
    862862                    {
    863                         rc = TMR3SetWarpDrive(pVM, u32WarpDrive);
     863                        rc = TMR3SetWarpDrive(pUVM, u32WarpDrive);
    864864                        if (RT_FAILURE(rc))
    865865                            RTPrintf("warning: TMVirtualSetWarpDrive(,%u) -> %Rrc\n", u32WarpDrive, rc);
Note: See TracChangeset for help on using the changeset viewer.

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