NVIDIA DRIVE OS Linux API Reference

5.1.6.1 Release
For Test and Development only

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nvscisync.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3  *
4  * NVIDIA Corporation and its licensors retain all intellectual property
5  * and proprietary rights in and to this software, related documentation
6  * and any modifications thereto. Any use, reproduction, disclosure or
7  * distribution of this software and related documentation without an express
8  * license agreement from NVIDIA Corporation is strictly prohibited.
9  */
18 #ifndef INCLUDED_NVSCISYNC_H
19 #define INCLUDED_NVSCISYNC_H
20 
80 #if defined(__cplusplus)
81 #include <cstdlib>
82 #else
83 #include <stdlib.h>
84 #include <stdbool.h>
85 #endif
86 
87 #include <nvscierror.h>
88 #include <nvsciipc.h>
89 
90 #if defined (__cplusplus)
91 extern "C"
92 {
93 #endif
94 
98 static const uint32_t NvSciSyncMajorVersion = 1U;
99 static const uint32_t NvSciSyncMinorVersion = 0U;
100 
112 typedef struct NvSciSyncModuleRec* NvSciSyncModule;
113 
124 typedef struct NvSciSyncCpuWaitContextRec* NvSciSyncCpuWaitContext;
125 
141 typedef struct {
142  uint64_t payload[6];
144 
150 
155 typedef struct {
156  uint64_t payload[7];
158 
163 typedef struct {
164  uint64_t payload[128];
166 
174 typedef struct NvSciSyncObjRec* NvSciSyncObj;
175 
183 typedef struct NvSciSyncAttrListRec* NvSciSyncAttrList;
184 
188 typedef enum {
206 
210 typedef enum {
238 
242 typedef struct {
249  const void* value;
251  size_t len;
253 
269  NvSciSyncModule* newModule);
270 
284  NvSciSyncModule module);
285 
302  NvSciSyncModule module,
303  NvSciSyncCpuWaitContext* newContext);
304 
313  NvSciSyncCpuWaitContext context);
314 
329  NvSciSyncModule module,
330  NvSciSyncAttrList* attrList);
331 
339  NvSciSyncAttrList attrList);
340 
352  NvSciSyncAttrList attrList,
353  bool* isReconciled);
354 
379  NvSciSyncAttrList reconciledAttrList,
380  const NvSciSyncAttrList inputUnreconciledAttrListArray[],
381  size_t inputUnreconciledAttrListCount,
382  bool* isReconciledListValid);
383 
405  NvSciSyncAttrList attrList,
406  const NvSciSyncAttrKeyValuePair* pairArray,
407  size_t pairCount);
408 
425  NvSciSyncAttrList attrList,
426  NvSciSyncAttrKeyValuePair* pairArray,
427  size_t pairCount);
428 
443  NvSciSyncAttrList attrList);
444 
469  const NvSciSyncAttrList inputUnreconciledAttrListArray[],
470  size_t inputUnreconciledAttrListCount,
471  NvSciSyncAttrList* newUnreconciledAttrList);
472 
490  NvSciSyncAttrList origAttrList,
491  NvSciSyncAttrList* newAttrList);
492 
520  NvSciSyncAttrList attrList,
521  size_t slotIndex,
522  NvSciSyncAttrKeyValuePair* pairArray,
523  size_t pairCount);
524 
558  const NvSciSyncAttrList inputArray[],
559  size_t inputCount,
560  NvSciSyncAttrList* newReconciledList,
561  NvSciSyncAttrList* newConflictList);
562 
576  NvSciSyncAttrList attrList,
577  void** buf,
578  size_t* len);
579 
606  const NvSciSyncAttrList unreconciledAttrListArray[],
607  size_t unreconciledAttrListCount,
608  NvSciIpcEndpoint ipcEndpoint,
609  void** descBuf,
610  size_t* descLen);
611 
629  const NvSciSyncAttrList reconciledAttrList,
630  NvSciIpcEndpoint ipcEndpoint,
631  void** descBuf,
632  size_t* descLen);
633 
654  NvSciSyncModule module,
655  NvSciIpcEndpoint ipcEndpoint,
656  const void* descBuf,
657  size_t descLen,
658  NvSciSyncAttrList* importedUnreconciledAttrList);
659 
706  NvSciSyncModule module,
707  NvSciIpcEndpoint ipcEndpoint,
708  const void* descBuf,
709  size_t descLen,
710  const NvSciSyncAttrList inputUnreconciledAttrListArray[],
711  size_t inputUnreconciledAttrListCount,
712  NvSciSyncAttrList* importedReconciledAttrList);
713 
722  void* descBuf);
723 
734  NvSciSyncFence* syncFence);
735 
749  const NvSciSyncFence* srcSyncFence,
750  NvSciSyncFence* dstSyncFence);
751 
771  NvSciSyncAttrList reconciledList,
772  NvSciSyncObj* syncObj);
773 
784  NvSciSyncObj syncObj,
785  NvSciSyncObj* dupObj);
786 
804  NvSciSyncObj syncObj,
805  NvSciSyncAttrList* syncAttrList);
806 
814 void NvSciSyncObjFree(
815  NvSciSyncObj syncObj);
816 
841  NvSciSyncObj syncObj,
842  NvSciSyncAccessPerm permissions,
843  NvSciIpcEndpoint ipcEndpoint,
845 
885  NvSciIpcEndpoint ipcEndpoint,
887  NvSciSyncAttrList inputAttrList,
888  NvSciSyncAccessPerm permissions,
889  int64_t timeoutUs,
890  NvSciSyncObj* syncObj);
891 
910  const NvSciSyncFence* syncFence,
911  NvSciIpcEndpoint ipcEndpoint,
913 
928  NvSciSyncObj syncObj,
930  NvSciSyncFence* syncFence);
931 
946  NvSciSyncObj syncObj,
947  NvSciSyncFence* syncFence);
948 
962  NvSciSyncObj syncObj);
963 
988  const NvSciSyncFence* syncFence,
989  NvSciSyncCpuWaitContext context,
990  int64_t timeoutUs);
991 
1009  NvSciSyncAttrList attrList,
1010  NvSciSyncAttrKey key,
1011  const void** value,
1012  size_t* len);
1013 
1037  const NvSciSyncAttrList inputArray[],
1038  size_t inputCount,
1039  NvSciSyncObj* syncObj,
1040  NvSciSyncAttrList* newConflictList);
1041 
1067  NvSciSyncObj syncObj,
1068  NvSciSyncAccessPerm permissions,
1069  NvSciIpcEndpoint ipcEndpoint,
1070  void** attrListAndObjDesc,
1071  size_t* attrListAndObjDescSize);
1072 
1082  void* attrListAndObjDescBuf);
1083 
1122  NvSciSyncModule module,
1123  NvSciIpcEndpoint ipcEndpoint,
1124  const void* attrListAndObjDesc,
1125  size_t attrListAndObjDescSize,
1126  NvSciSyncAttrList const attrList[],
1127  size_t attrListCount,
1128  NvSciSyncAccessPerm minPermissions,
1129  int64_t timeoutUs,
1130  NvSciSyncObj* syncObj);
1131 
1132 #if defined(__cplusplus)
1133 }
1134 #endif // __cplusplus
1135 
1136 #endif // INCLUDED_NVSCISYNC_H
struct NvSciSyncCpuWaitContextRec * NvSciSyncCpuWaitContext
Represents the right to perform a CPU wait on an NvSciSyncFence.
Definition: nvscisync.h:124
Defines the exported form of NvSciSyncFence shared across an NvSciIpc channel.
Definition: nvscisync.h:155
NvSciError NvSciSyncAttrListIpcExportReconciled(const NvSciSyncAttrList reconciledAttrList, NvSciIpcEndpoint ipcEndpoint, void **descBuf, size_t *descLen)
Translates the reconciled attribute list to an exported attribute list descriptor that can potentiall...
void NvSciSyncFenceClear(NvSciSyncFence *syncFence)
Frees any resources allocated for the specified fence.
void NvSciSyncAttrListAndObjFreeDesc(void *attrListAndObjDescBuf)
Frees an exported attribute-list-and-sync-object descriptor returned by NvSciSyncIpcExportAttrListAnd...
Describes the NvSciSyncAttrKey-Value pair.
Definition: nvscisync.h:242
NvSciError NvSciSyncAttrListAppendUnreconciled(const NvSciSyncAttrList inputUnreconciledAttrListArray[], size_t inputUnreconciledAttrListCount, NvSciSyncAttrList *newUnreconciledAttrList)
Appends multiple unreconciled attribute lists together, forming a single new unreconciled attribute l...
static const uint32_t NvSciSyncMajorVersion
NvSciSync version.
Definition: nvscisync.h:98
NvSciError NvSciSyncObjIpcImport(NvSciIpcEndpoint ipcEndpoint, const NvSciSyncObjIpcExportDescriptor *desc, NvSciSyncAttrList inputAttrList, NvSciSyncAccessPerm permissions, int64_t timeoutUs, NvSciSyncObj *syncObj)
Creates an NvSciSync object based on supplied binary descriptor and returns the sync object...
NvSciError NvSciSyncObjGenerateFence(NvSciSyncObj syncObj, NvSciSyncFence *syncFence)
Generates next point on sync timeline of an NvSciSync object and fills in the supplied NvSciSyncFence...
void NvSciSyncCpuWaitContextFree(NvSciSyncCpuWaitContext context)
Releases a CPU wait context.
NVIDIA Software Communications Interface (SCI): Error Handling
NvSciError NvSciSyncIpcImportAttrListAndObj(NvSciSyncModule module, NvSciIpcEndpoint ipcEndpoint, const void *attrListAndObjDesc, size_t attrListAndObjDescSize, NvSciSyncAttrList const attrList[], size_t attrListCount, NvSciSyncAccessPerm minPermissions, int64_t timeoutUs, NvSciSyncObj *syncObj)
Creates an NvSciSync object based on the supplied binary descriptor and returns the sync object...
NvSciError NvSciSyncAttrListIpcImportReconciled(NvSciSyncModule module, NvSciIpcEndpoint ipcEndpoint, const void *descBuf, size_t descLen, const NvSciSyncAttrList inputUnreconciledAttrListArray[], size_t inputUnreconciledAttrListCount, NvSciSyncAttrList *importedReconciledAttrList)
Translates an exported attribute list descriptor (potentially received from any process) into an attr...
uint64_t NvSciIpcEndpoint
Handle to the IPC endpoint.
Definition: nvsciipc.h:67
NvSciError NvSciSyncObjIpcExport(NvSciSyncObj syncObj, NvSciSyncAccessPerm permissions, NvSciIpcEndpoint ipcEndpoint, NvSciSyncObjIpcExportDescriptor *desc)
Exports a NvSciSync object into an NvSciIpc-transferable object binary descriptor.
This represents the capability to advance an NvSciSync object to its next point on its sync timeline ...
Definition: nvscisync.h:204
(bool) Importing and then exporting an NvSciSyncFenceIpcExportDescriptor has no side effects and yiel...
Definition: nvscisync.h:234
void NvSciSyncAttrListFreeDesc(void *descBuf)
Frees an exported attribute list descriptor previously returned by NvSciSyncAttrListExport().
This represents the capability to advance an NvSciSync object to its next point on its sync timeline...
Definition: nvscisync.h:198
void NvSciSyncObjFree(NvSciSyncObj syncObj)
Destroys the NvSciSync object and all memory that was allocated for it.
struct NvSciSyncAttrListRec * NvSciSyncAttrList
Holds a pointer to an opaque NvSciSync attribute list.
Definition: nvscisync.h:183
NvSciError NvSciSyncIpcExportFence(const NvSciSyncFence *syncFence, NvSciIpcEndpoint ipcEndpoint, NvSciSyncFenceIpcExportDescriptor *desc)
Exports a NvSciSyncFence into a binary descriptor shareable across the NvSciIpc channel.
NvSciError NvSciSyncAttrListIpcExportUnreconciled(const NvSciSyncAttrList unreconciledAttrListArray[], size_t unreconciledAttrListCount, NvSciIpcEndpoint ipcEndpoint, void **descBuf, size_t *descLen)
Translates the unreconciled attribute list(s) to an exported attribute list descriptor that can poten...
NvSciSyncAttrKey attrKey
Specifies the attribute key to set.
Definition: nvscisync.h:244
static const uint32_t NvSciSyncMinorVersion
Definition: nvscisync.h:99
NvSciError NvSciSyncAttrListSetAttrs(NvSciSyncAttrList attrList, const NvSciSyncAttrKeyValuePair *pairArray, size_t pairCount)
Sets the value of an attribute in an unreconciled attribute list that has not already been set...
NvSciError NvSciSyncObjDup(NvSciSyncObj syncObj, NvSciSyncObj *dupObj)
Duplicates a valid NvSciSyncObj.
NvSciError NvSciSyncAttrListGetAttrs(NvSciSyncAttrList attrList, NvSciSyncAttrKeyValuePair *pairArray, size_t pairCount)
Gets the value of attributes from an attribute list.
NvSciError NvSciSyncCpuWaitContextAlloc(NvSciSyncModule module, NvSciSyncCpuWaitContext *newContext)
Allocates a CPU wait context that can be used to perform a CPU wait with NvSciSyncFenceWait().
NvSciSyncAttrKey
Describes the types of NvSciSyncAttr keys.
Definition: nvscisync.h:210
NVIDIA Software Communications Interface (SCI) : NvSci Inter-Process Communication ...
NvSciError NvSciSyncObjAlloc(NvSciSyncAttrList reconciledList, NvSciSyncObj *syncObj)
Allocates a sync object that meets all the constraints in the specified reconciled attribute list...
size_t len
Specifies the buffer length, or 0 if there is no value assigned to attrKey.
Definition: nvscisync.h:251
void NvSciSyncModuleClose(NvSciSyncModule module)
Releases an instance of the NvSciSync module that was obtained through an earlier call to NvSciSyncMo...
NvSciError NvSciSyncModuleOpen(NvSciSyncModule *newModule)
Initializes an instance of the NvSciSync module within the calling process and provides an NvSciSyncM...
const void * value
Specifies the pointer to the attribute value, or NULL if there is no value assigned to attrKey...
Definition: nvscisync.h:249
NvSciSyncAccessPerm
Describes sync object access permissions.
Definition: nvscisync.h:188
NvSciError NvSciSyncAttrListIsReconciled(NvSciSyncAttrList attrList, bool *isReconciled)
Returns whether the attribute list is reconciled or unreconciled.
NvSciError NvSciSyncAttrListIpcImportUnreconciled(NvSciSyncModule module, NvSciIpcEndpoint ipcEndpoint, const void *descBuf, size_t descLen, NvSciSyncAttrList *importedUnreconciledAttrList)
Translates an exported attribute list descriptor (potentially received from any process) into an attr...
enum NvSciErrorRec NvSciError
Return/error codes for all NvSci functions.
(NvSciSyncAccessPerm) Actual permission granted after reconciliation.
Definition: nvscisync.h:227
Specifies the upper bound - for NvSciSync internal use only.
Definition: nvscisync.h:236
NvSciError NvSciSyncAttrListDebugDump(NvSciSyncAttrList attrList, void **buf, size_t *len)
Dumps the attribute list into a binary blob.
NvSciError NvSciSyncAttrListSlotGetAttrs(NvSciSyncAttrList attrList, size_t slotIndex, NvSciSyncAttrKeyValuePair *pairArray, size_t pairCount)
Gets the value of attributes from an attribute list at given index in a multi-slot unreconciled attri...
(NvSciSyncAccessPerm) Specifies the required access permissions.
Definition: nvscisync.h:222
This represents the capability to monitor an NvSciSync object as it progresses through points on its ...
Definition: nvscisync.h:193
NvSciError NvSciSyncAttrListReconcileAndObjAlloc(const NvSciSyncAttrList inputArray[], size_t inputCount, NvSciSyncObj *syncObj, NvSciSyncAttrList *newConflictList)
Reconcile the input unreconciled attribute list(s) into a new reconciled attribute list and allocate ...
NvSciError NvSciSyncAttrListReconcile(const NvSciSyncAttrList inputArray[], size_t inputCount, NvSciSyncAttrList *newReconciledList, NvSciSyncAttrList *newConflictList)
Reconciles the input unreconciled attribute list(s) into a new reconciled attribute list...
NvSciError NvSciSyncAttrListGetAttr(NvSciSyncAttrList attrList, NvSciSyncAttrKey key, const void **value, size_t *len)
NvSciSync Utility functions.
size_t NvSciSyncAttrListGetSlotCount(NvSciSyncAttrList attrList)
Gets the total number of slots contained in a NvSciSyncAttrList.
static const NvSciSyncFence NvSciSyncFenceInitializer
Defines the value used to zero-initialize the NvSciSyncFence object.
Definition: nvscisync.h:149
NvSciError NvSciSyncObjSignal(NvSciSyncObj syncObj)
Signal the NvSciSync object.
struct NvSciSyncObjRec * NvSciSyncObj
Holds a pointer to an opaque NvSciSync object.
Definition: nvscisync.h:174
NvSciError NvSciSyncFenceWait(const NvSciSyncFence *syncFence, NvSciSyncCpuWaitContext context, int64_t timeoutUs)
Performs a synchronous wait on the NvSciSyncFence object until the fence has been signaled or the tim...
(bool) Specifies if CPU access is required.
Definition: nvscisync.h:214
NvSciError NvSciSyncAttrListCreate(NvSciSyncModule module, NvSciSyncAttrList *attrList)
Creates an attribute list holding the attributes of the NvSciSyncObj to be allocated.
Defines the exported form of NvSciSyncObj shared across an NvSciIpc channel.
Definition: nvscisync.h:163
Defines the opaque NvSciSyncFence.
Definition: nvscisync.h:141
struct NvSciSyncModuleRec * NvSciSyncModule
Represents an instance of the NvSciSync module.
Definition: nvscisync.h:112
NvSciError NvSciSyncIpcExportAttrListAndObj(NvSciSyncObj syncObj, NvSciSyncAccessPerm permissions, NvSciIpcEndpoint ipcEndpoint, void **attrListAndObjDesc, size_t *attrListAndObjDescSize)
Exports an NvSciSync attribute list and object into an NvSciIpc-transferable object binary blob point...
NvSciError NvSciSyncAttrListClone(NvSciSyncAttrList origAttrList, NvSciSyncAttrList *newAttrList)
Clones an unreconciled/reconciled attribute list.
void NvSciSyncAttrListFree(NvSciSyncAttrList attrList)
Frees the memory of an attribute list.
NvSciError NvSciSyncFenceDup(const NvSciSyncFence *srcSyncFence, NvSciSyncFence *dstSyncFence)
Duplicates srcSyncFence into dstSyncFence, such that any wait on destSyncFence will complete at the s...
NvSciError NvSciSyncObjGetAttrList(NvSciSyncObj syncObj, NvSciSyncAttrList *syncAttrList)
Retrieves the attribute list from an allocated NvSciSync Object.
NvSciError NvSciSyncIpcImportFence(NvSciSyncObj syncObj, const NvSciSyncFenceIpcExportDescriptor *desc, NvSciSyncFence *syncFence)
Fills in the NvSciSyncFence object based on supplied binary descriptor.
Specifies the lower bound - for NvSciSync internal use only.
Definition: nvscisync.h:212
NvSciError NvSciSyncAttrListValidateReconciled(NvSciSyncAttrList reconciledAttrList, const NvSciSyncAttrList inputUnreconciledAttrListArray[], size_t inputUnreconciledAttrListCount, bool *isReconciledListValid)
Validates a reconciled attribute list against a set of input unreconciled attribute lists...