Коммит
c110d96687
@ -81,13 +81,17 @@ static void flush_and_invalidate_cache (unsigned long a)
|
|||||||
static int have_clflush = -1;
|
static int have_clflush = -1;
|
||||||
|
|
||||||
if (OPAL_UNLIKELY(-1 == have_clflush)) {
|
if (OPAL_UNLIKELY(-1 == have_clflush)) {
|
||||||
int32_t cpuid1, cpuid2;
|
int32_t cpuid1, cpuid2, tmp;
|
||||||
const int32_t level = 1;
|
const int32_t level = 1;
|
||||||
|
|
||||||
__asm__ volatile ("cpuid" :
|
/* cpuid clobbers ebx but it must be restored for -fPIC so save
|
||||||
"=a" (cpuid1), "=d" (cpuid2) :
|
* then restore ebx */
|
||||||
|
__asm__ volatile ("xchgl %%ebx, %2\n"
|
||||||
|
"cpuid\n"
|
||||||
|
"xchgl %%ebx, %2\n":
|
||||||
|
"=a" (cpuid1), "=d" (cpuid2), "=r" (tmp) :
|
||||||
"a" (level) :
|
"a" (level) :
|
||||||
"ecx", "ebx");
|
"ecx");
|
||||||
/* clflush is in edx bit 19 */
|
/* clflush is in edx bit 19 */
|
||||||
have_clflush = !!(cpuid2 & (1 << 19));
|
have_clflush = !!(cpuid2 & (1 << 19));
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user