VirtualBox

Ignore:
Timestamp:
Feb 15, 2021 10:45:27 PM (4 years ago)
Author:
vboxsync
Message:

VMM/TM,VMM/DevHlp: Require flag on timers that are to be used in ring-0 (and while refactoring a counte flag to check that all timers have been checked). Removed obsolete timer device helpers. bugref:9943

File:
1 edited

Legend:

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

    r87751 r87760  
    11091109VMMDECL(PTMTIMERR3) TMTimerR3Ptr(PTMTIMER pTimer)
    11101110{
     1111#ifdef IN_RING0
     1112    Assert(pTimer->fFlags & TMTIMER_FLAGS_RING0);
     1113#endif
    11111114    return (PTMTIMERR3)MMHyperCCToR3(pTimer->CTX_SUFF(pVM), pTimer);
    11121115}
     
    11211124VMMDECL(PTMTIMERR0) TMTimerR0Ptr(PTMTIMER pTimer)
    11221125{
     1126#ifdef IN_RING0
     1127    Assert(pTimer->fFlags & TMTIMER_FLAGS_RING0);
     1128#endif
    11231129    return (PTMTIMERR0)MMHyperCCToR0(pTimer->CTX_SUFF(pVM), pTimer);
    11241130}
     
    11331139VMMDECL(PTMTIMERRC) TMTimerRCPtr(PTMTIMER pTimer)
    11341140{
     1141#ifdef IN_RING0
     1142    Assert(pTimer->fFlags & TMTIMER_FLAGS_RING0);
     1143#endif
    11351144    return (PTMTIMERRC)MMHyperCCToRC(pTimer->CTX_SUFF(pVM), pTimer);
    11361145}
     
    11521161VMMDECL(int) TMTimerLock(PTMTIMER pTimer, int rcBusy)
    11531162{
     1163#ifdef IN_RING0
     1164    Assert(pTimer->fFlags & TMTIMER_FLAGS_RING0);
     1165#endif
    11541166    AssertPtr(pTimer);
    11551167    AssertReturn(pTimer->enmClock == TMCLOCK_VIRTUAL_SYNC, VERR_NOT_SUPPORTED);
     
    11651177VMMDECL(void) TMTimerUnlock(PTMTIMER pTimer)
    11661178{
     1179#ifdef IN_RING0
     1180    Assert(pTimer->fFlags & TMTIMER_FLAGS_RING0);
     1181#endif
    11671182    AssertPtr(pTimer);
    11681183    AssertReturnVoid(pTimer->enmClock == TMCLOCK_VIRTUAL_SYNC);
     
    11791194VMMDECL(bool) TMTimerIsLockOwner(PTMTIMER pTimer)
    11801195{
     1196#ifdef IN_RING0
     1197    Assert(pTimer->fFlags & TMTIMER_FLAGS_RING0);
     1198#endif
    11811199    AssertPtr(pTimer);
    11821200    AssertReturn(pTimer->enmClock == TMCLOCK_VIRTUAL_SYNC, false);
     
    13061324VMMDECL(int) TMTimerSet(PTMTIMER pTimer, uint64_t u64Expire)
    13071325{
     1326#ifdef IN_RING0
     1327    Assert(pTimer->fFlags & TMTIMER_FLAGS_RING0);
     1328#endif
    13081329    PVMCC pVM = pTimer->CTX_SUFF(pVM);
    13091330    STAM_COUNTER_INC(&pTimer->StatSetAbsolute);
     
    16131634VMMDECL(int) TMTimerSetRelative(PTMTIMER pTimer, uint64_t cTicksToNext, uint64_t *pu64Now)
    16141635{
     1636#ifdef IN_RING0
     1637    Assert(pTimer->fFlags & TMTIMER_FLAGS_RING0);
     1638#endif
    16151639    PVMCC pVM = pTimer->CTX_SUFF(pVM);
    16161640    STAM_COUNTER_INC(&pTimer->StatSetRelative);
     
    18411865VMMDECL(int) TMTimerSetFrequencyHint(PTMTIMER pTimer, uint32_t uHzHint)
    18421866{
     1867#ifdef IN_RING0
     1868    Assert(pTimer->fFlags & TMTIMER_FLAGS_RING0);
     1869#endif
    18431870    TMTIMER_ASSERT_CRITSECT(pTimer);
    18441871
     
    19361963VMMDECL(int) TMTimerStop(PTMTIMER pTimer)
    19371964{
     1965#ifdef IN_RING0
     1966    Assert(pTimer->fFlags & TMTIMER_FLAGS_RING0);
     1967#endif
    19381968    PVMCC pVM = pTimer->CTX_SUFF(pVM);
    19391969    STAM_COUNTER_INC(&pTimer->StatStop);
     
    20442074VMMDECL(uint64_t) TMTimerGet(PTMTIMER pTimer)
    20452075{
     2076#ifdef IN_RING0
     2077    Assert(pTimer->fFlags & TMTIMER_FLAGS_RING0);
     2078#endif
    20462079    PVMCC pVM = pTimer->CTX_SUFF(pVM);
    20472080    STAM_COUNTER_INC(&pTimer->StatGet);
     
    20772110VMMDECL(uint64_t) TMTimerGetFreq(PTMTIMER pTimer)
    20782111{
     2112#ifdef IN_RING0
     2113    Assert(pTimer->fFlags & TMTIMER_FLAGS_RING0);
     2114#endif
    20792115    switch (pTimer->enmClock)
    20802116    {
     
    21022138VMMDECL(uint64_t) TMTimerGetExpire(PTMTIMER pTimer)
    21032139{
     2140#ifdef IN_RING0
     2141    Assert(pTimer->fFlags & TMTIMER_FLAGS_RING0);
     2142#endif
    21042143    TMTIMER_ASSERT_CRITSECT(pTimer);
    21052144    int cRetries = 1000;
     
    21642203VMMDECL(bool) TMTimerIsActive(PTMTIMER pTimer)
    21652204{
     2205#ifdef IN_RING0
     2206    Assert(pTimer->fFlags & TMTIMER_FLAGS_RING0);
     2207#endif
    21662208    TMTIMERSTATE enmState = pTimer->enmState;
    21672209    switch (enmState)
     
    23412383VMMDECL(uint64_t) TMTimerToNano(PTMTIMER pTimer, uint64_t u64Ticks)
    23422384{
     2385#ifdef IN_RING0
     2386    Assert(pTimer->fFlags & TMTIMER_FLAGS_RING0);
     2387#endif
    23432388    switch (pTimer->enmClock)
    23442389    {
     
    23702415VMMDECL(uint64_t) TMTimerToMicro(PTMTIMER pTimer, uint64_t u64Ticks)
    23712416{
     2417#ifdef IN_RING0
     2418    Assert(pTimer->fFlags & TMTIMER_FLAGS_RING0);
     2419#endif
    23722420    switch (pTimer->enmClock)
    23732421    {
     
    23992447VMMDECL(uint64_t) TMTimerToMilli(PTMTIMER pTimer, uint64_t u64Ticks)
    24002448{
     2449#ifdef IN_RING0
     2450    Assert(pTimer->fFlags & TMTIMER_FLAGS_RING0);
     2451#endif
    24012452    switch (pTimer->enmClock)
    24022453    {
     
    24272478VMMDECL(uint64_t) TMTimerFromNano(PTMTIMER pTimer, uint64_t cNanoSecs)
    24282479{
     2480#ifdef IN_RING0
     2481    Assert(pTimer->fFlags & TMTIMER_FLAGS_RING0);
     2482#endif
    24292483    switch (pTimer->enmClock)
    24302484    {
     
    24552509VMMDECL(uint64_t) TMTimerFromMicro(PTMTIMER pTimer, uint64_t cMicroSecs)
    24562510{
     2511#ifdef IN_RING0
     2512    Assert(pTimer->fFlags & TMTIMER_FLAGS_RING0);
     2513#endif
    24572514    switch (pTimer->enmClock)
    24582515    {
     
    24832540VMMDECL(uint64_t) TMTimerFromMilli(PTMTIMER pTimer, uint64_t cMilliSecs)
    24842541{
     2542#ifdef IN_RING0
     2543    Assert(pTimer->fFlags & TMTIMER_FLAGS_RING0);
     2544#endif
    24852545    switch (pTimer->enmClock)
    24862546    {
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