]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
LinuxKPI: implement devres() framework parts and two examples
authorBjoern A. Zeeb <bz@FreeBSD.org>
Thu, 28 Jan 2021 16:32:43 +0000 (16:32 +0000)
committerBjoern A. Zeeb <bz@FreeBSD.org>
Thu, 28 Jan 2021 16:32:43 +0000 (16:32 +0000)
commitfa765ca73e553399ffbad382e579e4c2b4d0fc12
tree065e49d3754eac5f8dc36812a39aba65075731fb
parent1fac2cb4d6e5cfa1b8ff689213011b0fe077ffa7
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
sys/compat/linuxkpi/common/include/linux/device.h
sys/compat/linuxkpi/common/src/linux_compat.c
sys/compat/linuxkpi/common/src/linux_devres.c [new file with mode: 0644]
sys/conf/files
sys/modules/linuxkpi/Makefile