Deleted Added
full compact
cpufunc.h (67030) cpufunc.h (69006)
1/*-
2 * Copyright (c) 1993 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
1/*-
2 * Copyright (c) 1993 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * $FreeBSD: head/sys/amd64/include/cpufunc.h 67030 2000-10-12 17:05:33Z bde $
33 * $FreeBSD: head/sys/amd64/include/cpufunc.h 69006 2000-11-21 20:16:49Z markm $
34 */
35
36/*
37 * Functions to provide access to special i386 instructions.
38 */
39
40#ifndef _MACHINE_CPUFUNC_H_
41#define _MACHINE_CPUFUNC_H_

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

374 return (ef);
375}
376
377static __inline u_int64_t
378rdmsr(u_int msr)
379{
380 u_int64_t rv;
381
34 */
35
36/*
37 * Functions to provide access to special i386 instructions.
38 */
39
40#ifndef _MACHINE_CPUFUNC_H_
41#define _MACHINE_CPUFUNC_H_

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

374 return (ef);
375}
376
377static __inline u_int64_t
378rdmsr(u_int msr)
379{
380 u_int64_t rv;
381
382 __asm __volatile(".byte 0x0f, 0x32" : "=A" (rv) : "c" (msr));
382 __asm __volatile("rdmsr" : "=A" (rv) : "c" (msr));
383 return (rv);
384}
385
386static __inline u_int64_t
387rdpmc(u_int pmc)
388{
389 u_int64_t rv;
390
383 return (rv);
384}
385
386static __inline u_int64_t
387rdpmc(u_int pmc)
388{
389 u_int64_t rv;
390
391 __asm __volatile(".byte 0x0f, 0x33" : "=A" (rv) : "c" (pmc));
391 __asm __volatile("rdpmc" : "=A" (rv) : "c" (pmc));
392 return (rv);
393}
394
395static __inline u_int64_t
396rdtsc(void)
397{
398 u_int64_t rv;
399
392 return (rv);
393}
394
395static __inline u_int64_t
396rdtsc(void)
397{
398 u_int64_t rv;
399
400 __asm __volatile(".byte 0x0f, 0x31" : "=A" (rv));
400 __asm __volatile("rdtsc" : "=A" (rv));
401 return (rv);
402}
403
404static __inline void
405wbinvd(void)
406{
407 __asm __volatile("wbinvd");
408}
409
410static __inline void
411write_eflags(u_int ef)
412{
413 __asm __volatile("pushl %0; popfl" : : "r" (ef));
414}
415
416static __inline void
417wrmsr(u_int msr, u_int64_t newval)
418{
401 return (rv);
402}
403
404static __inline void
405wbinvd(void)
406{
407 __asm __volatile("wbinvd");
408}
409
410static __inline void
411write_eflags(u_int ef)
412{
413 __asm __volatile("pushl %0; popfl" : : "r" (ef));
414}
415
416static __inline void
417wrmsr(u_int msr, u_int64_t newval)
418{
419 __asm __volatile(".byte 0x0f, 0x30" : : "A" (newval), "c" (msr));
419 __asm __volatile("wrmsr" : : "A" (newval), "c" (msr));
420}
421
422static __inline u_int
423rfs(void)
424{
425 u_int sel;
426 __asm __volatile("movl %%fs,%0" : "=rm" (sel));
427 return (sel);

--- 118 unchanged lines hidden ---
420}
421
422static __inline u_int
423rfs(void)
424{
425 u_int sel;
426 __asm __volatile("movl %%fs,%0" : "=rm" (sel));
427 return (sel);

--- 118 unchanged lines hidden ---