Go to the source code of this file.
Data Structures | |
| struct | NvOsFileRec |
| struct | NvOsStatTypeRec |
Macros | |
| #define | NVOS_OPEN_READ (0x1U) |
| #define | NVOS_OPEN_WRITE (0x2U) |
| #define | NVOS_OPEN_CREATE (0x4U) |
| #define | NVOS_OPEN_APPEND (0x8U) |
| #define | NVOS_MAGIC_NUM_COMMON (0xF0250000U) |
| #define | NVOS_MAGIC_NUM_COND_HANDLE (NVOS_MAGIC_NUM_COMMON | 0x0000A001U) |
| #define | NVOS_MAGIC_NUM_FILE_HANDLE (NVOS_MAGIC_NUM_COMMON | 0x0000B001U) |
| #define | NVOS_MAGIC_NUM_LIB_HANDLE (NVOS_MAGIC_NUM_COMMON | 0x0000C001U) |
| #define | NVOS_MAGIC_NUM_MUTEX_HANDLE (NVOS_MAGIC_NUM_COMMON | 0x0000D001U) |
| #define | NVOS_MAGIC_NUM_SEMA_HANDLE (NVOS_MAGIC_NUM_COMMON | 0x0000E001U) |
| #define | NVOS_MAGIC_NUM_THREAD_HANDLE (NVOS_MAGIC_NUM_COMMON | 0x0000F001U) |
| #define | NVOS_MAGIC_NUM_INVALID (0xFFFFFFFFU) |
| #define | NVOS_MEM_NONE 0x0U |
| Specifies no memory flags. More... | |
| #define | NVOS_MEM_READ 0x1U |
| Specifies the memory may be read. More... | |
| #define | NVOS_MEM_WRITE 0x2U |
| Specifies the memory may be written to. More... | |
| #define | NVOS_MEM_EXECUTE 0x4U |
| Specifies the memory may be executed. More... | |
| #define | NVOS_MEM_READ_WRITE (NVOS_MEM_READ | NVOS_MEM_WRITE) |
| The memory may be both read and writen. More... | |
| #define | NVOS_MEM_MMAP_FIXED 0x40U |
| Specifies the memory must be mapped as fixed for mmap. More... | |
| #define | NVOS_MEM_MMAP_LAZY 0x80U |
| Support MAP_LAZY for mmap in QNX. More... | |
| #define | NVOS_MEM_MMAP_POPULATE 0x100U |
| Support MAP_POPULATE for mmap. More... | |
| #define | NV_ENABLE_DEBUG_PRINTS 0 |
| #define | NV_DEBUG_PRINTF(x) do {} while (NV_FALSE) |
| #define | NVOS_PATH_MAX 256 |
| The maximum length for a file system path. More... | |
| #define | NV_SHOW_ERRORS NV_DEBUG |
| Config flag to enable internal debug prints, enabled in debug builds. More... | |
| #define | NV_SHOW_ERROR(err) (err) |
| Do nothing if NV_DEBUG=0. More... | |
Typedefs | |
| typedef NvU32 | NvOsTlsKeyHandle |
| typedef NvU32 | NvOsPhysAddr |
| typedef void * | NvOsDirHandle |
| typedef struct NvOsFileRec | NvOsFile |
| typedef struct NvOsFileRec * | NvOsFileHandle |
| typedef struct NvOsStatTypeRec | NvOsStatType |
| typedef struct NvOsSharedMemRec * | NvOsSharedMemHandle |
| typedef struct NvOsPageAllocRec * | NvOsPageAllocHandle |
| typedef struct NvOsInterruptRec * | NvOsInterruptHandle |
Functions | |
| static NvBool | NvOsLinuxErrnoToNvError (NvError *e) |
| NvError | NvOsSharedMemAlloc (const char *key, size_t size, NvOsSharedMemHandle *descriptor) |
| NvError | NvOsSharedMemHandleFromFd (int fd, NvOsSharedMemHandle *descriptor) |
| void | NvOsSharedMemFree (NvOsSharedMemHandle descriptor) |
| NvError | NvOsSharedMemGetFd (NvOsSharedMemHandle descriptor, int *fd) |
| NvError | NvOsSharedMemMap (NvOsSharedMemHandle descriptor, size_t offset, size_t size, void **ptr) |
| void | NvOsSharedMemUnmap (void *ptr, size_t size) |
| int32_t | NvOsSnprintfS32 (char *dst, size_t max_count, NvS32 val) |
| This function generates a formatted string with a signed integer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More... | |
| int32_t | NvOsSnprintfU32 (char *dst, size_t max_count, NvU32 val) |
| This function generates a formatted string with a unsigned integer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More... | |
| int32_t | NvOsSnprintfU64 (char *dst, size_t max_count, NvU64 val) |
| This function generates a formatted string with an unsigned 64-bit integer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More... | |
| int32_t | NvOsSnprintfStr (char *dst, size_t max_count, const char *src) |
| This function generates a formatted string with a string and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More... | |
| int32_t | NvOsSnprintfStrS32 (char *dst, size_t max_count, const char *src, NvS32 val) |
| This function generates a formatted string with a string and a signed integer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More... | |
| int32_t | NvOsSnprintfStrU32 (char *dst, size_t max_count, const char *src, NvU32 val) |
| This function generates a formatted string with a string and unsigned integer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More... | |
| int32_t | NvOsSnprintfStrU64 (char *dst, size_t max_count, const char *src, NvU64 val) |
| This function generates a formatted string with a string and unsigned 64-bit integer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More... | |
| int32_t | NvOsSnprintfStrFloat (char *dst, size_t max_count, const char *src, NvF32 val) |
| This function generates a formatted string with a string and a float and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More... | |
| int32_t | NvOsSnprintfStrPtr (char *dst, size_t max_count, const char *src, const void *ptr) |
| This function generates a formatted string with a string and a pointer and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More... | |
| int32_t | NvOsSnprintfStrHexU32 (char *dst, size_t max_count, const char *src, NvU32 val) |
| This function generates a formatted string with a string and an unsigned integer(in hex format) and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More... | |
| int32_t | NvOsSnprintfStrHexRawBytes (char *dst, size_t max_count, const char *src, NvU32 val) |
| This function generates a formatted string with a string and an unsigned integer(in hex format) and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More... | |
| int32_t | NvOsSnprintfStrHexU64 (char *dst, size_t max_count, const char *src, NvU64 val) |
| This function generates a formatted string with a string and an unsigned 64bit integer(in hex format) and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More... | |
| int32_t | NvOsSnprintfStrWith2S32 (char *dst, size_t max_count, const char *src, NvS32 val0, NvS32 val1) |
| This function generates a formatted string with a string and two signed integers and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More... | |
| int32_t | NvOsSnprintfStrWith2U32 (char *dst, size_t max_count, const char *src, NvU32 val0, NvU32 val1) |
| This function generates a formatted string with a string and two unsigned integers and copy it into the output array, dst, up to a given maximum number of characters specified by max_count. If max_count is not 0, this function copies the formatted string generated at most (max_count - 1) characters (the remaining characters are discarded) into the output array and then appends a terminating null character. If count is zero, nothing is written. More... | |
| long int | NvUStrtol (const char *s, char **endptr, int base) |
| This function converts a string to integer. More... | |
| uint32_t | NvUStrtoui (const char *s, char **endptr, int32_t base) |
| This function convert to unsigned int from string pointer. More... | |
| unsigned long int | NvUStrtoul (const char *s, char **endptr, int base) |
| This function convert to unsigned long int from string pointer. More... | |
| unsigned long long int | NvUStrtoull (const char *s, char **endptr, int base) |
| This function convert to unsigned long long int from string pointer. More... | |
| size_t | NvOsStrnlen (const char *s, size_t size) |
| This function counts the length of given string, and its length is counted up to given size parameter. More... | |
| void | NvOsStrncpy (char *dest, const char *src, size_t size) |
| This function copy to dest string parameter from src string parameter, And the maximum copying length is limited by size parameter. More... | |
| NvError | NvOsShowError (NvError err, const char *file, int line) |
| This function prints an error and the line it appeared on. Does nothing if err is NvSuccess. More... | |
| void | NvOsMemcpy (void *dest, const void *src, size_t size) |
| This function copy to destination pointer from source pointer, and copying length is given as size parameter. More... | |
| void | NvOsThreadYield (void) |
| This function yields the caller thread and let other thread run. More... | |
| NvU64 | NvOsGetCurrentThreadId (void) |
| This function returns the thread id. More... | |
| void * | NvUAlloc0 (size_t size) |
| This function dynamically allocates zeroed memory. More... | |
| NvError | NvOsOpendir (const char *path, NvOsDirHandle *dir) |
| This function opens a directory. More... | |
| void | NvOsClosedir (NvOsDirHandle dir) |
| This function closes a directory. More... | |
| NvError | NvOsTlsAddTerminator (void(*func)(void *args), void *context) |
| This function registers a function which will be called when thread terminates successfully. More... | |
| NvOsTlsKeyHandle | NvOsTlsAlloc (void) |
| This function creates a thread specific data. More... | |
| NvOsTlsKeyHandle | NvOsTlsAllocWithDestructor (void(*destructor)(void *args)) |
| This function creates a thread specific data, and store function pointer into it, and the function pointer is called when thread is terminated successfully. More... | |
| void | NvOsTlsFree (NvOsTlsKeyHandle TlsIndex) |
| This function free the thread specific data, which is pointed by TlsIndex parameter. More... | |
| void * | NvOsTlsGet (NvOsTlsKeyHandle TlsIndex) |
| This function gets the thread specific data, which is pointed by TlsIndex parameter. More... | |
| NvBool | NvOsTlsRemoveTerminator (void(*func)(void *args), void *context) |
| This function unregisters a function from the list of functions will be called when thread terminates successfully. More... | |
| void | NvOsTlsSet (NvOsTlsKeyHandle TlsIndex, void *value) |
| This function set a thread specific data, which is pointed by TlsIndex parameter. More... | |
| NvError | NvOsFgetc (NvOsFileHandle hFile, NvU8 *c) |
| This function read a character from the current position of a file stream,and the read character is stored into c parameter. More... | |
| NvError | NvOsFopen (const char *path, NvU32 flags, NvOsFileHandle *file) |
| This function opens a file stream from path parameter. More... | |
| NvError | NvOsFcloseEx (NvOsFileHandle hFile) |
| This function closes a file stream. More... | |
| NvError | NvOsFread (NvOsFileHandle hFile, void *ptr, size_t size, size_t *bytes) |
| This function read from a file stream and store to ptr parameter. More... | |
| NvError | NvOsFseek (NvOsFileHandle hFile, NvS64 offset, NvOsSeekEnum whence) |
| This function changes the current position of file stream as it is specified by offset and whence parameter. More... | |
| NvError | NvOsFstat (NvOsFileHandle hFile, NvOsStatType *filestat) |
| This function gets a type of file stream, as file, directory, fifo, character device and unknown. More... | |
| NvError | NvOsFtell (NvOsFileHandle hFile, NvU64 *position) |
| This function gets the current position of file stream, and it is stored to position parameter as bytes. More... | |
| NvError | NvOsFwrite (NvOsFileHandle hFile, const void *ptr, size_t size) |
| This function writes the buffer to a file stream, and the length or writing is up to size parameter. More... | |
| NvError | NvOsFflush (NvOsFileHandle hFile) |
| This function flush a file stream, if there is any buffered/unwritten memory regarding the file stream. More... | |
| NvError | NvOsStat (const char *filename, NvOsStatType *filestat) |
| This function gets a type of path. More... | |
| NvError | NvOsStrncpySafe (char *dest, size_t destsz, const char *src, size_t count) |
| This function copies the source string to the destination string up to the maximum length specified by count, ensuring the resulting string is NULL-terminated. It also checks for overlapping between the two buffers, source and destination. More... | |
| NvError | NvOsStrncatSafe (char *dest, size_t destsz, const char *src, size_t count) |
| This function appends the source string to the destination string up to the maximum length specified by count, ensuring the resulting string is NULL-terminated. It also checks for overlapping between the two buffers, source and destination. More... | |
| NvError | NvOsStrErrorSafe (int errnum, char *buf, size_t buflen) |
| The function converts an error number to an error string and stores the string inside the buffer specified buf, using strerror_r(). More... | |
| #define NV_DEBUG_PRINTF | ( | x | ) | do {} while (NV_FALSE) |
Definition at line 365 of file nvos_common_tegra_safety.h.
| #define NV_ENABLE_DEBUG_PRINTS 0 |
Definition at line 360 of file nvos_common_tegra_safety.h.
| #define NV_SHOW_ERROR | ( | err | ) | (err) |
Do nothing if NV_DEBUG=0.
Definition at line 1344 of file nvos_common_tegra_safety.h.
| #define NV_SHOW_ERRORS NV_DEBUG |
Config flag to enable internal debug prints, enabled in debug builds.
Definition at line 1336 of file nvos_common_tegra_safety.h.
| #define NVOS_MAGIC_NUM_COMMON (0xF0250000U) |
Definition at line 94 of file nvos_common_tegra_safety.h.
| #define NVOS_MAGIC_NUM_COND_HANDLE (NVOS_MAGIC_NUM_COMMON | 0x0000A001U) |
Definition at line 95 of file nvos_common_tegra_safety.h.
| #define NVOS_MAGIC_NUM_FILE_HANDLE (NVOS_MAGIC_NUM_COMMON | 0x0000B001U) |
Definition at line 96 of file nvos_common_tegra_safety.h.
| #define NVOS_MAGIC_NUM_INVALID (0xFFFFFFFFU) |
Definition at line 101 of file nvos_common_tegra_safety.h.
| #define NVOS_MAGIC_NUM_LIB_HANDLE (NVOS_MAGIC_NUM_COMMON | 0x0000C001U) |
Definition at line 97 of file nvos_common_tegra_safety.h.
| #define NVOS_MAGIC_NUM_MUTEX_HANDLE (NVOS_MAGIC_NUM_COMMON | 0x0000D001U) |
Definition at line 98 of file nvos_common_tegra_safety.h.
| #define NVOS_MAGIC_NUM_SEMA_HANDLE (NVOS_MAGIC_NUM_COMMON | 0x0000E001U) |
Definition at line 99 of file nvos_common_tegra_safety.h.
| #define NVOS_MAGIC_NUM_THREAD_HANDLE (NVOS_MAGIC_NUM_COMMON | 0x0000F001U) |
Definition at line 100 of file nvos_common_tegra_safety.h.
| #define NVOS_MEM_EXECUTE 0x4U |
Specifies the memory may be executed.
Definition at line 326 of file nvos_common_tegra_safety.h.
| #define NVOS_MEM_MMAP_FIXED 0x40U |
Specifies the memory must be mapped as fixed for mmap.
Definition at line 332 of file nvos_common_tegra_safety.h.
| #define NVOS_MEM_MMAP_LAZY 0x80U |
Support MAP_LAZY for mmap in QNX.
Definition at line 335 of file nvos_common_tegra_safety.h.
| #define NVOS_MEM_MMAP_POPULATE 0x100U |
Support MAP_POPULATE for mmap.
Definition at line 338 of file nvos_common_tegra_safety.h.
| #define NVOS_MEM_NONE 0x0U |
Specifies no memory flags.
Definition at line 317 of file nvos_common_tegra_safety.h.
| #define NVOS_MEM_READ 0x1U |
Specifies the memory may be read.
Definition at line 320 of file nvos_common_tegra_safety.h.
| #define NVOS_MEM_READ_WRITE (NVOS_MEM_READ | NVOS_MEM_WRITE) |
The memory may be both read and writen.
Definition at line 329 of file nvos_common_tegra_safety.h.
| #define NVOS_MEM_WRITE 0x2U |
Specifies the memory may be written to.
Definition at line 323 of file nvos_common_tegra_safety.h.
| #define NVOS_PATH_MAX 256 |
The maximum length for a file system path.
Definition at line 370 of file nvos_common_tegra_safety.h.
| typedef struct NvOsFileRec NvOsFile |
| typedef struct NvOsInterruptRec* NvOsInterruptHandle |
Definition at line 426 of file nvos_common_tegra_safety.h.
| typedef struct NvOsPageAllocRec* NvOsPageAllocHandle |
Definition at line 421 of file nvos_common_tegra_safety.h.
| typedef NvU32 NvOsPhysAddr |
Definition at line 43 of file nvos_common_tegra_safety.h.
| typedef struct NvOsSharedMemRec* NvOsSharedMemHandle |
Definition at line 390 of file nvos_common_tegra_safety.h.
| typedef NvU32 NvOsTlsKeyHandle |
Definition at line 41 of file nvos_common_tegra_safety.h.
| enum NvOsCodePage |
Defines straight-forward mappings to international language encodings.
Commonly-used encodings on supported operating systems are provided.
| Enumerator | |
|---|---|
| NvOsCodePage_Unknown | |
| NvOsCodePage_Utf8 | |
| NvOsCodePage_Utf16 | |
| NvOsCodePage_Windows1252 | |
| NvOsCodePage_Force32 | |
Definition at line 350 of file nvos_common_tegra_safety.h.
| enum NvOsMemAttribute |
Defines memory attributes.
Definition at line 280 of file nvos_common_tegra_safety.h.
| enum NvOsPageFlags |
| Enumerator | |
|---|---|
| NvOsPageFlags_Contiguous | |
| NvOsPageFlags_NonContiguous | |
| NvOsMemFlags_Forceword | |
Definition at line 413 of file nvos_common_tegra_safety.h.
Definition at line 372 of file nvos_common_tegra_safety.h.
|
inlinestatic |
Definition at line 228 of file nvos_common_tegra_safety.h.
| NvError NvOsSharedMemAlloc | ( | const char * | key, |
| size_t | size, | ||
| NvOsSharedMemHandle * | descriptor | ||
| ) |
| void NvOsSharedMemFree | ( | NvOsSharedMemHandle | descriptor | ) |
| NvError NvOsSharedMemGetFd | ( | NvOsSharedMemHandle | descriptor, |
| int * | fd | ||
| ) |
| NvError NvOsSharedMemHandleFromFd | ( | int | fd, |
| NvOsSharedMemHandle * | descriptor | ||
| ) |
| NvError NvOsSharedMemMap | ( | NvOsSharedMemHandle | descriptor, |
| size_t | offset, | ||
| size_t | size, | ||
| void ** | ptr | ||
| ) |