[rtems commit] score: Merge tod implementation into one file

Sebastian Huber sebh at rtems.org
Fri Jul 26 09:51:54 UTC 2013


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Jul 25 15:10:11 2013 +0200

score: Merge tod implementation into one file

Delete TOD_MICROSECONDS_PER_SECOND, TOD_MICROSECONDS_TO_TICKS() and
TOD_MILLISECONDS_TO_TICKS().

---

 c/src/ada-tests/support/init.c                   |    3 +-
 c/src/lib/libbsp/i386/pc386/ide/ide.c            |    4 +-
 c/src/lib/libbsp/lm32/shared/startup/bspstart.c  |    6 --
 c/src/lib/libcpu/bfin/clock/rtc.c                |    1 +
 c/src/libchip/network/cs8900.c                   |    8 +-
 c/src/libchip/network/open_eth.c                 |    2 +-
 cpukit/libblock/src/bdbuf.c                      |    2 +-
 cpukit/libcsupport/src/__gettod.c                |    2 +-
 cpukit/libcsupport/src/__times.c                 |    1 +
 cpukit/libmisc/cpuuse/cpuusagereport.c           |    1 +
 cpukit/libmisc/cpuuse/cpuusagereset.c            |    6 +-
 cpukit/libnetworking/rtems/rtems_dhcp.c          |    4 +-
 cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c |    6 +-
 cpukit/posix/src/alarm.c                         |    1 +
 cpukit/posix/src/clockgetcpuclockid.c            |    1 -
 cpukit/posix/src/clockgetenableattr.c            |    1 -
 cpukit/posix/src/clockgetres.c                   |    6 +-
 cpukit/posix/src/clockgettime.c                  |    4 -
 cpukit/posix/src/clocksetenableattr.c            |    1 -
 cpukit/posix/src/mqueueopen.c                    |    4 +-
 cpukit/posix/src/nanosleep.c                     |    1 -
 cpukit/posix/src/posixtimespecabsolutetimeout.c  |    2 +-
 cpukit/posix/src/ptimer.c                        |    1 -
 cpukit/posix/src/sched_getscheduler.c            |    1 -
 cpukit/posix/src/sched_rr_get_interval.c         |    1 -
 cpukit/posix/src/sched_setparam.c                |    1 -
 cpukit/posix/src/sched_setscheduler.c            |    1 -
 cpukit/posix/src/sysconf.c                       |    2 +-
 cpukit/posix/src/timergettime.c                  |    7 +-
 cpukit/posix/src/timersettime.c                  |    8 +-
 cpukit/posix/src/timertsr.c                      |    5 +-
 cpukit/posix/src/ualarm.c                        |    1 +
 cpukit/rtems/include/rtems/rtems/clock.h         |    1 -
 cpukit/rtems/include/rtems/rtems/support.h       |    6 +-
 cpukit/rtems/include/rtems/rtems/types.h         |    1 -
 cpukit/rtems/src/clockget.c                      |    1 -
 cpukit/rtems/src/clockgetsecondssinceepoch.c     |    5 -
 cpukit/rtems/src/clockgettickspersecond.c        |    7 +--
 cpukit/rtems/src/clockgettickssinceboot.c        |    1 -
 cpukit/rtems/src/clockgettod.c                   |    7 +--
 cpukit/rtems/src/clockgettodtimeval.c            |    5 -
 cpukit/rtems/src/clockgetuptime.c                |    6 --
 cpukit/rtems/src/clockgetuptimeseconds.c         |    2 +
 cpukit/rtems/src/clockgetuptimetimeval.c         |    1 +
 cpukit/rtems/src/clocksetnsecshandler.c          |    1 -
 cpukit/rtems/src/clocktodtoseconds.c             |    2 +-
 cpukit/rtems/src/clocktodvalidate.c              |    4 +-
 cpukit/rtems/src/rtclock.c                       |    1 -
 cpukit/rtems/src/rtemstimer.c                    |    1 -
 cpukit/rtems/src/signalsend.c                    |    1 +
 cpukit/rtems/src/taskident.c                     |    1 -
 cpukit/rtems/src/taskinitusers.c                 |    1 -
 cpukit/rtems/src/tasks.c                         |    1 -
 cpukit/rtems/src/taskwakewhen.c                  |    1 +
 cpukit/rtems/src/timercancel.c                   |    1 -
 cpukit/rtems/src/timercreate.c                   |    1 -
 cpukit/rtems/src/timerdelete.c                   |    1 -
 cpukit/rtems/src/timerfireafter.c                |    1 -
 cpukit/rtems/src/timerfirewhen.c                 |    4 -
 cpukit/rtems/src/timergetinfo.c                  |    1 -
 cpukit/rtems/src/timerident.c                    |    1 -
 cpukit/rtems/src/timerreset.c                    |    1 -
 cpukit/rtems/src/timerserver.c                   |    1 +
 cpukit/rtems/src/timerserverfireafter.c          |    1 -
 cpukit/rtems/src/timerserverfirewhen.c           |    4 -
 cpukit/score/Makefile.am                         |    5 +-
 cpukit/score/include/rtems/score/tod.h           |   86 +++++++++++-----------
 cpukit/score/inline/rtems/score/tod.inl          |   72 ------------------
 cpukit/score/preinstall.am                       |    4 -
 cpukit/score/src/coretod.c                       |    3 -
 cpukit/score/src/coretodget.c                    |    1 +
 cpukit/score/src/coretodgetuptimetimespec.c      |    3 -
 cpukit/score/src/coretodmsecstoticks.c           |   44 -----------
 cpukit/score/src/coretodset.c                    |    5 +-
 cpukit/score/src/coretodtickle.c                 |    3 -
 cpukit/score/src/coretodtickspersec.c            |    3 +-
 cpukit/score/src/coretodusectoticks.c            |   44 -----------
 cpukit/score/src/timespecaddto.c                 |    2 -
 cpukit/score/src/timespecdivide.c                |    2 -
 cpukit/score/src/timespecdividebyinteger.c       |    2 -
 cpukit/score/src/timespecfromticks.c             |    5 +-
 cpukit/score/src/timespecisvalid.c               |    3 -
 cpukit/score/src/timespeclessthan.c              |    1 -
 cpukit/score/src/timespecsubtract.c              |    3 -
 cpukit/score/src/timespectoticks.c               |    6 +-
 cpukit/score/src/ts64toticks.c                   |    1 -
 testsuites/libtests/block06/init.c               |    6 +-
 testsuites/psxtests/psx01/init.c                 |    2 +
 testsuites/psxtests/psx05/init.c                 |    2 +
 testsuites/psxtests/psxclock/init.c              |    2 +
 testsuites/samples/nsecs/init.c                  |    7 +-
 testsuites/sptests/sp01/task1.c                  |    7 +--
 testsuites/sptests/sp16/task5.c                  |    7 +--
 testsuites/sptests/spcbssched01/task1.c          |    7 +--
 testsuites/sptests/spedfsched01/task1.c          |    7 +--
 95 files changed, 111 insertions(+), 403 deletions(-)

diff --git a/c/src/ada-tests/support/init.c b/c/src/ada-tests/support/init.c
index ad98409..983e51d 100644
--- a/c/src/ada-tests/support/init.c
+++ b/c/src/ada-tests/support/init.c
@@ -51,8 +51,7 @@ uint32_t milliseconds_per_tick(void)
 
 uint32_t ticks_per_second(void)
 {
-  /* XXX HACK -- use public API */
-  return TOD_TICKS_PER_SECOND;
+  return rtems_clock_get_ticks_per_second();
 }
 
 uint32_t work_space_size(void)
diff --git a/c/src/lib/libbsp/i386/pc386/ide/ide.c b/c/src/lib/libbsp/i386/pc386/ide/ide.c
index 3288cd2..2c2ca91 100644
--- a/c/src/lib/libbsp/i386/pc386/ide/ide.c
+++ b/c/src/lib/libbsp/i386/pc386/ide/ide.c
@@ -63,8 +63,8 @@ static void pc386_ide_prestart_sleep (void)
  */
 static void pc386_ide_tasking_sleep (void)
 {
-  rtems_task_wake_after (TOD_MICROSECONDS_TO_TICKS (10000) ?
-                         TOD_MICROSECONDS_TO_TICKS (10000) : 1);
+  rtems_task_wake_after (RTEMS_MICROSECONDS_TO_TICKS (10000) ?
+                         RTEMS_MICROSECONDS_TO_TICKS (10000) : 1);
 }
 
 typedef void (*pc386_ide_sleeper)(void);
diff --git a/c/src/lib/libbsp/lm32/shared/startup/bspstart.c b/c/src/lib/libbsp/lm32/shared/startup/bspstart.c
index ef82ad0..5b51e47 100644
--- a/c/src/lib/libbsp/lm32/shared/startup/bspstart.c
+++ b/c/src/lib/libbsp/lm32/shared/startup/bspstart.c
@@ -21,12 +21,6 @@
 #include <bsp/bootcard.h>
 #include "../include/system_conf.h"
 #include "../console/uart.h"
