cpufunc.h (24112) | cpufunc.h (25164) |
---|---|
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 * $Id: cpufunc.h,v 1.61 1997/02/22 09:34:08 peter Exp $ | 33 * $Id: cpufunc.h,v 1.62 1997/03/22 18:52:57 kato Exp $ |
34 */ 35 36/* 37 * Functions to provide access to special i386 instructions. 38 */ 39 40#ifndef _MACHINE_CPUFUNC_H_ 41#define _MACHINE_CPUFUNC_H_ 42 43#include <sys/cdefs.h> 44#include <sys/types.h> | 34 */ 35 36/* 37 * Functions to provide access to special i386 instructions. 38 */ 39 40#ifndef _MACHINE_CPUFUNC_H_ 41#define _MACHINE_CPUFUNC_H_ 42 43#include <sys/cdefs.h> 44#include <sys/types.h> |
45#include <machine/smp.h> |
|
45 | 46 |
47#include "opt_smp.h" 48#include "opt_smp_invltlb.h" 49 |
|
46#ifdef __GNUC__ 47 48static __inline void 49breakpoint(void) 50{ 51 __asm __volatile("int $3"); 52} 53 --- 142 unchanged lines hidden (view full) --- 196} 197 198static __inline void 199invd(void) 200{ 201 __asm __volatile("invd"); 202} 203 | 50#ifdef __GNUC__ 51 52static __inline void 53breakpoint(void) 54{ 55 __asm __volatile("int $3"); 56} 57 --- 142 unchanged lines hidden (view full) --- 200} 201 202static __inline void 203invd(void) 204{ 205 __asm __volatile("invd"); 206} 207 |
208#if defined(SMP) && defined(SMP_INVLTLB) 209 210/* 211 * When using APIC IPI's, the inlining cost is prohibitive.. 212 */ 213void invlpg __P((u_int addr)); 214void invltlb __P((void)); 215 216#else 217 |
|
204static __inline void 205invlpg(u_int addr) 206{ 207 __asm __volatile("invlpg (%0)" : : "r" (addr) : "memory"); 208} 209 210static __inline void 211invltlb(void) 212{ 213 u_long temp; 214 /* 215 * This should be implemented as load_cr3(rcr3()) when load_cr3() 216 * is inlined. 217 */ 218 __asm __volatile("movl %%cr3, %0; movl %0, %%cr3" : "=r" (temp) 219 : : "memory"); 220} | 218static __inline void 219invlpg(u_int addr) 220{ 221 __asm __volatile("invlpg (%0)" : : "r" (addr) : "memory"); 222} 223 224static __inline void 225invltlb(void) 226{ 227 u_long temp; 228 /* 229 * This should be implemented as load_cr3(rcr3()) when load_cr3() 230 * is inlined. 231 */ 232 __asm __volatile("movl %%cr3, %0; movl %0, %%cr3" : "=r" (temp) 233 : : "memory"); 234} |
235#endif /* SMP && SMP_INVLTLB */ |
|
221 222static __inline u_short 223inw(u_int port) 224{ 225 u_short data; 226 227 __asm __volatile("inw %%dx,%0" : "=a" (data) : "d" (port)); 228 return (data); --- 178 unchanged lines hidden --- | 236 237static __inline u_short 238inw(u_int port) 239{ 240 u_short data; 241 242 __asm __volatile("inw %%dx,%0" : "=a" (data) : "d" (port)); 243 return (data); --- 178 unchanged lines hidden --- |