mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-28 08:02:54 +00:00
c8b0c33b03
Linux has a header file that defines an ilog2 function and some simple functions/macros that use it: roundup_pow_of_two, is_power_of_2, rounddown_pow_of_two, and order_base_2. This change moves three of those simple functions (all but is_power_of_2) from linuxkpi to libkern. It also deletes a few implementations of these functions that have previously been copied into code for various device drivers, so that they can use the libkern version. The is_power_of_2 macro was not moved because powerof2 in param.h provides almost the same service already (except that they disagree about whether 0 is a power of two). Since the linux definitions of these functions were copied into FreeBSD 11 years ago, linux has improved them, and this change provides those improvements. In particular, a giant table of log values for evaluating ilog2 for constant values is no longer necessary. Reviewed by: alc, markj (previous version) Differential Revision: https://reviews.freebsd.org/D45536 |
||
---|---|---|
.. | ||
freebsd32 | ||
ia32 | ||
lindebugfs | ||
linprocfs | ||
linsysfs | ||
linux | ||
linuxkpi | ||
x86bios |