NVIDIA DRIVE OS Linux SDK API Reference

6.0.9 Release
nvscievent.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2023, 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 
60 /* use constant global version variable instead of macro for consistency with
61  * version check API of existing NvSci family
62  */
63 
65 static const uint32_t NvSciEventMajorVersion = 1U;
66 
68 static const uint32_t NvSciEventMinorVersion = 4U;
69 
160 /*****************************************************************************/
161 /* DATA TYPES */
162 /*****************************************************************************/
163 
168 #define NV_SCI_EVENT_INFINITE_WAIT -1
169 #define NV_SCI_EVENT_PRIORITIES 4
170 
176 
178 typedef struct NvSciTimerEvent NvSciTimerEvent;
179 typedef struct NvSciEventLoop NvSciEventLoop;
181 
191 
223  NvSciError (*Signal)(NvSciLocalEvent* thisLocalEvent);
224 
253  void (*Delete)(NvSciLocalEvent* thisLocalEvent);
254 };
255 
326  NvSciError (*CreateNativeEventNotifier)(
328  NvSciEventService* thisEventService,
329  NvSciNativeEvent* nativeEvent,
330  NvSciEventNotifier** newEventNotifier);
332 
366  NvSciEventService* thisEventService,
367  NvSciLocalEvent** newLocalEvent);
368 
378  NvSciError (*CreateTimerEvent)(
380  NvSciEventService* thisEventService,
381  NvSciTimerEvent** newTimerEvent);
383 
426  void (*Delete)(NvSciEventService* thisEventService);
427 };
428 
478  NvSciError (*SetHandler)(NvSciEventNotifier* thisEventNotifier,
479  void (*callback)(void* cookie),
480  void* cookie,
481  uint32_t priority);
482 
516  void (*Delete)(NvSciEventNotifier* thisEventNotifier);
517 };
518 
560  size_t maxEventLoops,
561  NvSciEventLoopService** newEventLoopService);
562 
628  size_t maxEventLoops,
629  void* config,
630  NvSciEventLoopService** newEventLoopService);
631 
678  size_t maxEventLoops,
679  void* config,
680  NvSciEventLoopService** newEventLoopService);
681 
690 
701  NvSciError (*CreateEventLoop)(NvSciEventLoopService* eventLoopService,
703  NvSciEventLoop** eventLoop);
705 
755  NvSciEventNotifier* eventNotifier,
756  int64_t microseconds);
757 
815  NvSciEventNotifier* const * eventNotifierArray,
816  size_t eventNotifierCount,
817  int64_t microseconds,
818  bool* newEventArray);
819 
890  NvSciEventService *eventService,
891  NvSciEventNotifier* const * eventNotifierArray,
892  size_t eventNotifierCount,
893  int64_t microseconds,
894  bool* newEventArray);
895 };
896 
897 #ifdef __QNX__
898 
938 NvSciError NvSciEventInspect(
939  NvSciEventService *thisEventService,
940  uint32_t numEvents,
941  uint32_t eventNotifierCount,
942  NvSciEventNotifier** eventNotifierArray);
943 #endif /* __QNX__ */
944 
999  NvSciEventService *oldEventService,
1000  NvSciEventService *newEventService,
1001  NvSciEventNotifier *eventNotifier);
1002 
1038  uint32_t majorVer,
1039  uint32_t minorVer,
1040  bool* isCompatible);
1041 
1044 #ifdef __cplusplus
1045 }
1046 #endif
1047 #endif /* INCLUDED_NVSCIEVENT_H */
NvSciError
NvSciError
Return/error codes for all NvSci functions.
Definition: nvscierror.h:45
NvSciLocalEvent::Signal
NvSciError(* Signal)(NvSciLocalEvent *thisLocalEvent)
Sends an intra-process local event signal.
Definition: nvscievent.h:223
NvSciLocalEvent::eventNotifier
NvSciEventNotifier * eventNotifier
Event notifier associated with this local event.
Definition: nvscievent.h:190
NvSciEventMinorVersion
static const uint32_t NvSciEventMinorVersion
NvSciEvent API Minor version number.
Definition: nvscievent.h:68
NvSciEventService::CreateLocalEvent
NvSciError(* CreateLocalEvent)(NvSciEventService *thisEventService, NvSciLocalEvent **newLocalEvent)
Creates an intra-process local event with an event notifier that reports each event signaled through ...
Definition: nvscievent.h:365
NvSciEventCheckVersionCompatibility
NvSciError NvSciEventCheckVersionCompatibility(uint32_t majorVer, uint32_t minorVer, bool *isCompatible)
Check NvSciEventSerivice library version compatibility.
NvSciEventNotifier
An abstract interface to notify event to event consumer and to register event handler of the event co...
Definition: nvscievent.h:435
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:754
NvSciEventMajorVersion
static const uint32_t NvSciEventMajorVersion
NvSciEvent API Major version number.
Definition: nvscievent.h:65
NvSciEventLoopServiceCreateSafeX
NvSciError NvSciEventLoopServiceCreateSafeX(size_t maxEventLoops, void *config, NvSciEventLoopService **newEventLoopService)
Creates a new event loop service that has the same properties as created by NvSciEventLoopServiceCrea...
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:516
NvSciLocalEvent
An OS-agnostic object that sends signal to another thread in the same process.
Definition: nvscievent.h:188
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:814
NvSciEventLoopService::EventService
NvSciEventService EventService
Definition: nvscievent.h:689
NvSciLocalEvent::Delete
void(* Delete)(NvSciLocalEvent *thisLocalEvent)
Releases any resources associated with this local event.
Definition: nvscievent.h:253
NvSciEventLoopService
An abstract interface that event consumer can wait for events using event notifier in event loop.
Definition: nvscievent.h:688
nvscierror.h
NvSciEventService::Delete
void(* Delete)(NvSciEventService *thisEventService)
Releases any resources associated with this event service.
Definition: nvscievent.h:426
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:478
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:889
NvSciEventMoveNotifier
NvSciError NvSciEventMoveNotifier(NvSciEventService *oldEventService, NvSciEventService *newEventService, NvSciEventNotifier *eventNotifier)
Move event notifier.
NvSciEventService
An abstract interface for a program's event handling infrastructure.
Definition: nvscievent.h:281
NvSciNativeEvent
struct NvSciNativeEvent NvSciNativeEvent
Definition: nvscievent.h:174