Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Briefly document the bintime_add() family of static inline f...



details:   https://anonhg.NetBSD.org/src/rev/ff280e8be969
branches:  trunk
changeset: 755509:ff280e8be969
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Tue Jun 08 05:40:26 2010 +0000

description:
Briefly document the bintime_add() family of static inline functions.

diffstat:

 distrib/sets/lists/comp/mi   |   23 +++++++++-
 share/man/man9/Makefile      |   10 +++-
 share/man/man9/bintime_add.3 |  101 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 131 insertions(+), 3 deletions(-)

diffs (206 lines):

diff -r 71a7413692b1 -r ff280e8be969 distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi        Tue Jun 08 05:38:32 2010 +0000
+++ b/distrib/sets/lists/comp/mi        Tue Jun 08 05:40:26 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mi,v 1.1458 2010/06/07 07:26:20 jruoho Exp $
+#      $NetBSD: mi,v 1.1459 2010/06/08 05:40:26 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -8720,6 +8720,11 @@
 ./usr/share/man/cat9/be64enc.0                 comp-sys-catman         .cat
 ./usr/share/man/cat9/be64toh.0                 comp-sys-catman         .cat
 ./usr/share/man/cat9/bintime.0                 comp-sys-catman         .cat
+./usr/share/man/cat9/bintime_add.0             comp-sys-catman         .cat
+./usr/share/man/cat9/bintime_addx.0            comp-sys-catman         .cat
+./usr/share/man/cat9/bintime_sub.0             comp-sys-catman         .cat
+./usr/share/man/cat9/bintime2timespec.0                comp-sys-catman         .cat
+./usr/share/man/cat9/bintime2timeval.0         comp-sys-catman         .cat
 ./usr/share/man/cat9/bintobcd.0                        comp-sys-catman         .cat
 ./usr/share/man/cat9/binuptime.0               comp-sys-catman         .cat
 ./usr/share/man/cat9/biodone.0                 comp-sys-catman         .cat
@@ -9692,6 +9697,8 @@
 ./usr/share/man/cat9/time_uptime.0             comp-sys-catman         .cat
 ./usr/share/man/cat9/timecounter.0             comp-sys-catman         .cat
 ./usr/share/man/cat9/timeout.0                 comp-sys-catman         .cat
+./usr/share/man/cat9/timespec2bintime.0                comp-sys-catman         .cat
+./usr/share/man/cat9/timeval2bintime.0         comp-sys-catman         .cat
 ./usr/share/man/cat9/tmpfs.0                   comp-obsolete           obsolete
 ./usr/share/man/cat9/todr.0                    comp-sys-catman         .cat
 ./usr/share/man/cat9/todr_getcal.0             comp-obsolete           obsolete
@@ -14485,6 +14492,11 @@
 ./usr/share/man/html9/be64enc.html             comp-sys-htmlman        html
 ./usr/share/man/html9/be64toh.html             comp-sys-htmlman        html
 ./usr/share/man/html9/bintime.html             comp-sys-htmlman        html
+./usr/share/man/html9/bintime_add.html         comp-sys-htmlman        html
+./usr/share/man/html9/bintime_addx.html                comp-sys-htmlman        html
+./usr/share/man/html9/bintime_sub.html         comp-sys-htmlman        html
+./usr/share/man/html9/bintime2timespec.html    comp-sys-htmlman        html
+./usr/share/man/html9/bintime2timeval.html     comp-sys-htmlman        html
 ./usr/share/man/html9/bintobcd.html            comp-sys-htmlman        html
 ./usr/share/man/html9/binuptime.html           comp-sys-htmlman        html
 ./usr/share/man/html9/biodone.html             comp-sys-htmlman        html
@@ -15408,6 +15420,8 @@
 ./usr/share/man/html9/time_uptime.html         comp-sys-htmlman        html
 ./usr/share/man/html9/timecounter.html         comp-sys-htmlman        html
 ./usr/share/man/html9/timeout.html             comp-sys-htmlman        html
+./usr/share/man/html9/timespec2bintime.html    comp-sys-htmlman        html
+./usr/share/man/html9/timeval2bintime.html     comp-sys-htmlman        html
 ./usr/share/man/html9/todr.html                        comp-sys-htmlman        html
 ./usr/share/man/html9/todr_gettime.html                comp-sys-htmlman        html
 ./usr/share/man/html9/todr_settime.html                comp-sys-htmlman        html
@@ -20361,6 +20375,11 @@
 ./usr/share/man/man9/be64enc.9                 comp-sys-man            .man
 ./usr/share/man/man9/be64toh.9                 comp-sys-man            .man
 ./usr/share/man/man9/bintime.9                 comp-sys-man            .man
+./usr/share/man/man9/bintime_add.9             comp-sys-man            .man
+./usr/share/man/man9/bintime_addx.9            comp-sys-man            .man
+./usr/share/man/man9/bintime_sub.9             comp-sys-man            .man
+./usr/share/man/man9/bintime2timespec.9                comp-sys-man            .man
+./usr/share/man/man9/bintime2timeval.9         comp-sys-man            .man
 ./usr/share/man/man9/bintobcd.9                        comp-sys-man            .man
 ./usr/share/man/man9/binuptime.9               comp-sys-man            .man
 ./usr/share/man/man9/biodone.9                 comp-sys-man            .man
