summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_conf.c
Commit message (Collapse)AuthorAgeFilesLines
* Since dynamic allocation of device major numbers so far have notphk2003-04-131-1/+0
| | | | | resulted in any earthquakes, civil wars or early onset hair-loss, I think we can do without the printf announcing the assigned number.
* Add one little hack to allow us to make MAJOR_AUTO be zero:phk2003-03-091-0/+2
| | | | | Let the console driver ask for major 256 and magically change this to mean zero.
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-031-14/+12
| | | | | | | | | | | | | branches: Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values. This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386. Approved by: re(scottl)
* Explicitly initialize all cdevsw methods with the relevant nofoo() functionphk2003-03-021-0/+11
| | | | if they are NULL.
* NO_GEOM cleanup:phk2003-03-021-8/+1
| | | | Remove cdevsw->d_size() implementation. No longer needed.
* NODEVFS cleanup:phk2003-03-021-9/+3
| | | | Replace devfs_{create,destroy} hooks with direct function calls.
* Add the flip-side check: If a driver wants a particular major#, makephk2003-02-271-0/+9
| | | | sure it is marked as allocated in reserved_majors[]. Whine if it wasn't.
* Add support for allocating a device driver major number on demand.phk2003-02-271-2/+15
| | | | | | | | | | | | | | | To do this, initialize the d_maj member of the cdevsw to MAJOR_AUTO. When the cdevsw is first passed to make_dev() a free major number will be assigned. Until we have a bit more experience with this a printf will announce this fact. Major numbers are not reclaimed, so loading/unloading the same device driver which uses MAJOR_AUTO will eventually deplete the pool of free major numbers and the system will panic when it can not allocate one. Still undecided who to invonvenience with the solution to this.
* NODEVFS cleanup:phk2003-02-271-22/+0
| | | | | Remove cdevsw_add() and cdevsw_remove(), they served us well for a long time. Bump __FreeBSD_version to 500104 to mark this.
* NO_GEOM cleanup:phk2003-02-211-1/+1
| | | | | | | | | | | | | Retire the "d_dump_t" and use the "dumper_t" type instead. Dumper_t takes a void * as first arg which is more general than the dev_t taken by d_dump_t. (Remember: we could have net-dumpers if somebody wrote us one!) Define the convention for GEOM controlled disk devices to be that the first argument to the dumper function is the struct disk pointer. Change device drivers accordingly.
* Add a dead_cdevsw which does its best to return ENXIO if at all possible.phk2003-02-201-3/+53
| | | | | | | In devsw() return dead_cdevsw instead of NULL in case the dev_t does not have a si_devsw. This may improve our survival chances with devices which go away unexpectedly.
* Add M_WAITOKphk2003-02-191-1/+1
|
* Implement proper bounds-checking and truncation of device names, this hasphk2003-02-041-4/+10
| | | | | become an issue now that end-user controlable attributes can become devices names with the geom_vol_ffs class.
* Pave the road to removing the fixed size limit on device nodes:phk2003-02-041-0/+2
| | | | | | | | | | Change the si_name of dev_t's to be a char * and put a private buffer for holding the name at then end of the struct. Initialize si_name to point to the private buffer. Put a KASSERT in geom_disk to prevent overrun on the fake dev_t we still have to generate for the disk_drivers.
* NO_GEOM cleanup: unifdef;phk2003-01-301-8/+0
|
* NODEVFS cleanup: Remove cdevsw[].phk2003-01-291-31/+0
| | | | | | | | This implicitly removes the need for major numbers, but a number of drivers still know things they shouldn't need to, and we need to consider if there are applications which cache major(+minor) gleaned from stat(2) and rely on it being constant over reboots before we start assigning random majors.
* disk_dev_synth() is a NO_GEOM hack.phk2003-01-201-0/+4
|
* Mark more code #ifdef NODEVFSphk2003-01-191-1/+6
|
* Originally when DEVFS was added, a global variable "devfs_present"phk2003-01-191-3/+4
| | | | | | | | | | | | was used to control code which were conditional on DEVFS' precense since this avoided the need for large-scale source pollution with #include "opt_geom.h" Now that we approach making DEVFS standard, replace these tests with an #ifdef to facilitate mechanical removal once DEVFS becomes non-optional. No functional change by this commit.
* Remove unused cdevsw_ALLOCSTART macro.phk2002-12-281-2/+0
|
* Don't allow dev_stdclone(9) to accept minors larger than the system isgreen2002-10-051-0/+2
| | | | able to handle (0xffffff).
* Rename struct specinfo to the more appropriate struct cdev.phk2002-09-271-6/+6
| | | | Agreed on: jake, rwatson, jhb
* Assert my copyright on this file (using the default 2-clause BSD).phk2002-09-201-11/+4
| | | | | The vast majority of the contents is from my keyboard and no significant pieces remain of the former copyright holders code.
* Fix a logic bug in the struct dev_t allocation code.phk2002-09-081-5/+5
| | | | Spotted by: Neelkanth Natu <neelnatu@yahoo.com>
* Break the following implementation of panic(3):bde2002-04-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #!bin/sh # Original version of this by Michael Reifenberger # <root@nihil.plaut.de>. mdconfig -d -u 11 >/dev/null 2>&1 dd if=/dev/zero of=zz bs=1m count=1 while : do mdconfig -a -t vnode -f zz -u 11 fdisk -f - -iv /dev/md11 <<EOF1 g c1 h64 s32 p 1 165 0 2048 a 1 EOF1 mdconfig -d -u 11 done Garbage pointers in __si_u were not cleared by destroy_dev(). Not clearing si_disk made the above fatal because the disk layer uses si_disk as a flag to indicate that the dev_t has been completely initialized. disk_destroy() clears si_disk for the parent dev_t but doesn't get called for children. Not fixed: - setting the undocumented sysctl debug.free_devt should cause more complete destruction of the dev_t including clearing of __si_u, but actually causes the above to panic a little earlier. - the loop leaks 10 memory allocations per iteration (4 DEVFS, 2 devbuf and 4 dev_t). Reviewed by: timeout by MAINTAINER after 3 months
* Make the proposed name arg to dev_stdclone() const.phk2002-03-101-1/+1
|
* (Doing that whole test-immediately-after-commit-thing like obrien sez:)green2002-02-161-0/+2
| | | | Forgot to include lock.h and mutex.h for GIANT_REQUIRED.
* Add revoke_and_destroy_dev(), to be used by devices which decide whengreen2002-02-161-0/+13
| | | | | they choose to destroy themselves without regard to whether or not they are open.
* Add a new sysinit SI_SUB_DEVFS. Devfs hooks into the kernel at SI_ORDER_FIRST,msmith2002-01-091-1/+19
| | | | | | and devices can be created anytime after that. Print a warning if an atttempt is made to create a device too early.
* Back out the previous fix to the leading zero problem, I hadn'tphk2001-11-161-2/+0
| | | | | noticed it in there already. That should teach me to check exit code from cvsup.
* Reject leading zeros in dev_stdclone().phk2001-11-161-0/+2
| | | | | PR: 32019 Submitted by: fenner
* Do not allow leading zeros on device names in dev_stdclone().fenner2001-11-151-0/+2
| | | | | PR: kern/32019 Reviewed by: phk
* Fix a problem in the disk related hack where device nodes for a physicallyphk2001-10-281-1/+1
| | | | | | | | non-existent disk in a legacy /dev on a DEVFS system would panic the system if stat(2)'ed. Do not whine about anonymous device nodes not having a si_devsw, they're not supposed to.
* Nudge the axe a bit closer to cdevsw[]:phk2001-10-271-0/+11
| | | | | | | | | | | | Make it a panic to repeat make_dev() or destroy_dev(), this check should maybe be neutered when -current goes -stable. Whine if devsw() is called on anon dev_t's in a devfs system. Make a hack to avoid our lazy-eval disk code triggering the above whine. Fix the multiple make_dev() in disk code by making ${disk}${unit}s${slice} an alias/symlink to ${disk}${unit}s${slice}c
* Make cdevsw[] static.phk2001-10-261-1/+1
|
* Add dev_named(dev, name), which is similar in spirit to devtoname().jlemon2001-10-171-0/+13
| | | | | This function returns success if the device is known by either 'name' or any of its aliases.
* KSE Milestone 2julian2001-09-121-1/+1
| | | | | | | | | | | | | | 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
* Make the fmt arguments to make_dev and make_dev_alias const char *.imp2001-08-021-2/+2
| | | | | | Approved on IRC as long as it didn't cause a large number of warnings by: phk MFC After: 700 hours
* Create a general facility for making dev_t's depend on anotherphk2001-05-261-11/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | dev_t. The dev_depends(dev_t, dev_t) function is for tying them to each other. When destroy_dev() is called on a dev_t, all dev_t's depending on it will also be destroyed (depth first order). Rewrite the make_dev_alias() to use this dependency facility. kern/subr_disk.c: Make the disk mini-layer use dependencies to make sure all relevant dev_t's are removed when the disk disappears. Make the disk mini-layer precreate some magic sub devices which the disk/slice/label code expects to be there. kern/subr_disklabel.c: Remove some now unneeded variables. kern/subr_diskmbr.c: Remove some ancient, commented out code. kern/subr_diskslice.c: Minor cleanup. Use name from dev_t instead of dsname()
* Call strlen() once instead of twice.brian2001-04-141-2/+2
|
* Add a KASSERT on unit2minor() so that we catch it if people try to passphk2001-03-201-0/+1
| | | | us unit numbers which doesn't fit in 24 bits.
* Fixes to track snapshot copy-on-write checking in the specinfomckusick2001-03-071-0/+1
| | | | | | structure rather than assuming that the device vnode would reside in the FFS filesystem (which is obviously a broken assumption with the device filesystem).
* KASSERT that the minor number passed to make_dev() is valid.brian2001-02-021-0/+3
|
* Convert a Debugger(3) to a panic(9) and a EINVAL.phk2001-01-211-1/+3
| | | | Reminded by: bde
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-2/+1
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* Staticize some malloc M_ instances.phk2000-12-081-1/+1
|
* Axe some unused variables.jhb2000-11-101-2/+0
|
* Deprecate devsw->d_bmaj entirely.phk2000-10-311-41/+1
| | | | | | | This removes support for booting current kernels with very old bootblocks. Device driver writers: Please remove initializations for the d_bmaj field in your cdevsw{}.
* Allow all users to access the dev -> devname sysctl.phk2000-10-291-1/+1
|
* Rename lminor() to dev2unit(). This function gives a linear unit numberphk2000-09-191-1/+8
| | | | | | | | | | | | which hides the 'hole' in the minor bits. Introduce unit2minor() to do the reverse operation. Fix some some make_dev() calls which didn't use UID_* or GID_* macros. Kill the v_hashchain alias macro, it hides the real relationship. Introduce experimental SI_CHEAPCLONE flag set it on cloned bpfs.
OpenPOWER on IntegriCloud