source: rtems/cpukit/score/src/coretodtickle.c @ 632e4306

4.104.115
Last change on this file since 632e4306 was 26fb4aa, checked in by Joel Sherrill <joel.sherrill@…>, on 12/16/08 at 20:53:34

2008-12-16 Joel Sherrill <joel.sherrill@…>

  • libblock/src/bdbuf.c, libmisc/capture/capture-cli.c, libmisc/capture/capture.c, libmisc/mw-fb/mw_uid.c, rtems/include/rtems/rtems/support.h, score/Makefile.am, score/include/rtems/score/tod.h, score/src/coretod.c, score/src/coretodtickle.c: Eliminate all public use of TOD conversion routines. Eliminate _TOD_Microseconds_per_tick and let every place use the field directly from the Configuration Table. This required moving some methods from macros to bodies.
  • score/src/coretodmsecstoticks.c, score/src/coretodtickspersec.c, score/src/coretodusectoticks.c: New files.
  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 *  Time of Day (TOD) Handler -- Tickle Ticks
3 */
4
5/*  COPYRIGHT (c) 1989-2007.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#if HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#include <rtems/system.h>
20#include <rtems/score/object.h>
21#include <rtems/score/thread.h>
22#include <rtems/score/timestamp.h>
23#include <rtems/score/tod.h>
24#include <rtems/score/watchdog.h>
25#include <rtems/config.h>
26
27/*PAGE
28 *
29 *  _TOD_Tickle_ticks
30 *
31 *  This routine processes a clock tick.
32 *
33 *  Input parameters: NONE
34 *
35 *  Output parameters: NONE
36 */
37
38void _TOD_Tickle_ticks( void )
39{
40  Timestamp_Control tick;
41  uint32_t          seconds;
42
43  /* Convert the tick quantum to a timestamp */
44  _Timestamp_Set( &tick, 0, rtems_configuration_get_nanoseconds_per_tick() );
45
46  /* Update the counter of ticks since boot */
47  _Watchdog_Ticks_since_boot += 1;
48
49  /* Update the timespec format uptime */
50  _Timestamp_Add_to( &_TOD_Uptime, &tick );
51  /* we do not care how much the uptime changed */
52
53  /* Update the timespec format TOD */
54  seconds = _Timestamp_Add_to_at_tick( &_TOD_Now, &tick );
55  while ( seconds ) {
56    _Watchdog_Tickle_seconds();
57    seconds--;
58  }
59}
60
Note: See TracBrowser for help on using the repository browser.