-#include <rtems/score/heap.h>
-
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/timespec.h>
-#include <rtems/score/tod.h>
 
 /*
  *  bsp_start
diff --git a/c/src/lib/libcpu/bfin/clock/rtc.c b/c/src/lib/libcpu/bfin/clock/rtc.c
index 7032fe3..657bf8f 100644
--- a/c/src/lib/libcpu/bfin/clock/rtc.c
+++ b/c/src/lib/libcpu/bfin/clock/rtc.c
@@ -16,6 +16,7 @@
 #include <rtems/libio.h>
 #include <bsp.h>
 #include <libcpu/rtcRegs.h>
+#include <rtems/score/tod.h>
 
 /* The following are inside RTEMS -- we are violating visibility!!!
  * Perhaps an API could be defined to get days since 1 Jan.
diff --git a/c/src/libchip/network/cs8900.c b/c/src/libchip/network/cs8900.c
index 8cd907e..6d40fa7 100644
--- a/c/src/libchip/network/cs8900.c
+++ b/c/src/libchip/network/cs8900.c
@@ -258,7 +258,7 @@ cs8900_hardware_init (cs8900_device *cs)
 
   io_pp_bit_set_reg_16 (cs, CS8900_PP_SelfCTL, CS8900_SELF_CTRL_RESET);
 
-  rtems_task_wake_after (TOD_MILLISECONDS_TO_TICKS (20));
+  rtems_task_wake_after (RTEMS_MILLISECONDS_TO_TICKS (20));
 
   status = io_pp_get_reg_16 (cs, CS8900_PP_SelfST);
   if (status == 0) {
@@ -660,7 +660,7 @@ cs8900_rx_task (void *arg)
 
     sc = rtems_bsdnet_event_receive (CS8900_RX_OK_EVENT,
                                      RTEMS_WAIT | RTEMS_EVENT_ANY,
-                                     TOD_MILLISECONDS_TO_TICKS (250),
+                                     RTEMS_MILLISECONDS_TO_TICKS (250),
                                      &events);
 
     cs8900_rx_refill_queue (cs);
@@ -749,7 +749,7 @@ cs8900_tx_task (void *arg)
    * Wait for the link to come up.
    */
 
-  rtems_task_wake_after (TOD_MILLISECONDS_TO_TICKS (750));
+  rtems_task_wake_after (RTEMS_MILLISECONDS_TO_TICKS (750));
 
   /*
    * Loop processing the tx queue.
@@ -815,7 +815,7 @@ cs8900_tx_task (void *arg)
               cs->eth_stats.tx_wait_for_rdy4tx++;
               sc = rtems_bsdnet_event_receive (CS8900_TX_WAIT_EVENT,
                                                RTEMS_WAIT | RTEMS_EVENT_ANY,
-                                               TOD_MILLISECONDS_TO_TICKS (750),
+                                               RTEMS_MILLISECONDS_TO_TICKS (750),
                                                &events);
               if (sc == RTEMS_TIMEOUT)
               {
diff --git a/c/src/libchip/network/open_eth.c b/c/src/libchip/network/open_eth.c
index d7c0b05..b311080 100644
--- a/c/src/libchip/network/open_eth.c
+++ b/c/src/libchip/network/open_eth.c
@@ -459,7 +459,7 @@ sendpacket (struct ifnet *ifp, struct mbuf *m)
           rtems_event_set events;
 	  rtems_bsdnet_event_receive (OPEN_ETH_TX_WAIT_EVENT,
 				      RTEMS_WAIT | RTEMS_EVENT_ANY,
-				      TOD_MILLISECONDS_TO_TICKS(500), &events);
+				      RTEMS_MILLISECONDS_TO_TICKS(500), &events);
 #endif
       }
 
diff --git a/cpukit/libblock/src/bdbuf.c b/cpukit/libblock/src/bdbuf.c
index d2b4238..0fbafaa 100644
--- a/cpukit/libblock/src/bdbuf.c
+++ b/cpukit/libblock/src/bdbuf.c
@@ -206,7 +206,7 @@ typedef enum {
 #define RTEMS_BDBUF_WAIT_TIMEOUT RTEMS_NO_TIMEOUT
 #if !defined (RTEMS_BDBUF_WAIT_TIMEOUT)
 #define RTEMS_BDBUF_WAIT_TIMEOUT \
-  (TOD_MICROSECONDS_TO_TICKS (20000000))
+  (RTEMS_MICROSECONDS_TO_TICKS (20000000))
 #endif
 
 static rtems_task rtems_bdbuf_swapout_task(rtems_task_argument arg);
diff --git a/cpukit/libcsupport/src/__gettod.c b/cpukit/libcsupport/src/__gettod.c
index 73cd04f..d73e681 100644
--- a/cpukit/libcsupport/src/__gettod.c
+++ b/cpukit/libcsupport/src/__gettod.c
@@ -23,7 +23,7 @@
 #if defined(RTEMS_NEWLIB)
 #include <sys/time.h>
 #include <errno.h>
-#include <rtems.h>
+#include <rtems/score/tod.h>
 #include <rtems/seterr.h>
 
 #if defined(RTEMS_NEWLIB) && !defined(HAVE_GETTIMEOFDAY)
diff --git a/cpukit/libcsupport/src/__times.c b/cpukit/libcsupport/src/__times.c
index 71eb4e2..f143bb8 100644
--- a/cpukit/libcsupport/src/__times.c
+++ b/cpukit/libcsupport/src/__times.c
@@ -25,6 +25,7 @@
 #include <sys/time.h>
 #include <errno.h>
 #include <rtems/seterr.h>
+#include <rtems/score/tod.h>
 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
   #include <rtems/score/timestamp.h>
 #endif
diff --git a/cpukit/libmisc/cpuuse/cpuusagereport.c b/cpukit/libmisc/cpuuse/cpuusagereport.c
index aa5a8c6..14945d7 100644
--- a/cpukit/libmisc/cpuuse/cpuusagereport.c
+++ b/cpukit/libmisc/cpuuse/cpuusagereport.c
@@ -26,6 +26,7 @@
 
 #include <rtems/cpuuse.h>
 #include <rtems/score/objectimpl.h>
+#include <rtems/score/tod.h>
 #include <rtems/score/watchdogimpl.h>
 
 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
diff --git a/cpukit/libmisc/cpuuse/cpuusagereset.c b/cpukit/libmisc/cpuuse/cpuusagereset.c
index 77bd095..9f682f3 100644
--- a/cpukit/libmisc/cpuuse/cpuusagereset.c
+++ b/cpukit/libmisc/cpuuse/cpuusagereset.c
@@ -18,11 +18,9 @@
 #include "config.h"
 #endif
 
-#include <stdlib.h>
-#include <ctype.h>
-#include <inttypes.h>
-
 #include <rtems/cpuuse.h>
+#include <rtems/score/thread.h>
+#include <rtems/score/tod.h>
 #include <rtems/score/watchdogimpl.h>
 
 static void CPU_usage_Per_thread_handler(
diff --git a/cpukit/libnetworking/rtems/rtems_dhcp.c b/cpukit/libnetworking/rtems/rtems_dhcp.c
index 4039a48..957a30a 100644
--- a/cpukit/libnetworking/rtems/rtems_dhcp.c
+++ b/cpukit/libnetworking/rtems/rtems_dhcp.c
@@ -712,7 +712,7 @@ dhcp_task (rtems_task_argument _sdl)
     /*
      * Sleep until the next poll
      */
-    timeout = TOD_MILLISECONDS_TO_TICKS (1000);
+    timeout = RTEMS_MILLISECONDS_TO_TICKS (1000);
     ev_st = rtems_event_receive (RTEMS_EVENT_0,
                                  RTEMS_WAIT | RTEMS_EVENT_ANY,
                                  timeout, &event_out);
@@ -1147,7 +1147,7 @@ void rtems_bsdnet_do_dhcp (void)
   while( dhcp_init (update) < 0 ) {
     update = false;
     rtems_bsdnet_semaphore_release();
-    rtems_task_wake_after(TOD_MILLISECONDS_TO_TICKS(1000));
+    rtems_task_wake_after(RTEMS_MILLISECONDS_TO_TICKS(1000));
     rtems_bsdnet_semaphore_obtain ();
   }
   rtems_bsdnet_semaphore_release ();
diff --git a/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c b/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c
index 62046db..3516504 100644
--- a/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c
+++ b/cpukit/libnetworking/rtems/rtems_dhcp_failsafe.c
@@ -257,7 +257,7 @@ do_dhcp_init (struct rtems_bsdnet_ifconfig *ifp)
 {
 #if BROADCAST_DELAY
   /* Wait before sending broadcast. */
-  rtems_task_wake_after(TOD_MILLISECONDS_TO_TICKS(BROADCAST_DELAY * 1000));
+  rtems_task_wake_after(RTEMS_MILLISECONDS_TO_TICKS(BROADCAST_DELAY * 1000));
 #endif
 
   printf ("starting dhcp client...\n");
@@ -303,7 +303,7 @@ static void dhcp_monitor_task (rtems_task_argument ifp_arg)
           must_renew = TRUE;
 #if NETWORK_DOWN_TIME
           dhcp_if_down(ifname);
-          rtems_task_wake_after(TOD_MILLISECONDS_TO_TICKS(NETWORK_DOWN_TIME * 1000));
+          rtems_task_wake_after(RTEMS_MILLISECONDS_TO_TICKS(NETWORK_DOWN_TIME * 1000));
           dhcp_if_up(ifname);
           downcount = 0;
 #endif
@@ -311,7 +311,7 @@ static void dhcp_monitor_task (rtems_task_argument ifp_arg)
       }
     }
 
