]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Internal branch sync. Included in this change:
authorVMware, Inc <>
Fri, 12 Apr 2013 19:51:36 +0000 (12:51 -0700)
committerDmitry Torokhov <dtor@vmware.com>
Wed, 17 Apr 2013 19:16:55 +0000 (12:16 -0700)
. turn vgauth on for Windows
. changes in shared code that don't affect open-vm-tools functionality

`Signed-off-by: Dmitry Torokhov <dtor@vmware.com>

open-vm-tools/lib/include/msg.h
open-vm-tools/lib/include/vixCommands.h
open-vm-tools/lib/include/vm_basic_asm_x86_64.h
open-vm-tools/services/plugins/vix/vixTools.c

index b438e48199f0556c6f2f3ee937ccb67646b845f1..3fe1c4323b8565a8e733860169791857a9e90091 100644 (file)
@@ -36,6 +36,9 @@
 #include "msgid.h"
 #include "msgfmt.h"
 #include "msgList.h"
+#if defined VMX86_SERVER && !defined VMCORE
+#include "voblib.h"
+#endif
 
 
 #define INVALID_MSG_CODE (-1)
@@ -121,6 +124,22 @@ extern Msg_String const Msg_Severities[];
 void Msg_Append(const char *idFmt,
                 ...) PRINTF_DECL(1, 2);
 void Msg_AppendStr(const char *id);
+void Msg_AppendMsgList(const MsgList *msgs);
+
+static INLINE void
+Msg_AppendVobContext(void)
+{
+#if defined VMX86_SERVER && !defined VMCORE
+   /* inline to avoid lib/vob dependency unless necessary */
+   MsgList *msgs = NULL;
+
+   VobLib_CurrentContextMsgAppend(&msgs);
+   Msg_AppendMsgList(msgs);
+
+   MsgList_Free(msgs);
+#endif
+}
+
 void Msg_Post(MsgSeverity severity,
               const char *idFmt,
               ...) PRINTF_DECL(2, 3);
@@ -134,7 +153,6 @@ char *Msg_VFormat(const char *idFmt,
 unsigned Msg_Question(Msg_String const *buttons,
                       int defaultAnswer,
                       const char *idFmt, ...) PRINTF_DECL(3, 4);
-void Msg_AppendMsgList(const MsgList *msgs);
 
 /*
  * Unfortunately, gcc warns about both NULL and "" being passed as format
index f6fd2766250f2e78dce04c956c5eb7ce45a859df..d5fdd299b19f43dd700f34a4b77667818512105d 100644 (file)
@@ -99,14 +99,15 @@ enum VixCommonCommandOptionValues {
  * These are the flags set in the request Flags field.
  */
 enum {
-   VIX_REQUESTMSG_ONLY_RELOAD_NETWORKS                = 0x01,
-   VIX_REQUESTMSG_RETURN_ON_INITIATING_TOOLS_UPGRADE  = 0x02,
-   VIX_REQUESTMSG_RUN_IN_ANY_VMX_STATE                = 0x04,
-   VIX_REQUESTMSG_REQUIRES_INTERACTIVE_ENVIRONMENT    = 0x08,
-   VIX_REQUESTMSG_INCLUDES_AUTH_DATA_V1               = 0x10,
-   VIX_REQUESTMSG_REQUIRES_VMDB_NOTIFICATION          = 0x20,
-   VIX_REQUESTMSG_ESCAPE_XML_DATA                     = 0x40,
-   VIX_REQUESTMSG_HAS_HASHED_SHARED_SECRET            = 0x80,
+   VIX_REQUESTMSG_ONLY_RELOAD_NETWORKS                = 0x001,
+   VIX_REQUESTMSG_RETURN_ON_INITIATING_TOOLS_UPGRADE  = 0x002,
+   VIX_REQUESTMSG_RUN_IN_ANY_VMX_STATE                = 0x004,
+   VIX_REQUESTMSG_REQUIRES_INTERACTIVE_ENVIRONMENT    = 0x008,
+   VIX_REQUESTMSG_INCLUDES_AUTH_DATA_V1               = 0x010,
+   VIX_REQUESTMSG_REQUIRES_VMDB_NOTIFICATION          = 0x020,
+   VIX_REQUESTMSG_ESCAPE_XML_DATA                     = 0x040,
+   VIX_REQUESTMSG_HAS_HASHED_SHARED_SECRET            = 0x080,
+   VIX_REQUESTMSG_VIGOR_COMMAND                       = 0x100,
 };
 
 
index a395c1109d20bff6a12afc767646b7c559e9138a..4cd6aebe5fe220a72587f8b0adf325a7f055e52a 100644 (file)
@@ -71,23 +71,36 @@ uint64 __shiftright128(uint64 lowPart, uint64 highPart, uint8 shift);
 
 #endif // _MSC_VER
 
+#if defined(__GNUC__)
 /*
  * GET_CURRENT_RIP
  *
- * Return an approximation of the current instruction pointer. For example for a
- * function call
- * foo.c
- * L123: Foo(GET_CURRENT_RIP())
+ * Returns the current instruction pointer. In the example below:
+ *
+ *   foo.c
+ *   L123: Foo(GET_CURRENT_RIP())
  *
- * The return value from GET_CURRENT_RIP will point a debugger to L123.
+ * the return value from GET_CURRENT_RIP will point a debugger to L123.
  */
-#if defined(__GNUC__)
-#define GET_CURRENT_RIP() ({                                                   \
-      void *__rip;                                                             \
-      asm("lea 0(%%rip), %0;\n\t"                                              \
-         : "=r" (__rip));                                                      \
-      __rip;                                                                   \
+#define GET_CURRENT_RIP() ({                                          \
+      void *__rip;                                                    \
+      asm("lea 0(%%rip), %0;\n\t"                                     \
+         : "=r" (__rip));                                             \
+      __rip;                                                          \
 })
+
+/*
+ * GET_CURRENT_LOCATION
+ *
+ * Updates the arguments with the values of the %rip, %rbp, and %rsp
+ * registers at the current code location where the macro is invoked.
+ */
+#define GET_CURRENT_LOCATION(rip, rbp, rsp)                           \
+   asm("lea 0(%%rip), %0\n"                                           \
+       "mov %%rbp, %1\n"                                              \
+       "mov %%rsp, %2\n"                                              \
+       : "=r" (rip), "=r" (rbp), "=r" (rsp))
+
 #endif
 
 /*
index 6a28fcfc84c9a7e5ea1c81684e66dab2d476a52f..633bdeef708b6033e038f80ce3e046f71223cdfe 100644 (file)
 #endif
 
 /*
- * Only support Linux right now.
- *
- * On Windows, the SAML impersonation story is too shaky to trust,
- * and without that, there's no reason to support AliasManager APIs.
- *
  * No support for open-vm-tools.
  */
-#if defined(linux) && !defined(OPEN_VM_TOOLS)
+#if (defined(_WIN32) ||  defined(linux)) && !defined(OPEN_VM_TOOLS)
 #define SUPPORT_VGAUTH 1
 #else
 #define SUPPORT_VGAUTH 0