NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release
nvos_s1_tegra.h File Reference

Go to the source code of this file.

Typedefs

typedef struct NvCallstackRec NvCallstack
 
typedef void(* NvOsDumpCallback) (void *context, const char *line)
 
typedef struct NvOsIntrMutexRec * NvOsIntrMutexHandle
 
typedef void(* NvOsInterruptHandler) (void *args)
 Interrupt handler function. More...
 

Enumerations

enum  {
  NVOS_VERB_LVL_0 = 0,
  NVOS_VERB_LVL_1 = 1,
  NVOS_VERB_LVL_2 = 2,
  NVOS_VERB_LVL_3 = 3,
  NVOS_VERB_LVL_4 = 4
}
 It point verbose log level, used as a parameter of NvOsSetVerboseLevel() function. More...
 
enum  NvOsCallstackType {
  NvOsCallstackType_NoStack = 1,
  NvOsCallstackType_HexStack = 2,
  NvOsCallstackType_SymbolStack = 3,
  NvOsCallstackType_Last = 4,
  NvOsCallstackType_Force32 = 0x7FFFFFFF
}
 

Functions

NvError NvOsFremove (const char *filename)
 This function removes a file. More...
 
NvError NvOsMkdir (char *dirname)
 This function creates a directory. More...
 
NvError NvOsReaddir (NvOsDirHandle dir, char *name, size_t size)
 This function gets an entry name in directory. More...
 
size_t NvOsStrlen (const char *s)
 This function counts string length. More...
 
NvError NvOsFsync (NvOsFileHandle stream)
 
NvError NvOsFtruncate (NvOsFileHandle stream, NvU64 length)
 
NvS32 NvOsVsnprintf (char *str, size_t size, const char *format, va_list ap)
 This function produces a string according format parameter and ap parameter. And the maximum length of produced string, is limited by size parameter. More...
 
NvS32 NvOsSnprintf (char *str, size_t size, const char *format,...)
 This function produces a string according format parameter, variable-argument list and size parameter. The maximum length of produced string, is limited by size parameter. More...
 
void NvOsLibraryUnload (NvOsLibraryHandle library)
 This function unloads the loaded dynamic lib. More...
 
void NvOsFclose (NvOsFileHandle hFile)
 This function closes a file stream. More...
 
void NvOsMutexDestroy (NvOsMutexHandle mutex)
 This function destroys a mutex. More...
 
void NvOsMutexLock (NvOsMutexHandle mutex)
 This function locks a mutex. More...
 
void NvOsMutexUnlock (NvOsMutexHandle mutex)
 This function unlocks a mutex. More...
 
void NvOsSemaphoreDestroy (NvOsSemaphoreHandle semaphore)
 This function destroys a semaphore. More...
 
void NvOsSemaphoreSignal (NvOsSemaphoreHandle semaphore)
 This function increases the number of wait operation, to given semaphore. More...
 
void NvOsSemaphoreWait (NvOsSemaphoreHandle semaphore)
 This function waits a semaphore, and decrease the number of wait operations. Thread is blocked infinitely, if number of semaphore wait operations is 0. More...
 
void NvOsWaitUS (NvU32 usec)
 This function busy-wait without blocking for a period of time. This function is designed for use that requires short time delay less than 1ms. If a delay more than 1ms is ncessary, please use NvOsSleepMS(). More...
 
void NvOsThreadJoin (NvOsThreadHandle t)
 This function blocks until while the thread is running, after the thread is terminated, this function unblocks. More...
 
NvError NvOsFprintf (NvOsFileHandle hFile, const char *format,...)
 This function print string into a file stream as format and per format parameter and variable-argument list. More...
 
void NvOsDebugPrintf (const char *format,...)
 This function print log. More...
 
void NvOsLogPrintf (int prio, const char *tag, const char *format,...)
 This function prints a log message according to the prio parameter. More...
 
void NvOsVerbosePrintf (NvS32 VerbLevel, const char *Fmt,...)
 This function print log, if current verbose log level is not smaller than log's verbose level. Log's verbose level is given as VerbLevel parameter, and log is printed actually by slogf() in QNX libc. More...
 
void NvOsDebugString (const char *str)
 This function prints debug logs via the system log facility. More...
 
void NvOsDebugVprintf (const char *format, va_list ap)
 This function print log as per format parameter and variable-argument list. More...
 
int NvOsGetVerboseLevel (NvS32 *VerbLevel)
 This function gets the verbose log level. More...
 
int NvOsSetVerboseLevel (NvS32 VerbLevel)
 This function set the verbose log level. More...
 
void NvOsDumpToDebugPrintf (void *context, const char *line)
 
NvCallstack * NvOsCallstackCreate (NvOsCallstackType stackType)
 
