[rtems commit] sptests/spintrcritical22: Avoid _Objects_Get()

Sebastian Huber sebh at rtems.org
Fri May 20 06:00:04 UTC 2016


Module:    rtems
Branch:    master
Commit:    92f6883073126f96973252cd57a5c7e24d88d412
Changeset: http://git.rtems.org/rtems/commit/?id=92f6883073126f96973252cd57a5c7e24d88d412

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue May 17 14:48:46 2016 +0200

sptests/spintrcritical22: Avoid _Objects_Get()

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;
 }




More information about the vc mailing list