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
e755679d
Commit
e755679d
authored
Feb 18, 2004
by
Tom Rini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PPC32: Make sure the read in in_8, in_{le,be}{16,32} happens before we return.
A forward port of changes from Paul Mackerras.
parent
4af996e9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
include/asm-ppc/io.h
include/asm-ppc/io.h
+20
-5
No files found.
include/asm-ppc/io.h
View file @
e755679d
...
...
@@ -280,12 +280,19 @@ extern inline void eieio(void)
/*
* 8, 16 and 32 bit, big and little endian I/O operations, with barrier.
*
* Read operations have additional twi & isync to make sure the read
* is actually performed (i.e. the data has come back) before we start
* executing any following instructions.
*/
extern
inline
int
in_8
(
volatile
unsigned
char
*
addr
)
{
int
ret
;
__asm__
__volatile__
(
"lbz%U1%X1 %0,%1; eieio"
:
"=r"
(
ret
)
:
"m"
(
*
addr
));
__asm__
__volatile__
(
"lbz%U1%X1 %0,%1;
\n
"
"twi 0,%0,0;
\n
"
"isync"
:
"=r"
(
ret
)
:
"m"
(
*
addr
));
return
ret
;
}
...
...
@@ -298,7 +305,9 @@ extern inline int in_le16(volatile unsigned short *addr)
{
int
ret
;
__asm__
__volatile__
(
"lhbrx %0,0,%1; eieio"
:
"=r"
(
ret
)
:
__asm__
__volatile__
(
"lhbrx %0,0,%1;
\n
"
"twi 0,%0,0;
\n
"
"isync"
:
"=r"
(
ret
)
:
"r"
(
addr
),
"m"
(
*
addr
));
return
ret
;
}
...
...
@@ -307,7 +316,9 @@ extern inline int in_be16(volatile unsigned short *addr)
{
int
ret
;
__asm__
__volatile__
(
"lhz%U1%X1 %0,%1; eieio"
:
"=r"
(
ret
)
:
"m"
(
*
addr
));
__asm__
__volatile__
(
"lhz%U1%X1 %0,%1;
\n
"
"twi 0,%0,0;
\n
"
"isync"
:
"=r"
(
ret
)
:
"m"
(
*
addr
));
return
ret
;
}
...
...
@@ -326,7 +337,9 @@ extern inline unsigned in_le32(volatile unsigned *addr)
{
unsigned
ret
;
__asm__
__volatile__
(
"lwbrx %0,0,%1; eieio"
:
"=r"
(
ret
)
:
__asm__
__volatile__
(
"lwbrx %0,0,%1;
\n
"
"twi 0,%0,0;
\n
"
"isync"
:
"=r"
(
ret
)
:
"r"
(
addr
),
"m"
(
*
addr
));
return
ret
;
}
...
...
@@ -335,7 +348,9 @@ extern inline unsigned in_be32(volatile unsigned *addr)
{
unsigned
ret
;
__asm__
__volatile__
(
"lwz%U1%X1 %0,%1; eieio"
:
"=r"
(
ret
)
:
"m"
(
*
addr
));
__asm__
__volatile__
(
"lwz%U1%X1 %0,%1;
\n
"
"twi 0,%0,0;
\n
"
"isync"
:
"=r"
(
ret
)
:
"m"
(
*
addr
));
return
ret
;
}
...
...
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