]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes in shared code that don't affect open-vm-tools functionality.
authorVMware, Inc <>
Tue, 19 Oct 2010 18:58:02 +0000 (11:58 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Tue, 19 Oct 2010 18:58:02 +0000 (11:58 -0700)
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/modules/linux/shared/vmciKernelAPI1.h
open-vm-tools/modules/linux/shared/vmci_kernel_if.h
open-vm-tools/modules/linux/vmci/vmciDatagram.c
open-vm-tools/modules/linux/vmci/vmciDatagram.h
open-vm-tools/modules/linux/vmci/vmciEvent.c
open-vm-tools/modules/linux/vmci/vmciEvent.h
open-vm-tools/modules/linux/vmci/vmciKernelIf.c
open-vm-tools/modules/linux/vmci/vmciNotifications.h
open-vm-tools/modules/linux/vmci/vmciQPair.c
open-vm-tools/modules/linux/vmci/vmciQueuePair.c

index dd7f9eaab24666dad12983177dae1903c852688a..75c866094b596da12cdd7869d66b6c7fd6316d66 100644 (file)
 #include "vmci_call_defs.h"
 
 
+/* VMCI module namespace on vmkernel. */
+
+#define MOD_VMCI_NAMESPACE "com.vmware.vmci"
+
 /* Define version 1. */
 
 #undef  VMCI_KERNEL_API_VERSION
index a06e208b317b75a6e1ec276d72413b751f675cb7..9bd20702562d4ef944bd0b0763334927c7a5173d 100644 (file)
  *********************************************************/
 
 /*
- * vmci_kernel_if.h -- 
- * 
+ * vmci_kernel_if.h --
+ *
  *      This file defines helper functions for VMCI host _and_ guest
  *      kernel code. It must work for Windows, Mac OS, vmkernel, Linux and
  *      Solaris kernels, i.e. using defines where necessary.
  */
+
 #ifndef _VMCI_KERNEL_IF_H_
 #define _VMCI_KERNEL_IF_H_
 
@@ -34,7 +34,7 @@
 
 #if defined(_WIN32)
 #include <ntddk.h>
-#endif 
+#endif
 
 #if defined(linux) && !defined(VMKERNEL)
 #  include <linux/wait.h>
@@ -52,6 +52,7 @@
 #ifdef VMKERNEL
 #include "splock.h"
 #include "semaphore_ext.h"
+#include "vmkapi.h"
 #endif
 
 #ifdef SOLARIS
@@ -75,7 +76,9 @@
 
 /* Platform specific type definitions. */
 
-#if defined(linux) && !defined(VMKERNEL)
+#if defined(VMKERNEL)
+#  define VMCI_EXPORT_SYMBOL(_SYMBOL)  VMK_MODULE_EXPORT_SYMBOL(_SYMBOL);
+#elif defined(linux)
 #  define VMCI_EXPORT_SYMBOL(_symbol)  EXPORT_SYMBOL(_symbol);
 #elif defined(__APPLE__)
 #  define VMCI_EXPORT_SYMBOL(_symbol)  __attribute__((visibility("default")))
@@ -125,7 +128,7 @@ typedef int (*VMCIEventReleaseCB)(void *clientData);
 /*
  * The VMCI locks use a ranking scheme similar to the one used by
  * vmkernel. While holding a lock L1 with rank R1, only locks with
- * rank higher than R1 may be grabbed. The available ranks for VMCI 
+ * rank higher than R1 may be grabbed. The available ranks for VMCI
  * locks are (in descending order):
  * - VMCI_LOCK_RANK_HIGH_BH : to be used for locks grabbed while executing
  *   in a bottom half and not held while grabbing other locks.
@@ -205,12 +208,12 @@ typedef struct VMCIHost {
 #elif defined(__APPLE__)
    struct Socket *socket; /* vmci Socket object on Mac OS. */
 #elif defined(_WIN32)
-   KEVENT *callEvent; /* Ptr to userlevel event used when signalling 
+   KEVENT *callEvent; /* Ptr to userlevel event used when signalling
                        * new pending guestcalls in kernel.
                        */
 #elif defined(SOLARIS)
    struct pollhead pollhead; /* Per datagram handle pollhead structure to
-                              * be treated as a black-box. None of its 
+                              * be treated as a black-box. None of its
                               * fields should be referenced.
                               */
 #endif
@@ -264,7 +267,7 @@ Bool VMCIWellKnownID_AllowMap(VMCIId wellKnownID,
 void VMCI_CreateEvent(VMCIEvent *event);
 void VMCI_DestroyEvent(VMCIEvent *event);
 void VMCI_SignalEvent(VMCIEvent *event);
-void VMCI_WaitOnEvent(VMCIEvent *event, VMCIEventReleaseCB releaseCB, 
+void VMCI_WaitOnEvent(VMCIEvent *event, VMCIEventReleaseCB releaseCB,
                      void *clientData);
 #if (defined(__APPLE__) || defined(__linux__) || defined(_WIN32)) && !defined(VMKERNEL)
 Bool VMCI_WaitOnEventInterruptible(VMCIEvent *event,
index 54e74c3215a7caa7dbdec1d4054eba599036d569..86d942da3d2d95e7df14e790cc0a43efbab4b9e1 100644 (file)
@@ -396,7 +396,7 @@ DatagramHandleUniqueLockedAnyCid(VMCIHandle handle) // IN
 /*
  *-----------------------------------------------------------------------------
  *
- * VMCIDatagramCreateHndInt --
+ * VMCIDatagram_CreateHnd --
  *
  *      Creates a datagram endpoint and returns a handle to it.
  *
@@ -409,13 +409,13 @@ DatagramHandleUniqueLockedAnyCid(VMCIHandle handle) // IN
  *-----------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIDatagramCreateHndInt)
+VMCI_EXPORT_SYMBOL(VMCIDatagram_CreateHnd)
 int
-VMCIDatagramCreateHndInt(VMCIId resourceID,          // IN:
-                         uint32 flags,               // IN:
-                         VMCIDatagramRecvCB recvCB,  // IN:
-                         void *clientData,           // IN:
-                         VMCIHandle *outHandle)      // OUT:
+VMCIDatagram_CreateHnd(VMCIId resourceID,          // IN
+                       uint32 flags,               // IN
+                       VMCIDatagramRecvCB recvCB,  // IN
+                       void *clientData,           // IN
+                       VMCIHandle *outHandle)      // OUT
 {
    int result;
    DatagramHashEntry *entry;
@@ -500,34 +500,6 @@ VMCIDatagramCreateHndInt(VMCIId resourceID,          // IN:
 }
 
 
-/*
- *-----------------------------------------------------------------------------
- *
- * VMCIDatagram_CreateHnd --
- *
- *      Creates a datagram endpoint and returns a handle to it.
- *
- * Results:
- *      Returns handle if success, negative errno value otherwise.
- *
- * Side effects:
- *      Datagram endpoint is created both in guest and on host.
- *
- *-----------------------------------------------------------------------------
- */
-
-VMCI_EXPORT_SYMBOL(VMCIDatagram_CreateHnd)
-int
-VMCIDatagram_CreateHnd(VMCIId resourceID,          // IN:
-                       uint32 flags,               // IN:
-                       VMCIDatagramRecvCB recvCB,  // IN:
-                       void *clientData,           // IN:
-                       VMCIHandle *outHandle)      // OUT:
-{
-   return VMCIDatagramCreateHndInt(resourceID, flags, recvCB, clientData, outHandle);
-}
-
-
 /*
  *-----------------------------------------------------------------------------
  *
@@ -562,38 +534,7 @@ VMCIDatagram_CreateHndPriv(VMCIId resourceID,            // IN:
 /*
  *-----------------------------------------------------------------------------
  *
- * VMCIDatagramCreateHndPriv --
- *
- *      API provided for compatibility with the host vmci API. This function
- *      doesn't ever succeed since you can't ask for elevated privileges from
- *      the guest. Use VMCIDatagramCreateHndInt instead.
- *
- * Results:
- *      Returns VMCI_ERROR_NO_ACCESS.
- *
- * Side effects:
- *      None.
- *
- *-----------------------------------------------------------------------------
- */
-
-VMCI_EXPORT_SYMBOL(VMCIDatagramCreateHndPriv)
-int
-VMCIDatagramCreateHndPriv(VMCIId resourceID,            // IN:
-                          uint32 flags,                 // IN:
-                          VMCIPrivilegeFlags privFlags, // IN:
-                          VMCIDatagramRecvCB recvCB,    // IN:
-                          void *clientData,             // IN:
-                          VMCIHandle *outHandle)        // OUT:
-{
-   return VMCI_ERROR_NO_ACCESS;
-}
-
-
-/*
- *-----------------------------------------------------------------------------
- *
- * VMCIDatagramDestroyHndInt --
+ * VMCIDatagram_DestroyHnd --
  *
  *      Destroys a handle.
  *
@@ -606,9 +547,9 @@ VMCIDatagramCreateHndPriv(VMCIId resourceID,            // IN:
  *-----------------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIDatagramDestroyHndInt)
+VMCI_EXPORT_SYMBOL(VMCIDatagram_DestroyHnd)
 int
-VMCIDatagramDestroyHndInt(VMCIHandle handle)       // IN
+VMCIDatagram_DestroyHnd(VMCIHandle handle)       // IN
 {
    DatagramHashEntry *entry = DatagramHashGetEntry(handle);
    if (entry == NULL) {
@@ -648,30 +589,6 @@ VMCIDatagramDestroyHndInt(VMCIHandle handle)       // IN
 }
 
 
-/*
- *-----------------------------------------------------------------------------
- *
- * VMCIDatagram_DestroyHnd --
- *
- *      Destroys a handle.
- *
- * Results:
- *      VMCI_SUCCESS or error code.
- *
- * Side effects:
- *      Host and guest state is cleaned up.
- *
- *-----------------------------------------------------------------------------
- */
-
-VMCI_EXPORT_SYMBOL(VMCIDatagram_DestroyHnd)
-int
-VMCIDatagram_DestroyHnd(VMCIHandle handle)       // IN
-{
-   return VMCIDatagramDestroyHndInt(handle);
-}
-
-
 /*
  *-----------------------------------------------------------------------------
  *
index 4837c86f8abc5086c3eb7f05d65024bfc93d07b8..8907af499c2e956af805e6db05b77acc469123af 100644 (file)
@@ -41,19 +41,6 @@ void VMCIDatagram_Init(void);
 Bool VMCIDatagram_CheckHostCapabilities(void);
 int VMCIDatagram_Dispatch(VMCIId contextID, VMCIDatagram *msg);
 
-int VMCIDatagramCreateHndInt(VMCIId resourceID,
-                             uint32 flags,
-                             VMCIDatagramRecvCB recvCB,
-                             void *clientData,
-                             VMCIHandle *outHandle);
-int VMCIDatagramCreateHndPriv(VMCIId resourceID,
-                              uint32 flags,
-                              VMCIPrivilegeFlags privFlags,
-                              VMCIDatagramRecvCB recvCB,
-                              void *clientData,
-                              VMCIHandle *outHandle); /* Compat */
-int VMCIDatagramDestroyHndInt(VMCIHandle handle);
-
 int VMCIDatagramProcess_Create(VMCIDatagramProcess **outDgmProc,
                                VMCIDatagramCreateProcessInfo *createInfo,
                                uintptr_t eventHnd);
index f6bf5cf6f31ef0a1bbedce329c9c5addad16659a..a03c8fcd15ac2ae86ead2f2848bc2f4c7ce1f0a1 100644 (file)
@@ -622,7 +622,7 @@ VMCIEventUnregisterSubscription(VMCIId subID)    // IN
 /*
  *----------------------------------------------------------------------
  *
- * VMCIEventSubscribe --
+ * VMCIEvent_Subscribe --
  *
  *      Subscribe to given event. The callback specified can be fired
  *      in different contexts depending on what flag is specified while
@@ -642,13 +642,13 @@ VMCIEventUnregisterSubscription(VMCIId subID)    // IN
  *----------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIEventSubscribe)
+VMCI_EXPORT_SYMBOL(VMCIEvent_Subscribe)
 int
-VMCIEventSubscribe(VMCI_Event event,        // IN
-                   uint32 flags,            // IN
-                   VMCI_EventCB callback,   // IN
-                   void *callbackData,      // IN
-                   VMCIId *subscriptionID)  // OUT
+VMCIEvent_Subscribe(VMCI_Event event,        // IN
+                    uint32 flags,            // IN
+                    VMCI_EventCB callback,   // IN
+                    void *callbackData,      // IN
+                    VMCIId *subscriptionID)  // OUT
 {
    int retval;
    VMCISubscription *s = NULL;
@@ -675,41 +675,10 @@ VMCIEventSubscribe(VMCI_Event event,        // IN
 }
 
 
-#ifndef VMKERNEL
 /*
  *----------------------------------------------------------------------
  *
- * VMCIEvent_Subscribe --
- *
- *      Subscribe to given event.
- *
- * Results:
- *      VMCI_SUCCESS on success, error code otherwise.
- *
- * Side effects:
- *      None.
- *
- *----------------------------------------------------------------------
- */
-
-VMCI_EXPORT_SYMBOL(VMCIEvent_Subscribe)
-int
-VMCIEvent_Subscribe(VMCI_Event event,        // IN
-                    uint32 flags,            // IN
-                    VMCI_EventCB callback,   // IN
-                    void *callbackData,      // IN
-                    VMCIId *subscriptionID)  // OUT
-{
-   return VMCIEventSubscribe(event, flags, callback, callbackData,
-                             subscriptionID);
-}
-#endif /* !VMKERNEL  */
-
-
-/*
- *----------------------------------------------------------------------
- *
- * VMCIEventUnsubscribe --
+ * VMCIEvent_Unsubscribe --
  *
  *      Unsubscribe to given event. Removes it from list and frees it.
  *      Will return callbackData if requested by caller.
@@ -723,9 +692,9 @@ VMCIEvent_Subscribe(VMCI_Event event,        // IN
  *----------------------------------------------------------------------
  */
 
-VMCI_EXPORT_SYMBOL(VMCIEventUnsubscribe)
+VMCI_EXPORT_SYMBOL(VMCIEvent_Unsubscribe)
 int
-VMCIEventUnsubscribe(VMCIId subID)   // IN
+VMCIEvent_Unsubscribe(VMCIId subID)   // IN
 {
    VMCISubscription *s;
 
@@ -742,31 +711,3 @@ VMCIEventUnsubscribe(VMCIId subID)   // IN
 
    return VMCI_SUCCESS;
 }
-
-
-#ifndef VMKERNEL
-/*
- *----------------------------------------------------------------------
- *
- * VMCIEvent_Unsubscribe --
- *
- *      Unsubscribe to given event. Removes it from list and frees it.
- *      Will return callbackData if requested by caller.
- *
- * Results:
- *      VMCI_SUCCESS on success, error code otherwise.
- *
- * Side effects:
- *      None.
- *
- *----------------------------------------------------------------------
- */
-
-VMCI_EXPORT_SYMBOL(VMCIEvent_Unsubscribe)
-int
-VMCIEvent_Unsubscribe(VMCIId subID)   // IN
-{
-   return VMCIEventUnsubscribe(subID);
-}
-
-#endif /* !VMKERNEL  */
index 5e784b895cc7fc03023d292189f61b55050c0b52..fb075d924a81853393123431738c850a7ae4a24f 100644 (file)
@@ -33,7 +33,6 @@
 
 #include "vmci_defs.h"
 #include "vmci_call_defs.h"
-#include "vmciKernelAPI.h"
 
 void VMCIEvent_Init(void);
 void VMCIEvent_Exit(void);
@@ -42,12 +41,4 @@ int  VMCIEvent_Dispatch(VMCIDatagram *msg);
 Bool VMCIEvent_CheckHostCapabilities(void);
 #endif
 
-/*
- * Non-public VMCI Event API for the kernel.
- */
-
-int VMCIEventSubscribe(VMCI_Event event, uint32 flags, VMCI_EventCB callback,
-                        void *callbackData, VMCIId *subID);
-int VMCIEventUnsubscribe(VMCIId subID);
-
 #endif //__VMCI_EVENT_H__
index 86445b414c4732af5524d01920c8adb61da123a6..566d441b34e85ebc9c908ebc8c2de868be620d96 100644 (file)
  *********************************************************/
 
 /*
- * vmciKernelIf.c -- 
- * 
+ * vmciKernelIf.c --
+ *
  *      This file implements defines and helper functions for VMCI
  *      host _and_ guest kernel code. This is the linux specific
  *      implementation.
- */ 
+ */
 
 /* Must come before any kernel header file */
 #include "driver-config.h"
@@ -35,9 +35,6 @@
 #  error "Linux kernels before 2.6.9 are not supported."
 #endif
 
-#define EXPORT_SYMTAB
-#define __NO_VERSION__
-
 #include <linux/mm.h>           /* For vmalloc_to_page() and get_user_pages()*/
 #include <linux/pagemap.h>      /* For page_cache_release() */
 #include <linux/socket.h>       /* For memcpy_{to,from}iovec(). */
@@ -1333,8 +1330,6 @@ __VMCIMemcpyFromQueue(void *dest,             // OUT:
  *-----------------------------------------------------------------------------
  */
 
-EXPORT_SYMBOL(VMCIMemcpyToQueue);
-
 int
 VMCIMemcpyToQueue(VMCIQueue *queue,   // OUT:
                   uint64 queueOffset, // IN:
@@ -1364,8 +1359,6 @@ VMCIMemcpyToQueue(VMCIQueue *queue,   // OUT:
  *-----------------------------------------------------------------------------
  */
 
-EXPORT_SYMBOL(VMCIMemcpyFromQueue);
-
 int
 VMCIMemcpyFromQueue(void *dest,             // OUT:
                     size_t destOffset,      // IN:
@@ -1395,8 +1388,6 @@ VMCIMemcpyFromQueue(void *dest,             // OUT:
  *----------------------------------------------------------------------------
  */
 
-EXPORT_SYMBOL(VMCIMemcpyToQueueV);
-
 int
 VMCIMemcpyToQueueV(VMCIQueue *queue,      // OUT:
                    uint64 queueOffset,    // IN:
@@ -1430,8 +1421,6 @@ VMCIMemcpyToQueueV(VMCIQueue *queue,      // OUT:
  *----------------------------------------------------------------------------
  */
 
-EXPORT_SYMBOL(VMCIMemcpyFromQueueV);
-
 int
 VMCIMemcpyFromQueueV(void *dest,              // OUT: iovec
                      size_t destOffset,       // IN: ignored
index 09c3da57d83333393b4efb7dbc7bc5da744c3c57..6c39ff81a284365aa390a383b2d229c83b7d5aa6 100644 (file)
 #ifndef _VMCI_NOTIFICATIONS_H_
 #define _VMCI_NOTIFICATIONS_H_
 
+#include "vm_basic_types.h"
+#include "vmci_defs.h"
+#include "vmciKernelAPI.h"
+
 void VMCINotifications_Init(void);
 void VMCINotifications_Exit(void);
 
index fbfa0ab494d78990c7eca73bb8b3dfbb9bc90f94..b977a987f816c3d734a2dfe04cdfed9852042563 100644 (file)
@@ -63,7 +63,6 @@
 
 /* Must come before any kernel header file. */
 #if defined(__linux__) && !defined(VMKERNEL)
-#  define EXPORT_SYMTAB
 #  include "driver-config.h"
 #  include "compat_module.h"
 #endif
@@ -987,4 +986,3 @@ VMCIQPair_PeekV(VMCIQPair *qpair,           // IN
 }
 
 #endif /* Systems that support struct iovec */
-
index c97e286b74d9574ceba28bef4d62739e25960b91..5f54eb31b4cf6c0d6f8aeb014c0f1b09cee7b92a 100644 (file)
 
 #include "vm_assert.h"
 #include "vmci_kernel_if.h"
+#include "vmciEvent.h"
+#include "vmciInt.h"
+#include "vmciKernelAPI.h"
 #include "vmciQueuePairInt.h"
 #include "vmciUtil.h"
-#include "vmciInt.h"
-#include "vmciEvent.h"
 #include "circList.h"
 
 #define LGPFX "VMCIQueuePair: "