]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes in shared code that don't affect open-vm-tools functionality.
authorVMware, Inc <>
Mon, 26 Apr 2010 18:20:09 +0000 (11:20 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Tue, 27 Apr 2010 03:48:52 +0000 (20:48 -0700)
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/include/vmci_defs.h
open-vm-tools/modules/linux/shared/vmci_defs.h
open-vm-tools/modules/linux/vsock/linux/vmciContext.h
open-vm-tools/modules/linux/vsock/linux/vmciHostKernelAPI.h

index 76d141660f5c2917a3362a8bb467e31254d96b03..63a1d427475e010c1dd2d7ea15c7a75a5f294fd5 100644 (file)
@@ -56,7 +56,7 @@
 #define VMCI_CONTROL_INT_DISABLE  0x4
 
 /* Capabilities register bits. */
-#define VMCI_CAPS_HYPERCALL     0x1 
+#define VMCI_CAPS_HYPERCALL     0x1
 #define VMCI_CAPS_GUESTCALL     0x2
 #define VMCI_CAPS_DATAGRAM      0x4
 #define VMCI_CAPS_NOTIFICATIONS 0x8
@@ -69,9 +69,9 @@
 #define VMCI_IMR_DATAGRAM      0x1
 #define VMCI_IMR_NOTIFICATION  0x2
 
-/* 
- * We have a fixed set of resource IDs available in the VMX. 
- * This allows us to have a very simple implementation since we statically 
+/*
+ * We have a fixed set of resource IDs available in the VMX.
+ * This allows us to have a very simple implementation since we statically
  * know how many will create datagram handles. If a new caller arrives and
  * we have run out of slots we can manually increment the maximum size of
  * available resource IDs.
@@ -105,7 +105,7 @@ typedef struct VMCIHandle {
 } VMCIHandle;
 
 static INLINE
-VMCIHandle VMCI_MAKE_HANDLE(VMCIId cid, 
+VMCIHandle VMCI_MAKE_HANDLE(VMCIId cid,
                            VMCIId rid)
 {
    VMCIHandle h;
@@ -123,8 +123,8 @@ VMCIHandle VMCI_MAKE_HANDLE(VMCIId cid,
  *
  * Results:
  *     The uint64 value.
- * 
- * Side effects:     
+ *
+ * Side effects:
  *     None.
  *
  *----------------------------------------------------------------------
@@ -151,8 +151,8 @@ VMCI_HANDLE_TO_UINT64(VMCIHandle handle) // IN:
  *
  * Results:
  *     The VMCI handle value.
- * 
- * Side effects:     
+ *
+ * Side effects:
  *     None.
  *
  *----------------------------------------------------------------------
@@ -173,7 +173,7 @@ VMCI_UINT64_TO_HANDLE(uint64 handle64) // IN:
                                     (_h1).resource == (_h2).resource)
 
 #define VMCI_INVALID_ID 0xFFFFFFFF
-static const VMCIHandle VMCI_INVALID_HANDLE = {VMCI_INVALID_ID, 
+static const VMCIHandle VMCI_INVALID_HANDLE = {VMCI_INVALID_ID,
                                               VMCI_INVALID_ID};
 
 #define VMCI_HANDLE_INVALID(_handle)   \
@@ -193,12 +193,12 @@ static const VMCIHandle VMCI_INVALID_HANDLE = {VMCI_INVALID_ID,
 
 /*
  * Hypervisor context id, used for calling into hypervisor
- * supplied services from the VM. 
+ * supplied services from the VM.
  */
 #define VMCI_HYPERVISOR_CONTEXT_ID 0
 
-/* 
- * Well-known context id, a logical context that contains 
+/*
+ * Well-known context id, a logical context that contains
  * a set of well-known services.
  */
 #define VMCI_WELL_KNOWN_CONTEXT_ID 1
@@ -206,8 +206,8 @@ static const VMCIHandle VMCI_INVALID_HANDLE = {VMCI_INVALID_ID,
 /* Todo: Change host context id to dynamic/random id. */
 #define VMCI_HOST_CONTEXT_ID  2
 
-/* 
- * The VMCI_CONTEXT_RESOURCE_ID is used together with VMCI_MAKE_HANDLE to make 
+/*
+ * The VMCI_CONTEXT_RESOURCE_ID is used together with VMCI_MAKE_HANDLE to make
  * handles that refer to a specific context.
  */
 #define VMCI_CONTEXT_RESOURCE_ID 0
@@ -295,12 +295,11 @@ typedef enum VMCIResourcePrivilegeType {
    VMCI_PRIV_ASSIGN_CLIENT,
    VMCI_PRIV_DG_CREATE,
    VMCI_PRIV_DG_SEND,
-   VMCI_PRIV_SM_CREATE,
-   VMCI_PRIV_SM_ATTACH,
+   VMCI_PRIV_NOTIFY,
    VMCI_NUM_PRIVILEGES,
 } VMCIResourcePrivilegeType;
 
-/* 
+/*
  * VMCI coarse-grained privileges (per context or host
  * process/endpoint. An entity with the restricted flag is only
  * allowed to interact with the hypervisor and trusted entities.
index c58b6d8acc67350653d637aa3ebcd38a1e6e83fe..07861ce3a2e548e75766138b4763e4d5ee0a6061 100644 (file)
@@ -56,7 +56,7 @@
 #define VMCI_CONTROL_INT_DISABLE  0x4
 
 /* Capabilities register bits. */
-#define VMCI_CAPS_HYPERCALL     0x1 
+#define VMCI_CAPS_HYPERCALL     0x1
 #define VMCI_CAPS_GUESTCALL     0x2
 #define VMCI_CAPS_DATAGRAM      0x4
 #define VMCI_CAPS_NOTIFICATIONS 0x8
@@ -69,9 +69,9 @@
 #define VMCI_IMR_DATAGRAM      0x1
 #define VMCI_IMR_NOTIFICATION  0x2
 
-/* 
- * We have a fixed set of resource IDs available in the VMX. 
- * This allows us to have a very simple implementation since we statically 
+/*
+ * We have a fixed set of resource IDs available in the VMX.
+ * This allows us to have a very simple implementation since we statically
  * know how many will create datagram handles. If a new caller arrives and
  * we have run out of slots we can manually increment the maximum size of
  * available resource IDs.
@@ -105,7 +105,7 @@ typedef struct VMCIHandle {
 } VMCIHandle;
 
 static INLINE
-VMCIHandle VMCI_MAKE_HANDLE(VMCIId cid, 
+VMCIHandle VMCI_MAKE_HANDLE(VMCIId cid,
                            VMCIId rid)
 {
    VMCIHandle h;
@@ -123,8 +123,8 @@ VMCIHandle VMCI_MAKE_HANDLE(VMCIId cid,
  *
  * Results:
  *     The uint64 value.
- * 
- * Side effects:     
+ *
+ * Side effects:
  *     None.
  *
  *----------------------------------------------------------------------
@@ -151,8 +151,8 @@ VMCI_HANDLE_TO_UINT64(VMCIHandle handle) // IN:
  *
  * Results:
  *     The VMCI handle value.
- * 
- * Side effects:     
+ *
+ * Side effects:
  *     None.
  *
  *----------------------------------------------------------------------
@@ -173,7 +173,7 @@ VMCI_UINT64_TO_HANDLE(uint64 handle64) // IN:
                                     (_h1).resource == (_h2).resource)
 
 #define VMCI_INVALID_ID 0xFFFFFFFF
-static const VMCIHandle VMCI_INVALID_HANDLE = {VMCI_INVALID_ID, 
+static const VMCIHandle VMCI_INVALID_HANDLE = {VMCI_INVALID_ID,
                                               VMCI_INVALID_ID};
 
 #define VMCI_HANDLE_INVALID(_handle)   \
@@ -193,12 +193,12 @@ static const VMCIHandle VMCI_INVALID_HANDLE = {VMCI_INVALID_ID,
 
 /*
  * Hypervisor context id, used for calling into hypervisor
- * supplied services from the VM. 
+ * supplied services from the VM.
  */
 #define VMCI_HYPERVISOR_CONTEXT_ID 0
 
-/* 
- * Well-known context id, a logical context that contains 
+/*
+ * Well-known context id, a logical context that contains
  * a set of well-known services.
  */
 #define VMCI_WELL_KNOWN_CONTEXT_ID 1
@@ -206,8 +206,8 @@ static const VMCIHandle VMCI_INVALID_HANDLE = {VMCI_INVALID_ID,
 /* Todo: Change host context id to dynamic/random id. */
 #define VMCI_HOST_CONTEXT_ID  2
 
-/* 
- * The VMCI_CONTEXT_RESOURCE_ID is used together with VMCI_MAKE_HANDLE to make 
+/*
+ * The VMCI_CONTEXT_RESOURCE_ID is used together with VMCI_MAKE_HANDLE to make
  * handles that refer to a specific context.
  */
 #define VMCI_CONTEXT_RESOURCE_ID 0
@@ -295,12 +295,11 @@ typedef enum VMCIResourcePrivilegeType {
    VMCI_PRIV_ASSIGN_CLIENT,
    VMCI_PRIV_DG_CREATE,
    VMCI_PRIV_DG_SEND,
-   VMCI_PRIV_SM_CREATE,
-   VMCI_PRIV_SM_ATTACH,
+   VMCI_PRIV_NOTIFY,
    VMCI_NUM_PRIVILEGES,
 } VMCIResourcePrivilegeType;
 
-/* 
+/*
  * VMCI coarse-grained privileges (per context or host
  * process/endpoint. An entity with the restricted flag is only
  * allowed to interact with the hypervisor and trusted entities.
index afcad30b5d1ad2cb8f30b0438403734c108ae61c..13e880822692f86c7d19e88e9afb5920a05bd8f9 100644 (file)
@@ -103,7 +103,8 @@ void VMCIUnsetNotify(VMCIContext *context);
 int VMCIContext_DoorbellCreate(VMCIId contextID, VMCIHandle handle);
 int VMCIContext_DoorbellDestroy(VMCIId contextID, VMCIHandle handle);
 int VMCIContext_DoorbellDestroyAll(VMCIId contextID);
-int VMCIContext_NotifyDoorbell(VMCIId cid, VMCIHandle handle);
+int VMCIContext_NotifyDoorbell(VMCIId cid, VMCIHandle handle,
+                               VMCIPrivilegeFlags srcPrivFlags);
 
 int VMCIContext_ReceiveNotificationsGet(VMCIId contextID,
                                         VMCIHandleArray **dbHandleArray,
index c7f020b6e30e8d47b273985996a810cc674d2237..e71511d36a3529d491d92fc401012fb6d4b141d5 100644 (file)
@@ -92,6 +92,18 @@ int VMCIEvent_Unsubscribe(VMCIId subID);
 
 VMCIPrivilegeFlags VMCIContext_GetPrivFlags(VMCIId contextID);
 
+/* VMCI Doorbell API. */
+
+#define VMCI_FLAG_DELAYED_CB    0x01
+
+typedef void (*VMCICallback)(void *clientData);
+
+int VMCIDoorbell_Create(VMCIHandle *handle, uint32 flags,
+                        VMCIPrivilegeFlags privFlags,
+                        VMCICallback notifyCB, void *clientData);
+int VMCIDoorbell_Destroy(VMCIHandle handle);
+int VMCIDoorbell_Notify(VMCIHandle handle,
+                        VMCIPrivilegeFlags privFlags);
 
 #endif /* !__VMCI_HOSTKERNELAPI_H__ */