summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/spnsext01
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-10 08:25:32 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-11 10:58:09 +0100
commitd50acdbb6c8213114ce887a56daea02697c9e1a1 (patch)
treee48fb252786992308fa2dd6337c8a02db35bd10b /testsuites/sptests/spnsext01
parentsapi: Use one SMP lock for all chains (diff)
downloadrtems-d50acdbb6c8213114ce887a56daea02697c9e1a1.tar.bz2
score: Add local context to SMP lock API
Add a local context structure to the SMP lock API for acquire and release pairs. This context can be used to store the ISR level and profiling information. It may be later used to enable more sophisticated lock algorithms, e.g. MCS locks. There is only one lock that cannot be used with a local context. This is the per-CPU lock since here we would have to transfer the local context through a context switch which is very complicated.
Diffstat (limited to 'testsuites/sptests/spnsext01')
-rw-r--r--testsuites/sptests/spnsext01/init.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/testsuites/sptests/spnsext01/init.c b/testsuites/sptests/spnsext01/init.c
index cbe3c137cf..788ba0b187 100644
--- a/testsuites/sptests/spnsext01/init.c
+++ b/testsuites/sptests/spnsext01/init.c
@@ -21,8 +21,8 @@
static rtems_task Init(rtems_task_argument argument)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
- rtems_interrupt_lock lock = RTEMS_INTERRUPT_LOCK_INITIALIZER;
- rtems_interrupt_level level;
+ rtems_interrupt_lock lock;
+ rtems_interrupt_lock_context lock_context;
rtems_interval t0 = 0;
rtems_interval t1 = 0;
int i = 0;
@@ -51,7 +51,8 @@ static rtems_task Init(rtems_task_argument argument)
n = (3 * n) / 2;
- rtems_interrupt_lock_acquire(&lock, level);
+ rtems_interrupt_lock_initialize(&lock);
+ rtems_interrupt_lock_acquire(&lock, &lock_context);
sc = rtems_clock_get_uptime(&uptime);
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
for (i = 0; i < n; ++i) {
@@ -63,7 +64,7 @@ static rtems_task Init(rtems_task_argument argument)
rtems_test_assert(!_Timespec_Less_than(&new_uptime, &uptime));
uptime = new_uptime;
}
- rtems_interrupt_lock_release(&lock, level);
+ rtems_interrupt_lock_release(&lock, &lock_context);
puts("*** END OF TEST NANO SECONDS EXTENSION 1 ***");