HomeFreeBSD

LinuxKPI: implement devres() framework parts and two examples

Description

LinuxKPI: implement devres() framework parts and two examples

This code implements a version of the devres framework found
working for various iwlwifi use cases and also providing functions
for ttm_page_alloc_dma.c from DRM.

Part of the framework replicates the consumed KPI, while others
are internal helper functions.

In addition the simple devm_k*malloc() consumers were implemented
and kvasprintf() was enhanced to also work for the devm_kasprintf()
case.
Addmittingly lkpi_devm_kmalloc_release() could be avoided but for
the overall understanding of the code and possible memory tracing
it may still be helpful.

Further devsres consumer are implemented for iwlwifi but will follow
later as the main reason for this change is to sort out overlap with
DRM.

Sponsored-by: The FreeBSD Foundation
Obtained-from: bz_iwlwifi
MFC After: 3 days
Reviewed-by: hselasky, manu
Differential Revision: https://reviews.freebsd.org/D28189

(cherry picked from commit fa765ca73e553399ffbad382e579e4c2b4d0fc12)

Details

Provenance
bzAuthored on Jan 28 2021, 4:32 PM
Differential Revision
D28189: LinuxKPI: implement devres() framework parts and two examples
Parents
rG3ac9e87b762c: LinuxKPI: enhance PCI bits for DRM
Branches
Unknown
Tags
Unknown