Deleted Added
full compact
cpu.h (219653) cpu.h (219672)
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * William Jolitz.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 16 unchanged lines hidden (view full) ---

25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * from: @(#)cpu.h 5.4 (Berkeley) 5/9/91
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * William Jolitz.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 16 unchanged lines hidden (view full) ---

25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * from: @(#)cpu.h 5.4 (Berkeley) 5/9/91
33 * $FreeBSD: head/sys/i386/include/cpu.h 219653 2011-03-14 23:30:14Z jkim $
33 * $FreeBSD: head/sys/i386/include/cpu.h 219672 2011-03-15 17:14:26Z jkim $
34 */
35
36#ifndef _MACHINE_CPU_H_
37#define _MACHINE_CPU_H_
38
39/*
40 * Definitions unique to i386 cpu support.
41 */

--- 23 unchanged lines hidden (view full) ---

65
66/*
67 * Return contents of in-cpu fast counter as a sort of "bogo-time"
68 * for random-harvesting purposes.
69 */
70static __inline uint64_t
71get_cyclecount(void)
72{
34 */
35
36#ifndef _MACHINE_CPU_H_
37#define _MACHINE_CPU_H_
38
39/*
40 * Definitions unique to i386 cpu support.
41 */

--- 23 unchanged lines hidden (view full) ---

65
66/*
67 * Return contents of in-cpu fast counter as a sort of "bogo-time"
68 * for random-harvesting purposes.
69 */
70static __inline uint64_t
71get_cyclecount(void)
72{
73#if defined(I486_CPU) || defined(KLD_MODULE)
74 struct bintime bt;
75
73 struct bintime bt;
74
76 if (!tsc_present) {
77 binuptime(&bt);
78 return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
79 }
80#endif
81 return (rdtsc());
75 binuptime(&bt);
76 return ((uint64_t)bt.sec << 56 | bt.frac >> 8);
82}
83
84#endif
85
86#endif /* !_MACHINE_CPU_H_ */
77}
78
79#endif
80
81#endif /* !_MACHINE_CPU_H_ */