]> xenbits.xensource.com Git - people/liuw/freebsd.git/commitdiff
Add CLFLUSHOPT instruction wrappers.
authorkib <kib@FreeBSD.org>
Fri, 23 Oct 2015 11:45:38 +0000 (11:45 +0000)
committerkib <kib@FreeBSD.org>
Fri, 23 Oct 2015 11:45:38 +0000 (11:45 +0000)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

sys/amd64/include/cpufunc.h
sys/i386/include/cpufunc.h

index c0c5b0a99a117c99f24c9fe08a1249443471be0d..f2961d6d9eac566b78f4c9d0e30723b2b3a971a4 100644 (file)
@@ -106,6 +106,13 @@ clflush(u_long addr)
        __asm __volatile("clflush %0" : : "m" (*(char *)addr));
 }
 
+static __inline void
+clflushopt(u_long addr)
+{
+
+       __asm __volatile(".byte 0x66;clflush %0" : : "m" (*(char *)addr));
+}
+
 static __inline void
 clts(void)
 {
index 3bc25d42116eac28af3681c47a4b514d552de8b1..ca7207d856632f7eb2110f1d5014d62711ff4e1c 100644 (file)
@@ -85,6 +85,13 @@ clflush(u_long addr)
        __asm __volatile("clflush %0" : : "m" (*(char *)addr));
 }
 
+static __inline void
+clflushopt(u_long addr)
+{
+
+       __asm __volatile(".byte 66;clflush %0" : : "m" (*(char *)addr));
+}
+
 static __inline void
 clts(void)
 {