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
35d684a3
Commit
35d684a3
authored
Apr 26, 2018
by
Federico Vaga
Committed by
Federico Vaga
Apr 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:*: move shared memory modifier to common header
Signed-off-by:
Federico Vaga
<
federico.vaga@vaga.pv.it
>
parent
8b9e49e2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
21 deletions
+9
-21
mockturtle.h
software/include/mockturtle.h
+7
-7
mockturtle-core.c
software/kernel/mockturtle-core.c
+1
-1
mockturtle-rt-smem.h
software/rt/lib/mockturtle-rt-smem.h
+0
-12
mockturtle-smem.c
software/tools/mockturtle-smem.c
+1
-1
No files found.
software/include/mockturtle.h
View file @
35d684a3
...
...
@@ -158,13 +158,13 @@ struct trtl_tlv {
* that you can use to access the shared memory.
*/
enum
trtl_smem_modifier
{
TRTL_SMEM_
DIRECT
=
0
,
/**< direct read/write of the memory
*/
TRTL_SMEM_
ADD
,
/**< on write, atomic ADD to memory content
*/
TRTL_SMEM_
SUB
,
/**< on write, atomic SUB to memory content
*/
TRTL_SMEM_
OR
,
/**< on write, atomic OR with memory conten
t */
TRTL_SMEM_
CLR_AND
,
/**< on write, atomic AND with complemented memory
content
*/
TRTL_SMEM_
XOR
,
/**< on write, atomic XOR with memory conten
t */
TRTL_SMEM_
TYPE_BASE
=
0
,
/**< no operation
*/
TRTL_SMEM_
TYPE_ADD
,
/**< atomic addition
*/
TRTL_SMEM_
TYPE_SUB
,
/**< atomic subtraction
*/
TRTL_SMEM_
TYPE_SET
,
/**< atomic bit se
t */
TRTL_SMEM_
TYPE_CLR
,
/**< atomic bit clear */
TRTL_SMEM_TYPE_FLP
,
/**< atomic bit flip
*/
TRTL_SMEM_
TYPE_TST_SET
,
/**< atomic test and se
t */
};
...
...
software/kernel/mockturtle-core.c
View file @
35d684a3
...
...
@@ -197,7 +197,7 @@ static ssize_t trtl_store_smem_op(struct device *dev,
if
(
kstrtol
(
buf
,
0
,
&
val
))
return
-
EINVAL
;
if
(
val
<
TRTL_SMEM_
DIRECT
||
val
>
TRTL_SMEM
_ADD
)
{
if
(
val
<
TRTL_SMEM_
TYPE_BASE
||
val
>
TRTL_SMEM_TYPE
_ADD
)
{
dev_err
(
&
trtl
->
dev
,
"Unsupported operation %ld
\n
"
,
val
);
return
-
EINVAL
;
}
...
...
software/rt/lib/mockturtle-rt-smem.h
View file @
35d684a3
...
...
@@ -13,18 +13,6 @@
#ifndef __TRTL_RT_SMEM_H
#define __TRTL_RT_SMEM_H
/**
* List of supported Shared Memory access type
*/
enum
trtl_smem_type
{
TRTL_SMEM_TYPE_BASE
=
0
,
/**< no operation */
TRTL_SMEM_TYPE_ADD
,
/**< atomic addition */
TRTL_SMEM_TYPE_SUB
,
/**< atomic subtraction */
TRTL_SMEM_TYPE_SET
,
/**< atomic bit set */
TRTL_SMEM_TYPE_CLR
,
/**< atomic bit clear */
TRTL_SMEM_TYPE_FLP
,
/**< atomic bit flip */
TRTL_SMEM_TYPE_TST_SET
,
/**< atomic test and set */
};
/**
* Shared Memory Size
...
...
software/tools/mockturtle-smem.c
View file @
35d684a3
...
...
@@ -79,7 +79,7 @@ int main(int argc, char *argv[])
break
;
case
'm'
:
sscanf
(
optarg
,
"%d"
,
&
mod
);
if
(
mod
>
TRTL_SMEM_ADD
)
{
if
(
mod
>
TRTL_SMEM_
TYPE_
ADD
)
{
fprintf
(
stderr
,
"Invalid operation mode
\n
"
);
help
();
exit
(
1
);
...
...
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