Deleted Added
full compact
cpufunc.h (184040) cpufunc.h (187948)
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

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

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
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

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

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: head/sys/i386/include/cpufunc.h 184040 2008-10-19 01:27:40Z kmacy $
29 * $FreeBSD: head/sys/i386/include/cpufunc.h 187948 2009-01-31 11:37:21Z obrien $
30 */
31
32/*
33 * Functions to provide access to special i386 instructions.
34 * This in included in sys/systm.h, and that file should be
35 * used in preference to this.
36 */
37

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

492 __asm __volatile("invlpg %0" : : "m" (*(char *)addr) : "memory");
493#endif
494}
495
496static __inline u_int
497rfs(void)
498{
499 u_int sel;
30 */
31
32/*
33 * Functions to provide access to special i386 instructions.
34 * This in included in sys/systm.h, and that file should be
35 * used in preference to this.
36 */
37

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

492 __asm __volatile("invlpg %0" : : "m" (*(char *)addr) : "memory");
493#endif
494}
495
496static __inline u_int
497rfs(void)
498{
499 u_int sel;
500 __asm __volatile("movl %%fs,%0" : "=rm" (sel));
500 __asm __volatile("mov %%fs,%0" : "=rm" (sel));
501 return (sel);
502}
503
504static __inline uint64_t
505rgdt(void)
506{
507 uint64_t gdtr;
508 __asm __volatile("sgdt %0" : "=m" (gdtr));
509 return (gdtr);
510}
511
512static __inline u_int
513rgs(void)
514{
515 u_int sel;
501 return (sel);
502}
503
504static __inline uint64_t
505rgdt(void)
506{
507 uint64_t gdtr;
508 __asm __volatile("sgdt %0" : "=m" (gdtr));
509 return (gdtr);
510}
511
512static __inline u_int
513rgs(void)
514{
515 u_int sel;
516 __asm __volatile("movl %%gs,%0" : "=rm" (sel));
516 __asm __volatile("mov %%gs,%0" : "=rm" (sel));
517 return (sel);
518}
519
520static __inline uint64_t
521ridt(void)
522{
523 uint64_t idtr;
524 __asm __volatile("sidt %0" : "=m" (idtr));

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

532 __asm __volatile("sldt %0" : "=g" (ldtr));
533 return (ldtr);
534}
535
536static __inline u_int
537rss(void)
538{
539 u_int sel;
517 return (sel);
518}
519
520static __inline uint64_t
521ridt(void)
522{
523 uint64_t idtr;
524 __asm __volatile("sidt %0" : "=m" (idtr));

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

532 __asm __volatile("sldt %0" : "=g" (ldtr));
533 return (ldtr);
534}
535
536static __inline u_int
537rss(void)
538{
539 u_int sel;
540 __asm __volatile("movl %%ss,%0" : "=rm" (sel));
540 __asm __volatile("mov %%ss,%0" : "=rm" (sel));
541 return (sel);
542}
543
544static __inline u_short
545rtr(void)
546{
547 u_short tr;
548 __asm __volatile("str %0" : "=g" (tr));
549 return (tr);
550}
551
552static __inline void
553load_fs(u_int sel)
554{
541 return (sel);
542}
543
544static __inline u_short
545rtr(void)
546{
547 u_short tr;
548 __asm __volatile("str %0" : "=g" (tr));
549 return (tr);
550}
551
552static __inline void
553load_fs(u_int sel)
554{
555 __asm __volatile("movl %0,%%fs" : : "rm" (sel));
555 __asm __volatile("mov %0,%%fs" : : "rm" (sel));
556}
557
558static __inline void
559load_gs(u_int sel)
560{
556}
557
558static __inline void
559load_gs(u_int sel)
560{
561 __asm __volatile("movl %0,%%gs" : : "rm" (sel));
561 __asm __volatile("mov %0,%%gs" : : "rm" (sel));
562}
563
564static __inline void
565lidt(struct region_descriptor *addr)
566{
567 __asm __volatile("lidt (%0)" : : "r" (addr));
568}
569

--- 227 unchanged lines hidden ---
562}
563
564static __inline void
565lidt(struct region_descriptor *addr)
566{
567 __asm __volatile("lidt (%0)" : : "r" (addr));
568}
569

--- 227 unchanged lines hidden ---