|
|
NVIDIA DriveOS Linux SDK API Reference
|
7.2.5.0 Early Access Release
|
Go to the documentation of this file.
12 #ifndef INCLUDED_NVOS_S3_TEGRA_SAFETY_H
13 #define INCLUDED_NVOS_S3_TEGRA_SAFETY_H
15 #if defined(__QNX__) || defined(__linux__)
26 #if defined(__cplusplus)
656 void NvOsMemset(
void *s, NvU8 c,
size_t size);
1699 #if defined(__QNX__)
1703 #define NVOS_INVALID_TLS_INDEX (-1)
1704 #elif defined(__linux__)
1705 #define NVOS_INVALID_TLS_INDEX 0xFFFFFFFFU
2237 #if defined(__QNX__)
2240 const void *OldValue,
2241 const void *NewValue);
2295 #if defined(__linux__)
2353 #if defined(__linux__) && NV_DEBUG
2355 void *NvOsAllocLeak(
NvOsAllocator *a,
size_t size,
const char *f,
int l);
2357 void *NvOsAllocAlignLeak(
NvOsAllocator *a,
size_t align,
size_t size,
const char *f,
int l);
2359 void *NvOsReallocLeak(
NvOsAllocator *a,
void *ptr,
size_t size,
const char *f,
int l);
2361 void NvOsFreeLeak(
NvOsAllocator *a,
void *ptr,
const char *f,
int l);
2363 #define NvOsAlloc(size) NvOsAllocLeak(NvOsGetCurrentAllocator(), size, __FILE__, __LINE__)
2364 #define NvOsAllocAlign(align, size) NvOsAllocAlignLeak(NvOsGetCurrentAllocator(), align, size, __FILE__, __LINE__)
2365 #define NvOsRealloc(ptr, size) NvOsReallocLeak(NvOsGetCurrentAllocator(), ptr, size, __FILE__, __LINE__)
2366 #define NvOsFree(ptr) NvOsFreeLeak(NvOsGetCurrentAllocator(), ptr, __FILE__, __LINE__)
2374 #if defined(__cplusplus)
2379 #include "nvos_tegra_nonsafety.h"
2382 #endif // INCLUDED_NVOS_S3_TEGRA_SAFETY_H
struct NvOsAllocatorRec NvOsAllocator
void *(* NvOsAllocFunc)(struct NvOsAllocatorRec *rec, size_t size)
void NvOsWriteReg(NvU64 reg, NvU32 off, NvU32 val)
This function writes the val parameter to the sum of two parameters (Reg and Off) and the sum is pass...
NvError NvOsSemaphoreCreate(NvOsSemaphoreHandle *semaphore, NvU32 value)
This function creates a semaphore, and the number of wait operations, is initialized to the value par...
NvError NvOsConditionCreate(NvOsConditionHandle *cond)
This function creates a condition.
void NvOsFree(void *ptr)
This function free the allocated memory.
NvError NvOsGetSysConfigString(const char *name, char *value, NvU32 size)
This function gets an environment variable as string pointer. And copy it to value parameter by strnc...
NvError
The NvError enumeration contains ALL return / error codes.
NvError NvOsConditionDestroy(NvOsConditionHandle cond)
This function destroys a condition.
NvOsAllocAlignFunc AllocAlign
NvError NvOsSemaphoreWaitEx(NvOsSemaphoreHandle semaphore)
This function waits a semaphore, and decrease the number of wait operations. Thread is blocked infini...
NvError NvOsConditionBroadcast(NvOsConditionHandle cond)
This function resumes multiple threads which wait the condition.
NvError NvOsMutexCreate(NvOsMutexHandle *mutex)
This function creates a mutex.
NvError NvOsThreadJoinEx(NvOsThreadHandle t)
This function blocks until while the thread is running, after the thread is terminated,...
NvError NvOsThreadSetName(NvOsThreadHandle t, const char *name)
This function set thread name.
NvError NvOsSemaphoreWaitTimeout(NvOsSemaphoreHandle semaphore, NvU32 msec)
This function waits a semaphore and decreases the number of wait operation.
@ NvOsAllocHookType_Realloc
@ NvOsOs_Integrity
Integrity OS.
@ NvOsSku_Unknown
Unknown SKU.
#define NVOS_MISRA(type, num)
These macros are used for whitelisting coverity violations.
struct NvOsMutexRec * NvOsMutexHandle
void * NvOsAllocTypeMemCached(int32_t handle, size_t size, uint32_t flags, int64_t *paddr)
Allocate cached typed memory.
NvError NvOsGetConfigString(const char *name, char *value, NvU32 size)
This function gets an environment variable as string pointer. And copy it to value parameter by strnc...
NvError NvOsSleepUS(NvU32 usec)
This function sleep during the given microsecond.
Info about OS type and the chip SKU.
NvError NvOsBusyWaitUS(NvU32 usec)
This function busy-wait without blocking for a period of time. This function is designed for use with...
@ NvOsSku_Android
Android.
void * NvOsAllocAlign(size_t align, size_t size)
This function allocates aligned memory.
@ NvOsOs_Force32
Max value for NvOsOs.
void *(* NvOsReallocFunc)(struct NvOsAllocatorRec *rec, void *ptr, size_t size)
void(* NvOsFreeFunc)(struct NvOsAllocatorRec *rec, void *ptr)
struct NvOsSemaphoreRec * NvOsSemaphoreHandle
void * NvOsLibraryGetSymbol(NvOsLibraryHandle library, const char *symbol)
This function get symbol from the loaded dynamic library.
void NvOsMemset(void *s, NvU8 c, size_t size)
This function initializes the memory with the c parameter, And the length of initializing memory,...
void *(* NvOsAllocAlignFunc)(struct NvOsAllocatorRec *rec, size_t align, size_t size)
NvError NvOsSemaphoreDestroyEx(NvOsSemaphoreHandle semaphore)
This function destroys a semaphore.
int32_t NvOsTypeMemDeinit(int32_t handle)
Close typed memory handle.
@ NvOsSku_Force32
Max value for NvOsSku.
NvError NvOsConditionWaitTimeout(NvOsConditionHandle cond, NvOsMutexHandle mutex, NvU32 microsecs)
This function waits for a condition till timeout.
NvS32 NvOsAtomicCompareExchange32(NvS32 *pTarget, NvS32 OldValue, NvS32 NewValue)
This function assigns new value to pointer if the value of pointer is same with the value specified b...
void * NvOsRealloc(void *ptr, size_t size)
This function resizes the allocated memory as the size parameter.
NvOsOs OsType
OS type - qnx, linux, etc.
int NvOsDebugExternalLogInit(void)
This function initializes the connection with syslog. And if a shared memory for log level control ex...
struct NvOsAllocatorRec * NvOsGetCurrentAllocator(void)
NvError NvOsLibraryLoad(const char *name, NvOsLibraryHandle *library)
This function loads the dynamic library.
struct NvOsConditionRec * NvOsConditionHandle
void(* NvOsThreadFunction)(void *args)
NvS32 NvOsAtomicExchange32(NvS32 *pTarget, NvS32 value)
This function atomically swaps the contents of a 32-bit memory location with a value....
void NvOsSetAllocHook(NvOsAllocSimCB Hook, void *UserContext)
NvS32 NvOsAtomicExchangeAdd32(NvS32 *pTarget, NvS32 value)
This function atomically increments the contents of a 32-bit memory location by a specified amount....
NvBool(* NvOsAllocSimCB)(NvOsAllocHookType AllocType, void *UserContext)
NvError NvOsSleepNS(NvU32 nsec)
This function sleep during the given nanosecond.
NvU64 NvOsGetTimeNS(void)
This function gets the current time as nanosecond.
typedef void(WFD_APIENTRY PFNWFDBINDSOURCETOPIPELINEWITHTIMESTAMPNV)(const WFDDevice device
NvError NvOsSemaphoreSignalEx(NvOsSemaphoreHandle semaphore)
This function increases the number of wait operation, to given semaphore.
NvU32 NvOsGetTimeMS(void)
This function returns the current time as millisecond.
NvError NvOsLibraryUnloadEx(NvOsLibraryHandle library)
This function unloads the loaded dynamic lib.
NvError NvOsUnMapRegSpace(NvU64 *reg, NvU32 base, NvU32 size)
This function unmap device's physical address from process's address space.
void * NvOsAlloc(size_t size)
This function returns the allocated memory dynamically, and allocated memory is not initialized.
struct NvOsThreadRec * NvOsThreadHandle
NvError NvOsMutexLockEx(NvOsMutexHandle mutex)
This function locks a mutex.
int32_t NvOsTypeMemInit(const char *typ_mem_name, int32_t *handle)
Open type memory specified by typ_mem_name and return the handle to the typed memory.
NvError NvOsMutexUnlockEx(NvOsMutexHandle mutex)
This function unlocks a mutex.
NvError NvOsMutexDestroyEx(NvOsMutexHandle mutex)
This function destroys a mutex.
void NvOsSleepMS(NvU32 msec)
This function sleep during the given millisecond.
void * NvOsAtomicCompareExchangePtr(void **pTarget, void *OldValue, void *NewValue)
This function atomically compares the contents of a pointer-sized memory location with a value,...
NvError NvOsGetSystemTime(NvOsSystemTime *hNvOsSystemtime)
This function gets the current time as seconds and milliseconds.
@ NvOsOs_Unknown
Unsupported OS.
NvError NvOsGetOsInformation(NvOsOsInfo *pOsInfo)
This function gets the OS information.
const WFDCommitType const WFDHandle handle
void * NvOsAllocTypeMemUncached(int32_t handle, size_t size, uint32_t flags, int64_t *paddr)
Allocate non-cached typed memory.
int32_t NvOsTypeMemFree(size_t size, void *ptr)
Frees the previously allocated memory. This function removes any mappings for pages in the address ra...
NvError NvOsConditionWait(NvOsConditionHandle cond, NvOsMutexHandle mutex)
This function waits a condition.
NvError NvOsThreadCreate(NvOsThreadFunction function, void *args, NvOsThreadHandle *thread)
This function creates a thread with entry point and parameter of entry point. All signals are blocked...
NvError NvOsSemaphoreClone(NvOsSemaphoreHandle orig, NvOsSemaphoreHandle *semaphore)
This function clones the semaphore.
#define NVOS_COV_WHITELIST(type, checker, comment_str)
NvError NvOsGetConfigU32(const char *name, NvU32 *value)
This function get an environment variable as integer.
NvError NvOsMapRegSpace(NvU64 *reg, NvU32 base, NvU32 size)
This function map device's physical address to process's address space. And mapped address is stored ...
@ NvOsAllocHookType_Alloc
@ NvOsOs_Windows
Windows OS.
NvU64 NvOsGetTimeUS(void)
This function returns the current time as microsecond.
NvU32 NvOsReadReg(NvU64 reg, NvU32 off)
This function reads the value of device's physical address from mapped pointer. And mapped address is...
void NvOsGetProcessInfo(char *buf, NvU32 len)
This function gets process information. The buf parameter is printed as 's - (pid d)' which followed ...
NvU32 Seconds
Time in seconds.
NvU32 Milliseconds
Time in milliseconds.
NvError NvOsBusyWaitNS(NvU32 nsec)
This function busy-wait without blocking for a period of time. This function is designed for use with...
NvError NvOsConditionSignal(NvOsConditionHandle cond)
This function resumes a thread which wait the condition.