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-25 15:10:11 +02:00
parent a2e3f33f39
commit 88c74ab115
95 changed files with 112 additions and 404 deletions

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)

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);

View File

@@ -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

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.

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)
{

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
}

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);

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)

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

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__

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(

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 ();

View File

@@ -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:

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>

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>

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>

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>
/*

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>
/*

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>

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

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>
/*

View File

@@ -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>
/*

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>

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>

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>

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>

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>

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>

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

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,

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

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>

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>

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())
/**

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)

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(

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_seconds_since_epoch(
rtems_interval *the_interval

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)
{

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>
rtems_interval rtems_clock_get_ticks_since_boot(void)

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

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

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

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 )
{

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 )
{

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>
/*

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

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.

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 */

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)

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(

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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(

View File

@@ -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>
/*

View File

@@ -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(

View File

@@ -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(

View File

@@ -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(

View File

@@ -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>

View File

@@ -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(

View File

@@ -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(

View File

@@ -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>
/*

View File

@@ -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>

View File

@@ -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(

View File

@@ -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>

View File

@@ -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 \

View File

@@ -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
*
@@ -263,37 +264,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.
*
@@ -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.
*/
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 );
}
/**@}*/
#ifdef __cplusplus
}
#endif
/**@}*/
#endif
/* end of include file */

View File

@@ -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 */

View File

@@ -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

View File

@@ -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)
{

View File

@@ -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(

View File

@@ -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(

View File

@@ -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;
}

View File

@@ -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(

View File

@@ -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>

View File

@@ -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)
{

View File

@@ -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;
}

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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,

View File

@@ -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>

View File

@@ -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,

View File

@@ -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,

View File

@@ -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>
/**
*

View File

@@ -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(

View File

@@ -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: ");

View File

@@ -18,6 +18,8 @@
#include "system.h"
#include "pritime.h"
#include <rtems/score/tod.h>
void *POSIX_Init(
void *argument
)

View File

@@ -17,6 +17,8 @@
#include "system.h"
#include <errno.h>
#include <rtems/score/tod.h>
#define MUTEX_BAD_ID 0xfffffffe
void Print_mutexattr(

View File

@@ -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);

View File

@@ -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",

View File

@@ -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 );

View File

@@ -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" );

View File

@@ -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 );

View File

@@ -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 );