1 #define NVOC_GPU_ACCESS_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_gpu_access_nvoc.h"
9 
10 #ifdef DEBUG
11 char __nvoc_class_id_uniqueness_check_0x40549c = 1;
12 #endif
13 
14 extern const struct NVOC_CLASS_DEF __nvoc_class_def_IoAperture;
15 
16 extern const struct NVOC_CLASS_DEF __nvoc_class_def_Object;
17 
18 extern const struct NVOC_CLASS_DEF __nvoc_class_def_RegisterAperture;
19 
20 void __nvoc_init_IoAperture(IoAperture*);
21 void __nvoc_init_funcTable_IoAperture(IoAperture*);
22 NV_STATUS __nvoc_ctor_IoAperture(IoAperture*, struct IoAperture * arg_pParentAperture, OBJGPU * arg_pGpu, NvU32 arg_deviceIndex, NvU32 arg_deviceInstance, DEVICE_MAPPING * arg_pMapping, NvU32 arg_mappingStartAddr, NvU32 arg_offset, NvU32 arg_length);
23 void __nvoc_init_dataField_IoAperture(IoAperture*);
24 void __nvoc_dtor_IoAperture(IoAperture*);
25 extern const struct NVOC_EXPORT_INFO __nvoc_export_info_IoAperture;
26 
27 static const struct NVOC_RTTI __nvoc_rtti_IoAperture_IoAperture = {
28     /*pClassDef=*/          &__nvoc_class_def_IoAperture,
29     /*dtor=*/               (NVOC_DYNAMIC_DTOR) &__nvoc_dtor_IoAperture,
30     /*offset=*/             0,
31 };
32 
33 static const struct NVOC_RTTI __nvoc_rtti_IoAperture_Object = {
34     /*pClassDef=*/          &__nvoc_class_def_Object,
35     /*dtor=*/               &__nvoc_destructFromBase,
36     /*offset=*/             NV_OFFSETOF(IoAperture, __nvoc_base_Object),
37 };
38 
39 static const struct NVOC_RTTI __nvoc_rtti_IoAperture_RegisterAperture = {
40     /*pClassDef=*/          &__nvoc_class_def_RegisterAperture,
41     /*dtor=*/               &__nvoc_destructFromBase,
42     /*offset=*/             NV_OFFSETOF(IoAperture, __nvoc_base_RegisterAperture),
43 };
44 
45 static const struct NVOC_CASTINFO __nvoc_castinfo_IoAperture = {
46     /*numRelatives=*/       3,
47     /*relatives=*/ {
48         &__nvoc_rtti_IoAperture_IoAperture,
49         &__nvoc_rtti_IoAperture_RegisterAperture,
50         &__nvoc_rtti_IoAperture_Object,
51     },
52 };
53 
54 const struct NVOC_CLASS_DEF __nvoc_class_def_IoAperture =
55 {
56     /*classInfo=*/ {
57         /*size=*/               sizeof(IoAperture),
58         /*classId=*/            classId(IoAperture),
59         /*providerId=*/         &__nvoc_rtti_provider,
60 #if NV_PRINTF_STRINGS_ALLOWED
61         /*name=*/               "IoAperture",
62 #endif
63     },
64     /*objCreatefn=*/        (NVOC_DYNAMIC_OBJ_CREATE) &__nvoc_objCreateDynamic_IoAperture,
65     /*pCastInfo=*/          &__nvoc_castinfo_IoAperture,
66     /*pExportInfo=*/        &__nvoc_export_info_IoAperture
67 };
68 
__nvoc_thunk_IoAperture_regaprtReadReg08(struct RegisterAperture * pAperture,NvU32 addr)69 static NvU8 __nvoc_thunk_IoAperture_regaprtReadReg08(struct RegisterAperture *pAperture, NvU32 addr) {
70     return ioaprtReadReg08((struct IoAperture *)(((unsigned char *)pAperture) - __nvoc_rtti_IoAperture_RegisterAperture.offset), addr);
71 }
72 
__nvoc_thunk_IoAperture_regaprtReadReg16(struct RegisterAperture * pAperture,NvU32 addr)73 static NvU16 __nvoc_thunk_IoAperture_regaprtReadReg16(struct RegisterAperture *pAperture, NvU32 addr) {
74     return ioaprtReadReg16((struct IoAperture *)(((unsigned char *)pAperture) - __nvoc_rtti_IoAperture_RegisterAperture.offset), addr);
75 }
76 
__nvoc_thunk_IoAperture_regaprtReadReg32(struct RegisterAperture * pAperture,NvU32 addr)77 static NvU32 __nvoc_thunk_IoAperture_regaprtReadReg32(struct RegisterAperture *pAperture, NvU32 addr) {
78     return ioaprtReadReg32((struct IoAperture *)(((unsigned char *)pAperture) - __nvoc_rtti_IoAperture_RegisterAperture.offset), addr);
79 }
80 
__nvoc_thunk_IoAperture_regaprtWriteReg08(struct RegisterAperture * pAperture,NvU32 addr,NvV8 value)81 static void __nvoc_thunk_IoAperture_regaprtWriteReg08(struct RegisterAperture *pAperture, NvU32 addr, NvV8 value) {
82     ioaprtWriteReg08((struct IoAperture *)(((unsigned char *)pAperture) - __nvoc_rtti_IoAperture_RegisterAperture.offset), addr, value);
83 }
84 
__nvoc_thunk_IoAperture_regaprtWriteReg16(struct RegisterAperture * pAperture,NvU32 addr,NvV16 value)85 static void __nvoc_thunk_IoAperture_regaprtWriteReg16(struct RegisterAperture *pAperture, NvU32 addr, NvV16 value) {
86     ioaprtWriteReg16((struct IoAperture *)(((unsigned char *)pAperture) - __nvoc_rtti_IoAperture_RegisterAperture.offset), addr, value);
87 }
88 
__nvoc_thunk_IoAperture_regaprtWriteReg32(struct RegisterAperture * pAperture,NvU32 addr,NvV32 value)89 static void __nvoc_thunk_IoAperture_regaprtWriteReg32(struct RegisterAperture *pAperture, NvU32 addr, NvV32 value) {
90     ioaprtWriteReg32((struct IoAperture *)(((unsigned char *)pAperture) - __nvoc_rtti_IoAperture_RegisterAperture.offset), addr, value);
91 }
92 
__nvoc_thunk_IoAperture_regaprtWriteReg32Uc(struct RegisterAperture * pAperture,NvU32 addr,NvV32 value)93 static void __nvoc_thunk_IoAperture_regaprtWriteReg32Uc(struct RegisterAperture *pAperture, NvU32 addr, NvV32 value) {
94     ioaprtWriteReg32Uc((struct IoAperture *)(((unsigned char *)pAperture) - __nvoc_rtti_IoAperture_RegisterAperture.offset), addr, value);
95 }
96 
__nvoc_thunk_IoAperture_regaprtIsRegValid(struct RegisterAperture * pAperture,NvU32 addr)97 static NvBool __nvoc_thunk_IoAperture_regaprtIsRegValid(struct RegisterAperture *pAperture, NvU32 addr) {
98     return ioaprtIsRegValid((struct IoAperture *)(((unsigned char *)pAperture) - __nvoc_rtti_IoAperture_RegisterAperture.offset), addr);
99 }
100 
101 const struct NVOC_EXPORT_INFO __nvoc_export_info_IoAperture =
102 {
103     /*numEntries=*/     0,
104     /*pExportEntries=*/  0
105 };
106 
107 void __nvoc_dtor_Object(Object*);
108 void __nvoc_dtor_RegisterAperture(RegisterAperture*);
__nvoc_dtor_IoAperture(IoAperture * pThis)109 void __nvoc_dtor_IoAperture(IoAperture *pThis) {
110     __nvoc_dtor_Object(&pThis->__nvoc_base_Object);
111     __nvoc_dtor_RegisterAperture(&pThis->__nvoc_base_RegisterAperture);
112     PORT_UNREFERENCED_VARIABLE(pThis);
113 }
114 
__nvoc_init_dataField_IoAperture(IoAperture * pThis)115 void __nvoc_init_dataField_IoAperture(IoAperture *pThis) {
116     PORT_UNREFERENCED_VARIABLE(pThis);
117 }
118 
119 NV_STATUS __nvoc_ctor_Object(Object* );
120 NV_STATUS __nvoc_ctor_RegisterAperture(RegisterAperture* );
__nvoc_ctor_IoAperture(IoAperture * pThis,struct IoAperture * arg_pParentAperture,OBJGPU * arg_pGpu,NvU32 arg_deviceIndex,NvU32 arg_deviceInstance,DEVICE_MAPPING * arg_pMapping,NvU32 arg_mappingStartAddr,NvU32 arg_offset,NvU32 arg_length)121 NV_STATUS __nvoc_ctor_IoAperture(IoAperture *pThis, struct IoAperture * arg_pParentAperture, OBJGPU * arg_pGpu, NvU32 arg_deviceIndex, NvU32 arg_deviceInstance, DEVICE_MAPPING * arg_pMapping, NvU32 arg_mappingStartAddr, NvU32 arg_offset, NvU32 arg_length) {
122     NV_STATUS status = NV_OK;
123     status = __nvoc_ctor_Object(&pThis->__nvoc_base_Object);
124     if (status != NV_OK) goto __nvoc_ctor_IoAperture_fail_Object;
125     status = __nvoc_ctor_RegisterAperture(&pThis->__nvoc_base_RegisterAperture);
126     if (status != NV_OK) goto __nvoc_ctor_IoAperture_fail_RegisterAperture;
127     __nvoc_init_dataField_IoAperture(pThis);
128 
129     status = __nvoc_ioaprtConstruct(pThis, arg_pParentAperture, arg_pGpu, arg_deviceIndex, arg_deviceInstance, arg_pMapping, arg_mappingStartAddr, arg_offset, arg_length);
130     if (status != NV_OK) goto __nvoc_ctor_IoAperture_fail__init;
131     goto __nvoc_ctor_IoAperture_exit; // Success
132 
133 __nvoc_ctor_IoAperture_fail__init:
134     __nvoc_dtor_RegisterAperture(&pThis->__nvoc_base_RegisterAperture);
135 __nvoc_ctor_IoAperture_fail_RegisterAperture:
136     __nvoc_dtor_Object(&pThis->__nvoc_base_Object);
137 __nvoc_ctor_IoAperture_fail_Object:
138 __nvoc_ctor_IoAperture_exit:
139 
140     return status;
141 }
142 
__nvoc_init_funcTable_IoAperture_1(IoAperture * pThis)143 static void __nvoc_init_funcTable_IoAperture_1(IoAperture *pThis) {
144     PORT_UNREFERENCED_VARIABLE(pThis);
145 
146     pThis->__ioaprtReadReg08__ = &ioaprtReadReg08_IMPL;
147 
148     pThis->__ioaprtReadReg16__ = &ioaprtReadReg16_IMPL;
149 
150     pThis->__ioaprtReadReg32__ = &ioaprtReadReg32_IMPL;
151 
152     pThis->__ioaprtWriteReg08__ = &ioaprtWriteReg08_IMPL;
153 
154     pThis->__ioaprtWriteReg16__ = &ioaprtWriteReg16_IMPL;
155 
156     pThis->__ioaprtWriteReg32__ = &ioaprtWriteReg32_IMPL;
157 
158     pThis->__ioaprtWriteReg32Uc__ = &ioaprtWriteReg32Uc_IMPL;
159 
160     pThis->__ioaprtIsRegValid__ = &ioaprtIsRegValid_IMPL;
161 
162     pThis->__nvoc_base_RegisterAperture.__regaprtReadReg08__ = &__nvoc_thunk_IoAperture_regaprtReadReg08;
163 
164     pThis->__nvoc_base_RegisterAperture.__regaprtReadReg16__ = &__nvoc_thunk_IoAperture_regaprtReadReg16;
165 
166     pThis->__nvoc_base_RegisterAperture.__regaprtReadReg32__ = &__nvoc_thunk_IoAperture_regaprtReadReg32;
167 
168     pThis->__nvoc_base_RegisterAperture.__regaprtWriteReg08__ = &__nvoc_thunk_IoAperture_regaprtWriteReg08;
169 
170     pThis->__nvoc_base_RegisterAperture.__regaprtWriteReg16__ = &__nvoc_thunk_IoAperture_regaprtWriteReg16;
171 
172     pThis->__nvoc_base_RegisterAperture.__regaprtWriteReg32__ = &__nvoc_thunk_IoAperture_regaprtWriteReg32;
173 
174     pThis->__nvoc_base_RegisterAperture.__regaprtWriteReg32Uc__ = &__nvoc_thunk_IoAperture_regaprtWriteReg32Uc;
175 
176     pThis->__nvoc_base_RegisterAperture.__regaprtIsRegValid__ = &__nvoc_thunk_IoAperture_regaprtIsRegValid;
177 }
178 
__nvoc_init_funcTable_IoAperture(IoAperture * pThis)179 void __nvoc_init_funcTable_IoAperture(IoAperture *pThis) {
180     __nvoc_init_funcTable_IoAperture_1(pThis);
181 }
182 
183 void __nvoc_init_Object(Object*);
184 void __nvoc_init_RegisterAperture(RegisterAperture*);
__nvoc_init_IoAperture(IoAperture * pThis)185 void __nvoc_init_IoAperture(IoAperture *pThis) {
186     pThis->__nvoc_pbase_IoAperture = pThis;
187     pThis->__nvoc_pbase_Object = &pThis->__nvoc_base_Object;
188     pThis->__nvoc_pbase_RegisterAperture = &pThis->__nvoc_base_RegisterAperture;
189     __nvoc_init_Object(&pThis->__nvoc_base_Object);
190     __nvoc_init_RegisterAperture(&pThis->__nvoc_base_RegisterAperture);
191     __nvoc_init_funcTable_IoAperture(pThis);
192 }
193 
__nvoc_objCreate_IoAperture(IoAperture ** ppThis,Dynamic * pParent,NvU32 createFlags,struct IoAperture * arg_pParentAperture,OBJGPU * arg_pGpu,NvU32 arg_deviceIndex,NvU32 arg_deviceInstance,DEVICE_MAPPING * arg_pMapping,NvU32 arg_mappingStartAddr,NvU32 arg_offset,NvU32 arg_length)194 NV_STATUS __nvoc_objCreate_IoAperture(IoAperture **ppThis, Dynamic *pParent, NvU32 createFlags, struct IoAperture * arg_pParentAperture, OBJGPU * arg_pGpu, NvU32 arg_deviceIndex, NvU32 arg_deviceInstance, DEVICE_MAPPING * arg_pMapping, NvU32 arg_mappingStartAddr, NvU32 arg_offset, NvU32 arg_length)
195 {
196     NV_STATUS status;
197     Object *pParentObj = NULL;
198     IoAperture *pThis;
199 
200     // Assign `pThis`, allocating memory unless suppressed by flag.
201     status = __nvoc_handleObjCreateMemAlloc(createFlags, sizeof(IoAperture), (void**)&pThis, (void**)ppThis);
202     if (status != NV_OK)
203         return status;
204 
205     // Zero is the initial value for everything.
206     portMemSet(pThis, 0, sizeof(IoAperture));
207 
208     // Initialize runtime type information.
209     __nvoc_initRtti(staticCast(pThis, Dynamic), &__nvoc_class_def_IoAperture);
210 
211     pThis->__nvoc_base_Object.createFlags = createFlags;
212 
213     // Link the child into the parent if there is one unless flagged not to do so.
214     if (pParent != NULL && !(createFlags & NVOC_OBJ_CREATE_FLAGS_PARENT_HALSPEC_ONLY))
215     {
216         pParentObj = dynamicCast(pParent, Object);
217         objAddChild(pParentObj, &pThis->__nvoc_base_Object);
218     }
219     else
220     {
221         pThis->__nvoc_base_Object.pParent = NULL;
222     }
223 
224     __nvoc_init_IoAperture(pThis);
225     status = __nvoc_ctor_IoAperture(pThis, arg_pParentAperture, arg_pGpu, arg_deviceIndex, arg_deviceInstance, arg_pMapping, arg_mappingStartAddr, arg_offset, arg_length);
226     if (status != NV_OK) goto __nvoc_objCreate_IoAperture_cleanup;
227 
228     // Assignment has no effect if NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT is set.
229     *ppThis = pThis;
230 
231     return NV_OK;
232 
233 __nvoc_objCreate_IoAperture_cleanup:
234 
235     // Unlink the child from the parent if it was linked above.
236     if (pParentObj != NULL)
237         objRemoveChild(pParentObj, &pThis->__nvoc_base_Object);
238 
239     // Do not call destructors here since the constructor already called them.
240     if (createFlags & NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT)
241         portMemSet(pThis, 0, sizeof(IoAperture));
242     else
243     {
244         portMemFree(pThis);
245         *ppThis = NULL;
246     }
247 
248     // coverity[leaked_storage:FALSE]
249     return status;
250 }
251 
__nvoc_objCreateDynamic_IoAperture(IoAperture ** ppThis,Dynamic * pParent,NvU32 createFlags,va_list args)252 NV_STATUS __nvoc_objCreateDynamic_IoAperture(IoAperture **ppThis, Dynamic *pParent, NvU32 createFlags, va_list args) {
253     NV_STATUS status;
254     struct IoAperture * arg_pParentAperture = va_arg(args, struct IoAperture *);
255     OBJGPU * arg_pGpu = va_arg(args, OBJGPU *);
256     NvU32 arg_deviceIndex = va_arg(args, NvU32);
257     NvU32 arg_deviceInstance = va_arg(args, NvU32);
258     DEVICE_MAPPING * arg_pMapping = va_arg(args, DEVICE_MAPPING *);
259     NvU32 arg_mappingStartAddr = va_arg(args, NvU32);
260     NvU32 arg_offset = va_arg(args, NvU32);
261     NvU32 arg_length = va_arg(args, NvU32);
262 
263     status = __nvoc_objCreate_IoAperture(ppThis, pParent, createFlags, arg_pParentAperture, arg_pGpu, arg_deviceIndex, arg_deviceInstance, arg_pMapping, arg_mappingStartAddr, arg_offset, arg_length);
264 
265     return status;
266 }
267 
268 #ifdef DEBUG
269 char __nvoc_class_id_uniqueness_check_0x6d0f88 = 1;
270 #endif
271 
272 extern const struct NVOC_CLASS_DEF __nvoc_class_def_SwBcAperture;
273 
274 extern const struct NVOC_CLASS_DEF __nvoc_class_def_Object;
275 
276 extern const struct NVOC_CLASS_DEF __nvoc_class_def_RegisterAperture;
277 
278 void __nvoc_init_SwBcAperture(SwBcAperture*);
279 void __nvoc_init_funcTable_SwBcAperture(SwBcAperture*);
280 NV_STATUS __nvoc_ctor_SwBcAperture(SwBcAperture*, struct IoAperture * arg_pApertures, NvU32 arg_numApertures);
281 void __nvoc_init_dataField_SwBcAperture(SwBcAperture*);
282 void __nvoc_dtor_SwBcAperture(SwBcAperture*);
283 extern const struct NVOC_EXPORT_INFO __nvoc_export_info_SwBcAperture;
284 
285 static const struct NVOC_RTTI __nvoc_rtti_SwBcAperture_SwBcAperture = {
286     /*pClassDef=*/          &__nvoc_class_def_SwBcAperture,
287     /*dtor=*/               (NVOC_DYNAMIC_DTOR) &__nvoc_dtor_SwBcAperture,
288     /*offset=*/             0,
289 };
290 
291 static const struct NVOC_RTTI __nvoc_rtti_SwBcAperture_Object = {
292     /*pClassDef=*/          &__nvoc_class_def_Object,
293     /*dtor=*/               &__nvoc_destructFromBase,
294     /*offset=*/             NV_OFFSETOF(SwBcAperture, __nvoc_base_Object),
295 };
296 
297 static const struct NVOC_RTTI __nvoc_rtti_SwBcAperture_RegisterAperture = {
298     /*pClassDef=*/          &__nvoc_class_def_RegisterAperture,
299     /*dtor=*/               &__nvoc_destructFromBase,
300     /*offset=*/             NV_OFFSETOF(SwBcAperture, __nvoc_base_RegisterAperture),
301 };
302 
303 static const struct NVOC_CASTINFO __nvoc_castinfo_SwBcAperture = {
304     /*numRelatives=*/       3,
305     /*relatives=*/ {
306         &__nvoc_rtti_SwBcAperture_SwBcAperture,
307         &__nvoc_rtti_SwBcAperture_RegisterAperture,
308         &__nvoc_rtti_SwBcAperture_Object,
309     },
310 };
311 
312 const struct NVOC_CLASS_DEF __nvoc_class_def_SwBcAperture =
313 {
314     /*classInfo=*/ {
315         /*size=*/               sizeof(SwBcAperture),
316         /*classId=*/            classId(SwBcAperture),
317         /*providerId=*/         &__nvoc_rtti_provider,
318 #if NV_PRINTF_STRINGS_ALLOWED
319         /*name=*/               "SwBcAperture",
320 #endif
321     },
322     /*objCreatefn=*/        (NVOC_DYNAMIC_OBJ_CREATE) &__nvoc_objCreateDynamic_SwBcAperture,
323     /*pCastInfo=*/          &__nvoc_castinfo_SwBcAperture,
324     /*pExportInfo=*/        &__nvoc_export_info_SwBcAperture
325 };
326 
__nvoc_thunk_SwBcAperture_regaprtReadReg08(struct RegisterAperture * pAperture,NvU32 addr)327 static NvU8 __nvoc_thunk_SwBcAperture_regaprtReadReg08(struct RegisterAperture *pAperture, NvU32 addr) {
328     return swbcaprtReadReg08((struct SwBcAperture *)(((unsigned char *)pAperture) - __nvoc_rtti_SwBcAperture_RegisterAperture.offset), addr);
329 }
330 
__nvoc_thunk_SwBcAperture_regaprtReadReg16(struct RegisterAperture * pAperture,NvU32 addr)331 static NvU16 __nvoc_thunk_SwBcAperture_regaprtReadReg16(struct RegisterAperture *pAperture, NvU32 addr) {
332     return swbcaprtReadReg16((struct SwBcAperture *)(((unsigned char *)pAperture) - __nvoc_rtti_SwBcAperture_RegisterAperture.offset), addr);
333 }
334 
__nvoc_thunk_SwBcAperture_regaprtReadReg32(struct RegisterAperture * pAperture,NvU32 addr)335 static NvU32 __nvoc_thunk_SwBcAperture_regaprtReadReg32(struct RegisterAperture *pAperture, NvU32 addr) {
336     return swbcaprtReadReg32((struct SwBcAperture *)(((unsigned char *)pAperture) - __nvoc_rtti_SwBcAperture_RegisterAperture.offset), addr);
337 }
338 
__nvoc_thunk_SwBcAperture_regaprtWriteReg08(struct RegisterAperture * pAperture,NvU32 addr,NvV8 value)339 static void __nvoc_thunk_SwBcAperture_regaprtWriteReg08(struct RegisterAperture *pAperture, NvU32 addr, NvV8 value) {
340     swbcaprtWriteReg08((struct SwBcAperture *)(((unsigned char *)pAperture) - __nvoc_rtti_SwBcAperture_RegisterAperture.offset), addr, value);
341 }
342 
__nvoc_thunk_SwBcAperture_regaprtWriteReg16(struct RegisterAperture * pAperture,NvU32 addr,NvV16 value)343 static void __nvoc_thunk_SwBcAperture_regaprtWriteReg16(struct RegisterAperture *pAperture, NvU32 addr, NvV16 value) {
344     swbcaprtWriteReg16((struct SwBcAperture *)(((unsigned char *)pAperture) - __nvoc_rtti_SwBcAperture_RegisterAperture.offset), addr, value);
345 }
346 
__nvoc_thunk_SwBcAperture_regaprtWriteReg32(struct RegisterAperture * pAperture,NvU32 addr,NvV32 value)347 static void __nvoc_thunk_SwBcAperture_regaprtWriteReg32(struct RegisterAperture *pAperture, NvU32 addr, NvV32 value) {
348     swbcaprtWriteReg32((struct SwBcAperture *)(((unsigned char *)pAperture) - __nvoc_rtti_SwBcAperture_RegisterAperture.offset), addr, value);
349 }
350 
__nvoc_thunk_SwBcAperture_regaprtWriteReg32Uc(struct RegisterAperture * pAperture,NvU32 addr,NvV32 value)351 static void __nvoc_thunk_SwBcAperture_regaprtWriteReg32Uc(struct RegisterAperture *pAperture, NvU32 addr, NvV32 value) {
352     swbcaprtWriteReg32Uc((struct SwBcAperture *)(((unsigned char *)pAperture) - __nvoc_rtti_SwBcAperture_RegisterAperture.offset), addr, value);
353 }
354 
__nvoc_thunk_SwBcAperture_regaprtIsRegValid(struct RegisterAperture * pAperture,NvU32 addr)355 static NvBool __nvoc_thunk_SwBcAperture_regaprtIsRegValid(struct RegisterAperture *pAperture, NvU32 addr) {
356     return swbcaprtIsRegValid((struct SwBcAperture *)(((unsigned char *)pAperture) - __nvoc_rtti_SwBcAperture_RegisterAperture.offset), addr);
357 }
358 
359 const struct NVOC_EXPORT_INFO __nvoc_export_info_SwBcAperture =
360 {
361     /*numEntries=*/     0,
362     /*pExportEntries=*/  0
363 };
364 
365 void __nvoc_dtor_Object(Object*);
366 void __nvoc_dtor_RegisterAperture(RegisterAperture*);
__nvoc_dtor_SwBcAperture(SwBcAperture * pThis)367 void __nvoc_dtor_SwBcAperture(SwBcAperture *pThis) {
368     __nvoc_dtor_Object(&pThis->__nvoc_base_Object);
369     __nvoc_dtor_RegisterAperture(&pThis->__nvoc_base_RegisterAperture);
370     PORT_UNREFERENCED_VARIABLE(pThis);
371 }
372 
__nvoc_init_dataField_SwBcAperture(SwBcAperture * pThis)373 void __nvoc_init_dataField_SwBcAperture(SwBcAperture *pThis) {
374     PORT_UNREFERENCED_VARIABLE(pThis);
375 }
376 
377 NV_STATUS __nvoc_ctor_Object(Object* );
378 NV_STATUS __nvoc_ctor_RegisterAperture(RegisterAperture* );
__nvoc_ctor_SwBcAperture(SwBcAperture * pThis,struct IoAperture * arg_pApertures,NvU32 arg_numApertures)379 NV_STATUS __nvoc_ctor_SwBcAperture(SwBcAperture *pThis, struct IoAperture * arg_pApertures, NvU32 arg_numApertures) {
380     NV_STATUS status = NV_OK;
381     status = __nvoc_ctor_Object(&pThis->__nvoc_base_Object);
382     if (status != NV_OK) goto __nvoc_ctor_SwBcAperture_fail_Object;
383     status = __nvoc_ctor_RegisterAperture(&pThis->__nvoc_base_RegisterAperture);
384     if (status != NV_OK) goto __nvoc_ctor_SwBcAperture_fail_RegisterAperture;
385     __nvoc_init_dataField_SwBcAperture(pThis);
386 
387     status = __nvoc_swbcaprtConstruct(pThis, arg_pApertures, arg_numApertures);
388     if (status != NV_OK) goto __nvoc_ctor_SwBcAperture_fail__init;
389     goto __nvoc_ctor_SwBcAperture_exit; // Success
390 
391 __nvoc_ctor_SwBcAperture_fail__init:
392     __nvoc_dtor_RegisterAperture(&pThis->__nvoc_base_RegisterAperture);
393 __nvoc_ctor_SwBcAperture_fail_RegisterAperture:
394     __nvoc_dtor_Object(&pThis->__nvoc_base_Object);
395 __nvoc_ctor_SwBcAperture_fail_Object:
396 __nvoc_ctor_SwBcAperture_exit:
397 
398     return status;
399 }
400 
__nvoc_init_funcTable_SwBcAperture_1(SwBcAperture * pThis)401 static void __nvoc_init_funcTable_SwBcAperture_1(SwBcAperture *pThis) {
402     PORT_UNREFERENCED_VARIABLE(pThis);
403 
404     pThis->__swbcaprtReadReg08__ = &swbcaprtReadReg08_IMPL;
405 
406     pThis->__swbcaprtReadReg16__ = &swbcaprtReadReg16_IMPL;
407 
408     pThis->__swbcaprtReadReg32__ = &swbcaprtReadReg32_IMPL;
409 
410     pThis->__swbcaprtWriteReg08__ = &swbcaprtWriteReg08_IMPL;
411 
412     pThis->__swbcaprtWriteReg16__ = &swbcaprtWriteReg16_IMPL;
413 
414     pThis->__swbcaprtWriteReg32__ = &swbcaprtWriteReg32_IMPL;
415 
416     pThis->__swbcaprtWriteReg32Uc__ = &swbcaprtWriteReg32Uc_IMPL;
417 
418     pThis->__swbcaprtIsRegValid__ = &swbcaprtIsRegValid_IMPL;
419 
420     pThis->__nvoc_base_RegisterAperture.__regaprtReadReg08__ = &__nvoc_thunk_SwBcAperture_regaprtReadReg08;
421 
422     pThis->__nvoc_base_RegisterAperture.__regaprtReadReg16__ = &__nvoc_thunk_SwBcAperture_regaprtReadReg16;
423 
424     pThis->__nvoc_base_RegisterAperture.__regaprtReadReg32__ = &__nvoc_thunk_SwBcAperture_regaprtReadReg32;
425 
426     pThis->__nvoc_base_RegisterAperture.__regaprtWriteReg08__ = &__nvoc_thunk_SwBcAperture_regaprtWriteReg08;
427 
428     pThis->__nvoc_base_RegisterAperture.__regaprtWriteReg16__ = &__nvoc_thunk_SwBcAperture_regaprtWriteReg16;
429 
430     pThis->__nvoc_base_RegisterAperture.__regaprtWriteReg32__ = &__nvoc_thunk_SwBcAperture_regaprtWriteReg32;
431 
432     pThis->__nvoc_base_RegisterAperture.__regaprtWriteReg32Uc__ = &__nvoc_thunk_SwBcAperture_regaprtWriteReg32Uc;
433 
434     pThis->__nvoc_base_RegisterAperture.__regaprtIsRegValid__ = &__nvoc_thunk_SwBcAperture_regaprtIsRegValid;
435 }
436 
__nvoc_init_funcTable_SwBcAperture(SwBcAperture * pThis)437 void __nvoc_init_funcTable_SwBcAperture(SwBcAperture *pThis) {
438     __nvoc_init_funcTable_SwBcAperture_1(pThis);
439 }
440 
441 void __nvoc_init_Object(Object*);
442 void __nvoc_init_RegisterAperture(RegisterAperture*);
__nvoc_init_SwBcAperture(SwBcAperture * pThis)443 void __nvoc_init_SwBcAperture(SwBcAperture *pThis) {
444     pThis->__nvoc_pbase_SwBcAperture = pThis;
445     pThis->__nvoc_pbase_Object = &pThis->__nvoc_base_Object;
446     pThis->__nvoc_pbase_RegisterAperture = &pThis->__nvoc_base_RegisterAperture;
447     __nvoc_init_Object(&pThis->__nvoc_base_Object);
448     __nvoc_init_RegisterAperture(&pThis->__nvoc_base_RegisterAperture);
449     __nvoc_init_funcTable_SwBcAperture(pThis);
450 }
451 
__nvoc_objCreate_SwBcAperture(SwBcAperture ** ppThis,Dynamic * pParent,NvU32 createFlags,struct IoAperture * arg_pApertures,NvU32 arg_numApertures)452 NV_STATUS __nvoc_objCreate_SwBcAperture(SwBcAperture **ppThis, Dynamic *pParent, NvU32 createFlags, struct IoAperture * arg_pApertures, NvU32 arg_numApertures)
453 {
454     NV_STATUS status;
455     Object *pParentObj = NULL;
456     SwBcAperture *pThis;
457 
458     // Assign `pThis`, allocating memory unless suppressed by flag.
459     status = __nvoc_handleObjCreateMemAlloc(createFlags, sizeof(SwBcAperture), (void**)&pThis, (void**)ppThis);
460     if (status != NV_OK)
461         return status;
462 
463     // Zero is the initial value for everything.
464     portMemSet(pThis, 0, sizeof(SwBcAperture));
465 
466     // Initialize runtime type information.
467     __nvoc_initRtti(staticCast(pThis, Dynamic), &__nvoc_class_def_SwBcAperture);
468 
469     pThis->__nvoc_base_Object.createFlags = createFlags;
470 
471     // Link the child into the parent if there is one unless flagged not to do so.
472     if (pParent != NULL && !(createFlags & NVOC_OBJ_CREATE_FLAGS_PARENT_HALSPEC_ONLY))
473     {
474         pParentObj = dynamicCast(pParent, Object);
475         objAddChild(pParentObj, &pThis->__nvoc_base_Object);
476     }
477     else
478     {
479         pThis->__nvoc_base_Object.pParent = NULL;
480     }
481 
482     __nvoc_init_SwBcAperture(pThis);
483     status = __nvoc_ctor_SwBcAperture(pThis, arg_pApertures, arg_numApertures);
484     if (status != NV_OK) goto __nvoc_objCreate_SwBcAperture_cleanup;
485 
486     // Assignment has no effect if NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT is set.
487     *ppThis = pThis;
488 
489     return NV_OK;
490 
491 __nvoc_objCreate_SwBcAperture_cleanup:
492 
493     // Unlink the child from the parent if it was linked above.
494     if (pParentObj != NULL)
495         objRemoveChild(pParentObj, &pThis->__nvoc_base_Object);
496 
497     // Do not call destructors here since the constructor already called them.
498     if (createFlags & NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT)
499         portMemSet(pThis, 0, sizeof(SwBcAperture));
500     else
501     {
502         portMemFree(pThis);
503         *ppThis = NULL;
504     }
505 
506     // coverity[leaked_storage:FALSE]
507     return status;
508 }
509 
__nvoc_objCreateDynamic_SwBcAperture(SwBcAperture ** ppThis,Dynamic * pParent,NvU32 createFlags,va_list args)510 NV_STATUS __nvoc_objCreateDynamic_SwBcAperture(SwBcAperture **ppThis, Dynamic *pParent, NvU32 createFlags, va_list args) {
511     NV_STATUS status;
512     struct IoAperture * arg_pApertures = va_arg(args, struct IoAperture *);
513     NvU32 arg_numApertures = va_arg(args, NvU32);
514 
515     status = __nvoc_objCreate_SwBcAperture(ppThis, pParent, createFlags, arg_pApertures, arg_numApertures);
516 
517     return status;
518 }
519 
520