| #
c8b0c33b
|
| 24-Jun-2024 |
Doug Moore <dougm@FreeBSD.org> |
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_p
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
show more ...
|
| #
b0056b31
|
| 03-Jun-2024 |
Doug Moore <dougm@FreeBSD.org> |
libkern: add ilog2 macro
The kernel source contains several definitions of an ilog2 function; some are slower than necessary, and one of them is incorrect. Elimininate them all and define an ilog2 m
libkern: add ilog2 macro
The kernel source contains several definitions of an ilog2 function; some are slower than necessary, and one of them is incorrect. Elimininate them all and define an ilog2 macro in libkern to replace them, in a way that is fast, correct for all argument types, and, in a GENERIC kernel, includes a check for an invalid zero parameter.
Folks at Microsoft have verified that having a correct ilog2 definition for their MANA driver doesn't break it.
Reviewed by: alc, markj, mhorne (older version), jhibbits (older version) Differential Revision: https://reviews.freebsd.org/D45170 Differential Revision: https://reviews.freebsd.org/D45235
show more ...
|
| #
95ee2897
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
| #
307f78f3
|
| 19-Dec-2021 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
LinuxKPI: Constantly use _LINUXKPI_ prefix in include guards
MFC after: 1 week Reviewed by: bz, emaste, hselasky, manu Differential Revision: https://reviews.freebsd.org/D33562
|
| #
c8b0c33b
|
| 24-Jun-2024 |
Doug Moore <dougm@FreeBSD.org> |
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_p
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
show more ...
|
| #
b0056b31
|
| 03-Jun-2024 |
Doug Moore <dougm@FreeBSD.org> |
libkern: add ilog2 macro
The kernel source contains several definitions of an ilog2 function; some are slower than necessary, and one of them is incorrect. Elimininate them all and define an ilog2 m
libkern: add ilog2 macro
The kernel source contains several definitions of an ilog2 function; some are slower than necessary, and one of them is incorrect. Elimininate them all and define an ilog2 macro in libkern to replace them, in a way that is fast, correct for all argument types, and, in a GENERIC kernel, includes a check for an invalid zero parameter.
Folks at Microsoft have verified that having a correct ilog2 definition for their MANA driver doesn't break it.
Reviewed by: alc, markj, mhorne (older version), jhibbits (older version) Differential Revision: https://reviews.freebsd.org/D45170 Differential Revision: https://reviews.freebsd.org/D45235
show more ...
|
| #
95ee2897
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
| #
307f78f3
|
| 19-Dec-2021 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
LinuxKPI: Constantly use _LINUXKPI_ prefix in include guards
MFC after: 1 week Reviewed by: bz, emaste, hselasky, manu Differential Revision: https://reviews.freebsd.org/D33562
|
| #
83630517
|
| 23-Mar-2018 |
Ed Maste <emaste@FreeBSD.org> |
linuxkpi whitespace cleanup
Reviewed by: hselasky, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14807
|
| #
8d59ecb2
|
| 29-Oct-2015 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Finish process of moving the LinuxKPI module into the default kernel build.
- Move all files related to the LinuxKPI into sys/compat/linuxkpi and its subfolders. - Update sys/conf/files and some M
Finish process of moving the LinuxKPI module into the default kernel build.
- Move all files related to the LinuxKPI into sys/compat/linuxkpi and its subfolders. - Update sys/conf/files and some Makefiles to use new file locations. - Added description of COMPAT_LINUXKPI to sys/conf/NOTES which in turn adds the LinuxKPI to all LINT builds. - The LinuxKPI can be added to the kernel by setting the COMPAT_LINUXKPI option. The OFED kernel option no longer builds the LinuxKPI into the kernel. This was done to keep the build rules for the LinuxKPI in sys/conf/files simple. - Extend the LinuxKPI module to include support for USB by moving the Linux USB compat from usb.ko to linuxkpi.ko. - Bump the FreeBSD_version. - A universe kernel build has been done.
Reviewed by: np @ (cxgb and cxgbe related changes only) Sponsored by: Mellanox Technologies
show more ...
|
| #
03ae3808
|
| 21-Oct-2015 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Remove all comments deriving from Linux. Minor rework of ilog2() function.
Suggested by: emaste @ Sponsored by: Mellanox Technologies
|
| #
382d6beb
|
| 20-Oct-2015 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Move location of RCS keyword according to style.
Suggested by: jhb @ Sponsored by: Mellanox Technologies
|
| #
77320fe8
|
| 20-Oct-2015 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Add missing FreeBSD RCS keyword and SVN properties.
Sponsored by: Mellanox Technologies
|
| #
74db12ca
|
| 23-Feb-2015 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Macro fixes: - Add missing "order_base_2()" macro. - Fix BUILD_BUG_ON() macro.
MFC after: 1 month Sponsored by: Mellanox Technologies
|
| #
c7818b48
|
| 27-Aug-2014 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
- Update the OFED Linux Emulation layer as a preparation for a hardware driver update from Mellanox Technologies. - Remove empty files from the OFED Linux Emulation layer. - Fix compile warnings rela
- Update the OFED Linux Emulation layer as a preparation for a hardware driver update from Mellanox Technologies. - Remove empty files from the OFED Linux Emulation layer. - Fix compile warnings related to printf() and the "%lld" and "%llx" format specifiers. - Add some missing 2-clause BSD copyrights. - Add "Mellanox Technologies, Ltd." to list of copyright holders. - Add some new compatibility files. - Fix order of uninit in the mlx4ib module to avoid crash at unload using the new module_exit_order() function.
MFC after: 1 week Sponsored by: Mellanox Technologies
show more ...
|
| #
c9f432b7
|
| 29-Sep-2013 |
Alfred Perlstein <alfred@FreeBSD.org> |
Update OFED to Linux 3.7 and update Mellanox drivers.
Update the OFED Infiniband core to the version supplied in Linux version 3.7.
The update to OFED is nearly all additional defines and functions
Update OFED to Linux 3.7 and update Mellanox drivers.
Update the OFED Infiniband core to the version supplied in Linux version 3.7.
The update to OFED is nearly all additional defines and functions with the exception of the addition of additional parameters to ib_register_device() and the reg_user_mr callback.
In addition the ibcore (Infiniband core) and ipoib (IP over Infiniband) have both been made into completely loadable modules to facilitate testing of the OFED stack in FreeBSD.
Finally the Mellanox Infiniband drivers are now updated to the latest version shipping with Linux 3.7.
Submitted by: Mellanox FreeBSD driver team: Oded Shanoon (odeds mellanox.com), Meny Yossefi (menyy mellanox.com), Orit Moskovich (oritm mellanox.com)
Approved by: re
show more ...
|
| #
aa0a1e58
|
| 21-Mar-2011 |
Jeff Roberson <jeff@FreeBSD.org> |
- Merge in OFED 1.5.3 from projects/ofed/head
|