Commit Graph

316 Commits

Author SHA1 Message Date
Ruslan Ermilov
bfbdccc1d1 Sort. 2007-11-13 20:26:27 +00:00
Robert Watson
a1b36788c2 Hook up rmlock(9) and its links to the build. 2007-11-10 16:47:38 +00:00
Julian Elischer
39b920eb0c Doc police fixes
thanks to: ru@
2007-10-26 16:50:21 +00:00
Ruslan Ermilov
5d40d4a597 Sort MLINKS. 2007-10-26 11:01:17 +00:00
Alexander Leidinger
9f05d312b3 Backout sensors framework.
Requested by:	phk
Discussed on:	cvs-all
2007-10-15 20:00:24 +00:00
Alexander Leidinger
99f6b270e3 Import OpenBSD's sysctl hardware sensors framework.
This commit includes the following core components:

 * sample configuration file for sensorsd
 * rc(8) script and glue code for sensorsd(8)
 * sysctl(3) doc fixes for CTL_HW tree
 * sysctl(3) documentation for hardware sensors
 * sysctl(8) documentation for hardware sensors
 * support for the sensor structure for sysctl(8)
 * rc.conf(5) documentation for starting sensorsd(8)
 * sensor_attach(9) et al documentation
 * /sys/kern/kern_sensors.c
   o sensor_attach(9) API for drivers to register ksensors
   o sensor_task_register(9) API for the update task
   o sysctl(3) glue code
   o hw.sensors shadow tree for sysctl(8) internal magic
 * <sys/sensors.h>
 * HW_SENSORS definition for <sys/sysctl.h>
 * sensors display for systat(1), including documentation
 * sensorsd(8) and all applicable documentation

The userland part of the framework is entirely source-code
compatible with OpenBSD 4.1, 4.2 and  -current as of today.

All sensor readings can be viewed with `sysctl hw.sensors`,
monitored in semi-realtime with `systat -sensors` and also
logged with `sensorsd`.

Submitted by:	Constantine A. Murenin <cnst@FreeBSD.org>
Sponsored by:	Google Summer of Code 2007 (GSoC2007/cnst-sensors)
Mentored by:	syrinx
Tested by:	many
OKed by:	kensmith
Obtained from:	OpenBSD (parts)
2007-10-14 10:45:31 +00:00
Marius Strobl
2e01823535 Add an MLINKS for pci_find_dbsf.9.
Submitted by:	ru
Approved by:	re (gnn)
2007-10-05 22:50:44 +00:00
Robert Watson
bdec1ad988 Add MLINKS entries for various SYSCTL_*() macros documented in sysctl.9.
Approved by:	re (bmah)
Submitted by:	Constantine A. Murenin <cnst+freebsd@bugmail.mojo.ru>
Sponsored by:	Google Summer of Code 2007
2007-09-05 19:46:23 +00:00
John Baldwin
2b9573af36 Document sx_xholder(). 2007-05-19 20:24:32 +00:00
Andrew Thompson
b84a4e0cf2 Link the defunct MUTEX_PROFILING option to LOCK_PROFILING. 2007-05-13 22:56:58 +00:00
Maxim Konovalov
8ad9c32345 o Document vdropl(9) [1].
o Add an MLINK for vdropl().

Reviewed by:	des [1]
Obtained from:	wording from vgone(9)
2007-04-01 09:48:59 +00:00
John Baldwin
4e7f640dfb Optimize sx locks to use simple atomic operations for the common cases of
obtaining and releasing shared and exclusive locks.  The algorithms for
manipulating the lock cookie are very similar to that rwlocks.  This patch
also adds support for exclusive locks using the same algorithm as mutexes.

A new sx_init_flags() function has been added so that optional flags can be
specified to alter a given locks behavior.  The flags include SX_DUPOK,
SX_NOWITNESS, SX_NOPROFILE, and SX_QUITE which are all identical in nature
to the similar flags for mutexes.

Adaptive spinning on select locks may be enabled by enabling the
ADAPTIVE_SX kernel option.  Only locks initialized with the SX_ADAPTIVESPIN
flag via sx_init_flags() will adaptively spin.

The common cases for sx_slock(), sx_sunlock(), sx_xlock(), and sx_xunlock()
are now performed inline in non-debug kernels.  As a result, <sys/sx.h> now
requires <sys/lock.h> to be included prior to <sys/sx.h>.

The new kernel option SX_NOINLINE can be used to disable the aforementioned
inlining in non-debug kernels.

The size of struct sx has changed, so the kernel ABI is probably greatly
disturbed.

MFC after:	1 month
Submitted by:	attilio
Tested by:	kris, pjd
2007-03-31 23:23:42 +00:00
Julian Elischer
27c20cc4b8 Connect the locking man page to the build.
Next step is to add it as a "See Also" to related man pages.
2007-03-30 17:56:19 +00:00
Maxim Konovalov
1f43095400 o Trim unneeded backslash. 2007-03-28 04:43:55 +00:00
Maxim Konovalov
dd3c9f51e5 o Actually add MLINKs for priv(9) functions. 2007-03-28 04:41:50 +00:00
Christian Brueffer
09dfbddbda Add MLINKs for priv(9) functions. 2007-03-27 21:20:57 +00:00
John Baldwin
e7573e7ad7 Allow threads to atomically release rw and sx locks while waiting for an
event.  Locking primitives that support this (mtx, rw, and sx) now each
include their own foo_sleep() routine.
- Rename msleep() to _sleep() and change it's 'struct mtx' object to a
  'struct lock_object' pointer.  _sleep() uses the recently added
  lc_unlock() and lc_lock() function pointers for the lock class of the
  specified lock to release the lock while the thread is suspended.
- Add wrappers around _sleep() for mutexes (mtx_sleep()), rw locks
  (rw_sleep()), and sx locks (sx_sleep()).  msleep() still exists and
  is now identical to mtx_sleep(), but it is deprecated.
- Rename SLEEPQ_MSLEEP to SLEEPQ_SLEEP.
- Rewrite much of sleep.9 to not be msleep(9) centric.
- Flesh out the 'RETURN VALUES' section in sleep.9 and add an 'ERRORS'
  section.
- Add __nonnull(1) to _sleep() and msleep_spin() so that the compiler will
  warn if you try to pass a NULL wait channel.  The functions already have
  a KASSERT to that effect.
2007-03-09 22:41:01 +00:00
John Baldwin
e6b69890ed - Document cv_wait_unlock(9).
- Don't claim that the mutex is atomically reacquired when a cv_wait
  routine returns.  There's nothing atomic or magical about the lock
  reacquire.  The only magic is that we atomically drop the lock by
  placing the thread on the sleep queue before dropping the lock.
2007-03-09 16:59:27 +00:00
John Baldwin
cc61ffc3fb - Sort functions in the order that rwlock(9) and mutex(9) use.
- Markup sx_unlock() as a function rather than saying it is a macro.
  The macro part is an implementation detail, and all the other sx_*lock()
  functions are actually macros, too.
- Use the same style as rwlock(9) and mutex(9) to markup sx_assert() and
  SX_SYSINIT() with respect to headers and kernel options.
- Add a missing MLINK.
2007-03-09 16:52:26 +00:00
John Baldwin
7d3052bbc4 - Sort rwlock functions similar to the order in mutex(9).
- Add a missing MLINK.
2007-03-09 16:44:58 +00:00
Chad David
6c2478125a Add vfs_getopt.9 to the build, and add links for related functions. 2007-03-02 17:03:56 +00:00
Robert Watson
149b6b0b12 Add rw_wowned(9) symlink. 2007-02-26 19:09:36 +00:00
Ruslan Ermilov
066eef7a1d Remove the traces of vm_page_unmanage(). 2007-02-25 06:51:11 +00:00
John Baldwin
37e80fcac2 Add a new kernel sleep function pause(9). pause(9) is for places that
want an equivalent of DELAY(9) that sleeps instead of spins.  It accepts
a wmesg and a timeout and is not interrupted by signals.  It uses a private
wait channel that should never be woken up by wakeup(9) or wakeup_one(9).

Glanced at by:	phk
2007-02-23 16:22:09 +00:00
Pawel Jakub Dawidek
eb62f84553 VFS_VPTOFH(9) was replaced with VOP_VPTOFH(9).
VFS_VPTOFH.9 was repo-copied to VOP_VPTOFH.9.

Repo-copy done by:	joe
2007-02-16 14:27:59 +00:00
John Baldwin
f4ad756aef MLINK for bus_dmamap_load_mbuf_sg(9) 2007-02-12 17:53:21 +00:00
Robert Watson
806c2dc9bf Add MLINKS for sf_buf.9. 2007-01-29 11:27:44 +00:00
Robert Watson
5a05988c32 Add a rudimentary man page for sf_bufs, based on my rudimentary
understanding of sf_bufs.
2007-01-28 16:07:50 +00:00
Randall Stewart
b939bb368a Reviewed by: rwatson
Approved by:	gnn

Add a new function hashinit_flags() which allows NOT-waiting
for memory (or waiting). The old hashinit() function now
calls hashinit_flags(..., HASH_WAITOK);
2007-01-15 15:06:28 +00:00
Robert Watson
6a751174bd Add a basic man page for the socket(9) kernel programming interface used
by the NFS client and server, netsmb, netncp, etc.

Reviewed by:	ru
Fixed by:	ru
2006-12-15 23:35:15 +00:00
Warner Losh
f0bab87823 devsw() was removed by phk:
revision 1.199
	date: 2004/09/24 08:30:57;  author: phk;  state: Exp;  lines: +0 -1
	Remove the cdevsw() function which is now unused.

(the log is wrong, it was really devsw that was removed).

# we really need to actually document the functions in sys/conf.h as well
# as things like d_open...
2006-11-25 22:36:09 +00:00
Ceri Davies
9bda7d940b Add manuals for cr_cansee(9) and p_cansee(9).
Thanks to Ruslan for the time he spent reviewing these.

Reviewed by:	ru
Approved by:	ru
2006-11-19 13:35:03 +00:00
Ruslan Ermilov
cd852a2996 Fix build (forgotten MUTEX_PROFILING.9 -> LOCK_PROFILING.9). 2006-11-11 08:59:34 +00:00
Robert Watson
800c940832 Add a new priv(9) kernel interface for checking the availability of
privilege for threads and credentials.  Unlike the existing suser(9)
interface, priv(9) exposes a named privilege identifier to the privilege
checking code, allowing more complex policies regarding the granting of
privilege to be expressed.  Two interfaces are provided, replacing the
existing suser(9) interface:

suser(td)                 ->   priv_check(td, priv)
suser_cred(cred, flags)   ->   priv_check_cred(cred, priv, flags)

A comprehensive list of currently available kernel privileges may be
found in priv.h.  New privileges are easily added as required, but the
comments on adding privileges found in priv.h and priv(9) should be read
before doing so.

The new privilege interface exposed sufficient information to the
privilege checking routine that it will now be possible for jail to
determine whether a particular privilege is granted in the check routine,
rather than relying on hints from the calling context via the
SUSER_ALLOWJAIL flag.  For now, the flag is maintained, but a new jail
check function, prison_priv_check(), is exposed from kern_jail.c and used
by the privilege check routine to determine if the privilege is permitted
in jail.  As a result, a centralized list of privileges permitted in jail
is now present in kern_jail.c.

The MAC Framework is now also able to instrument privilege checks, both
to deny privileges otherwise granted (mac_priv_check()), and to grant
privileges otherwise denied (mac_priv_grant()), permitting MAC Policy
modules to implement privilege models, as well as control a much broader
range of system behavior in order to constrain processes running with
root privilege.

The suser() and suser_cred() functions remain implemented, now in terms
of priv_check() and the PRIV_ROOT privilege, for use during the transition
and possibly continuing use by third party kernel modules that have not
been updated.  The PRIV_DRIVER privilege exists to allow device drivers to
check privilege without adopting a more specific privilege identifier.

This change does not modify the actual security policy, rather, it
modifies the interface for privilege checks so changes to the security
policy become more feasible.

Sponsored by:		nCircle Network Security, Inc.
Obtained from:		TrustedBSD Project
Discussed on:		arch@
Reviewed (at least in part) by:	mlaier, jmg, pjd, bde, ceri,
			Alex Lyashkov <umka at sevcity dot net>,
			Skip Ford <skip dot ford at verizon dot net>,
			Antoine Brodin <antoine dot brodin at laposte dot net>
2006-11-06 13:37:19 +00:00
Ruslan Ermilov
72377e4c4b Sort MAN and MLINKS lists. 2006-10-05 12:40:44 +00:00
John-Mark Gurney
32d5d9ffc9 sort MLINKS properly
Pointed out by:	ru
2006-10-05 08:55:35 +00:00
John-Mark Gurney
90db62aca6 add man page talking about how to interface w/ the kqueue system so others
can write additional filters...

mdoc police please!
2006-10-04 20:16:23 +00:00
Andre Oppermann
b2c1b09193 Connect hash(9) to the build and add MLINKS for all functions.
Pointed out by:	ru
2006-10-02 11:51:25 +00:00
Warner Losh
fa81ece897 Document config_intrhook.
MFC After: 250 millifortnights
2006-09-25 20:12:13 +00:00
Maxim Konovalov
533baf579b o Sort sx(9) MLINKS. 2006-07-12 19:12:16 +00:00
Pawel Jakub Dawidek
d8e7058159 Document sx_xlocked(9).
Submitted by:	ssouhlal
2006-07-12 15:40:35 +00:00
Warner Losh
9f14302d3c Add a stub man page for device_get_sysctl{_ctx,tree}. Needs some
work, but is better than nothing.  Any help appreciated.
2006-05-23 22:11:20 +00:00
Robert Watson
dba9e9ccbf Add a basic man page for the sysctl(9) macro interfaces. Previously man
pages existed only for the dynamic sysctl interfaces.  There's probably
more complete and accurate content, better advice, etc, that could be added
here.

Per scottl's suggest, add a small piece of moralizing text regarding the
fact that sysctl names quickly get embedded in system configuration files,
libraries, third party applications, and even books, so renaming and
removing names after they've been published is a tricky issue.

MFC after:	1 month
2006-04-28 10:45:27 +00:00
John-Mark Gurney
af3b868186 document the various bus_space_*_stream_? functions... 2006-04-22 03:58:41 +00:00
John Baldwin
c1ffaf8c9a Add MLINKS for rwlock(9). 2006-04-19 21:09:39 +00:00
John-Mark Gurney
18f1afb9f4 add links for the functions documented in bus_space.9... 2006-04-04 22:56:08 +00:00
Gleb Smirnoff
3182fc7b3e Document read/write locks.
Reviewed by:	jhb, ru
2006-02-01 19:39:25 +00:00
Pawel Jakub Dawidek
847a2a1716 Add buffer corruption protection (RedZone) for kernel's malloc(9).
It detects both: buffer underflows and buffer overflows bugs at runtime
(on free(9) and realloc(9)) and prints backtraces from where memory was
allocated and from where it was freed.

Tested by:	kris
2006-01-31 11:09:21 +00:00
Max Laier
6aec1278dc firmware(9) is a subsystem to load binary data into the kernel via a
specially crafted module.  There are several handrolled sollutions to this
problem in the tree already which will be replaced with this.  They include
iwi(4), ipw(4), ispfw(4) and digi(4).

No objection from:	arch
MFC after:		2 weeks
X-MFC after:		some drivers have been converted
2006-01-29 02:52:42 +00:00
John Baldwin
61d963bc57 - Don't list sleep() in the NAME section as we haven't had a sleep()
function in years.
- Change the 'ident' paramters to 'wchan' to match <sys/systm.h>.
- Use 'otherwise' in place of 'else' in one place so that this reads like
  English rather than C.
- Document the new msleep_spin() function.
- Add history notes for msleep() and msleep_spin().
2006-01-03 17:00:38 +00:00