diff options
| author | Miles Bader <miles@lsi.nec.co.jp> | 2002-11-26 05:21:40 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-11-26 05:21:40 -0800 |
| commit | 828bb5f408cbae3c7dae1545f3ceb0bba55cdf47 (patch) | |
| tree | 1b8e0ea10a36624cd57e682391f21c81d773df6f | |
| parent | 4c9bebabe17d8aa5c879c86566756e45cca40afe (diff) | |
[PATCH] Add `unlikely' to error-return path in v850 __syscall_return macro
Add `unlikely' to error-return path in v850 __syscall_return macro
| -rw-r--r-- | include/asm-v850/unistd.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/asm-v850/unistd.h b/include/asm-v850/unistd.h index 7cd4f3b04ca9..93939f4124d9 100644 --- a/include/asm-v850/unistd.h +++ b/include/asm-v850/unistd.h @@ -239,11 +239,18 @@ #define SYSCALL_SHORT_CLOBBERS SYSCALL_CLOBBERS, "r13", "r14" +/* User programs sometimes end up including this header file + (indirectly, via uClibc header files), so I'm a bit nervous just + including <linux/compiler.h>. */ +#if !defined(__builtin_expect) && __GNUC__ == 2 && __GNUC_MINOR__ < 96 +#define __builtin_expect(x, expected_value) (x) +#endif + #define __syscall_return(type, res) \ do { \ /* user-visible error numbers are in the range -1 - -124: \ see <asm-v850/errno.h> */ \ - if ((unsigned long)(res) >= (unsigned long)(-125)) { \ + if (__builtin_expect ((unsigned long)(res) >= (unsigned long)(-125), 0)) { \ errno = -(res); \ res = -1; \ } \ |