void NvOsCallstackDestroy (NvCallstack *callstack)
 
NvU32 NvOsCallstackGetHeight (NvCallstack *stack)
 
void NvOsCallstackGetFrame (char *buf, NvU32 len, NvCallstack *stack, NvU32 level)
 
void NvOsCallstackDump (NvCallstack *stack, NvU32 skip, NvOsDumpCallback callBack, void *context)
 
NvU32 NvOsCallstackHash (NvCallstack *stack)
 
NvBool NvOsCallstackContainsPid (NvCallstack *stack, NvU32 pid)
 
static NV_INLINE void NvOsDebugCallstack (NvU32 skip)
 
NvError NvOsVfprintf (NvOsFileHandle stream, const char *format, va_list ap)
 Prints a string to a file stream using a va_list. More...
 
NvS32 NvOsDebugNprintf (const char *format,...)
 Same as NvOsDebugPrintf, except returns the number of chars written. More...
 
void NvOsStrcpy (char *dest, const char *src)
 Copies a string. More...
 
int NvOsMemcmp (const void *s1, const void *s2, size_t size)
 Compares two memory regions. More...
 
NvError NvOsPhysicalMemMap (NvOsPhysAddr phys, size_t size, NvOsMemAttribute attrib, NvU32 flags, void **ptr)
 Maps computer resources into user space. More...
 
void NvOsPhysicalMemUnmap (void *ptr, size_t size)
 Releases resources previously allocated by NvOsPhysicalMemMap(). More...
 
NvError NvOsIntrMutexCreate (NvOsIntrMutexHandle *mutex)
 Creates a mutex that is safe to aquire in an ISR. More...
 
void NvOsIntrMutexLock (NvOsIntrMutexHandle mutex)
 Aquire an ISR-safe mutex. More...
 
void NvOsIntrMutexUnlock (NvOsIntrMutexHandle mutex)
 Releases an ISR-safe mutex. More...
 
void NvOsIntrMutexDestroy (NvOsIntrMutexHandle mutex)
 Destroys an ISR-safe mutex. More...
 
void NvOsDataCacheWritebackRange (void *start, NvU32 length)
 Writes back a range of the data cache. More...
 
void NvOsDataCacheWritebackInvalidateRange (void *start, NvU32 length)
 Writes back and invlidates a range of the data cache. More...
 
void NvOsFlushWriteCombineBuffer (void)
 Flushes the CPU's write combine buffer. More...
 
NvError NvOsInterruptRegister (NvU32 IrqListSize, const NvU32 *pIrqList, const NvOsInterruptHandler *pIrqHandlerList, void *context, NvOsInterruptHandle *handle, NvBool InterruptEnable)
 Registers the interrupt handler with the IRQ number. More...
 
void NvOsInterruptUnregister (NvOsInterruptHandle handle)
 Unregisters the interrupt handler from the associated IRQ number. More...
 
NvError NvOsInterruptEnable (NvOsInterruptHandle handle)
 Enables the interrupt handler with the IRQ number. More...
 
void NvOsInterruptDone (NvOsInterruptHandle handle)
 Called when the ISR/IST is done handling the interrupt. More...
 
int NvOsSetFpsTarget (int target)
 To be deprecated. More...
 
int NvOsModifyFpsTarget (int fd, int target)
 To be deprecated. More...
 
void NvOsCancelFpsTarget (int fd)
 To be deprecated. More...
 
NvError NvOsInterruptPriorityThreadCreate (NvOsThreadFunction function, void *args, NvOsThreadHandle *thread)
 Creates a near interrupt priority thread. More...
 

Typedef Documentation

◆ NvCallstack

typedef struct NvCallstackRec NvCallstack

Definition at line 659 of file nvos_s1_tegra.h.

◆ NvOsDumpCallback

typedef void(* NvOsDumpCallback) (void *context, const char *line)

Definition at line 671 of file nvos_s1_tegra.h.

◆ NvOsInterruptHandler

typedef void(* NvOsInterruptHandler) (void *args)

Interrupt handler function.

Definition at line 818 of file nvos_s1_tegra.h.

◆ NvOsIntrMutexHandle

typedef struct NvOsIntrMutexRec* NvOsIntrMutexHandle

Definition at line 699 of file nvos_s1_tegra.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

It point verbose log level, used as a parameter of NvOsSetVerboseLevel() function.

Enumerator
NVOS_VERB_LVL_0 

NvOS log verbosity level 0 (lowest)

NVOS_VERB_LVL_1 

NvOS log verbosity level 1.

NVOS_VERB_LVL_2 

NvOS log verbosity level 2.

NVOS_VERB_LVL_3 

NvOS log verbosity level 3.

NVOS_VERB_LVL_4 

NvOS log verbosity level 4 (highest)

