score: Merge tod implementation into one file

Delete TOD_MICROSECONDS_PER_SECOND, TOD_MICROSECONDS_TO_TICKS() and
TOD_MILLISECONDS_TO_TICKS().
This commit is contained in:
Sebastian Huber
2013-07-26 11:55:47 +02:00
parent a2e3f33f39
commit 88c74ab115
95 changed files with 112 additions and 404 deletions
+1 -2
View File
@@ -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)
+2 -2
View File
@@ -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);
@@ -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
+1
View File
@@ -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.
+4 -4
View File
@@ -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)
{
+1 -1
View File
@@ -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
}
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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)
+1
View File
@@ -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
+1
View File
@@ -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__
+2 -4
View File
@@ -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(
+2 -2
View File
@@ -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 ();
@@ -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:
+1
View File
@@ -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>
-1
View File
@@ -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>
-1
View File
@@ -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>
+1 -5
View File
@@ -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>
/*
-4
View File
@@ -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>
/*
-1
View File
@@ -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>
+2 -2
View File
@@ -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
-1
View File
@@ -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>
/*
@@ -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>
/*
-1
View File
@@ -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>
-1
View File
@@ -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>
-1
View File
@@ -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>
-1
View File
@@ -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>
-1
View File
@@ -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>
+1 -1
View File
@@ -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>
+3 -6
View File
@@ -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/score/tod.h>
#include <rtems/score/timespec.h>
#include <rtems/score/watchdogimpl.h>
#include <rtems/posix/timerimpl.h>
#include <rtems/score/tod.h>
#include <rtems/score/watchdogimpl.h>
#include <rtems/seterr.h>
/*
* - When a timer is initialized, the value of the time in
+3 -5
View File
@@ -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,
+1 -4
View File
@@ -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
+1
View File
@@ -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>
-1
View File
@@ -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>
+3 -3
View File
@@ -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())
/**
-1
View File
@@ -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)
-1
View File
@@ -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(
@@ -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
+1 -6
View File
@@ -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)
{
@@ -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)
+1 -6
View File
@@ -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
-5
View File
@@ -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
-6
View File
@@ -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
+2
View File
@@ -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 )
{
+1
View File
@@ -24,6 +24,7 @@
#endif
#include <rtems/rtems/clock.h>
#include <rtems/score/tod.h>
void rtems_clock_get_uptime_timeval( struct timeval *uptime )
{
-1
View File
@@ -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>
/*
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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.
-1
View File
@@ -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 */
-1
View File
@@ -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)
+1
View File
@@ -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(

Some files were not shown because too many files have changed in this diff Show More