summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2014-02-13 12:38:21 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2014-02-13 12:38:21 +0000
commitac739619b775cf38de134d2ed65b71512ec69d0a (patch)
tree0438d96e63ba96a85f8fbcfcde7795be977b92a0
parentda58fdf24974f9945ef8f41aee78469bddf27bb0 (diff)
document the timeout_add and timeout_del return values in the RETURN VALUES
section. im not sure what to do with the macros yet.
-rw-r--r--share/man/man9/bemtoh32.9143
-rw-r--r--share/man/man9/timeout.926
2 files changed, 162 insertions, 7 deletions
diff --git a/share/man/man9/bemtoh32.9 b/share/man/man9/bemtoh32.9
new file mode 100644
index 00000000000..b450dbdb73c
--- /dev/null
+++ b/share/man/man9/bemtoh32.9
@@ -0,0 +1,143 @@
+.\" $OpenBSD: bemtoh32.9,v 1.1 2014/02/13 12:38:20 dlg Exp $
+.\"
+.\" Copyright (c) 2014 David Gwynne <dlg@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 $Mdocdate: February 13 2014 $
+.Dt BEMTOH32 9
+.Os
+.Sh NAME
+.Nm bemtoh16 ,
+.Nm bemtoh32 ,
+.Nm bemtoh64 ,
+.Nm lemtoh16 ,
+.Nm lemtoh32 ,
+.Nm lemtoh64 ,
+.Nm htobem16 ,
+.Nm htobem32 ,
+.Nm htobem64 ,
+.Nm htobem16 ,
+.Nm htobem32 ,
+.Nm htobem64
+.Nd byte swapping memory load and store operations
+.Sh SYNOPSIS
+.In sys/types.h
+.Ft uint16_t
+.Fn bemtoh16 "uint16_t *m"
+.Ft uint32_t
+.Fn bemtoh32 "uint32_t *m"
+.Ft uint64_t
+.Fn bemtoh64 "uint64_t *m"
+.Ft uint16_t
+.Fn lemtoh16 "uint16_t *m"
+.Ft uint32_t
+.Fn lemtoh32 "uint32_t *m"
+.Ft uint64_t
+.Fn lemtoh64 "uint64_t *m"
+.Ft void
+.Fn htobem16 "uint16_t *m, uint16_t v"
+.Ft void
+.Fn htobem32 "uint32_t *m, uint32_t v"
+.Ft void
+.Fn htobem64 "uint64_t *m, uint64_t v"
+.Ft void
+.Fn htolem16 "uint16_t *m, uint16_t v"
+.Ft void
+.Fn htolem32 "uint32_t *m, uint32_t v"
+.Ft void
+.Fn htolem64 "uint64_t *m, uint64_t v"
+.Sh DESCRIPTION
+This API provides a way to take advantage of an architectures ability
+to load and store words in memory of different endians.
+If an architecture has no specialised support for these operations
+they will be implemented as a wrapper around the
+.Xr byteorder 3
+API.
+.Pp
+These operations are subject to the same alignment restrictions as
+the hosts normal memory loads and stores.
+.Pp
+.Fn bemtoh16 ,
+.Fn bemtoh32 ,
+and
+.Fn bemtoh64
+read a big endian value from the memory located at
+.Fa m
+into the hosts native byte order.
+.Fn lemtoh16 ,
+.Fn lemtoh32 ,
+and
+.Fn lemtoh64
+read a little endian value from the memory located at
+.Fa m
+into the hosts native byte order.
+.Pp
+.Fn htobem16 ,
+.Fn htobem32 ,
+and
+.Fn htobem64
+store the hosts native byte ordered value of
+.Fa v
+as a big endian value in the memory located at
+.Fa m .
+.Fn htolem16 ,
+.Fn htolem32 ,
+and
+.Fn htolem64
+store the hosts native byte ordered value of
+.Fa v
+as a little endian value in the memory located at
+.Fa m .
+.Sh CONTEXT
+.Fn bemtoh16 ,
+.Fn bemtoh32 ,
+.Fn bemtoh64 ,
+.Fn lemtoh16 ,
+.Fn lemtoh32 ,
+.Fn lemtoh64 ,
+.Fn htobem16 ,
+.Fn htobem32 ,
+.Fn htobem64 ,
+.Fn htolem16 ,
+.Fn htolem32 ,
+and
+.Fn htolem64
+can all be called during autoconf, from process context, or from interrupt
+context.
+.Sh RETURN VALUES
+.Fn bemtoh16 ,
+.Fn bemtoh32 ,
+.Fn bemtoh64 ,
+.Fn lemtoh16 ,
+.Fn lemtoh32 ,
+and
+.Fn lemtoh64
+return the hosts native byte ordered value of the memory at
+.Fa m
+after the appropriate byteswapping has occurred.
+.Pp
+.Fn htobem16 ,
+.Fn htobem32 ,
+.Fn htobem64 ,
+.Fn htolem16 ,
+.Fn htolem32 ,
+and
+.Fn htolem64
+do not return a value.
+.Sh SEE ALSO
+.Xr byteorder 3
+.Sh HISTORY
+These functions first appeared in
+.Ox 5.6 .
diff --git a/share/man/man9/timeout.9 b/share/man/man9/timeout.9
index f32c0149c56..160c910f2f2 100644
--- a/share/man/man9/timeout.9
+++ b/share/man/man9/timeout.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: timeout.9,v 1.34 2014/02/13 12:32:49 dlg Exp $
+.\" $OpenBSD: timeout.9,v 1.35 2014/02/13 12:38:20 dlg Exp $
.\"
.\" Copyright (c) 2000 Artur Grabowski <art@openbsd.org>
.\" All rights reserved.
@@ -131,9 +131,6 @@ and may not be used in calls to
.Fn timeout_set
until it has timed out or been removed with
.Fn timeout_del .
-If the timeout was not already scheduled by a previous call to
-.Fn timeout_add
-it will return 1, otherwise 0.
If the timeout in the
.Fa to
argument is already scheduled, the old execution time will be
@@ -145,9 +142,6 @@ will cancel the timeout in the argument
.Fa to .
If the timeout has already executed or has never been added
the call will have no effect.
-If the timeout was actually removed by
-.Fn timeout_del
-it will return 1, otherwise 0.
.Pp
The
.Fn timeout_pending
@@ -197,6 +191,24 @@ can be called during autoconf, from process context, or from interrupt context.
.Fn timeout_triggered
can be called during autoconf, from process context, or from any interrupt context at or below
.Dv IPL_CLOCK .
+.Sh RETURN VALUES
+.Fn timeout_add ,
+.Fn timeout_add_sec ,
+.Fn timeout_add_msec ,
+.Fn timeout_add_nsec ,
+.Fn timeout_add_usec ,
+.Fn timeout_add_tv ,
+.Fn timeout_add_ts ,
+and
+.Fn timeout_add_bt
+will return 1 if the timeout
+.Fa to
+was added to the timeout schedule or 0 if it was already queued.
+.Pp
+.Fn timeout_del
+will return 1 if the timeout
+.Fa to
+was removed from the pending timeout schedule or 0 if it was not currently queued.
.Sh CODE REFERENCES
These functions are implemented in the file
.Pa sys/kern/kern_timeout.c .