NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release
nvos_s1_tegra.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2019-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION and its licensors retain all intellectual property
6  * and proprietary rights in and to this software, related documentation
7  * and any modifications thereto. Any use, reproduction, disclosure or
8  * distribution of this software and related documentation without an express
9  * license agreement from NVIDIA CORPORATION is strictly prohibited
10  */
11 
12 #ifndef INCLUDED_NVOS_S1_TEGRA_H
13 #define INCLUDED_NVOS_S1_TEGRA_H
14 
15 #include <stdarg.h>
16 
17 #include "nvcommon.h"
18 #include "nverror.h"
19 
21 #include "nvos_s3_tegra_safety.h"
22 
23 #if defined(__cplusplus)
24 extern "C"
25 {
26 #endif
27 
52 NvError NvOsFremove(const char *filename);
53 
73 NvError NvOsMkdir(char *dirname);
74 
93 NvError NvOsReaddir(NvOsDirHandle dir, char *name, size_t size);
94 
115 size_t NvOsStrlen(const char *s);
116 
118 
119 NvError
120 NvOsFtruncate(NvOsFileHandle stream, NvU64 length);
121 
141 NvS32 NvOsVsnprintf(char *str, size_t size, const char *format, va_list ap);
142 
163 NvS32 NvOsSnprintf(char *str, size_t size, const char *format, ...);
164 
199 
219 void NvOsFclose(NvOsFileHandle hFile);
220 
254 
280 void NvOsMutexLock(NvOsMutexHandle mutex);
281 
301 void NvOsMutexUnlock(NvOsMutexHandle mutex);
302 
338 
359 
385 void NvOsSemaphoreWait(NvOsSemaphoreHandle semaphore);
386 
413 void NvOsWaitUS(NvU32 usec);
414 
440 
463 NvError NvOsFprintf(NvOsFileHandle hFile, const char *format, ...);
464 
484 void NvOsDebugPrintf(const char *format, ...);
485 
516 void NvOsLogPrintf(int prio, const char *tag, const char *format, ...);
517 
540 void NvOsVerbosePrintf(NvS32 VerbLevel, const char *Fmt, ...);
541 
569 void NvOsDebugString(const char *str);
570 
578 enum {
589 };
590 
611 void NvOsDebugVprintf(const char *format, va_list ap);
612 
631 int NvOsGetVerboseLevel(NvS32 *VerbLevel);
632 
655 int NvOsSetVerboseLevel(NvS32 VerbLevel);
656 
657 #if defined(__linux__)
658 
659 typedef struct NvCallstackRec NvCallstack;
660 
661 typedef enum
662 {
666 
670 
671 typedef void (*NvOsDumpCallback)(void* context, const char* line);
672 
673 void NvOsDumpToDebugPrintf(void* context, const char* line);
674 
676 
677 void NvOsCallstackDestroy (NvCallstack* callstack);
678 
679 NvU32 NvOsCallstackGetHeight (NvCallstack* stack);
680 
681 void NvOsCallstackGetFrame (char* buf, NvU32 len, NvCallstack* stack, NvU32 level);
682 
683 void NvOsCallstackDump (NvCallstack* stack, NvU32 skip, NvOsDumpCallback callBack, void* context);
684 
685 NvU32 NvOsCallstackHash (NvCallstack* stack);
686 
687 NvBool NvOsCallstackContainsPid (NvCallstack* stack, NvU32 pid);
688 
689 static NV_INLINE void NvOsDebugCallstack(NvU32 skip)
690 {
692  if (stack)
693  {
694  NvOsCallstackDump(stack, skip, NvOsDumpToDebugPrintf, NULL);
695  NvOsCallstackDestroy(stack);
696  }
697 }
698 
699 typedef struct NvOsIntrMutexRec *NvOsIntrMutexHandle;
700 
707 NvError
708 NvOsVfprintf(NvOsFileHandle stream, const char *format, va_list ap);
709 
715 NvS32
716 NvOsDebugNprintf( const char *format, ...);
717 
727 void
728 NvOsStrcpy(char *dest, const char *src);
729 
740 int
741 NvOsMemcmp(const void *s1, const void *s2, size_t size);
742 
751 NvError
752 NvOsPhysicalMemMap(NvOsPhysAddr phys, size_t size,
753  NvOsMemAttribute attrib, NvU32 flags, void **ptr);
754 
762 void NvOsPhysicalMemUnmap(void *ptr, size_t size);
763 
770 
778 
786 
794 
800 void
801 NvOsDataCacheWritebackRange(void *start, NvU32 length);
802 
808 void
809 NvOsDataCacheWritebackInvalidateRange(void *start, NvU32 length);
810 
813 void
815 
818 typedef void (*NvOsInterruptHandler)(void *args);
819 
837 NvError
838 NvOsInterruptRegister(NvU32 IrqListSize,
839  const NvU32 *pIrqList,
840  const NvOsInterruptHandler *pIrqHandlerList,
841  void *context,
843  NvBool InterruptEnable);
844 
854 void
856 
870 NvError
872 
879 void
881 
891 int NvOsSetFpsTarget(int target);
892 
901 int NvOsModifyFpsTarget(int fd, int target);
902 
910 void NvOsCancelFpsTarget(int fd);
911 
918 NvError
920  NvOsThreadHandle *thread);
921 
922 #if NV_DEBUG
923 
934 void NvOsSetResourceAllocFileLine(void* userptr, const char* file, int line);
935 #endif
936 
937 #endif
938 
939 #if defined(__cplusplus)
940 }
941 #endif
942 
943 #endif // INCLUDED_NVOS_S1_TEGRA_H
NvOsMkdir
NvError NvOsMkdir(char *dirname)
This function creates a directory.
NvOsSetVerboseLevel
int NvOsSetVerboseLevel(NvS32 VerbLevel)
This function set the verbose log level.
NvOsLogPrintf
void NvOsLogPrintf(int prio, const char *tag, const char *format,...)
This function prints a log message according to the prio parameter.
NvOsWaitUS
void NvOsWaitUS(NvU32 usec)
This function busy-wait without blocking for a period of time. This function is designed for use that...
NvOsDataCacheWritebackInvalidateRange
void NvOsDataCacheWritebackInvalidateRange(void *start, NvU32 length)
Writes back and invlidates a range of the data cache.
NvOsDebugNprintf
NvS32 NvOsDebugNprintf(const char *format,...)
Same as NvOsDebugPrintf, except returns the number of chars written.
NvOsMutexUnlock
void NvOsMutexUnlock(NvOsMutexHandle mutex)
This function unlocks a mutex.
NVOS_VERB_LVL_4
@ NVOS_VERB_LVL_4
NvOS log verbosity level 4 (highest)
Definition: nvos_s1_tegra.h:588
NvError
NvError
The NvError enumeration contains ALL return / error codes.
Definition: nverror.h:43
NvOsCallstackCreate
NvCallstack * NvOsCallstackCreate(NvOsCallstackType stackType)
NvOsMutexLock
void NvOsMutexLock(NvOsMutexHandle mutex)
This function locks a mutex.
NvOsCallstackType_Force32
@ NvOsCallstackType_Force32
Definition: nvos_s1_tegra.h:668
NvOsGetVerboseLevel
int NvOsGetVerboseLevel(NvS32 *VerbLevel)
This function gets the verbose log level.
NvOsFprintf
NvError NvOsFprintf(NvOsFileHandle hFile, const char *format,...)
This function print string into a file stream as format and per format parameter and variable-argumen...
NvOsDumpToDebugPrintf
void NvOsDumpToDebugPrintf(void *context, const char *line)
NvOsMutexDestroy
void NvOsMutexDestroy(NvOsMutexHandle mutex)
This function destroys a mutex.
NvOsCancelFpsTarget
void NvOsCancelFpsTarget(int fd)
To be deprecated.
NvOsIntrMutexUnlock
void NvOsIntrMutexUnlock(NvOsIntrMutexHandle mutex)
Releases an ISR-safe mutex.
NvOsCallstackType
NvOsCallstackType
Definition: nvos_s1_tegra.h:661
NvOsLibraryHandle
void * NvOsLibraryHandle
Definition: nvos_s3_tegra_safety.h:436
nverror.h
NvOsMutexHandle
struct NvOsMutexRec * NvOsMutexHandle
Definition: nvos_s3_tegra_safety.h:344
NvOsIntrMutexLock
void NvOsIntrMutexLock(NvOsIntrMutexHandle mutex)
Aquire an ISR-safe mutex.
NvOsInterruptHandle
struct NvOsInterruptRec * NvOsInterruptHandle
Definition: nvos_common_tegra_safety.h:426
NvOsFileRec
Definition: nvos_common_tegra_safety.h:103
NvOsInterruptEnable
NvError NvOsInterruptEnable(NvOsInterruptHandle handle)
Enables the interrupt handler with the IRQ number.
NvOsLibraryUnload
void NvOsLibraryUnload(NvOsLibraryHandle library)
This function unloads the loaded dynamic lib.
NVOS_VERB_LVL_1
@ NVOS_VERB_LVL_1
NvOS log verbosity level 1.
Definition: nvos_s1_tegra.h:582
NvOsSemaphoreHandle
struct NvOsSemaphoreRec * NvOsSemaphoreHandle
Definition: nvos_s3_tegra_safety.h:1245
NvOsCallstackContainsPid
NvBool NvOsCallstackContainsPid(NvCallstack *stack, NvU32 pid)
NvOsVerbosePrintf
void NvOsVerbosePrintf(NvS32 VerbLevel, const char *Fmt,...)
This function print log, if current verbose log level is not smaller than log's verbose level....
NvOsIntrMutexHandle
struct NvOsIntrMutexRec * NvOsIntrMutexHandle
Definition: nvos_s1_tegra.h:699
NvOsThreadJoin
void NvOsThreadJoin(NvOsThreadHandle t)
This function blocks until while the thread is running, after the thread is terminated,...
nvcommon.h
NvOsSemaphoreDestroy
void NvOsSemaphoreDestroy(NvOsSemaphoreHandle semaphore)
This function destroys a semaphore.
nvos_common_tegra_safety.h
NvOsInterruptUnregister
void NvOsInterruptUnregister(NvOsInterruptHandle handle)
Unregisters the interrupt handler from the associated IRQ number.
NvOsSemaphoreWait
void NvOsSemaphoreWait(NvOsSemaphoreHandle semaphore)
This function waits a semaphore, and decrease the number of wait operations. Thread is blocked infini...
NvOsInterruptDone
void NvOsInterruptDone(NvOsInterruptHandle handle)
Called when the ISR/IST is done handling the interrupt.
NvOsVfprintf
NvError NvOsVfprintf(NvOsFileHandle stream, const char *format, va_list ap)
Prints a string to a file stream using a va_list.
NvOsFremove
NvError NvOsFremove(const char *filename)
This function removes a file.
NvOsDumpCallback
void(* NvOsDumpCallback)(void *context, const char *line)
Definition: nvos_s1_tegra.h:671
NvOsSemaphoreSignal
void NvOsSemaphoreSignal(NvOsSemaphoreHandle semaphore)
This function increases the number of wait operation, to given semaphore.
NvOsStrcpy
void NvOsStrcpy(char *dest, const char *src)
Copies a string.
NvOsIntrMutexDestroy
void NvOsIntrMutexDestroy(NvOsIntrMutexHandle mutex)
Destroys an ISR-safe mutex.
NvOsFlushWriteCombineBuffer
void NvOsFlushWriteCombineBuffer(void)
Flushes the CPU's write combine buffer.
NvOsThreadFunction
void(* NvOsThreadFunction)(void *args)
Definition: nvos_s3_tegra_safety.h:1711
NvOsCallstackType_HexStack
@ NvOsCallstackType_HexStack
Definition: nvos_s1_tegra.h:664
NvOsCallstackType_NoStack
@ NvOsCallstackType_NoStack
Definition: nvos_s1_tegra.h:663
NvOsSnprintf
NvS32 NvOsSnprintf(char *str, size_t size, const char *format,...)
This function produces a string according format parameter, variable-argument list and size parameter...
NVOS_VERB_LVL_0
@ NVOS_VERB_LVL_0
NvOS log verbosity level 0 (lowest)
Definition: nvos_s1_tegra.h:580
nvos_s3_tegra_safety.h
NvOsCallstackDump
void NvOsCallstackDump(NvCallstack *stack, NvU32 skip, NvOsDumpCallback callBack, void *context)
NvOsFtruncate
NvError NvOsFtruncate(NvOsFileHandle stream, NvU64 length)
NvOsPhysAddr
NvU32 NvOsPhysAddr
Definition: nvos_common_tegra_safety.h:43
NVOS_VERB_LVL_3
@ NVOS_VERB_LVL_3
NvOS log verbosity level 3.
Definition: nvos_s1_tegra.h:586
NvOsInterruptPriorityThreadCreate
NvError NvOsInterruptPriorityThreadCreate(NvOsThreadFunction function, void *args, NvOsThreadHandle *thread)
Creates a near interrupt priority thread.
void
typedef void(WFD_APIENTRY PFNWFDBINDSOURCETOPIPELINEWITHTIMESTAMPNV)(const WFDDevice device
NvOsCallstackGetHeight
NvU32 NvOsCallstackGetHeight(NvCallstack *stack)
NvOsDataCacheWritebackRange
void NvOsDataCacheWritebackRange(void *start, NvU32 length)
Writes back a range of the data cache.
NvCallstack
struct NvCallstackRec NvCallstack
Definition: nvos_s1_tegra.h:659
NvOsThreadHandle
struct NvOsThreadRec * NvOsThreadHandle
Definition: nvos_s3_tegra_safety.h:1716
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.
NvOsCallstackDestroy
void NvOsCallstackDestroy(NvCallstack *callstack)
NvOsMemAttribute
NvOsMemAttribute
Defines memory attributes.
Definition: nvos_common_tegra_safety.h:280
NvOsDebugCallstack
static NV_INLINE void NvOsDebugCallstack(NvU32 skip)
Definition: nvos_s1_tegra.h:689
NvOsCallstackType_SymbolStack
@ NvOsCallstackType_SymbolStack
Definition: nvos_s1_tegra.h:665
NvOsFsync
NvError NvOsFsync(NvOsFileHandle stream)
NvOsReaddir
NvError NvOsReaddir(NvOsDirHandle dir, char *name, size_t size)
This function gets an entry name in directory.
handle
const WFDCommitType const WFDHandle handle
Definition: wfdext.h:532
NvOsPhysicalMemMap
NvError NvOsPhysicalMemMap(NvOsPhysAddr phys, size_t size, NvOsMemAttribute attrib, NvU32 flags, void **ptr)
Maps computer resources into user space.
NvOsModifyFpsTarget
int NvOsModifyFpsTarget(int fd, int target)
To be deprecated.
NvOsFclose
void NvOsFclose(NvOsFileHandle hFile)
This function closes a file stream.
NvOsDirHandle
void * NvOsDirHandle
Definition: nvos_common_tegra_safety.h:75
NvOsPhysicalMemUnmap
void NvOsPhysicalMemUnmap(void *ptr, size_t size)
Releases resources previously allocated by NvOsPhysicalMemMap().
NvOsDebugPrintf
void NvOsDebugPrintf(const char *format,...)
This function print log.
NvOsCallstackGetFrame
void NvOsCallstackGetFrame(char *buf, NvU32 len, NvCallstack *stack, NvU32 level)
NvOsStrlen
size_t NvOsStrlen(const char *s)
This function counts string length.
NvOsDebugVprintf
void NvOsDebugVprintf(const char *format, va_list ap)
This function print log as per format parameter and variable-argument list.
NvOsVsnprintf
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 o...
NvOsCallstackHash
NvU32 NvOsCallstackHash(NvCallstack *stack)
NvOsDebugString
void NvOsDebugString(const char *str)
This function prints debug logs via the system log facility.
NvOsSetFpsTarget
int NvOsSetFpsTarget(int target)
To be deprecated.
NVOS_VERB_LVL_2
@ NVOS_VERB_LVL_2
NvOS log verbosity level 2.
Definition: nvos_s1_tegra.h:584
NvOsIntrMutexCreate
NvError NvOsIntrMutexCreate(NvOsIntrMutexHandle *mutex)
Creates a mutex that is safe to aquire in an ISR.
NvOsInterruptHandler
void(* NvOsInterruptHandler)(void *args)
Interrupt handler function.
Definition: nvos_s1_tegra.h:818
NvOsMemcmp
int NvOsMemcmp(const void *s1, const void *s2, size_t size)
Compares two memory regions.
NvOsCallstackType_Last
@ NvOsCallstackType_Last
Definition: nvos_s1_tegra.h:667