forked from Imagelibrary/rtems
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:
@@ -51,8 +51,7 @@ uint32_t milliseconds_per_tick(void)
|
|||||||
|
|
||||||
uint32_t ticks_per_second(void)
|
uint32_t ticks_per_second(void)
|
||||||
{
|
{
|
||||||
/* XXX HACK -- use public API */
|
return rtems_clock_get_ticks_per_second();
|
||||||
return TOD_TICKS_PER_SECOND;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t work_space_size(void)
|
uint32_t work_space_size(void)
|
||||||
|
|||||||
@@ -63,8 +63,8 @@ static void pc386_ide_prestart_sleep (void)
|
|||||||
*/
|
*/
|
||||||
static void pc386_ide_tasking_sleep (void)
|
static void pc386_ide_tasking_sleep (void)
|
||||||
{
|
{
|
||||||
rtems_task_wake_after (TOD_MICROSECONDS_TO_TICKS (10000) ?
|
rtems_task_wake_after (RTEMS_MICROSECONDS_TO_TICKS (10000) ?
|
||||||
TOD_MICROSECONDS_TO_TICKS (10000) : 1);
|
RTEMS_MICROSECONDS_TO_TICKS (10000) : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void (*pc386_ide_sleeper)(void);
|
typedef void (*pc386_ide_sleeper)(void);
|
||||||
|
|||||||
@@ -21,12 +21,6 @@
|
|||||||
#include <bsp/bootcard.h>
|
#include <bsp/bootcard.h>
|
||||||
#include "../include/system_conf.h"
|
#include "../include/system_conf.h"
|
||||||
#include "../console/uart.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
|
* bsp_start
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include <rtems/libio.h>
|
#include <rtems/libio.h>
|
||||||
#include <bsp.h>
|
#include <bsp.h>
|
||||||
#include <libcpu/rtcRegs.h>
|
#include <libcpu/rtcRegs.h>
|
||||||
|
#include <rtems/score/tod.h>
|
||||||
|
|
||||||
/* The following are inside RTEMS -- we are violating visibility!!!
|
/* The following are inside RTEMS -- we are violating visibility!!!
|
||||||
* Perhaps an API could be defined to get days since 1 Jan.
|
* Perhaps an API could be defined to get days since 1 Jan.
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ cs8900_hardware_init (cs8900_device *cs)
|
|||||||
|
|
||||||
io_pp_bit_set_reg_16 (cs, CS8900_PP_SelfCTL, CS8900_SELF_CTRL_RESET);
|
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);
|
status = io_pp_get_reg_16 (cs, CS8900_PP_SelfST);
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
@@ -660,7 +660,7 @@ cs8900_rx_task (void *arg)
|
|||||||
|
|
||||||
sc = rtems_bsdnet_event_receive (CS8900_RX_OK_EVENT,
|
sc = rtems_bsdnet_event_receive (CS8900_RX_OK_EVENT,
|
||||||
RTEMS_WAIT | RTEMS_EVENT_ANY,
|
RTEMS_WAIT | RTEMS_EVENT_ANY,
|
||||||
TOD_MILLISECONDS_TO_TICKS (250),
|
RTEMS_MILLISECONDS_TO_TICKS (250),
|
||||||
&events);
|
&events);
|
||||||
|
|
||||||
cs8900_rx_refill_queue (cs);
|
cs8900_rx_refill_queue (cs);
|
||||||
@@ -749,7 +749,7 @@ cs8900_tx_task (void *arg)
|
|||||||
* Wait for the link to come up.
|
* 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.
|
* Loop processing the tx queue.
|
||||||
@@ -815,7 +815,7 @@ cs8900_tx_task (void *arg)
|
|||||||
cs->eth_stats.tx_wait_for_rdy4tx++;
|
cs->eth_stats.tx_wait_for_rdy4tx++;
|
||||||
sc = rtems_bsdnet_event_receive (CS8900_TX_WAIT_EVENT,
|
sc = rtems_bsdnet_event_receive (CS8900_TX_WAIT_EVENT,
|
||||||
RTEMS_WAIT | RTEMS_EVENT_ANY,
|
RTEMS_WAIT | RTEMS_EVENT_ANY,
|
||||||
TOD_MILLISECONDS_TO_TICKS (750),
|
RTEMS_MILLISECONDS_TO_TICKS (750),
|
||||||
&events);
|
&events);
|
||||||
if (sc == RTEMS_TIMEOUT)
|
if (sc == RTEMS_TIMEOUT)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -459,7 +459,7 @@ sendpacket (struct ifnet *ifp, struct mbuf *m)
|
|||||||
rtems_event_set events;
|
rtems_event_set events;
|
||||||
rtems_bsdnet_event_receive (OPEN_ETH_TX_WAIT_EVENT,
|
rtems_bsdnet_event_receive (OPEN_ETH_TX_WAIT_EVENT,
|
||||||
RTEMS_WAIT | RTEMS_EVENT_ANY,
|
RTEMS_WAIT | RTEMS_EVENT_ANY,
|
||||||
TOD_MILLISECONDS_TO_TICKS(500), &events);
|
RTEMS_MILLISECONDS_TO_TICKS(500), &events);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ typedef enum {
|
|||||||
#define RTEMS_BDBUF_WAIT_TIMEOUT RTEMS_NO_TIMEOUT
|
#define RTEMS_BDBUF_WAIT_TIMEOUT RTEMS_NO_TIMEOUT
|
||||||
#if !defined (RTEMS_BDBUF_WAIT_TIMEOUT)
|
#if !defined (RTEMS_BDBUF_WAIT_TIMEOUT)
|
||||||
#define RTEMS_BDBUF_WAIT_TIMEOUT \
|
#define RTEMS_BDBUF_WAIT_TIMEOUT \
|
||||||
(TOD_MICROSECONDS_TO_TICKS (20000000))
|
(RTEMS_MICROSECONDS_TO_TICKS (20000000))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static rtems_task rtems_bdbuf_swapout_task(rtems_task_argument arg);
|
static rtems_task rtems_bdbuf_swapout_task(rtems_task_argument arg);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
#if defined(RTEMS_NEWLIB)
|
#if defined(RTEMS_NEWLIB)
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <rtems.h>
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/seterr.h>
|
#include <rtems/seterr.h>
|
||||||
|
|
||||||
#if defined(RTEMS_NEWLIB) && !defined(HAVE_GETTIMEOFDAY)
|
#if defined(RTEMS_NEWLIB) && !defined(HAVE_GETTIMEOFDAY)
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <rtems/seterr.h>
|
#include <rtems/seterr.h>
|
||||||
|
#include <rtems/score/tod.h>
|
||||||
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
|
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
|
||||||
#include <rtems/score/timestamp.h>
|
#include <rtems/score/timestamp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include <rtems/cpuuse.h>
|
#include <rtems/cpuuse.h>
|
||||||
#include <rtems/score/objectimpl.h>
|
#include <rtems/score/objectimpl.h>
|
||||||
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/score/watchdogimpl.h>
|
#include <rtems/score/watchdogimpl.h>
|
||||||
|
|
||||||
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
|
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
|
||||||
|
|||||||
@@ -18,11 +18,9 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <inttypes.h>
|
|
||||||
|
|
||||||
#include <rtems/cpuuse.h>
|
#include <rtems/cpuuse.h>
|
||||||
|
#include <rtems/score/thread.h>
|
||||||
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/score/watchdogimpl.h>
|
#include <rtems/score/watchdogimpl.h>
|
||||||
|
|
||||||
static void CPU_usage_Per_thread_handler(
|
static void CPU_usage_Per_thread_handler(
|
||||||
|
|||||||
@@ -712,7 +712,7 @@ dhcp_task (rtems_task_argument _sdl)
|
|||||||
/*
|
/*
|
||||||
* Sleep until the next poll
|
* 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,
|
ev_st = rtems_event_receive (RTEMS_EVENT_0,
|
||||||
RTEMS_WAIT | RTEMS_EVENT_ANY,
|
RTEMS_WAIT | RTEMS_EVENT_ANY,
|
||||||
timeout, &event_out);
|
timeout, &event_out);
|
||||||
@@ -1147,7 +1147,7 @@ void rtems_bsdnet_do_dhcp (void)
|
|||||||
while( dhcp_init (update) < 0 ) {
|
while( dhcp_init (update) < 0 ) {
|
||||||
update = false;
|
update = false;
|
||||||
rtems_bsdnet_semaphore_release();
|
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_obtain ();
|
||||||
}
|
}
|
||||||
rtems_bsdnet_semaphore_release ();
|
rtems_bsdnet_semaphore_release ();
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ do_dhcp_init (struct rtems_bsdnet_ifconfig *ifp)
|
|||||||
{
|
{
|
||||||
#if BROADCAST_DELAY
|
#if BROADCAST_DELAY
|
||||||
/* Wait before sending broadcast. */
|
/* 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
|
#endif
|
||||||
|
|
||||||
printf ("starting dhcp client...\n");
|
printf ("starting dhcp client...\n");
|
||||||
@@ -303,7 +303,7 @@ static void dhcp_monitor_task (rtems_task_argument ifp_arg)
|
|||||||
must_renew = TRUE;
|
must_renew = TRUE;
|
||||||
#if NETWORK_DOWN_TIME
|
#if NETWORK_DOWN_TIME
|
||||||
dhcp_if_down(ifname);
|
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);
|
dhcp_if_up(ifname);
|
||||||
downcount = 0;
|
downcount = 0;
|
||||||
#endif
|
#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:
|
error_out:
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include <rtems/posix/pthreadimpl.h>
|
#include <rtems/posix/pthreadimpl.h>
|
||||||
#include <rtems/posix/psignalimpl.h>
|
#include <rtems/posix/psignalimpl.h>
|
||||||
|
#include <rtems/score/threaddispatch.h>
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/score/watchdogimpl.h>
|
#include <rtems/score/watchdogimpl.h>
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
#include <rtems/system.h>
|
#include <rtems/system.h>
|
||||||
#include <rtems/score/isr.h>
|
#include <rtems/score/isr.h>
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
|
|
||||||
#include <rtems/seterr.h>
|
#include <rtems/seterr.h>
|
||||||
#include <rtems/posix/time.h>
|
#include <rtems/posix/time.h>
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
#include <rtems/system.h>
|
#include <rtems/system.h>
|
||||||
#include <rtems/score/isr.h>
|
#include <rtems/score/isr.h>
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
|
|
||||||
#include <rtems/seterr.h>
|
#include <rtems/seterr.h>
|
||||||
#include <rtems/posix/time.h>
|
#include <rtems/posix/time.h>
|
||||||
|
|||||||
@@ -21,12 +21,8 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <errno.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/score/tod.h>
|
||||||
|
#include <rtems/config.h>
|
||||||
#include <rtems/seterr.h>
|
#include <rtems/seterr.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -21,11 +21,7 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <errno.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/score/tod.h>
|
||||||
|
|
||||||
#include <rtems/seterr.h>
|
#include <rtems/seterr.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
#include <rtems/system.h>
|
#include <rtems/system.h>
|
||||||
#include <rtems/score/isr.h>
|
#include <rtems/score/isr.h>
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
|
|
||||||
#include <rtems/seterr.h>
|
#include <rtems/seterr.h>
|
||||||
#include <rtems/posix/time.h>
|
#include <rtems/posix/time.h>
|
||||||
|
|||||||
@@ -38,11 +38,11 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <mqueue.h>
|
#include <mqueue.h>
|
||||||
|
|
||||||
#include <rtems/system.h>
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/score/watchdog.h>
|
#include <rtems/score/watchdog.h>
|
||||||
#include <rtems/seterr.h>
|
|
||||||
#include <rtems/posix/mqueueimpl.h>
|
#include <rtems/posix/mqueueimpl.h>
|
||||||
#include <rtems/posix/time.h>
|
#include <rtems/posix/time.h>
|
||||||
|
#include <rtems/seterr.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 15.2.2 Open a Message Queue, P1003.1b-1993, p. 272
|
* 15.2.2 Open a Message Queue, P1003.1b-1993, p. 272
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
#include <rtems/score/schedulerimpl.h>
|
#include <rtems/score/schedulerimpl.h>
|
||||||
#include <rtems/score/threadimpl.h>
|
#include <rtems/score/threadimpl.h>
|
||||||
#include <rtems/score/timespec.h>
|
#include <rtems/score/timespec.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/watchdogimpl.h>
|
#include <rtems/score/watchdogimpl.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -26,9 +26,9 @@
|
|||||||
#include <semaphore.h>
|
#include <semaphore.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <rtems/posix/semaphoreimpl.h>
|
#include <rtems/posix/semaphoreimpl.h>
|
||||||
#include <rtems/posix/time.h>
|
#include <rtems/posix/time.h>
|
||||||
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/seterr.h>
|
#include <rtems/seterr.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
#include <rtems/config.h>
|
#include <rtems/config.h>
|
||||||
#include <rtems/score/isr.h>
|
#include <rtems/score/isr.h>
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
|
|
||||||
#include <rtems/posix/time.h>
|
#include <rtems/posix/time.h>
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <rtems/system.h>
|
#include <rtems/system.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/seterr.h>
|
#include <rtems/seterr.h>
|
||||||
#include <rtems/posix/priorityimpl.h>
|
#include <rtems/posix/priorityimpl.h>
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <rtems/system.h>
|
#include <rtems/system.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/threadimpl.h>
|
#include <rtems/score/threadimpl.h>
|
||||||
#include <rtems/score/timespec.h>
|
#include <rtems/score/timespec.h>
|
||||||
#include <rtems/seterr.h>
|
#include <rtems/seterr.h>
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <rtems/system.h>
|
#include <rtems/system.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/seterr.h>
|
#include <rtems/seterr.h>
|
||||||
#include <rtems/posix/priorityimpl.h>
|
#include <rtems/posix/priorityimpl.h>
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <rtems/system.h>
|
#include <rtems/system.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/seterr.h>
|
#include <rtems/seterr.h>
|
||||||
#include <rtems/posix/priorityimpl.h>
|
#include <rtems/posix/priorityimpl.h>
|
||||||
|
|||||||
@@ -22,9 +22,9 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/system.h>
|
#include <rtems/system.h>
|
||||||
#include <rtems/seterr.h>
|
#include <rtems/seterr.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/libio_.h>
|
#include <rtems/libio_.h>
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
|||||||
@@ -23,13 +23,10 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <errno.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/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
|
* - When a timer is initialized, the value of the time in
|
||||||
|
|||||||
@@ -23,14 +23,12 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <errno.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/time.h>
|
||||||
#include <rtems/posix/ptimer.h>
|
#include <rtems/posix/ptimer.h>
|
||||||
#include <rtems/posix/timerimpl.h>
|
#include <rtems/posix/timerimpl.h>
|
||||||
|
#include <rtems/score/tod.h>
|
||||||
|
#include <rtems/score/watchdogimpl.h>
|
||||||
|
#include <rtems/seterr.h>
|
||||||
|
|
||||||
int timer_settime(
|
int timer_settime(
|
||||||
timer_t timerid,
|
timer_t timerid,
|
||||||
|
|||||||
@@ -24,13 +24,10 @@
|
|||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <signal.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/time.h>
|
||||||
#include <rtems/posix/ptimer.h>
|
#include <rtems/posix/ptimer.h>
|
||||||
#include <rtems/posix/timerimpl.h>
|
#include <rtems/posix/timerimpl.h>
|
||||||
|
#include <rtems/score/tod.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is the operation that is run when a timer expires
|
* This is the operation that is run when a timer expires
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#include <rtems/posix/pthreadimpl.h>
|
#include <rtems/posix/pthreadimpl.h>
|
||||||
#include <rtems/posix/psignalimpl.h>
|
#include <rtems/posix/psignalimpl.h>
|
||||||
#include <rtems/posix/time.h>
|
#include <rtems/posix/time.h>
|
||||||
|
#include <rtems/score/threaddispatch.h>
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/score/watchdogimpl.h>
|
#include <rtems/score/watchdogimpl.h>
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
#ifndef _RTEMS_RTEMS_CLOCK_H
|
#ifndef _RTEMS_RTEMS_CLOCK_H
|
||||||
#define _RTEMS_RTEMS_CLOCK_H
|
#define _RTEMS_RTEMS_CLOCK_H
|
||||||
|
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/watchdog.h>
|
#include <rtems/score/watchdog.h>
|
||||||
#include <rtems/rtems/status.h>
|
#include <rtems/rtems/status.h>
|
||||||
#include <rtems/rtems/types.h>
|
#include <rtems/rtems/types.h>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#define _RTEMS_RTEMS_SUPPORT_H
|
#define _RTEMS_RTEMS_SUPPORT_H
|
||||||
|
|
||||||
#include <rtems/rtems/types.h>
|
#include <rtems/rtems/types.h>
|
||||||
|
#include <rtems/config.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@@ -32,14 +33,13 @@ extern "C" {
|
|||||||
/**
|
/**
|
||||||
* @brief Returns the number of micro seconds for the milli seconds value @a _ms.
|
* @brief Returns the number of micro seconds for the milli seconds value @a _ms.
|
||||||
*/
|
*/
|
||||||
#define RTEMS_MILLISECONDS_TO_MICROSECONDS(_ms) \
|
#define RTEMS_MILLISECONDS_TO_MICROSECONDS(_ms) ((uint32_t)(_ms) * 1000UL)
|
||||||
TOD_MILLISECONDS_TO_MICROSECONDS(_ms)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the number of ticks for the milli seconds value @a _ms.
|
* @brief Returns the number of ticks for the milli seconds value @a _ms.
|
||||||
*/
|
*/
|
||||||
#define RTEMS_MILLISECONDS_TO_TICKS(_ms) \
|
#define RTEMS_MILLISECONDS_TO_TICKS(_ms) \
|
||||||
(TOD_MILLISECONDS_TO_MICROSECONDS(_ms) / \
|
(RTEMS_MILLISECONDS_TO_MICROSECONDS(_ms) / \
|
||||||
rtems_configuration_get_microseconds_per_tick())
|
rtems_configuration_get_microseconds_per_tick())
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
#include <rtems/score/heap.h>
|
#include <rtems/score/heap.h>
|
||||||
#include <rtems/score/object.h>
|
#include <rtems/score/object.h>
|
||||||
#include <rtems/score/priority.h>
|
#include <rtems/score/priority.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/watchdog.h>
|
#include <rtems/score/watchdog.h>
|
||||||
#include <rtems/rtems/modes.h>
|
#include <rtems/rtems/modes.h>
|
||||||
#if defined(RTEMS_MULTIPROCESSING)
|
#if defined(RTEMS_MULTIPROCESSING)
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
#include <rtems/rtems/clock.h>
|
#include <rtems/rtems/clock.h>
|
||||||
#include <rtems/score/isr.h>
|
#include <rtems/score/isr.h>
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/watchdog.h>
|
#include <rtems/score/watchdog.h>
|
||||||
|
|
||||||
rtems_status_code rtems_clock_get(
|
rtems_status_code rtems_clock_get(
|
||||||
|
|||||||
@@ -18,13 +18,8 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <rtems/rtems/status.h>
|
|
||||||
#include <rtems/rtems/clock.h>
|
#include <rtems/rtems/clock.h>
|
||||||
#include <rtems/score/isr.h>
|
|
||||||
#include <rtems/score/thread.h>
|
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/score/watchdog.h>
|
|
||||||
|
|
||||||
rtems_status_code rtems_clock_get_seconds_since_epoch(
|
rtems_status_code rtems_clock_get_seconds_since_epoch(
|
||||||
rtems_interval *the_interval
|
rtems_interval *the_interval
|
||||||
|
|||||||
@@ -18,14 +18,9 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <rtems/config.h>
|
|
||||||
#include <rtems/rtems/status.h>
|
|
||||||
#include <rtems/rtems/clock.h>
|
#include <rtems/rtems/clock.h>
|
||||||
#include <rtems/score/isr.h>
|
|
||||||
#include <rtems/score/thread.h>
|
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/score/watchdog.h>
|
#include <rtems/config.h>
|
||||||
|
|
||||||
rtems_interval rtems_clock_get_ticks_per_second(void)
|
rtems_interval rtems_clock_get_ticks_per_second(void)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
#include <rtems/rtems/clock.h>
|
#include <rtems/rtems/clock.h>
|
||||||
#include <rtems/score/isr.h>
|
#include <rtems/score/isr.h>
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/watchdogimpl.h>
|
#include <rtems/score/watchdogimpl.h>
|
||||||
|
|
||||||
rtems_interval rtems_clock_get_ticks_since_boot(void)
|
rtems_interval rtems_clock_get_ticks_since_boot(void)
|
||||||
|
|||||||
@@ -18,14 +18,9 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <rtems/config.h>
|
|
||||||
#include <rtems/rtems/status.h>
|
|
||||||
#include <rtems/rtems/clock.h>
|
#include <rtems/rtems/clock.h>
|
||||||
#include <rtems/score/isr.h>
|
|
||||||
#include <rtems/score/thread.h>
|
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/score/watchdog.h>
|
#include <rtems/config.h>
|
||||||
|
|
||||||
rtems_status_code rtems_clock_get_tod(
|
rtems_status_code rtems_clock_get_tod(
|
||||||
rtems_time_of_day *time_buffer
|
rtems_time_of_day *time_buffer
|
||||||
|
|||||||
@@ -18,13 +18,8 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <rtems/rtems/status.h>
|
|
||||||
#include <rtems/rtems/clock.h>
|
#include <rtems/rtems/clock.h>
|
||||||
#include <rtems/score/isr.h>
|
|
||||||
#include <rtems/score/thread.h>
|
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/score/watchdog.h>
|
|
||||||
|
|
||||||
rtems_status_code rtems_clock_get_tod_timeval(
|
rtems_status_code rtems_clock_get_tod_timeval(
|
||||||
struct timeval *time
|
struct timeval *time
|
||||||
|
|||||||
@@ -18,14 +18,8 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <rtems/rtems/status.h>
|
|
||||||
#include <rtems/rtems/clock.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/tod.h>
|
||||||
#include <rtems/score/watchdog.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* rtems_clock_get_uptime
|
* rtems_clock_get_uptime
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/rtems/clock.h>
|
#include <rtems/rtems/clock.h>
|
||||||
|
#include <rtems/score/isrlevel.h>
|
||||||
|
#include <rtems/score/tod.h>
|
||||||
|
|
||||||
time_t rtems_clock_get_uptime_seconds( void )
|
time_t rtems_clock_get_uptime_seconds( void )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/rtems/clock.h>
|
#include <rtems/rtems/clock.h>
|
||||||
|
#include <rtems/score/tod.h>
|
||||||
|
|
||||||
void rtems_clock_get_uptime_timeval( struct timeval *uptime )
|
void rtems_clock_get_uptime_timeval( struct timeval *uptime )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
#include <rtems/rtems/clock.h>
|
#include <rtems/rtems/clock.h>
|
||||||
#include <rtems/score/isr.h>
|
#include <rtems/score/isr.h>
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/watchdogimpl.h>
|
#include <rtems/score/watchdogimpl.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <rtems/rtems/clock.h>
|
#include <rtems/rtems/clock.h>
|
||||||
|
#include <rtems/score/tod.h>
|
||||||
|
|
||||||
#define TOD_SECONDS_AT_2100_03_01_00_00 4107538800UL
|
#define TOD_SECONDS_AT_2100_03_01_00_00 4107538800UL
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,9 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <rtems/config.h>
|
|
||||||
#include <rtems/rtems/clock.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.
|
* The following array contains the number of days in all months.
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
#include <rtems/rtems/clock.h>
|
#include <rtems/rtems/clock.h>
|
||||||
#include <rtems/score/isr.h>
|
#include <rtems/score/isr.h>
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/watchdog.h>
|
#include <rtems/score/watchdog.h>
|
||||||
|
|
||||||
/* No initialization routine */
|
/* No initialization routine */
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
#include <rtems/rtems/support.h>
|
#include <rtems/rtems/support.h>
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/rtems/timerimpl.h>
|
#include <rtems/rtems/timerimpl.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/watchdog.h>
|
#include <rtems/score/watchdog.h>
|
||||||
|
|
||||||
void _Timer_Manager_initialization(void)
|
void _Timer_Manager_initialization(void)
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include <rtems/rtems/signalimpl.h>
|
#include <rtems/rtems/signalimpl.h>
|
||||||
#include <rtems/rtems/asrimpl.h>
|
#include <rtems/rtems/asrimpl.h>
|
||||||
#include <rtems/rtems/tasks.h>
|
#include <rtems/rtems/tasks.h>
|
||||||
|
#include <rtems/score/isr.h>
|
||||||
#include <rtems/score/threadimpl.h>
|
#include <rtems/score/threadimpl.h>
|
||||||
|
|
||||||
rtems_status_code rtems_signal_send(
|
rtems_status_code rtems_signal_send(
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
#include <rtems/score/stack.h>
|
#include <rtems/score/stack.h>
|
||||||
#include <rtems/rtems/tasksimpl.h>
|
#include <rtems/rtems/tasksimpl.h>
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/wkspace.h>
|
#include <rtems/score/wkspace.h>
|
||||||
#include <rtems/score/apiext.h>
|
#include <rtems/score/apiext.h>
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
#include <rtems/score/stack.h>
|
#include <rtems/score/stack.h>
|
||||||
#include <rtems/rtems/tasksimpl.h>
|
#include <rtems/rtems/tasksimpl.h>
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/wkspace.h>
|
#include <rtems/score/wkspace.h>
|
||||||
#include <rtems/score/apiext.h>
|
#include <rtems/score/apiext.h>
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,6 @@
|
|||||||
#include <rtems/score/stack.h>
|
#include <rtems/score/stack.h>
|
||||||
#include <rtems/rtems/tasksimpl.h>
|
#include <rtems/rtems/tasksimpl.h>
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/userextimpl.h>
|
#include <rtems/score/userextimpl.h>
|
||||||
#include <rtems/score/wkspace.h>
|
#include <rtems/score/wkspace.h>
|
||||||
#include <rtems/score/apiext.h>
|
#include <rtems/score/apiext.h>
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include <rtems/rtems/tasks.h>
|
#include <rtems/rtems/tasks.h>
|
||||||
#include <rtems/rtems/clock.h>
|
#include <rtems/rtems/clock.h>
|
||||||
#include <rtems/score/threadimpl.h>
|
#include <rtems/score/threadimpl.h>
|
||||||
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/score/watchdogimpl.h>
|
#include <rtems/score/watchdogimpl.h>
|
||||||
|
|
||||||
rtems_status_code rtems_task_wake_when(
|
rtems_status_code rtems_task_wake_when(
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
#include <rtems/rtems/support.h>
|
#include <rtems/rtems/support.h>
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/rtems/timerimpl.h>
|
#include <rtems/rtems/timerimpl.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/watchdogimpl.h>
|
#include <rtems/score/watchdogimpl.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
#include <rtems/rtems/support.h>
|
#include <rtems/rtems/support.h>
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/rtems/timerimpl.h>
|
#include <rtems/rtems/timerimpl.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/watchdogimpl.h>
|
#include <rtems/score/watchdogimpl.h>
|
||||||
|
|
||||||
rtems_status_code rtems_timer_create(
|
rtems_status_code rtems_timer_create(
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
#include <rtems/rtems/support.h>
|
#include <rtems/rtems/support.h>
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/rtems/timerimpl.h>
|
#include <rtems/rtems/timerimpl.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/watchdogimpl.h>
|
#include <rtems/score/watchdogimpl.h>
|
||||||
|
|
||||||
rtems_status_code rtems_timer_delete(
|
rtems_status_code rtems_timer_delete(
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
#include <rtems/rtems/support.h>
|
#include <rtems/rtems/support.h>
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/rtems/timerimpl.h>
|
#include <rtems/rtems/timerimpl.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/watchdogimpl.h>
|
#include <rtems/score/watchdogimpl.h>
|
||||||
|
|
||||||
rtems_status_code rtems_timer_fire_after(
|
rtems_status_code rtems_timer_fire_after(
|
||||||
|
|||||||
@@ -18,10 +18,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#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/timerimpl.h>
|
||||||
#include <rtems/rtems/clock.h>
|
#include <rtems/rtems/clock.h>
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
#include <rtems/rtems/support.h>
|
#include <rtems/rtems/support.h>
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/rtems/timerimpl.h>
|
#include <rtems/rtems/timerimpl.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/watchdog.h>
|
#include <rtems/score/watchdog.h>
|
||||||
|
|
||||||
rtems_status_code rtems_timer_get_information(
|
rtems_status_code rtems_timer_get_information(
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
#include <rtems/rtems/support.h>
|
#include <rtems/rtems/support.h>
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/rtems/timerimpl.h>
|
#include <rtems/rtems/timerimpl.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/watchdog.h>
|
#include <rtems/score/watchdog.h>
|
||||||
|
|
||||||
rtems_status_code rtems_timer_ident(
|
rtems_status_code rtems_timer_ident(
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
#include <rtems/rtems/support.h>
|
#include <rtems/rtems/support.h>
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/rtems/timerimpl.h>
|
#include <rtems/rtems/timerimpl.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/watchdogimpl.h>
|
#include <rtems/score/watchdogimpl.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include <rtems/rtems/timerimpl.h>
|
#include <rtems/rtems/timerimpl.h>
|
||||||
#include <rtems/rtems/tasksimpl.h>
|
#include <rtems/rtems/tasksimpl.h>
|
||||||
|
#include <rtems/score/isrlevel.h>
|
||||||
#include <rtems/score/threadimpl.h>
|
#include <rtems/score/threadimpl.h>
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/score/watchdogimpl.h>
|
#include <rtems/score/watchdogimpl.h>
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
#include <rtems/rtems/support.h>
|
#include <rtems/rtems/support.h>
|
||||||
#include <rtems/score/thread.h>
|
#include <rtems/score/thread.h>
|
||||||
#include <rtems/rtems/timerimpl.h>
|
#include <rtems/rtems/timerimpl.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
#include <rtems/score/watchdogimpl.h>
|
#include <rtems/score/watchdogimpl.h>
|
||||||
|
|
||||||
rtems_status_code rtems_timer_server_fire_after(
|
rtems_status_code rtems_timer_server_fire_after(
|
||||||
|
|||||||
@@ -18,10 +18,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#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/timerimpl.h>
|
||||||
#include <rtems/rtems/clock.h>
|
#include <rtems/rtems/clock.h>
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
|
|||||||
@@ -101,9 +101,6 @@ if HAS_SMP
|
|||||||
include_rtems_score_HEADERS += include/rtems/score/schedulersimplesmp.h
|
include_rtems_score_HEADERS += include/rtems/score/schedulersimplesmp.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
## inline
|
|
||||||
include_rtems_score_HEADERS += inline/rtems/score/tod.inl
|
|
||||||
|
|
||||||
## src
|
## src
|
||||||
|
|
||||||
AM_CPPFLAGS += -D__RTEMS_INSIDE__
|
AM_CPPFLAGS += -D__RTEMS_INSIDE__
|
||||||
@@ -301,7 +298,7 @@ libscore_a_SOURCES += src/ts64addto.c src/ts64dividebyinteger.c \
|
|||||||
## TOD_C_FILES
|
## TOD_C_FILES
|
||||||
libscore_a_SOURCES += src/coretod.c src/coretodset.c src/coretodget.c \
|
libscore_a_SOURCES += src/coretod.c src/coretodset.c src/coretodget.c \
|
||||||
src/coretodgetuptimetimespec.c src/coretodtickle.c \
|
src/coretodgetuptimetimespec.c src/coretodtickle.c \
|
||||||
src/coretodmsecstoticks.c src/coretodtickspersec.c src/coretodusectoticks.c
|
src/coretodtickspersec.c
|
||||||
|
|
||||||
## WATCHDOG_C_FILES
|
## WATCHDOG_C_FILES
|
||||||
libscore_a_SOURCES += src/watchdog.c src/watchdogadjust.c \
|
libscore_a_SOURCES += src/watchdog.c src/watchdogadjust.c \
|
||||||
|
|||||||
@@ -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
|
* @brief Time of Day Handler API
|
||||||
* with the Time of Day Handler.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -19,16 +18,18 @@
|
|||||||
#ifndef _RTEMS_SCORE_TOD_H
|
#ifndef _RTEMS_SCORE_TOD_H
|
||||||
#define _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/timestamp.h>
|
||||||
#include <rtems/score/basedefs.h> /* SCORE_EXTERN */
|
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup ScoreTODConstants TOD Constants
|
* @defgroup ScoreTOD Time of Day Handler
|
||||||
*
|
*
|
||||||
* @ingroup Score
|
* @ingroup Score
|
||||||
*
|
*
|
||||||
@@ -263,37 +264,6 @@ void _TOD_Get_uptime_as_timespec(
|
|||||||
*/
|
*/
|
||||||
void _TOD_Tickle_ticks( void );
|
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.
|
* @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()
|
#define TOD_TICKS_PER_SECOND TOD_TICKS_PER_SECOND_method()
|
||||||
|
|
||||||
#ifndef __RTEMS_APPLICATION__
|
/**
|
||||||
#include <rtems/score/tod.inl>
|
* This routine deactivates updating of the current time of day.
|
||||||
#endif
|
*/
|
||||||
|
|
||||||
|
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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**@}*/
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
/* end of include file */
|
/* end of include 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 */
|
|
||||||
@@ -339,7 +339,3 @@ $(PROJECT_INCLUDE)/rtems/score/schedulersimplesmp.h: include/rtems/score/schedul
|
|||||||
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulersimplesmp.h
|
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulersimplesmp.h
|
||||||
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulersimplesmp.h
|
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulersimplesmp.h
|
||||||
endif
|
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
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,10 +18,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <rtems/score/thread.h>
|
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/score/watchdog.h>
|
|
||||||
|
|
||||||
void _TOD_Handler_initialization(void)
|
void _TOD_Handler_initialization(void)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
|
#include <rtems/score/isrlevel.h>
|
||||||
#include <rtems/score/watchdogimpl.h>
|
#include <rtems/score/watchdogimpl.h>
|
||||||
|
|
||||||
Timestamp_Control *_TOD_Get_with_nanoseconds(
|
Timestamp_Control *_TOD_Get_with_nanoseconds(
|
||||||
|
|||||||
@@ -18,9 +18,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <rtems/score/isr.h>
|
|
||||||
#include <rtems/score/timestamp.h>
|
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
|
|
||||||
void _TOD_Get_uptime_as_timespec(
|
void _TOD_Get_uptime_as_timespec(
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
|
||||||
@@ -18,11 +18,8 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#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/tod.h>
|
||||||
|
#include <rtems/score/threaddispatch.h>
|
||||||
#include <rtems/score/watchdogimpl.h>
|
#include <rtems/score/watchdogimpl.h>
|
||||||
|
|
||||||
void _TOD_Set_with_timestamp(
|
void _TOD_Set_with_timestamp(
|
||||||
|
|||||||
@@ -18,9 +18,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <rtems/score/thread.h>
|
|
||||||
#include <rtems/score/timestamp.h>
|
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/score/watchdogimpl.h>
|
#include <rtems/score/watchdogimpl.h>
|
||||||
#include <rtems/config.h>
|
#include <rtems/config.h>
|
||||||
|
|||||||
@@ -18,9 +18,8 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <rtems/config.h>
|
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
|
#include <rtems/config.h>
|
||||||
|
|
||||||
uint32_t TOD_TICKS_PER_SECOND_method(void)
|
uint32_t TOD_TICKS_PER_SECOND_method(void)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
|
||||||
@@ -18,8 +18,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <rtems/score/timespec.h>
|
#include <rtems/score/timespec.h>
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/score/watchdog.h>
|
#include <rtems/score/watchdog.h>
|
||||||
|
|||||||
@@ -18,8 +18,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <rtems/score/timespec.h>
|
#include <rtems/score/timespec.h>
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <rtems/score/timespec.h>
|
#include <rtems/score/timespec.h>
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
|
|
||||||
|
|||||||
@@ -18,12 +18,9 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <rtems/config.h>
|
|
||||||
#include <rtems/score/timespec.h>
|
#include <rtems/score/timespec.h>
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
|
#include <rtems/config.h>
|
||||||
|
|
||||||
void _Timespec_From_ticks(
|
void _Timespec_From_ticks(
|
||||||
uint32_t ticks,
|
uint32_t ticks,
|
||||||
|
|||||||
@@ -18,9 +18,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <rtems/score/timespec.h>
|
#include <rtems/score/timespec.h>
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#include <rtems/system.h>
|
#include <rtems/system.h>
|
||||||
#include <rtems/score/timespec.h>
|
#include <rtems/score/timespec.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
|
|
||||||
bool _Timespec_Less_than(
|
bool _Timespec_Less_than(
|
||||||
const struct timespec *lhs,
|
const struct timespec *lhs,
|
||||||
|
|||||||
@@ -18,11 +18,8 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <rtems/score/timespec.h>
|
#include <rtems/score/timespec.h>
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/score/watchdog.h>
|
|
||||||
|
|
||||||
void _Timespec_Subtract(
|
void _Timespec_Subtract(
|
||||||
const struct timespec *start,
|
const struct timespec *start,
|
||||||
|
|||||||
@@ -15,13 +15,9 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <rtems/config.h>
|
|
||||||
#include <rtems/score/timespec.h>
|
#include <rtems/score/timespec.h>
|
||||||
#include <rtems/score/tod.h>
|
#include <rtems/score/tod.h>
|
||||||
#include <rtems/score/watchdog.h>
|
#include <rtems/config.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
#include <rtems/system.h>
|
#include <rtems/system.h>
|
||||||
#include <rtems/config.h>
|
#include <rtems/config.h>
|
||||||
#include <rtems/score/timestamp.h>
|
#include <rtems/score/timestamp.h>
|
||||||
#include <rtems/score/tod.h>
|
|
||||||
|
|
||||||
#if CPU_TIMESTAMP_USE_INT64 == TRUE
|
#if CPU_TIMESTAMP_USE_INT64 == TRUE
|
||||||
uint32_t _Timestamp64_To_ticks(
|
uint32_t _Timestamp64_To_ticks(
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ bdbuf_wait (const char* who, unsigned long timeout)
|
|||||||
rtems_event_set out;
|
rtems_event_set out;
|
||||||
sc = rtems_event_receive (RTEMS_EVENT_0,
|
sc = rtems_event_receive (RTEMS_EVENT_0,
|
||||||
RTEMS_WAIT | RTEMS_EVENT_ANY,
|
RTEMS_WAIT | RTEMS_EVENT_ANY,
|
||||||
TOD_MICROSECONDS_TO_TICKS (timeout * 1000),
|
RTEMS_MICROSECONDS_TO_TICKS (timeout * 1000),
|
||||||
&out);
|
&out);
|
||||||
if (sc != RTEMS_SUCCESSFUL)
|
if (sc != RTEMS_SUCCESSFUL)
|
||||||
{
|
{
|
||||||
@@ -236,7 +236,7 @@ bdbuf_watch (unsigned long timeout)
|
|||||||
rtems_event_set out;
|
rtems_event_set out;
|
||||||
sc = rtems_event_receive (RTEMS_EVENT_1,
|
sc = rtems_event_receive (RTEMS_EVENT_1,
|
||||||
RTEMS_WAIT | RTEMS_EVENT_ANY,
|
RTEMS_WAIT | RTEMS_EVENT_ANY,
|
||||||
TOD_MICROSECONDS_TO_TICKS (timeout * 1000),
|
RTEMS_MICROSECONDS_TO_TICKS (timeout * 1000),
|
||||||
&out);
|
&out);
|
||||||
if (sc != RTEMS_SUCCESSFUL)
|
if (sc != RTEMS_SUCCESSFUL)
|
||||||
{
|
{
|
||||||
@@ -330,7 +330,7 @@ static bool
|
|||||||
bdbuf_sleep (unsigned long msecs)
|
bdbuf_sleep (unsigned long msecs)
|
||||||
{
|
{
|
||||||
rtems_status_code sc;
|
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)
|
if (sc != RTEMS_SUCCESSFUL)
|
||||||
{
|
{
|
||||||
bdbuf_test_printf ("sleep wake after failed: ");
|
bdbuf_test_printf ("sleep wake after failed: ");
|
||||||
|
|||||||
@@ -18,6 +18,8 @@
|
|||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include "pritime.h"
|
#include "pritime.h"
|
||||||
|
|
||||||
|
#include <rtems/score/tod.h>
|
||||||
|
|
||||||
void *POSIX_Init(
|
void *POSIX_Init(
|
||||||
void *argument
|
void *argument
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include <rtems/score/tod.h>
|
||||||
|
|
||||||
#define MUTEX_BAD_ID 0xfffffffe
|
#define MUTEX_BAD_ID 0xfffffffe
|
||||||
|
|
||||||
void Print_mutexattr(
|
void Print_mutexattr(
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
#include "pmacros.h"
|
#include "pmacros.h"
|
||||||
#include "pritime.h"
|
#include "pritime.h"
|
||||||
|
|
||||||
|
#include <rtems/score/tod.h>
|
||||||
|
|
||||||
/* forward declarations to avoid warnings */
|
/* forward declarations to avoid warnings */
|
||||||
rtems_task Init(rtems_task_argument argument);
|
rtems_task Init(rtems_task_argument argument);
|
||||||
void check_enosys(int status);
|
void check_enosys(int status);
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <time.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
#define CONFIGURE_INIT
|
#define CONFIGURE_INIT
|
||||||
@@ -81,13 +82,9 @@ rtems_task Init(
|
|||||||
for (index=0 ; index <10 ; index++ ) {
|
for (index=0 ; index <10 ; index++ ) {
|
||||||
struct timespec start, stop;
|
struct timespec start, stop;
|
||||||
struct timespec diff;
|
struct timespec diff;
|
||||||
#if 0
|
|
||||||
clock_gettime( CLOCK_REALTIME, &start );
|
clock_gettime( CLOCK_REALTIME, &start );
|
||||||
clock_gettime( CLOCK_REALTIME, &stop );
|
clock_gettime( CLOCK_REALTIME, &stop );
|
||||||
#else
|
|
||||||
_TOD_Get( &start );
|
|
||||||
_TOD_Get( &stop );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
subtract_em( &start, &stop, &diff );
|
subtract_em( &start, &stop, &diff );
|
||||||
printf( "Start: %s:%ld\nStop : %s:%ld",
|
printf( "Start: %s:%ld\nStop : %s:%ld",
|
||||||
|
|||||||
@@ -25,12 +25,7 @@ rtems_task Task_1_through_3(
|
|||||||
status = rtems_object_get_classic_name( rtems_task_self(), &name );
|
status = rtems_object_get_classic_name( rtems_task_self(), &name );
|
||||||
directive_failed( status, "rtems_object_get_classic_name" );
|
directive_failed( status, "rtems_object_get_classic_name" );
|
||||||
|
|
||||||
/*
|
ticks = RTEMS_MILLISECONDS_TO_TICKS( index * 5 * 1000 );
|
||||||
* 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 );
|
|
||||||
|
|
||||||
while( FOREVER ) {
|
while( FOREVER ) {
|
||||||
status = rtems_clock_get_tod( &time );
|
status = rtems_clock_get_tod( &time );
|
||||||
|
|||||||
@@ -46,12 +46,7 @@ rtems_task Task5(
|
|||||||
Put_address_from_area_1( segment_address_1 );
|
Put_address_from_area_1( segment_address_1 );
|
||||||
new_line;
|
new_line;
|
||||||
|
|
||||||
/*
|
status = rtems_task_wake_after( RTEMS_MICROSECONDS_TO_TICKS( 1000000 ) );
|
||||||
* 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 ) );
|
|
||||||
directive_failed( status, "rtems_task_wake_after" );
|
directive_failed( status, "rtems_task_wake_after" );
|
||||||
|
|
||||||
puts( "TA5 - rtems_region_get_segment - wait on 3K segment from region 1" );
|
puts( "TA5 - rtems_region_get_segment - wait on 3K segment from region 1" );
|
||||||
|
|||||||
@@ -34,12 +34,7 @@ rtems_task Task_1_through_3(
|
|||||||
status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
|
status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
|
||||||
directive_failed( status, "rtems_task_ident" );
|
directive_failed( status, "rtems_task_ident" );
|
||||||
|
|
||||||
/*
|
ticks = RTEMS_MILLISECONDS_TO_TICKS( task_number( tid ) * 5 * 1000 );
|
||||||
* 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 );
|
|
||||||
|
|
||||||
while( FOREVER ) {
|
while( FOREVER ) {
|
||||||
status = rtems_clock_get_tod( &time );
|
status = rtems_clock_get_tod( &time );
|
||||||
|
|||||||
@@ -34,12 +34,7 @@ rtems_task Task_1_through_3(
|
|||||||
status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
|
status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
|
||||||
directive_failed( status, "rtems_task_ident" );
|
directive_failed( status, "rtems_task_ident" );
|
||||||
|
|
||||||
/*
|
ticks = RTEMS_MILLISECONDS_TO_TICKS( task_number( tid ) * 5 * 1000 );
|
||||||
* 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 );
|
|
||||||
|
|
||||||
while( FOREVER ) {
|
while( FOREVER ) {
|
||||||
status = rtems_clock_get_tod( &time );
|
status = rtems_clock_get_tod( &time );
|
||||||
|
|||||||
Reference in New Issue
Block a user