Mon May 4 08:15:21 2015 UTC ()
Swap function names, so that xxx_bp() refers to the boot processor and
xxx_ap() to the application processor. It doesn't make any sense to
have bp reference the application processor while ap references boot!

XXX The two function are now lexicographically mis-ordered.  If this
XXX is an issue, let me know and I will re-sequence them.


(pgoyette)
diff -r1.5 -r1.6 src/share/man/man9/man9.x86/tsc.9

cvs diff -r1.5 -r1.6 src/share/man/man9/man9.x86/tsc.9 (expand / switch to unified diff)

--- src/share/man/man9/man9.x86/tsc.9 2013/11/20 18:13:16 1.5
+++ src/share/man/man9/man9.x86/tsc.9 2015/05/04 08:15:21 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: tsc.9,v 1.5 2013/11/20 18:13:16 jruoho Exp $ 1.\" $NetBSD: tsc.9,v 1.6 2015/05/04 08:15:21 pgoyette Exp $
2.\" 2.\"
3.\" Copyright (c) 2011 The NetBSD Foundation, Inc. 3.\" Copyright (c) 2011 The NetBSD Foundation, Inc.
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation 6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Jukka Ruohonen. 7.\" by Jukka Ruohonen.
8.\" 8.\"
9.\" Redistribution and use in source and binary forms, with or without 9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions 10.\" modification, are permitted provided that the following conditions
11.\" are met: 11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright 12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer. 13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" 2. Redistributions in binary form must reproduce the above copyright
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17.\" 17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE. 28.\" POSSIBILITY OF SUCH DAMAGE.
29.\" 29.\"
30.Dd November 20, 2013 30.Dd April 4, 2015
31.Dt TSC 9 x86 31.Dt TSC 9 x86
32.Os 32.Os
33.Sh NAME 33.Sh NAME
34.Nm tsc 34.Nm tsc
35.Nd Time Stamp Counter 35.Nd Time Stamp Counter
36.Sh SYNOPSIS 36.Sh SYNOPSIS
37.In x86/x86/tsc.h 37.In x86/x86/tsc.h
38.Ft uint64_t 38.Ft uint64_t
39.Fn rdtsc "void" 39.Fn rdtsc "void"
40.Ft void 40.Ft void
41.Fn tsc_tc_init "void" 41.Fn tsc_tc_init "void"
42.Ft void 42.Ft void
43.Fn tsc_sync_ap "struct cpu_info *ci" 43.Fn tsc_sync_ap "struct cpu_info *ci"
@@ -83,44 +83,44 @@ Care should be however taken in implemen @@ -83,44 +83,44 @@ Care should be however taken in implemen
83.It Fn rdtsc "" 83.It Fn rdtsc ""
84The 84The
85.Fn rdtsc 85.Fn rdtsc
86function returns the value read from 86function returns the value read from
87.Dv RDTSC . 87.Dv RDTSC .
88.It Fn tsc_tc_init "" 88.It Fn tsc_tc_init ""
89The 89The
90.Fn tsc_tc_init 90.Fn tsc_tc_init
91function initializes the 91function initializes the
92.Tn TSC 92.Tn TSC
93as a 93as a
94.Xr timecounter 9 . 94.Xr timecounter 9 .
95The function is called early in the boot process when the processors attach. 95The function is called early in the boot process when the processors attach.
96.It Fn tsc_sync_ap "ci" 96.It Fn tsc_sync_bp "ci"
97The 97The
98.Fn tsc_sync_ap 98.Fn tsc_sync_bp
99function synchronizes the counter for the boot processor 99function synchronizes the counter for the boot processor
100.Pq Tn BP . 100.Pq Tn BP .
101The supplied 101The supplied
102.Fa ci 102.Fa ci
103must refer to the 103must refer to the
104.Tn BP 104.Tn BP
105itself. 105itself.
106The 106The
107.Nm 107.Nm
108interface takes internally care of such issues as out-of-order execution, 108interface takes internally care of such issues as out-of-order execution,
109where instructions are not necessarily performed in the order of execution, 109where instructions are not necessarily performed in the order of execution,
110possibly causing a misleading cycle count. 110possibly causing a misleading cycle count.
111.It Fn tsc_sync_bp "ci" 111.It Fn tsc_sync_ap "ci"
112The 112The
113.Fn tsc_sync_bp 113.Fn tsc_sync_ap
114function synchronize the counter for the application processor 114function synchronize the counter for the application processor
115.Fa ci . 115.Fa ci .
116Interrupts must be off at machine-level when the function is called. 116Interrupts must be off at machine-level when the function is called.
117.Pp 117.Pp
118It is necessary to call both 118It is necessary to call both
119.Fn tsc_sync_ap 119.Fn tsc_sync_ap
120and 120and
121.Fn tsc_sync_bp 121.Fn tsc_sync_bp
122during the boot, but additional synchronization 122during the boot, but additional synchronization
123may be required also during runtime. 123may be required also during runtime.
124As an example, the 124As an example, the
125.Tn TSC 125.Tn TSC
126needs to be synchronized for all processors when the system resumes from an 126needs to be synchronized for all processors when the system resumes from an