#
93215106 |
| 20-Jun-2006 |
John Baldwin <jhb@FreeBSD.org> |
- Add a new linker_file_foreach() function that walks the list of linker file objects calling a user-specified predicate function on each object. The iteration terminates either when the entire l
- Add a new linker_file_foreach() function that walks the list of linker file objects calling a user-specified predicate function on each object. The iteration terminates either when the entire list has been iterated over or the predicate function returns a non-zero value. linker_file_foreach() returns the value returned by the last invocation of the predicate function. It also accepts a void * context pointer that is passed to the predicate function as well. Using an iterator function avoids exposing linker internals to the rest of the kernel making locking simpler. - Use linker_file_foreach() instead of walking the list of linker files manually to lookup ndis files in ndis(4). - Use linker_file_foreach() to implement linker_hwpmc_list_objects().
show more ...
|
#
aaf31705 |
| 20-Jun-2006 |
John Baldwin <jhb@FreeBSD.org> |
Make linker_file_add_dependency() and linker_load_module() static since only the linker uses them.
|
#
e767366f |
| 20-Jun-2006 |
John Baldwin <jhb@FreeBSD.org> |
Don't check if malloc(M_WAITOK) returns NULL.
|
#
e5bb3a01 |
| 20-Jun-2006 |
John Baldwin <jhb@FreeBSD.org> |
Use 'else' to remove another goto.
|
#
73a2437a |
| 20-Jun-2006 |
John Baldwin <jhb@FreeBSD.org> |
- Remove some useless variable initializations. - Make some conditional free()'s where the condition was always true unconditional.
|
#
e1684acf |
| 14-Jun-2006 |
Marcel Moolenaar <marcel@FreeBSD.org> |
Unbreak 64-bit architectures. The 3rd argument to kern_kldload() is a pointer to an integer and td->td_retval[0] is of type register_t. On 64-bit architectures register_t is wider than an integer.
|
#
d5388587 |
| 13-Jun-2006 |
John Baldwin <jhb@FreeBSD.org> |
- Add a kern_kldload() that is most of the previous kldload() and push Giant down in it. - Push Giant down in kern_kldunload() and reorganize it slightly to avoid using gotos. Also, expose this
- Add a kern_kldload() that is most of the previous kldload() and push Giant down in it. - Push Giant down in kern_kldunload() and reorganize it slightly to avoid using gotos. Also, expose this function to the rest of the kernel.
show more ...
|
#
6b3d277a |
| 13-Jun-2006 |
John Baldwin <jhb@FreeBSD.org> |
- Push down Giant some in kldstat(). - Use a 'struct kld_file_stat' on the stack to read data under the lock and then do one copyout() w/o holding the lock at the end to push the data out to user
- Push down Giant some in kldstat(). - Use a 'struct kld_file_stat' on the stack to read data under the lock and then do one copyout() w/o holding the lock at the end to push the data out to userland.
show more ...
|
#
b904477c |
| 13-Jun-2006 |
John Baldwin <jhb@FreeBSD.org> |
Unexpand TAILQ_FOREACH() and TAILQ_FOREACH_SAFE().
|
#
3a600aea |
| 13-Jun-2006 |
John Baldwin <jhb@FreeBSD.org> |
Remove some more pointless goto's and don't check to see if malloc(M_WAITOK) returns NULL.
|
#
2fa6cc80 |
| 13-Jun-2006 |
John Baldwin <jhb@FreeBSD.org> |
Handle the simple case of just dropping a reference near the start of linker_file_unload() instead of in the middle of a bunch of code for the case of dropping the last reference to improve readabili
Handle the simple case of just dropping a reference near the start of linker_file_unload() instead of in the middle of a bunch of code for the case of dropping the last reference to improve readability and sanity. While I'm here, remove pointless goto's that were just jumping to a return statement.
show more ...
|
#
e38c7f3e |
| 27-May-2006 |
Xin LI <delphij@FreeBSD.org> |
extlen and cpp is not used here in linker_search_kld(), so nuke them.
Reported by: Mingyan Guo <guomingyan at gmail dot com> MFC After: 2 weeks
|
Revision tags: release/5.5.0_cvs, release/5.5.0, release/6.1.0_cvs, release/6.1.0 |
|
#
49874f6e |
| 26-Mar-2006 |
Joseph Koshy <jkoshy@FreeBSD.org> |
MFP4: Support for profiling dynamically loaded objects.
Kernel changes:
Inform hwpmc of executable objects brought into the system by kldload() and mmap(), and of their removal by kldunload() a
MFP4: Support for profiling dynamically loaded objects.
Kernel changes:
Inform hwpmc of executable objects brought into the system by kldload() and mmap(), and of their removal by kldunload() and munmap(). A helper function linker_hwpmc_list_objects() has been added to "sys/kern/kern_linker.c" and is used by hwpmc to retrieve the list of currently loaded kernel modules.
The unused `MAPPINGCHANGE' event has been deprecated in favour of separate `MAP_IN' and `MAP_OUT' events; this change reduces space wastage in the log.
Bump the hwpmc's ABI version to "2.0.00". Teach hwpmc(4) to handle the map change callbacks.
Change the default per-cpu sample buffer size to hold 32 samples (up from 16).
Increment __FreeBSD_version.
libpmc(3) changes:
Update libpmc(3) to deal with the new events in the log file; bring the pmclog(3) manual page in sync with the code.
pmcstat(8) changes:
Introduce new options to pmcstat(8): "-r" (root fs path), "-M" (mapfile name), "-q"/"-v" (verbosity control). Option "-k" now takes a kernel directory as its argument but will also work with the older invocation syntax.
Rework string handling in pmcstat(8) to use an opaque type for interned strings. Clean up ELF parsing code and add support for tracking dynamic object mappings reported by a v2.0.00 hwpmc(4).
Report statistics at the end of a log conversion run depending on the requested verbosity level.
Reviewed by: jhb, dds (kernel parts of an earlier patch) Tested by: gallatin (earlier patch)
show more ...
|
Revision tags: release/6.0.0_cvs, release/6.0.0 |
|
#
135c43dc |
| 19-Oct-2005 |
John Polstra <jdp@FreeBSD.org> |
Fix a bug in the kernel module runtime linker that made it impossible to unload the usb.ko module after boot if it was originally preloaded from "/boot/loader.conf". When processing preloaded module
Fix a bug in the kernel module runtime linker that made it impossible to unload the usb.ko module after boot if it was originally preloaded from "/boot/loader.conf". When processing preloaded modules, the linker erroneously added self-dependencies the each module's reference count. That prevented usb.ko's reference count from ever going to 0, so it could not be unloaded.
Sponsored by Isilon Systems.
Reviewed by: pjd, peter MFC after: 1 week
show more ...
|
#
885fec3e |
| 29-May-2005 |
Pawel Jakub Dawidek <pjd@FreeBSD.org> |
Fix panic when module is compiled in and it is loaded from loader.conf. Only panic is fixed, module will be still listed in kldstat(8) output. Not sure what is correct fix, because adding unloading c
Fix panic when module is compiled in and it is loaded from loader.conf. Only panic is fixed, module will be still listed in kldstat(8) output. Not sure what is correct fix, because adding unloading code in case of failure to linker_init_kernel_modules() doesn't work.
show more ...
|
#
870fba26 |
| 29-May-2005 |
Pawel Jakub Dawidek <pjd@FreeBSD.org> |
Prevent loading modules with are compiled into the kernel.
PR: kern/48759 Submitted by: Pawe³ Ma³achowski <pawmal@unia.3lo.lublin.pl> Patch from: demon MFC after: 2 weeks
|
Revision tags: release/5.4.0_cvs, release/5.4.0 |
|
#
ea2b9b3e |
| 01-Apr-2005 |
John Baldwin <jhb@FreeBSD.org> |
- Denote a few places where kobj class references are manipulated without holding the appropriate lock. - Add a comment explaining why we bump a driver's kobj class reference when loading a modul
- Denote a few places where kobj class references are manipulated without holding the appropriate lock. - Add a comment explaining why we bump a driver's kobj class reference when loading a module.
show more ...
|
Revision tags: release/4.11.0_cvs, release/4.11.0, release/5.3.0_cvs, release/5.3.0 |
|
#
0ca311f6 |
| 27-Aug-2004 |
Ian Dowse <iedowse@FreeBSD.org> |
When trying each linker class in turn with a preloaded module, exit the loop if the preload was successful. Previously a successful preload was ignored if the linker class was not the last in the lis
When trying each linker class in turn with a preloaded module, exit the loop if the preload was successful. Previously a successful preload was ignored if the linker class was not the last in the list.
show more ...
|
#
65a311fc |
| 13-Jul-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
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 t
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.
show more ...
|
#
39981fed |
| 01-Jul-2004 |
John Baldwin <jhb@FreeBSD.org> |
Trim a few things from the dmesg output and stick them under bootverbose to cut down on the clutter including PCI interrupt routing, MTRR, pcibios, etc.
Discussed with: USENIX Cabal
|
Revision tags: release/4.10.0_cvs, release/4.10.0 |
|
#
23eb3eb6 |
| 17-May-2004 |
Peter Wemm <peter@FreeBSD.org> |
Since we go to the trouble of compiling the kobj ops table for each class, and cannot handle it going away, add an explicit reference to the kobj class inside each linker class. Without this, a clas
Since we go to the trouble of compiling the kobj ops table for each class, and cannot handle it going away, add an explicit reference to the kobj class inside each linker class. Without this, a class with no modules loaded will sit with an idle refcount of 0. Loading and unloading a module with it causes a 0->1->0 transition which frees the ops table and causes subsequent loads using that class to explode. Normally, the "kernel" module will remain forever loaded and prevent this happening, but if you have more than one linker class active, only one owns the "kernel".
This finishes making modules work for kldload(8) on amd64.
show more ...
|
#
24554d00 |
| 09-Apr-2004 |
Peter Edwards <peadar@FreeBSD.org> |
Plug minor memory leak of module_t structures when unloading a file from the kernel.
Reviewed By: Doug Rabson (dfr@)
|
#
47934cef |
| 26-Feb-2004 |
Don Lewis <truckman@FreeBSD.org> |
Split the mlock() kernel code into two parts, mlock(), which unpacks the syscall arguments and does the suser() permission check, and kern_mlock(), which does the resource limit checking and calls vm
Split the mlock() kernel code into two parts, mlock(), which unpacks the syscall arguments and does the suser() permission check, and kern_mlock(), which does the resource limit checking and calls vm_map_wire(). Split munlock() in a similar way.
Enable the RLIMIT_MEMLOCK checking code in kern_mlock().
Replace calls to vslock() and vsunlock() in the sysctl code with calls to kern_mlock() and kern_munlock() so that the sysctl code will obey the wired memory limits.
Nuke the vslock() and vsunlock() implementations, which are no longer used.
Add a member to struct sysctl_req to track the amount of memory that is wired to handle the request.
Modify sysctl_wire_old_buffer() to return an error if its call to kern_mlock() fails. Only wire the minimum of the length specified in the sysctl request and the length specified in its argument list. It is recommended that sysctl handlers that use sysctl_wire_old_buffer() should specify reasonable estimates for the amount of data they want to return so that only the minimum amount of memory is wired no matter what length has been specified by the request.
Modify the callers of sysctl_wire_old_buffer() to look for the error return.
Modify sysctl_old_user to obey the wired buffer length and clean up its implementation.
Reviewed by: bms
show more ...
|
Revision tags: release/5.2.1_cvs, release/5.2.1, release/5.2.0_cvs, release/5.2.0, release/4.9.0_cvs, release/4.9.0 |
|
#
b15572e3 |
| 23-Sep-2003 |
Max Khon <fjoe@FreeBSD.org> |
Avoid NULL pointer dereferencing in modlist_lookup2().
PR: 56570 Submitted by: Thomas Wintergerst <Thomas.Wintergerst@nord-com.net>
|
#
7c89f162 |
| 27-Jul-2003 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Add fdidx argument to vn_open() and vn_open_cred() and pass -1 throughout.
|