1 #define NVOC_CRASHCAT_QUEUE_H_PRIVATE_ACCESS_ALLOWED
2 #include "nvoc/runtime.h"
3 #include "nvoc/rtti.h"
4 #include "nvtypes.h"
5 #include "nvport/nvport.h"
6 #include "nvport/inline/util_valist.h"
7 #include "utils/nvassert.h"
8 #include "g_crashcat_queue_nvoc.h"
9 
10 #ifdef DEBUG
11 char __nvoc_class_id_uniqueness_check_0xbaa900 = 1;
12 #endif
13 
14 extern const struct NVOC_CLASS_DEF __nvoc_class_def_CrashCatQueue;
15 
16 extern const struct NVOC_CLASS_DEF __nvoc_class_def_Object;
17 
18 void __nvoc_init_CrashCatQueue(CrashCatQueue*, CrashCatWayfinder* );
19 void __nvoc_init_funcTable_CrashCatQueue(CrashCatQueue*, CrashCatWayfinder* );
20 NV_STATUS __nvoc_ctor_CrashCatQueue(CrashCatQueue*, CrashCatWayfinder* , CrashCatQueueConfig * arg_pQueueConfig);
21 void __nvoc_init_dataField_CrashCatQueue(CrashCatQueue*, CrashCatWayfinder* );
22 void __nvoc_dtor_CrashCatQueue(CrashCatQueue*);
23 extern const struct NVOC_EXPORT_INFO __nvoc_export_info_CrashCatQueue;
24 
25 static const struct NVOC_RTTI __nvoc_rtti_CrashCatQueue_CrashCatQueue = {
26     /*pClassDef=*/          &__nvoc_class_def_CrashCatQueue,
27     /*dtor=*/               (NVOC_DYNAMIC_DTOR) &__nvoc_dtor_CrashCatQueue,
28     /*offset=*/             0,
29 };
30 
31 static const struct NVOC_RTTI __nvoc_rtti_CrashCatQueue_Object = {
32     /*pClassDef=*/          &__nvoc_class_def_Object,
33     /*dtor=*/               &__nvoc_destructFromBase,
34     /*offset=*/             NV_OFFSETOF(CrashCatQueue, __nvoc_base_Object),
35 };
36 
37 static const struct NVOC_CASTINFO __nvoc_castinfo_CrashCatQueue = {
38     /*numRelatives=*/       2,
39     /*relatives=*/ {
40         &__nvoc_rtti_CrashCatQueue_CrashCatQueue,
41         &__nvoc_rtti_CrashCatQueue_Object,
42     },
43 };
44 
45 const struct NVOC_CLASS_DEF __nvoc_class_def_CrashCatQueue =
46 {
47     /*classInfo=*/ {
48         /*size=*/               sizeof(CrashCatQueue),
49         /*classId=*/            classId(CrashCatQueue),
50         /*providerId=*/         &__nvoc_rtti_provider,
51 #if NV_PRINTF_STRINGS_ALLOWED
52         /*name=*/               "CrashCatQueue",
53 #endif
54     },
55     /*objCreatefn=*/        (NVOC_DYNAMIC_OBJ_CREATE) &__nvoc_objCreateDynamic_CrashCatQueue,
56     /*pCastInfo=*/          &__nvoc_castinfo_CrashCatQueue,
57     /*pExportInfo=*/        &__nvoc_export_info_CrashCatQueue
58 };
59 
60 const struct NVOC_EXPORT_INFO __nvoc_export_info_CrashCatQueue =
61 {
62     /*numEntries=*/     0,
63     /*pExportEntries=*/  0
64 };
65 
66 void __nvoc_dtor_Object(Object*);
67 void __nvoc_dtor_CrashCatQueue(CrashCatQueue *pThis) {
68     __nvoc_crashcatQueueDestruct(pThis);
69     __nvoc_dtor_Object(&pThis->__nvoc_base_Object);
70     PORT_UNREFERENCED_VARIABLE(pThis);
71 }
72 
73 void __nvoc_init_dataField_CrashCatQueue(CrashCatQueue *pThis, CrashCatWayfinder *pCrashcatWayfinder) {
74     CrashCatWayfinderHal *wayfinderHal = &pCrashcatWayfinder->wayfinderHal;
75     const unsigned long wayfinderHal_HalVarIdx = (unsigned long)wayfinderHal->__nvoc_HalVarIdx;
76     PORT_UNREFERENCED_VARIABLE(pThis);
77     PORT_UNREFERENCED_VARIABLE(pCrashcatWayfinder);
78     PORT_UNREFERENCED_VARIABLE(wayfinderHal);
79     PORT_UNREFERENCED_VARIABLE(wayfinderHal_HalVarIdx);
80 }
81 
82 NV_STATUS __nvoc_ctor_Object(Object* );
83 NV_STATUS __nvoc_ctor_CrashCatQueue(CrashCatQueue *pThis, CrashCatWayfinder *pCrashcatWayfinder, CrashCatQueueConfig * arg_pQueueConfig) {
84     NV_STATUS status = NV_OK;
85     status = __nvoc_ctor_Object(&pThis->__nvoc_base_Object);
86     if (status != NV_OK) goto __nvoc_ctor_CrashCatQueue_fail_Object;
87     __nvoc_init_dataField_CrashCatQueue(pThis, pCrashcatWayfinder);
88 
89     status = __nvoc_crashcatQueueConstruct(pThis, arg_pQueueConfig);
90     if (status != NV_OK) goto __nvoc_ctor_CrashCatQueue_fail__init;
91     goto __nvoc_ctor_CrashCatQueue_exit; // Success
92 
93 __nvoc_ctor_CrashCatQueue_fail__init:
94     __nvoc_dtor_Object(&pThis->__nvoc_base_Object);
95 __nvoc_ctor_CrashCatQueue_fail_Object:
96 __nvoc_ctor_CrashCatQueue_exit:
97 
98     return status;
99 }
100 
101 static void __nvoc_init_funcTable_CrashCatQueue_1(CrashCatQueue *pThis, CrashCatWayfinder *pCrashcatWayfinder) {
102     CrashCatWayfinderHal *wayfinderHal = &pCrashcatWayfinder->wayfinderHal;
103     const unsigned long wayfinderHal_HalVarIdx = (unsigned long)wayfinderHal->__nvoc_HalVarIdx;
104     PORT_UNREFERENCED_VARIABLE(pThis);
105     PORT_UNREFERENCED_VARIABLE(pCrashcatWayfinder);
106     PORT_UNREFERENCED_VARIABLE(wayfinderHal);
107     PORT_UNREFERENCED_VARIABLE(wayfinderHal_HalVarIdx);
108 }
109 
110 void __nvoc_init_funcTable_CrashCatQueue(CrashCatQueue *pThis, CrashCatWayfinder *pCrashcatWayfinder) {
111     __nvoc_init_funcTable_CrashCatQueue_1(pThis, pCrashcatWayfinder);
112 }
113 
114 void __nvoc_init_Object(Object*);
115 void __nvoc_init_CrashCatQueue(CrashCatQueue *pThis, CrashCatWayfinder *pCrashcatWayfinder) {
116     pThis->__nvoc_pbase_CrashCatQueue = pThis;
117     pThis->__nvoc_pbase_Object = &pThis->__nvoc_base_Object;
118     __nvoc_init_Object(&pThis->__nvoc_base_Object);
119     __nvoc_init_funcTable_CrashCatQueue(pThis, pCrashcatWayfinder);
120 }
121 
122 NV_STATUS __nvoc_objCreate_CrashCatQueue(CrashCatQueue **ppThis, Dynamic *pParent, NvU32 createFlags, CrashCatQueueConfig * arg_pQueueConfig) {
123     NV_STATUS status;
124     Object *pParentObj;
125     CrashCatQueue *pThis;
126     CrashCatWayfinder *pCrashcatWayfinder;
127 
128     status = __nvoc_handleObjCreateMemAlloc(createFlags, sizeof(CrashCatQueue), (void**)&pThis, (void**)ppThis);
129     if (status != NV_OK)
130         return status;
131 
132     portMemSet(pThis, 0, sizeof(CrashCatQueue));
133 
134     __nvoc_initRtti(staticCast(pThis, Dynamic), &__nvoc_class_def_CrashCatQueue);
135 
136     pThis->__nvoc_base_Object.createFlags = createFlags;
137 
138     if (pParent != NULL && !(createFlags & NVOC_OBJ_CREATE_FLAGS_PARENT_HALSPEC_ONLY))
139     {
140         pParentObj = dynamicCast(pParent, Object);
141         objAddChild(pParentObj, &pThis->__nvoc_base_Object);
142     }
143     else
144     {
145         pThis->__nvoc_base_Object.pParent = NULL;
146     }
147 
148     if ((pCrashcatWayfinder = dynamicCast(pParent, CrashCatWayfinder)) == NULL)
149         pCrashcatWayfinder = objFindAncestorOfType(CrashCatWayfinder, pParent);
150     NV_ASSERT_OR_RETURN(pCrashcatWayfinder != NULL, NV_ERR_INVALID_ARGUMENT);
151 
152     __nvoc_init_CrashCatQueue(pThis, pCrashcatWayfinder);
153     status = __nvoc_ctor_CrashCatQueue(pThis, pCrashcatWayfinder, arg_pQueueConfig);
154     if (status != NV_OK) goto __nvoc_objCreate_CrashCatQueue_cleanup;
155 
156     *ppThis = pThis;
157 
158     return NV_OK;
159 
160 __nvoc_objCreate_CrashCatQueue_cleanup:
161     // do not call destructors here since the constructor already called them
162     if (createFlags & NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT)
163         portMemSet(pThis, 0, sizeof(CrashCatQueue));
164     else
165         portMemFree(pThis);
166 
167     // coverity[leaked_storage:FALSE]
168     return status;
169 }
170 
171 NV_STATUS __nvoc_objCreateDynamic_CrashCatQueue(CrashCatQueue **ppThis, Dynamic *pParent, NvU32 createFlags, va_list args) {
172     NV_STATUS status;
173     CrashCatQueueConfig * arg_pQueueConfig = va_arg(args, CrashCatQueueConfig *);
174 
175     status = __nvoc_objCreate_CrashCatQueue(ppThis, pParent, createFlags, arg_pQueueConfig);
176 
177     return status;
178 }
179 
180