summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/include/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-02-18 08:36:26 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-03-04 13:36:10 +0100
commit03b900d3ed120ea919ea3eded7edbece3488cff3 (patch)
tree182781fc14fe15fd67caeb80e46f1c58495839c2 /cpukit/posix/include/rtems
parentscore: Distribute clock tick to all online CPUs (diff)
downloadrtems-03b900d3ed120ea919ea3eded7edbece3488cff3.tar.bz2
score: Replace watchdog handler implementation
Use a red-black tree instead of delta chains. Close #2344. Update #2554. Update #2555. Close #2606.
Diffstat (limited to 'cpukit/posix/include/rtems')
-rw-r--r--cpukit/posix/include/rtems/posix/pthreadimpl.h5
-rw-r--r--cpukit/posix/include/rtems/posix/threadsup.h2
-rw-r--r--cpukit/posix/include/rtems/posix/timerimpl.h54
3 files changed, 36 insertions, 25 deletions
diff --git a/cpukit/posix/include/rtems/posix/pthreadimpl.h b/cpukit/posix/include/rtems/posix/pthreadimpl.h
index 870b5f9460..16b0163384 100644
--- a/cpukit/posix/include/rtems/posix/pthreadimpl.h
+++ b/cpukit/posix/include/rtems/posix/pthreadimpl.h
@@ -114,10 +114,7 @@ void _POSIX_Threads_Sporadic_budget_callout(
* @param[in] argument is a pointer to the Thread_Control structure
* for the thread being replenished.
*/
-void _POSIX_Threads_Sporadic_budget_TSR(
- Objects_Id id,
- void *argument
-);
+void _POSIX_Threads_Sporadic_budget_TSR( Watchdog_Control *watchdog );
/**
* @brief Translate sched_param into SuperCore terms.
diff --git a/cpukit/posix/include/rtems/posix/threadsup.h b/cpukit/posix/include/rtems/posix/threadsup.h
index 55db35ddbd..7cd235409c 100644
--- a/cpukit/posix/include/rtems/posix/threadsup.h
+++ b/cpukit/posix/include/rtems/posix/threadsup.h
@@ -42,6 +42,8 @@ extern "C" {
* each thread in a system with POSIX configured.
*/
typedef struct {
+ /** Back pointer to thread of this POSIX API control. */
+ Thread_Control *thread;
/** This is the POSIX threads attribute set. */
pthread_attr_t Attributes;
/** This indicates whether the thread is attached or detached. */
diff --git a/cpukit/posix/include/rtems/posix/timerimpl.h b/cpukit/posix/include/rtems/posix/timerimpl.h
index 8b5b42e98a..2eefd7063c 100644
--- a/cpukit/posix/include/rtems/posix/timerimpl.h
+++ b/cpukit/posix/include/rtems/posix/timerimpl.h
@@ -21,6 +21,7 @@
#include <rtems/posix/timer.h>
#include <rtems/score/objectimpl.h>
+#include <rtems/score/watchdogimpl.h>
#ifdef __cplusplus
extern "C" {
@@ -51,24 +52,6 @@ extern "C" {
#endif
/**
- * @brief POSIX Timer Manager Timer Service Routine Helper
- *
- * This is the operation that is run when a timer expires.
- */
-void _POSIX_Timer_TSR(Objects_Id timer, void *data);
-
-/**
- * @brief POSIX Timer Watchdog Insertion Helper
- */
-bool _POSIX_Timer_Insert_helper(
- Watchdog_Control *timer,
- Watchdog_Interval ticks,
- Objects_Id id,
- Watchdog_Service_routine_entry TSR,
- void *arg
-);
-
-/**
* The following defines the information control block used to manage
* this class of objects.
*/
@@ -98,6 +81,8 @@ RTEMS_INLINE_ROUTINE void _POSIX_Timer_Free (
_Objects_Free( &_POSIX_Timer_Information, &the_timer->Object );
}
+void _POSIX_Timer_TSR( Watchdog_Control *the_watchdog );
+
/**
* @brief POSIX Timer Get
*
@@ -109,11 +94,38 @@ RTEMS_INLINE_ROUTINE void _POSIX_Timer_Free (
*/
RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get (
timer_t id,
- Objects_Locations *location
+ Objects_Locations *location,
+ ISR_lock_Context *lock_context
+)
+{
+ return (POSIX_Timer_Control *) _Objects_Get_isr_disable(
+ &_POSIX_Timer_Information,
+ (Objects_Id) id,
+ location,
+ lock_context
+ );
+}
+
+RTEMS_INLINE_ROUTINE Per_CPU_Control *_POSIX_Timer_Acquire_critical(
+ POSIX_Timer_Control *ptimer,
+ ISR_lock_Context *lock_context
+)
+{
+ Per_CPU_Control *cpu;
+
+ cpu = _Watchdog_Get_CPU( &ptimer->Timer );
+ _Watchdog_Per_CPU_acquire_critical( cpu, lock_context );
+
+ return cpu;
+}
+
+RTEMS_INLINE_ROUTINE void _POSIX_Timer_Release(
+ Per_CPU_Control *cpu,
+ ISR_lock_Context *lock_context
)
{
- return (POSIX_Timer_Control *)
- _Objects_Get( &_POSIX_Timer_Information, (Objects_Id) id, location );
+ _Watchdog_Per_CPU_release_critical( cpu, lock_context );
+ _ISR_lock_ISR_enable( lock_context );
}
#ifdef __cplusplus