NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release
stm_error.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
26 #ifndef STM_ERROR_H_
27 #define STM_ERROR_H_
28 
29 #if __GNUC__ >= 4
30 #define STM_API __attribute__((visibility("default")))
31 #endif
32 
33 #include <stdint.h>
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
54 typedef enum stmErrorCode_t {
95  /* Error in establishing TCP scoket connection */
97  /* Error in Unknown clock source setup */
99  /* Error in reading timestamp */
101  /* Error unknown scheduling state */
103  /* Error state transition not possible between current and next state */
105  /* Error schedule id invalid */
109 
116 static inline const char* stmErrorCodeToString(stmErrorCode_t err)
117 {
118  static const char* stmErrorCodeNames[] = {
119  "STM_SUCCESS",
120  "STM_ERROR_EXPECTED",
121  "STM_ERROR_NOT_INITIALIZED",
122  "STM_ERROR_BAD_PARAMETER",
123  "STM_ERROR_NOT_SUPPORTED",
124  "STM_ERROR_TIMEOUT",
125  "STM_ERROR_NOT_FOUND",
126  "STM_ERROR_INVALID_STATE",
127  "STM_ERROR_GENERIC",
128  "STM_ERROR_BAD_VALUE",
129  "STM_ERROR_NVSCISYNC",
130  "STM_ERROR_SYNC",
131  "STM_ERROR_NVSCISYNC_TIMEOUT",
132  "STM_ERROR_CUDA",
133  "STM_ERROR_VULKAN",
134  "STM_ERROR_INSUFFICIENT_MEMORY",
135  "STM_ERROR_CUDLA",
136  "STM_ERROR_PVA",
137  "STM_ERROR_NVMEDIA_LDC",
138  "STM_ERROR_NVMEDIA_2D",
139  "STM_ERROR_CONNECTION",
140  "STM_ERROR_UNKNOWN_CLOCK",
141  "STM_ERROR_FAILED_READING_TIMESTAMPS",
142  "STM_ERROR_UNKNOWN_STATE",
143  "STM_ERROR_BAD_STATE_TRANSITION",
144  "STM_ERROR_SCHEDULE_ID_INVALID",
145  };
146 
147  return stmErrorCodeNames[(uint32_t)err];
148 }
149 
154 #ifdef __cplusplus
155 }
156 #endif
157 
158 #endif //STM_ERROR_H_
STM_ERROR_BAD_STATE_TRANSITION
@ STM_ERROR_BAD_STATE_TRANSITION
Definition: stm_error.h:104
STM_ERROR_CUDLA
@ STM_ERROR_CUDLA
CUDLA operation in STM returned an error.
Definition: stm_error.h:88
STM_ERROR_BAD_VALUE
@ STM_ERROR_BAD_VALUE
Invalid value in STM.
Definition: stm_error.h:74
STM_ERROR_INSUFFICIENT_MEMORY
@ STM_ERROR_INSUFFICIENT_MEMORY
[ENOMEM] Not enough memory
Definition: stm_error.h:86
STM_ERROR_EXPECTED
@ STM_ERROR_EXPECTED
Failure in one of the allowed/expected ways.
Definition: stm_error.h:58
STM_ERROR_FAILED_READING_TIMESTAMPS
@ STM_ERROR_FAILED_READING_TIMESTAMPS
Definition: stm_error.h:100
STM_ERROR_NOT_SUPPORTED
@ STM_ERROR_NOT_SUPPORTED
Operation not supported.
Definition: stm_error.h:64
STM_ERROR_NVSCISYNC
@ STM_ERROR_NVSCISYNC
NvSciSync operation in STM returned an error.
Definition: stm_error.h:76
STM_NUM_ERROR_CODES
@ STM_NUM_ERROR_CODES
Definition: stm_error.h:107
STM_ERROR_SCHEDULE_ID_INVALID
@ STM_ERROR_SCHEDULE_ID_INVALID
Definition: stm_error.h:106
STM_ERROR_NVMEDIA_LDC
@ STM_ERROR_NVMEDIA_LDC
NVMEDIA_LDC operation in STM returned an error.
Definition: stm_error.h:92
STM_ERROR_NVSCISYNC_TIMEOUT
@ STM_ERROR_NVSCISYNC_TIMEOUT
NvSciSync operation in STM timed out.
Definition: stm_error.h:80
STM_ERROR_VULKAN
@ STM_ERROR_VULKAN
Vulkan operation in STM returned an error.
Definition: stm_error.h:84
STM_ERROR_NOT_INITIALIZED
@ STM_ERROR_NOT_INITIALIZED
STM client context not initialized through previous call to stmClientInit()
Definition: stm_error.h:60
STM_ERROR_UNKNOWN_STATE
@ STM_ERROR_UNKNOWN_STATE
Definition: stm_error.h:102
STM_ERROR_NOT_FOUND
@ STM_ERROR_NOT_FOUND
Lookup failed in STM.
Definition: stm_error.h:68
STM_ERROR_NVMEDIA_2D
@ STM_ERROR_NVMEDIA_2D
NVMEDIA_2D operation in STM returned an error.
Definition: stm_error.h:94
STM_SUCCESS
@ STM_SUCCESS
[EOK] No error
Definition: stm_error.h:56
STM_ERROR_CUDA
@ STM_ERROR_CUDA
CUDA operation in STM returned an error.
Definition: stm_error.h:82
STM_ERROR_SYNC
@ STM_ERROR_SYNC
Synchronization operation in STM returned an error.
Definition: stm_error.h:78
STM_ERROR_GENERIC
@ STM_ERROR_GENERIC
Generic error; no other information.
Definition: stm_error.h:72
STM_ERROR_PVA
@ STM_ERROR_PVA
CUPVA operation in STM returned an error.
Definition: stm_error.h:90
STM_ERROR_TIMEOUT
@ STM_ERROR_TIMEOUT
Operation timeout.
Definition: stm_error.h:66
STM_ERROR_UNKNOWN_CLOCK
@ STM_ERROR_UNKNOWN_CLOCK
Definition: stm_error.h:98
STM_ERROR_BAD_PARAMETER
@ STM_ERROR_BAD_PARAMETER
Invalid parameter value.
Definition: stm_error.h:62
stmErrorCode_t
stmErrorCode_t
Return/error codes for all STM functions.
Definition: stm_error.h:54
STM_ERROR_INVALID_STATE
@ STM_ERROR_INVALID_STATE
STM in invalid state.
Definition: stm_error.h:70
STM_ERROR_CONNECTION
@ STM_ERROR_CONNECTION
Definition: stm_error.h:96
stmErrorCodeToString
static const char * stmErrorCodeToString(stmErrorCode_t err)
Convert STM error code to string representation.
Definition: stm_error.h:116