opnsense-src/sys/arm64/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 Regularize my copyright notice 2019-12-04 16:56:11 +00:00
_inttypes.h
_limits.h
_stdint.h arm64: Fix sig_atomic_t limit definitions 2023-03-22 16:22:21 +00:00
_types.h Reduce code duplication in machine/_types.h 2021-06-14 16:30:16 +01:00
acpica_machdep.h arm64: clean up empty lines in .c and .h files 2020-09-01 21:18:06 +00:00
armreg.h Add more arm64 special register values 2023-06-12 09:31:14 +01:00
asan.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
asm.h Mark EENTRY as .text 2023-04-06 16:50:54 +01:00
atomic.h arm64: add KASAN support 2023-03-23 16:34:33 -05:00
bus.h arm64: bus: provide bus_space_set_{multi,region}_stream definitions 2022-09-26 14:24:37 -05:00
bus_dma.h Allow loading the same DMA address multiple times without any prior 2019-05-16 17:41:16 +00:00
bus_dma_impl.h bus_dma: Deduplicate locking helper functions. 2022-01-05 13:50:40 -08:00
clock.h Bring in the start of the arm64 kernel. 2015-04-13 14:43:10 +00:00
cmn600_reg.h Fix the SPDX-License-Identifier in CMN-600 files 2022-12-22 10:36:18 +00:00
counter.h Allocate arm64 per-CPU data in the correct domain 2021-10-11 10:36:50 +01:00
cpu.h arm64: Add a masked get_kernel_reg() 2023-06-28 16:29:49 -04:00
cpufunc.h Consistently provide ffs/fls using builtins 2023-07-06 14:46:41 -03:00
csan.h arm64: Improve DDB backtrace support 2021-02-01 14:15:57 +00:00
db_machdep.h Remove unused registes from the arm pcb 2023-03-23 18:56:26 +00:00
debug_monitor.h Make some arm64 debug monitor functions static 2023-07-05 11:05:38 +01:00
disassem.h Framework for ARM64 instruction disassembler 2016-01-29 13:06:30 +00:00
dump.h minidump: De-duplicate the progress bar 2021-09-29 16:42:21 -03:00
efi.h smbios: support getting address from EFI 2021-04-07 14:46:29 -05:00
elf.h arm, arm64: tweak hard-coded load addresses for PIE binaries 2022-10-25 19:00:44 +03:00
endian.h Consolidate machine/endian.h definitions 2021-03-26 19:00:22 -03:00
exec.h
float.h Rationalize BSD license on sys/*/include/float.h 2015-08-05 17:05:35 +00:00
floatingpoint.h add floatingpoint.h for arm64 2015-06-24 14:51:53 +00:00
fpu.h Add machine/fpu.h on arm64 for compatibility with amd64. 2017-10-10 13:02:58 +00:00
frame.h arm64: Remove struct arm64_frame 2023-06-15 12:38:45 -04:00
gdb_machdep.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
hypervisor.h arm64: set FPEN if we're stuck with HCR_EL2.E2H 2023-02-28 16:16:14 -06:00
ieeefp.h arm64: clean up empty lines in .c and .h files 2020-09-01 21:18:06 +00:00
ifunc.h Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
in_cksum.h machine/in_cksum.h: don't include sys/cdefs.h 2022-04-18 21:02:19 +01:00
intr.h arm: remove passing trapframe to intr_ipi_dispatch() 2023-04-26 20:08:30 +01:00
iodev.h Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
iommu.h Introduce IOMMU support for arm64 platform. 2020-11-16 21:55:52 +00:00
kdb.h arm64: implement kdb watchpoint functions 2021-03-29 12:05:43 -03:00
machdep.h arm64: disable the physical timer for now if HCR_EL2.E2H is set 2023-03-03 11:02:34 -06:00
md_var.h arm64: add swapueword8/32 2023-05-11 13:23:14 -05:00
memdev.h Add the MEM_EXTRACT_PADDR ioctl to /dev/mem. 2020-09-02 18:12:47 +00:00
metadata.h loader.efi: Make framebuffer commands available for arm64 2017-10-25 18:55:04 +00:00
minidump.h Make page size dynamic in libkvm for arm64 2022-03-15 09:52:15 +00:00
ofw_machdep.h Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
param.h arm64: add KASAN support 2023-03-23 16:34:33 -05:00
pcb.h Add padding for future use on arm64 2023-04-25 10:23:15 +01:00
pci_cfgreg.h Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
pcpu.h Use a uint64_t to store the arm64 mpidr 2023-04-24 12:33:50 +01:00
pcpu_aux.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
pmap.h pmap_{un}map_io_transient: Use bool instead of boolean_t. 2023-05-04 12:29:48 -07:00
pmc_mdep.h hwpmc: use kstack_contains() 2023-05-06 14:49:19 -03:00
proc.h Add padding for future use on arm64 2023-04-25 10:23:15 +01:00
procctl.h amd64 KPTI: add control from procctl(2). 2019-03-16 11:44:33 +00:00
profile.h Remove checks for __GNUCLIKE_ASM assuming it is always true. 2022-04-12 10:05:45 -07:00
psl.h Add support for arm64 to loader.efi and boot1.efi 2015-04-14 13:55:01 +00:00
pte.h arm64 pmap: introduce PHYS_TO_PTE macro 2023-05-24 11:55:38 +01:00
ptrace.h arm64: Implement cpu_ptrace(). 2022-10-27 23:25:56 +02:00
reg.h arm64: extend ESR/SPSR registers to 64b 2023-03-23 18:56:26 +00:00
reloc.h
resource.h Define PCI_RES_BUS for NEW_PCIB 2016-05-19 14:00:18 +00:00
runq.h
setjmp.h Move the stored signal mask later in the jump buf. It was being clobbered 2016-12-06 13:46:12 +00:00
sf_buf.h Bring in the start of the arm64 kernel. 2015-04-13 14:43:10 +00:00
sigframe.h Follow arm[32] and sparc64 KAPI and provide the FreeBSD standard spelling 2019-01-29 20:10:27 +00:00
signal.h
smp.h smp: Dynamically allocate the stoppcbs array 2023-05-25 18:09:55 -04:00
stack.h kstack_contains(): account for struct pcb on stack 2023-02-02 00:59:27 +02:00
stdarg.h Introduce an architecture-agnostic <sys/_stdarg.h> to reduce 2017-12-25 20:54:00 +00:00
sysarch.h Add more arm64 machine dependent headers. With this we now have the minimum 2015-03-26 21:10:42 +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 Bring in the start of the arm64 kernel. 2015-04-13 14:43:10 +00:00
ucontext.h arm64: extend ESR/SPSR registers to 64b 2023-03-23 18:56:26 +00:00
undefined.h Move ID reading signatures to a better header 2020-07-01 16:17:51 +00:00
vdso.h Add rudimentary support for building FreeBSD/arm64 with COMPAT_FREEBSD32. 2017-11-24 13:50:53 +00:00
vfp.h Add helpers to allocate an arm64 VFP state struct 2023-07-05 10:42:14 +01:00
vm.h Switch the arm64 VM_MEMATTR_DEVICE to nGnRE 2023-03-16 16:45:42 +00:00
vmparam.h arm64: make VM_NFREEORDER and the comment describing it match 2023-06-29 12:48:48 -05:00