Deleted Added
full compact
cpu.h (67694) cpu.h (69003)
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

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

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * 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

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

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * from: @(#)cpu.h 5.4 (Berkeley) 5/9/91
37 * $FreeBSD: head/sys/amd64/include/cpu.h 67694 2000-10-27 08:30:59Z bde $
37 * $FreeBSD: head/sys/amd64/include/cpu.h 69003 2000-11-21 19:55:21Z markm $
38 */
39
40#ifndef _MACHINE_CPU_H_
41#define _MACHINE_CPU_H_
42
43/*
44 * Definitions unique to i386 cpu support.
45 */
46#include <machine/psl.h>
47#include <machine/frame.h>
48#include <machine/segments.h>
49#include <machine/globals.h>
38 */
39
40#ifndef _MACHINE_CPU_H_
41#define _MACHINE_CPU_H_
42
43/*
44 * Definitions unique to i386 cpu support.
45 */
46#include <machine/psl.h>
47#include <machine/frame.h>
48#include <machine/segments.h>
49#include <machine/globals.h>
50#include <machine/md_var.h>
51#include <machine/specialreg.h>
50
51/*
52 * definitions of cpu-dependent requirements
53 * referenced in generic code
54 */
55#undef COPY_SIGCODE /* don't copy sigcode above user stack in exec */
56
57#define cpu_exec(p) /* nothing */

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

128}
129
130#ifdef _KERNEL
131extern char btext[];
132extern char etext[];
133
134void fork_trampoline __P((void));
135void fork_return __P((struct proc *, struct trapframe));
52
53/*
54 * definitions of cpu-dependent requirements
55 * referenced in generic code
56 */
57#undef COPY_SIGCODE /* don't copy sigcode above user stack in exec */
58
59#define cpu_exec(p) /* nothing */

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

130}
131
132#ifdef _KERNEL
133extern char btext[];
134extern char etext[];
135
136void fork_trampoline __P((void));
137void fork_return __P((struct proc *, struct trapframe));
138
139/*
140 * Return contents of in-cpu fast counter as a sort of "bogo-time"
141 * for non-critical timing.
142 */
143static __inline u_int64_t
144get_cyclecount(void)
145{
146#if defined(I386_CPU) || defined(I486_CPU)
147 struct timespec tv;
148
149 if ((cpu_feature & CPUID_TSC) == 0) {
150 nanotime(&tv);
151 return (tv.tv_sec * (u_int64_t)1000000000 + tv.tv_nsec);
152 }
136#endif
153#endif
154 return (rdtsc());
155}
137
156
157#endif
158
138#endif /* !_MACHINE_CPU_H_ */
159#endif /* !_MACHINE_CPU_H_ */