summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_log.c
Commit message (Collapse)AuthorAgeFilesLines
* Add kqueue support to /dev/klog.kib2012-02-011-0/+48
| | | | | | Submitted by: Mateusz Guzik <mjguzik gmail com> PR: kern/156423 MFC after: 1 weeks
* Finish r210923, 210926. Mark some devices as eternal.kib2011-01-041-1/+2
| | | | MFC after: 2 weeks
* Make /dev/klog and kern.msgbuf* MPSAFE.ed2009-11-031-32/+41
| | | | | | | | | | | | | | Normally msgbufp is locked using Giant. Switch it to use the msgbuf_lock. Instead of changing the tsleep() calls to msleep(), just convert it to condvar(9). In my opinion the locking around msgbuf_peekbytes() still remains questionable. It looks like locks are dropped while performing copies of multiple blocks to userspace, which may cause the msgbuf to be reset in the mean time. At least getting it underneath from Giant should make it a little easier for us to figure out how to solve that. Reminded by: rdivacky
* In keeping with style(9)'s recommendations on macros, use a ';'rwatson2008-03-161-1/+1
| | | | | | | | | after each SYSINIT() macro invocation. This makes a number of lightweight C parsers much happier with the FreeBSD kernel source, including cflow's prcc and lxr. MFC after: 1 month Discussed with: imp, rink
* Use dynamic major number allocation.phk2005-02-271-3/+1
|
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-5/+5
| | | | Bump __FreeBSD_version accordingly.
* Remove advertising clause from University of California Regent's license,imp2004-04-051-4/+0
| | | | | | per letter dated July 22, 1999. Approved by: core
* Device megapatch 4/6:phk2004-02-211-0/+2
| | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
* - Implement selwakeuppri() which allows raising the priority of atanimura2003-11-091-1/+1
| | | | | | | | | | | | | thread being waken up. The thread waken up can run at a priority as high as after tsleep(). - Replace selwakeup()s with selwakeuppri()s and pass appropriate priorities. - Add cv_broadcastpri() which raises the priority of the broadcast threads. Used by selwakeuppri() if collision occurs. Not objected in: -arch, -current
* Replace the code for reading and writing the kernel message bufferiedowse2003-06-221-18/+7
| | | | | | | | | | | | | | | | | with a new implementation that has a mostly reentrant "addchar" routine, supports multiple message buffers in the kernel, and hides the implementation details from callers. The new code uses a kind of sequence number to represend the current read and write positions in the buffer. This approach (suggested mainly by bde) permits the read and write pointers to be maintained separately, which reduces the number of atomic operations that are required. The "mostly reentrant" above refers to the way that while it is now always safe to have any number of concurrent writers, readers could see the message buffer after a writer has advanced the pointers but before it has witten the new character. Discussed on: freebsd-arch
* Fix a divide-by-zero on kern.log_wakeups_per_second tunable.bmilekic2003-06-201-0/+8
| | | | | Submitted by: Christian S.J. Peron <maneo@bsdpro.com> PR: kern/53557
* Use __FBSDID().obrien2003-06-111-1/+3
|
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-031-13/+7
| | | | | | | | | | | | | 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)
* More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9).des2003-03-021-1/+1
|
* uiomove-related caddr_t -> void * (just the low-hanging fruit)des2003-03-021-1/+1
|
* Make the msg_size, msg_bufx and msg_bufr memebers of struct msgbuftmm2002-11-141-9/+6
| | | | | | | | | | | signed, since they describe a ring buffer and signed arithmetic is performed on them. This avoids some evilish casts. Since this changes all but two members of this structure, style(9) those remaining ones, too. Requested by: bde Reviewed by: bde (earlier version)
* Fix the calculations of the length of the unread message buffertmm2002-10-201-2/+2
| | | | | | | | | | contents. The code was subtracting two unsigned ints, stored the result in a log and expected it to be the same as of a signed subtraction; this does only work on platforms where int and long have the same size (due to overflows). Instead, cast to long before the subtraction; the numbers are guaranteed to be small enough so that there will be no overflows because of that.
* In an SMP environment post-Giant it is no longer safe to blindlytruckman2002-10-031-2/+2
| | | | | | | | | dereference the struct sigio pointer without any locking. Change fgetown() to take a reference to the pointer instead of a copy of the pointer and call SIGIO_LOCK() before copying the pointer and dereferencing it. Reviewed by: rwatson
* more caddr_t removal.alfred2002-06-291-2/+1
|
* Make funsetown() take a 'struct sigio **' so that the locking canalfred2002-05-061-1/+1
| | | | | | | | | | | | | | | | be done internally. Ensure that no one can fsetown() to a dying process/pgrp. We need to check the process for P_WEXIT to see if it's exiting. Process groups are already safe because there is no such thing as a pgrp zombie, therefore the proctree lock completely protects the pgrp from having sigio structures associated with it after it runs funsetownlst. Add sigio lock to witness list under proctree and allproc, but over proc and pgrp. Seigo Tanimura helped with this.
* Redo the sigio locking.alfred2002-05-011-1/+1
| | | | | | | | | | | Turn the sigio sx into a mutex. Sigio lock is really only needed to protect interrupts from dereferencing the sigio pointer in an object when the sigio itself is being destroyed. In order to do this in the most unintrusive manner change pgsigio's sigio * argument into a **, that way we can lock internally to the function.
* Use the passed in thread to selrecord() instead of curthread.jhb2001-09-211-1/+1
|
* KSE Milestone 2julian2001-09-121-6/+6
| | | | | | | | | | | | | | 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
* syslogd gets kernel log messages only once every 30 seconds orphk2001-05-231-4/+7
| | | | | | | | | | | at the top of the minute, whichever comes first. It seems logtimeout() is only called once after the kernel log is opened and then never again after that. So I guess syslogd only gets kernel log messages by virtue of syncer(4)'s flushes ...? PR: 27361 Submitted by: pkern@utcc.utoronto.ca MFC after: 1 week
* Send the remains (such as I have located) of "block major numbers" tophk2001-03-261-1/+0
| | | | the bit-bucket.
* Replace logwakeup() with "int msgbuftrigger". There is littlephk2000-12-201-12/+2
| | | | | | | | | | | point in calling a function just to set a flag. Keep better track of the syslog FAC/PRI code and try to DTRT if they mingle. Log all writes to /dev/console to syslog with <console.info> priority. The formatting is not preserved, there is no robust, way of doing it. (Ideas with patches welcome).
* Delay waking up processes select'ing on the log device directly fromjhb2000-12-151-0/+29
| | | | | | | | | | the kernel console. Instead, change logwakeup() to set a flag in the softc. A callout then wakes up every so often and wakes up any processes selecting on /dev/log (such as syslogd) if the flag is set. By default this callout fires 5 times a second, but that can be adjusted by the sysctl kern.log_wakeups_per_second. Reviewed by: phk
* Kill some bogus "register" keywords.phk2000-12-081-31/+11
| | | | Go Ansi on the functions.
* Remove five now unused fields from struct cdevsw. They should neverphk1999-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
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Convert DEVFS hooks in (most) drivers to make_dev().phk1999-08-231-20/+3
| | | | | | | | | | | | | | | | 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().
* Simplify cdevsw registration.phk1999-05-311-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* This commit should be a extensive NO-OP:phk1999-05-301-5/+22
| | | | | | | | | | | | | 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.
* Add sufficient braces to keep egcs happy about potentially ambiguouspeter1999-05-061-3/+3
| | | | if/else nesting.
* The "easy" fixes for compiling the kernel -Wunused: remove unreferenced staticarchie1998-12-071-3/+1
| | | | and local variables, goto labels, and functions declared but not defined.
* I got another batch of suggestions for cosmetic changes from bde.truckman1998-11-111-2/+2
|
* Installed the second patch attached to kern/7899 with some changes suggestedtruckman1998-11-111-12/+18
| | | | | | | | | | | | | | | | by bde, a few other tweaks to get the patch to apply cleanly again and some improvements to the comments. This change closes some fairly minor security holes associated with F_SETOWN, fixes a few bugs, and removes some limitations that F_SETOWN had on tty devices. For more details, see the description on the PR. Because this patch increases the size of the proc and pgrp structures, it is necessary to re-install the includes and recompile libkvm, the vinum lkm, fstat, gcore, gdb, ipfilter, ps, top, and w. PR: kern/7899 Reviewed by: bde, elvind
* This commit fixes various 64bit portability problems required fordfr1998-06-071-2/+2
| | | | | | | | | | 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.
* Some cleanups related to timecounters and weird ifdefs in <sys/time.h>.phk1998-05-281-4/+1
| | | | | | | | | | | | | | | | | | | | Clean up (or if antipodic: down) some of the msgbuf stuff. Use an inline function rather than a macro for timecounter delta. Maintain process "on-cpu" time as 64 bits of microseconds to avoid needless second rollover overhead. Avoid calling microuptime the second time in mi_switch() if we do not pass through _idle in cpu_switch() This should reduce our context-switch overhead a bit, in particular on pre-P5 and SMP systems. WARNING: Programs which muck about with struct proc in userland will have to be fixed. Reviewed, but found imperfect by: bde
* Make the size of the msgbuf (dmesg) a "normal" option.phk1998-05-191-6/+7
|
* Don't depend on "implicit int" or bloat the data section in thebde1998-02-201-2/+2
| | | | declaration of xxx_devsw_installed.
* Make all file-system (MFS, FFS, NFS, LFS, DEVFS) related option new-style.eivind1998-01-241-1/+3
| | | | | | | | 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.
* Removed unused #includes.bde1997-10-281-2/+1
|
* Fixed gratuitous ANSIisms.bde1997-09-161-2/+4
|
* Extend select hook to support pollpeter1997-09-141-16/+16
|
* Don't include <sys/ioctl.h> in the kernel. Stage 4: includebde1997-03-241-2/+3
| | | | | | | | <sys/ttycom.h> and sometimes <sys/filio.h> instead of <sys/ioctl.h> in miscellaneous files. Most of these files have nothing to do with ttys but need to include <sys/ttycom.h> to get the definitions of TIOC[SG]PGRP which are (ab)used to convert F[SG]ETOWN fcntls into ioctls.
* Don't #include <sys/fcntl.h> in <sys/file.h> if KERNEL is defined.bde1997-03-231-2/+2
| | | | | Fixed everything that depended on getting fcntl.h stuff from the wrong place. Most things don't depend on file.h stuff at all.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
OpenPOWER on IntegriCloud