summaryrefslogtreecommitdiff
path: root/src/VBox/HostDrivers/Support/linux/SUPWrapperMod-linux.c
diff options
context:
space:
mode:
authorvboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2021-02-12 02:24:07 +0000
committervboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2021-02-12 02:24:07 +0000
commit1f3b7ebc48f9b0807706c325a8d3c0ff3cd7c00b (patch)
tree725e69d339c0b56a4e61747509e5563c86ca9a21 /src/VBox/HostDrivers/Support/linux/SUPWrapperMod-linux.c
parent6a933eb9954c401138c35db5d48892073ce0df98 (diff)
downloadVirtualBox-svn-1f3b7ebc48f9b0807706c325a8d3c0ff3cd7c00b.tar.gz
SUPDrv,VMMR0,VBoxDDR0,++: More work on wrapper kmods. bugref:9937
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@87728 cfe28804-0f27-0410-a406-dd0f0b0b656f
Diffstat (limited to 'src/VBox/HostDrivers/Support/linux/SUPWrapperMod-linux.c')
-rw-r--r--src/VBox/HostDrivers/Support/linux/SUPWrapperMod-linux.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/src/VBox/HostDrivers/Support/linux/SUPWrapperMod-linux.c b/src/VBox/HostDrivers/Support/linux/SUPWrapperMod-linux.c
index 378bc92793c..b95eec6a656 100644
--- a/src/VBox/HostDrivers/Support/linux/SUPWrapperMod-linux.c
+++ b/src/VBox/HostDrivers/Support/linux/SUPWrapperMod-linux.c
@@ -167,29 +167,11 @@ static void *g_hWrappedRegistration = NULL;
*/
static int __init VBoxWrapperModInit(void)
{
- /* Locate the module structure before we call SUPDrv to register.
-
- Before Linux v5.9 this could be done by address (__module_address()
- or __module_text_address()), but someone (guess who) apparently on
- a mission to make life miserable for out-of-tree modules or something,
- decided it was only used by build-in code and unexported both of them.
-
- I could find no init callouts getting a struct module pointer either,
- nor any module name hint anywhere I could see. So, we're left with
- hardcoding the module name via the compiler and call find_module.
-
- Sigh^2. */
/*printk("vboxwrap/" WRAPPED_MODULE_NAME ": VBoxWrapperModInit\n");*/
- struct module *pLnxMod = find_module(WRAPPER_MODULE_KMOD_NAME);
- if (pLnxMod)
- {
- int rc = SUPDrvLinuxLdrRegisterWrappedModule(&g_WrappedMod, pLnxMod, &g_hWrappedRegistration);
- if (rc == 0)
- return 0;
- printk("vboxwrap/" WRAPPED_MODULE_NAME ": SUPDrvLinuxRegisterWrappedModule failed: %d\n", rc);
- }
- else
- printk("vboxwrap/" WRAPPED_MODULE_NAME ": find_module(" WRAPPER_MODULE_KMOD_NAME ") failed\n");
+ int rc = SUPDrvLinuxLdrRegisterWrappedModule(&g_WrappedMod, KBUILD_MODNAME, &g_hWrappedRegistration);
+ if (rc == 0)
+ return 0;
+ printk("vboxwrap/" WRAPPED_MODULE_NAME ": SUPDrvLinuxRegisterWrappedModule failed: %d\n", rc);
return -EINVAL;
}