summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-20 08:45:41 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-21 08:25:31 +0200
commit4db0ae8e07870d4ca23dc1b9f8097e3494fe82a2 (patch)
treee7ba3533960b935b67b152198bba713b1c4ebed2 /cpukit/rtems
parentscore: Add _ISR_lock_ISR_disable/enable() (diff)
downloadrtems-4db0ae8e07870d4ca23dc1b9f8097e3494fe82a2.tar.bz2
score: _Objects_Get_isr_disable()
Use ISR_lock_Context instead of ISR_Level to allow use of ISR locks for low-level locking. Update #2273.
Diffstat (limited to 'cpukit/rtems')
-rw-r--r--cpukit/rtems/include/rtems/rtems/semimpl.h10
-rw-r--r--cpukit/rtems/src/semobtain.c14
2 files changed, 16 insertions, 8 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/semimpl.h b/cpukit/rtems/include/rtems/rtems/semimpl.h
index b4d1e83e13..8c93e93554 100644
--- a/cpukit/rtems/include/rtems/rtems/semimpl.h
+++ b/cpukit/rtems/include/rtems/rtems/semimpl.h
@@ -190,11 +190,15 @@ RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get (
RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get_interrupt_disable (
Objects_Id id,
Objects_Locations *location,
- ISR_Level *level
+ ISR_lock_Context *lock_context
)
{
- return (Semaphore_Control *)
- _Objects_Get_isr_disable( &_Semaphore_Information, id, location, level );
+ return (Semaphore_Control *) _Objects_Get_isr_disable(
+ &_Semaphore_Information,
+ id,
+ location,
+ lock_context
+ );
}
#ifdef __cplusplus
diff --git a/cpukit/rtems/src/semobtain.c b/cpukit/rtems/src/semobtain.c
index 3608a00053..152274ea0a 100644
--- a/cpukit/rtems/src/semobtain.c
+++ b/cpukit/rtems/src/semobtain.c
@@ -39,12 +39,16 @@ rtems_status_code rtems_semaphore_obtain(
{
Semaphore_Control *the_semaphore;
Objects_Locations location;
- ISR_Level level;
+ ISR_lock_Context lock_context;
Thread_Control *executing;
rtems_attribute attribute_set;
bool wait;
- the_semaphore = _Semaphore_Get_interrupt_disable( id, &location, &level );
+ the_semaphore = _Semaphore_Get_interrupt_disable(
+ id,
+ &location,
+ &lock_context
+ );
switch ( location ) {
case OBJECTS_LOCAL:
@@ -55,7 +59,7 @@ rtems_status_code rtems_semaphore_obtain(
if ( _Attributes_Is_multiprocessor_resource_sharing( attribute_set ) ) {
MRSP_Status mrsp_status;
- _ISR_Enable( level );
+ _ISR_lock_ISR_enable( &lock_context );
mrsp_status = _MRSP_Obtain(
&the_semaphore->Core_control.mrsp,
executing,
@@ -73,7 +77,7 @@ rtems_status_code rtems_semaphore_obtain(
id,
wait,
timeout,
- level
+ &lock_context
);
_Objects_Put_for_get_isr_disable( &the_semaphore->Object );
return _Semaphore_Translate_core_mutex_return_code(
@@ -87,7 +91,7 @@ rtems_status_code rtems_semaphore_obtain(
id,
wait,
timeout,
- level
+ &lock_context
);
_Objects_Put_for_get_isr_disable( &the_semaphore->Object );
return _Semaphore_Translate_core_semaphore_return_code(