source: rtems/cpukit/rtems/src/clocktick.c @ 24934e36

4.115
Last change on this file since 24934e36 was 24934e36, checked in by Sebastian Huber <sebastian.huber@…>, on 04/03/14 at 13:03:35

score: Add scheduler control to scheduler ops

Scheduler operations must be free of a global scheduler context to
enable partitioned/clustered scheduling.

  • Property mode set to 100644
File size: 972 bytes
Line 
1/**
2 *  @file
3 *
4 *  @brief Announce a Clock Tick
5 *  @ingroup ClassicClock
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2009.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/rtems/clock.h>
22#include <rtems/score/schedulerimpl.h>
23#include <rtems/score/threadimpl.h>
24#include <rtems/score/todimpl.h>
25#include <rtems/score/watchdogimpl.h>
26
27rtems_status_code rtems_clock_tick( void )
28{
29#if defined( RTEMS_SMP )
30  _Thread_Disable_dispatch();
31#endif
32
33  _TOD_Tickle_ticks();
34
35  _Watchdog_Tickle_ticks();
36
37  _Scheduler_Tick( _Scheduler_Get( NULL ) );
38
39#if defined( RTEMS_SMP )
40  _Thread_Enable_dispatch();
41#else
42  if ( _Thread_Is_context_switch_necessary() &&
43       _Thread_Dispatch_is_enabled() )
44    _Thread_Dispatch();
45#endif
46
47  return RTEMS_SUCCESSFUL;
48}
Note: See TracBrowser for help on using the repository browser.