[rtems commit] score: Remove TOD_TICKS_PER_SECOND_method()

Sebastian Huber sebh at rtems.org
Mon Sep 6 10:25:31 UTC 2021


Module:    rtems
Branch:    master
Commit:    c8e4de991d34222fd2cc9c732898e0a0727aee82
Changeset: http://git.rtems.org/rtems/commit/?id=c8e4de991d34222fd2cc9c732898e0a0727aee82

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Sep  3 09:36:55 2021 +0200

score: Remove TOD_TICKS_PER_SECOND_method()

Use _Watchdog_Ticks_per_second instead.

---

 cpukit/Makefile.am                    |  1 -
 cpukit/include/rtems/score/todimpl.h  | 20 ++------------------
 cpukit/score/src/coretodtickspersec.c | 30 ------------------------------
 spec/build/cpukit/librtemscpu.yml     |  1 -
 4 files changed, 2 insertions(+), 50 deletions(-)

diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
index 93100b5..6b2c1fb 100644
--- a/cpukit/Makefile.am
+++ b/cpukit/Makefile.am
@@ -1005,7 +1005,6 @@ librtemscpu_a_SOURCES += score/src/timespecdividebyinteger.c
 librtemscpu_a_SOURCES += score/src/timespecgetasnanoseconds.c
 librtemscpu_a_SOURCES += score/src/coretod.c
 librtemscpu_a_SOURCES += score/src/coretodset.c
-librtemscpu_a_SOURCES += score/src/coretodtickspersec.c
 librtemscpu_a_SOURCES += score/src/coretodadjust.c
 librtemscpu_a_SOURCES += score/src/watchdoginsert.c
 librtemscpu_a_SOURCES += score/src/coretodhookdata.c
diff --git a/cpukit/include/rtems/score/todimpl.h b/cpukit/include/rtems/score/todimpl.h
index 02a7fb1..5346f12 100644
--- a/cpukit/include/rtems/score/todimpl.h
+++ b/cpukit/include/rtems/score/todimpl.h
@@ -24,6 +24,7 @@
 #include <rtems/score/timestamp.h>
 #include <rtems/score/timecounterimpl.h>
 #include <rtems/score/watchdog.h>
+#include <rtems/score/watchdogticks.h>
 
 #include <sys/time.h>
 #include <time.h>
@@ -296,26 +297,9 @@ static inline uint32_t _TOD_Seconds_since_epoch( void )
 }
 
 /**
- * @brief Gets number of ticks in a second.
- *
- * This method returns the number of ticks in a second.
- *
- * @note If the clock tick value does not multiply evenly into a second
- *       then this number of ticks will be slightly shorter than a second.
- *
- * @return The number of ticks in a second.
- */
-uint32_t TOD_TICKS_PER_SECOND_method(void);
-
-/**
  *  @brief Gets number of ticks in a second.
- *
- *  This method exists to hide the fact that TOD_TICKS_PER_SECOND can not
- *  be implemented as a macro in a .h file due to visibility issues.
- *  The Configuration Table is not available to SuperCore .h files but
- *  is available to their .c files.
  */
-#define TOD_TICKS_PER_SECOND TOD_TICKS_PER_SECOND_method()
+#define TOD_TICKS_PER_SECOND _Watchdog_Ticks_per_second
 
 /**
  * @brief This routine returns a timeval based upon the internal timespec
diff --git a/cpukit/score/src/coretodtickspersec.c b/cpukit/score/src/coretodtickspersec.c
deleted file mode 100644
index f486097..0000000
--- a/cpukit/score/src/coretodtickspersec.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * @file
- *
- * @ingroup RTEMSScoreTOD
- *
- * @brief This source file contains the implementation of
- *   TOD_TICKS_PER_SECOND_method().
- */
-
-/*  COPYRIGHT (c) 1989-2014.
- *  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.org/license/LICENSE.
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/score/todimpl.h>
-#include <rtems/config.h>
-
-uint32_t TOD_TICKS_PER_SECOND_method(void)
-{
-  return (TOD_MICROSECONDS_PER_SECOND /
-      rtems_configuration_get_microseconds_per_tick());
-}
diff --git a/spec/build/cpukit/librtemscpu.yml b/spec/build/cpukit/librtemscpu.yml
index c033233..5957661 100644
--- a/spec/build/cpukit/librtemscpu.yml
+++ b/spec/build/cpukit/librtemscpu.yml
@@ -1395,7 +1395,6 @@ source:
 - cpukit/score/src/coretodhookrun.c
 - cpukit/score/src/coretodhookunregister.c
 - cpukit/score/src/coretodset.c
-- cpukit/score/src/coretodtickspersec.c
 - cpukit/score/src/debugisthreaddispatchingallowed.c
 - cpukit/score/src/freechain.c
 - cpukit/score/src/futex.c



More information about the vc mailing list