4.104.114.84.95
Line | |
---|
1 | /* |
---|
2 | * Clock Manager |
---|
3 | * |
---|
4 | * COPYRIGHT (c) 1989-1999. |
---|
5 | * On-Line Applications Research Corporation (OAR). |
---|
6 | * |
---|
7 | * The license and distribution terms for this file may be |
---|
8 | * found in the file LICENSE in this distribution or at |
---|
9 | * http://www.rtems.com/license/LICENSE. |
---|
10 | * |
---|
11 | * $Id$ |
---|
12 | */ |
---|
13 | |
---|
14 | #if HAVE_CONFIG_H |
---|
15 | #include "config.h" |
---|
16 | #endif |
---|
17 | |
---|
18 | #include <rtems/system.h> |
---|
19 | #include <rtems/rtems/status.h> |
---|
20 | #include <rtems/rtems/clock.h> |
---|
21 | #include <rtems/score/isr.h> |
---|
22 | #include <rtems/score/thread.h> |
---|
23 | #include <rtems/score/tod.h> |
---|
24 | #include <rtems/score/watchdog.h> |
---|
25 | |
---|
26 | /*PAGE |
---|
27 | * |
---|
28 | * rtems_clock_tick |
---|
29 | * |
---|
30 | * This directive notifies the executve that a tick has occurred. |
---|
31 | * When the tick occurs the time manager updates and maintains |
---|
32 | * the calendar time, timeslicing, and any timeout delays. |
---|
33 | * |
---|
34 | * Input parameters: NONE |
---|
35 | * |
---|
36 | * Output parameters: |
---|
37 | * RTEMS_SUCCESSFUL - always succeeds |
---|
38 | * |
---|
39 | * NOTE: This routine only works for leap-years through 2099. |
---|
40 | */ |
---|
41 | |
---|
42 | rtems_status_code rtems_clock_tick( void ) |
---|
43 | { |
---|
44 | _TOD_Tickle_ticks(); |
---|
45 | |
---|
46 | _Watchdog_Tickle_ticks(); |
---|
47 | |
---|
48 | _Thread_Tickle_timeslice(); |
---|
49 | |
---|
50 | if ( _Thread_Is_context_switch_necessary() && |
---|
51 | _Thread_Is_dispatching_enabled() ) |
---|
52 | _Thread_Dispatch(); |
---|
53 | |
---|
54 | return RTEMS_SUCCESSFUL; |
---|
55 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.