Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cortex-m-rtfm-klee
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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KLEE
cortex-m-rtfm-klee
Commits
03f373fb
Commit
03f373fb
authored
Jul 24, 2017
by
Jorge Aparicio
Browse files
Options
Downloads
Patches
Plain Diff
drop idle.locals
parent
e56ab133
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
macros/src/trans.rs
+6
-43
6 additions, 43 deletions
macros/src/trans.rs
with
6 additions
and
43 deletions
macros/src/trans.rs
+
6
−
43
View file @
03f373fb
...
...
@@ -11,7 +11,6 @@ pub fn app(app: &App, ownerships: &Ownerships) -> Tokens {
let
mut
root
=
vec!
[];
let
mut
main
=
vec!
[];
// ::trans::check(app, &mut main);
::
trans
::
init
(
app
,
&
mut
main
,
&
mut
root
);
::
trans
::
idle
(
app
,
ownerships
,
&
mut
main
,
&
mut
root
);
::
trans
::
resources
(
app
,
ownerships
,
&
mut
root
);
...
...
@@ -27,12 +26,6 @@ pub fn app(app: &App, ownerships: &Ownerships) -> Tokens {
quote!
(
#
(
#
root
)
*
)
}
// Check that the exceptions / interrupts are valid
// Sadly we can't do this test at expansion time. Instead we'll generate some
// code that won't compile if the interrupt name is invalid.
// fn check(app: &App, main: &mut Vec<Tokens>) {
// }
fn
idle
(
app
:
&
App
,
ownerships
:
&
Ownerships
,
...
...
@@ -55,40 +48,6 @@ fn idle(
exprs
.push
(
quote!
(
unsafe
{
&
mut
#
krate
::
Threshold
::
new
(
0
)
}));
}
if
!
app
.idle.locals
.is_empty
()
{
let
mut
lexprs
=
vec!
[];
let
mut
lfields
=
vec!
[];
for
(
name
,
resource
)
in
&
app
.idle.locals
{
let
expr
=
&
resource
.expr
;
let
ty
=
&
resource
.ty
;
lfields
.push
(
quote!
{
pub
#
name
:
#
krate
::
Static
<
#
ty
>
,
});
lexprs
.push
(
quote!
{
#
name
:
unsafe
{
#
krate
::
Static
::
new
(
#
expr
)
},
});
}
mod_items
.push
(
quote!
{
#[allow(non_snake_case)]
pub
struct
Locals
{
#
(
#
lfields
)
*
}
});
tys
.push
(
quote!
(
&
'static
mut
idle
::
Locals
));
exprs
.push
(
quote!
(
unsafe
{
&
mut
LOCALS
}));
main
.push
(
quote!
{
static
mut
LOCALS
:
idle
::
Locals
=
idle
::
Locals
{
#
(
#
lexprs
)
*
};
});
}
if
!
app
.idle.resources
.is_empty
()
{
let
device
=
&
app
.device
;
...
...
@@ -424,7 +383,9 @@ fn resources(app: &App, ownerships: &Ownerships, root: &mut Vec<Tokens>) {
&
'cs
self
,
_cs
:
&
'cs
#
krate
::
CriticalSection
,
)
->
&
'cs
#
krate
::
Static
<
#
device
::
#
name
>
{
unsafe
{
#
krate
::
Static
::
ref_
(
&*
#
device
::
#
name
.get
())
}
unsafe
{
#
krate
::
Static
::
ref_
(
&*
#
device
::
#
name
.get
())
}
}
fn
borrow_mut
<
'cs
>
(
...
...
@@ -432,7 +393,9 @@ fn resources(app: &App, ownerships: &Ownerships, root: &mut Vec<Tokens>) {
_cs
:
&
'cs
#
krate
::
CriticalSection
,
)
->
&
'cs
mut
#
krate
::
Static
<
#
device
::
#
name
>
{
unsafe
{
#
krate
::
Static
::
ref_mut
(
&
mut
*
#
device
::
#
name
.get
())
#
krate
::
Static
::
ref_mut
(
&
mut
*
#
device
::
#
name
.get
(),
)
}
}
...
...
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