tstRTR0TimerDriver.cpp revision 72b8475aa6b56364852ae8c3e02cc1fb06cb9232
60b32e7ca2a75ab3f7e70c3a4bdcd7cfedf5be57vboxsync * IPRT R0 Testcase - Timers, driver program.
60b32e7ca2a75ab3f7e70c3a4bdcd7cfedf5be57vboxsync * Copyright (C) 2009-2010 Oracle Corporation
60b32e7ca2a75ab3f7e70c3a4bdcd7cfedf5be57vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
60b32e7ca2a75ab3f7e70c3a4bdcd7cfedf5be57vboxsync * available from http://www.virtualbox.org. This file is free software;
60b32e7ca2a75ab3f7e70c3a4bdcd7cfedf5be57vboxsync * you can redistribute it and/or modify it under the terms of the GNU
60b32e7ca2a75ab3f7e70c3a4bdcd7cfedf5be57vboxsync * General Public License (GPL) as published by the Free Software
60b32e7ca2a75ab3f7e70c3a4bdcd7cfedf5be57vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
60b32e7ca2a75ab3f7e70c3a4bdcd7cfedf5be57vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
60b32e7ca2a75ab3f7e70c3a4bdcd7cfedf5be57vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
60b32e7ca2a75ab3f7e70c3a4bdcd7cfedf5be57vboxsync * The contents of this file may alternatively be used under the terms
60b32e7ca2a75ab3f7e70c3a4bdcd7cfedf5be57vboxsync * of the Common Development and Distribution License Version 1.0
60b32e7ca2a75ab3f7e70c3a4bdcd7cfedf5be57vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
60b32e7ca2a75ab3f7e70c3a4bdcd7cfedf5be57vboxsync * VirtualBox OSE distribution, in which case the provisions of the
60b32e7ca2a75ab3f7e70c3a4bdcd7cfedf5be57vboxsync * CDDL are applicable instead of those of the GPL.
60b32e7ca2a75ab3f7e70c3a4bdcd7cfedf5be57vboxsync * You may elect to license modified versions of this file under the
60b32e7ca2a75ab3f7e70c3a4bdcd7cfedf5be57vboxsync * terms and conditions of either the GPL or the CDDL or both.
60b32e7ca2a75ab3f7e70c3a4bdcd7cfedf5be57vboxsync/*******************************************************************************
60b32e7ca2a75ab3f7e70c3a4bdcd7cfedf5be57vboxsync* Header Files *
60b32e7ca2a75ab3f7e70c3a4bdcd7cfedf5be57vboxsync*******************************************************************************/
7e3ff7c4e45ee1f8eb46a1aba9d2d8816d337c4avboxsync RTEXITCODE rcExit = RTR3TestR0CommonDriverInit("tstRTR0Timer");
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync RTR3TestR0SimpleTest(TSTRTR0TIMER_LATENCY_OMNI, "Latency omni timer");
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync RTR3TestR0SimpleTest(TSTRTR0TIMER_LATENCY_OMNI_HIRES, "Latency omni hires timer");
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync * Standard timers.
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync RTR3TestR0SimpleTest(TSTRTR0TIMER_ONE_SHOT_BASIC, "Basic one shot");
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync RTR3TestR0SimpleTest(TSTRTR0TIMER_PERIODIC_BASIC, "Basic periodic");
28d34e9bb91646a6f96c0841eeb0ea980df4c38dvboxsync# ifndef RT_OS_SOLARIS /* Solaris cannot call back into cyclic subsystem from a cyclic callback. */
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync RTR3TestR0SimpleTest(TSTRTR0TIMER_ONE_SHOT_RESTART, "Restart one shot from callback");
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync RTR3TestR0SimpleTest(TSTRTR0TIMER_ONE_SHOT_DESTROY, "Destroy one shot from callback");
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync RTR3TestR0SimpleTest(TSTRTR0TIMER_PERIODIC_CSSD_LOOPS, "Create-start-stop-destroy loops");
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync RTR3TestR0SimpleTestWithArg(TSTRTR0TIMER_PERIODIC_CHANGE_INTERVAL, i, "Change interval from callback, variation %u", i);
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync RTR3TestR0SimpleTest(TSTRTR0TIMER_ONE_SHOT_SPECIFIC, "One shot cpu specific");
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync RTR3TestR0SimpleTest(TSTRTR0TIMER_PERIODIC_SPECIFIC, "Periodic cpu specific");
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync RTR3TestR0SimpleTest(TSTRTR0TIMER_PERIODIC_OMNI, "Periodic omni timer");
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync * High resolution timers.
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync RTR3TestR0SimpleTest(TSTRTR0TIMER_ONE_SHOT_BASIC_HIRES, "Basic hires one shot");
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync RTR3TestR0SimpleTest(TSTRTR0TIMER_PERIODIC_BASIC_HIRES, "Basic hires periodic");
28d34e9bb91646a6f96c0841eeb0ea980df4c38dvboxsync# ifndef RT_OS_SOLARIS /* Solaris cannot call back into cyclic subsystem from a cyclic callback. */
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync RTR3TestR0SimpleTest(TSTRTR0TIMER_ONE_SHOT_RESTART_HIRES, "Restart hires one shot from callback");
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync RTR3TestR0SimpleTest(TSTRTR0TIMER_ONE_SHOT_DESTROY_HIRES, "Destroy hires one shot from callback");
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync RTR3TestR0SimpleTest(TSTRTR0TIMER_PERIODIC_CSSD_LOOPS_HIRES, "Create-start-stop-destroy loops, hires");
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync RTR3TestR0SimpleTestWithArg(TSTRTR0TIMER_PERIODIC_CHANGE_INTERVAL, i, "Change interval from callback, hires, variation %u", i);
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync RTR3TestR0SimpleTest(TSTRTR0TIMER_ONE_SHOT_SPECIFIC_HIRES, "One shot hires cpu specific");
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync RTR3TestR0SimpleTest(TSTRTR0TIMER_PERIODIC_SPECIFIC_HIRES, "Periodic hires cpu specific");
72b8475aa6b56364852ae8c3e02cc1fb06cb9232vboxsync RTR3TestR0SimpleTest(TSTRTR0TIMER_PERIODIC_OMNI, "Periodic omni hires timer");