Definition at line 578 of file nvos_s1_tegra.h.

◆ NvOsCallstackType

Enumerator
NvOsCallstackType_NoStack 
NvOsCallstackType_HexStack 
NvOsCallstackType_SymbolStack 
NvOsCallstackType_Last 
NvOsCallstackType_Force32 

Definition at line 661 of file nvos_s1_tegra.h.

Function Documentation

◆ NvOsCallstackContainsPid()

NvBool NvOsCallstackContainsPid ( NvCallstack *  stack,
NvU32  pid 
)

◆ NvOsCallstackCreate()

NvCallstack* NvOsCallstackCreate ( NvOsCallstackType  stackType)

Referenced by NvOsDebugCallstack().

◆ NvOsCallstackDestroy()

void NvOsCallstackDestroy ( NvCallstack *  callstack)

Referenced by NvOsDebugCallstack().

◆ NvOsCallstackDump()

void NvOsCallstackDump ( NvCallstack *  stack,
NvU32  skip,
NvOsDumpCallback  callBack,
void *  context 
)

Referenced by NvOsDebugCallstack().

◆ NvOsCallstackGetFrame()

void NvOsCallstackGetFrame ( char *  buf,
NvU32  len,
NvCallstack *  stack,
NvU32  level 
)

◆ NvOsCallstackGetHeight()

NvU32 NvOsCallstackGetHeight ( NvCallstack *  stack)

◆ NvOsCallstackHash()

NvU32 NvOsCallstackHash ( NvCallstack *  stack)

◆ NvOsCancelFpsTarget()

void NvOsCancelFpsTarget ( int  fd)

To be deprecated.

Cancels the fps target previously supplied with the NvOsSetFpsTarget() function.

Parameters
fdThe file descriptor generated by NvOsSetFpsTarget.

◆ NvOsDataCacheWritebackInvalidateRange()

void NvOsDataCacheWritebackInvalidateRange ( void *  start,
NvU32  length 
)

Writes back and invlidates a range of the data cache.

Parameters
startA pointer to the start address.
lengthThe number of bytes to write back.

◆ NvOsDataCacheWritebackRange()

void NvOsDataCacheWritebackRange ( void *  start,
NvU32  length 
)

Writes back a range of the data cache.

Parameters
startA pointer to the start address.
lengthThe number of bytes to write back.

◆ NvOsDebugCallstack()

static NV_INLINE void NvOsDebugCallstack ( NvU32  skip)
static

◆ NvOsDebugNprintf()

NvS32 NvOsDebugNprintf ( const char *  format,
  ... 
)

Same as NvOsDebugPrintf, except returns the number of chars written.

Returns
number of chars written or -1 if that number is unavailable.

◆ NvOsDebugString()

void NvOsDebugString ( const char *  str)

This function prints debug logs via the system log facility.

Parameters
[in]strThe string to be printed
Returns
N/A
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • Allowed execution state
    • Initialization: Yes
    • Operational: Yes
    • Reinit/Deinit Preparation: Yes
  • Maturity: GA

◆ NvOsDumpToDebugPrintf()

void NvOsDumpToDebugPrintf ( void *  context,
const char *  line 
)

Referenced by NvOsDebugCallstack().

◆ NvOsFlushWriteCombineBuffer()

void NvOsFlushWriteCombineBuffer ( void  )

Flushes the CPU's write combine buffer.

◆ NvOsFsync()

NvError NvOsFsync ( NvOsFileHandle  stream)

◆ NvOsFtruncate()

NvError NvOsFtruncate ( NvOsFileHandle  stream,
NvU64  length 
)

◆ NvOsInterruptDone()

void NvOsInterruptDone ( NvOsInterruptHandle  handle)

Called when the ISR/IST is done handling the interrupt.

Parameters
handleInterrupt handle returned when a successfull call is made to NvOsInterruptRegister().

◆ NvOsInterruptEnable()

NvError NvOsInterruptEnable ( NvOsInterruptHandle  handle)

Enables the interrupt handler with the IRQ number.

Note
This function is intended to only be called from NvOsInterruptRegister().
Parameters
handleInterrupt handle returned when a successfull call is made to NvOsInterruptRegister.
Return values
NvError_BadParameterIf the handle is not valid.
NvError_InsufficientMemoryIf interrupt enable failed.
NvSuccessIf interrupt enable is successful.

◆ NvOsInterruptPriorityThreadCreate()

NvError NvOsInterruptPriorityThreadCreate ( NvOsThreadFunction  function,
void *  args,
NvOsThreadHandle *  thread 
)

Creates a near interrupt priority thread.

Parameters
functionThe thread entry point.
argsA pointer to the thread arguments.
[out]threadA pointer to the result thread ID structure.

◆ NvOsInterruptRegister()

