Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-07-07 08:07:19 +0300
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-07-10 08:18:10 +0300
commit1d49ce4d6b4649a3f89396de67e9c73fc88162f4 (patch)
treefb95149dd824614b7d4031c32497c98b042e2031 /newlib/libc/sys/rtems
parentbf61b38d984539d63dce809923e4edb7865bf721 (diff)
Synchronize RTEMS <sys/bitset.h> with FreeBSD
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Diffstat (limited to 'newlib/libc/sys/rtems')
-rw-r--r--newlib/libc/sys/rtems/include/sys/bitset.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/newlib/libc/sys/rtems/include/sys/bitset.h b/newlib/libc/sys/rtems/include/sys/bitset.h
index ec75223e9..4c58f1fb7 100644
--- a/newlib/libc/sys/rtems/include/sys/bitset.h
+++ b/newlib/libc/sys/rtems/include/sys/bitset.h
@@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: head/sys/sys/bitset.h 318781 2017-05-24 10:09:54Z kib $
+ * $FreeBSD: head/sys/sys/bitset.h 320755 2017-07-06 21:47:17Z kib $
*/
#ifndef _SYS_BITSET_H_
@@ -216,6 +216,21 @@
__bit; \
})
+#define BIT_FLS(_s, p) __extension__ ({ \
+ __size_t __i; \
+ int __bit; \
+ \
+ __bit = 0; \
+ for (__i = __bitset_words((_s)) - 1; __i >= 0; __i--) { \
+ if ((p)->__bits[__i] != 0) { \
+ __bit = flsl((p)->__bits[__i]); \
+ __bit += __i * _BITSET_BITS; \
+ break; \
+ } \
+ } \
+ __bit; \
+})
+
#define BIT_COUNT(_s, p) __extension__ ({ \
__size_t __i; \
int __count; \