summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-09-29 14:48:17 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-09-29 14:48:17 +0000
commitbebf0438d6ab8128952b425ee735b2835bcfe668 (patch)
tree2dd7d89a7812bb584766b144fa3be8330fa26f47
parent2000-09-29 Charles-Antoine Gauthier <charles.gauthier@nrc.ca> (diff)
downloadrtems-bebf0438d6ab8128952b425ee735b2835bcfe668.tar.bz2
2000-09-29 Stephan Merker <merker@decrc.abb.de>
* include/rtems/rtems/ratemon.h, src/ratemonperiod.c, src/ratemontimeout.c: Add next_length field so period length can be changed by the the sequence period(X), period(not X) with no intervening cancel or expiration.
-rw-r--r--c/src/exec/rtems/ChangeLog7
-rw-r--r--c/src/exec/rtems/include/rtems/rtems/ratemon.h1
-rw-r--r--c/src/exec/rtems/src/ratemonperiod.c7
-rw-r--r--c/src/exec/rtems/src/ratemontimeout.c9
-rw-r--r--cpukit/rtems/ChangeLog7
-rw-r--r--cpukit/rtems/include/rtems/rtems/ratemon.h1
-rw-r--r--cpukit/rtems/src/ratemonperiod.c7
-rw-r--r--cpukit/rtems/src/ratemontimeout.c9
8 files changed, 42 insertions, 6 deletions
diff --git a/c/src/exec/rtems/ChangeLog b/c/src/exec/rtems/ChangeLog
index c69bbab7d4..cf2f350f33 100644
--- a/c/src/exec/rtems/ChangeLog
+++ b/c/src/exec/rtems/ChangeLog
@@ -1,3 +1,10 @@
+2000-09-29 Stephan Merker <merker@decrc.abb.de>
+
+ * include/rtems/rtems/ratemon.h, src/ratemonperiod.c,
+ src/ratemontimeout.c: Add next_length field so period length
+ can be changed by the the sequence period(X), period(not X)
+ with no intervening cancel or expiration.
+
2000-09-04 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* optman/Makefile.am, src/Makefile.am: Include compile.am.
diff --git a/c/src/exec/rtems/include/rtems/rtems/ratemon.h b/c/src/exec/rtems/include/rtems/rtems/ratemon.h
index bc1036043f..51bafde19c 100644
--- a/c/src/exec/rtems/include/rtems/rtems/ratemon.h
+++ b/c/src/exec/rtems/include/rtems/rtems/ratemon.h
@@ -76,6 +76,7 @@ typedef struct {
rtems_rate_monotonic_period_states state;
unsigned32 owner_ticks_executed_at_period;
unsigned32 time_at_period;
+ unsigned32 next_length;
Thread_Control *owner;
} Rate_monotonic_Control;
diff --git a/c/src/exec/rtems/src/ratemonperiod.c b/c/src/exec/rtems/src/ratemonperiod.c
index 6d031cf218..854f39f812 100644
--- a/c/src/exec/rtems/src/ratemonperiod.c
+++ b/c/src/exec/rtems/src/ratemonperiod.c
@@ -95,6 +95,7 @@ rtems_status_code rtems_rate_monotonic_period(
_Thread_Executing->ticks_executed;
the_period->time_at_period = _Watchdog_Ticks_since_boot;
+ the_period->next_length = length;
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
@@ -103,10 +104,13 @@ rtems_status_code rtems_rate_monotonic_period(
case RATE_MONOTONIC_ACTIVE:
/*
* This tells the _Rate_monotonic_Timeout that this task is
- * in the process of blocking on the period.
+ * in the process of blocking on the period and that we
+ * may be changing the length of the next period.
*/
the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING;
+ the_period->next_length = length;
+
_ISR_Enable( level );
_Thread_Executing->Wait.id = the_period->Object.id;
@@ -140,6 +144,7 @@ rtems_status_code rtems_rate_monotonic_period(
the_period->owner_ticks_executed_at_period =
_Thread_Executing->ticks_executed;
the_period->time_at_period = _Watchdog_Ticks_since_boot;
+ the_period->next_length = length;
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
diff --git a/c/src/exec/rtems/src/ratemontimeout.c b/c/src/exec/rtems/src/ratemontimeout.c
index 0a53059d1b..607cee16ce 100644
--- a/c/src/exec/rtems/src/ratemontimeout.c
+++ b/c/src/exec/rtems/src/ratemontimeout.c
@@ -44,6 +44,11 @@ void _Rate_monotonic_Timeout(
Objects_Locations location;
Thread_Control *the_thread;
+ /*
+ * When we get here, the Timer is already off the chain so we do not
+ * have to worry about that -- hence no _Watchdog_Remove().
+ */
+
the_period = _Rate_monotonic_Get( id, &location );
switch ( location ) {
case OBJECTS_REMOTE: /* impossible */
@@ -60,14 +65,14 @@ void _Rate_monotonic_Timeout(
the_period->time_at_period = _Watchdog_Ticks_since_boot;
- _Watchdog_Reset( &the_period->Timer );
+ _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length );
} else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) {
the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING;
the_period->owner_ticks_executed_at_period =
the_thread->ticks_executed;
the_period->time_at_period = _Watchdog_Ticks_since_boot;
- _Watchdog_Reset( &the_period->Timer );
+ _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length );
} else
the_period->state = RATE_MONOTONIC_EXPIRED;
_Thread_Unnest_dispatch();
diff --git a/cpukit/rtems/ChangeLog b/cpukit/rtems/ChangeLog
index c69bbab7d4..cf2f350f33 100644
--- a/cpukit/rtems/ChangeLog
+++ b/cpukit/rtems/ChangeLog
@@ -1,3 +1,10 @@
+2000-09-29 Stephan Merker <merker@decrc.abb.de>
+
+ * include/rtems/rtems/ratemon.h, src/ratemonperiod.c,
+ src/ratemontimeout.c: Add next_length field so period length
+ can be changed by the the sequence period(X), period(not X)
+ with no intervening cancel or expiration.
+
2000-09-04 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* optman/Makefile.am, src/Makefile.am: Include compile.am.
diff --git a/cpukit/rtems/include/rtems/rtems/ratemon.h b/cpukit/rtems/include/rtems/rtems/ratemon.h
index bc1036043f..51bafde19c 100644
--- a/cpukit/rtems/include/rtems/rtems/ratemon.h
+++ b/cpukit/rtems/include/rtems/rtems/ratemon.h
@@ -76,6 +76,7 @@ typedef struct {
rtems_rate_monotonic_period_states state;
unsigned32 owner_ticks_executed_at_period;
unsigned32 time_at_period;
+ unsigned32 next_length;
Thread_Control *owner;
} Rate_monotonic_Control;
diff --git a/cpukit/rtems/src/ratemonperiod.c b/cpukit/rtems/src/ratemonperiod.c
index 6d031cf218..854f39f812 100644
--- a/cpukit/rtems/src/ratemonperiod.c
+++ b/cpukit/rtems/src/ratemonperiod.c
@@ -95,6 +95,7 @@ rtems_status_code rtems_rate_monotonic_period(
_Thread_Executing->ticks_executed;
the_period->time_at_period = _Watchdog_Ticks_since_boot;
+ the_period->next_length = length;
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
@@ -103,10 +104,13 @@ rtems_status_code rtems_rate_monotonic_period(
case RATE_MONOTONIC_ACTIVE:
/*
* This tells the _Rate_monotonic_Timeout that this task is
- * in the process of blocking on the period.
+ * in the process of blocking on the period and that we
+ * may be changing the length of the next period.
*/
the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING;
+ the_period->next_length = length;
+
_ISR_Enable( level );
_Thread_Executing->Wait.id = the_period->Object.id;
@@ -140,6 +144,7 @@ rtems_status_code rtems_rate_monotonic_period(
the_period->owner_ticks_executed_at_period =
_Thread_Executing->ticks_executed;
the_period->time_at_period = _Watchdog_Ticks_since_boot;
+ the_period->next_length = length;
_Watchdog_Insert_ticks( &the_period->Timer, length );
_Thread_Enable_dispatch();
diff --git a/cpukit/rtems/src/ratemontimeout.c b/cpukit/rtems/src/ratemontimeout.c
index 0a53059d1b..607cee16ce 100644
--- a/cpukit/rtems/src/ratemontimeout.c
+++ b/cpukit/rtems/src/ratemontimeout.c
@@ -44,6 +44,11 @@ void _Rate_monotonic_Timeout(
Objects_Locations location;
Thread_Control *the_thread;
+ /*
+ * When we get here, the Timer is already off the chain so we do not
+ * have to worry about that -- hence no _Watchdog_Remove().
+ */
+
the_period = _Rate_monotonic_Get( id, &location );
switch ( location ) {
case OBJECTS_REMOTE: /* impossible */
@@ -60,14 +65,14 @@ void _Rate_monotonic_Timeout(
the_period->time_at_period = _Watchdog_Ticks_since_boot;
- _Watchdog_Reset( &the_period->Timer );
+ _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length );
} else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) {
the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING;
the_period->owner_ticks_executed_at_period =
the_thread->ticks_executed;
the_period->time_at_period = _Watchdog_Ticks_since_boot;
- _Watchdog_Reset( &the_period->Timer );
+ _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length );
} else
the_period->state = RATE_MONOTONIC_EXPIRED;
_Thread_Unnest_dispatch();