Commit Graph

27 Commits

Author SHA1 Message Date
jmcneill
56614eff97 In bdev_strategy, return ENXIO instead of panicing if the block device has
disappeared. ok pooka@
2009-09-03 11:42:21 +00:00
yamt
f97310f398 whitespace fixes. no functional changes. 2009-08-18 02:43:49 +00:00
haad
07b62696b9 Add support for loading pseudo-device drivers. Try to autoload modules from
specs_open routine. If devsw_open fail, get driver name with devsw_getname
routine and autoload module.

For now only dm drivervcan be loaded, other pseudo drivers needs more work.

Ok by ad@.
2009-02-02 14:00:27 +00:00
enami
ad526ef003 - An errno is missed in rev. 1.11 while converting return statement to
goto statement.
- A local variable still in use is intercepted in rev. 1.6.  Define and
  use variable of its own.
2009-02-02 11:19:29 +00:00
drochner
d767912be3 Change major()/minor() to return 32-bit types again, called
devmajor_t/devminor_t, as proposed on tech-kern.
This avoids 64-bit arithmetics and 64-bit printf formats in parts
of the kernel where it is not really useful, and helps clarity.
2009-01-20 18:20:47 +00:00
pooka
8583cae233 Rename specfs_lock as device_lock and move it from specfs to devsw.
Relaxes kernel dependency on vfs.
2008-12-29 17:41:18 +00:00
ad
5ab3329550 Correct previous. 2008-06-08 12:23:18 +00:00
ad
7304342b50 cdev_tty: don't acquire kernel lock, as we may need to call this with
tty_lock already held (and it would reverse the usual lock order).
2008-06-08 12:22:39 +00:00
ad
736a4d9b78 Kill devsw_lock and just use specfs_lock. The two would need merging
in order to prevent unload of modules when a device that they provide
is still open.
2008-05-31 21:34:42 +00:00
ad
b0f6f924e3 Give devsw_detach() a dummy error return. 2008-05-19 17:15:00 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
ad
d49b125626 When accessing a block/char device, cache the D_MPSAFE flag on initial
access, in case the devsw record is modified.
2008-04-06 17:27:39 +00:00
plunky
606c30fdca add devsw_name2chr() function to look up character devices 2008-03-21 19:32:07 +00:00
matt
88f1e662d1 #include <sys/cpu.h> for curlwp 2008-02-13 18:43:16 +00:00
pooka
e0122367ec Don't pass devname to {b,c}devsw_attach(), it's not used. 2007-11-20 14:47:14 +00:00
ad
d18c6ca4de Merge from vmlocking:
- pool_cache changes.
- Debugger/procfs locking fixes.
- Other minor changes.
2007-11-07 00:23:13 +00:00
ad
d50d28b794 Merge from vmlocking: in cdev_tty() check d_tty != NULL. 2007-10-08 16:54:09 +00:00
ad
88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
yamt
1a7bc55dcc remove some __unused from function parameters. 2006-11-01 10:17:58 +00:00
christos
4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
lukem
09b3191490 add missing __KERNEL_RCSID() 2003-07-14 14:59:01 +00:00
itojun
f265a4a4da use strlcpy. [fixed off-by-one in subr_prop.c] 2003-05-16 14:25:02 +00:00
mrg
bf26b4d9e4 in devsw_name2blk(), as we use strncmp(), make sure the next character
in the device is either nul or a digit.  this avoids "raid0" being
matched as the "ra" device (and thus failing to find anything at all
causing my raid0 root to fail) on my vax.
2003-02-01 11:12:35 +00:00
tsutsui
a4c0983618 Fix devsw_name2blk() to return the correct device name for devname arg.
Ok'ed by gehenna.
2002-09-15 14:29:01 +00:00
gehenna
fcba53f1a9 fix that no major numbers is assigned dynamically if the
not-listed-in-majors device switch is loaded.
2002-09-11 16:33:03 +00:00
gehenna
77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +00:00