~n-muench/ubuntu/precise/open-vm-tools/open-vm-tools.raring-precise.backport

« back to all changes in this revision

Viewing changes to modules/linux/vmci/common/vmciQueuePair.h

  • Committer: Package Import Robot
  • Author(s): Nate Muench
  • Date: 2012-01-23 16:09:45 UTC
  • mfrom: (1.4.6) (2.4.26 sid)
  • Revision ID: package-import@ubuntu.com-20120123160945-b6s0r1vkcovucpf3
Tags: 2011.12.20-562307-0ubuntu1
* Merge latest upstream git tag. Fixes building on Precise
  (LP: #898289, LP: #905612)

* Items merged from Debian unstable:
  - debian/control:
    + open-vm-tools recommends open-vm-dkms. (LP: #598933)
    + open-vm-tools now suggests open-vm-toolbox. (LP: #604998)
  (From 2011.08.21-471295-1 release)
  - Updating maintainer and uploaders fields.
  - Removing vcs fields.
  - Removing references to Daniel's old email address.
  - Updating years in copyright file.
  - Updating to standards version 3.9.2.
  - Updating to debhelper version 8.
  - Switching to source format 3.0 (quilt).
  - Removing manual chrpath setting.
  - Removing exclusion from plugins from debhelper shlibs.
  - Rediffing kvers.patch.
  (From 2011.09.23-491607-1 release)
  - Marking binary architecture-dependend packages as linux and kfreebsd
  only.
  - Removing liburiparser-dev from build-depends as upstream dropped
  unity support.
  - Building with libproc-dev on amd64 again.
  - Dropping disabling of dnet support.
  (From 2011.09.23-491607-2 release)
  - Adding doxygen to build-depends for api documentation.
  - Adding libcunit1-dev to build-depends for test suites.
  - Minimizing rules file.
  - Adding open-vm-tools-dev package, containing only the api
    documentation for now.
  (From 2011.09.23-491607-3 release)
  - Sorting overrides in rules alphabetically.
  - Compacting copyright file.
  - Adding udev rule to set timeout for vmware scsi devices
  (From 2011.12.20-562307-1 release)
  - Adding patch to correct typo in upstreams dkms configuration

* Remaining Changes:
  - Remove Stable part of version numbering.
  - debian folder:
    + Re-added open-vm-dkms.postinst & open-vm-dkms.prerm.
      * Allows dkms modules to compile upon installation.
  - debian/control:
    + Re-add open-vm-source and make into a transitional package
      for open-vm-toolbox.
    + Return dependancies that were moved to open-vm-tools back to
      open-vm-toolbox.
  - debian/rules and debian/open-vm-toolbox.lintian-overrides:
    + Make vmware-user-suid-wrapper suid-root
  - debian/rules:
    + Added CFLAGS field with -Wno-deprecated-declarations
      * Will suppress issues with glib 2.31 or later.
    + Add line to copy vmware-xdg-detect-de into place.
    + Install vmware-user.desktop through toolbox package.
  - debian/open-vm-tools.init:
    + Re-add 'modprobe [-r] vmblock'.
    + Add 'modprobe [-r] vmxnet'.
      * Incase it's not loaded during boot.
    + Remove and re-add pcnet32 module
      * Will be done before (remove) and after (readd) vmxnet module
        is added.
      * If vmxnet doesn't exist (aka modules fail to build), pcnet32 can be
        still used for network connectivity.
      * Workaround until a better fix can be done.
  - Re-add gnome-session to debian/local/xautostart.conf
  - Manpages removed (from debian/manpages):
    + vmmemctl.9
    + vmxnet3.9
    + Remove references to manpages that have been removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include "includeCheck.h"
33
33
 
34
34
#include "vmci_defs.h"
 
35
#include "vmci_iocontrols.h"
 
36
#include "vmci_kernel_if.h"
35
37
#include "vmciContext.h"
36
 
#include "vmci_iocontrols.h"
37
38
#include "vmciQueue.h"
38
 
#ifdef VMKERNEL
39
 
#include "vm_atomic.h"
40
 
#include "util_copy_dist.h"
41
 
#include "shm.h"
42
39
 
43
40
/*
44
 
 * On vmkernel, the queue pairs are either backed by shared memory or
45
 
 * kernel memory allocated on the VMCI heap. Shared memory is used for
46
 
 * guest to guest and guest to host queue pairs, whereas the heap
47
 
 * allocated queue pairs are used for host local queue pairs.
 
41
 * QueuePairPageStore describes how the memory of a given queue pair
 
42
 * is backed. When the queue pair is between the host and a guest, the
 
43
 * page store consists of references to the guest pages. On vmkernel,
 
44
 * this is a list of PPNs, and on hosted, it is a user VA where the
 
45
 * queue pair is mapped into the VMX address space.
48
46
 */
49
47
 
50
48
typedef struct QueuePairPageStore {
51
 
   Bool shared; // Indicates whether the pages are stored in shared memory
52
 
   union {
53
 
      Shm_ID   shmID;
54
 
      void    *ptr;
55
 
   } store;
56
 
} QueuePairPageStore;
57
 
 
58
 
#else
59
 
 
60
 
typedef struct QueuePairPageStore {
61
 
   Bool user;                  // Whether the page file strings are userspace pointers
62
 
   VA64 producePageFile;       // Name of the file
63
 
   VA64 consumePageFile;       // Name of the file
64
 
   uint64 producePageFileSize; // Size of the string
65
 
   uint64 consumePageFileSize; // Size of the string
66
 
   VA64 producePageUVA;        // User space VA of the mapped file in VMX
67
 
   VA64 consumePageUVA;        // User space VA of the mapped file in VMX
68
 
} QueuePairPageStore;
69
 
 
70
 
#endif // !VMKERNEL
71
 
 
72
 
#if (defined(__linux__) || defined(_WIN32) || defined(__APPLE__) || \
73
 
     defined(SOLARIS)) && !defined(VMKERNEL)
74
 
struct VMCIQueue;
75
 
 
76
 
typedef struct PageStoreAttachInfo {
77
 
   char producePageFile[VMCI_PATH_MAX];
78
 
   char consumePageFile[VMCI_PATH_MAX];
79
 
   uint64 numProducePages;
80
 
   uint64 numConsumePages;
81
 
 
82
 
   /* User VAs in the VMX task */
83
 
   VA64   produceBuffer;
84
 
   VA64   consumeBuffer;
85
 
 
86
 
   /*
87
 
    * Platform-specific references to the physical pages backing the
88
 
    * queue. These include a page for the header.
89
 
    *
90
 
    * PR361589 tracks this, too.
91
 
    */
92
 
 
93
 
#if defined(__linux__)
94
 
   struct page **producePages;
95
 
   struct page **consumePages;
96
 
#elif defined(_WIN32)
97
 
   void *kmallocPtr;
98
 
   size_t kmallocSize;
99
 
   PMDL produceMDL;
100
 
   PMDL consumeMDL;
101
 
#elif defined(__APPLE__)
102
 
   /*
103
 
    * All the Mac OS X fields are members of the VMCIQueue
104
 
    */
105
 
#endif
106
 
} PageStoreAttachInfo;
107
 
 
108
 
#endif // (__linux__ || _WIN32 || __APPLE__) && !VMKERNEL
 
49
   VMCIQPGuestMem pages;  // Reference to pages backing the queue pair.
 
50
   uint32 len;            // Length of pageList/virtual addres range (in pages).
 
51
} QueuePairPageStore;
109
52
 
110
53
 
111
54
/*
128
71
static INLINE Bool
129
72
VMCI_QP_PAGESTORE_IS_WELLFORMED(QueuePairPageStore *pageStore) // IN
130
73
{
131
 
#ifdef VMKERNEL
132
 
   return (pageStore->shared && pageStore->store.shmID != SHM_INVALID_ID) ||
133
 
          (!pageStore->shared && pageStore->store.ptr != NULL);
134
 
#else
135
 
   return pageStore->producePageFile && pageStore->consumePageFile &&
136
 
          pageStore->producePageFileSize && pageStore->consumePageFileSize;
137
 
#endif // !VMKERNEL
 
74
  return pageStore->len >= 2;
138
75
}
139
76
 
140
77
int VMCIQPBroker_Init(void);
141
78
void VMCIQPBroker_Exit(void);
142
 
void VMCIQPBroker_Lock(void);
143
 
void VMCIQPBroker_Unlock(void);
144
79
int VMCIQPBroker_Alloc(VMCIHandle handle, VMCIId peer, uint32 flags,
145
80
                       VMCIPrivilegeFlags privFlags,
146
81
                       uint64 produceSize, uint64 consumeSize,
147
82
                       QueuePairPageStore *pageStore,
148
83
                       VMCIContext *context);
149
 
int VMCIQPBroker_SetPageStore(VMCIHandle handle,
150
 
                              QueuePairPageStore *pageStore,
 
84
int VMCIQPBroker_SetPageStore(VMCIHandle handle, VA64 produceUVA, VA64 consumeUVA,
151
85
                              VMCIContext *context);
152
 
int VMCIQPBroker_Detach(VMCIHandle handle, VMCIContext *context, Bool detach);
 
86
int VMCIQPBroker_Detach(VMCIHandle handle, VMCIContext *context);
153
87
 
154
88
int VMCIQPGuestEndpoints_Init(void);
155
89
void VMCIQPGuestEndpoints_Exit(void);
159
93
int VMCIQueuePair_Alloc(VMCIHandle *handle, VMCIQueue **produceQ,
160
94
                        uint64 produceSize, VMCIQueue **consumeQ,
161
95
                        uint64 consumeSize, VMCIId peer, uint32 flags,
162
 
                        VMCIPrivilegeFlags privFlags, Bool guestEndpoint);
 
96
                        VMCIPrivilegeFlags privFlags, Bool guestEndpoint,
 
97
                        VMCIEventReleaseCB wakeupCB, void *clientData);
163
98
int VMCIQueuePair_Detach(VMCIHandle handle, Bool guestEndpoint);
 
99
int VMCIQPBroker_Map(VMCIHandle  handle, VMCIContext *context, VMCIQPGuestMem guestMem);
 
100
int VMCIQPBroker_Unmap(VMCIHandle  handle, VMCIContext *context, VMCIGuestMemID gid);
164
101
 
165
102
 
166
103
#endif /* !_VMCI_QUEUE_PAIR_H_ */