diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-10-30 14:14:46 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-11-02 09:11:22 +0100 |
commit | 524990c2ab2965879fe1c966db8021119ab9ff0b (patch) | |
tree | 421f28383247fa3d0cdfc536a5ec6e7f7ef636e3 | |
parent | testsuite: Add bdbuf configuration (diff) | |
download | rtems-libbsd-524990c2ab2965879fe1c966db8021119ab9ff0b.tar.bz2 |
Provide ffs() and ffsl() via builtins
-rw-r--r-- | freebsd/sys/sys/libkern.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/freebsd/sys/sys/libkern.h b/freebsd/sys/sys/libkern.h index acdedda6..dcdd8023 100644 --- a/freebsd/sys/sys/libkern.h +++ b/freebsd/sys/sys/libkern.h @@ -88,12 +88,17 @@ void arc4rand(void *ptr, u_int len, int reseed); int bcmp(const void *, const void *, size_t); void *bsearch(const void *, const void *, size_t, size_t, int (*)(const void *, const void *)); +#ifndef __rtems__ #ifndef HAVE_INLINE_FFS int ffs(int); #endif #ifndef HAVE_INLINE_FFSL int ffsl(long); #endif +#else /* __rtems__ */ +#define ffs(_x) __builtin_ffs((unsigned int)(_x)) +#define ffsl(_x) __builtin_ffsl((unsigned long)(_x)) +#endif /* __rtems__ */ #ifndef HAVE_INLINE_FLS int fls(int); #endif |