VirtualBox

Changeset 62596 in vbox for trunk/src


Ignore:
Timestamp:
Jul 27, 2016 2:36:46 PM (8 years ago)
Author:
vboxsync
Message:

VMM/TM: new functions for getting virtual time from R3

Location:
trunk/src/VBox/VMM/VMMR3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/TM.cpp

    r62478 r62596  
    29132913
    29142914/**
     2915 * Gets the current TMCLOCK_VIRTUAL time without checking
     2916 * timers or anything.
     2917 *
     2918 * @returns The timestamp.
     2919 * @param   pUVM        The user mode VM structure.
     2920 *
     2921 * @remarks See TMVirtualGetNoCheck.
     2922 */
     2923VMMR3DECL(uint64_t) TMR3TimeVirtGet(PUVM pUVM)
     2924{
     2925    UVM_ASSERT_VALID_EXT_RETURN(pUVM, UINT64_MAX);
     2926    PVM pVM = pUVM->pVM;
     2927    VM_ASSERT_VALID_EXT_RETURN(pVM, UINT64_MAX);
     2928    return TMVirtualGetNoCheck(pVM);
     2929}
     2930
     2931/**
     2932 * Gets the current TMCLOCK_VIRTUAL time in milliseconds without checking
     2933 * timers or anything.
     2934 *
     2935 * @returns The timestamp in milliseconds.
     2936 * @param   pUVM        The user mode VM structure.
     2937 *
     2938 * @remarks See TMVirtualGetNoCheck.
     2939 */
     2940VMMR3DECL(uint64_t) TMR3TimeVirtGetMilli(PUVM pUVM)
     2941{
     2942    UVM_ASSERT_VALID_EXT_RETURN(pUVM, UINT64_MAX);
     2943    PVM pVM = pUVM->pVM;
     2944    VM_ASSERT_VALID_EXT_RETURN(pVM, UINT64_MAX);
     2945    return TMVirtualToMilli(pVM, TMVirtualGetNoCheck(pVM));
     2946}
     2947
     2948/**
     2949 * Gets the current TMCLOCK_VIRTUAL time in microseconds without checking
     2950 * timers or anything.
     2951 *
     2952 * @returns The timestamp in microseconds.
     2953 * @param   pUVM        The user mode VM structure.
     2954 *
     2955 * @remarks See TMVirtualGetNoCheck.
     2956 */
     2957VMMR3DECL(uint64_t) TMR3TimeVirtGetMicro(PUVM pUVM)
     2958{
     2959    UVM_ASSERT_VALID_EXT_RETURN(pUVM, UINT64_MAX);
     2960    PVM pVM = pUVM->pVM;
     2961    VM_ASSERT_VALID_EXT_RETURN(pVM, UINT64_MAX);
     2962    return TMVirtualToMicro(pVM, TMVirtualGetNoCheck(pVM));
     2963}
     2964
     2965/**
     2966 * Gets the current TMCLOCK_VIRTUAL time in nanoseconds without checking
     2967 * timers or anything.
     2968 *
     2969 * @returns The timestamp in nanoseconds.
     2970 * @param   pUVM        The user mode VM structure.
     2971 *
     2972 * @remarks See TMVirtualGetNoCheck.
     2973 */
     2974VMMR3DECL(uint64_t) TMR3TimeVirtGetNano(PUVM pUVM)
     2975{
     2976    UVM_ASSERT_VALID_EXT_RETURN(pUVM, UINT64_MAX);
     2977    PVM pVM = pUVM->pVM;
     2978    VM_ASSERT_VALID_EXT_RETURN(pVM, UINT64_MAX);
     2979    return TMVirtualToNano(pVM, TMVirtualGetNoCheck(pVM));
     2980}
     2981
     2982
     2983/**
    29152984 * Gets the current warp drive percent.
    29162985 *
  • trunk/src/VBox/VMM/VMMR3/VMMR3.def

    r62534 r62596  
    345345    TMR3GetWarpDrive
    346346    TMR3SetWarpDrive
     347    TMR3TimeVirtGet
     348    TMR3TimeVirtGetMicro
     349    TMR3TimeVirtGetMilli
     350    TMR3TimeVirtGetNano
    347351
    348352    VMMGetCpu
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