From ece15d78ea998997fad84ffb30ceae690cdd3fe6 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Sun, 29 Sep 1996 18:35:07 +0000 Subject: [PATCH] Added "memory" to clobber list in invlpg(). It needs it if invltlb() needs it. Fixed style in invlpg(). Sorted recently renamed functions. Added prototypes in the non-gcc section for recently added/renamed functions. --- sys/amd64/include/cpufunc.h | 41 +++++++++++++++++++------------------ sys/i386/include/cpufunc.h | 41 +++++++++++++++++++------------------ 2 files changed, 42 insertions(+), 40 deletions(-) diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index f789ee11ae0..81df81cf6f7 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cpufunc.h,v 1.57 1996/09/28 04:22:46 dyson Exp $ + * $Id: cpufunc.h,v 1.58 1996/09/28 22:37:57 dyson Exp $ */ /* @@ -195,6 +195,24 @@ insl(u_int port, void *addr, size_t cnt) : "di", "cx", "memory"); } +static __inline void +invlpg(u_int addr) +{ + __asm __volatile("invlpg (%0)" : : "r" (addr) : "memory"); +} + +static __inline void +invltlb(void) +{ + u_long temp; + /* + * This should be implemented as load_cr3(rcr3()) when load_cr3() + * is inlined. + */ + __asm __volatile("movl %%cr3, %0; movl %0, %%cr3" : "=r" (temp) + : : "memory"); +} + static __inline u_short inw(u_int port) { @@ -269,25 +287,6 @@ outw(u_int port, u_short data) __asm __volatile("outw %0,%%dx" : : "a" (data), "d" (port)); } - -static __inline void -invltlb(void) -{ - u_long temp; - /* - * This should be implemented as load_cr3(rcr3()) when load_cr3() - * is inlined. - */ - __asm __volatile("movl %%cr3, %0; movl %0, %%cr3" : "=r" (temp) - : : "memory"); -} - -static __inline void -invlpg(u_long addr) -{ - __asm __volatile("invlpg (%0)": :"r"(addr)); -} - static __inline u_long rcr2(void) { @@ -361,6 +360,8 @@ u_long inl __P((u_int port)); void insb __P((u_int port, void *addr, size_t cnt)); void insl __P((u_int port, void *addr, size_t cnt)); void insw __P((u_int port, void *addr, size_t cnt)); +void invlpg __P((u_int addr)); +void invltlb __P((void)); u_short inw __P((u_int port)); u_int loadandclear __P((u_int *addr)); void outb __P((u_int port, u_char data)); diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index f789ee11ae0..81df81cf6f7 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cpufunc.h,v 1.57 1996/09/28 04:22:46 dyson Exp $ + * $Id: cpufunc.h,v 1.58 1996/09/28 22:37:57 dyson Exp $ */ /* @@ -195,6 +195,24 @@ insl(u_int port, void *addr, size_t cnt) : "di", "cx", "memory"); } +static __inline void +invlpg(u_int addr) +{ + __asm __volatile("invlpg (%0)" : : "r" (addr) : "memory"); +} + +static __inline void +invltlb(void) +{ + u_long temp; + /* + * This should be implemented as load_cr3(rcr3()) when load_cr3() + * is inlined. + */ + __asm __volatile("movl %%cr3, %0; movl %0, %%cr3" : "=r" (temp) + : : "memory"); +} + static __inline u_short inw(u_int port) { @@ -269,25 +287,6 @@ outw(u_int port, u_short data) __asm __volatile("outw %0,%%dx" : : "a" (data), "d" (port)); } - -static __inline void -invltlb(void) -{ - u_long temp; - /* - * This should be implemented as load_cr3(rcr3()) when load_cr3() - * is inlined. - */ - __asm __volatile("movl %%cr3, %0; movl %0, %%cr3" : "=r" (temp) - : : "memory"); -} - -static __inline void -invlpg(u_long addr) -{ - __asm __volatile("invlpg (%0)": :"r"(addr)); -} - static __inline u_long rcr2(void) { @@ -361,6 +360,8 @@ u_long inl __P((u_int port)); void insb __P((u_int port, void *addr, size_t cnt)); void insl __P((u_int port, void *addr, size_t cnt)); void insw __P((u_int port, void *addr, size_t cnt)); +void invlpg __P((u_int addr)); +void invltlb __P((void)); u_short inw __P((u_int port)); u_int loadandclear __P((u_int *addr)); void outb __P((u_int port, u_char data));