summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/include/rtems/rtems
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/rtems/include/rtems/rtems')
-rw-r--r--cpukit/rtems/include/rtems/rtems/barrierimpl.h1
-rw-r--r--cpukit/rtems/include/rtems/rtems/clock.h31
-rw-r--r--cpukit/rtems/include/rtems/rtems/event.h5
-rw-r--r--cpukit/rtems/include/rtems/rtems/messageimpl.h16
-rw-r--r--cpukit/rtems/include/rtems/rtems/regionimpl.h2
-rw-r--r--cpukit/rtems/include/rtems/rtems/timerimpl.h60
6 files changed, 62 insertions, 53 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/barrierimpl.h b/cpukit/rtems/include/rtems/rtems/barrierimpl.h
index 963ebd93da..e718028715 100644
--- a/cpukit/rtems/include/rtems/rtems/barrierimpl.h
+++ b/cpukit/rtems/include/rtems/rtems/barrierimpl.h
@@ -86,6 +86,7 @@ RTEMS_INLINE_ROUTINE void _Barrier_Free (
Barrier_Control *the_barrier
)
{
+ _CORE_barrier_Destroy( &the_barrier->Barrier );
_Objects_Free( &_Barrier_Information, &the_barrier->Object );
}
diff --git a/cpukit/rtems/include/rtems/rtems/clock.h b/cpukit/rtems/include/rtems/rtems/clock.h
index 2a1c77251f..989bf2f5c9 100644
--- a/cpukit/rtems/include/rtems/rtems/clock.h
+++ b/cpukit/rtems/include/rtems/rtems/clock.h
@@ -14,7 +14,6 @@
*
* - set the current date and time
* - obtain the current date and time
- * - set the nanoseconds since last clock tick handler
* - announce a clock tick
* - obtain the system uptime
*/
@@ -35,6 +34,7 @@
#include <rtems/rtems/status.h>
#include <rtems/rtems/types.h>
#include <rtems/config.h>
+#include <rtems/score/timecounterimpl.h>
#include <sys/time.h> /* struct timeval */
@@ -69,12 +69,6 @@ typedef enum {
} rtems_clock_get_options;
/**
- * Type for the nanoseconds since last tick BSP extension.
- */
-typedef TOD_Nanoseconds_since_last_tick_routine
- rtems_nanoseconds_extension_routine;
-
-/**
* @brief Obtain Current Time of Day
*
* @deprecated rtems_clock_get() is deprecated. Use the more explicit
@@ -279,24 +273,6 @@ rtems_status_code rtems_clock_set(
rtems_status_code rtems_clock_tick( void );
/**
- * @brief Set the BSP specific Nanoseconds Extension
- *
- * Clock Manager
- *
- * This directive sets the BSP provided nanoseconds since last tick
- * extension.
- *
- * @param[in] routine is a pointer to the extension routine
- *
- * @return This method returns RTEMS_SUCCESSFUL if there was not an
- * error. Otherwise, a status code is returned indicating the
- * source of the error.
- */
-rtems_status_code rtems_clock_set_nanoseconds_extension(
- rtems_nanoseconds_extension_routine routine
-);
-
-/**
* @brief Obtain the System Uptime
*
* This directive returns the system uptime.
@@ -328,7 +304,10 @@ void rtems_clock_get_uptime_timeval( struct timeval *uptime );
*
* @retval The system uptime in seconds.
*/
-time_t rtems_clock_get_uptime_seconds( void );
+RTEMS_INLINE_ROUTINE time_t rtems_clock_get_uptime_seconds( void )
+{
+ return _Timecounter_Time_uptime - 1;
+}
/**
* @brief Returns the system uptime in nanoseconds.
diff --git a/cpukit/rtems/include/rtems/rtems/event.h b/cpukit/rtems/include/rtems/rtems/event.h
index dce7de1165..012452a9d8 100644
--- a/cpukit/rtems/include/rtems/rtems/event.h
+++ b/cpukit/rtems/include/rtems/rtems/event.h
@@ -319,6 +319,11 @@ rtems_status_code rtems_event_receive (
#define RTEMS_EVENT_SYSTEM_NETWORK_CLOSE RTEMS_EVENT_26
/**
+ * @brief Reserved system event for the timer server.
+ */
+#define RTEMS_EVENT_SYSTEM_TIMER_SERVER RTEMS_EVENT_30
+
+/**
* @brief Reserved system event for transient usage.
*/
#define RTEMS_EVENT_SYSTEM_TRANSIENT RTEMS_EVENT_31
diff --git a/cpukit/rtems/include/rtems/rtems/messageimpl.h b/cpukit/rtems/include/rtems/rtems/messageimpl.h
index e2bc88d0db..2399d65f29 100644
--- a/cpukit/rtems/include/rtems/rtems/messageimpl.h
+++ b/cpukit/rtems/include/rtems/rtems/messageimpl.h
@@ -18,6 +18,7 @@
#include <rtems/rtems/message.h>
#include <rtems/score/objectimpl.h>
+#include <rtems/score/coremsgimpl.h>
#ifdef __cplusplus
extern "C" {
@@ -138,6 +139,21 @@ RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get (
_Objects_Get( &_Message_queue_Information, id, location );
}
+RTEMS_INLINE_ROUTINE Message_queue_Control *
+_Message_queue_Get_interrupt_disable(
+ Objects_Id id,
+ Objects_Locations *location,
+ ISR_lock_Context *lock_context
+)
+{
+ return (Message_queue_Control *) _Objects_Get_isr_disable(
+ &_Message_queue_Information,
+ id,
+ location,
+ lock_context
+ );
+}
+
RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Allocate( void )
{
return (Message_queue_Control *)
diff --git a/cpukit/rtems/include/rtems/rtems/regionimpl.h b/cpukit/rtems/include/rtems/rtems/regionimpl.h
index 9ff7b966ca..ae1a50d208 100644
--- a/cpukit/rtems/include/rtems/rtems/regionimpl.h
+++ b/cpukit/rtems/include/rtems/rtems/regionimpl.h
@@ -20,6 +20,7 @@
#include <rtems/rtems/region.h>
#include <rtems/score/heapimpl.h>
#include <rtems/score/objectimpl.h>
+#include <rtems/score/threadqimpl.h>
#include <rtems/debug.h>
#ifdef __cplusplus
@@ -84,6 +85,7 @@ RTEMS_INLINE_ROUTINE void _Region_Free (
Region_Control *the_region
)
{
+ _Thread_queue_Destroy( &the_region->Wait_queue );
_Objects_Free( &_Region_Information, &the_region->Object );
}
diff --git a/cpukit/rtems/include/rtems/rtems/timerimpl.h b/cpukit/rtems/include/rtems/rtems/timerimpl.h
index b695d5e2fe..e5b37aa5f1 100644
--- a/cpukit/rtems/include/rtems/rtems/timerimpl.h
+++ b/cpukit/rtems/include/rtems/rtems/timerimpl.h
@@ -50,9 +50,9 @@ extern "C" {
typedef struct Timer_server_Control Timer_server_Control;
/**
- * @brief Method used to schedule the insertion of task based timers.
+ * @brief Method used for task based timers.
*/
-typedef void (*Timer_server_Schedule_operation)(
+typedef void (*Timer_server_Method)(
Timer_server_Control *timer_server,
Timer_Control *timer
);
@@ -65,28 +65,52 @@ typedef struct {
Watchdog_Control System_watchdog;
/**
+ * @brief Remaining delta of the system watchdog.
+ */
+ Watchdog_Interval system_watchdog_delta;
+
+ /**
+ * @brief Unique identifier of the context which deals currently with the
+ * system watchdog.
+ */
+ Thread_Control *system_watchdog_helper;
+
+ /**
+ * @brief Each insert and tickle operation increases the generation count so
+ * that the system watchdog dealer notices updates of the watchdog chain.
+ */
+ uint32_t generation;
+
+ /**
* @brief Watchdog header managed by the timer server.
*/
Watchdog_Header Header;
/**
- * @brief Last known time snapshot of the timer server.
+ * @brief Last time snapshot of the timer server.
*
* The units may be ticks or seconds.
*/
- Watchdog_Interval volatile last_snapshot;
+ Watchdog_Interval last_snapshot;
+
+ /**
+ * @brief Current time snapshot of the timer server.
+ *
+ * The units may be ticks or seconds.
+ */
+ Watchdog_Interval current_snapshot;
} Timer_server_Watchdogs;
struct Timer_server_Control {
/**
- * @brief Timer server thread.
+ * @brief The cancel method of the timer server.
*/
- Thread_Control *thread;
+ Timer_server_Method cancel;
/**
* @brief The schedule operation method of the timer server.
*/
- Timer_server_Schedule_operation schedule_operation;
+ Timer_server_Method schedule_operation;
/**
* @brief Interval watchdogs triggered by the timer server.
@@ -97,26 +121,6 @@ struct Timer_server_Control {
* @brief TOD watchdogs triggered by the timer server.
*/
Timer_server_Watchdogs TOD_watchdogs;
-
- /**
- * @brief Chain of timers scheduled for insert.
- *
- * This pointer is not @c NULL whenever the interval and TOD chains are
- * processed. After the processing this list will be checked and if
- * necessary the processing will be restarted. Processing of these chains
- * can be only interrupted through interrupts.
- */
- Chain_Control *volatile insert_chain;
-
- /**
- * @brief Indicates that the timer server is active or not.
- *
- * The server is active after the delay on a system watchdog. The activity
- * period of the server ends when no more watchdogs managed by the server
- * fire. The system watchdogs must not be manipulated when the server is
- * active.
- */
- bool volatile active;
};
/**
@@ -220,6 +224,8 @@ RTEMS_INLINE_ROUTINE bool _Timer_Is_dormant_class (
return ( the_class == TIMER_DORMANT );
}
+void _Timer_Cancel( Timer_Control *the_timer );
+
/**@}*/
#ifdef __cplusplus