<div dir="ltr">Hi,<div><br></div><div>This is the 3rd version of the patch. I realised that the previous version had a syntax error after I ran 'make' on the testsuite.</div><div>Please review this patch.</div><div><br></div><div>Thanks,</div><div>Richi.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 29, 2020 at 11:47 AM Richi Dubey <<a href="mailto:richidubey@gmail.com">richidubey@gmail.com</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">---<br>
testsuites/smptests/smpstrongapa01/init.c | 60 ++++++++++++++---------<br>
1 file changed, 38 insertions(+), 22 deletions(-)<br>
<br>
diff --git a/testsuites/smptests/smpstrongapa01/init.c b/testsuites/smptests/smpstrongapa01/init.c<br>
index bf8bc05231..d067f2b5b9 100644<br>
--- a/testsuites/smptests/smpstrongapa01/init.c<br>
+++ b/testsuites/smptests/smpstrongapa01/init.c<br>
@@ -16,7 +16,7 @@<br>
#include "config.h"<br>
#endif<br>
<br>
-#include "tmacros.h"<br>
+#include <tmacros.h><br>
<br>
#include <rtems.h><br>
<br>
@@ -30,9 +30,22 @@ const char rtems_test_name[] = "SMPSTRONGAPA 1";<br>
<br>
#define ALL ((UINT32_C(1) << CPU_COUNT) - 1)<br>
<br>
-#define IDLE UINT8_C(255)<br>
+typedef enum {<br>
+ T0,<br>
+ T1,<br>
+ T2,<br>
+ T3,<br>
+ T4,<br>
+ T5,<br>
+ T6,<br>
+ T7,<br>
+ T8,<br>
+ T9,<br>
+ T10,<br>
+ T11,<br>
+ IDLE<br>
+} task_index;<br>
<br>
-#define NAME rtems_build_name('S', 'A', 'P', 'A')<br>
<br>
typedef struct {<br>
enum {<br>
@@ -43,7 +56,7 @@ typedef struct {<br>
KIND_UNBLOCK<br>
} kind;<br>
<br>
- size_t index;<br>
+ task_index index;<br>
<br>
struct {<br>
rtems_task_priority priority;<br>
@@ -102,17 +115,17 @@ typedef struct {<br>
<br>
static const test_action test_actions[] = {<br>
RESET,<br>
- UNBLOCK( 0, 0, IDLE, IDLE, IDLE),<br>
- UNBLOCK( 1, 0, 1, IDLE, IDLE),<br>
- UNBLOCK( 2, 0, 1, 2, IDLE),<br>
- UNBLOCK( 3, 0, 1, 2, 3),<br>
- UNBLOCK( 5, 0, 1, 2, 3),<br>
- SET_PRIORITY( 3, P(4), 0, 1, 2, 3),<br>
- SET_PRIORITY( 5, P(3), 0, 1, 2, 5),<br>
- BLOCK( 5, 0, 1, 2, 3),<br>
- SET_AFFINITY( 5, ALL, 0, 1, 2, 3),<br>
+ UNBLOCK( T0, T0, IDLE, IDLE, IDLE),<br>
+ UNBLOCK( T1, T0, T1, IDLE, IDLE),<br>
+ UNBLOCK( T2, T0, T1, T2, IDLE),<br>
+ UNBLOCK( T3, T0, T1, T2, T3),<br>
+ UNBLOCK( T5, T0, T1, T2, T3),<br>
+ SET_PRIORITY( T3, P(4), T0, T1, T2, T3),<br>
+ SET_PRIORITY( T5, P(3), T0, T1, T2, T5),<br>
+ BLOCK( T5, T0, T1, T2, T3),<br>
+ SET_AFFINITY( T5, ALL, T0, T1, T2, T3),<br>
RESET,<br>
- UNBLOCK( 0, 0, IDLE, IDLE, IDLE),<br>
+ UNBLOCK( T0, T0, IDLE, IDLE, IDLE),<br>
RESET<br>
};<br>
<br>
@@ -130,7 +143,7 @@ static void set_affinity(rtems_id id, uint32_t cpu_set_32)<br>
{<br>
rtems_status_code sc;<br>
cpu_set_t cpu_set;<br>
- size_t i;<br>
+ task_index i;<br>
<br>
CPU_ZERO(&cpu_set);<br>
<br>
@@ -147,7 +160,7 @@ static void set_affinity(rtems_id id, uint32_t cpu_set_32)<br>
static void reset(test_context *ctx)<br>
{<br>
rtems_status_code sc;<br>
- size_t i;<br>
+ task_index i;<br>
<br>
for (i = CPU_COUNT; i < TASK_COUNT; ++i) {<br>
set_priority(ctx->task_ids[i], P(i));<br>
@@ -179,10 +192,10 @@ static void reset(test_context *ctx)<br>
<br>
static void check_cpu_allocations(test_context *ctx, const test_action *action)<br>
{<br>
- size_t i;<br>
+ task_index i;<br>
<br>
for (i = 0; i < CPU_COUNT; ++i) {<br>
- size_t e;<br>
+ task_index e;<br>
const Per_CPU_Control *c;<br>
const Thread_Control *h;<br>
<br>
@@ -206,7 +219,7 @@ static void timer(rtems_id id, void *arg)<br>
{<br>
test_context *ctx;<br>
rtems_status_code sc;<br>
- size_t i;<br>
+ task_index i;<br>
<br>
ctx = arg;<br>
i = ctx->action_index;<br>
@@ -271,7 +284,7 @@ static void test(void)<br>
{<br>
test_context *ctx;<br>
rtems_status_code sc;<br>
- size_t i;<br>
+ task_index i;<br>
<br>
ctx = &test_instance;<br>
<br>
@@ -279,7 +292,7 @@ static void test(void)<br>
<br>
for (i = 0; i < TASK_COUNT; ++i) {<br>
sc = rtems_task_create(<br>
- NAME,<br>
+ rtems_build_name(' ', ' ', 'T', '0' + i),<br>
P(i),<br>
RTEMS_MINIMUM_STACK_SIZE,<br>
RTEMS_DEFAULT_MODES,<br>
@@ -292,7 +305,10 @@ static void test(void)<br>
rtems_test_assert(sc == RTEMS_SUCCESSFUL);<br>
}<br>
<br>
- sc = rtems_timer_create(NAME, &ctx->timer_id);<br>
+ sc = rtems_timer_create(<br>
+ rtems_build_name('S', 'A', 'P', 'A'),<br>
+ &ctx->timer_id<br>
+ );<br>
rtems_test_assert(sc == RTEMS_SUCCESSFUL);<br>
<br>
sc = rtems_timer_fire_after(ctx->timer_id, 1, timer, ctx);<br>
-- <br>
2.17.1<br>
<br>
</blockquote></div>