Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
buildsupport
Commits
ea61a49e
Commit
ea61a49e
authored
Jun 22, 2016
by
Maxime Perrotin
Browse files
Fix C wrappers to handle filtered PIs
parent
03a7f660
Pipeline
#368
skipped
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
c/c_wrappers_backend.c
View file @
ea61a49e
...
...
@@ -486,13 +486,27 @@ void add_RI_to_c_wrappers(Interface * i)
"
\t
/* This function is passive, thus not have direct access to the VM
\n
"
);
fprintf
(
b
,
"
\t
It must use its calling thread to invoke this asynchronous RI */
\n\n
"
);
FOREACH
(
t
,
FV
,
i
->
parent_fv
->
calling_threads
,
{
(
void
)
t
;
count
++
;});
/* Build the list of calling threads for this RI */
FV_list
*
calltmp
=
NULL
;
if
(
NULL
==
i
->
calling_pis
)
calltmp
=
i
->
parent_fv
->
calling_threads
;
else
{
FOREACH
(
calling_pi
,
Interface
,
i
->
calling_pis
,
{
FOREACH
(
thread_caller
,
FV
,
calling_pi
->
calling_threads
,
{
ADD_TO_SET
(
FV
,
calltmp
,
thread_caller
);
});
});
}
/* Count the number of calling threads */
FOREACH
(
ct
,
FV
,
calltmp
,
{
(
void
)
ct
;
count
++
;
});
/* If there is only one possible caller, no need for stack */
if
(
1
==
count
)
{
fprintf
(
b
,
"
\t
vm_async_%s_%s_vt("
,
i
->
parent_fv
->
calling_threads
->
value
->
name
,
calltmp
->
value
->
name
,
i
->
name
);
/* If any, add the IN parameter (async RI) */
...
...
@@ -502,15 +516,21 @@ void add_RI_to_c_wrappers(Interface * i)
}
fprintf
(
b
,
");
\n
"
);
}
else
if
(
count
>
1
)
{
/* Several possible callers: switch-case based on the stack top value */
}
else
if
(
count
>
1
)
{
/* Several possible callers: switch-case based on the stack top value */
fprintf
(
b
,
"
\t
switch(%s_callinglist_get_top_value()) {
\n
"
,
i
->
parent_fv
->
name
);
FOREACH
(
t
,
FV
,
i
->
parent_fv
->
calling_threads
,
{
fprintf
(
b
,
"
\t\t
case %d: vm_async_%s_%s_vt("
,
t
->
thread_id
,
t
->
name
,
i
->
name
);
if
(
NULL
!=
i
->
in
)
{
/* Add the unique IN parameter (async RI) */
fprintf
(
b
,
"%s, %s_len"
,
i
->
in
->
value
->
name
,
i
->
in
->
value
->
name
);}
fprintf
(
b
,
"); break;
\n
"
);}
);
FOREACH
(
caller
,
FV
,
calltmp
,
{
fprintf
(
b
,
"
\t\t
case %d: vm_async_%s_%s_vt("
,
caller
->
thread_id
,
caller
->
name
,
i
->
name
);
if
(
NULL
!=
i
->
in
)
{
/* Add the unique IN parameter (async RI) */
fprintf
(
b
,
"%s, %s_len"
,
i
->
in
->
value
->
name
,
i
->
in
->
value
->
name
);
}
fprintf
(
b
,
"); break;
\n
"
);
});
fprintf
(
b
,
"
\t\t
default: break;
\n
"
);
fprintf
(
b
,
"
\t
}
\n
"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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