Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3c5892ee
authored
Feb 02, 2015
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
base_c: fixed fetch and add to support armv7-a
parent
5c236c46
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
base_c/include/embb/base/c/internal/atomic/fetch_and_add.h
+6
-6
No files found.
base_c/include/embb/base/c/internal/atomic/fetch_and_add.h
View file @
3c5892ee
...
...
@@ -92,17 +92,17 @@ EMBB_DEFINE_FETCH_AND_ADD(8, "q")
EMBB_CAT2(EMBB_BASE_BASIC_TYPE_SIZE_, EMBB_PARAMETER_SIZE_BYTE) \
new_value) { \
EMBB_CAT2(EMBB_BASE_BASIC_TYPE_SIZE_, EMBB_PARAMETER_SIZE_BYTE) \
tmp, result; \
tmp
1, tmp2
, result; \
__asm__ __volatile__ ( \
"dmb\n\t" \
"loop_%=:\n\t" \
"ldrex" EMBB_ATOMIC_ARM_SIZE_SUFFIX " %0, [%
2
]\n\t" \
"add %1, %0, %
3
\n\t" \
"strex" EMBB_ATOMIC_ARM_SIZE_SUFFIX " %
1, %1, [%2
]\n\t" \
"teq %
1
, #0\n\t" \
"ldrex" EMBB_ATOMIC_ARM_SIZE_SUFFIX " %0, [%
3
]\n\t" \
"add %1, %0, %
4
\n\t" \
"strex" EMBB_ATOMIC_ARM_SIZE_SUFFIX " %
2, %1, [%3
]\n\t" \
"teq %
2
, #0\n\t" \
"bne loop_%=\n\t" \
"isb" \
: "=&r" (result), "=&r" (tmp) \
: "=&r" (result), "=&r" (tmp
1), "=&r" (tmp2
) \
: "r" (pointer_to_value), "r" (new_value) \
: "memory", "cc" ); \
return result; \
...
...
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