Searched hist:"28 a59100b54ff245a45fbd328266266f1c14eb8c" (Results 1 – 2 of 2) sorted by relevance
/freebsd/sys/sys/ |
H A D | linker.h | diff 28a59100b54ff245a45fbd328266266f1c14eb8c Wed Mar 06 18:48:07 CET 2024 Austin Shafer <ashafer@badland.io> linuxkpi: Provide a non-NULL value for THIS_MODULE
THIS_MODULE is used to differentiate modules on Linux. We currently completely stub out any Linux struct module usage, but THIS_MODULE is still used to populate the "owner" fields of various drivers. Even though we don't actually dereference these "owner" fields they are still used by drivers to check if devices/dmabufs/etc come from different modules. For example, during DRM GEM import some drivers check if the dmabuf's owner matches the dev's owner. If they match because they are both NULL drivers may incorrectly think two resources come from the same module.
This adds a general purpose __this_linker_file which will point to the linker file of the module that uses it. We can then use that pointer to have a valid value for THIS_MODULE.
Reviewed by: bz, jhb Differential Revision: https://reviews.freebsd.org/D44306
|
/freebsd/sys/kern/ |
H A D | kern_linker.c | diff 28a59100b54ff245a45fbd328266266f1c14eb8c Wed Mar 06 18:48:07 CET 2024 Austin Shafer <ashafer@badland.io> linuxkpi: Provide a non-NULL value for THIS_MODULE
THIS_MODULE is used to differentiate modules on Linux. We currently completely stub out any Linux struct module usage, but THIS_MODULE is still used to populate the "owner" fields of various drivers. Even though we don't actually dereference these "owner" fields they are still used by drivers to check if devices/dmabufs/etc come from different modules. For example, during DRM GEM import some drivers check if the dmabuf's owner matches the dev's owner. If they match because they are both NULL drivers may incorrectly think two resources come from the same module.
This adds a general purpose __this_linker_file which will point to the linker file of the module that uses it. We can then use that pointer to have a valid value for THIS_MODULE.
Reviewed by: bz, jhb Differential Revision: https://reviews.freebsd.org/D44306
|