2007-04-04 Joel Sherrill <joel@OARcorp.com>

* score/Makefile.am, score/include/rtems/score/tod.h,
	score/inline/rtems/score/tod.inl: Make _TOD_Tickle_ticks a real
	non-inlined routine. It should only be used once so there is little
	advantage to inlining it.
	* score/src/coretodtickle.c: New file.
This commit is contained in:
Joel Sherrill
2007-04-04 13:54:10 +00:00
parent 551db24a70
commit fc054cabb5
5 changed files with 77 additions and 30 deletions

View File

@@ -1,3 +1,11 @@
2007-04-04 Joel Sherrill <joel@OARcorp.com>
* score/Makefile.am, score/include/rtems/score/tod.h,
score/inline/rtems/score/tod.inl: Make _TOD_Tickle_ticks a real
non-inlined routine. It should only be used once so there is little
advantage to inlining it.
* score/src/coretodtickle.c: New file.
2007-04-02 Joel Sherrill <joel@OARcorp.com>
* posix/Makefile.am, score/src/objectgetnoprotection.c: Eliminate some

View File

@@ -139,9 +139,12 @@ libscore_a_SOURCES += src/threadq.c src/threadqdequeue.c \
src/threadqfirstpriority.c src/threadqflush.c src/threadqrequeue.c \
src/threadqtimeout.c
## TIMESPEC_C_FILES
## libscore_a_SOURCES +=
## TOD_C_FILES
libscore_a_SOURCES += src/coretod.c src/coretodset.c src/coretodget.c \
src/coretodgetuptime.c
src/coretodgetuptime.c src/coretodtickle.c
## WATCHDOG_C_FILES
libscore_a_SOURCES += src/watchdog.c src/watchdogadjust.c \

View File

@@ -184,6 +184,12 @@ void _TOD_Get_uptime(
struct timespec *time
);
/**
* This routine increments the ticks field of the current time of
* day at each clock tick.
*/
void _TOD_Tickle_ticks( void );
/** @brief TOD_MILLISECONDS_TO_MICROSECONDS
*
* This routine converts an interval expressed in milliseconds to microseconds.

View File

@@ -54,35 +54,6 @@ RTEMS_INLINE_ROUTINE uint32_t _TOD_Add_timespec(
return seconds;
}
/**
* This routine increments the ticks field of the current time of
* day at each clock tick.
*/
RTEMS_INLINE_ROUTINE void _TOD_Tickle_ticks( void )
{
struct timespec tick;
uint32_t seconds;
/* Convert the tick quantum to a timespec */
tick.tv_nsec = _TOD_Microseconds_per_tick * 1000;
tick.tv_sec = 0;
/* Update the counter of ticks since boot */
_Watchdog_Ticks_since_boot += 1;
/* Update the timespec format uptime */
(void) _TOD_Add_timespec( &_TOD_Uptime, &tick );
/* we do not care how much the uptime changed */
/* Update the timespec format TOD */
seconds = _TOD_Add_timespec( &_TOD_Now, &tick );
while ( seconds ) {
_Watchdog_Tickle_seconds();
seconds--;
}
}
/**
* This routine deactivates updating of the current time of day.
*/

View File

@@ -0,0 +1,59 @@
/*
* Time of Day (TOD) Handler -- Tickle Ticks
*
* COPYRIGHT (c) 1989-2007.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/score/thread.h>
#include <rtems/score/tod.h>
#include <rtems/score/watchdog.h>
/*PAGE
*
* _TOD_Tickle_ticks
*
* This routine processes a clock tick.
*
* Input parameters: NONE
*
* Output parameters: NONE
*/
void _TOD_Tickle_ticks( void )
{
struct timespec tick;
uint32_t seconds;
/* Convert the tick quantum to a timespec */
tick.tv_nsec = _TOD_Microseconds_per_tick * 1000;
tick.tv_sec = 0;
/* Update the counter of ticks since boot */
_Watchdog_Ticks_since_boot += 1;
/* Update the timespec format uptime */
(void) _TOD_Add_timespec( &_TOD_Uptime, &tick );
/* we do not care how much the uptime changed */
/* Update the timespec format TOD */
seconds = _TOD_Add_timespec( &_TOD_Now, &tick );
while ( seconds ) {
_Watchdog_Tickle_seconds();
seconds--;
}
}