summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_linker.c
Commit message (Collapse)AuthorAgeFilesLines
* Change the name of the static variable 'files' to 'linker_files' ingrog1999-08-201-14/+14
| | | | | | order to be able to refer to it uniquely from the kernel debugger. Approved-by: peter
* Slight reorganization of kernel thread/process creation. Instead of usingpeter1999-07-011-34/+5
| | | | | | | | | | | | | | | SYSINIT_KT() etc (which is a static, compile-time procedure), use a NetBSD-style kthread_create() interface. kproc_start is still available as a SYSINIT() hook. This allowed simplification of chunks of the sysinit code in the process. This kthread_create() is our old kproc_start internals, with the SYSINIT_KT fork hooks grafted in and tweaked to work the same as the NetBSD one. One thing I'd like to do shortly is get rid of nfsiod as a user initiated process. It makes sense for the nfs client code to create them on the fly as needed up to a user settable limit. This means that nfsiod doesn't need to be in /sbin and is always "available". This is a fair bit easier to do outside of the SYSINIT_KT() framework.
* Slight tweak to fork1() calling conventions. Add a third argument sopeter1999-06-301-7/+6
| | | | | | | | the caller can easily find the child proc struct. fork(), rfork() etc syscalls set p->p_retval[] themselves. Simplify the SYSINIT_KT() code and other kernel thread creators to not need to use pfind() to find the child based on the pid. While here, partly tidy up some of the fork1() code for RF_SIGSHARE etc.
* First stages of a module dependency cleanup. This part fixes apeter1999-05-081-5/+12
| | | | | | | | | | | | 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.
* Enable vmspace sharing on SMP. Major changes are,luoqi1999-04-281-3/+1
| | | | | | | | | | | | | | | | | - %fs register is added to trapframe and saved/restored upon kernel entry/exit. - Per-cpu pages are no longer mapped at the same virtual address. - Each cpu now has a separate gdt selector table. A new segment selector is added to point to per-cpu pages, per-cpu global variables are now accessed through this new selector (%fs). The selectors in gdt table are rearranged for cache line optimization. - fask_vfork is now on as default for both UP and SMP. - Some aio code cleanup. Reviewed by: Alan Cox <alc@cs.rice.edu> John Dyson <dyson@iquest.net> Julian Elischer <julian@whistel.com> Bruce Evans <bde@zeta.org.au> David Greenman <dg@root.com>
* Suser() simplification:phk1999-04-271-3/+3
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* LK_RETRY is a vn_lock() flag, not one for lockmgr().peter1999-04-061-3/+3
|
* * Register sysctl nodes before running sysinits when loading files anddfr1999-03-071-2/+2
| | | | | | | | unregister them after sysuninits when unloading. * Add code to vfs_register() to set the oid number of vfs sysctls to the type number of the filesystem. Reviewed by: bde
* A correction to the code which attempts to prevent the same moduledfr1999-02-201-1/+3
| | | | | | | | being loaded twice. It used rindex() to strip the pathname but failed to account for the fact that rindex() will return a pointer to the '/', not the first character of the filename. Submitted by: Nick Hibma <hibma@skylink.it>
* * Change sysctl from using linker_set to construct its tree using SLISTs.dfr1999-02-161-2/+42
| | | | | | | | | | This makes it possible to change the sysctl tree at runtime. * Change KLD to find and register any sysctl nodes contained in the loaded file and to unregister them when the file is unloaded. Reviewed by: Archie Cobbs <archie@whistle.com>, Peter Wemm <peter@netplex.com.au> (well they looked at it anyway)
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-271-8/+8
| | | | | | | kernel compile. This commit includes significant work to proper handle const arguments for the DDB symbol routines.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-271-15/+15
| | | | kernel compile
* Don't try to call SYSUNINIT functions if there was a link error.dfr1999-01-251-2/+5
| | | | Reviewed by: Peter Wemm <peter@netplex.com.au>
* Update userref handling after discussion with submitter of previouspeter1999-01-231-4/+4
| | | | | | | | | | patch. lf can't be dereferenced after the unload attempt, in case it was freed. Instead, decrement first and back it out if the unload failed. This should be relatively immune to races caused by the user since the userref count will be zero for the duration of the actual unloading and will stop further kldunload attempts. Submitted by: Ustimenko Semen <semen@iclub.nsu.ru>
* Relax linkage symbol scope restrictions to be more compatable with thatpeter1999-01-191-2/+22
| | | | of shared libraries.
* Don't decrement userrefs unless the file was actually was unloaded.peter1999-01-191-2/+4
| | | | Submitted by: Ustimenko Semen <semen@iclub.nsu.ru>
* Try and clean up the multiple formal loading support a bit, based onpeter1999-01-171-10/+21
| | | | | | | | | | | | suggestions from Greg Lehey some time ago. In the face of multiple potential file formats, try and give a more sensible error than just ENOEXEC. XXX a good case can be made that the loading process is wrong - the linker should locate the file first (using the search paths etc), then run the loaders to see if they recognize it. While the present system allows for the possibility of different search paths for different formats, we do not use it and it just makes things more complicated than they need to be.
* Don't allow more than one module with the same name to be loaded.msmith1999-01-051-4/+17
| | | | | | Make kldfind ignore the path when searching for a loaded module. Submitted by: John Birrell (jb@freebsd.org)
* kldsym(2) prototype implementationpeter1998-11-111-1/+54
|
* Arrange for unload-time linker set hooks to be called. While cut/pastingpeter1998-11-101-14/+71
| | | | | some code, I changed the original to be consistant with the rest of the file rather than duplicating the problems.
* Define the kld_debug variable if KLD_DEBUG is enabledpeter1998-11-061-1/+5
|
* The handle for the kernel is common. With this fix, ELF kernels can loadpeter1998-11-041-1/+2
| | | | a.out kld modules, and a.out kernels can load ELF kld modules.
* Have the in-kernel linker try a default extension of .ko. This means thatpeter1998-11-031-3/+30
| | | | | "kldload nfs" works. We use the same default extension in the /boot/loader system.
* Use the kvm space pathname that we copied in, not the one in user space.peter1998-11-031-2/+2
|
* Don't put 0x in front of %p, it does it already.msmith1998-10-241-4/+4
| | | | Submitted by: Brian Feldman <green@janus.syracuse.net>
* - bzero() after malloc(). This is especially obvious when kern_malloc ispeter1998-10-151-3/+5
| | | | | compiled with DIAGNOSTIC. - Don't break from the preload module processing loop prematurely.
* Display module type as well as module name when we find one preloaded.peter1998-10-101-3/+8
|
* Use Mike Smith's linker module search path code.peter1998-10-101-16/+261
| | | | | | | | | | Implement preloading in a fairly MI way, assuming the information is prepared. DDB interface helpers.. Provide some support for db_kld.c so that we don't have to export too much detail. Debugging and cosmetic nits left in from development.. The other half of the containing file hack so modules can associate themselves with their "file".
* Modify the internal interfaces to the kernel linker to make it possibledfr1998-08-121-6/+9
| | | | for DDB to use its symbol tables.
* Use a real malloc type for M_LINKER instead of #defining it as M_TEMP.bde1998-01-011-1/+2
| | | | Fixed a comment.
* We have had support for running the kernel daemons as threads fordyson1997-12-121-2/+13
| | | | | | | quite a while, but forgot to do so. For now, this code supports most daemons running as kernel threads in UP kernels, and as full processes in SMP. We will soon be able to run them as threads in SMP, but not yet.
* Fixed a sloppy common-style definitions.bde1997-11-201-1/+3
|
* Move the "retval" (3rd) parameter from all syscall functions and putphk1997-11-061-21/+21
| | | | | | | | | | | | 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-08-021-4/+1
|
* This is the kernel linker. To use it, you will first need to applydfr1997-05-071-0/+562
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