Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
7a65eaf4
Commit
7a65eaf4
authored
Nov 09, 2007
by
Paul Mundt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sh: SH-5 byteorder routines.
Signed-off-by:
Paul Mundt
<
lethal@linux-sh.org
>
parent
4690bdc7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
15 deletions
+30
-15
include/asm-sh/byteorder.h
include/asm-sh/byteorder.h
+30
-15
No files found.
include/asm-sh/byteorder.h
View file @
7a65eaf4
...
@@ -3,26 +3,41 @@
...
@@ -3,26 +3,41 @@
/*
/*
* Copyright (C) 1999 Niibe Yutaka
* Copyright (C) 1999 Niibe Yutaka
* Copyright (C) 2000, 2001 Paolo Alberelli
*/
*/
#include <asm/types.h>
#include <linux/compiler.h>
#include <linux/compiler.h>
#include <linux/types.h>
static
__inline__
__attribute_const__
__u32
___arch__swab32
(
__u32
x
)
static
inline
__attribute_const__
__u32
___arch__swab32
(
__u32
x
)
{
{
__asm__
(
"swap.b %0, %0
\n\t
"
__asm__
(
#ifdef CONFIG_SUPERH32
"swap.b %0, %0
\n\t
"
"swap.w %0, %0
\n\t
"
"swap.w %0, %0
\n\t
"
"swap.b %0, %0"
"swap.b %0, %0"
#else
"byterev %0, %0
\n\t
"
"shari %0, 32, %0"
#endif
:
"=r"
(
x
)
:
"=r"
(
x
)
:
"0"
(
x
));
:
"0"
(
x
));
return
x
;
return
x
;
}
}
static
__inline__
__attribute_const__
__u16
___arch__swab16
(
__u16
x
)
static
inline
__attribute_const__
__u16
___arch__swab16
(
__u16
x
)
{
{
__asm__
(
"swap.b %0, %0"
__asm__
(
#ifdef CONFIG_SUPERH32
"swap.b %0, %0"
#else
"byterev %0, %0
\n\t
"
"shari %0, 32, %0"
#endif
:
"=r"
(
x
)
:
"=r"
(
x
)
:
"0"
(
x
));
:
"0"
(
x
));
return
x
;
return
x
;
}
}
...
...
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