[PATCH 4/4] score: Use Resource Handler for MrsP semaphores

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Jun 2 08:31:57 UTC 2014


On 2014-05-28 23:45, Gedare Bloom wrote:
>> @@ -200,27 +250,36 @@ RTEMS_INLINE_ROUTINE MRSP_Status _MRSP_Obtain(
>> >    MRSP_Status status;
>> >    const Scheduler_Control *scheduler = _Scheduler_Get( executing );
>> >    uint32_t scheduler_index = _Scheduler_Get_index( scheduler );
>> >+  Priority_Control initial_priority = executing->current_priority;
>> >    Priority_Control ceiling_priority =
>> >      _MRSP_Get_ceiling_priority( mrsp, scheduler_index );
>> >    bool priority_ok = !_Scheduler_Is_priority_higher_than(
>> >      scheduler,
>> >-    executing->current_priority,
>> >+    initial_priority,
>> >      ceiling_priority
>> >    );
>> >+  Resource_Node *owner = _Resource_Get_owner( &mrsp->Resource );
> I'd put this after the priority_ok check, for better readability by
> keeping the error check closer to the cause. (Ahem, this should
> probably be in our conventions too, eh?)
>

This change would affect code generation and would make it less efficient.  The 
_Scheduler_Is_priority_higher_than() calls a global function and thus owner 
would have to be saved/restored around this call.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list