[PATCH 22/32] sptests/spintrcritical22: Avoid _Objects_Get()

Sebastian Huber sebastian.huber at embedded-brains.de
Wed May 18 09:20:41 UTC 2016


Use _Semaphore_Get_interrupt_disable() instead.

Update #2555.
---
 testsuites/sptests/spintrcritical22/init.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/testsuites/sptests/spintrcritical22/init.c b/testsuites/sptests/spintrcritical22/init.c
index 1a377f7..aada98d 100644
--- a/testsuites/sptests/spintrcritical22/init.c
+++ b/testsuites/sptests/spintrcritical22/init.c
@@ -34,13 +34,12 @@ static test_context ctx_instance;
 static Semaphore_Control *get_semaphore_control(rtems_id id)
 {
   Objects_Locations location;
+  ISR_lock_Context lock_context;
   Semaphore_Control *sem;
 
-  sem = (Semaphore_Control *)
-    _Objects_Get(&_Semaphore_Information, id, &location);
-  _Thread_Unnest_dispatch();
-
-  rtems_test_assert(sem != NULL && location == OBJECTS_LOCAL);
+  sem = _Semaphore_Get_interrupt_disable(id, &location, &lock_context);
+  rtems_test_assert(sem != NULL);
+  _ISR_lock_ISR_enable(&lock_context);
 
   return sem;
 }
-- 
1.8.4.5




More information about the devel mailing list