Commit f58adda7 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

Verified on target, sync works properly

parent deef4444
Pipeline #105 skipped
...@@ -34,7 +34,7 @@ rtems_task Init(rtems_task_argument argument) ...@@ -34,7 +34,7 @@ rtems_task Init(rtems_task_argument argument)
i == 0 ? RTEMS_FLOATING_POINT : RTEMS_DEFAULT_ATTRIBUTES, i == 0 ? RTEMS_FLOATING_POINT : RTEMS_DEFAULT_ATTRIBUTES,
&Task_id[i]); &Task_id[i]);
if (status != RTEMS_SUCCESSFUL) { if (status != RTEMS_SUCCESSFUL) {
printf("Failed to rtems_task_create... status:%0x\n", status); printf("[PARENT] Failed to rtems_task_create... status:%0x\n", status);
rtems_task_delete(RTEMS_SELF); rtems_task_delete(RTEMS_SELF);
} }
...@@ -45,7 +45,7 @@ rtems_task Init(rtems_task_argument argument) ...@@ -45,7 +45,7 @@ rtems_task Init(rtems_task_argument argument)
i); i);
} }
// To give coverage code room to breathe! // To give coverage code room to breathe!
printf("Parent task waits for his children to complete...\n"); printf("[PARENT] Parent task waits for his children to complete...\n");
{ {
rtems_option options = (RTEMS_EVENT_ANY | RTEMS_WAIT); rtems_option options = (RTEMS_EVENT_ANY | RTEMS_WAIT);
rtems_event_set in = (RTEMS_EVENT_0 | RTEMS_EVENT_1); rtems_event_set in = (RTEMS_EVENT_0 | RTEMS_EVENT_1);
...@@ -55,11 +55,11 @@ rtems_task Init(rtems_task_argument argument) ...@@ -55,11 +55,11 @@ rtems_task Init(rtems_task_argument argument)
status = rtems_event_receive(in, options, RTEMS_NO_TIMEOUT, &out); status = rtems_event_receive(in, options, RTEMS_NO_TIMEOUT, &out);
if ( status == RTEMS_SUCCESSFUL ) { if ( status == RTEMS_SUCCESSFUL ) {
completed |= out; completed |= out;
printf("Task completed!\n"); printf("[PARENT] Task completed!\n");
fflush(stdout); fflush(stdout);
} }
} }
printf("All tasks completed!\n"); printf("[PARENT] All tasks completed!\n");
fflush(stdout); fflush(stdout);
} }
exit(0); exit(0);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
rtems_task Task1_EntryPoint(rtems_task_argument argument) rtems_task Task1_EntryPoint(rtems_task_argument argument)
{ {
int task_no = (int) argument; int task_no = (int) argument;
printf("Inside task %d...\n", task_no); printf("[TASK %d] Starting...\n", task_no);
fflush(stdout); fflush(stdout);
int j; int j;
...@@ -15,7 +15,7 @@ rtems_task Task1_EntryPoint(rtems_task_argument argument) ...@@ -15,7 +15,7 @@ rtems_task Task1_EntryPoint(rtems_task_argument argument)
d+=1.001; d+=1.001;
d*=1.0001; d*=1.0001;
} }
printf("Computed value by task %d was %ld\n", task_no, (long)d); printf("[TASK %d] Computed value was %ld\n", task_no, (long)d);
rtems_event_send(g_init_task_id, RTEMS_EVENT_0); rtems_event_send(g_init_task_id, RTEMS_EVENT_0);
rtems_task_delete(RTEMS_SELF); rtems_task_delete(RTEMS_SELF);
} }
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
rtems_task Task2_EntryPoint(rtems_task_argument argument) rtems_task Task2_EntryPoint(rtems_task_argument argument)
{ {
int task_no = (int) argument; int task_no = (int) argument;
printf("Inside task %d...\n", task_no); printf("[TASK %d] Starting...\n", task_no);
fflush(stdout); fflush(stdout);
int j; int j;
...@@ -15,7 +15,7 @@ rtems_task Task2_EntryPoint(rtems_task_argument argument) ...@@ -15,7 +15,7 @@ rtems_task Task2_EntryPoint(rtems_task_argument argument)
dummy ^= k; dummy ^= k;
dummy++; dummy++;
} }
printf("Computed value by task %d was %lld\n", task_no, dummy); printf("[TASK %d] Computed value was %lld\n", task_no, dummy);
rtems_event_send(g_init_task_id, RTEMS_EVENT_1); rtems_event_send(g_init_task_id, RTEMS_EVENT_1);
rtems_task_delete(RTEMS_SELF); rtems_task_delete(RTEMS_SELF);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment