diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-05-17 22:42:47 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-05-17 22:42:47 +0000 |
commit | bd83f4738f0f6d071dee6601f0b71abf27f80469 (patch) | |
tree | 933ade771196c5ec219ec5b4967a5dbb2e9cb524 /cpukit/rtems/src/clocktick.c | |
parent | Split Region Manager into one routine per file. (diff) | |
download | rtems-bd83f4738f0f6d071dee6601f0b71abf27f80469.tar.bz2 |
Split Clock Manager into one routine per file.
Diffstat (limited to 'cpukit/rtems/src/clocktick.c')
-rw-r--r-- | cpukit/rtems/src/clocktick.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/cpukit/rtems/src/clocktick.c b/cpukit/rtems/src/clocktick.c new file mode 100644 index 0000000000..b07c9cb1a0 --- /dev/null +++ b/cpukit/rtems/src/clocktick.c @@ -0,0 +1,52 @@ +/* + * Clock Manager + * + * COPYRIGHT (c) 1989-1998. + * On-Line Applications Research Corporation (OAR). + * Copyright assigned to U.S. Government, 1994. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.OARcorp.com/rtems/license.html. + * + * $Id$ + */ + +#include <rtems/system.h> +#include <rtems/rtems/status.h> +#include <rtems/rtems/clock.h> +#include <rtems/score/isr.h> +#include <rtems/score/thread.h> +#include <rtems/score/tod.h> +#include <rtems/score/watchdog.h> + +/*PAGE + * + * rtems_clock_tick + * + * This directive notifies the executve that a tick has occurred. + * When the tick occurs the time manager updates and maintains + * the calendar time, timeslicing, and any timeout delays. + * + * Input parameters: NONE + * + * Output parameters: + * RTEMS_SUCCESSFUL - always succeeds + * + * NOTE: This routine only works for leap-years through 2099. + */ + +rtems_status_code rtems_clock_tick( void ) +{ + _TOD_Tickle_ticks(); + + _Watchdog_Tickle_ticks(); + + _Thread_Tickle_timeslice(); + + if ( _Thread_Is_context_switch_necessary() && + _Thread_Is_dispatching_enabled() ) + _Thread_Dispatch(); + + return RTEMS_SUCCESSFUL; +} |