opnsense-src/sys/compat/linuxkpi/common/include
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
..
acpi LinuxKPI: Add acpi_dev_present() function. 2023-12-24 11:20:00 +03:00
asm linuxkpi: Fix set_memory_* 2024-05-03 15:27:29 +02:00
asm-generic linuxkpi: Add io.h 2022-08-08 15:22:35 +02:00
crypto LinuxKPI: add dummy hash.h and kernel_connect() 2023-05-12 11:21:10 +00:00
linux log2: move log2 functions from linuxkpi to libkern 2024-06-24 02:00:31 -05:00
net LinuxKPI: 802.11: fix for_each_sta_active_link() 2024-05-21 22:12:00 +00:00
video LinuxKPI: Add video/vga.h header 2023-12-24 11:19:58 +03:00
xen LinuxKPI: Add xen/xen.h header 2023-12-24 11:19:58 +03:00
stdarg.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00