Module Name:    src
Committed By:   riastradh
Date:           Wed Feb 25 15:40:20 UTC 2015

Modified Files:
        src/sys/external/bsd/drm2/include/linux: bitops.h

Log Message:
Add hweight8 (hamming weight of 8-bit quantity).


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/drm2/include/linux/bitops.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/linux/bitops.h
diff -u src/sys/external/bsd/drm2/include/linux/bitops.h:1.8 src/sys/external/bsd/drm2/include/linux/bitops.h:1.9
--- src/sys/external/bsd/drm2/include/linux/bitops.h:1.8	Sat Aug 23 08:03:33 2014
+++ src/sys/external/bsd/drm2/include/linux/bitops.h	Wed Feb 25 15:40:20 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bitops.h,v 1.8 2014/08/23 08:03:33 riastradh Exp $	*/
+/*	$NetBSD: bitops.h,v 1.9 2015/02/25 15:40:20 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -167,4 +167,11 @@ find_first_zero_bit(const unsigned long 
 	return result;
 }
 
+static inline unsigned
+hweight8(unsigned w)
+{
+
+	return popcount(w & 0xff);
+}
+
 #endif  /* _LINUX_BITOPS_H_ */

Reply via email to