Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RTEMS-build-workflows
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thanassis Tsiodras
RTEMS-build-workflows
Commits
27681fff
Commit
27681fff
authored
Apr 21, 2016
by
Thanassis Tsiodras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added termination synchronization via events (preparation for coverage logic)
parent
96872f2b
Pipeline
#103
skipped
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
4 deletions
+32
-4
OAR/src/init.c
OAR/src/init.c
+22
-4
OAR/src/system.h
OAR/src/system.h
+8
-0
OAR/src/task1.c
OAR/src/task1.c
+1
-0
OAR/src/task2.c
OAR/src/task2.c
+1
-0
No files found.
OAR/src/init.c
View file @
27681fff
...
...
@@ -5,7 +5,9 @@
#define CONFIGURE_INIT
#define TASKS 2
#define DEFINE_VARS
#include "system.h"
#include <stdio.h>
rtems_task
Init
(
rtems_task_argument
argument
)
...
...
@@ -15,6 +17,7 @@ rtems_task Init(rtems_task_argument argument)
rtems_id
Task_id
[
TASKS
];
/* task ids */
int
i
;
g_init_task_id
=
rtems_task_self
();
for
(
i
=
0
;
i
<
TASKS
;
i
++
)
{
// Initialize Task name
...
...
@@ -40,8 +43,23 @@ rtems_task Init(rtems_task_argument argument)
i
==
0
?
Task1_EntryPoint
:
Task2_EntryPoint
,
i
);
}
printf
(
"Parent task sleeps for a second...
\n
"
);
rtems_task_wake_after
(
100
);
printf
(
"Parent task bids adieu...
\n
"
);
rtems_task_delete
(
RTEMS_SELF
);
// To give coverage code room to breathe!
printf
(
"Parent task waits for his children to complete...
\n
"
);
{
rtems_option
options
=
(
RTEMS_EVENT_ANY
|
RTEMS_WAIT
);
rtems_event_set
in
=
(
RTEMS_EVENT_0
|
RTEMS_EVENT_1
);
rtems_event_set
out
;
rtems_event_set
completed
=
0
;
while
((
completed
&
in
)
!=
(
RTEMS_EVENT_0
|
RTEMS_EVENT_1
))
{
status
=
rtems_event_receive
(
in
,
options
,
RTEMS_NO_TIMEOUT
,
&
out
);
if
(
status
==
RTEMS_SUCCESSFUL
)
{
completed
|=
out
;
printf
(
"Task completed!
\n
"
);
fflush
(
stdout
);
}
}
printf
(
"All tasks completed!
\n
"
);
fflush
(
stdout
);
}
exit
(
0
);
}
OAR/src/system.h
View file @
27681fff
#include <rtems/score/types.h>
#include <rtems/rtems/types.h>
#include <rtems/rtems/tasks.h>
#include <rtems/rtems/event.h>
rtems_task
Init
(
rtems_task_argument
argument
);
rtems_task
Task1_EntryPoint
(
rtems_task_argument
argument
);
...
...
@@ -13,5 +14,12 @@ rtems_task Task2_EntryPoint(rtems_task_argument argument);
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_SMP_APPLICATION
#define CONFIGURE_SMP_MAXIMUM_PROCESSORS 2
#ifndef DEFINE_VARS
#define GLOBAL
#else
#define GLOBAL extern
#endif
GLOBAL
rtems_id
g_init_task_id
;
#include <rtems/confdefs.h>
OAR/src/task1.c
View file @
27681fff
...
...
@@ -16,5 +16,6 @@ rtems_task Task1_EntryPoint(rtems_task_argument argument)
d
*=
1
.
0001
;
}
printf
(
"Computed value by task %d was %ld
\n
"
,
task_no
,
(
long
)
d
);
rtems_event_send
(
g_init_task_id
,
RTEMS_EVENT_0
);
rtems_task_delete
(
RTEMS_SELF
);
}
OAR/src/task2.c
View file @
27681fff
...
...
@@ -16,5 +16,6 @@ rtems_task Task2_EntryPoint(rtems_task_argument argument)
dummy
++
;
}
printf
(
"Computed value by task %d was %lld
\n
"
,
task_no
,
dummy
);
rtems_event_send
(
g_init_task_id
,
RTEMS_EVENT_1
);
rtems_task_delete
(
RTEMS_SELF
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment