elflink: Add _module_unload() prototype to module.h
authorMatt Fleming <matt.fleming@intel.com>
Mon, 2 Apr 2012 10:50:03 +0000 (11:50 +0100)
committerMatt Fleming <matt.fleming@intel.com>
Tue, 17 Apr 2012 09:58:33 +0000 (10:58 +0100)
Commit 8e0ed96bff7 ("elf: Support __constructor and __destructor")
failed to add a prototype for the newly introduced _module_unload()
function, which resulted in the following build warning being
introduced,

sys/module/exec.c: In function ‘spawn_load’:
sys/module/exec.c:222:3: warning: implicit declaration of function ‘_module_unload’

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
com32/include/sys/module.h

index 00d6331..fb6a1eb 100644 (file)
@@ -246,9 +246,10 @@ extern int module_load_shallow(struct elf_module *module, Elf32_Addr base_addr);
  * module_unload - unloads the module from the system.
  * @module: the module descriptor structure.
  *
- * The function checks to see whether the module can be safely removed, then
- * it releases all the associated memory. This function can be applied both
- * for standard modules and for shallow modules.
+ * The function checks to see whether the module can be safely
+ * removed, then it executes any destructors and releases all the
+ * associated memory. This function can be applied both for standard
+ * modules and for shallow modules.
  *
  * A module can be safely removed from the system when no other modules reference
  * symbols from it.
@@ -256,6 +257,14 @@ extern int module_load_shallow(struct elf_module *module, Elf32_Addr base_addr);
 extern int module_unload(struct elf_module *module);
 
 /**
+ * _module_unload - unloads the module without running destructors
+ *
+ * This function is the same as module_unload(), except that the
+ * module's destructors are not executed.
+ */
+extern int _module_unload(struct elf_module *module);
+
+/**
  * module_unload - unloads the module from the system.
  * @module: the module descriptor structure.
  *