diff options
author | kib <kib@FreeBSD.org> | 2009-07-29 08:49:58 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2009-07-29 08:49:58 +0000 |
commit | 7b17971146d9d04f6fdfc56456eda87bddfb201f (patch) | |
tree | a9270d20c2533ced81403eaadb92f28a6d20d577 /sys/i386/include/cpufunc.h | |
parent | 6b019307f44e0dbb389ad68649826526b790a7cc (diff) | |
download | FreeBSD-src-7b17971146d9d04f6fdfc56456eda87bddfb201f.zip FreeBSD-src-7b17971146d9d04f6fdfc56456eda87bddfb201f.tar.gz |
As was done in r195820 for amd64, use clflush for flushing cache lines
when memory page caching attributes changed, and CPU does not support
self-snoop, but implemented clflush, for i386.
Take care of possible mappings of the page by sf buffer by utilizing
the mapping for clflush, otherwise map the page transiently. Amd64
used direct map.
Proposed and reviewed by: alc
Approved by: re (kensmith)
Diffstat (limited to 'sys/i386/include/cpufunc.h')
-rw-r--r-- | sys/i386/include/cpufunc.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index 6139a1f..147040b 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -90,6 +90,13 @@ bsrl(u_int mask) } static __inline void +clflush(u_long addr) +{ + + __asm __volatile("clflush %0" : : "m" (*(char *)addr)); +} + +static __inline void disable_intr(void) { #ifdef XEN @@ -138,6 +145,13 @@ cpu_mwait(int extensions, int hints) __asm __volatile("mwait;" : :"a" (hints), "c" (extensions)); } +static __inline void +mfence(void) +{ + + __asm __volatile("mfence" : : : "memory"); +} + #ifdef _KERNEL #define HAVE_INLINE_FFS |