-    rtems_task_wake_after(TOD_MILLISECONDS_TO_TICKS(1000));
+    rtems_task_wake_after(RTEMS_MILLISECONDS_TO_TICKS(1000));
   }
 
 error_out:
diff --git a/cpukit/posix/src/alarm.c b/cpukit/posix/src/alarm.c
index acdec65..065fae6 100644
--- a/cpukit/posix/src/alarm.c
+++ b/cpukit/posix/src/alarm.c
@@ -25,6 +25,7 @@
 
 #include <rtems/posix/pthreadimpl.h>
 #include <rtems/posix/psignalimpl.h>
+#include <rtems/score/threaddispatch.h>
 #include <rtems/score/tod.h>
 #include <rtems/score/watchdogimpl.h>
 
diff --git a/cpukit/posix/src/clockgetcpuclockid.c b/cpukit/posix/src/clockgetcpuclockid.c
index d69783c..0556e34 100644
--- a/cpukit/posix/src/clockgetcpuclockid.c
+++ b/cpukit/posix/src/clockgetcpuclockid.c
@@ -24,7 +24,6 @@
 #include <rtems/system.h>
 #include <rtems/score/isr.h>
 #include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
 
 #include <rtems/seterr.h>
 #include <rtems/posix/time.h>
diff --git a/cpukit/posix/src/clockgetenableattr.c b/cpukit/posix/src/clockgetenableattr.c
index b6a638b..a2a3691 100644
--- a/cpukit/posix/src/clockgetenableattr.c
+++ b/cpukit/posix/src/clockgetenableattr.c
@@ -24,7 +24,6 @@
 #include <rtems/system.h>
 #include <rtems/score/isr.h>
 #include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
 
 #include <rtems/seterr.h>
 #include <rtems/posix/time.h>
diff --git a/cpukit/posix/src/clockgetres.c b/cpukit/posix/src/clockgetres.c
index 08fd773..d35d50f 100644
--- a/cpukit/posix/src/clockgetres.c
+++ b/cpukit/posix/src/clockgetres.c
@@ -21,12 +21,8 @@
 #include <time.h>
 #include <errno.h>
 
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
 #include <rtems/score/tod.h>
-
+#include <rtems/config.h>
 #include <rtems/seterr.h>
 
 /*
diff --git a/cpukit/posix/src/clockgettime.c b/cpukit/posix/src/clockgettime.c
index a8aa0f0..ebd0496 100644
--- a/cpukit/posix/src/clockgettime.c
+++ b/cpukit/posix/src/clockgettime.c
@@ -21,11 +21,7 @@
 #include <time.h>
 #include <errno.h>
 
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
 #include <rtems/score/tod.h>
-
 #include <rtems/seterr.h>
 
 /*
diff --git a/cpukit/posix/src/clocksetenableattr.c b/cpukit/posix/src/clocksetenableattr.c
index d6e2c11..3917c1e 100644
--- a/cpukit/posix/src/clocksetenableattr.c
+++ b/cpukit/posix/src/clocksetenableattr.c
@@ -24,7 +24,6 @@
 #include <rtems/system.h>
 #include <rtems/score/isr.h>
 #include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
 
 #include <rtems/seterr.h>
 #include <rtems/posix/time.h>
diff --git a/cpukit/posix/src/mqueueopen.c b/cpukit/posix/src/mqueueopen.c
index e01be7a..79e7422 100644
--- a/cpukit/posix/src/mqueueopen.c
+++ b/cpukit/posix/src/mqueueopen.c
@@ -38,11 +38,11 @@
 #include <fcntl.h>
 #include <mqueue.h>
 
-#include <rtems/system.h>
+#include <rtems/score/tod.h>
 #include <rtems/score/watchdog.h>
-#include <rtems/seterr.h>
 #include <rtems/posix/mqueueimpl.h>
 #include <rtems/posix/time.h>
+#include <rtems/seterr.h>
 
 /*
  *  15.2.2 Open a Message Queue, P1003.1b-1993, p. 272
diff --git a/cpukit/posix/src/nanosleep.c b/cpukit/posix/src/nanosleep.c
index 3c408eb..7aaaa12 100644
--- a/cpukit/posix/src/nanosleep.c
+++ b/cpukit/posix/src/nanosleep.c
@@ -25,7 +25,6 @@
 #include <rtems/score/schedulerimpl.h>
 #include <rtems/score/threadimpl.h>
 #include <rtems/score/timespec.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/watchdogimpl.h>
 
 /*
diff --git a/cpukit/posix/src/posixtimespecabsolutetimeout.c b/cpukit/posix/src/posixtimespecabsolutetimeout.c
index c46f13b..47cb875 100644
--- a/cpukit/posix/src/posixtimespecabsolutetimeout.c
+++ b/cpukit/posix/src/posixtimespecabsolutetimeout.c
@@ -26,9 +26,9 @@
 #include <semaphore.h>
 #include <limits.h>
 
-#include <rtems/system.h>
 #include <rtems/posix/semaphoreimpl.h>
 #include <rtems/posix/time.h>
+#include <rtems/score/tod.h>
 #include <rtems/seterr.h>
 
 /*
diff --git a/cpukit/posix/src/ptimer.c b/cpukit/posix/src/ptimer.c
index 5ce17d4..9cc5376 100644
--- a/cpukit/posix/src/ptimer.c
+++ b/cpukit/posix/src/ptimer.c
@@ -26,7 +26,6 @@
 #include <rtems/config.h>
 #include <rtems/score/isr.h>
 #include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
 
 #include <rtems/posix/time.h>
 
diff --git a/cpukit/posix/src/sched_getscheduler.c b/cpukit/posix/src/sched_getscheduler.c
index ed958e0..d4f8b05 100644
--- a/cpukit/posix/src/sched_getscheduler.c
+++ b/cpukit/posix/src/sched_getscheduler.c
@@ -24,7 +24,6 @@
 #include <errno.h>
 
 #include <rtems/system.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/thread.h>
 #include <rtems/seterr.h>
 #include <rtems/posix/priorityimpl.h>
diff --git a/cpukit/posix/src/sched_rr_get_interval.c b/cpukit/posix/src/sched_rr_get_interval.c
index 242077d..ca50480 100644
--- a/cpukit/posix/src/sched_rr_get_interval.c
+++ b/cpukit/posix/src/sched_rr_get_interval.c
@@ -25,7 +25,6 @@
 #include <errno.h>
 
 #include <rtems/system.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/threadimpl.h>
 #include <rtems/score/timespec.h>
 #include <rtems/seterr.h>
diff --git a/cpukit/posix/src/sched_setparam.c b/cpukit/posix/src/sched_setparam.c
index 6a2047d..689ec69 100644
--- a/cpukit/posix/src/sched_setparam.c
+++ b/cpukit/posix/src/sched_setparam.c
@@ -24,7 +24,6 @@
 #include <errno.h>
 
 #include <rtems/system.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/thread.h>
 #include <rtems/seterr.h>
 #include <rtems/posix/priorityimpl.h>
diff --git a/cpukit/posix/src/sched_setscheduler.c b/cpukit/posix/src/sched_setscheduler.c
index 1ce173f..0ff6286 100644
--- a/cpukit/posix/src/sched_setscheduler.c
+++ b/cpukit/posix/src/sched_setscheduler.c
@@ -22,7 +22,6 @@
 #include <errno.h>
 
 #include <rtems/system.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/thread.h>
 #include <rtems/seterr.h>
 #include <rtems/posix/priorityimpl.h>
diff --git a/cpukit/posix/src/sysconf.c b/cpukit/posix/src/sysconf.c
index 65812d3..eb94e17 100644
--- a/cpukit/posix/src/sysconf.c
+++ b/cpukit/posix/src/sysconf.c
@@ -22,9 +22,9 @@
 #include <unistd.h>
 #include <errno.h>
 
+#include <rtems/score/tod.h>
 #include <rtems/system.h>
 #include <rtems/seterr.h>
-#include <rtems/score/tod.h>
 #include <rtems/libio_.h>
 
 #include <sys/param.h>
diff --git a/cpukit/posix/src/timergettime.c b/cpukit/posix/src/timergettime.c
index 40f0f61..e4fd60d 100644
--- a/cpukit/posix/src/timergettime.c
+++ b/cpukit/posix/src/timergettime.c
@@ -23,13 +23,10 @@
 #include <time.h>
 #include <errno.h>
 
-#include <rtems/system.h>
-#include <rtems/seterr.h>
-#include <rtems/score/thread.h>
+#include <rtems/posix/timerimpl.h>
 #include <rtems/score/tod.h>
-#include <rtems/score/timespec.h>
 #include <rtems/score/watchdogimpl.h>
-#include <rtems/posix/timerimpl.h>
+#include <rtems/seterr.h>
 
 /*
  *          - When a timer is initialized, the value of the time in
diff --git a/cpukit/posix/src/timersettime.c b/cpukit/posix/src/timersettime.c
index 2b7f074..a1bd40b 100644
--- a/cpukit/posix/src/timersettime.c
+++ b/cpukit/posix/src/timersettime.c
@@ -23,14 +23,12 @@
 #include <time.h>
 #include <errno.h>
 
-#include <rtems/system.h>
-#include <rtems/seterr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
-#include <rtems/score/watchdogimpl.h>
 #include <rtems/posix/time.h>
 #include <rtems/posix/ptimer.h>
 #include <rtems/posix/timerimpl.h>
+#include <rtems/score/tod.h>
+#include <rtems/score/watchdogimpl.h>
+#include <rtems/seterr.h>
 
 int timer_settime(
   timer_t                  timerid,
diff --git a/cpukit/posix/src/timertsr.c b/cpukit/posix/src/timertsr.c
index eb6ca9f..9c8f035 100644
--- a/cpukit/posix/src/timertsr.c
+++ b/cpukit/posix/src/timertsr.c
@@ -24,13 +24,10 @@
 #include <pthread.h>
 #include <signal.h>
 
-#include <rtems/system.h>
-#include <rtems/seterr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
 #include <rtems/posix/time.h>
 #include <rtems/posix/ptimer.h>
 #include <rtems/posix/timerimpl.h>
+#include <rtems/score/tod.h>
 
 /*
  *  This is the operation that is run when a timer expires
diff --git a/cpukit/posix/src/ualarm.c b/cpukit/posix/src/ualarm.c
index 17573ba..ae65a63 100644
--- a/cpukit/posix/src/ualarm.c
+++ b/cpukit/posix/src/ualarm.c
@@ -24,6 +24,7 @@
 #include <rtems/posix/pthreadimpl.h>
 #include <rtems/posix/psignalimpl.h>
 #include <rtems/posix/time.h>
+#include <rtems/score/threaddispatch.h>
 #include <rtems/score/tod.h>
 #include <rtems/score/watchdogimpl.h>
 
diff --git a/cpukit/rtems/include/rtems/rtems/clock.h b/cpukit/rtems/include/rtems/rtems/clock.h
index 3254b59..3c32ccd 100644
--- a/cpukit/rtems/include/rtems/rtems/clock.h
+++ b/cpukit/rtems/include/rtems/rtems/clock.h
@@ -30,7 +30,6 @@
 #ifndef _RTEMS_RTEMS_CLOCK_H
 #define _RTEMS_RTEMS_CLOCK_H
 
-#include <rtems/score/tod.h>
 #include <rtems/score/watchdog.h>
 #include <rtems/rtems/status.h>
 #include <rtems/rtems/types.h>
diff --git a/cpukit/rtems/include/rtems/rtems/support.h b/cpukit/rtems/include/rtems/rtems/support.h
index e2e01b0..80da79b 100644
--- a/cpukit/rtems/include/rtems/rtems/support.h
+++ b/cpukit/rtems/include/rtems/rtems/support.h
@@ -19,6 +19,7 @@
 #define _RTEMS_RTEMS_SUPPORT_H
 
 #include <rtems/rtems/types.h>
+#include <rtems/config.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -32,14 +33,13 @@ extern "C" {
 /**
  * @brief Returns the number of micro seconds for the milli seconds value @a _ms.
  */
