]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes to a common header file not applicable to open-vm-tools.
authorJohn Wolfe <jwolfe@vmware.com>
Wed, 30 Jun 2021 18:37:27 +0000 (11:37 -0700)
committerJohn Wolfe <jwolfe@vmware.com>
Wed, 30 Jun 2021 18:37:27 +0000 (11:37 -0700)
open-vm-tools/lib/include/vm_basic_asm_x86_common.h

index 77372a8246e1d8161aceb527f40b0dc1bc3e9c04..590b1ce3fa1657807d599c811bded2da9f73a4f5 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2013-2020 VMware, Inc. All rights reserved.
+ * Copyright (C) 2013-2021 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -164,6 +164,37 @@ GetCallerEFlags(void)
    X86MSR_GetMSR(MSR_BIOS_SIGN_ID))
 
 
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * CLFLUSH --
+ *
+ *      Wrapper around the CLFLUSH instruction.
+ *
+ * Results:
+ *      None.
+ *
+ * Side effects:
+ *      See CLFLUSH instruction in Intel SDM or AMD Programmer's Manual.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+static INLINE void
+CLFLUSH(const void *addr)
+{
+#ifdef __GNUC__
+   __asm__ __volatile__(
+      "clflush %0"
+      :: "m" (*(uint8 *)addr));
+#elif defined _MSC_VER
+   _mm_clflush(addr);
+#else
+#error No compiler defined for CLFLUSH
+#endif
+}
+
+
 /*
  *-----------------------------------------------------------------------------
  *