Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
63e2c803
Commit
63e2c803
authored
Nov 11, 2007
by
Paul Mundt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sh: Plug in
SH-5
ffz()/__ffs() bitops.
Signed-off-by:
Paul Mundt
<
lethal@linux-sh.org
>
parent
079060c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
include/asm-sh/bitops.h
include/asm-sh/bitops.h
+26
-0
No files found.
include/asm-sh/bitops.h
View file @
63e2c803
...
...
@@ -105,6 +105,7 @@ static inline int test_and_change_bit(int nr, volatile void * addr)
#include <asm-generic/bitops/non-atomic.h>
#ifdef CONFIG_SUPERH32
static
inline
unsigned
long
ffz
(
unsigned
long
word
)
{
unsigned
long
result
;
...
...
@@ -138,6 +139,31 @@ static inline unsigned long __ffs(unsigned long word)
:
"t"
);
return
result
;
}
#else
static
inline
unsigned
long
ffz
(
unsigned
long
word
)
{
unsigned
long
result
,
__d2
,
__d3
;
__asm__
(
"gettr tr0, %2
\n\t
"
"pta $+32, tr0
\n\t
"
"andi %1, 1, %3
\n\t
"
"beq %3, r63, tr0
\n\t
"
"pta $+4, tr0
\n
"
"0:
\n\t
"
"shlri.l %1, 1, %1
\n\t
"
"addi %0, 1, %0
\n\t
"
"andi %1, 1, %3
\n\t
"
"beqi %3, 1, tr0
\n
"
"1:
\n\t
"
"ptabs %2, tr0
\n\t
"
:
"=r"
(
result
),
"=r"
(
word
),
"=r"
(
__d2
),
"=r"
(
__d3
)
:
"0"
(
0L
),
"1"
(
word
));
return
result
;
}
#include <asm-generic/bitops/__ffs.h>
#endif
#include <asm-generic/bitops/find.h>
#include <asm-generic/bitops/ffs.h>
...
...
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