NvError NvOsInterruptRegister ( NvU32  IrqListSize,
const NvU32 *  pIrqList,
const NvOsInterruptHandler *  pIrqHandlerList,
void *  context,
NvOsInterruptHandle *  handle,
NvBool  InterruptEnable 
)

Registers the interrupt handler with the IRQ number.

Parameters
IrqListSizeSize of the IrqList passed in for registering the IRQ handlers for each IRQ number.
pIrqListArray of IRQ numbers for which interupt handlers are to be registerd.
pIrqHandlerListA pointer to an array of interrupt routines to be called when an interrupt occurs.
contextA pointer to the register's context handle.
handleA pointer to the interrupt handle.
InterruptEnableIf true, immediately enable interrupt. Otherwise enable interrupt only after calling NvOsInterruptEnable().
Return values
NvError_IrqRegistrationFailedIf the interrupt is already registered.
NvError_BadParameterIf the IRQ number is not valid.

◆ NvOsInterruptUnregister()

void NvOsInterruptUnregister ( NvOsInterruptHandle  handle)

Unregisters the interrupt handler from the associated IRQ number.

Note
This function is intended to only be called from NvOsInterruptUnregister().
Parameters
handleinterrupt Handle returned when a successfull call is made to NvOsInterruptRegister().

◆ NvOsIntrMutexCreate()

NvError NvOsIntrMutexCreate ( NvOsIntrMutexHandle *  mutex)

Creates a mutex that is safe to aquire in an ISR.

Parameters
mutexA pointer to the mutex is stored here on success.

◆ NvOsIntrMutexDestroy()

void NvOsIntrMutexDestroy ( NvOsIntrMutexHandle  mutex)

Destroys an ISR-safe mutex.

Parameters
mutexThe mutex to destroy. If mutex is NULL, this API has no effect.

◆ NvOsIntrMutexLock()

void NvOsIntrMutexLock ( NvOsIntrMutexHandle  mutex)

Aquire an ISR-safe mutex.

Parameters
mutexThe mutex to lock. For kernel (OAL) implementations, NULL implies the system-wide lock will be used.

◆ NvOsIntrMutexUnlock()

void NvOsIntrMutexUnlock ( NvOsIntrMutexHandle  mutex)

Releases an ISR-safe mutex.

Parameters
mutexThe mutex to unlock. For kernel (OAL) implementations, NULL implies the system-wide lock will be used.

◆ NvOsMemcmp()

int NvOsMemcmp ( const void *  s1,
const void *  s2,
size_t  size 
)

Compares two memory regions.

Deprecated:
Instead use memcmp().
Parameters
s1A pointer to the first memory region.
s2A pointer to the second memory region.
sizeThe length to compare.

This returns 0 If the memory regions are identical

◆ NvOsModifyFpsTarget()

int NvOsModifyFpsTarget ( int  fd,
int  target 
)

To be deprecated.

Sets the frame rate target with an existing file descriptor (fd).

Parameters
fdAn open fd returned by the NvOsSetFpsTarget() function.
targetThe fps target.

◆ NvOsPhysicalMemMap()

NvError NvOsPhysicalMemMap ( NvOsPhysAddr  phys,
size_t  size,
NvOsMemAttribute  attrib,
NvU32  flags,
void **  ptr 
)

Maps computer resources into user space.

Parameters
physThe physical address start.
sizeThe size of the aperture.
attribMemory attributes (caching).
flagsBitwise OR of NVOS_MEM_*.
[out]ptrA pointer to the result pointer.

◆ NvOsPhysicalMemUnmap()

void NvOsPhysicalMemUnmap ( void *  ptr,
size_t  size 
)

Releases resources previously allocated by NvOsPhysicalMemMap().

Parameters
ptrThe virtual pointer returned by NvOsPhysicalMemMap. If this pointer is null, this function has no effect.
sizeThe size of the mapped region.

◆ NvOsSetFpsTarget()

int NvOsSetFpsTarget ( int  target)

To be deprecated.

Sets a frame rate target that matches the CPU frequency scaling to the measured performance.

Parameters
targetThe fps target.
Returns
A file descriptor that, on exiting, you pass to the NvOsCancelFpsTarget function.

◆ NvOsStrcpy()

void NvOsStrcpy ( char *  dest,
const char *  src 
)

Copies a string.

The src string must be NUL terminated.

Deprecated:
Instead use strcpy().
Parameters
destA pointer to the destination of the copy.
srcA pointer to the source string.

◆ NvOsVfprintf()

NvError NvOsVfprintf ( NvOsFileHandle  stream,
const char *  format,
va_list  ap 
)

Prints a string to a file stream using a va_list.

Parameters
streamThe file stream.
formatA pointer to the format string.
apThe va_list structure.