kshim/usb: Add build option.
Add WITH{,OUT}_LOADER_USB to build the kshim usb library. Nothing
in-tree uses it, but this will make it easier to keep building. Updated
src.conf.5 with a few extra changes...
Sponsored by: Netflix
devel/py-lazyarray: New port
lazyarray is a Python package that provides a lazily-evaluated numerical
array class, larray, based on and compatible with NumPy arrays.
Lazy evaluation means that any operations on the array (potentially including
array construction) are not performed immediately, but are delayed until
evaluation is specifically requested. Evaluation of only parts of the array
is also possible.
LinuxKPI: implement devm_kmemdup_array()
Implement devm_kmemdup_array() using devm_kmemdup() in order to
prepare for Linux v7.0 based drivers.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D56396
LinuxKPI: sync overflow.h from Linux v7.0
overflow.h was imported directly from Linux in 3208d4ad2b8320a.
Update the file to the newer version as needed for v7.0 driver updates.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Obtained from: git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
028ef9c96e96197026887c0f092424679298aae8 (tag: v7.0)
Reviewed by: emaste, dumbbell
Differential Revision: https://reviews.freebsd.org/D56394
LinuxKPI: add kmalloc_obj[s], kzalloc_obj[s], and kzalloc_flex
Drivers in Linux v7.0 seem to have changed to the new allocation
macros using a sweep. Add the ones I encountered with wireless
drivers so far. They all take an optional argument for a gfp_t,
which default_gfp() deals with.
The plural version "objs" takes an extra nitems argument in addition
to the size. We use size_mul() to possibly detect overflows.
The "flex" version uses an extra variable to track the variable sized
array allocations and if supported by the compiler will use
__builtin_counted_by_ref() to properly track bounds.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D56395
LinuxKPI: conditionally add __flex_counter()
__flex_counter() is used by overflow.h and needed for "flex allocations".
It is either a void * typed 0 (NULL) (like this for _Generic checks),
or uses __builtin_counted_by_ref.
The latter was added to gcc and llvm fairly recently and while for gcc
the __has_builtin() check suffices, clang had parts broken until recently
so needs an extra check for the next major version. The fixed hash is
currently not part of any tag to use, so we play it save (and hope 23
will have it). It will be a while until we will see the builting to be
used but at least we will be prepared for it. See inline comments for
the commit hashes and versions which added the feature.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D56393