VirtualBox

Changeset 87760 in vbox for trunk/src/VBox/Devices/PC


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

Location:
trunk/src/VBox/Devices/PC
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevACPI.cpp

    r86408 r87760  
    43884388     */
    43894389    rc = PDMDevHlpTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, acpiR3PmTimer, NULL /*pvUser*/,
    4390                               TMTIMER_FLAGS_NO_CRIT_SECT, "ACPI PM Timer", &pThis->hPmTimer);
     4390                              TMTIMER_FLAGS_NO_CRIT_SECT | TMTIMER_FLAGS_RING0, "ACPI PM Timer", &pThis->hPmTimer);
    43914391    AssertRCReturn(rc, rc);
    43924392
  • trunk/src/VBox/Devices/PC/DevHPET.cpp

    r86591 r87760  
    14651465
    14661466        rc = PDMDevHlpTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, hpetR3Timer, pHpetTimer,
    1467                                   TMTIMER_FLAGS_NO_CRIT_SECT, s_apszTimerNames[i], &pThis->aTimers[i].hTimer);
     1467                                  TMTIMER_FLAGS_NO_CRIT_SECT | TMTIMER_FLAGS_RING0,
     1468                                  s_apszTimerNames[i], &pThis->aTimers[i].hTimer);
    14681469        AssertRCReturn(rc, rc);
    14691470        /** @todo r=bird: This is TOTALLY MESSED UP!  Why do we need
  • trunk/src/VBox/Devices/PC/DevPit-i8254.cpp

    r84334 r87760  
    14241424     */
    14251425    rc = PDMDevHlpTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, pitR3Timer, &pThis->channels[0],
    1426                               TMTIMER_FLAGS_NO_CRIT_SECT, "i8254 Programmable Interval Timer", &pThis->channels[0].hTimer);
     1426                              TMTIMER_FLAGS_NO_CRIT_SECT | TMTIMER_FLAGS_RING0,
     1427                              "i8254 Programmable Interval Timer", &pThis->channels[0].hTimer);
    14271428    AssertRCReturn(rc, rc);
    14281429    rc = PDMDevHlpTimerSetCritSect(pDevIns, pThis->channels[0].hTimer, &pThis->CritSect);
  • trunk/src/VBox/Devices/PC/DevRTC.cpp

    r82968 r87760  
    588588    RT_NOREF2(pTimer, pvUser);
    589589    PRTCSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PRTCSTATE);
    590     Assert(pTimer == PDMDevHlpTimerToPtr(pDevIns, pThis->hPeriodicTimer));
    591590    Assert(PDMDevHlpTimerIsLockOwner(pDevIns, pThis->hPeriodicTimer));
    592591    Assert(PDMDevHlpCritSectIsOwner(pDevIns, pDevIns->CTX_SUFF(pCritSectRo)));
     
    667666 * @callback_method_impl{FNTMTIMERDEV, Second timer.}
    668667 */
    669 static DECLCALLBACK(void) rtcTimerSecond(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser)
     668static DECLCALLBACK(void) rtcR3TimerSecond(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser)
    670669{
    671670    PRTCSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PRTCSTATE);
     
    673672    Assert(PDMDevHlpTimerIsLockOwner(pDevIns, pThis->hPeriodicTimer));
    674673    Assert(PDMDevHlpCritSectIsOwner(pDevIns, pDevIns->CTX_SUFF(pCritSectRo)));
    675     Assert(pTimer == PDMDevHlpTimerToPtr(pDevIns, pThis->hSecondTimer));
    676674    RT_NOREF(pvUser, pTimer);
    677675
     
    700698
    701699
    702 /* Used by rtc_set_date and rtcTimerSecond2. */
     700/* Used by rtc_set_date and rtcR3TimerSecond2. */
    703701static void rtc_copy_date(PRTCSTATE pThis)
    704702{
     
    730728 * @callback_method_impl{FNTMTIMERDEV, Second2 timer.}
    731729 */
    732 static DECLCALLBACK(void) rtcTimerSecond2(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser)
     730static DECLCALLBACK(void) rtcR3TimerSecond2(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser)
    733731{
    734732    PRTCSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PRTCSTATE);
     
    736734    Assert(PDMDevHlpTimerIsLockOwner(pDevIns, pThis->hPeriodicTimer));
    737735    Assert(PDMDevHlpCritSectIsOwner(pDevIns, pDevIns->CTX_SUFF(pCritSectRo)));
    738     Assert(pTimer == PDMDevHlpTimerToPtr(pDevIns, pThis->hSecondTimer2));
    739736    RT_NOREF2(pTimer, pvUser);
    740737
     
    11591156    /* Periodic timer. */
    11601157    rc = PDMDevHlpTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, rtcTimerPeriodic, pThis,
    1161                               TMTIMER_FLAGS_DEFAULT_CRIT_SECT, "MC146818 RTC (CMOS) - Periodic", &pThis->hPeriodicTimer);
     1158                              TMTIMER_FLAGS_DEFAULT_CRIT_SECT | TMTIMER_FLAGS_RING0,
     1159                              "MC146818 RTC (CMOS) - Periodic", &pThis->hPeriodicTimer);
    11621160    AssertRCReturn(rc, rc);
    11631161
    11641162    /* Seconds timer. */
    1165     rc = PDMDevHlpTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, rtcTimerSecond, pThis,
    1166                               TMTIMER_FLAGS_DEFAULT_CRIT_SECT, "MC146818 RTC (CMOS) - Second", &pThis->hSecondTimer);
     1163    rc = PDMDevHlpTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, rtcR3TimerSecond, pThis,
     1164                              TMTIMER_FLAGS_DEFAULT_CRIT_SECT | TMTIMER_FLAGS_RING0,
     1165                              "MC146818 RTC (CMOS) - Second", &pThis->hSecondTimer);
    11671166    AssertRCReturn(rc, rc);
    11681167
    11691168    /* The second2 timer, this is always active. */
    1170     rc = PDMDevHlpTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, rtcTimerSecond2, pThis,
    1171                               TMTIMER_FLAGS_DEFAULT_CRIT_SECT, "MC146818 RTC (CMOS) - Second2", &pThis->hSecondTimer2);
     1169    rc = PDMDevHlpTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, rtcR3TimerSecond2, pThis,
     1170                              TMTIMER_FLAGS_DEFAULT_CRIT_SECT | TMTIMER_FLAGS_NO_RING0,
     1171                              "MC146818 RTC (CMOS) - Second2", &pThis->hSecondTimer2);
    11721172    AssertRCReturn(rc, rc);
    11731173
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