Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
Mock Turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Mock Turtle
Commits
856ea376
Commit
856ea376
authored
May 31, 2016
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*:rt: smem variables are always volatile
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
ff95de0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
rt-smem.h
applications/common/rt/rt-smem.h
+5
-5
No files found.
applications/common/rt/rt-smem.h
View file @
856ea376
...
...
@@ -28,7 +28,7 @@
* Perform an operation on a given pointer. Operation can be performed only
* on integer variables
*/
static
inline
void
__smem_atomic_op
(
int
*
p
,
int
x
,
unsigned
int
range
)
static
inline
void
__smem_atomic_op
(
volatile
int
*
p
,
int
x
,
unsigned
int
range
)
{
*
(
volatile
int
*
)(
p
+
(
range
>>
2
))
=
x
;
}
...
...
@@ -37,7 +37,7 @@ static inline void __smem_atomic_op(int *p, int x, unsigned int range)
/**
* Add x to the value in the shared memory pointed by p
*/
static
inline
void
smem_atomic_add
(
int
*
p
,
int
x
)
static
inline
void
smem_atomic_add
(
volatile
int
*
p
,
int
x
)
{
__smem_atomic_op
(
p
,
x
,
SMEM_RANGE_ADD
);
}
...
...
@@ -46,7 +46,7 @@ static inline void smem_atomic_add(int *p, int x)
/**
* Subtract x to the value in the shared memory pointed by p
*/
static
inline
void
smem_atomic_sub
(
int
*
p
,
int
x
)
static
inline
void
smem_atomic_sub
(
volatile
int
*
p
,
int
x
)
{
__smem_atomic_op
(
p
,
x
,
SMEM_RANGE_SUB
);
}
...
...
@@ -55,7 +55,7 @@ static inline void smem_atomic_sub(int *p, int x)
/**
* Do "OR" between x and the value in the shared memory pointed by p
*/
static
inline
void
smem_atomic_or
(
int
*
p
,
int
x
)
static
inline
void
smem_atomic_or
(
volatile
int
*
p
,
int
x
)
{
__smem_atomic_op
(
p
,
x
,
SMEM_RANGE_SET
);
}
...
...
@@ -64,7 +64,7 @@ static inline void smem_atomic_or(int *p, int x)
/**
* Do "AND ~" between x and the value in the shared memory pointed by p
*/
static
inline
void
smem_atomic_and_not
(
int
*
p
,
int
x
)
static
inline
void
smem_atomic_and_not
(
volatile
int
*
p
,
int
x
)
{
__smem_atomic_op
(
p
,
x
,
SMEM_RANGE_CLEAR
);
}
...
...
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