]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Hide VMCI symbols and only export that are needed.
authorVMware, Inc <>
Mon, 20 Sep 2010 17:50:34 +0000 (10:50 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Mon, 20 Sep 2010 17:50:34 +0000 (10:50 -0700)
Hiding all the VMCI symbols by default and only exporting
the ones that are needed.

Also changed few usage of private symbols in vsock with public
ones. I mostly tried to export all the symbols that were exported
for linux.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/modules/linux/shared/vmci_kernel_if.h
open-vm-tools/modules/linux/vmci/vmciDatagram.c
open-vm-tools/modules/linux/vmci/vmciEvent.c
open-vm-tools/modules/linux/vmci/vmciGuestDs.c
open-vm-tools/modules/linux/vmci/vmciNotifications.c
open-vm-tools/modules/linux/vmci/vmciQPair.c
open-vm-tools/modules/linux/vmci/vmciUtil.c

index 74e44336802ad1cab56890b09d0027f5a130da8d..81534fe907f460ab77f6bb437afbc892a8975645 100644 (file)
 
 /* Platform specific type definitions. */
 
+#if defined(linux) && !defined(VMKERNEL)
+#  define VMCI_EXPORT_SYMBOL(_symbol)  EXPORT_SYMBOL(_symbol);
+#elif defined(__APPLE__)
+#  define VMCI_EXPORT_SYMBOL(_symbol)  __attribute__((visibility("default")))
+#else
+#  define VMCI_EXPORT_SYMBOL(_symbol)
+#endif
+
 #if defined(VMKERNEL)
   typedef SP_SpinLock VMCILock;
   typedef SP_IRQL VMCILockFlags;
index 1174453f72c0952e4a9ae0042f97d37fe62ad8f6..54e74c3215a7caa7dbdec1d4054eba599036d569 100644 (file)
@@ -409,6 +409,7 @@ DatagramHandleUniqueLockedAnyCid(VMCIHandle handle) // IN
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIDatagramCreateHndInt)
 int
 VMCIDatagramCreateHndInt(VMCIId resourceID,          // IN:
                          uint32 flags,               // IN:
@@ -515,10 +516,7 @@ VMCIDatagramCreateHndInt(VMCIId resourceID,          // IN:
  *-----------------------------------------------------------------------------
  */
 
-#ifdef __linux__
-EXPORT_SYMBOL(VMCIDatagram_CreateHnd);
-#endif
-
+VMCI_EXPORT_SYMBOL(VMCIDatagram_CreateHnd)
 int
 VMCIDatagram_CreateHnd(VMCIId resourceID,          // IN:
                        uint32 flags,               // IN:
@@ -548,10 +546,7 @@ VMCIDatagram_CreateHnd(VMCIId resourceID,          // IN:
  *-----------------------------------------------------------------------------
  */
 
-#ifdef __linux__
-EXPORT_SYMBOL(VMCIDatagram_CreateHndPriv);
-#endif
-
+VMCI_EXPORT_SYMBOL(VMCIDatagram_CreateHndPriv)
 int
 VMCIDatagram_CreateHndPriv(VMCIId resourceID,            // IN:
                            uint32 flags,                 // IN:
@@ -582,6 +577,7 @@ VMCIDatagram_CreateHndPriv(VMCIId resourceID,            // IN:
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIDatagramCreateHndPriv)
 int
 VMCIDatagramCreateHndPriv(VMCIId resourceID,            // IN:
                           uint32 flags,                 // IN:
@@ -610,6 +606,7 @@ VMCIDatagramCreateHndPriv(VMCIId resourceID,            // IN:
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIDatagramDestroyHndInt)
 int
 VMCIDatagramDestroyHndInt(VMCIHandle handle)       // IN
 {
@@ -667,10 +664,7 @@ VMCIDatagramDestroyHndInt(VMCIHandle handle)       // IN
  *-----------------------------------------------------------------------------
  */
 
-#ifdef __linux__
-EXPORT_SYMBOL(VMCIDatagram_DestroyHnd);
-#endif
-
+VMCI_EXPORT_SYMBOL(VMCIDatagram_DestroyHnd)
 int
 VMCIDatagram_DestroyHnd(VMCIHandle handle)       // IN
 {
@@ -694,10 +688,7 @@ VMCIDatagram_DestroyHnd(VMCIHandle handle)       // IN
  *-----------------------------------------------------------------------------
  */
 
-#ifdef __linux__
-EXPORT_SYMBOL(VMCIDatagram_Send);
-#endif
-
+VMCI_EXPORT_SYMBOL(VMCIDatagram_Send)
 int
 VMCIDatagram_Send(VMCIDatagram *msg) // IN
 {
index 1932c13996fa1d8e43505fae64d4aa71a87f61cb..f6bf5cf6f31ef0a1bbedce329c9c5addad16659a 100644 (file)
@@ -642,6 +642,7 @@ VMCIEventUnregisterSubscription(VMCIId subID)    // IN
  *----------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIEventSubscribe)
 int
 VMCIEventSubscribe(VMCI_Event event,        // IN
                    uint32 flags,            // IN
@@ -691,10 +692,7 @@ VMCIEventSubscribe(VMCI_Event event,        // IN
  *----------------------------------------------------------------------
  */
 
-#if defined(__linux__)
-EXPORT_SYMBOL(VMCIEvent_Subscribe);
-#endif
-
+VMCI_EXPORT_SYMBOL(VMCIEvent_Subscribe)
 int
 VMCIEvent_Subscribe(VMCI_Event event,        // IN
                     uint32 flags,            // IN
@@ -725,6 +723,7 @@ VMCIEvent_Subscribe(VMCI_Event event,        // IN
  *----------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIEventUnsubscribe)
 int
 VMCIEventUnsubscribe(VMCIId subID)   // IN
 {
@@ -763,10 +762,7 @@ VMCIEventUnsubscribe(VMCIId subID)   // IN
  *----------------------------------------------------------------------
  */
 
-#if defined(__linux__)
-EXPORT_SYMBOL(VMCIEvent_Unsubscribe);
-#endif
-
+VMCI_EXPORT_SYMBOL(VMCIEvent_Unsubscribe)
 int
 VMCIEvent_Unsubscribe(VMCIId subID)   // IN
 {
index 46942d5c06804fa5ccc3e0e4cfc0ef08813e4b79..62ce12750a3ceaa54fd08e8a4d6bb3a5c06049b5 100644 (file)
@@ -84,10 +84,7 @@ static int VMCIDsRecvCB(void *clientData, struct VMCIDatagram *msg);
  *-------------------------------------------------------------------------
  */
 
-#ifdef __linux__
-EXPORT_SYMBOL(VMCIDs_Lookup);
-#endif
-
+VMCI_EXPORT_SYMBOL(VMCIDs_Lookup)
 int
 VMCIDs_Lookup(const char *name,          // IN
               VMCIHandle *out)    //
index 90f9b7990b18fbd62a52befa45167372f942229a..fdbbd56ccacc00bd378cb799acbf503160986b0f 100644 (file)
@@ -951,6 +951,7 @@ VMCI_ScanNotificationBitmap(uint8 *bitmap) // IN
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIDoorbell_Create)
 int
 VMCIDoorbell_Create(VMCIHandle *handle,            // IN
                     uint32 flags,                  // IN
@@ -969,10 +970,6 @@ VMCIDoorbell_Create(VMCIHandle *handle,            // IN
                                    notifyCB, clientData);
 }
 
-#if defined(__linux__)
-EXPORT_SYMBOL(VMCIDoorbell_Create);
-#endif
-
 
 /*
  *-----------------------------------------------------------------------------
@@ -992,6 +989,7 @@ EXPORT_SYMBOL(VMCIDoorbell_Create);
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIDoorbell_Destroy)
 int
 VMCIDoorbell_Destroy(VMCIHandle handle) // IN
 {
@@ -1001,10 +999,6 @@ VMCIDoorbell_Destroy(VMCIHandle handle) // IN
    return VMCINotificationUnregister(handle, TRUE);
 }
 
-#if defined(__linux__)
-EXPORT_SYMBOL(VMCIDoorbell_Destroy);
-#endif
-
 
 /*
  *-----------------------------------------------------------------------------
@@ -1023,6 +1017,7 @@ EXPORT_SYMBOL(VMCIDoorbell_Destroy);
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIDoorbell_Notify)
 int
 VMCIDoorbell_Notify(VMCIHandle handle,             // IN
                     VMCIPrivilegeFlags privFlags)  // IN: Unused in guest
@@ -1048,9 +1043,6 @@ VMCIDoorbell_Notify(VMCIHandle handle,             // IN
    return result;
 }
 
-#if defined(__linux__)
-EXPORT_SYMBOL(VMCIDoorbell_Notify);
-#endif
 
 #else // defined(SOLARIS) || defined(__APPLE__)
 
@@ -1071,9 +1063,10 @@ EXPORT_SYMBOL(VMCIDoorbell_Notify);
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIDoorbell_Create)
 int
 VMCIDoorbell_Create(VMCIHandle *handle,            // IN
-                    uint32 flags,                  // IN
+                    uint32 flags,                  // I
                     VMCIPrivilegeFlags privFlags,  // IN
                     VMCICallback notifyCB,         // IN
                     void *clientData)              // IN
@@ -1082,6 +1075,7 @@ VMCIDoorbell_Create(VMCIHandle *handle,            // IN
 }
 
 
+VMCI_EXPORT_SYMBOL(VMCIDoorbell_Destroy)
 int
 VMCIDoorbell_Destroy(VMCIHandle handle)  // IN
 {
@@ -1089,6 +1083,7 @@ VMCIDoorbell_Destroy(VMCIHandle handle)  // IN
 }
 
 
+VMCI_EXPORT_SYMBOL(VMCIDoorbell_Notify)
 int
 VMCIDoorbell_Notify(VMCIHandle handle,             // IN
                     VMCIPrivilegeFlags privFlags)  // IN
index 0a7845f93ac2a8ea4bfcb34f4518bbc8e89f29cc..e4ba9e4deee89429db6863d40b08ca76225658a8 100644 (file)
@@ -123,6 +123,7 @@ struct VMCIQPair {
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIQPair_Alloc)
 int
 VMCIQPair_Alloc(VMCIQPair **qpair,            // OUT
                 VMCIHandle *handle,           // OUT
@@ -186,6 +187,7 @@ VMCIQPair_Alloc(VMCIQPair **qpair,            // OUT
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIQPair_Detach)
 int
 VMCIQPair_Detach(VMCIQPair **qpair) // IN/OUT
 {
@@ -220,11 +222,6 @@ VMCIQPair_Detach(VMCIQPair **qpair) // IN/OUT
 }
 
 
-#if defined __linux__ && !defined VMKERNEL
-EXPORT_SYMBOL(VMCIQPair_Alloc);
-EXPORT_SYMBOL(VMCIQPair_Detach);
-#endif
-
 /*
  * "Windows blocking call."
  *
@@ -304,6 +301,7 @@ VMCIQPairUnlock(const VMCIQPair *qpair) // IN
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIQPair_Init)
 void
 VMCIQPair_Init(VMCIQPair *qpair)
 {
@@ -337,6 +335,7 @@ VMCIQPair_Init(VMCIQPair *qpair)
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIQPair_GetProduceIndexes)
 int
 VMCIQPair_GetProduceIndexes(const VMCIQPair *qpair, // IN
                             uint64 *producerTail,   // OUT
@@ -382,6 +381,7 @@ VMCIQPair_GetProduceIndexes(const VMCIQPair *qpair, // IN
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIQPair_GetConsumeIndexes)
 int
 VMCIQPair_GetConsumeIndexes(const VMCIQPair *qpair, // IN
                             uint64 *consumerTail,   // OUT
@@ -408,12 +408,6 @@ VMCIQPair_GetConsumeIndexes(const VMCIQPair *qpair, // IN
    return VMCI_SUCCESS;
 }
 
-#if defined __linux__ && !defined VMKERNEL
-EXPORT_SYMBOL(VMCIQPair_Init);
-EXPORT_SYMBOL(VMCIQPair_GetProduceIndexes);
-EXPORT_SYMBOL(VMCIQPair_GetConsumeIndexes);
-#endif
-
 
 /*
  *-----------------------------------------------------------------------------
@@ -435,6 +429,7 @@ EXPORT_SYMBOL(VMCIQPair_GetConsumeIndexes);
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIQPair_ProduceFreeSpace)
 int64
 VMCIQPair_ProduceFreeSpace(const VMCIQPair *qpair) // IN
 {
@@ -477,6 +472,7 @@ VMCIQPair_ProduceFreeSpace(const VMCIQPair *qpair) // IN
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIQPair_ConsumeFreeSpace)
 int64
 VMCIQPair_ConsumeFreeSpace(const VMCIQPair *qpair) // IN
 {
@@ -519,6 +515,7 @@ VMCIQPair_ConsumeFreeSpace(const VMCIQPair *qpair) // IN
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIQPair_ProduceBufReady)
 int64
 VMCIQPair_ProduceBufReady(const VMCIQPair *qpair) // IN
 {
@@ -560,6 +557,7 @@ VMCIQPair_ProduceBufReady(const VMCIQPair *qpair) // IN
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIQPair_ConsumeBufReady)
 int64
 VMCIQPair_ConsumeBufReady(const VMCIQPair *qpair) // IN
 {
@@ -580,13 +578,6 @@ VMCIQPair_ConsumeBufReady(const VMCIQPair *qpair) // IN
    return result;
 }
 
-#if defined __linux__ && !defined VMKERNEL
-EXPORT_SYMBOL(VMCIQPair_ProduceFreeSpace);
-EXPORT_SYMBOL(VMCIQPair_ConsumeFreeSpace);
-EXPORT_SYMBOL(VMCIQPair_ProduceBufReady);
-EXPORT_SYMBOL(VMCIQPair_ConsumeBufReady);
-#endif
-
 
 /*
  *-----------------------------------------------------------------------------
@@ -772,6 +763,7 @@ DequeueLocked(VMCIQueue *produceQ,                        // IN
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIQPair_Enqueue)
 ssize_t
 VMCIQPair_Enqueue(VMCIQPair *qpair,        // IN
                   const void *buf,         // IN
@@ -815,6 +807,7 @@ VMCIQPair_Enqueue(VMCIQPair *qpair,        // IN
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIQPair_Dequeue)
 ssize_t
 VMCIQPair_Dequeue(VMCIQPair *qpair,        // IN
                   void *buf,               // IN
@@ -860,6 +853,7 @@ VMCIQPair_Dequeue(VMCIQPair *qpair,        // IN
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIQPair_Peek)
 ssize_t
 VMCIQPair_Peek(VMCIQPair *qpair,    // IN
                void *buf,           // IN
@@ -886,12 +880,6 @@ VMCIQPair_Peek(VMCIQPair *qpair,    // IN
    return result;
 }
 
-#if defined __linux__ && !defined VMKERNEL
-EXPORT_SYMBOL(VMCIQPair_Enqueue);
-EXPORT_SYMBOL(VMCIQPair_Dequeue);
-EXPORT_SYMBOL(VMCIQPair_Peek);
-#endif
-
 
 #if defined (SOLARIS) || (defined(__APPLE__) && !defined (VMX86_TOOLS)) || \
     (defined(__linux__) && defined(__KERNEL__)) || \
@@ -914,6 +902,7 @@ EXPORT_SYMBOL(VMCIQPair_Peek);
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIQPair_EnqueueV)
 ssize_t
 VMCIQPair_EnqueueV(VMCIQPair *qpair,        // IN
                    void *iov,               // IN
@@ -957,6 +946,7 @@ VMCIQPair_EnqueueV(VMCIQPair *qpair,        // IN
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIQPair_DequeueV)
 ssize_t
 VMCIQPair_DequeueV(VMCIQPair *qpair,         // IN
                    void *iov,                // IN
@@ -1002,6 +992,7 @@ VMCIQPair_DequeueV(VMCIQPair *qpair,         // IN
  *-----------------------------------------------------------------------------
  */
 
+VMCI_EXPORT_SYMBOL(VMCIQPair_PeekV)
 ssize_t
 VMCIQPair_PeekV(VMCIQPair *qpair,           // IN
                 void *iov,                  // IN
@@ -1028,11 +1019,5 @@ VMCIQPair_PeekV(VMCIQPair *qpair,           // IN
    return result;
 }
 
-#if defined __linux__ && !defined VMKERNEL
-EXPORT_SYMBOL(VMCIQPair_EnqueueV);
-EXPORT_SYMBOL(VMCIQPair_DequeueV);
-EXPORT_SYMBOL(VMCIQPair_PeekV);
-#endif
-
 #endif /* Systems that support struct iovec */
 
index 7fb8d7c6db00635b4cb00dddee017fad744b27e5..6c5dfb30764cf64185828af659fbf24a57973e1a 100644 (file)
@@ -233,10 +233,7 @@ VMCIUtil_CheckHostCapabilities(void)
  *-----------------------------------------------------------------------------
  */
 
-#ifdef __linux__
-EXPORT_SYMBOL(VMCI_GetContextID);
-#endif
-
+VMCI_EXPORT_SYMBOL(VMCI_GetContextID)
 VMCIId
 VMCI_GetContextID(void)
 {
@@ -302,10 +299,7 @@ VMCI_CheckHostCapabilities(void)
  *----------------------------------------------------------------------
  */
 
-#ifdef __linux__
-EXPORT_SYMBOL(VMCI_Version);
-#endif
-
+VMCI_EXPORT_SYMBOL(VMCI_Version)
 uint32
 VMCI_Version()
 {
@@ -366,10 +360,7 @@ VMCI_InInterrupt()
  *----------------------------------------------------------------------
  */
 
-#ifdef __linux__
-EXPORT_SYMBOL(VMCI_DeviceGet);
-#endif
-
+VMCI_EXPORT_SYMBOL(VMCI_DeviceGet)
 Bool
 VMCI_DeviceGet(void)
 {
@@ -393,10 +384,7 @@ VMCI_DeviceGet(void)
  *----------------------------------------------------------------------
  */
 
-#ifdef __linux__
-EXPORT_SYMBOL(VMCI_DeviceRelease);
-#endif
-
+VMCI_EXPORT_SYMBOL(VMCI_DeviceRelease)
 void
 VMCI_DeviceRelease(void)
 {
@@ -562,10 +550,7 @@ VMCI_ReadDatagramsFromPort(VMCIIoHandle ioHandle,  // IN
  *----------------------------------------------------------------------
  */
 
-#ifdef __linux__
-EXPORT_SYMBOL(VMCIContext_GetPrivFlags);
-#endif
-
+VMCI_EXPORT_SYMBOL(VMCIContext_GetPrivFlags)
 VMCIPrivilegeFlags
 VMCIContext_GetPrivFlags(VMCIId contextID) // IN
 {
@@ -589,10 +574,7 @@ VMCIContext_GetPrivFlags(VMCIId contextID) // IN
  *----------------------------------------------------------------------
  */
 
-#ifdef __linux__
-EXPORT_SYMBOL(VMCI_ContextID2HostVmID);
-#endif
-
+VMCI_EXPORT_SYMBOL(VMCI_ContextID2HostVmID)
 int
 VMCI_ContextID2HostVmID(VMCIId contextID,    // IN
                         void *hostVmID,      // OUT