Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
buildsupport
Commits
7fe28607
Commit
7fe28607
authored
Jul 21, 2017
by
Maxime Perrotin
Browse files
Remove atomic subs (PIs are protected, no need)
parent
d1713b94
Changes
1
Hide whitespace changes
Inline
Side-by-side
c/preprocessing_backend.c
View file @
7fe28607
...
...
@@ -153,8 +153,11 @@ FV *Add_timer_manager(Process *node, FV_list *fv_with_timer)
timer_res
);
FOREACH
(
timer
,
String
,
all_timers
,
{
// sync_fetch_and_sub (atomic sub) is (1) not supported on all
// platforms (e.g. RTEMS) and (2) unnecessary since the PI is protected
fprintf
(
code
,
" if (timers[%s].state == active && "
"1 == __sync_fetch_and_sub(&timers[%s].value, 1)) {
\n
"
"0 == --timers[%s].value) {
\n
"
//"1 == __sync_fetch_and_sub(&timers[%s].value, 1)) {\n"
" %s_RI_%s();
\n
"
" timers[%s].state = inactive;
\n
"
" }
\n\n
"
,
...
...
@@ -201,7 +204,8 @@ void Add_timers_to_function (FV *fv, FV *timer_manager)
" /* Timer value must be multiple of %d ms */
\n
"
" assert (*val %% %d == 0);
\n
"
" timers[%s_%s].state = active;
\n
"
" __sync_lock_test_and_set(&timers[%s_%s].value, *val / %d);
\n
"
" timers[%s_%s].value = *val / %d;
\n
"
//" __sync_lock_test_and_set(&timers[%s_%s].value, *val / %d);\n"
"}
\n\n
"
,
timer_manager
->
name
,
fv
->
name
,
...
...
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