mirror of
https://github.com/opnsense/src.git
synced 2026-02-16 00:58:21 -05:00
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 (cherry picked from commit c8b0c33b03ac072413b27bed2bdae2ae27426f3a) |
||
|---|---|---|
| .. | ||
| ttm | ||
| drm.h | ||
| drm_agpsupport.c | ||
| drm_atomic.h | ||
| drm_auth.c | ||
| drm_buffer.c | ||
| drm_buffer.h | ||
| drm_bufs.c | ||
| drm_context.c | ||
| drm_core.h | ||
| drm_crtc.c | ||
| drm_crtc.h | ||
| drm_crtc_helper.c | ||
| drm_crtc_helper.h | ||
| drm_dma.c | ||
| drm_dp_helper.c | ||
| drm_dp_helper.h | ||
| drm_dp_iic_helper.c | ||
| drm_drv.c | ||
| drm_edid.c | ||
| drm_edid.h | ||
| drm_edid_modes.h | ||
| drm_fb_helper.c | ||
| drm_fb_helper.h | ||
| drm_fixed.h | ||
| drm_fops.c | ||
| drm_fourcc.h | ||
| drm_gem.c | ||
| drm_gem_names.c | ||
| drm_gem_names.h | ||
| drm_global.c | ||
| drm_global.h | ||
| drm_hashtab.c | ||
| drm_hashtab.h | ||
| drm_ioc32.c | ||
| drm_ioctl.c | ||
| drm_irq.c | ||
| drm_linux_list.h | ||
| drm_linux_list_sort.c | ||
| drm_lock.c | ||
| drm_mem_util.h | ||
| drm_memory.c | ||
| drm_mm.c | ||
| drm_mm.h | ||
| drm_mode.h | ||
| drm_modes.c | ||
| drm_os_freebsd.c | ||
| drm_os_freebsd.h | ||
| drm_pci.c | ||
| drm_pciids.h | ||
| drm_platform.c | ||
| drm_sarea.h | ||
| drm_scatter.c | ||
| drm_stub.c | ||
| drm_sysctl.c | ||
| drm_vm.c | ||
| drmP.h | ||