opnsense-src/sys/powerpc/include
Mitchell Horne a89262079e Consistently provide ffs/fls using builtins
Use of compiler builtin ffs/ctz functions will result in optimized
instruction sequences when possible, and fall back to calling a function
provided by the compiler run-time library. We have slowly shifted our
platforms to take advantage of these builtins in 60645781d6 (arm64),
1c76d3a9fb (arm), 9e319462a0 (powerpc, partial).

Some platforms still rely on the libkern implementations of these
functions provided by libkern, namely riscv, powerpc (ffs*, flsll), and
i386 (ffsll and flsll). These routines are slow, as they perform a
linear search for the bit in question. Even on platforms lacking
dedicated bit-search instructions, such as riscv, the compiler library
will provide better-optimized routines, e.g. by using binary search.

Consolidate all definitions of these functions (whether currently using
builtins or not) to libkern.h. This should result in equivalent or
better performing routines in all cases.

One wart in all of this is the existing HAVE_INLINE_F*** macros, which
we use in a few places to conditionally avoid the slow libkern routines.
These aren't easily removed in one commit. For now, provide these
defines unconditionally, but marked for removal after subsequent
cleanup.

Removal of the now unused libkern routines will follow in the next
commit.

Reviewed by:	dougm, imp (previous version)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40698
2023-07-06 14:46:41 -03:00
..
_align.h
_bus.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
_inttypes.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
_limits.h
_stdint.h
_types.h Reduce code duplication in machine/_types.h 2021-06-14 16:30:16 +01:00
altivec.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
asm.h Add CFI start/end proc directives to arm64, i386, and ppc 2020-12-05 00:33:28 +00:00
atomic.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
bat.h spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD 2023-05-12 10:44:04 -06:00
bus.h spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD 2023-05-12 10:44:04 -06:00
bus_dma.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
clock.h
counter.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
cpu.h Simplify swi for bus_dma. 2021-12-28 13:51:25 -08:00
cpufunc.h Consistently provide ffs/fls using builtins 2023-07-06 14:46:41 -03:00
db_machdep.h [PowerPC] kernel ifunc support for powerpc*, fix ppc64 relocation oddities. 2020-05-07 19:32:49 +00:00
dbdma.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
dump.h minidump: Use the provided dump bitset 2021-11-19 15:05:52 -04:00
efi.h
elf.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
endian.h powerpc: Drop old workaround for old gcc 2023-02-14 09:47:08 -07:00
exec.h
float.h
floatingpoint.h
fpu.h [POWERPC] Floating-Point Exception trap support 2020-11-06 13:34:30 +00:00
frame.h
gdb_machdep.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
hid.h
ieee.h
ieeefp.h Fix floating point exception definitions for powerpcspe 2018-07-24 22:04:56 +00:00
ifunc.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
in_cksum.h machine/in_cksum.h: don't include sys/cdefs.h 2022-04-18 21:02:19 +01:00
intr_machdep.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
kdb.h smp: Dynamically allocate the stoppcbs array 2023-05-25 18:09:55 -04:00
limits.h Remove checks for __CC_SUPPORTS_WARNING assuming it is always true. 2022-04-12 10:06:13 -07:00
machdep.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
md_var.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
memdev.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
metadata.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
minidump.h Sparsify the vm_page_dump bitmap 2020-09-21 22:21:59 +00:00
mmuvar.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
ofw_machdep.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
openpicreg.h powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00
openpicvar.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
param.h [PowerPC64LE] Set up powerpc.powerpc64le architecture 2020-09-22 23:49:30 +00:00
pcb.h [PowerPC64LE] Fix LE VSX/fpr interop 2020-12-03 01:39:59 +00:00
pcpu.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
pcpu_aux.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
pio.h powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00
platform.h powerpc: Fix the NUMA domain list on powernv 2020-01-18 01:26:54 +00:00
platformvar.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
pmap.h amd64: fix PKRU and swapout interaction 2023-04-15 02:53:59 +03:00
pmc_mdep.h powerpc64: add Power8 and Power9 PMCs 2021-07-26 10:27:23 -03:00
proc.h Move kstack_contains() and GET_STACK_USAGE() to MD machine/stack.h 2023-02-02 00:59:26 +02:00
procctl.h amd64 KPTI: add control from procctl(2). 2019-03-16 11:44:33 +00:00
profile.h powerpc: Axe PPC4xx support. 2020-03-18 01:09:43 +00:00
psl.h [POWERPC] Floating-Point Exception trap support 2020-11-06 13:34:30 +00:00
pte.h Implement superpages for PowerPC64 (HPT) 2020-11-06 14:12:45 +00:00
ptrace.h
reg.h powerpc: Make machine/reg.h self-contained 2021-11-23 21:21:18 -07:00
reloc.h
resource.h powerpc/booke: Simplify the MPC85XX PCIe root complex driver 2019-10-24 03:51:33 +00:00
rtas.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
runq.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
sc_machdep.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
setjmp.h
sigframe.h
signal.h
slb.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
smp.h smp: Dynamically allocate the stoppcbs array 2023-05-25 18:09:55 -04:00
spr.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
sr.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
stack.h kstack_contains(): account for struct pcb on stack 2023-02-02 00:59:27 +02:00
stdarg.h
sysarch.h
tlb.h powerpc: Axe PPC4xx support. 2020-03-18 01:09:43 +00: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 powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00
ucontext.h
vdso.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
vm.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
vmparam.h vm: centralize VM_BATCHQUEUE_SIZE definition 2023-01-21 14:30:00 -05:00