Module Name:    src
Committed By:   riastradh
Date:           Wed Aug  6 14:05:08 UTC 2014

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

Log Message:
Add rounddown_pow_of_two.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/include/linux/log2.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/log2.h
diff -u src/sys/external/bsd/drm2/include/linux/log2.h:1.4 src/sys/external/bsd/drm2/include/linux/log2.h:1.5
--- src/sys/external/bsd/drm2/include/linux/log2.h:1.4	Wed Jul 16 20:59:58 2014
+++ src/sys/external/bsd/drm2/include/linux/log2.h	Wed Aug  6 14:05:08 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: log2.h,v 1.4 2014/07/16 20:59:58 riastradh Exp $	*/
+/*	$NetBSD: log2.h,v 1.5 2014/08/06 14:05:08 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -58,6 +58,14 @@ roundup_pow_of_two(unsigned long n)
 	return (n + 1);
 }
 
+static inline unsigned long
+rounddown_pow_of_two(unsigned long n)
+{
+
+	/* XXX fls64 is not fls_ulong, but it'll do for now.  */
+	return (1UL << (fls64(n) - 1));
+}
+
 static inline unsigned
 order_base_2(unsigned long n)
 {

Reply via email to