Page MenuHomeFreeBSD

LinuxKPI: add kmalloc_obj[s], kzalloc_obj[s], and kzalloc_flex
ClosedPublic

Authored by bz on Tue, Apr 14, 3:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 20, 12:05 PM
Unknown Object (File)
Mon, Apr 20, 11:30 AM
Unknown Object (File)
Sun, Apr 19, 4:18 AM
Unknown Object (File)
Sat, Apr 18, 7:50 AM
Unknown Object (File)
Sat, Apr 18, 7:49 AM
Unknown Object (File)
Sat, Apr 18, 6:12 AM
Unknown Object (File)
Sat, Apr 18, 2:01 AM
Subscribers

Details

Summary

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable