aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/snp
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-4/+4
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* Declare the snp ioctl()s to work on udev_t, since that is what theyThomas Moestl2002-11-111-1/+1
| | | | | | | | | | really do and dev_t is defined differently in kernel and userland. Return a correctly formed udev from SNPGTTY. Reviewed by: dd Notes: svn path=/head/; revision=106767
* Treat input on the snp device as an `unsigned char'. According to theDima Dorfman2002-04-101-1/+1
| | | | | | | | | | | submitter, this permits Russian (and probably other locales') characters to be entered via watch(8). PR: 35636 Submitted by: Gleb Smirnoff <glebius@rinet.ru> Notes: svn path=/head/; revision=94341
* Remove __P.Alfred Perlstein2002-03-201-7/+7
| | | | Notes: svn path=/head/; revision=92739
* Fixes to make select/poll mpsafe.Alfred Perlstein2002-03-141-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: selwakeup required calling pfind which would cause lock order reversals with the allproc_lock and the per-process filedesc lock. Solution: Instead of recording the pid of the select()'ing process into the selinfo structure, actually record a pointer to the thread. To avoid dereferencing a bad address all the selinfo structures that are in use by a thread are kept in a list hung off the thread (protected by sellock). When a selwakeup occurs the selinfo is removed from that threads list, it is also removed on the way out of select or poll where the thread will traverse its list removing all the selinfos from its own list. Problem: Previously the PROC_LOCK was used to provide the mutual exclusion needed to ensure proper locking, this couldn't work because there was a single condvar used for select and poll and condvars can only be used with a single mutex. Solution: Introduce a global mutex 'sellock' which is used to provide mutual exclusion when recording events to wait on as well as performing notification when an event occurs. Interesting note: schedlock is required to manipulate the per-thread TDF_SELECT flag, however if given its own field it would not need schedlock, also because TDF_SELECT is only manipulated under sellock one doesn't actually use schedlock for syncronization, only to protect against corruption. Proc locks are no longer used in select/poll. Portions contributed by: davidc Notes: svn path=/head/; revision=92252
* Make the diagnostics printfs less ugly.Dima Dorfman2002-03-111-4/+6
| | | | Notes: svn path=/head/; revision=92056
* Check the return value of tsleep() in snpread(). This may beDima Dorfman2001-11-241-1/+4
| | | | | | | | | | | important, since our sleep is interruptable (PCATCH flag). PR: 30985 Discovered by: Vladimir Jakovenko <vovik@lucky.net> Submitted by: Valentin Nechayev <netch@segfault.kiev.ua> Notes: svn path=/head/; revision=86861
* Return EBUSY if we try to attach to a tty that is already beingDima Dorfman2001-11-241-0/+2
| | | | | | | | | | | snooped on. This causes all kinds of Bad Things(tm) to happen since closing one session will clobber state that's needed for the other one. This could theoretically be supported if the code was careful, but until somebody implements that, preventing this will stop people from unknowingly shooting themselves in the foot. Notes: svn path=/head/; revision=86855
* Create a snpbasedev variable which holds a reference to the first snpDima Dorfman2001-11-241-3/+9
| | | | | | | | | | | | | | | | | | | device cloned, and assign all further devices to depend on it. This allows us to call dev_depends() on it at module unload time to get rid of /dev/snp* (in the devfs case, anyway). For this to work, we must not destroy the device at close time. [Idea stolen from if_tun.] The above has the following sideaffects: (a) The snp device used by watch(8) will remain after watch(8) exits. This is probably how it should have been all along, and how it was before devfs came along. (b) Module unload doesn't panic if there are any /dev/snp* devices which haven't been used (and thus previously destroyed). Thus, we can reenable the unload functionality disabled in rev. 1.65. PR: 32012 Notes: svn path=/head/; revision=86853
* 'error' is now unused, since its only purpose was to catch theRobert Watson2001-11-151-1/+0
| | | | | | | results of suser_td(). Notes: svn path=/head/; revision=86419
* Temporarily disable unloading, as it appears to be broken (read: causesRobert Watson2001-11-151-0/+2
| | | | | | | panics) Notes: svn path=/head/; revision=86417
* o Rely on /dev/snp* permissions, rather than using suser() in snpopen()Robert Watson2001-11-151-3/+0
| | | | | | | | | to prevent inappropriate use of the snoop device. This means that, with appropriate chmod'ing, arbitrary users may make use of the snoop device. Notes: svn path=/head/; revision=86413
* KSE Milestone 2Julian Elischer2001-09-121-11/+11
| | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=83366
* Don't allocate a 512 byte buffer on the stack in snplwrite. It'sDima Dorfman2001-08-161-5/+12
| | | | | | | | | | | probably harmless in this case, since the latter is called on tty input, which is usually a result of some system call, so we've got plenty of stack left. It's still nice to fix these things, though, in case somebody ever decides this driver is a good example of something (perhaps "what you probably shouldn't do"). Notes: svn path=/head/; revision=81747
* Move the kernel stuff out of snoop.h. It was only there because someDima Dorfman2001-07-251-0/+39
| | | | | | | | of the snp* functions needed to be called from tty.c, which is no longer the case. Notes: svn path=/head/; revision=80326
* Keep track of all "struct snoop"'s so that snp_modevent can fail withDima Dorfman2001-07-181-1/+9
| | | | | | | EBUSY if there's a device still open. Notes: svn path=/head/; revision=79864
* Add a line discipline close routine which restores some functionalityDima Dorfman2001-06-051-5/+21
| | | | | | | | I accidently nuked in rev. 1.54. Also rework the error handling in snplwrite a little. Notes: svn path=/head/; revision=77749
* Style and cosmetic cleanups. This driver is now reasonably stlye(9)Dima Dorfman2001-06-051-111/+127
| | | | | | | | | | | | compliant. All the variable definitions and function names are reasonably consistent, and the functions which should be static (i.e., all of them) are. Other assorted fixes were made. The majority of the delta is indentation fixes. Partially reviewed by: bde Notes: svn path=/head/; revision=77748
* Use the l_nullioctl exported from tty_conf.c rather than rolling our own.Dima Dorfman2001-06-041-10/+0
| | | | Notes: svn path=/head/; revision=77736
* Remove unused includes, use *min() inline functions rather than aDima Dorfman2001-06-031-26/+8
| | | | | | | | | | home-grown macro, rewrite a confusing conditional in snpdevtotty(), and change ibuf to 512 bytes instead of 1024 bytes in dsnwrite(). Reviewed by: bde Notes: svn path=/head/; revision=77648
* Convert this driver to (ab?)use line disciplines to get the input itDima Dorfman2001-05-221-17/+84
| | | | | | | | | | needs instead of relying on idiosyncratic hacks in the tty subsystem. Also add module code since this can now be compiled as a module. Silence by: -hackers, -audit Notes: svn path=/head/; revision=77016
* Make this driver play ball with devfs(5).Dima Dorfman2001-04-171-3/+19
| | | | | | | Reviewed by: brian Notes: svn path=/head/; revision=75633
* Send the remains (such as I have located) of "block major numbers" toPoul-Henning Kamp2001-03-261-1/+0
| | | | | | | the bit-bucket. Notes: svn path=/head/; revision=74810
* Remove unused #include "snp.h"Peter Wemm2001-01-291-1/+0
| | | | Notes: svn path=/head/; revision=71789
* Convert more malloc+bzero to malloc+M_ZERO.David Malone2000-12-081-2/+1
| | | | | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Notes: svn path=/head/; revision=69781
* Staticize some malloc M_ instances.Poul-Henning Kamp2000-12-081-1/+1
| | | | Notes: svn path=/head/; revision=69774
* Move suser() and suser_xxx() prototypes and a related #define fromPoul-Henning Kamp2000-10-291-1/+0
| | | | | | | | | | | | <sys/proc.h> to <sys/systm.h>. Correctly document the #includes needed in the manpage. Add one now needed #include of <sys/systm.h>. Remove the consequent 48 unused #includes of <sys/proc.h>. Notes: svn path=/head/; revision=67893
* Unstaticize this driver. You can have as many snoop devices as you canBrian Feldman2000-04-021-65/+61
| | | | | | | | | mknod :) Clean things up a lot while I'm here. A lot of KNF changes. Notes: svn path=/head/; revision=58908
* Remove cdevsw_add() - the make_dev() calls are already there.Peter Wemm1999-11-181-8/+1
| | | | | | | | Don't '#if NSNP > 0' around the thing as it's silly and not required. config(8) only causes it to be compiled if NSNP is > 0 by definition. Notes: svn path=/head/; revision=53335
* Remove five now unused fields from struct cdevsw. They should neverPoul-Henning Kamp1999-09-251-5/+0
| | | | | | | | | | | have been there in the first place. A GENERIC kernel shrinks almost 1k. Add a slightly different safetybelt under nostop for tty drivers. Add some missing FreeBSD tags Notes: svn path=/head/; revision=51658
* This patch clears the way for removing a number of tty relatedPoul-Henning Kamp1999-09-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | fields in struct cdevsw: d_stop moved to struct tty. d_reset already unused. d_devtotty linkage now provided by dev_t->si_tty. These fields will be removed from struct cdevsw together with d_params and d_maxio Real Soon Now. The changes in this patch consist of: initialize dev->si_tty in *_open() initialize tty->t_stop remove devtotty functions rename ttpoll to ttypoll a few adjustments to these changes in the generic code a bump of __FreeBSD_version add a couple of FreeBSD tags Notes: svn path=/head/; revision=51654
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Convert DEVFS hooks in (most) drivers to make_dev().Poul-Henning Kamp1999-08-231-24/+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(). Notes: svn path=/head/; revision=50254
* Add Id stringsGary Palmer1999-06-171-0/+2
| | | | Notes: svn path=/head/; revision=47989
* Fixed a missing userland dev_t to kernel dev_t conversion.Bruce Evans1999-06-171-1/+1
| | | | Notes: svn path=/head/; revision=47969
* Simplify cdevsw registration.Poul-Henning Kamp1999-05-311-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=47640
* This commit should be a extensive NO-OP:Poul-Henning Kamp1999-05-301-4/+21
| | | | | | | | | | | | | | | | Reformat and initialize correctly all "struct cdevsw". Initialize the d_maj and d_bmaj fields. The d_reset field was not removed, although it is never used. I used a program to do most of this, so all the files now use the same consistent format. Please keep it that way. Vinum and i4b not modified, patches emailed to respective authors. Notes: svn path=/head/; revision=47625
* Use NODEV instead of -1Poul-Henning Kamp1999-05-101-4/+4
| | | | Notes: svn path=/head/; revision=46920
* I got tired of seeing all the cdevsw[major(foo)] all over the place.Poul-Henning Kamp1999-05-081-1/+1
| | | | | | | | | | | Made a new (inline) function devsw(dev_t dev) and substituted it. Changed to the BDEV variant to this format as well: bdevsw(dev_t dev) DEVFS will eventually benefit from this change too. Notes: svn path=/head/; revision=46676
* Add sufficient braces to keep egcs happy about potentially ambiguousPeter Wemm1999-05-061-2/+2
| | | | | | | if/else nesting. Notes: svn path=/head/; revision=46568
* Suser() simplification:Poul-Henning Kamp1999-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=46112
* Fix warnings in preparation for adding -Wall -Wcast-qual to theMatthew Dillon1999-01-271-2/+2
| | | | | | | kernel compile Notes: svn path=/head/; revision=43301
* KNFize, by bde.Eivind Eklund1999-01-101-3/+2
| | | | Notes: svn path=/head/; revision=42453
* Split DIAGNOSTIC -> DIAGNOSTIC, INVARIANTS, and INVARIANT_SUPPORT asEivind Eklund1999-01-081-7/+4
| | | | | | | | | | | | discussed on -hackers. Introduce 'KASSERT(assertion, ("panic message", args))' for simple check + panic. Reviewed by: msmith Notes: svn path=/head/; revision=42408
* This commit fixes various 64bit portability problems required forDoug Rabson1998-06-071-1/+1
| | | | | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time. Notes: svn path=/head/; revision=36735
* Don't depend on "implicit int" or bloat the data section in theBruce Evans1998-02-201-1/+1
| | | | | | | declaration of xxx_devsw_installed. Notes: svn path=/head/; revision=33679
* Back out DIAGNOSTIC changes.Eivind Eklund1998-02-061-1/+0
| | | | Notes: svn path=/head/; revision=33134
* Turn DIAGNOSTIC into a new-style option.Eivind Eklund1998-02-041-0/+1
| | | | Notes: svn path=/head/; revision=33108
* Make all file-system (MFS, FFS, NFS, LFS, DEVFS) related option new-style.Eivind Eklund1998-01-241-0/+1
| | | | | | | | | | | This introduce an xxxFS_BOOT for each of the rootable filesystems. (Presently not required, but encouraged to allow a smooth move of option *FS to opt_dontuse.h later.) LFS is temporarily disabled, and will be re-enabled tomorrow. Notes: svn path=/head/; revision=32726
* Make COMPAT_43 and COMPAT_SUNOS new-style options.Eivind Eklund1997-12-161-0/+2
| | | | Notes: svn path=/head/; revision=31778