-#define RTEMS_MILLISECONDS_TO_MICROSECONDS(_ms) \
-        TOD_MILLISECONDS_TO_MICROSECONDS(_ms)
+#define RTEMS_MILLISECONDS_TO_MICROSECONDS(_ms) ((uint32_t)(_ms) * 1000UL)
 
 /**
  * @brief Returns the number of ticks for the milli seconds value @a _ms.
  */
 #define RTEMS_MILLISECONDS_TO_TICKS(_ms) \
-       (TOD_MILLISECONDS_TO_MICROSECONDS(_ms) / \
+       (RTEMS_MILLISECONDS_TO_MICROSECONDS(_ms) / \
           rtems_configuration_get_microseconds_per_tick())
 
 /**
diff --git a/cpukit/rtems/include/rtems/rtems/types.h b/cpukit/rtems/include/rtems/rtems/types.h
index 60a787d..ae121e0 100644
--- a/cpukit/rtems/include/rtems/rtems/types.h
+++ b/cpukit/rtems/include/rtems/rtems/types.h
@@ -26,7 +26,6 @@
 #include <rtems/score/heap.h>
 #include <rtems/score/object.h>
 #include <rtems/score/priority.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/watchdog.h>
 #include <rtems/rtems/modes.h>
 #if defined(RTEMS_MULTIPROCESSING)
diff --git a/cpukit/rtems/src/clockget.c b/cpukit/rtems/src/clockget.c
index 45f4c29..fdf8b22 100644
--- a/cpukit/rtems/src/clockget.c
+++ b/cpukit/rtems/src/clockget.c
@@ -23,7 +23,6 @@
 #include <rtems/rtems/clock.h>
 #include <rtems/score/isr.h>
 #include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/watchdog.h>
 
 rtems_status_code rtems_clock_get(
diff --git a/cpukit/rtems/src/clockgetsecondssinceepoch.c b/cpukit/rtems/src/clockgetsecondssinceepoch.c
index c1f2af5..1f23072 100644
--- a/cpukit/rtems/src/clockgetsecondssinceepoch.c
+++ b/cpukit/rtems/src/clockgetsecondssinceepoch.c
@@ -18,13 +18,8 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/rtems/status.h>
 #include <rtems/rtems/clock.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
 #include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
 
 rtems_status_code rtems_clock_get_seconds_since_epoch(
   rtems_interval *the_interval
diff --git a/cpukit/rtems/src/clockgettickspersecond.c b/cpukit/rtems/src/clockgettickspersecond.c
index 3a6d280..87ae7bb 100644
--- a/cpukit/rtems/src/clockgettickspersecond.c
+++ b/cpukit/rtems/src/clockgettickspersecond.c
@@ -18,14 +18,9 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/rtems/status.h>
 #include <rtems/rtems/clock.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
 #include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
+#include <rtems/config.h>
 
 rtems_interval rtems_clock_get_ticks_per_second(void)
 {
diff --git a/cpukit/rtems/src/clockgettickssinceboot.c b/cpukit/rtems/src/clockgettickssinceboot.c
index 340b4bc..a016777 100644
--- a/cpukit/rtems/src/clockgettickssinceboot.c
+++ b/cpukit/rtems/src/clockgettickssinceboot.c
@@ -23,7 +23,6 @@
 #include <rtems/rtems/clock.h>
 #include <rtems/score/isr.h>
 #include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/watchdogimpl.h>
 
 rtems_interval rtems_clock_get_ticks_since_boot(void)
diff --git a/cpukit/rtems/src/clockgettod.c b/cpukit/rtems/src/clockgettod.c
index 18f7773..8710b0f 100644
--- a/cpukit/rtems/src/clockgettod.c
+++ b/cpukit/rtems/src/clockgettod.c
@@ -18,14 +18,9 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/rtems/status.h>
 #include <rtems/rtems/clock.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
 #include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
+#include <rtems/config.h>
 
 rtems_status_code rtems_clock_get_tod(
   rtems_time_of_day  *time_buffer
diff --git a/cpukit/rtems/src/clockgettodtimeval.c b/cpukit/rtems/src/clockgettodtimeval.c
index b2d7c52..b10c4f2 100644
--- a/cpukit/rtems/src/clockgettodtimeval.c
+++ b/cpukit/rtems/src/clockgettodtimeval.c
@@ -18,13 +18,8 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/rtems/status.h>
 #include <rtems/rtems/clock.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
 #include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
 
 rtems_status_code rtems_clock_get_tod_timeval(
   struct timeval  *time
diff --git a/cpukit/rtems/src/clockgetuptime.c b/cpukit/rtems/src/clockgetuptime.c
index 848fd34..0645b8e 100644
--- a/cpukit/rtems/src/clockgetuptime.c
+++ b/cpukit/rtems/src/clockgetuptime.c
@@ -18,14 +18,8 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/rtems/status.h>
 #include <rtems/rtems/clock.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/timestamp.h>
 #include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
 
 /*
  *  rtems_clock_get_uptime
diff --git a/cpukit/rtems/src/clockgetuptimeseconds.c b/cpukit/rtems/src/clockgetuptimeseconds.c
index 655a18e..e4436c1 100644
--- a/cpukit/rtems/src/clockgetuptimeseconds.c
+++ b/cpukit/rtems/src/clockgetuptimeseconds.c
@@ -24,6 +24,8 @@
 #endif
 
 #include <rtems/rtems/clock.h>
+#include <rtems/score/isrlevel.h>
+#include <rtems/score/tod.h>
 
 time_t rtems_clock_get_uptime_seconds( void )
 {
diff --git a/cpukit/rtems/src/clockgetuptimetimeval.c b/cpukit/rtems/src/clockgetuptimetimeval.c
index c173a71..ef13882 100644
--- a/cpukit/rtems/src/clockgetuptimetimeval.c
+++ b/cpukit/rtems/src/clockgetuptimetimeval.c
@@ -24,6 +24,7 @@
 #endif
 
 #include <rtems/rtems/clock.h>
+#include <rtems/score/tod.h>
 
 void rtems_clock_get_uptime_timeval( struct timeval *uptime )
 {
diff --git a/cpukit/rtems/src/clocksetnsecshandler.c b/cpukit/rtems/src/clocksetnsecshandler.c
index 8b79d0c..25c0ad7 100644
--- a/cpukit/rtems/src/clocksetnsecshandler.c
+++ b/cpukit/rtems/src/clocksetnsecshandler.c
@@ -23,7 +23,6 @@
 #include <rtems/rtems/clock.h>
 #include <rtems/score/isr.h>
 #include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/watchdogimpl.h>
 
 /*
diff --git a/cpukit/rtems/src/clocktodtoseconds.c b/cpukit/rtems/src/clocktodtoseconds.c
index 9f80b53..daa33b4 100644
--- a/cpukit/rtems/src/clocktodtoseconds.c
+++ b/cpukit/rtems/src/clocktodtoseconds.c
@@ -18,8 +18,8 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
 #include <rtems/rtems/clock.h>
+#include <rtems/score/tod.h>
 
 #define TOD_SECONDS_AT_2100_03_01_00_00 4107538800UL
 
diff --git a/cpukit/rtems/src/clocktodvalidate.c b/cpukit/rtems/src/clocktodvalidate.c
index a56b1df..c464c37 100644
--- a/cpukit/rtems/src/clocktodvalidate.c
+++ b/cpukit/rtems/src/clocktodvalidate.c
@@ -18,9 +18,9 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/config.h>
 #include <rtems/rtems/clock.h>
+#include <rtems/score/tod.h>
+#include <rtems/config.h>
 
 /*
  *  The following array contains the number of days in all months.
diff --git a/cpukit/rtems/src/rtclock.c b/cpukit/rtems/src/rtclock.c
index fb4cb35..dcf878c 100644
--- a/cpukit/rtems/src/rtclock.c
+++ b/cpukit/rtems/src/rtclock.c
@@ -23,7 +23,6 @@
 #include <rtems/rtems/clock.h>
 #include <rtems/score/isr.h>
 #include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/watchdog.h>
 
 /* No initialization routine */
diff --git a/cpukit/rtems/src/rtemstimer.c b/cpukit/rtems/src/rtemstimer.c
index 259df4c..4c86c86 100644
--- a/cpukit/rtems/src/rtemstimer.c
+++ b/cpukit/rtems/src/rtemstimer.c
@@ -24,7 +24,6 @@
 #include <rtems/rtems/support.h>
 #include <rtems/score/thread.h>
 #include <rtems/rtems/timerimpl.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/watchdog.h>
 
 void _Timer_Manager_initialization(void)
diff --git a/cpukit/rtems/src/signalsend.c b/cpukit/rtems/src/signalsend.c
index 8da26e8..440405a 100644
--- a/cpukit/rtems/src/signalsend.c
+++ b/cpukit/rtems/src/signalsend.c
@@ -21,6 +21,7 @@
 #include <rtems/rtems/signalimpl.h>
 #include <rtems/rtems/asrimpl.h>
 #include <rtems/rtems/tasks.h>
+#include <rtems/score/isr.h>
 #include <rtems/score/threadimpl.h>
 
 rtems_status_code rtems_signal_send(
diff --git a/cpukit/rtems/src/taskident.c b/cpukit/rtems/src/taskident.c
index ecd01c0..659b1df 100644
--- a/cpukit/rtems/src/taskident.c
+++ b/cpukit/rtems/src/taskident.c
@@ -25,7 +25,6 @@
 #include <rtems/score/stack.h>
 #include <rtems/rtems/tasksimpl.h>
 #include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/wkspace.h>
 #include <rtems/score/apiext.h>
 
diff --git a/cpukit/rtems/src/taskinitusers.c b/cpukit/rtems/src/taskinitusers.c
index b086a6e..a86a2ff 100644
--- a/cpukit/rtems/src/taskinitusers.c
+++ b/cpukit/rtems/src/taskinitusers.c
@@ -27,7 +27,6 @@
 #include <rtems/score/stack.h>
 #include <rtems/rtems/tasksimpl.h>
 #include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/wkspace.h>
 #include <rtems/score/apiext.h>
 
diff --git a/cpukit/rtems/src/tasks.c b/cpukit/rtems/src/tasks.c
index ddbc0d2..9a2a96f 100644
--- a/cpukit/rtems/src/tasks.c
+++ b/cpukit/rtems/src/tasks.c
@@ -28,7 +28,6 @@
 #include <rtems/score/stack.h>
 #include <rtems/rtems/tasksimpl.h>
 #include <rtems/score/thread.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/userextimpl.h>
 #include <rtems/score/wkspace.h>
 #include <rtems/score/apiext.h>
diff --git a/cpukit/rtems/src/taskwakewhen.c b/cpukit/rtems/src/taskwakewhen.c
index 7bee637..759cb2e 100644
--- a/cpukit/rtems/src/taskwakewhen.c
+++ b/cpukit/rtems/src/taskwakewhen.c
@@ -21,6 +21,7 @@
 #include <rtems/rtems/tasks.h>
 #include <rtems/rtems/clock.h>
 #include <rtems/score/threadimpl.h>
+#include <rtems/score/tod.h>
 #include <rtems/score/watchdogimpl.h>
 
 rtems_status_code rtems_task_wake_when(
diff --git a/cpukit/rtems/src/timercancel.c b/cpukit/rtems/src/timercancel.c
index 28d16f4..45f0c70 100644
--- a/cpukit/rtems/src/timercancel.c
+++ b/cpukit/rtems/src/timercancel.c
@@ -19,7 +19,6 @@
 #include <rtems/rtems/support.h>
 #include <rtems/score/thread.h>
 #include <rtems/rtems/timerimpl.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/watchdogimpl.h>
 
 /*
diff --git a/cpukit/rtems/src/timercreate.c b/cpukit/rtems/src/timercreate.c
index 516be2f..06e6e7a 100644
--- a/cpukit/rtems/src/timercreate.c
+++ b/cpukit/rtems/src/timercreate.c
@@ -23,7 +23,6 @@
 #include <rtems/rtems/support.h>
 #include <rtems/score/thread.h>
 #include <rtems/rtems/timerimpl.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/watchdogimpl.h>
 
 rtems_status_code rtems_timer_create(
diff --git a/cpukit/rtems/src/timerdelete.c b/cpukit/rtems/src/timerdelete.c
index dee2dfa..5f1f404 100644
--- a/cpukit/rtems/src/timerdelete.c
+++ b/cpukit/rtems/src/timerdelete.c
@@ -23,7 +23,6 @@
 #include <rtems/rtems/support.h>
 #include <rtems/score/thread.h>
 #include <rtems/rtems/timerimpl.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/watchdogimpl.h>
 
 rtems_status_code rtems_timer_delete(
diff --git a/cpukit/rtems/src/timerfireafter.c b/cpukit/rtems/src/timerfireafter.c
index a7df31e..3bab7d2 100644
--- a/cpukit/rtems/src/timerfireafter.c
+++ b/cpukit/rtems/src/timerfireafter.c
@@ -23,7 +23,6 @@
 #include <rtems/rtems/support.h>
 #include <rtems/score/thread.h>
 #include <rtems/rtems/timerimpl.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/watchdogimpl.h>
 
 rtems_status_code rtems_timer_fire_after(
diff --git a/cpukit/rtems/src/timerfirewhen.c b/cpukit/rtems/src/timerfirewhen.c
index 453c849..c2be8b8 100644
--- a/cpukit/rtems/src/timerfirewhen.c
+++ b/cpukit/rtems/src/timerfirewhen.c
@@ -18,10 +18,6 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/thread.h>
 #include <rtems/rtems/timerimpl.h>
 #include <rtems/rtems/clock.h>
 #include <rtems/score/tod.h>
diff --git a/cpukit/rtems/src/timergetinfo.c b/cpukit/rtems/src/timergetinfo.c
index f711228..cf15198 100644
--- a/cpukit/rtems/src/timergetinfo.c
+++ b/cpukit/rtems/src/timergetinfo.c
@@ -23,7 +23,6 @@
 #include <rtems/rtems/support.h>
 #include <rtems/score/thread.h>
 #include <rtems/rtems/timerimpl.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/watchdog.h>
 
 rtems_status_code rtems_timer_get_information(
diff --git a/cpukit/rtems/src/timerident.c b/cpukit/rtems/src/timerident.c
index e87585c..58b7531 100644
--- a/cpukit/rtems/src/timerident.c
+++ b/cpukit/rtems/src/timerident.c
@@ -23,7 +23,6 @@
 #include <rtems/rtems/support.h>
 #include <rtems/score/thread.h>
 #include <rtems/rtems/timerimpl.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/watchdog.h>
 
 rtems_status_code rtems_timer_ident(
diff --git a/cpukit/rtems/src/timerreset.c b/cpukit/rtems/src/timerreset.c
index fb55f9e..0b18daa 100644
--- a/cpukit/rtems/src/timerreset.c
+++ b/cpukit/rtems/src/timerreset.c
@@ -23,7 +23,6 @@
 #include <rtems/rtems/support.h>
 #include <rtems/score/thread.h>
 #include <rtems/rtems/timerimpl.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/watchdogimpl.h>
 
 /*
diff --git a/cpukit/rtems/src/timerserver.c b/cpukit/rtems/src/timerserver.c
index 5c7099c..a76f346 100644
--- a/cpukit/rtems/src/timerserver.c
+++ b/cpukit/rtems/src/timerserver.c
@@ -28,6 +28,7 @@
 
 #include <rtems/rtems/timerimpl.h>
 #include <rtems/rtems/tasksimpl.h>
+#include <rtems/score/isrlevel.h>
 #include <rtems/score/threadimpl.h>
 #include <rtems/score/tod.h>
 #include <rtems/score/watchdogimpl.h>
diff --git a/cpukit/rtems/src/timerserverfireafter.c b/cpukit/rtems/src/timerserverfireafter.c
index c486d91..f361f06 100644
--- a/cpukit/rtems/src/timerserverfireafter.c
+++ b/cpukit/rtems/src/timerserverfireafter.c
@@ -23,7 +23,6 @@
 #include <rtems/rtems/support.h>
 #include <rtems/score/thread.h>
 #include <rtems/rtems/timerimpl.h>
-#include <rtems/score/tod.h>
 #include <rtems/score/watchdogimpl.h>
 
 rtems_status_code rtems_timer_server_fire_after(
diff --git a/cpukit/rtems/src/timerserverfirewhen.c b/cpukit/rtems/src/timerserverfirewhen.c
index c6749b2..bf1f7d5 100644
--- a/cpukit/rtems/src/timerserverfirewhen.c
+++ b/cpukit/rtems/src/timerserverfirewhen.c
@@ -18,10 +18,6 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/score/thread.h>
 #include <rtems/rtems/timerimpl.h>
 #include <rtems/rtems/clock.h>
 #include <rtems/score/tod.h>
diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index a5daa5c..531ddc1 100644
--- a/cpukit/score/Makefile.am
+++ b/cpukit/score/Makefile.am
@@ -101,9 +101,6 @@ if HAS_SMP
 include_rtems_score_HEADERS += include/rtems/score/schedulersimplesmp.h
 endif
 
-## inline
-include_rtems_score_HEADERS += inline/rtems/score/tod.inl
-
 ## src
 
 AM_CPPFLAGS += -D__RTEMS_INSIDE__
@@ -301,7 +298,7 @@ libscore_a_SOURCES += src/ts64addto.c src/ts64dividebyinteger.c \
 ## TOD_C_FILES
 libscore_a_SOURCES += src/coretod.c src/coretodset.c src/coretodget.c \
     src/coretodgetuptimetimespec.c src/coretodtickle.c \
-    src/coretodmsecstoticks.c src/coretodtickspersec.c src/coretodusectoticks.c
+    src/coretodtickspersec.c
 
 ## WATCHDOG_C_FILES
 libscore_a_SOURCES += src/watchdog.c src/watchdogadjust.c \
diff --git a/cpukit/score/include/rtems/score/tod.h b/cpukit/score/include/rtems/score/tod.h
index df73f95..0cbbe2f 100644
--- a/cpukit/score/include/rtems/score/tod.h
+++ b/cpukit/score/include/rtems/score/tod.h
@@ -1,10 +1,9 @@
 /**
- *  @file  rtems/score/tod.h
+ * @file
  *
- *  @brief Constants and Structures Associated with the Time of Day Handler.
+ * @ingroup ScoreTOD
  *
- *  This include file contains all the constants and structures associated
- *  with the Time of Day Handler.
+ * @brief Time of Day Handler API
  */
 
 /*
@@ -19,16 +18,18 @@
 #ifndef _RTEMS_SCORE_TOD_H
 #define _RTEMS_SCORE_TOD_H
 
-#include <time.h>
+#include <rtems/score/basedefs.h>
 #include <rtems/score/timestamp.h>
-#include <rtems/score/basedefs.h> /* SCORE_EXTERN */
+
+#include <sys/time.h>
+#include <time.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /**
- *  @defgroup ScoreTODConstants TOD Constants
+ *  @defgroup ScoreTOD Time of Day Handler
  *
  *  @ingroup Score
  *
@@ -264,37 +265,6 @@ void _TOD_Get_uptime_as_timespec(
 void _TOD_Tickle_ticks( void );
 
 /**
- *  @brief Converts an interval expressed in milliseconds to microseconds.
- *
- *  This routine converts an interval expressed in milliseconds to microseconds.
- *
- *  @note This must be a macro so it can be used in "static" tables.
- */
-#define TOD_MILLISECONDS_TO_MICROSECONDS(_ms) ((uint32_t)(_ms) * 1000L)
-
-/**
- *  @brief Converts an interval expressed in microseconds to ticks.
- *
- *  This routine converts an interval expressed in microseconds to ticks.
- *
- *  @note This must be a macro so it can be used in "static" tables.
- */
-uint32_t TOD_MICROSECONDS_TO_TICKS(
-  uint32_t microseconds
-);
-
-/**
- *  @brief Converts an interval expressed in milliseconds to ticks.
- *
- *  This routine converts an interval expressed in milliseconds to ticks.
- *
- *  @note This must be a macro so it can be used in "static" tables.
- */
-uint32_t TOD_MILLISECONDS_TO_TICKS(
-  uint32_t milliseconds
-);
-
-/**
  *  @brief Gets number of ticks in a second.
  *
  *  This method returns the number of ticks in a second.
@@ -314,15 +284,45 @@ uint32_t TOD_TICKS_PER_SECOND_method(void);
  */
 #define TOD_TICKS_PER_SECOND TOD_TICKS_PER_SECOND_method()
 
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/tod.inl>
-#endif
+/**
+ * This routine deactivates updating of the current time of day.
+ */
 
-#ifdef __cplusplus
+RTEMS_INLINE_ROUTINE void _TOD_Deactivate( void )
+{
+  /* XXX do we need something now that we are using timespec for TOD */
+}
+
+/**
+ * This routine activates updating of the current time of day.
+ */
+
+RTEMS_INLINE_ROUTINE void _TOD_Activate( void )
+{
+  /* XXX do we need something now that we are using timespec for TOD */
+}
+
+/**
+ * This routine returns a timeval based upon the internal timespec format TOD.
+ */
+
+RTEMS_INLINE_ROUTINE void _TOD_Get_timeval(
+  struct timeval *time
+)
+{
+  Timestamp_Control  snapshot_as_timestamp;
+  Timestamp_Control *snapshot_as_timestamp_ptr;
+
+  snapshot_as_timestamp_ptr =
+    _TOD_Get_with_nanoseconds( &snapshot_as_timestamp, &_TOD.now );
+  _Timestamp_To_timeval( snapshot_as_timestamp_ptr, time );
 }
-#endif
 
 /**@}*/
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 /* end of include file */
diff --git a/cpukit/score/inline/rtems/score/tod.inl b/cpukit/score/inline/rtems/score/tod.inl
deleted file mode 100644
index 89b2634..0000000
--- a/cpukit/score/inline/rtems/score/tod.inl
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * @file
- *
- * @brief Inlined Routines from the Time of Day Handle
- *
- * This file contains the static inline implementation of the inlined routines
- * from the Time of Day Handler.
- */
-
-/*
- *  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.
- */
-
-#ifndef _RTEMS_SCORE_TOD_H
-# error "Never use <rtems/score/tod.inl> directly; include <rtems/score/tod.h> instead."
-#endif
-
-#ifndef _RTEMS_SCORE_TOD_INL
-#define _RTEMS_SCORE_TOD_INL
-
-#include <sys/time.h> /* struct timeval */
-
-#include <rtems/score/isr.h>
-
-/**
- * @addtogroup ScoreTOD
- */
-/**@{**/
-
-/**
- * This routine deactivates updating of the current time of day.
- */
-
-RTEMS_INLINE_ROUTINE void _TOD_Deactivate( void )
-{
-  /* XXX do we need something now that we are using timespec for TOD */
-}
-
-/**
- * This routine activates updating of the current time of day.
- */
-
-RTEMS_INLINE_ROUTINE void _TOD_Activate( void )
-{
-  /* XXX do we need something now that we are using timespec for TOD */
-}
-
-/**
- * This routine returns a timeval based upon the internal timespec format TOD.
- */
-
-RTEMS_INLINE_ROUTINE void _TOD_Get_timeval(
-  struct timeval *time
-)
-{
-  Timestamp_Control  snapshot_as_timestamp;
-  Timestamp_Control *snapshot_as_timestamp_ptr;
-
-  snapshot_as_timestamp_ptr =
-    _TOD_Get_with_nanoseconds( &snapshot_as_timestamp, &_TOD.now );
-  _Timestamp_To_timeval( snapshot_as_timestamp_ptr, time );
-}
-
-/** @} */
-
-#endif
-/* end of include file */
diff --git a/cpukit/score/preinstall.am b/cpukit/score/preinstall.am
index 42e2dbf..420fdaa 100644
--- a/cpukit/score/preinstall.am
+++ b/cpukit/score/preinstall.am
@@ -339,7 +339,3 @@ $(PROJECT_INCLUDE)/rtems/score/schedulersimplesmp.h: include/rtems/score/schedul
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulersimplesmp.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulersimplesmp.h
 endif
-$(PROJECT_INCLUDE)/rtems/score/tod.inl: inline/rtems/score/tod.inl $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
-	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/tod.inl
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/tod.inl
-
diff --git a/cpukit/score/src/coretod.c b/cpukit/score/src/coretod.c
index 2f664b4..1dcf19f 100644
--- a/cpukit/score/src/coretod.c
+++ b/cpukit/score/src/coretod.c
@@ -18,10 +18,7 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/score/thread.h>
 #include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
 
 void _TOD_Handler_initialization(void)
 {
diff --git a/cpukit/score/src/coretodget.c b/cpukit/score/src/coretodget.c
index e58b9fe..3e2cb4f 100644
--- a/cpukit/score/src/coretodget.c
+++ b/cpukit/score/src/coretodget.c
@@ -19,6 +19,7 @@
 #endif
 
 #include <rtems/score/tod.h>
+#include <rtems/score/isrlevel.h>
 #include <rtems/score/watchdogimpl.h>
 
 Timestamp_Control *_TOD_Get_with_nanoseconds(
diff --git a/cpukit/score/src/coretodgetuptimetimespec.c b/cpukit/score/src/coretodgetuptimetimespec.c
index 500acfd..16e519e 100644
--- a/cpukit/score/src/coretodgetuptimetimespec.c
+++ b/cpukit/score/src/coretodgetuptimetimespec.c
@@ -18,9 +18,6 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/timestamp.h>
 #include <rtems/score/tod.h>
 
 void _TOD_Get_uptime_as_timespec(
diff --git a/cpukit/score/src/coretodmsecstoticks.c b/cpukit/score/src/coretodmsecstoticks.c
deleted file mode 100644
index c55338e..0000000
--- a/cpukit/score/src/coretodmsecstoticks.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * @file
- *
- * @brief Convert Microseconds to Ticks
- *
- * @ingroup ScoreTODConstants
- */
-
-/*  COPYRIGHT (c) 1989-2011.
- *  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.
- */
-
-
-#if HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/score/tod.h>
-
-uint32_t TOD_MILLISECONDS_TO_TICKS(
-  uint32_t milliseconds
-)
-{
-  uint32_t ticks;
-  uint32_t milliseconds_per_tick;
-
-  /**
-   *  We should ensure the ticks not be truncated by integer division.  We
-   *  need to have it be greater than or equal to the requested time.  It
-   *  should not be shorter.
-   */
-  milliseconds_per_tick = rtems_configuration_get_milliseconds_per_tick();
-  ticks                 = milliseconds / milliseconds_per_tick;
-  if ( (milliseconds % milliseconds_per_tick) != 0 )
-    ticks += 1;
-
-  return ticks;
-}
diff --git a/cpukit/score/src/coretodset.c b/cpukit/score/src/coretodset.c
index 5c5e9c4..23ba2e6 100644
--- a/cpukit/score/src/coretodset.c
+++ b/cpukit/score/src/coretodset.c
@@ -18,11 +18,8 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threaddispatch.h>
-#include <rtems/score/timestamp.h>
 #include <rtems/score/tod.h>
+#include <rtems/score/threaddispatch.h>
 #include <rtems/score/watchdogimpl.h>
 
 void _TOD_Set_with_timestamp(
diff --git a/cpukit/score/src/coretodtickle.c b/cpukit/score/src/coretodtickle.c
index d55c054..41644b9 100644
--- a/cpukit/score/src/coretodtickle.c
+++ b/cpukit/score/src/coretodtickle.c
@@ -18,9 +18,6 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/timestamp.h>
 #include <rtems/score/tod.h>
 #include <rtems/score/watchdogimpl.h>
 #include <rtems/config.h>
diff --git a/cpukit/score/src/coretodtickspersec.c b/cpukit/score/src/coretodtickspersec.c
index 3dc792a..58e7e04 100644
--- a/cpukit/score/src/coretodtickspersec.c
+++ b/cpukit/score/src/coretodtickspersec.c
@@ -18,9 +18,8 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/config.h>
 #include <rtems/score/tod.h>
+#include <rtems/config.h>
 
 uint32_t TOD_TICKS_PER_SECOND_method(void)
 {
diff --git a/cpukit/score/src/coretodusectoticks.c b/cpukit/score/src/coretodusectoticks.c
deleted file mode 100644
index 60d08b9..0000000
--- a/cpukit/score/src/coretodusectoticks.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * @file
- *
- * @brief Converts Microseconds to Ticks
- *
- * @ingroup ScoreTOD
- */
-
-/*  COPYRIGHT (c) 1989-2011.
- *  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.
- */
-
-
-#if HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/score/tod.h>
-
-uint32_t TOD_MICROSECONDS_TO_TICKS(
-  uint32_t microseconds
-)
-{
-  uint32_t ticks;
-  uint32_t microseconds_per_tick;
-
-  /**
-   *  We should ensure the ticks not be truncated by integer division.  We
-   *  need to have it be greater than or equal to the requested time.  It
-   *  should not be shorter.
-   */
-  microseconds_per_tick = rtems_configuration_get_microseconds_per_tick();
-  ticks                 = microseconds / microseconds_per_tick;
-  if ( (microseconds % microseconds_per_tick) != 0 )
-    ticks += 1;
-
-  return ticks;
-}
diff --git a/cpukit/score/src/timespecaddto.c b/cpukit/score/src/timespecaddto.c
index a71e1d6..a1d6c87 100644
--- a/cpukit/score/src/timespecaddto.c
+++ b/cpukit/score/src/timespecaddto.c
@@ -18,8 +18,6 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <sys/types.h>
 #include <rtems/score/timespec.h>
 #include <rtems/score/tod.h>
 #include <rtems/score/watchdog.h>
diff --git a/cpukit/score/src/timespecdivide.c b/cpukit/score/src/timespecdivide.c
index e889dac..3434fdf 100644
--- a/cpukit/score/src/timespecdivide.c
+++ b/cpukit/score/src/timespecdivide.c
@@ -18,8 +18,6 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <sys/types.h>
 #include <rtems/score/timespec.h>
 #include <rtems/score/tod.h>
 
diff --git a/cpukit/score/src/timespecdividebyinteger.c b/cpukit/score/src/timespecdividebyinteger.c
index 33d2164..6d97dcb 100644
--- a/cpukit/score/src/timespecdividebyinteger.c
+++ b/cpukit/score/src/timespecdividebyinteger.c
@@ -19,8 +19,6 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <sys/types.h>
 #include <rtems/score/timespec.h>
 #include <rtems/score/tod.h>
 
diff --git a/cpukit/score/src/timespecfromticks.c b/cpukit/score/src/timespecfromticks.c
index dc11fbf..3e994a0 100644
--- a/cpukit/score/src/timespecfromticks.c
+++ b/cpukit/score/src/timespecfromticks.c
@@ -18,12 +18,9 @@
 #include "config.h"
 #endif
 
-#include <time.h>
-
-#include <rtems/system.h>
-#include <rtems/config.h>
 #include <rtems/score/timespec.h>
 #include <rtems/score/tod.h>
+#include <rtems/config.h>
 
 void _Timespec_From_ticks(
   uint32_t         ticks,
diff --git a/cpukit/score/src/timespecisvalid.c b/cpukit/score/src/timespecisvalid.c
index 4a0a247..61dce72 100644
--- a/cpukit/score/src/timespecisvalid.c
+++ b/cpukit/score/src/timespecisvalid.c
@@ -18,9 +18,6 @@
 #include "config.h"
 #endif
 
-#include <sys/types.h>
-
-#include <rtems/system.h>
 #include <rtems/score/timespec.h>
 #include <rtems/score/tod.h>
 
diff --git a/cpukit/score/src/timespeclessthan.c b/cpukit/score/src/timespeclessthan.c
index c120ae9..885f40b 100644
--- a/cpukit/score/src/timespeclessthan.c
+++ b/cpukit/score/src/timespeclessthan.c
@@ -22,7 +22,6 @@
 
 #include <rtems/system.h>
 #include <rtems/score/timespec.h>
-#include <rtems/score/tod.h>
 
 bool _Timespec_Less_than(
   const struct timespec *lhs,
diff --git a/cpukit/score/src/timespecsubtract.c b/cpukit/score/src/timespecsubtract.c
index 391cbc0..8d29f17 100644
--- a/cpukit/score/src/timespecsubtract.c
+++ b/cpukit/score/src/timespecsubtract.c
@@ -18,11 +18,8 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <sys/types.h>
 #include <rtems/score/timespec.h>
 #include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
 
 void _Timespec_Subtract(
   const struct timespec *start,
diff --git a/cpukit/score/src/timespectoticks.c b/cpukit/score/src/timespectoticks.c
index 4fe22f0..12eaada 100644
--- a/cpukit/score/src/timespectoticks.c
+++ b/cpukit/score/src/timespectoticks.c
@@ -15,13 +15,9 @@
 #include "config.h"
 #endif
 
-#include <sys/types.h>
-
-#include <rtems/system.h>
-#include <rtems/config.h>
 #include <rtems/score/timespec.h>
 #include <rtems/score/tod.h>
-#include <rtems/score/watchdog.h>
+#include <rtems/config.h>
 
 /**
  *
diff --git a/cpukit/score/src/ts64toticks.c b/cpukit/score/src/ts64toticks.c
index f1b9758..365198d 100644
--- a/cpukit/score/src/ts64toticks.c
+++ b/cpukit/score/src/ts64toticks.c
@@ -23,7 +23,6 @@
 #include <rtems/system.h>
 #include <rtems/config.h>
 #include <rtems/score/timestamp.h>
-#include <rtems/score/tod.h>
 
 #if CPU_TIMESTAMP_USE_INT64 == TRUE
 uint32_t _Timestamp64_To_ticks(
diff --git a/testsuites/libtests/block06/init.c b/testsuites/libtests/block06/init.c
index cbab056..6352aba 100644
--- a/testsuites/libtests/block06/init.c
+++ b/testsuites/libtests/block06/init.c
@@ -202,7 +202,7 @@ bdbuf_wait (const char* who, unsigned long timeout)
   rtems_event_set   out;
   sc = rtems_event_receive (RTEMS_EVENT_0,
                             RTEMS_WAIT | RTEMS_EVENT_ANY,
-                            TOD_MICROSECONDS_TO_TICKS (timeout * 1000),
+                            RTEMS_MICROSECONDS_TO_TICKS (timeout * 1000),
                             &out);
   if (sc != RTEMS_SUCCESSFUL)
   {
@@ -236,7 +236,7 @@ bdbuf_watch (unsigned long timeout)
   rtems_event_set   out;
   sc = rtems_event_receive (RTEMS_EVENT_1,
                             RTEMS_WAIT | RTEMS_EVENT_ANY,
-                            TOD_MICROSECONDS_TO_TICKS (timeout * 1000),
+                            RTEMS_MICROSECONDS_TO_TICKS (timeout * 1000),
                             &out);
   if (sc != RTEMS_SUCCESSFUL)
   {
@@ -330,7 +330,7 @@ static bool
 bdbuf_sleep (unsigned long msecs)
 {
   rtems_status_code sc;
-  sc = rtems_task_wake_after (TOD_MICROSECONDS_TO_TICKS (msecs * 1000));
+  sc = rtems_task_wake_after (RTEMS_MICROSECONDS_TO_TICKS (msecs * 1000));
   if (sc != RTEMS_SUCCESSFUL)
   {
     bdbuf_test_printf ("sleep wake after failed: ");
diff --git a/testsuites/psxtests/psx01/init.c b/testsuites/psxtests/psx01/init.c
index 13eb024..128bf23 100644
--- a/testsuites/psxtests/psx01/init.c
+++ b/testsuites/psxtests/psx01/init.c
@@ -18,6 +18,8 @@
 #include "system.h"
 #include "pritime.h"
 
+#include <rtems/score/tod.h>
+
 void *POSIX_Init(
   void *argument
 )
diff --git a/testsuites/psxtests/psx05/init.c b/testsuites/psxtests/psx05/init.c
index 06b5a37..dc6a0c1 100644
--- a/testsuites/psxtests/psx05/init.c
+++ b/testsuites/psxtests/psx05/init.c
@@ -17,6 +17,8 @@
 #include "system.h"
 #include <errno.h>
 
+#include <rtems/score/tod.h>
+
 #define MUTEX_BAD_ID 0xfffffffe
 
 void Print_mutexattr(
diff --git a/testsuites/psxtests/psxclock/init.c b/testsuites/psxtests/psxclock/init.c
index 16b3c3c..819bc15 100644
--- a/testsuites/psxtests/psxclock/init.c
+++ b/testsuites/psxtests/psxclock/init.c
@@ -17,6 +17,8 @@
 #include "pmacros.h"
 #include "pritime.h"
 
+#include <rtems/score/tod.h>
+
 /* forward declarations to avoid warnings */
 rtems_task Init(rtems_task_argument argument);
 void check_enosys(int status);
diff --git a/testsuites/samples/nsecs/init.c b/testsuites/samples/nsecs/init.c
index f94c672..fe5390d 100644
--- a/testsuites/samples/nsecs/init.c
+++ b/testsuites/samples/nsecs/init.c
@@ -23,6 +23,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <time.h>
 #include <sys/time.h>
 
 #define CONFIGURE_INIT
@@ -81,13 +82,9 @@ rtems_task Init(
   for (index=0 ; index <10 ; index++ ) {
     struct timespec start, stop;
     struct timespec diff;
-#if 0
+
     clock_gettime( CLOCK_REALTIME, &start );
     clock_gettime( CLOCK_REALTIME, &stop );
-#else
-    _TOD_Get( &start );
-    _TOD_Get( &stop );
-#endif
 
     subtract_em( &start, &stop, &diff );
     printf( "Start: %s:%ld\nStop : %s:%ld",
diff --git a/testsuites/sptests/sp01/task1.c b/testsuites/sptests/sp01/task1.c
index 1527b80..d2b824a 100644
--- a/testsuites/sptests/sp01/task1.c
+++ b/testsuites/sptests/sp01/task1.c
@@ -25,12 +25,7 @@ rtems_task Task_1_through_3(
   status = rtems_object_get_classic_name( rtems_task_self(), &name );
   directive_failed( status, "rtems_object_get_classic_name" );
 
-  /*
-   * Use TOD_MILLISECONDS_TO_TICKS not RTEMS_MILLISECONDS_TO_TICKS to
-   * test C implementation in SuperCore -- not macro version used
-   * everywhere else.
-   */
-  ticks = TOD_MILLISECONDS_TO_TICKS( index * 5 * 1000 );
+  ticks = RTEMS_MILLISECONDS_TO_TICKS( index * 5 * 1000 );
 
   while( FOREVER ) {
     status = rtems_clock_get_tod( &time );
diff --git a/testsuites/sptests/sp16/task5.c b/testsuites/sptests/sp16/task5.c
index ced8c27..d2dcc4e 100644
--- a/testsuites/sptests/sp16/task5.c
+++ b/testsuites/sptests/sp16/task5.c
@@ -46,12 +46,7 @@ rtems_task Task5(
   Put_address_from_area_1( segment_address_1 );
   new_line;
 
-  /*
-   * Use TOD_MICROSECONDS_TO_TICKS not RTEMS_MICROSECONDS_TO_TICKS to
-   * test C implementation in SuperCore -- not macro version used
-   * everywhere else.
-   */
-  status = rtems_task_wake_after( TOD_MICROSECONDS_TO_TICKS( 1000000 ) );
+  status = rtems_task_wake_after( RTEMS_MICROSECONDS_TO_TICKS( 1000000 ) );
   directive_failed( status, "rtems_task_wake_after" );
 
   puts( "TA5 - rtems_region_get_segment - wait on 3K segment from region 1" );
diff --git a/testsuites/sptests/spcbssched01/task1.c b/testsuites/sptests/spcbssched01/task1.c
index 0139f04..cf96549 100644
--- a/testsuites/sptests/spcbssched01/task1.c
+++ b/testsuites/sptests/spcbssched01/task1.c
@@ -34,12 +34,7 @@ rtems_task Task_1_through_3(
   status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
   directive_failed( status, "rtems_task_ident" );
 
-  /*
-   * Use TOD_MILLISECONDS_TO_TICKS not RTEMS_MILLISECONDS_TO_TICKS to
-   * test C implementation in SuperCore -- not macro version used
-   * everywhere else.
-   */
-  ticks = TOD_MILLISECONDS_TO_TICKS( task_number( tid ) * 5 * 1000 );
+  ticks = RTEMS_MILLISECONDS_TO_TICKS( task_number( tid ) * 5 * 1000 );
 
   while( FOREVER ) {
     status = rtems_clock_get_tod( &time );
diff --git a/testsuites/sptests/spedfsched01/task1.c b/testsuites/sptests/spedfsched01/task1.c
index a668190..d38df41 100644
--- a/testsuites/sptests/spedfsched01/task1.c
+++ b/testsuites/sptests/spedfsched01/task1.c
@@ -34,12 +34,7 @@ rtems_task Task_1_through_3(
   status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
   directive_failed( status, "rtems_task_ident" );
 
-  /*
-   * Use TOD_MILLISECONDS_TO_TICKS not RTEMS_MILLISECONDS_TO_TICKS to
-   * test C implementation in SuperCore -- not macro version used
-   * everywhere else.
-   */
-  ticks = TOD_MILLISECONDS_TO_TICKS( task_number( tid ) * 5 * 1000 );
+  ticks = RTEMS_MILLISECONDS_TO_TICKS( task_number( tid ) * 5 * 1000 );
 
   while( FOREVER ) {
     status = rtems_clock_get_tod( &time );




More information about the vc mailing list