|
NVIDIA DriveOS Linux NSR SDK API Reference
|
7.0.3.0 Release
|
Go to the documentation of this file.
12 #ifndef INCLUDED_NVOS_TEGRA_NONSAFETY_H
13 #define INCLUDED_NVOS_TEGRA_NONSAFETY_H
99 #if defined(__cplusplus)
124 #define NVOS_KEY_MAX 128
128 #define NVOS_PATH_MAX 256
132 #define NVOS_HAS_MTIME 1
136 #define NVOS_HAS_MKDIR 1
140 #define NVOS_HAS_FTRUNCATE 1
144 #define NVOS_HAS_CONDITION 1
174 NvOsSnprintf(
char *str,
size_t size,
const char *format, ...);
197 NvOsVsnprintf(
char *str,
size_t size,
const char *format, va_list ap);
213 NvOsLogPrintf(
int prio,
const char *tag,
const char *format, ...);
272 #define NV_SHOW_ERRORS NV_DEBUG
274 #define NV_SHOW_ERROR(err) NvOsShowError(err,__FILE__,__LINE__)
276 #define NV_SHOW_ERROR(err) (err)
303 #if !defined(NV_ENABLE_DEBUG_PRINTS)
304 #define NV_ENABLE_DEBUG_PRINTS 0
306 #if NV_ENABLE_DEBUG_PRINTS
307 #define NV_DEBUG_PRINTF(x) do { NvOsDebugPrintf x; } while (NV_FALSE)
309 #define NV_DEBUG_PRINTF(x) do {} while (NV_FALSE)
375 NvOsStrncpy(
char *dest,
const char *src,
size_t size);
423 void NvOsMemcpy(
void *dest,
const void *src,
size_t size);
436 NvOsMemcmp(
const void *s1,
const void *s2,
size_t size);
484 typedef struct NvOsFileRec
500 #define NVOS_OPEN_READ 0x1
503 #define NVOS_OPEN_WRITE 0x2
506 #define NVOS_OPEN_CREATE 0x4
509 #define NVOS_OPEN_APPEND 0x8
856 size_t size,
void **ptr);
877 #ifdef INCLUDED_NVOS_TEGRA_NONSAFETY_H
878 NvOsMemAttribute_Reserved = 0,
893 #ifdef INCLUDED_NVOS_TEGRA_NONSAFETY_H
894 #if defined(__LP64__) && !defined(__DEPRECATE_NVOS_MEM_ATTR_UNCACHED__) && (!NVOS_IS_QNX)
895 #if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 6)
896 #pragma GCC diagnostic warning "-Wdeprecated-declarations"
897 #define __DEPRECATE_NVOS_MEM_ATTR_UNCACHED__ __attribute__ ((deprecated(\
898 "Use NvOsMemAttribute_WriteCombined instead!!\n"\
899 "Use proper barrier protection when moved to writecombined\n"\
900 "VPR is treated as strongly ordered in kernel even if you use\n"\
901 "writecombined. So, no need for barrier protection for VPR allocations")))
912 #define NVOS_MEM_NONE 0x0U
915 #define NVOS_MEM_READ 0x1U
918 #define NVOS_MEM_WRITE 0x2U
921 #define NVOS_MEM_EXECUTE 0x4U
927 #define NVOS_MEM_GLOBAL_ADDR 0x8U
930 #define NVOS_MEM_READ_WRITE (NVOS_MEM_READ | NVOS_MEM_WRITE)
933 #define NVOS_MEM_MMAP_FIXED 0x40U
936 #define NVOS_MEM_MMAP_LAZY 0x80U
939 #define NVOS_MEM_MMAP_POPULATE 0x100U
1576 #if NVOS_IS_INTEGRITY
1582 #define NVOS_INVALID_TLS_INDEX 0xFFFFFFFF
1583 #define NVOS_TLS_CNT 4
1799 const NvU32 *pIrqList,
1803 NvBool InterruptEnable);
1879 void *NvOsAllocLeak(
NvOsAllocator *,
size_t size,
const char *f,
int l);
1880 void *NvOsAllocAlignLeak(
NvOsAllocator *,
size_t align,
size_t size,
const char *f,
int l);
1881 void *NvOsReallocLeak(
NvOsAllocator *,
void *ptr,
size_t size,
const char *f,
int l);
1882 void NvOsFreeLeak(
NvOsAllocator *,
void *ptr,
const char *f,
int l);
1884 #define NvOsAlloc(size) NvOsAllocLeak(NvOsGetCurrentAllocator(), size, __FILE__, __LINE__)
1885 #define NvOsAllocAlign(align, size) NvOsAllocAlignLeak(NvOsGetCurrentAllocator(), align, size, __FILE__, __LINE__)
1886 #define NvOsRealloc(ptr, size) NvOsReallocLeak(NvOsGetCurrentAllocator(), ptr, size, __FILE__, __LINE__)
1887 #define NvOsFree(ptr) NvOsFreeLeak(NvOsGetCurrentAllocator(), ptr, __FILE__, __LINE__)
1905 void NvOsSetResourceAllocFileLine(
void* userptr,
const char* file,
int line);
1908 NvOsSharedMemAllocTraced(
const char *key,
size_t size,
1914 NvOsSetResourceAllocFileLine(*descriptor, f, l);
1919 NvOsSharedMemHandleFromFdTraced(
int fd,
1925 NvOsSetResourceAllocFileLine(*descriptor, f, l);
1930 NvOsPhysicalMemMapTraced(
NvOsPhysAddr phys,
size_t size,
1936 NvOsSetResourceAllocFileLine(*ptr, f, l);
1943 const char *f,
int l )
1946 status = (
NvOsPageAlloc)(size, attrib, flags, protect, descriptor);
1948 NvOsSetResourceAllocFileLine(*descriptor, f, l);
1958 NvOsSetResourceAllocFileLine(*mutex, f, l);
1968 NvOsSetResourceAllocFileLine(*mutex, f, l);
1974 const char *f,
int l )
1979 NvOsSetResourceAllocFileLine(*semaphore, f, l);
1985 const char *f,
int l )
1990 NvOsSetResourceAllocFileLine(*clone, f, l);
2001 NvOsSetResourceAllocFileLine(*thread, f, l);
2006 NvOsInterruptRegisterTraced(NvU32 IrqListSize,
const NvU32 *pIrqList,
2014 context,
handle, InterruptEnable);
2018 #define NvOsSharedMemAlloc(key, size, descriptor) \
2019 NvOsSharedMemAllocTraced(key, size, descriptor, __FILE__, __LINE__)
2020 #define NvOsSharedMemHandleFromFd(fd, descriptor) \
2021 NvOsSharedMemHandleFromFdTraced(fd, descriptor, __FILE__, __LINE__)
2022 #define NvOsPhysicalMemMap(phys, size, attrib, flags, ptr) \
2023 NvOsPhysicalMemMapTraced(phys, size, attrib, flags, ptr, \
2025 #define NvOsPageAlloc(size, attrib, flags, protect, descriptor) \
2026 NvOsPageAllocTraced(size, attrib, flags, protect, descriptor, \
2028 #define NvOsMutexCreate(mutex) NvOsMutexCreateTraced(mutex, __FILE__, __LINE__)
2029 #define NvOsIntrMutexCreate(mutex) \
2030 NvOsIntrMutexCreateTraced(mutex, __FILE__, __LINE__)
2031 #define NvOsSemaphoreCreate(semaphore, value) \
2032 NvOsSemaphoreCreateTraced(semaphore, value, __FILE__, __LINE__)
2033 #define NvOsSemaphoreClone(orig, semaphore) \
2034 NvOsSemaphoreCloneTraced(orig, semaphore, __FILE__, __LINE__)
2035 #define NvOsThreadCreate(func, args, thread) \
2036 NvOsThreadCreateTraced(func, args, thread, __FILE__, __LINE__)
2037 #define NvOsInterruptRegister(IrqListSize, pIrqList, pIrqHandlerList, \
2038 context, handle, InterruptEnable) \
2039 NvOsInterruptRegisterTraced(IrqListSize, pIrqList, pIrqHandlerList, \
2040 context, handle, InterruptEnable, __FILE__, __LINE__)
2042 #endif // NVOS_DEBUG
2116 typedef int NvOsDrvHandle;
2122 NvOsDrvHandle NvOsDrvOpen(
const char *pathname);
2127 void NvOsDrvClose(NvOsDrvHandle);
2133 NvError NvOsDrvIoctl(NvOsDrvHandle,
unsigned int iocode,
void *arg,
size_t argsize);
2139 NvError NvOsDrvIoctl2(NvOsDrvHandle,
unsigned int iocode,
void *arg,
size_t argsize,
const void *inbuf,
size_t inbufsize);
2145 NvError NvOsDrvIoctl3(NvOsDrvHandle,
unsigned int iocode,
void *arg,
size_t argsize,
void *outbuf,
size_t outbufsize);
2150 NvError NvOsDrvMapSharedMem(NvOsDrvHandle,
unsigned int handle,
unsigned int hMem);
2166 typedef struct NvOsEventPoolRec NvOsEventPool;
2167 typedef struct NvOsEventRec NvOsEvent;
2169 NvError NvOsEventPoolCreate(NvU32 numEvents, NvOsEventPool **eventPool);
2175 void NvOsEventPoolDestroy(NvOsEventPool *eventPool);
2187 NvError NvOsEventPoolLink(NvOsEventPool *eventPool, NvOsEvent *
event);
2195 void NvOsEventPoolWait(NvOsEventPool *eventPool, NvU32 timeoutUs, NvOsEvent **
event);
2205 NvError NvOsSystemEventCreate(
int fd, NvU32
id, NvOsEvent **
event);
2214 NvError NvOsTimerEventCreate(NvU32 timeoutMs, NvOsEvent **
event);
2236 void NvOsEventDestroy(NvOsEvent *
event);
2244 void NvOsEventClear(NvOsEvent *
event);
2257 NvError NvOsEventWait(NvOsEvent*
event, NvU32 timeoutUs);
2259 typedef struct NvOsThreadCreateAttrRec
2264 size_t threadStackSize;
2272 uint64_t affinityMask;
2274 const char *threadName;
2275 } NvOsThreadCreateAttr;
2277 #define NVOS_DEFINE_THREAD_CREATE_ATTR(x) \
2278 NvOsThreadCreateAttr x = { NULL, 0, NvOsThreadPriorityType_Normal, 0, -1, 0, NULL }
2295 typedef void (*NvOsExitHandlerFunc)(
void);
2296 typedef struct NvOsExitHandlerContextRec
2298 NvOsExitHandlerFunc Func;
2299 struct NvOsExitHandlerContextRec *Prev;
2300 } NvOsExitHandlerContext;
2308 NvOsTelemetryCategory_Test,
2309 NvOsTelemetryCategory_VideoInfo,
2310 } NvOsTelemetryCategory;
2322 NvError NvOsTelemetrySubmitData(NvOsTelemetryCategory category,
void *arg);
2356 void NvOsRegisterExitHandler(NvOsExitHandlerFunc func, NvOsExitHandlerContext *
ctx, NvBool toLast);
2358 #define NVOS_REGISTER_EXIT_HANDLER(_func) \
2360 static NvOsExitHandlerContext _ctx = {0,0}; \
2361 NvOsRegisterExitHandler(_func, &_ctx, false); \
2364 #define NVOS_REGISTER_EXIT_HANDLER_LAST(_func) \
2366 static NvOsExitHandlerContext _ctx = {0,0}; \
2367 NvOsRegisterExitHandler(_func, &_ctx, true); \
2404 #if defined(__cplusplus)
2410 #include "../../core-hos/include/nvos_hos.h"
2413 #endif // INCLUDED_NVOS_TEGRA_NONSAFETY_H
NvError NvOsInterruptRegister(NvU32 IrqListSize, const NvU32 *pIrqList, const NvOsInterruptHandler *pIrqHandlerList, void *context, NvOsInterruptHandle *handle, NvBool InterruptEnable)
Registers the interrupt handler with the IRQ number.
void NvOsWriteReg(NvU64 reg, NvU32 off, NvU32 val)
void * NvOsAtomicCompareExchangePtr(void **pTarget, void *OldValue, void *NewValue)
Atomically compares the contents of a pointer-sized memory location with a value, and if they match,...
void * NvOsRealloc(void *ptr, size_t size)
Re-sizes a previous dynamic allocation.
void NvOsDataCacheWritebackInvalidate(void)
Writes back and invalidates the entire data cache.
NvError NvOsGetConfigString(const char *name, char *value, NvU32 size)
Retrieves a string variable from the config store.
struct NvOsStatTypeRec NvOsStatType
NvError NvOsVfprintf(NvOsFileHandle stream, const char *format, va_list ap)
Prints a string to a file stream using a va_list.
struct NvOsFileRec * NvOsFileHandle
Printf family.
NvError NvOsStat(const char *filename, NvOsStatType *stat)
Gets file information.
@ NvOsFileType_CharacterDevice
NvS32 NvOsSnprintf(char *str, size_t size, const char *format,...)
Expands a string into a given string buffer.
NvError NvOsPageAlloc(size_t size, NvOsMemAttribute attrib, NvOsPageFlags flags, NvU32 protect, NvOsPageAllocHandle *descriptor)
Allocates memory via the page allocator.
NvOsSeekEnum
Defines wrappers over stdlib's file stream functions, with some changes to the API.
NvError NvOsFsync(NvOsFileHandle stream)
Commits any pending writes to storage media.
NvError NvOsConditionCreate(NvOsConditionHandle *cond)
Creates a condition variable.
void NvOsInstrCacheInvalidateRange(void *start, NvU32 length)
Invalidates a range of the instruction cache.
NvOsTlsKeyHandle NvOsTlsAlloc(void)
Allocates a thread-local storage variable.
NvBool NvOsTlsRemoveTerminator(void(*func)(void *), void *context)
Checks the list of existing terminator functions for one that matches both the function and the data,...
NvError NvOsUnMapRegSpace(NvU64 *VirtReg, NvU32 Base, NvU32 Size)
@ NvOsThreadPriorityType_NearInterrupt
struct NvOsThreadRec * NvOsThreadHandle
NvError NvOsMkdir(char *dirname)
Creates the directory.
NvError
The NvError enumeration contains ALL return / error codes.
@ NvOsFileType_BlockDevice
void NvOsSleepMS(NvU32 msec)
Unschedules the calling thread for at least the given number of milliseconds.
void NvOsStrncpy(char *dest, const char *src, size_t size)
Copies a string, length-limited.
NvError NvOsFtell(NvOsFileHandle file, NvU64 *position)
Gets the current file position pointer.
void NvOsSemaphoreDestroy(NvOsSemaphoreHandle semaphore)
Frees resources held by the semaphore.
struct NvOsConditionRec * NvOsConditionHandle
void NvOsInterruptDone(NvOsInterruptHandle handle)
Called when the ISR/IST is done handling the interrupt.
NvError NvOsFgetc(NvOsFileHandle stream, NvU8 *c)
Gets a character from a file stream.
@ NvOsCallstackType_SymbolStack
NvError NvOsFcloseEx(NvOsFileHandle stream)
Closes a file stream.
void NvOsMutexUnlock(NvOsMutexHandle mutex)
Unlocks a locked mutex.
const char * NvOsThreadGetName(NvOsThreadHandle thread)
Returns the name of the given thread.
NvError NvOsSemaphoreSignalEx(NvOsSemaphoreHandle semaphore)
Increments the semaphore value.
NvError NvOsGetSysConfigString(const char *name, char *value, NvU32 size)
Retrieves a string variable from the config store, with a persist.sys prefix.
void NvOsDataCacheWriteback(void)
Writes back the entire data cache.
int NvOsGetVerboseLevel(NvS32 *VerbLevel)
DW_API_PUBLIC dwPointCloudRangeImageCreatorParams const *const const dwContextHandle_t ctx
NvOsPageFlags
Low-level memory allocation of the external system memory.
void NvOsClosedir(NvOsDirHandle dir)
Closes the directory.
NvU64 mtime
last modified time of the file
@ NvOsCallstackType_NoStack
int NvOsModifyFpsTarget(int fd, int target)
To be deprecated.
NvError NvOsConditionWait(NvOsConditionHandle cond, NvOsMutexHandle mutex)
Atomically releases the mutex and causes the calling thread to block on the condition variable.
NvError NvOsConditionSignal(NvOsConditionHandle cond)
Unblocks atleast one of the threads that are blocked on the specified condition variable.
@ NvOsMemAttribute_WriteCombined
NvS32 NvOsDebugNprintf(const char *format,...)
Same as NvOsDebugPrintf, except returns the number of chars written.
NvError NvOsGetConfigU32(const char *name, NvU32 *value)
Retrieves an unsigned integer variable from the config store.
NvError NvOsGetSystemTime(NvOsSystemTime *hNvOsSystemtime)
Gets system realtime clock.
void NvOsThreadYield(void)
Yields to another runnable thread.
@ NvOsCallstackType_HexStack
void NvOsDebugPrintf(const char *format,...)
Outputs a message to the debugging console, if present.
void NvOsDataCacheWritebackRange(void *start, NvU32 length)
Writes back a range of the data cache.
NvError NvOsPageMap(NvOsPageAllocHandle descriptor, size_t offset, size_t size, void **ptr)
Maps pages into the virtual address space.
struct NvOsDirRec * NvOsDirHandle
A handle to a directory.
void NvOsIntrMutexUnlock(NvOsIntrMutexHandle mutex)
Releases an ISR-safe mutex.
NvError NvOsSemaphoreWaitTimeout(NvOsSemaphoreHandle semaphore, NvU32 msec)
Waits for the given semaphore value to become non-zero with timeout.
NvOsAllocAlignFunc AllocAlign
void(* NvOsDumpCallback)(void *context, const char *line)
int NvOsSetVerboseLevel(NvS32 VerbLevel)
void NvOsPageFree(NvOsPageAllocHandle descriptor)
Frees pages from NvOsPageAlloc().
NvError NvOsSemaphoreWaitEx(NvOsSemaphoreHandle semaphore)
Waits until the semaphore value becomes non-zero, then decrements the value and returns.
NvS32 NvOsAtomicExchangeAdd32(NvS32 *pTarget, NvS32 Value)
Atomically increments the contents of a 32-bit memory location by a specified amount.
@ NvOsCodePage_Windows1252
@ NvOsThreadPriorityType_Native
NvError NvOsSharedMemGetFd(NvOsSharedMemHandle descriptor, int *fd)
Extracts the file descriptor from a handle.
NvError NvOsConditionWaitTimeout(NvOsConditionHandle cond, NvOsMutexHandle mutex, NvU32 microsecs)
Atomically releases the mutex and causes the calling thread to block on the condition variable with a...
void NvOsDumpToDebugPrintf(void *context, const char *line)
NvError NvOsIntrMutexCreate(NvOsIntrMutexHandle *mutex)
Creates a mutex that is safe to aquire in an ISR.
NvError NvOsLibraryLoad(const char *name, NvOsLibraryHandle *library)
Load a dynamic library.
@ NvOsPageFlags_NonContiguous
@ NvOsSeek_Cur
NvOS equivalent of SEEK_CUR.
struct NvOsPageAllocRec * NvOsPageAllocHandle
@ NvOsThreadPriorityType_Normal
void(* NvOsFreeFunc)(struct NvOsAllocatorRec *, void *ptr)
void NvOsSharedMemUnmap(void *ptr, size_t size)
Unmaps a mapped region of shared memory.
void *(* NvOsReallocFunc)(struct NvOsAllocatorRec *, void *ptr, size_t size)
const WFDCommitType const WFDHandle handle
NvError NvOsShowError(NvError err, const char *file, int line)
Prints an error and the line it appeared on.
struct NvOsSemaphoreRec * NvOsSemaphoreHandle
NvError NvOsConditionBroadcast(NvOsConditionHandle cond)
Unblocks all threads currently blocked on the specified condition variable.
struct NvOsSharedMemRec * NvOsSharedMemHandle
An opaque handle returned by shared memory allocations.
NvError NvOsMutexUnlockEx(NvOsMutexHandle mutex)
Unlocks a locked mutex.
NvOsMemAttribute
Defines memory attributes.
static NV_INLINE void NvOsDebugCallstack(NvU32 skip)
void NvOsSemaphoreSignal(NvOsSemaphoreHandle semaphore)
Increments the semaphore value.
@ NvOsThreadPriorityType_Last
NvError NvOsInterruptEnable(NvOsInterruptHandle handle)
Enables the interrupt handler with the IRQ number.
NvError NvOsMutexDestroyEx(NvOsMutexHandle mutex)
Frees the resources held by a mutex.
NvError NvOsFflush(NvOsFileHandle stream)
Flushes any pending writes to the file stream.
NvU32 NvOsTlsKeyHandle
A NvOsTlsKey Handle.
void *(* NvOsAllocFunc)(struct NvOsAllocatorRec *, size_t size)
NvError NvOsInterruptPriorityThreadCreate(NvOsThreadFunction function, void *args, NvOsThreadHandle *thread)
Creates a near interrupt priority thread.
NvOsPhysAddr NvOsPageAddress(NvOsPageAllocHandle descriptor, size_t offset)
Returns the physical address given an offset.
int NvOsDebugExternalLogInit(void)
This function does slog initialization for current executing context.
NvError NvOsSemaphoreDestroyEx(NvOsSemaphoreHandle semaphore)
Frees resources held by the semaphore.
void NvOsDebugVprintf(const char *format, va_list ap)
Same as NvOsDebugPrintf, except takes a va_list.
void NvOsCallstackDump(NvCallstack *stack, NvU32 skip, NvOsDumpCallback callBack, void *context)
NvError NvOsThreadSetName(NvOsThreadHandle thread, const char *name)
Assigns the given name to the given thread.
size_t NvOsStrnlen(const char *s, size_t size)
Gets the length of a string.
struct NvOsOsInfoRec NvOsOsInfo
@ NvOsMemAttribute_WriteBack
struct NvOsAllocatorRec NvOsAllocator
NvOsCodePage
Defines straight-forward mappings to international language encodings.
void NvOsIntrMutexLock(NvOsIntrMutexHandle mutex)
Aquire an ISR-safe mutex.
void NvOsMutexLock(NvOsMutexHandle mutex)
Locks the given unlocked mutex.
void NvOsStrcpy(char *dest, const char *src)
Copies a string.
void NvOsMemcpy(void *dest, const void *src, size_t size)
Copies memory.
void NvOsThreadJoin(NvOsThreadHandle thread)
Waits for the given thread to exit.
NvError NvOsThreadCreate(NvOsThreadFunction function, void *args, NvOsThreadHandle *thread)
Creates a thread.
void * NvOsAlloc(size_t size)
Dynamically allocates memory.
NvError NvOsMapRegSpace(NvU64 *VirtReg, NvU32 Base, NvU32 Size)
NvS32 NvOsVsnprintf(char *str, size_t size, const char *format, va_list ap)
Expands a string into a string buffer using a va_list.
@ NvOsMemAttribute_DeviceMemory
NvError NvOsSleepNS(NvU32 nsec)
void NvOsInterruptUnregister(NvOsInterruptHandle handle)
Unregisters the interrupt handler from the associated IRQ number.
NvError NvOsFremove(const char *filename)
Removes a file from the storage media.
NvError NvOsOpendir(const char *path, NvOsDirHandle *dir)
Opens a directory.
NvCallstack * NvOsCallstackCreate(NvOsCallstackType stackType)
NvU32 NvOsReadReg(NvU64 Reg, NvU32 Off)
NvError NvOsSemaphoreClone(NvOsSemaphoreHandle orig, NvOsSemaphoreHandle *semaphore)
Creates a duplicate semaphore from the given semaphore.
@ NvOsCallstackType_Force32
void NvOsLibraryUnload(NvOsLibraryHandle library)
Unloads a dynamic library.
NvError NvOsFread(NvOsFileHandle stream, void *ptr, size_t size, size_t *bytes)
Reads a file stream.
NvS32 NvOsAtomicCompareExchange32(NvS32 *pTarget, NvS32 OldValue, NvS32 NewValue)
Atomically compares the contents of a 32-bit memory location with a value, and if they match,...
NvError NvOsConditionDestroy(NvOsConditionHandle cond)
Frees resources held by the condition variable.
NvU64 NvOsGetTimeNS(void)
void NvOsFlushWriteCombineBuffer(void)
Flushes the CPU's write combine buffer.
NvError NvOsReaddir(NvOsDirHandle dir, char *name, size_t size)
Gets the next entry in the directory.
@ NvOsPageFlags_Contiguous
void NvOsWaitUS(NvU32 usec)
Stalls the calling thread for at least the given number of microseconds.
struct NvCallstackRec NvCallstack
size_t NvOsStrlen(const char *s)
Gets the length of a string.
NvError NvOsTlsAddTerminator(void(*func)(void *), void *context)
Registers a function that should be called when the thread terminates to clean up any structures stor...
NvU32 NvOsCallstackGetHeight(NvCallstack *stack)
void NvOsSemaphoreWait(NvOsSemaphoreHandle semaphore)
Waits until the semaphore value becomes non-zero, then decrements the value and returns.
Defines the system time structure.
void NvOsMutexDestroy(NvOsMutexHandle mutex)
Frees the resources held by a mutex.
void * NvOsTlsGet(NvOsTlsKeyHandle TlsIndex)
Gets the value of a thread-local storage variable.
NvError NvOsFtruncate(NvOsFileHandle stream, NvU64 length)
Causes the file to have a size of length bytes.
struct NvOsMutexRec * NvOsMutexHandle
void NvOsFree(void *ptr)
Frees a dynamic memory allocation.
NvError NvOsSleepUS(NvU32 usec)
typedef void(WFD_APIENTRY PFNWFDBINDSOURCETOPIPELINEWITHTIMESTAMPNV)(const WFDDevice device
void(* NvOsInterruptHandler)(void *args)
Interrupt handler function.
void *(* NvOsAllocAlignFunc)(struct NvOsAllocatorRec *, size_t align, size_t size)
NvError NvOsSharedMemMap(NvOsSharedMemHandle descriptor, size_t offset, size_t size, void **ptr)
Maps a shared memory region into the process virtual memory.
NvError NvOsSharedMemAlloc(const char *key, size_t size, NvOsSharedMemHandle *descriptor)
Dynamically allocates multiprocess shared memory.
NvS32 NvOsAtomicExchange32(NvS32 *pTarget, NvS32 Value)
Atomically swaps the contents of a 32-bit memory location with a value.
NvError NvOsSharedMemHandleFromFd(int fd, NvOsSharedMemHandle *descriptor)
Enables sharing NvOsSharedMemHandle memory that was created by a call to NvOsSharedMemAlloc().
@ NvOsThreadPriorityType_Force32
@ NvOsMemAttribute_InnerWriteBack
NvU32 NvOsGetTimeMS(void)
void NvOsGetProcessInfo(char *buf, NvU32 len)
NvError NvOsSemaphoreCreate(NvOsSemaphoreHandle *semaphore, NvU32 value)
Creates a counting semaphore.
NvError NvOsGetOsInformation(NvOsOsInfo *pOsInfo)
Gets the current OS version.
@ NvOsMemAttribute_SO_DeviceMemory
@ NvOsSeek_Force32
Max value for NvOsSeekEnum.
int NvOsMemcmp(const void *s1, const void *s2, size_t size)
Compares two memory regions.
NvError NvOsBusyWaitUS(NvU32 usec)
Stalls the calling thread for at least the given number of microseconds.
struct NvOsLibraryRec * NvOsLibraryHandle
A handle to a dynamic library.
void NvOsCallstackGetFrame(char *buf, NvU32 len, NvCallstack *stack, NvU32 level)
NvError NvOsFprintf(NvOsFileHandle stream, const char *format,...)
Prints a string to a file stream.
void NvOsInstrCacheInvalidate(void)
Invalidates the entire instruction cache.
@ NvOsMemAttribute_Force32
void NvOsMemset(void *s, NvU8 c, size_t size)
Sets a region of memory to a value.
void NvOsIntrMutexDestroy(NvOsIntrMutexHandle mutex)
Destroys an ISR-safe mutex.
NvBool NvOsIsMemoryOfGivenType(NvOsMemAttribute Attrib, NvU32 Addr)
Checks and returns whether the given memory address is within memory of given attribute.
struct NvOsAllocatorRec * NvOsGetCurrentAllocator(void)
NvU64 NvOsGetCurrentThreadId(void)
Returns current thread ID.
void NvOsPageUnmap(NvOsPageAllocHandle descriptor, void *ptr, size_t size)
Unmaps the virtual address from NvOsPageMap().
@ NvOsMemAttribute_Secured
void NvOsSharedMemFree(NvOsSharedMemHandle descriptor)
Frees shared memory from NvOsSharedMemAlloc().
NvU32 NvOsPhysAddr
A physical address.
NvError NvOsFopen(const char *path, NvU32 flags, NvOsFileHandle *file)
Opens a file stream.
NvError NvOsThreadJoinEx(NvOsThreadHandle thread)
Waits for the given thread to exit.
void NvOsTlsSet(NvOsTlsKeyHandle TlsIndex, void *Value)
Sets the value of a thread-local storage variable.
NvError NvOsMutexCreate(NvOsMutexHandle *mutex)
Allocates a new process-local mutex.
void NvOsDataCacheWritebackInvalidateRange(void *start, NvU32 length)
Writes back and invlidates a range of the data cache.
void NvOsLogPrintf(int prio, const char *tag, const char *format,...)
Same as NvOsDebugPrintf, except takes priority and tag fields.
void NvOsInterruptMask(NvOsInterruptHandle handle, NvBool mask)
Mask/unmask an interrupt.
NvError NvOsFseek(NvOsFileHandle file, NvS64 offset, NvOsSeekEnum whence)
Changes the file position pointer.
@ NvOsSeek_End
NvOS equivalent of SEEK_END.
NvError NvOsPhysicalMemMap(NvOsPhysAddr phys, size_t size, NvOsMemAttribute attrib, NvU32 flags, void **ptr)
Maps computer resources into user space.
NvError NvOsBusyWaitNS(NvU32 nsec)
void NvOsVerbosePrintf(NvS32 VerbLevel, const char *Fmt,...)
void * NvOsLibraryGetSymbol(NvOsLibraryHandle library, const char *symbol)
Gets an address of a symbol in a dynamic library.
void NvOsDebugString(const char *str)
void NvOsFclose(NvOsFileHandle stream)
Closes a file stream.
NvU32 NvOsCallstackHash(NvCallstack *stack)
struct NvOsIntrMutexRec * NvOsIntrMutexHandle
@ NvOsMemAttribute_Uncached
void NvOsCancelFpsTarget(int fd)
To be deprecated.
int NvOsSetFpsTarget(int target)
To be deprecated.
NvError NvOsFstat(NvOsFileHandle file, NvOsStatType *stat)
Gets file information from an already open file.
NvOsTlsKeyHandle NvOsTlsAllocWithDestructor(void(*destructor)(void *))
Allocates a thread-local storage variable, with destructor when thread exits.
void NvOsTlsFree(NvOsTlsKeyHandle TlsIndex)
Frees a thread-local storage variable.
void NvOsPhysicalMemUnmap(void *ptr, size_t size)
Releases resources previously allocated by NvOsPhysicalMemMap().
NvError NvOsLibraryUnloadEx(NvOsLibraryHandle library)
Unloads a dynamic library.
NvError NvOsMutexLockEx(NvOsMutexHandle mutex)
Locks the given unlocked mutex.
struct NvOsSystemTimeRec NvOsSystemTime
Defines the system time structure.
NvError NvOsFwrite(NvOsFileHandle stream, const void *ptr, size_t size)
Writes to a file stream.
struct NvOsInterruptRec * NvOsInterruptHandle
Interrupt handler type.
void NvOsCallstackDestroy(NvCallstack *callstack)
@ NvOsSeek_Set
NvOS equivalent of SEEK_SET.
void * NvOsAllocAlign(size_t align, size_t size)
Dynamically allocates memory with specific alignment.
NvU64 NvOsGetTimeUS(void)
NvBool NvOsCallstackContainsPid(NvCallstack *stack, NvU32 pid)
void(* NvOsThreadFunction)(void *args)
Entry point for a thread.