summaryrefslogtreecommitdiffstats
path: root/sys/sys/linker.h
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-07-13 19:36:59 +0000
committerphk <phk@FreeBSD.org>2004-07-13 19:36:59 +0000
commitb0e68741889ab66096103a2dec2219bbde3c21c6 (patch)
treed2eb15e6477b3d5e7e1f7c49c1e2eed3b85ec318 /sys/sys/linker.h
parent7b891087ed78b2c7943c2503f0bfdd7678a6d65c (diff)
downloadFreeBSD-src-b0e68741889ab66096103a2dec2219bbde3c21c6.zip
FreeBSD-src-b0e68741889ab66096103a2dec2219bbde3c21c6.tar.gz
Give kldunload a -f(orce) argument.
Add a MOD_QUIESCE event for modules. This should return error (EBUSY) of the module is in use. MOD_UNLOAD should now only fail if it is impossible (as opposed to inconvenient) to unload the module. Valid reasons are memory references into the module which cannot be tracked down and eliminated. When kldunloading, we abandon if MOD_UNLOAD fails, and if -force is not given, MOD_QUIESCE failing will also prevent the unload. For backwards compatibility, we treat EOPNOTSUPP from MOD_QUIESCE as success. Document that modules should return EOPNOTSUPP for unknown events.
Diffstat (limited to 'sys/sys/linker.h')
-rw-r--r--sys/sys/linker.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/sys/linker.h b/sys/sys/linker.h
index 1815c47..923febe 100644
--- a/sys/sys/linker.h
+++ b/sys/sys/linker.h
@@ -135,7 +135,7 @@ linker_file_t linker_make_file(const char* _filename, linker_class_t _cls);
/*
* Unload a file, freeing up memory.
*/
-int linker_file_unload(linker_file_t _file);
+int linker_file_unload(linker_file_t _file, int flags);
/*
* Add a dependency to a file.
@@ -275,6 +275,12 @@ struct kld_sym_lookup {
};
#define KLDSYM_LOOKUP 1
+/*
+ * Flags for kldunloadf() and linker_file_unload()
+ */
+#define LINKER_UNLOAD_NORMAL 0
+#define LINKER_UNLOAD_FORCE 1
+
#ifndef _KERNEL
#include <sys/cdefs.h>
@@ -282,6 +288,7 @@ struct kld_sym_lookup {
__BEGIN_DECLS
int kldload(const char* _file);
int kldunload(int _fileid);
+int kldunloadf(int _fileid, int flags);
int kldfind(const char* _file);
int kldnext(int _fileid);
int kldstat(int _fileid, struct kld_file_stat* _stat);
OpenPOWER on IntegriCloud