summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_module.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Move the MOD_SHUTDOWN event from shutdown_post_sync to shutdown_final,peter2003-01-071-1/+1
| | | | | | | | | | so that entities that want to use the post_sync hook to write stuff to devices and other tidy-up can do so before the device tree is shot down. eg: da doing a SYNC_CACHE etc. This should get crashdumps working on mpt devices again, and stops the ia64 boxes locking up on regular shutdown when da tries to issue the scsi commands to mpt. Obtained from: njl, gibbs
* SCARGS removal take II.alfred2002-12-141-6/+6
|
* Backout removal SCARGS, the code freeze is only "selectively" over.alfred2002-12-131-6/+6
|
* Remove SCARGS.alfred2002-12-131-6/+6
| | | | Reviewed by: md5
* - Remove Giant acquisition from modevent(), modfnext(), modstat() andarr2002-06-261-27/+11
| | | | | | | modfind(). Giant is no longer needed by these functions for safe execution. Reviewed by: jhb
* - Lock down the ``module'' structure by adding an SX lock that is used byarr2002-03-181-19/+58
| | | | | | | | | all the global bits of ``module'' data. This commit adds a few generic macros, MOD_SLOCK, MOD_XLOCK, etc., that are meant to be used as ways of accessing the SX lock. It is also the first step in helping to lock down the kernel linker and module systems. Reviewed by: jhb, jake, smp@
* Fix a warning. Do not assume pointer == long.peter2002-02-261-2/+2
|
* - Whitespace fixup left over from previous commit.arr2002-02-221-10/+9
| | | | | | - Remove bogus cast. Submitted by: bde
* - Fix style further by adding parentheses around return values so thatarr2002-02-201-14/+14
| | | | | they look like: return (val); instead of: return val;
* - Style.9 formatting fix; this commit is mostly white space related witharr2002-02-201-209/+209
| | | | | | | | | | the next commit actually doing the: return val; -> return (val); changes. This commit was done in preparation for getting ``struct modules'' locked down. Reviewed by: bde Approved by: dfr
* KSE Milestone 2julian2001-09-121-13/+13
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Giant Pushdown. Saved the worst P4 tree breakage for last.dillon2001-09-011-19/+52
| | | | | | | | | | | | reboot() getpriority() setpriority() rtprio() osetrlimit() ogetrlimit() setrlimit() getrlimit() getrusage() getpid() getppid() getpgrp() getpgid() getsid() getgid() getegid() getgroups() setsid() setpgid() setuid() seteuid() setgid() setegid() setgroups() setreuid() setregid() setresuid() setresgid() getresuid() getresgid () __setugid() getlogin() setlogin() modnext() modfnext() modstat() modfind() kldload() kldunload() kldfind() kldnext() kldstat() kldfirstmod() kldsym() getdtablesize() dup2() dup() fcntl() close() ofstat() fstat() nfsstat() fpathconf() flock()
* Mechanical change to use <sys/queue.h> macro API instead ofphk2001-02-041-3/+3
| | | | | | | fondling implementation details. Created with: sed(1) Reviewed by: md5(1)
* Staticize some malloc M_ instances.phk2000-12-081-1/+1
|
* Back out the previous change to the queue(3) interface.jake2000-05-261-3/+3
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-3/+3
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* First round implementation of a fine grain enhanced module to modulepeter2000-04-291-15/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | version dependency system. This isn't quite finished, but it is at a useful stage to do a functional checkpoint. Highlights: - version and dependency metadata is gathered via linker sets, so things are handled the same for static kernels and code built to live in a kld. - The dependencies are at module level (versus at file level). - Dependencies determine kld symbol search order - this means that you cannot link against symbols in another file unless you depend on it. This is so that you cannot accidently unload the target out from underneath the ones referencing it. - It is flexible enough that we can put tags in #include files and macros so that we can get decent hooks for enforcing recompiles on incompatable ABI changes. eg: if we change struct proc, we could force a recompile for all kld's that reference the proc struct. - Tangled dependency references at boot time are sorted. Files are relocated once all their dependencies are already relocated. Caveats: - Loader support is incomplete, but has been worked on seperately. - Actual enforcement of the version number tags is not active yet - just the module dependencies are live. The actual structure of versioning hasn't been agreed on yet. (eg: major.minor, or whatever) - There is some backwards compatability for old modules without metadata but I'm not sure how good it is. This is based on work originally done by Boris Popov (bp@freebsd.org), but I'm not sure he'd recognize much of it now. Don't blame him. :-) Also, ideas have been borrowed from Mike Smith.
* A hack basically.. We have a bunch of code that used to callpeter1999-11-081-1/+8
| | | | | | | | | | | devsw_module_handler() indirectly and not use the chain arguments. To eliminate this indirection via that function (which does nothing now) without duplicating a modevent handler into all the routines that don't presently have one, supply a NOP (do nothing, return OK) routine which is functionally equivalent to what's there now. This is a hack and is still wrong, because there doesn't appear to be anything to reclaim resources on an unload of a module with one of these in it. I'm not sure whether to make the NOP handler refuse a MOD_UNLOAD event or what.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Implement a new generic mechanism for attaching handler functions tomsmith1999-08-211-4/+6
| | | | | | | | | | | | | events, in order to pave the way for removing a number of the ad-hoc implementations currently in use. Retire the at_shutdown family of functions and replace them with new event handler lists. Rework kern_shutdown.c to take greater advantage of the use of event handlers. Reviewed by: green
* Oops, set module->file..peter1999-05-201-1/+2
| | | | | PR: 1179 Submitted-by: lha@stacken.kth.se
* First stages of a module dependency cleanup. This part fixes apeter1999-05-081-21/+33
| | | | | | | | | | | | particularly annoying hack, namely having the linker bash the moduledata to set the container pointer, preventing it being const. In the process, a stack of warnings were fixed and will probably allow a revisit of the const C_SYSINIT() changes. This explicitly registers modules in files or preload areas with the module system first, and let them initialize via SYSINIT/DECLARE_MODULE later in their SI_ORDER_xxx order. The kludge of finding the containing file is no longer needed since the registration of modules onto the modules list is done in the context of initializing the linker file.
* More -Wall / -Wcast-qual cleanup. Also, EXEC_SET can't usedillon1999-01-291-3/+3
| | | | | C_DECLARE_MODULE due to the linker_file_sysinit() function making modifications to the data.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-271-8/+8
| | | | kernel compile
* Remove a diagnostic message left in by mistake.dfr1999-01-091-3/+2
|
* Implement a mechanism for a module to report a small amount of moduledfr1999-01-091-2/+27
| | | | | specific data back to the user via kldstat(2). Use that mechanism in the syscall handler to report the syscall number used.
* put a \n on an error message printfpeter1998-11-061-2/+2
|
* *gulp*. Jordan specifically OK'ed this..peter1998-10-161-2/+2
| | | | | | | | This is the bulk of the support for doing kld modules. Two linker_sets were replaced by SYSINIT()'s. VFS's and exec handlers are self registered. kld is now a superset of lkm. I have converted most of them, they will follow as a seperate commit as samples. This all still works as a static a.out kernel using LKM's.
* Keep track of the containing file for modules. This is a bit of a hack,peter1998-10-101-7/+11
| | | | | | | but I can't think of another (relatively) easy way of getting the info since the boot-time initialization is not done immediately after "loading". XXX module_register() gained an extra arg. This might break the alpha compile, if so, just add a zero to get the old behavior.
* Send a MOD_UNLOAD event before deleting the module. if the MOD_LOAD eventdfr1998-10-031-1/+2
| | | | failed.
* Changed to the C9x draft spelling of the (unsigned) integral typebde1998-07-141-3/+2
| | | | | | | | suitable for holding object pointers (ptrint_t -> uintptr_t). Added corresponding signed type (intptr_t). Changed/added corresponding non-C9x types for function pointers to match. Don't use nonstandard types to implement these types, and don't comment on them in <machine/types.h>.
* Fixed printf format errors.bde1998-07-111-3/+4
|
* Remove a bunch of variables which were unused both in GENERIC and LINT.phk1997-11-071-2/+1
| | | | Found by: -Wunused
* Move the "retval" (3rd) parameter from all syscall functions and putphk1997-11-061-14/+15
| | | | | | | | | | | | it in struct proc instead. This fixes a boatload of compiler warning, and removes a lot of cruft from the sources. I have not removed the /*ARGSUSED*/, they will require some looking at. libkvm, ps and other userland struct proc frobbing programs will need recompiled.
* Removed unused #includes.bde1997-10-281-2/+1
|
* make a couple functions static...jmg1997-10-241-3/+3
| | | | | also change module_register_static to module_register_init as this function initalizes the module for both dynamic and static modules...
* Removed unused #includes.bde1997-08-021-3/+1
|
* This is the kernel linker. To use it, you will first need to applydfr1997-05-071-0/+304
the patches in freefall:/home/dfr/ld.diffs to your ld sources and set BINFORMAT to aoutkld when linking the kernel. Library changes and userland utilities will appear in a later commit.
OpenPOWER on IntegriCloud