summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_conf.c
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* revent multiple make_dev() calls on the same dev_t and similar bogosities.phk2000-09-111-0/+16
| | | | | | A couple of new warnings may be emitted during boot if drivers DTWT. Tested by: George Cox <gjvc@gjvc.com>
* Add code to devname(3) so it can find the names of devices whichphk2000-09-091-0/+27
| | | | | | | | | | | | were not present when dev_mkdb(8) was run. First the dev_mkdb(8) database is searched, this caters for non-DEVFS cases where people have renamed a device. If that fails we ask the kernel using sysctl kern.devname if the device driver has put a name in the dev_t. This covers DEVFS cloned devices. If that also fails we format a string which isn't entirely useless.
* Avoid the modules madness I inadvertently introduced by making thephk2000-09-021-3/+28
| | | | | | | | | | | | | | | | | | cloning infrastructure standard in kern_conf. Modules are now the same with or without devfs support. If you need to detect if devfs is present, in modules or elsewhere, check the integer variable "devfs_present". This happily removes an ugly hack from kern/vfs_conf.c. This forces a rename of the eventhandler and the standard clone helper function. Include <sys/eventhandler.h> in <sys/conf.h>: it's a helper #include like <sys/queue.h> Remove all #includes of opt_devfs.h they no longer matter.
* Remove all traces of Julians DEVFS (incl from kern/subr_diskslice.c)phk2000-08-201-15/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove old DEVFS support fields from dev_t. Make uid, gid & mode members of dev_t and set them in make_dev(). Use correct uid, gid & mode in make_dev in disk minilayer. Add support for registering alias names for a dev_t using the new function make_dev_alias(). These will show up as symlinks in DEVFS. Use makedev() rather than make_dev() for MFSs magic devices to prevent DEVFS from noticing this abuse. Add a field for DEVFS inode number in dev_t. Add new DEVFS in fs/devfs. Add devfs cloning to: disk minilayer (ie: ad(4), sd(4), cd(4) etc etc) md(4), tun(4), bpf(4), fd(4) If DEVFS add -d flag to /sbin/inits args to make it mount devfs. Add commented out DEVFS to GENERIC
* Back out the previous change to the queue(3) interface.jake2000-05-261-2/+2
| | | | | | 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-2/+2
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Change the "bdev-whiner" to whine when open is attempted and extendphk2000-05-091-5/+0
| | | | the deadline a month.
* Reword warning to make it clearer (I read it as "remove block devices createdkris2000-03-251-1/+1
| | | | before 2000-06-01" which is obviously not what was intended :-)
* Whine at users who still have block devices in /dev, give them untilphk2000-03-211-0/+5
| | | | june 1st to fix their system.
* Backout previous commit. It was a mistake.bp2000-01-231-1/+1
|
* Replace non obvious number with SPECNAMELEN constant.bp2000-01-231-1/+1
| | | | Reviewed by: phk
* Be more careful about NOUDEV and NODEV.phk2000-01-041-0/+8
| | | | Submitted by: bde
* Report swapdevices as cdevs rather than bdevs.phk1999-11-291-9/+0
| | | | Remove unused dev2budev() function.
* Remove the now unused chrtoblk() function.phk1999-11-291-17/+0
|
* Zap devsw_module_handler().peter1999-11-081-12/+0
|
* Rename remove_dev() to destroy_dev().phk1999-11-081-1/+1
| | | | Nagged about by: msmith
* Remove the devsw magic from DEV_MODULE()phk1999-11-071-17/+0
|
* A little step further in the dev_t cleanups:phk1999-10-041-17/+28
| | | | | | Refuse to register a bmajor if the D_DISK flag is not set in cdevsw. A little bit of cleanup while here.
* Const'ify devtoname() and d_name. This exposes some errors (2 non-benign).bde1999-09-131-3/+7
| | | | Handle negative minor numbers properly in devtoname().
* Add dev_t freeing code. Controlled by sysctl debug.free_devt, defaultphk1999-08-291-9/+58
| | | | is off.
* Put a brief comment on a couple of #defines.phk1999-08-281-0/+7
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Convert DEVFS hooks in (most) drivers to make_dev().phk1999-08-231-21/+5
| | | | | | | | | | | | | | | | Diskslice/label code not yet handled. Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers) Add the correct hook for devfs to kern_conf.c The net result of this excercise is that a lot less files depends on DEVFS, and devtoname() gets more sensible output in many cases. A few drivers had minor additional cleanups performed relating to cdevsw registration. A few drivers don't register a cdevsw{} anymore, but only use make_dev().
* First small steps at merging DEVFS and PHK's Dev_t stuff.julian1999-08-201-1/+19
|
* Welcome devtoname(), to most likely be used when printing informationbillf1999-08-171-1/+8
| | | | | | | | | | about a dev_t. printf("%x", dev) now becomes printf("%s", devtoname(dev)) because printing actual information about the device is much more useful then printing a pointer to an address that would never help the developer debug. Submitted by: phk, bde
* Introduce lminor(dev_t dev), which returns a linear minor number,phk1999-08-151-1/+12
| | | | ie: hides the fact that the major number is stuck in the middle.
* The bdevsw() and cdevsw() are now identical, so kill the former.phk1999-08-131-7/+3
|
* Decommision miscfs/specfs/specdev.h. Most of it goes into <sys/conf.h>,phk1999-08-081-3/+22
| | | | | | a few lines into <sys/vnode.h>. Add a few fields to struct specinfo, paving the way for the fun part.
* cdevsw_remove: place correct value in bmaj2cmaj. This had causedgrog1999-08-081-2/+2
| | | | | | | | | | warnings of the following nature on reloading a kld: WARNING: "vinum" is usurping "console"'s bmaj This only applies to cases where "console" is mentioned. Broken-by: grog
* Fix a REALLY embarrassing mistake. Don't look; I warned you.green1999-07-201-2/+2
|
* Make a dev2budev() function, and use it. This refixes pstat (working, broken,green1999-07-201-1/+10
| | | | | | | working, broken, working) and savecore (working, working, broken, working, working). Sorta Reviewed by: phk
* Now a dev_t is a pointer to struct specinfo which is shared by all specdevphk1999-07-201-25/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vnodes referencing this device. Details: cdevsw->d_parms has been removed, the specinfo is available now (== dev_t) and the driver should modify it directly when applicable, and the only driver doing so, does so: vn.c. I am not sure the logic in checking for "<" was right before, and it looks even less so now. An intial pool of 50 struct specinfo are depleted during early boot, after that malloc had better work. It is likely that fewer than 50 would do. Hashing is done from udev_t to dev_t with a prime number remainder hash, experiments show no better hash available for decent cost (MD5 is only marginally better) The prime number used should not be close to a power of two, we use 83 for now. Add new checkalias2() to get around the loss of info from dev2udev() in bdevvp(); The aliased vnodes are hung on a list straight of the dev_t, and speclisth[SPECSZ] is unused. The sharing of struct specinfo means that the v_specnext moves into the vnode which grows by 4 bytes. Don't use a VBLK dev_t which doesn't make sense in MFS, now we hang a dummy cdevsw on B/Cmaj 253 so that things look sane. Storage overhead from all of this is O(50k). Bump __FreeBSD_version to 400009 The next step will add the stuff needed so device-drivers can start to hang things from struct specinfo
* [click] Now all dev_t's in the kernel have their char device major.phk1999-07-191-18/+6
| | | | | | | | | | Only know casualy of this is swapinfo/pstat which should be fixes the right way: Store the actual pathname in the kernel like mount does. [Volounteers sought for this task] The road map from here is roughly: expand struct specinfo into struct based dev_t. Add dev_t registration facilities for device drivers and start to use them.
* Use 256 as magic in bmaj2cmaj[]. Treat BLK/CHR dev_t more correctly.phk1999-07-171-6/+14
|
* I have not one single time remembered the name of this function correctlyphk1999-07-171-3/+3
| | | | so obviously I gave it the wrong name. s/umakedev/makeudev/g
* Remove cmaj and bmaj args from DEV_DRIVER_MODULE.phk1999-07-041-15/+1
|
* Warn about drivers which take over other drivers cdevsw entries, but stillphk1999-07-031-2/+12
| | | | grant them squatters right.
* * Call cdevsw_remove from the MOD_UNLOAD event.dfr1999-06-261-6/+5
| | | | * Fix a couple of warnings while I'm here.
* Add function cdevsw_remove, the opposite of cdevsw_add: remove angrog1999-06-251-1/+22
| | | | | | entry in cdevsw (and bdevsw if appropriate). Reviewed-by: phk
* || vs && confusion in cdevsw_add().dt1999-06-011-2/+2
|
* Introduce the makebdev() function, it does the same as the makedev()phk1999-06-011-1/+7
| | | | function for now, but that will change.
* Simplify cdevsw registration.phk1999-05-311-52/+46
| | | | | | | | | | | | | | | | | | | | | | | | | The cdevsw_add() function now finds the major number(s) in the struct cdevsw passed to it. cdevsw_add_generic() is no longer needed, cdevsw_add() does the same thing. cdevsw_add() will print an message if the d_maj field looks bogus. Remove nblkdev and nchrdev variables. Most places they were used bogusly. Instead check a dev_t for validity by seeing if devsw() or bdevsw() returns NULL. Move bdevsw() and devsw() functions to kern/kern_conf.c Bump __FreeBSD_version to 400006 This commit removes: 72 bogus makedev() calls 26 bogus SYSINIT functions if_xe.c bogusly accessed cdevsw[], author/maintainer please fix. I4b and vinum not changed. Patches emailed to authors. LINT probably broken until they catch up.
* Avoid negative numbers in dev_t manipulation. This should fix recent MFSluoqi1999-05-181-3/+3
| | | | related crashes.
* braino.phk1999-05-121-3/+3
|
* Produce compiler warning if dev_t and udev_t is confused.phk1999-05-121-6/+10
|
* Divorce "dev_t" from the "major|minor" bitmap, which is now calledphk1999-05-111-2/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | udev_t in the kernel but still called dev_t in userland. Provide functions to manipulate both types: major() umajor() minor() uminor() makedev() umakedev() dev2udev() udev2dev() For now they're functions, they will become in-line functions after one of the next two steps in this process. Return major/minor/makedev to macro-hood for userland. Register a name in cdevsw[] for the "filedescriptor" driver. In the kernel the udev_t appears in places where we have the major/minor number combination, (ie: a potential device: we may not have the driver nor the device), like in inodes, vattr, cdevsw registration and so on, whereas the dev_t appears where we carry around a reference to a actual device. In the future the cdevsw and the aliased-from vnode will be hung directly from the dev_t, along with up to two softc pointers for the device driver and a few houskeeping bits. This will essentially replace the current "alias" check code (same buck, bigger bang). A little stunt has been provided to try to catch places where the wrong type is being used (dev_t vs udev_t), if you see something not working, #undef DEVT_FASCIST in kern/kern_conf.c and see if it makes a difference. If it does, please try to track it down (many hands make light work) or at least try to reproduce it as simply as possible, and describe how to do that. Without DEVT_FASCIST I belive this patch is a no-op. Stylistic/posixoid comments about the userland view of the <sys/*.h> files welcome now, from userland they now contain the end result. Next planned step: make all dev_t's refer to the same devsw[] which means convert BLK's to CHR's at the perimeter of the vnodes and other places where they enter the game (bootdev, mknod, sysctl).
* Unconfuse DEV_MODULE() and DEV_DRIVER_MODULE() about the difference betweenphk1999-05-091-2/+11
| | | | a major number for a dev_t.
* Peter beat me to half this patch, but didn't do the other half:phk1999-05-091-4/+5
| | | | | | set d_bmaj don't cast a dev_t to int before comparing to NODEV
* Comment advising ordering of cdevsw_add and bdevsw_add is obsolete (nopeter1999-05-091-4/+1
| | | | bdevsw_add any more).
OpenPOWER on IntegriCloud