@@ -21333,6 +21352,8 @@
 ./usr/share/man/man9/time_uptime.9             comp-sys-man            .man
 ./usr/share/man/man9/timecounter.9             comp-sys-man            .man
 ./usr/share/man/man9/timeout.9                 comp-sys-man            .man
+./usr/share/man/man9/timespec2bintime.9                comp-sys-man            .man
+./usr/share/man/man9/timeval2bintime.9         comp-sys-man            .man
 ./usr/share/man/man9/tmpfs.9                   comp-obsolete           obsolete
 ./usr/share/man/man9/todr.9                    comp-sys-man            .man
 ./usr/share/man/man9/todr_getcal.9             comp-obsolete           obsolete
diff -r 71a7413692b1 -r ff280e8be969 share/man/man9/Makefile
--- a/share/man/man9/Makefile   Tue Jun 08 05:38:32 2010 +0000
+++ b/share/man/man9/Makefile   Tue Jun 08 05:40:26 2010 +0000
@@ -1,10 +1,10 @@
-#       $NetBSD: Makefile,v 1.331 2010/05/13 13:08:08 jruoho Exp $
+#       $NetBSD: Makefile,v 1.332 2010/06/08 05:40:27 jruoho Exp $
 
 #      Makefile for section 9 (kernel function and variable) manual pages.
 
 MAN=   accept_filter.9 accf_data.9 accf_http.9 \
        altq.9 arc4random.9 arp.9 audio.9 autoconf.9 \
-       bcdtobin.9 bcmp.9 bcopy.9 bluetooth.9 boothowto.9 bpf.9 \
+       bcdtobin.9 bcmp.9 bcopy.9 bintime_add.9 bluetooth.9 boothowto.9 bpf.9 \
        buffercache.9 bufq.9 bus_dma.9 bus_space.9 byteorder.9 bzero.9 \
        callback.9 callout.9 cardbus.9 cnmagic.9 condvar.9 config.9 \
        cons.9 copy.9 coredump_write.9 \
@@ -105,6 +105,12 @@
        autoconf.9 config_pending_decr.9 \
        autoconf.9 config_finalize_register.9
 MLINKS+=bcdtobin.9 bintobcd.9
+MLINKS+=bintime_add.9 bintime_addx.9 \
+       bintime_add.9 bintime_sub.9 \
+       bintime_add.9 bintime2timespec.9 \
+       bintime_add.9 timespec2bintime.9 \
+       bintime_add.9 bintime2timeval.9 \
+       bintime_add.9 timeval2bintime.9
 MLINKS+=buffercache.9 bread.9 \
        buffercache.9 breada.9 \
        buffercache.9 breadn.9 \
diff -r 71a7413692b1 -r ff280e8be969 share/man/man9/bintime_add.3
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man9/bintime_add.3      Tue Jun 08 05:40:26 2010 +0000
@@ -0,0 +1,101 @@
+.\" $NetBSD: bintime_add.3,v 1.1 2010/06/08 05:40:27 jruoho Exp $
+.\"
+.\" Copyright (c) 2010 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Jukka Ruohonen.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd June 8, 2010
+.Dt BINTIME_ADD 9
+.Os
+.Sh NAME
+.Nm bintime_add
+.Nd operations on
+.Dq bintime
+.Sh SYNOPSIS
+.In sys/time.h
+.Ft vid
+.Fn bintime_add "struct bintime *bt" "const struct bintime *bt2"
+.Ft void
+.Fn bintime_addx "struct bintime *bt" "uint64_t x"
+.Ft void
+.Fn bintime_sub "struct bintime *bt" "const struct bintime *bt2"
+.Ft void
+.Fn bintime2timespec "const struct bintime *bt" "struct timespec *ts"
+.Ft void
+.Fn timespec2bintime "const struct timespec *ts" "struct bintime *bt"
+.Ft void
+.Fn bintime2timeval "const struct bintime *bt" "struct timeval *tv"
+.Ft void
+.Fn timeval2bintime "const struct timeval *tv" "struct bintime *bt"
+.Sh DESCRIPTION
+These functions are provided for convenience as part of the machine-independent
+.Xr timecounter 9
+framework.
+All of them operate with the
+.Em bintime
+structure.
+.Pp
+The function
+.Fn bintime_add
+adds the time information stored in
+.Fa bt2
+to
+.Fa bt .
+Conversely,
+.Fn bintime_sub
+subtracts
+.Fa bt2
+from
+.Fa bt .
+The
+.Fn bintime_addx
+function stores the fraction of a second
+.Fa x
+to
+.Fa bt .
+.Pp
+Like the function names bespeak,
+.Fn bintime2timespec
+converts the
+.Em bintime
+structure to
+.Em struct timespec
+and
+.Fn timespec2bintime
+does the opposite.
+The functions
+.Fn bintime2timeval
+and
+.Fn timeval2bintime
+operate with
+.Em struct timeval
+instead.
+The result is stored to the right-hand side.
+.Sh SEE ALSO
+.Xr timeradd 3 ,
+.Xr timeval 3 ,
+.Xr bintime 9 ,
+.Xr timercounter 9



Home | Main Index | Thread Index | Old Index