Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ln
firmware
Commits
86354656
Commit
86354656
authored
5 years ago
by
swym
Browse files
Options
Downloads
Patches
Plain Diff
fix(epicardium): use less collision-prone names for stub-local variables
allow API signatures to contain the names "buffer" and "size"
parent
4247ee09
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
epicardium/api/genapi.py
+10
-10
10 additions, 10 deletions
epicardium/api/genapi.py
with
10 additions
and
10 deletions
epicardium/api/genapi.py
+
10
−
10
View file @
86354656
...
...
@@ -150,18 +150,18 @@ def main():
/* Autogenerated stub for {id} */
{return_type} {name}({args_str})
{{
const int size = {total_size};
void*buffer;
const int
epc__apistub_
size = {total_size};
void*
epc__apistub_
buffer;
buffer = _api_call_start({id}, size);
/* TODO: Check if buffer is not NULL */
epc__apistub_
buffer = _api_call_start({id},
epc__apistub_
size);
/* TODO: Check if
epc__apistub_
buffer is not NULL */
"""
f_client
.
write
(
tmp
.
format
(
**
decl
))
for
i
,
arg
in
enumerate
(
decl
[
"
args
"
]):
tmp
=
"""
\
*({type}*)(buffer + {offset}) = {name};
*({type}*)(
epc__apistub_
buffer + {offset}) = {name};
"""
f_client
.
write
(
tmp
.
format
(
**
arg
))
...
...
@@ -169,14 +169,14 @@ def main():
# Don't return if return type is void
tmp
=
"""
\
_api_call_transact(buffer);
_api_call_transact(
epc__apistub_
buffer);
}}
"""
f_client
.
write
(
tmp
.
format
(
**
decl
))
else
:
tmp
=
"""
\
return *({return_type}*)_api_call_transact(buffer);
return *({return_type}*)_api_call_transact(
epc__apistub_
buffer);
}}
"""
f_client
.
write
(
tmp
.
format
(
**
decl
))
...
...
@@ -249,7 +249,7 @@ void __dispatch_isr(api_int_id_t id)
#include
"
modules/log.h
"
#include
"
{header}
"
void __api_dispatch_call(uint32_t id, void*buffer)
void __api_dispatch_call(uint32_t id, void*
epc__apistub_
buffer)
{{
switch (id) {{
"""
...
...
@@ -264,13 +264,13 @@ void __api_dispatch_call(uint32_t id, void*buffer)
else
:
tmp
=
"""
\
case {id}:
*(({return_type}*)buffer) = {name}(
"""
*(({return_type}*)
epc__apistub_
buffer) = {name}(
"""
f_dispatcher
.
write
(
tmp
.
format
(
**
decl
))
for
i
,
arg
in
enumerate
(
decl
[
"
args
"
]):
arg
[
"
comma
"
]
=
""
if
i
==
0
else
"
,
"
tmp
=
"""
{comma}
*({type}*)(buffer + {offset})
"""
*({type}*)(
epc__apistub_
buffer + {offset})
"""
f_dispatcher
.
write
(
tmp
.
format
(
**
arg
))
tmp
=
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment