Commit ad1d4358 authored by Michal Simek's avatar Michal Simek

microblaze: delay.h fix udelay and ndelay for 8 bit args

Based on:
"asm-generic: delay.h fix udelay and ndelay for 8 bit args"
(sha1: a87e553f)
Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
parent 163e4074
...@@ -61,13 +61,29 @@ extern inline void __udelay(unsigned int x) ...@@ -61,13 +61,29 @@ extern inline void __udelay(unsigned int x)
extern void __bad_udelay(void); /* deliberately undefined */ extern void __bad_udelay(void); /* deliberately undefined */
extern void __bad_ndelay(void); /* deliberately undefined */ extern void __bad_ndelay(void); /* deliberately undefined */
#define udelay(n) (__builtin_constant_p(n) ? \ #define udelay(n) \
((n) > __MAX_UDELAY ? __bad_udelay() : __udelay((n) * (19 * HZ))) : \ ({ \
__udelay((n) * (19 * HZ))) if (__builtin_constant_p(n)) { \
if ((n) / __MAX_UDELAY >= 1) \
__bad_udelay(); \
else \
__udelay((n) * (19 * HZ)); \
} else { \
__udelay((n) * (19 * HZ)); \
} \
})
#define ndelay(n) (__builtin_constant_p(n) ? \ #define ndelay(n) \
((n) > __MAX_NDELAY ? __bad_ndelay() : __udelay((n) * HZ)) : \ ({ \
__udelay((n) * HZ)) if (__builtin_constant_p(n)) { \
if ((n) / __MAX_NDELAY >= 1) \
__bad_ndelay(); \
else \
__udelay((n) * HZ); \
} else { \
__udelay((n) * HZ); \
} \
})
#define muldiv(a, b, c) (((a)*(b))/(c)) #define muldiv(a, b, c) (((a)*(b))/(c))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment