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
nexedi
linux
Commits
1c2babcb
Commit
1c2babcb
authored
Feb 20, 2003
by
Paul Mackerras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PPC32: Add definition of ndelay()
parent
69f54f0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
include/asm-ppc/delay.h
include/asm-ppc/delay.h
+19
-4
No files found.
include/asm-ppc/delay.h
View file @
1c2babcb
...
...
@@ -31,21 +31,36 @@ extern void __delay(unsigned int loops);
* -- paulus
*/
#define __MAX_UDELAY (226050910/HZ)
/* maximum udelay argument */
#define __MAX_NDELAY (4294967295/HZ)
/* maximum ndelay argument */
extern
__inline__
void
__udelay
(
unsigned
int
usecs
)
extern
__inline__
void
__udelay
(
unsigned
int
x
)
{
unsigned
int
loops
;
__asm__
(
"mulhwu %0,%1,%2"
:
"=r"
(
loops
)
:
"r"
(
usecs
*
(
19
*
HZ
)),
"r"
(
loops_per_jiffy
*
226
));
"r"
(
x
),
"r"
(
loops_per_jiffy
*
226
));
__delay
(
loops
);
}
extern
__inline__
void
__ndelay
(
unsigned
int
x
)
{
unsigned
int
loops
;
__asm__
(
"mulhwu %0,%1,%2"
:
"=r"
(
loops
)
:
"r"
(
x
),
"r"
(
loops_per_jiffy
*
5
));
__delay
(
loops
);
}
extern
void
__bad_udelay
(
void
);
/* deliberately undefined */
extern
void
__bad_ndelay
(
void
);
/* deliberately undefined */
#define udelay(n) (__builtin_constant_p(n)? \
((n) > __MAX_UDELAY? __bad_udelay(): __udelay((n))) : \
__udelay(n))
((n) > __MAX_UDELAY? __bad_udelay(): __udelay((n) * (19 * HZ))) : \
__udelay((n) * (19 * HZ)))
#define ndelay(n) (__builtin_constant_p(n)? \
((n) > __MAX_NDELAY? __bad_ndelay(): __ndelay((n) * HZ)) : \
__ndelay((n) * HZ))
#endif
/* defined(_PPC_DELAY_H) */
#endif
/* __KERNEL__ */
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