NVIDIA DRIVE OS Linux SDK API Reference

6.0.5 Release
nvscievent.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2022, 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  */
10 
11 #ifndef INCLUDED_NVSCIEVENT_H
12 #define INCLUDED_NVSCIEVENT_H
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 #include <string.h>
19 #include <stdint.h>
20 #include <stdlib.h>
21 #include <stdbool.h>
22 #include <nvscierror.h>
23 
39 /* use constant global version variable instead of macro for consistency with
40  * version check API of existing NvSci family
41  */
42 
44 static const uint32_t NvSciEventMajorVersion = 1U;
45 
47 static const uint32_t NvSciEventMinorVersion = 0U;
48 
141 /*****************************************************************************/
142 /* DATA TYPES */
143 /*****************************************************************************/
144 
149 #define NV_SCI_EVENT_INFINITE_WAIT -1
150 #define NV_SCI_EVENT_PRIORITIES 4
151 
155 
157 typedef struct NvSciNativeEvent NvSciNativeEvent;
158 typedef struct NvSciLocalEvent NvSciLocalEvent;
159 typedef struct NvSciTimerEvent NvSciTimerEvent;
160 typedef struct NvSciEventLoop NvSciEventLoop;
162 
233  NvSciError (*CreateNativeEventNotifier)(
235  NvSciEventService* thisEventService,
236  NvSciNativeEvent* nativeEvent,
237  NvSciEventNotifier** newEventNotifier);
239 
273  NvSciError (*CreateLocalEvent)(
275  NvSciEventService* thisEventService,
276  NvSciLocalEvent** newLocalEvent);
278 
288  NvSciError (*CreateTimerEvent)(
290  NvSciEventService* thisEventService,
291  NvSciTimerEvent** newTimerEvent);
293 
333  void (*Delete)(NvSciEventService* thisEventService);
334 };
335 
391  NvSciError (*SetHandler)(NvSciEventNotifier* thisEventNotifier,
392  void (*callback)(void* cookie),
393  void* cookie,
394  uint32_t priority);
395 
431  void (*Delete)(NvSciEventNotifier* thisEventNotifier);
432 };
433 
474  size_t maxEventLoops,
475  NvSciEventLoopService** newEventLoopService);
476 
541  size_t maxEventLoops,
542  void* config,
543  NvSciEventLoopService** newEventLoopService);
544 
553 
564  NvSciError (*CreateEventLoop)(NvSciEventLoopService* eventLoopService,
566  NvSciEventLoop** eventLoop);
568 
623  NvSciEventNotifier* eventNotifier,
624  int64_t microseconds);
625 
688  NvSciEventNotifier* const * eventNotifierArray,
689  size_t eventNotifierCount,
690  int64_t microseconds,
691  bool* newEventArray);
692 
768  NvSciEventService *eventService,
769  NvSciEventNotifier* const * eventNotifierArray,
770  size_t eventNotifierCount,
771  int64_t microseconds,
772  bool* newEventArray);
773 };
774 
775 #ifdef __QNX__
776 
816 NvSciError NvSciEventInspect(
817  NvSciEventService *thisEventSerivce,
818  uint32_t numEvents,
819  uint32_t eventNotifierCount,
820  NvSciEventNotifier** eventNotifierArray);
821 #endif /* __QNX__ */
822 
823 /*
824  * \brief Checks if loaded NvSciEvent library version is compatible with
825  * the version the application was compiled against.
826  *
827  * This function checks loaded NvSciEvent library version with input NvSciEvent
828  * library version and sets output variable true provided major version of the
829  * loaded library is same as @a majorVer and minor version of the
830  * loaded library is not less than @a minorVer, else sets output to false
831  *
832  * @param[in] majorVer build major version.
833  * @param[in] minorVer build minor version.
834  * @param[out] isCompatible boolean value stating if loaded NvSciEvent library
835  * is compatible or not.
836  *
837  * @return ::NvSciError, the completion code of the operation:
838  * - ::NvSciError_Success if successful.
839  * - ::NvSciError_BadParameter if any of the following occurs:
840  * - @a isCompatible is NULL
841  *
842  * @pre None
843  *
844  * @usage
845  * - Allowed context for the API call
846  * - Interrupt: No
847  * - Signal handler: No
848  * - Thread-safe: Yes
849  * - Async/Sync: Sync
850  * - Required Privileges(QNX): None
851  * - API Group
852  * - Init: Yes
853  * - Runtime: Yes
854  * - De-Init: Yes
855  */
857  uint32_t majorVer,
858  uint32_t minorVer,
859  bool* isCompatible);
860 
863 #ifdef __cplusplus
864 }
865 #endif
866 #endif /* INCLUDED_NVSCIEVENT_H */
NvSciError
NvSciError
Return/error codes for all NvSci functions.
Definition: nvscierror.h:45
NvSciEventMinorVersion
static const uint32_t NvSciEventMinorVersion
NvSciEvent API Minor version number.
Definition: nvscievent.h:47
NvSciEventCheckVersionCompatibility
NvSciError NvSciEventCheckVersionCompatibility(uint32_t majorVer, uint32_t minorVer, bool *isCompatible)
NvSciEventNotifier
An abstract interface to notify event to event consumer and to register event handler of the event co...
Definition: nvscievent.h:342
NvSciEventLoopServiceCreate
NvSciError NvSciEventLoopServiceCreate(size_t maxEventLoops, NvSciEventLoopService **newEventLoopService)
Creates a new event loop service.
NvSciEventLoopService::WaitForEvent
NvSciError(* WaitForEvent)(NvSciEventNotifier *eventNotifier, int64_t microseconds)
Waits up to a configurable timeout for a particular event notification, servicing events with configu...
Definition: nvscievent.h:622
NvSciEventMajorVersion
static const uint32_t NvSciEventMajorVersion
NvSciEvent API Major version number.
Definition: nvscievent.h:44
NvSciEventLoopServiceCreateSafe
NvSciError NvSciEventLoopServiceCreateSafe(size_t maxEventLoops, void *config, NvSciEventLoopService **newEventLoopService)
Creates a new event loop service.
NvSciEventNotifier::Delete
void(* Delete)(NvSciEventNotifier *thisEventNotifier)
Unregisters any previously-registered event handler and delete this event notifier.
Definition: nvscievent.h:431
NvSciEventLoopService::WaitForMultipleEvents
NvSciError(* WaitForMultipleEvents)(NvSciEventNotifier *const *eventNotifierArray, size_t eventNotifierCount, int64_t microseconds, bool *newEventArray)
Waits up to a configurable timeout for any of a set of particular event notifications,...
Definition: nvscievent.h:687
NvSciEventLoopService::EventService
NvSciEventService EventService
Definition: nvscievent.h:552
NvSciEventLoopService
An abstract interface that event consumer can wait for events using event notifier in event loop.
Definition: nvscievent.h:551
nvscierror.h
NvSciEventService::Delete
void(* Delete)(NvSciEventService *thisEventService)
Releases any resources associated with this event service.
Definition: nvscievent.h:333
NvSciEventNotifier::SetHandler
NvSciError(* SetHandler)(NvSciEventNotifier *thisEventNotifier, void(*callback)(void *cookie), void *cookie, uint32_t priority)
Registers or unregisters a handler for a particular event notifier.
Definition: nvscievent.h:391
NvSciEventLoopService::WaitForMultipleEventsExt
NvSciError(* WaitForMultipleEventsExt)(NvSciEventService *eventService, NvSciEventNotifier *const *eventNotifierArray, size_t eventNotifierCount, int64_t microseconds, bool *newEventArray)
Waits up to a configurable timeout for any of a set of particular event notifications,...
Definition: nvscievent.h:767
NvSciEventService
An abstract interface for a program's event handling infrastructure.
Definition: nvscievent.h:188