Re: [PATCH] Fix compiler warnings for schedulerstrongapa.c
Done. Can you please check now? I have verified that it works. On Mon, Jul 5, 2021 at 11:09 AM Sebastian Huber < sebastian.hu...@embedded-brains.de> wrote: > On 03/07/2021 09:06, Richi Dubey wrote: > > --- > > cpukit/score/src/schedulerstrongapa.c | 21 - > > 1 file changed, 16 insertions(+), 5 deletions(-) > > > > diff --git a/cpukit/score/src/schedulerstrongapa.c > b/cpukit/score/src/schedulerstrongapa.c > > index 845d19d1a8..b34ffe4b6d 100644 > > --- a/cpukit/score/src/schedulerstrongapa.c > > +++ b/cpukit/score/src/schedulerstrongapa.c > > @@ -187,7 +187,7 @@ static inline Scheduler_Node * > _Scheduler_strong_APA_Find_highest_ready( > > uint32_t rear > > ) > > { > > - Scheduler_Node *highest_ready; > > + Scheduler_Node *highest_ready = NULL; > > Scheduler_strong_APA_CPU*CPU; > > const Chain_Node*tail; > > Chain_Node *next; > > @@ -259,6 +259,10 @@ static inline Scheduler_Node * > _Scheduler_strong_APA_Find_highest_ready( > > } > > } > > > > + /* > > + * By definition, the system would always have a ready node, > > + * hence highest_ready would not be NULL. > > + */ > > return highest_ready; > > Could you please add an _Assert( highest_ready != NULL ) statement here > and also to the following parts. > > -- > embedded brains GmbH > Herr Sebastian HUBER > Dornierstr. 4 > 82178 Puchheim > Germany > email: sebastian.hu...@embedded-brains.de > phone: +49-89-18 94 741 - 16 > fax: +49-89-18 94 741 - 08 > > Registergericht: Amtsgericht München > Registernummer: HRB 157899 > Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler > Unsere Datenschutzerklärung finden Sie hier: > https://embedded-brains.de/datenschutzerklaerung/ > ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH v2] Fix compiler warnings for schedulerstrongapa.c
--- cpukit/score/src/schedulerstrongapa.c | 24 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/cpukit/score/src/schedulerstrongapa.c b/cpukit/score/src/schedulerstrongapa.c index 845d19d1a8..2d138bc7c3 100644 --- a/cpukit/score/src/schedulerstrongapa.c +++ b/cpukit/score/src/schedulerstrongapa.c @@ -187,7 +187,7 @@ static inline Scheduler_Node * _Scheduler_strong_APA_Find_highest_ready( uint32_t rear ) { - Scheduler_Node *highest_ready; + Scheduler_Node *highest_ready = NULL; Scheduler_strong_APA_CPU*CPU; const Chain_Node*tail; Chain_Node *next; @@ -259,6 +259,12 @@ static inline Scheduler_Node * _Scheduler_strong_APA_Find_highest_ready( } } + /* + * By definition, the system would always have a ready node, + * hence highest_ready would not be NULL. + */ + _Assert( highest_ready != NULL ); + return highest_ready; } @@ -494,7 +500,7 @@ static inline Scheduler_Node* _Scheduler_strong_APA_Get_lowest_reachable( Per_CPU_Control **cpu_to_preempt ) { - Scheduler_Node *lowest_reachable; + Scheduler_Node *lowest_reachable = NULL; Priority_Control max_priority_num; uint32_tcpu_max; uint32_tcpu_index; @@ -546,6 +552,11 @@ static inline Scheduler_Node* _Scheduler_strong_APA_Get_lowest_reachable( } } } + /* + * Since it is not allowed for a task to have an empty affinity set, + * there would always be a lowest_reachable task, hence it would not be NULL + */ + _Assert( lowest_reachable != NULL ); return lowest_reachable; } @@ -673,7 +684,7 @@ static inline bool _Scheduler_strong_APA_Enqueue( Scheduler_strong_APA_CPU *CPU; uint32_t cpu_max; uint32_t cpu_index; - Per_CPU_Control *cpu_to_preempt; + Per_CPU_Control *cpu_to_preempt = NULL; Scheduler_Node *lowest_reachable; Scheduler_strong_APA_Node*strong_node; @@ -711,7 +722,12 @@ static inline bool _Scheduler_strong_APA_Enqueue( rear, &cpu_to_preempt ); - + /* + * Since it is not allowed for a task to have an empty affinity set, + * there would always be a lowest_reachable task, hence cpu_to_preempt + * would not be NULL. + */ + _Assert( cpu_to_preempt != NULL ); return _Scheduler_strong_APA_Do_enqueue( context, lowest_reachable, -- 2.17.1 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: RTEMS on uC5282
On Sun, Jul 4, 2021 at 5:08 PM Vijay Kumar Banerjee wrote: > > Hi, > > I have a uC5282 board running uClinux and I was wondering if someone > has instructions for converting the RTEMS exe files into boot files > that can be booted from the ram buffer (using `goram` from > uCbootloader. > This command works great! m68k-rtems6-objcopy -O binary capture.exe capture.ralf I will soon write a documentation for uC5282 (before I forget how I did it :p ) > The RTEMS documentation is empty: > https://docs.rtems.org/branches/master/user/bsps/bsps-m68k.html#uc5282 > > I will populate this section in the documentation once I figure out > how to run and debug RTEMS executables on it. Any help is much > appreciated. > > > > Best regards, > Vijay ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH] rtems:modify spthread01 testsuites for cond variable signal and broadcast intf
From: tianye --- testsuites/sptests/spthread01/init.c | 90 ++-- 1 file changed, 75 insertions(+), 15 deletions(-) diff --git a/testsuites/sptests/spthread01/init.c b/testsuites/sptests/spthread01/init.c index 9044ca2..63cc7b8 100644 --- a/testsuites/sptests/spthread01/init.c +++ b/testsuites/sptests/spthread01/init.c @@ -167,14 +167,30 @@ typedef struct { rtems_condition_variable cnd; } signal_context; -static void signal_task(rtems_task_argument arg) +static unsigned int g_exeing_task_cnt = 0; + +static void signal_task_1(rtems_task_argument arg) +{ + signal_context *s; + + s = (signal_context *) arg; + rtems_mutex_lock(&s->mtx); + rtems_condition_variable_wait(&s->cnd, &s->mtx); + rtems_mutex_unlock(&s->mtx); + g_exeing_task_cnt++; + rtems_task_exit(); +} + +static void signal_task_2(rtems_task_argument arg) { signal_context *s; s = (signal_context *) arg; rtems_mutex_lock(&s->mtx); - rtems_condition_variable_signal(&s->cnd); + rtems_condition_variable_wait(&s->cnd, &s->mtx); rtems_mutex_unlock(&s->mtx); + g_exeing_task_cnt++; + rtems_task_exit(); } static void test_condition_variable(void) @@ -183,7 +199,8 @@ static void test_condition_variable(void) signal_context s; const char *name; rtems_status_code sc; - rtems_id id; + rtems_id id1; + rtems_id id2; name = rtems_condition_variable_get_name(&a); rtems_test_assert(strcmp(name, "a") == 0); @@ -201,32 +218,75 @@ static void test_condition_variable(void) name = rtems_condition_variable_get_name(&s.cnd); rtems_test_assert(strcmp(name, "c") == 0); - rtems_condition_variable_signal(&s.cnd); - - rtems_condition_variable_broadcast(&s.cnd); + g_exeing_task_cnt = 0; + sc = rtems_task_create( +rtems_build_name('C', 'O', 'D', '1'), +2, +RTEMS_MINIMUM_STACK_SIZE, +RTEMS_DEFAULT_MODES, +RTEMS_DEFAULT_ATTRIBUTES, +&id1 + ); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_task_start(id1, signal_task_1, (rtems_task_argument) &s); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_task_create( +rtems_build_name('C', 'O', 'D', '2'), +2, +RTEMS_MINIMUM_STACK_SIZE, +RTEMS_DEFAULT_MODES, +RTEMS_DEFAULT_ATTRIBUTES, +&id2 + ); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_task_start(id2, signal_task_2, (rtems_task_argument) &s); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_task_wake_after(3); rtems_mutex_lock(&s.mtx); + rtems_condition_variable_signal(&s.cnd); + rtems_mutex_unlock(&s.mtx); + rtems_task_wake_after(3); + rtems_test_assert(g_exeing_task_cnt == 1); + + sc = rtems_task_delete(id1); + sc = rtems_task_delete(id2); + rtems_condition_variable_destroy(&s.cnd); + rtems_mutex_destroy(&s.mtx); + g_exeing_task_cnt = 0; sc = rtems_task_create( -rtems_build_name('C', 'O', 'N', 'D'), +rtems_build_name('C', 'O', 'D', '1'), 2, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, -&id +&id1 ); rtems_test_assert(sc == RTEMS_SUCCESSFUL); - - sc = rtems_task_start(id, signal_task, (rtems_task_argument) &s); + sc = rtems_task_start(id1, signal_task_1, (rtems_task_argument) &s); rtems_test_assert(sc == RTEMS_SUCCESSFUL); - - rtems_condition_variable_wait(&s.cnd, &s.mtx); - - sc = rtems_task_delete(id); + sc = rtems_task_create( +rtems_build_name('C', 'O', 'D', '2'), +2, +RTEMS_MINIMUM_STACK_SIZE, +RTEMS_DEFAULT_MODES, +RTEMS_DEFAULT_ATTRIBUTES, +&id2 + ); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_task_start(id2, signal_task_2, (rtems_task_argument) &s); rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_task_wake_after(3); + rtems_mutex_lock(&s.mtx); + rtems_condition_variable_broadcast(&s.cnd); rtems_mutex_unlock(&s.mtx); + rtems_task_wake_after(3); + rtems_test_assert(g_exeing_task_cnt == 2); + sc = rtems_task_delete(id1); + sc = rtems_task_delete(id2); rtems_condition_variable_destroy(&s.cnd); rtems_mutex_destroy(&s.mtx); } @@ -319,7 +379,7 @@ static void Init(rtems_task_argument arg) #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER -#define CONFIGURE_MAXIMUM_TASKS 2 +#define CONFIGURE_MAXIMUM_TASKS 3 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -- 1.8.3.1 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH v7] Update test smpstrongapa01
On 29/06/2021 09:05, Richi Dubey wrote: Update smpstrongapa01 to account for task shifting. Thanks, I checked it in. -- embedded brains GmbH Herr Sebastian HUBER Dornierstr. 4 82178 Puchheim Germany email: sebastian.hu...@embedded-brains.de phone: +49-89-18 94 741 - 16 fax: +49-89-18 94 741 - 08 Registergericht: Amtsgericht München Registernummer: HRB 157899 Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler Unsere Datenschutzerklärung finden Sie hier: https://embedded-brains.de/datenschutzerklaerung/ ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH v2] Fix compiler warnings for schedulerstrongapa.c
Thanks for the warning fix. -- embedded brains GmbH Herr Sebastian HUBER Dornierstr. 4 82178 Puchheim Germany email: sebastian.hu...@embedded-brains.de phone: +49-89-18 94 741 - 16 fax: +49-89-18 94 741 - 08 Registergericht: Amtsgericht München Registernummer: HRB 157899 Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler Unsere Datenschutzerklärung finden Sie hier: https://embedded-brains.de/datenschutzerklaerung/ ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: WAF build system: configure to prepend .o to all links?
Hello Peter, On 04/07/2021 15:02, Peter Dufault wrote: I want to build the i.MX RT BSP with a custom DTS file. It's easy to build an application using ones own "dts.o" file, but I want to build all the BSP tests with my dts.o. For now I just change the one in the tree but I don't want to do that. I don't want a BSP variant, either, since it's a custom board that shouldn't have changes in the tree. I want to get my "dts.o" in the link commands before the "-lrtemsbsp". I looked through what is in "config.ini" and don't see what I need. I can't over-ride LDFLAGS since that is appended in the command line after the libraries were already added. So I want to add a .o to the sources or a flag that goes in after the "-o" for the program output. Is there a way to do that? I even tried setting LINK_CC but though "waf configure" warned be it was set it didn't use it. I checked in a patch which should help to address this problem: https://git.rtems.org/rtems/commit/?id=c9e0445932691b3b34c7fff979e5799d53d58d59 Could you try if this works in config.ini LINKFLAGS = dts.o ? -- embedded brains GmbH Herr Sebastian HUBER Dornierstr. 4 82178 Puchheim Germany email: sebastian.hu...@embedded-brains.de phone: +49-89-18 94 741 - 16 fax: +49-89-18 94 741 - 08 Registergericht: Amtsgericht München Registernummer: HRB 157899 Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler Unsere Datenschutzerklärung finden Sie hier: https://embedded-brains.de/datenschutzerklaerung/ ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel