summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2007-04-27 10:06:57 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2007-04-27 10:06:57 +0000
commit0cf9d988c4916ba3299a05e1f4f8fb46b8f2c7ff (patch)
tree57ee67e7493ba29e27034efd4262285dc77d77aa
parentdf62569440b4fe03a14dd1fa4f2df90a424af1c8 (diff)
Document atomic_{set,clear}bits_int.
-rw-r--r--share/man/man9/Makefile6
-rw-r--r--share/man/man9/atomic.964
2 files changed, 68 insertions, 2 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index c800f0a1e58..aac494fec10 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -1,9 +1,10 @@
-# $OpenBSD: Makefile,v 1.122 2007/02/18 20:47:16 mk Exp $
+# $OpenBSD: Makefile,v 1.123 2007/04/27 10:06:56 art Exp $
# $NetBSD: Makefile,v 1.4 1996/01/09 03:23:01 thorpej Exp $
# Makefile for section 9 (kernel function and variable) manual pages.
-MAN= altq.9 aml_evalnode.9 audio.9 autoconf.9 bio_register.9 boot.9 \
+MAN= altq.9 aml_evalnode.9 atomic.9 audio.9 autoconf.9 bio_register.9 \
+ boot.9 \
buffercache.9 bus_dma.9 bus_space.9 copy.9 crypto.9 ctxsw.9 delay.9 \
disk.9 disklabel.9 dohooks.9 dopowerhooks.9 \
domountroothooks.9 doshutdownhooks.9 dostartuphooks.9 \
@@ -31,6 +32,7 @@ MAN= altq.9 aml_evalnode.9 audio.9 autoconf.9 bio_register.9 boot.9 \
MLINKS+=aml_evalnode.9 aml_evalname.9 aml_evalnode.9 aml_find_node.9 \
aml_evalnode.9 aml_freevalue.9 aml_evalnode.9 aml_val2int.9
+MLINKS+=atomic.9 atomic_setbits_int.9 atomic.9 atomic_clearbits_int.9
MLINKS+=autoconf.9 config_init.9 autoconf.9 config_search.9 \
autoconf.9 config_rootsearch.9 autoconf.9 config_found_sm.9 \
autoconf.9 config_found.9 autoconf.9 config_rootfound.9 \
diff --git a/share/man/man9/atomic.9 b/share/man/man9/atomic.9
new file mode 100644
index 00000000000..3b071e1bdcd
--- /dev/null
+++ b/share/man/man9/atomic.9
@@ -0,0 +1,64 @@
+.\" $OpenBSD: atomic.9,v 1.1 2007/04/27 10:06:56 art Exp $
+.\"
+.\" Copyright (c) 2007 Artur Grabowski <art@openbsd.org>
+.\" All rights reserved.
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd April 27, 2007
+.Dt ATOMIC 9
+.Os
+.Sh NAME
+.Nm atomic ,
+.Nm atomic_setbits_int ,
+.Nm atomic_clearbits_int ,
+.Nd interface to perform atomic operations on data
+.Sh SYNOPSIS
+.Fd #include <machine/atomic.h>
+.Ft void
+.Fn atomic_setbits_int "unsigned int *p" "unsigned int b"
+.Ft void
+.Fn atomic_clearbits_int "unsigned int *p" "unsigned int b"
+.Sh DESCRIPTION
+The
+.Nm
+set of functions provide an interface for changing data atomically with
+respect to interrupts and multiple processors in the system.
+.Pp
+The
+.Fn atomic_setbits_int
+function sets the bits in
+.Fa b
+in the integer pointed to by
+.Fa p .
+It is equivalent to
+.Bd -literal -offset indent
+*p |= b;
+.Ed
+.Pp
+The
+.Fn atomic_clearbits_int
+function clears the bits in
+.Fa b
+in the integer pointed to by
+.Fa p .
+It is equivalent to
+.Bd -literal -offset indent
+*p &= ~b;
+.Ed
+.Pp
+.Sh HISTORY
+The
+.Nm
+functions first appeared in
+.Ox 4.0 .