/*********************************************************
- * Copyright (C) 2010-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2010-2019 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
iovIndex < iovCount && remainingSize > 0;
iovIndex++, mappedIovCount++) {
- iov[iovIndex].context = NULL;
-
/* Check: Iov in VMCI should never cross page boundary */
ASSERT(iov[iovIndex].len <= (PAGE_SIZE - PAGE_OFFSET(iov[iovIndex].pa)));
- iov[iovIndex].va = mapVa(iov[iovIndex].pa,
- iov[iovIndex].len,
- &iov[iovIndex].context);
+ iov[iovIndex].va = mapVa(&iov[iovIndex]);
if (NULL == iov[iovIndex].va) {
/* Failed to map the physical address. */
break;
for (iovIndex = startIndex, endIndex = startIndex + *mappedCount;
iovIndex < endIndex;
iovIndex++) {
- ASSERT(iov[iovIndex].context);
unmapVa(&iov[iovIndex].context);
- iov[iovIndex].context = NULL;
iov[iovIndex].va = NULL;
}
*mappedCount = 0;
/*********************************************************
- * Copyright (C) 1998-2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-2019 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
#ifndef _HGFS_SERVER_H_
#define _HGFS_SERVER_H_
-#include "hgfs.h" /* for HGFS_PACKET_MAX */
#include "dbllnklst.h"
+#include "hgfs.h" /* for HGFS_PACKET_MAX */
+#include "vm_basic_defs.h" /* for vmx86_debug */
#if defined(__cplusplus)
extern "C" {
#endif
+#define HGFS_VMX_IOV_CONTEXT_SIZE (vmx86_debug ? 112 : 96)
typedef struct HgfsVmxIov {
void *va; /* Virtual addr */
uint64 pa; /* Physical address passed by the guest */
uint32 len; /* length of data; should be <= PAGE_SIZE for VMCI; arbitrary for backdoor */
- void *context; /* Mapping context */
+ union {
+ void *ptr;
+ char clientStorage[HGFS_VMX_IOV_CONTEXT_SIZE];
+ } context; /* Mapping context */
} HgfsVmxIov;
typedef enum {
typedef Bool (*HgfsChannelSendFunc)(void *opaqueSession,
HgfsPacket *packet,
HgfsSendFlags flags);
-typedef void * (*HgfsChannelMapVirtAddrFunc)(uint64 pa, uint32 size, void **context);
-typedef void (*HgfsChannelUnmapVirtAddrFunc)(void **context);
+typedef void * (*HgfsChannelMapVirtAddrFunc)(HgfsVmxIov *iov);
+typedef void (*HgfsChannelUnmapVirtAddrFunc)(void *context);
typedef void (*HgfsChannelRegisterThreadFunc)(void);
typedef void (*HgfsChannelUnregisterThreadFunc)(void);