1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-28 08:02:54 +00:00
freebsd/sys/compat
Doug Moore c8b0c33b03 log2: move log2 functions from linuxkpi to libkern
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
2024-06-24 02:00:31 -05:00
..
freebsd32 Regen 2024-05-21 22:03:20 +02:00
ia32 freebsd32: struct siginfo32 -> struct __siginfo32 2024-03-19 23:13:26 +00:00
lindebugfs uio: Use switch statements when handling UIO_READ vs UIO_WRITE 2024-05-10 13:43:36 -07:00
linprocfs linprocfs: Add support for proc/sys/fs/mqueue/* 2024-05-23 13:40:45 -06:00
linsysfs linsysfs(5): Remove sys/cdefs.h inclusion where it's not needed due to 685dc743 2023-08-18 13:12:02 +03:00
linux linux: Translate Linux NVME ioctls to the lower layers. 2024-06-14 16:40:20 -06:00
linuxkpi log2: move log2 functions from linuxkpi to libkern 2024-06-24 02:00:31 -05:00
x86bios sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00