VirtualBox

Changeset 54251 in vbox


Ignore:
Timestamp:
Feb 17, 2015 7:22:22 PM (10 years ago)
Author:
vboxsync
Message:

asm-amd64-x86.h: Added ASMReadTscWithAux().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/asm-amd64-x86.h

    r53405 r54251  
    7272#  pragma intrinsic(__readeflags)
    7373#  pragma intrinsic(__writeeflags)
     74#  pragma intrinsic(__rdtscp)
    7475# endif
    7576#endif
     
    546547        mov     [u.s.Lo], eax
    547548        mov     [u.s.Hi], edx
     549    }
     550#  endif
     551# endif
     552    return u.u;
     553}
     554#endif
     555
     556
     557/**
     558 * Gets the content of the CPU timestamp counter register and the
     559 * assoicated AUX value.
     560 *
     561 * @returns TSC.
     562 * @param   puAux   Where to store the AUX value.
     563 */
     564#if RT_INLINE_ASM_EXTERNAL && RT_INLINE_ASM_USES_INTRIN < 15
     565DECLASM(uint64_t) ASMReadTscWithAux(uint32_t *puAux);
     566#else
     567DECLINLINE(uint64_t) ASMReadTscWithAux(uint32_t *puAux)
     568{
     569    RTUINT64U u;
     570# if RT_INLINE_ASM_GNU_STYLE
     571    __asm__ __volatile__("rdtscp\n\t" : "=a" (u.s.Lo), "=d" (u.s.Hi), "=c" (*puAux));
     572# else
     573#  if RT_INLINE_ASM_USES_INTRIN >= 15
     574    u.u = __rdtscp(puAux);
     575#  else
     576    __asm
     577    {
     578        rdtscp
     579        mov     [u.s.Lo], eax
     580        mov     [u.s.Hi], edx
     581        mov     eax, [puAux]
     582        mov     [eax], ecx
    548583    }
    549584#  endif
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