<div dir="ltr"><div dir="ltr">Sorry to pick Sebastian and I know it is too late to fix but in <div>providing feedback to Ryan and Alexon their commit messages,</div><div>"Fix XXX" was a pattern I realized really was not good and </div><div>encouraged them to avoid. </div><div><br></div><div>Look at <a href="https://git.rtems.org/rtems/log/">https://git.rtems.org/rtems/log/</a> and see which ones give </div><div>you a solid hint and which ones say little beyond "I changed something".</div><div><br></div><div>I'm not sure how to turn this into solid guidance for the future</div><div>except that the title message should be short but specific enough</div><div>to hint at the purpose of the patch.</div><div><br></div><div>I think we all get in a hurry and forget that these messages are </div><div>permanent records and there for others (and ourselves) in the future.</div><div><br></div><div>No offense.</div><div><br></div><div>--joel</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 18, 2021 at 4:39 AM Sebastian Huber <<a href="mailto:sebh@rtems.org">sebh@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Module: rtems<br>
Branch: master<br>
Commit: 50abce31efeb54efd1957143e3cbf279785d8a9b<br>
Changeset: <a href="http://git.rtems.org/rtems/commit/?id=50abce31efeb54efd1957143e3cbf279785d8a9b" rel="noreferrer" target="_blank">http://git.rtems.org/rtems/commit/?id=50abce31efeb54efd1957143e3cbf279785d8a9b</a><br>
<br>
Author: Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>><br>
Date: Thu Mar 18 10:37:23 2021 +0100<br>
<br>
rtems: Fix rtems_task_mode()<br>
<br>
Do the ASR and preemption mode change only if requested by the mode<br>
mask. The bug was introduced by<br>
508f868237225a75e566d9fd304206363cfe441d.<br>
<br>
---<br>
<br>
cpukit/rtems/src/taskmode.c | 38 ++++++++++++++++++++++----------------<br>
1 file changed, 22 insertions(+), 16 deletions(-)<br>
<br>
diff --git a/cpukit/rtems/src/taskmode.c b/cpukit/rtems/src/taskmode.c<br>
index 377224c..96bed47 100644<br>
--- a/cpukit/rtems/src/taskmode.c<br>
+++ b/cpukit/rtems/src/taskmode.c<br>
@@ -94,31 +94,37 @@ rtems_status_code rtems_task_mode(<br>
if ( ( mask & ( RTEMS_ASR_MASK | RTEMS_PREEMPT_MASK ) ) != 0 ) {<br>
bool need_thread_dispatch;<br>
ISR_lock_Context lock_context;<br>
- bool previous_asr_is_enabled;<br>
- bool previous_is_preemptible;<br>
<br>
need_thread_dispatch = false;<br>
<br>
_Thread_State_acquire( executing, &lock_context );<br>
<br>
- previous_asr_is_enabled = asr->is_enabled;<br>
- asr->is_enabled = !_Modes_Is_asr_disabled( mode_set );<br>
+ if ( ( mask & RTEMS_ASR_MASK ) != 0 ) {<br>
+ bool previous_asr_is_enabled;<br>
<br>
- if (<br>
- !previous_asr_is_enabled &&<br>
- asr->is_enabled &&<br>
- asr->signals_pending != 0<br>
- ) {<br>
- need_thread_dispatch = true;<br>
- _Thread_Append_post_switch_action( executing, &api->Signal_action );<br>
+ previous_asr_is_enabled = asr->is_enabled;<br>
+ asr->is_enabled = !_Modes_Is_asr_disabled( mode_set );<br>
+<br>
+ if (<br>
+ !previous_asr_is_enabled &&<br>
+ asr->is_enabled &&<br>
+ asr->signals_pending != 0<br>
+ ) {<br>
+ need_thread_dispatch = true;<br>
+ _Thread_Append_post_switch_action( executing, &api->Signal_action );<br>
+ }<br>
}<br>
<br>
- previous_is_preemptible = executing->is_preemptible;<br>
- executing->is_preemptible = _Modes_Is_preempt( mode_set );<br>
+ if ( ( mask & RTEMS_PREEMPT_MASK ) != 0 ) {<br>
+ bool previous_is_preemptible;<br>
+<br>
+ previous_is_preemptible = executing->is_preemptible;<br>
+ executing->is_preemptible = _Modes_Is_preempt( mode_set );<br>
<br>
- if ( executing->is_preemptible && !previous_is_preemptible ) {<br>
- need_thread_dispatch = true;<br>
- _Scheduler_Schedule( executing );<br>
+ if ( executing->is_preemptible && !previous_is_preemptible ) {<br>
+ need_thread_dispatch = true;<br>
+ _Scheduler_Schedule( executing );<br>
+ }<br>
}<br>
<br>
if ( need_thread_dispatch ) {<br>
<br>
_______________________________________________<br>
vc mailing list<br>
<a href="mailto:vc@rtems.org" target="_blank">vc@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/vc" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/vc</a><br>
</blockquote></div></div>