freebsd-src/sys/i386/include
Doug Moore b0056b31e9 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
2024-06-03 11:37:55 -05:00
..
pc sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
xen xen: add SPDX license tags to Xen headers 2023-12-15 14:59:25 +01:00
_align.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
_bus.h _bus.h: Use standard licnese text 2023-11-13 12:25:30 -07:00
_inttypes.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
_limits.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
_stdint.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
_types.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
acpica_machdep.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
apm_bios.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
apm_segments.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
asm.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
asmacros.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
atomic.h i386: Fix a typo in a source code comment 2024-04-20 14:13:33 +02:00
bootinfo.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
bus.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
bus_dma.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
clock.h x86: Deduplicate clock.h 2021-12-06 10:39:08 -05:00
counter.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
cpu.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
cpufunc.h libkern: add ilog2 macro 2024-06-03 11:37:55 -05:00
cputypes.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
db_machdep.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
dump.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
efi.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
elan_mmcr.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
elf.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
endian.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
exec.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
fdt.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
float.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
floatingpoint.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
fpu.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
frame.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
gdb_machdep.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieeefp.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
in_cksum.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
intr_machdep.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
iodev.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
iommu.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
kdb.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
limits.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
md_var.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
memdev.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
metadata.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
minidump.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
nexusvar.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
npx.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
ofw_machdep.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
param.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
pcb.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
pcb_ext.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
pci_cfgreg.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
pcpu.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
pcpu_aux.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
perfmon.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
pmap.h pmap: Convert boolean_t to bool. 2024-01-31 14:48:26 -08:00
pmap_base.h pmap: Convert boolean_t to bool. 2024-01-31 14:48:26 -08:00
pmap_nopae.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
pmap_pae.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
pmc_mdep.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
proc.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
procctl.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
profile.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
psl.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
ptrace.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
pvclock.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
reg.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
reloc.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
resource.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
runq.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
segments.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
setjmp.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
sf_buf.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
sigframe.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
signal.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
smapi.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
smp.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
speaker.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
specialreg.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
stack.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
stdarg.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
sysarch.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
tls.h Add <machine/tls.h> header to hold MD constants and helpers for TLS. 2021-12-09 13:17:13 -08:00
trap.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
tss.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
ucontext.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vdso.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
vm.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vm86.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vmparam.h vm: Simplify startup page dumping conditional 2024-05-25 19:24:55 +02:00