uint64 dummy;
__asm__ __volatile__(
+#ifdef __APPLE__
+ /*
+ * Save %rbx on the stack because the Mac OS GCC doesn't want us to
+ * clobber it - it erroneously thinks %rbx is the PIC register.
+ * (Radar bug 7304232)
+ */
+ "pushq %%rbx" "\n\t"
+#endif
"pushq %%rax" "\n\t"
"movq 40(%%rax), %%rdi" "\n\t"
"movq 32(%%rax), %%rsi" "\n\t"
"movq %%rdx, 24(%%rax)" "\n\t"
"movq %%rcx, 16(%%rax)" "\n\t"
"movq %%rbx, 8(%%rax)" "\n\t"
- "popq (%%rax)"
+ "popq (%%rax)" "\n\t"
+#ifdef __APPLE__
+ "popq %%rbx" "\n\t"
+#endif
: "=a" (dummy)
: "0" (myBp)
/*
* vmware can modify the whole VM state without the compiler knowing
* it. So far it does not modify EFLAGS. --hpreg
*/
- : "rbx", "rcx", "rdx", "rsi", "rdi", "memory"
+ :
+#ifndef __APPLE__
+ /* %rbx is unchanged at the end of the function on Mac OS. */
+ "rbx",
+#endif
+ "rcx", "rdx", "rsi", "rdi", "memory"
);
}
__asm__ __volatile__(
"pushq %%rbp" "\n\t"
-
+#ifdef __APPLE__
+ /*
+ * Save %rbx on the stack because the Mac OS GCC doesn't want us to
+ * clobber it - it erroneously thinks %rbx is the PIC register.
+ * (Radar bug 7304232)
+ */
+ "pushq %%rbx" "\n\t"
+#endif
"pushq %%rax" "\n\t"
"movq 48(%%rax), %%rbp" "\n\t"
"movq 40(%%rax), %%rdi" "\n\t"
"movq %%rcx, 16(%%rax)" "\n\t"
"movq %%rbx, 8(%%rax)" "\n\t"
"popq (%%rax)" "\n\t"
-
+#ifdef __APPLE__
+ "popq %%rbx" "\n\t"
+#endif
"popq %%rbp"
: "=a" (dummy)
: "0" (myBp)
* vmware can modify the whole VM state without the compiler knowing
* it. --hpreg
*/
- : "rbx", "rcx", "rdx", "rsi", "rdi", "memory", "cc"
+ :
+#ifndef __APPLE__
+ /* %rbx is unchanged at the end of the function on Mac OS. */
+ "rbx",
+#endif
+ "rcx", "rdx", "rsi", "rdi", "memory", "cc"
);
}
__asm__ __volatile__(
"pushq %%rbp" "\n\t"
-
+#ifdef __APPLE__
+ /*
+ * Save %rbx on the stack because the Mac OS GCC doesn't want us to
+ * clobber it - it erroneously thinks %rbx is the PIC register.
+ * (Radar bug 7304232)
+ */
+ "pushq %%rbx" "\n\t"
+#endif
"pushq %%rax" "\n\t"
"movq 48(%%rax), %%rbp" "\n\t"
"movq 40(%%rax), %%rdi" "\n\t"
"movq %%rcx, 16(%%rax)" "\n\t"
"movq %%rbx, 8(%%rax)" "\n\t"
"popq (%%rax)" "\n\t"
-
+#ifdef __APPLE__
+ "popq %%rbx" "\n\t"
+#endif
"popq %%rbp"
: "=a" (dummy)
: "0" (myBp)
- : "rbx", "rcx", "rdx", "rsi", "rdi", "memory", "cc"
+ :
+#ifndef __APPLE__
+ /* %rbx is unchanged at the end of the function on Mac OS. */
+ "rbx",
+#endif
+ "rcx", "rdx", "rsi", "rdi", "memory", "cc"
);
}
}
return ret;
}
-#endif
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * File_GetVMFSMountInfo --
+ *
+ * Acquire the FS mount point info such as fsType, major version,
+ * local mount point (/vmfs/volumes/xyz), and for NFS,
+ * remote IP and remote mount point for a given file.
+ *
+ * Results:
+ * Integer return value and allocated data
+ *
+ * Side effects:
+ * Only implemented on ESX. Will fail on other platforms.
+ * remoteIP and remoteMountPoint are only populated for files on NFS.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+File_GetVMFSMountInfo(ConstUnicode pathName,
+ char **fsType,
+ uint32 *version,
+ char **remoteIP,
+ char **remoteMountPoint,
+ char **localMountPoint)
+{
+ int ret;
+ int len;
+ FS_PartitionListResult *fsAttrs;
+
+ *localMountPoint = File_GetUniqueFileSystemID(pathName);
+
+ if (*localMountPoint == NULL) {
+ return -1;
+ }
+
+ // Get file IP and mount point
+ ret = File_GetVMFSAttributes(pathName, &fsAttrs);
+ if (ret >= 0 && fsAttrs) {
+ *version = fsAttrs->versionNumber;
+ *fsType = Util_SafeStrdup(fsAttrs->fsType);
+
+ if (strncmp(fsAttrs->fsType, "NFS", sizeof("NFS")) == 0) {
+ len = strlen(fsAttrs->logicalDevice);
+ *remoteIP = Util_SafeMalloc(len);
+ *remoteMountPoint = Util_SafeMalloc(len);
+ sscanf(fsAttrs->logicalDevice, "%s %s", *remoteIP, *remoteMountPoint);
+ } else {
+ *remoteIP = NULL;
+ *remoteMountPoint = NULL;
+ }
+ }
+
+ free(fsAttrs);
+ return ret;
+}
+
+#endif
/*
#elif defined VMX86_SERVER
EXTERN int File_GetVMFSBlockSize(ConstUnicode pathName, uint32 *blockSize);
EXTERN int File_GetVMFSfsType(ConstUnicode pathName, char **fsType);
+EXTERN int File_GetVMFSMountInfo(ConstUnicode pathName,
+ char **fsType,
+ uint32 *version,
+ char **remoteIP,
+ char **remoteMountPoint,
+ char **localMountPoint);
#endif
EXTERN Bool File_Exists(ConstUnicode pathName);
Bool W32Util_VerifyXPModeHostLicense(void);
+Unicode W32Util_GetPipeNameFromFilePath(ConstUnicode fileName);
+
#endif // _WIN32
#endif // WIN32UTIL_H_
#include "vmware_pack_end.h"
SCSIVerify10Cmd;
+typedef
+#include "vmware_pack_begin.h"
+struct {
+ uint8 opcode;
+ uint8 relAdr :1, // relative address
+ bytChk :1, // byte
+ blkvfy :1, // blank blocks verification, scsi-2 rev 8.
+ :1,
+ dpo :1, // cache control bit
+ resvd :3; // reserved
+ uint64 lbn; // logical block address
+ uint32 length; // verification length
+ uint8 reserved;
+ uint8 control; // control byte
+}
+#include "vmware_pack_end.h"
+SCSIVerify16Cmd;
+
typedef
#include "vmware_pack_begin.h"
struct {
#else
-# define compat_netif_napi_add(dev, napi, pollcb, quota) \
- do { \
- (dev)->poll = (pollcb); \
- (dev)->weight = (quota);\
- } while (0)
# define compat_napi_schedule(dev, napi) netif_rx_schedule(dev)
# define compat_napi_enable(dev, napi) netif_poll_enable(dev)
# define compat_napi_disable(dev, napi) netif_poll_disable(dev)
/* RedHat ported GRO to 2.6.18 bringing new napi_struct with it */
# if defined NETIF_F_GRO
# define compat_napi_complete(dev, napi) napi_complete(napi)
+# define compat_netif_napi_add(netdev, napi, pollcb, quota) \
+ do { \
+ (netdev)->poll = (pollcb); \
+ (netdev)->weight = (quota);\
+ (napi)->dev = (netdev); \
+ } while (0)
+
# else
# define compat_napi_complete(dev, napi) netif_rx_complete(dev)
struct napi_struct {
int dummy;
};
+# define compat_netif_napi_add(dev, napi, pollcb, quota) \
+ do { \
+ (dev)->poll = (pollcb); \
+ (dev)->weight = (quota);\
+ } while (0)
+
# endif
#endif
#define NPA_PLUGIN_NUMPAGES 64
#define NPA_MEMIO_NUMPAGES 32
+#define NPA_SHARED_NUMPAGES 6
#define VMXNET3_NPA_CMD_SUCCESS 0
#define VMXNET3_NPA_CMD_FAILURE 1
#define VMXNET3_PLUGIN_INFO_LEN 32
#include "vmware_pack_end.h"
NPA_MemioPages;
+typedef
+#include "vmware_pack_begin.h"
+struct NPA_SharedPages {
+ PPN64 startPPN;
+ uint32 numPages;
+}
+#include "vmware_pack_end.h"
+NPA_SharedPages;
+
typedef
#include "vmware_pack_begin.h"
struct NPA_PluginConf {
NPA_PluginPages pluginPages;
NPA_MemioPages memioPages;
+ NPA_SharedPages sharedPages;
uint64 entryVA; // address of entry function in the plugin
uint32 deviceInfo[VMXNET3_PLUGIN_INFO_LEN]; // opaque data returned by PF driver
}
/* Notify the device */
mutex_enter(&dp->txLock);
if (txqCtrl->txNumDeferred >= txqCtrl->txThreshold) {
- VMXNET3_BAR0_PUT32(dp, VMXNET3_REG_TXPROD, cmdRing->next2fill);
txqCtrl->txNumDeferred = 0;
+ VMXNET3_BAR0_PUT32(dp, VMXNET3_REG_TXPROD, cmdRing->next2fill);
}
mutex_exit(&dp->txLock);