mirror of
https://github.com/NVIDIA/open-gpu-kernel-modules.git
synced 2026-03-01 11:19:49 +00:00
590.44.01
This commit is contained in:
@@ -453,16 +453,25 @@ void __nvoc_init__DebugBufferApi(DebugBufferApi *pThis) {
|
||||
__nvoc_init_funcTable_DebugBufferApi(pThis);
|
||||
}
|
||||
|
||||
NV_STATUS __nvoc_objCreate_DebugBufferApi(DebugBufferApi **ppThis, Dynamic *pParent, NvU32 createFlags, CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams)
|
||||
NV_STATUS __nvoc_objCreate_DebugBufferApi(DebugBufferApi **ppThis, Dynamic *pParent, NvU32 createFlags, CALL_CONTEXT *arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL *arg_pParams)
|
||||
{
|
||||
NV_STATUS status;
|
||||
Object *pParentObj = NULL;
|
||||
DebugBufferApi *pThis;
|
||||
|
||||
// Assign `pThis`, allocating memory unless suppressed by flag.
|
||||
status = __nvoc_handleObjCreateMemAlloc(createFlags, sizeof(DebugBufferApi), (void**)&pThis, (void**)ppThis);
|
||||
if (status != NV_OK)
|
||||
return status;
|
||||
// Don't allocate memory if the caller has already done so.
|
||||
if (createFlags & NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT)
|
||||
{
|
||||
NV_CHECK_OR_RETURN(LEVEL_ERROR, ppThis != NULL && *ppThis != NULL, NV_ERR_INVALID_PARAMETER);
|
||||
pThis = *ppThis;
|
||||
}
|
||||
|
||||
// Allocate memory
|
||||
else
|
||||
{
|
||||
pThis = portMemAllocNonPaged(sizeof(DebugBufferApi));
|
||||
NV_CHECK_OR_RETURN(LEVEL_ERROR, pThis != NULL, NV_ERR_NO_MEMORY);
|
||||
}
|
||||
|
||||
// Zero is the initial value for everything.
|
||||
portMemSet(pThis, 0, sizeof(DebugBufferApi));
|
||||
@@ -480,6 +489,7 @@ NV_STATUS __nvoc_objCreate_DebugBufferApi(DebugBufferApi **ppThis, Dynamic *pPar
|
||||
pThis->__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object.pParent = NULL;
|
||||
}
|
||||
|
||||
// Initialize vtable, RTTI, etc., then call constructor.
|
||||
__nvoc_init__DebugBufferApi(pThis);
|
||||
status = __nvoc_ctor_DebugBufferApi(pThis, arg_pCallContext, arg_pParams);
|
||||
if (status != NV_OK) goto __nvoc_objCreate_DebugBufferApi_cleanup;
|
||||
@@ -487,31 +497,35 @@ NV_STATUS __nvoc_objCreate_DebugBufferApi(DebugBufferApi **ppThis, Dynamic *pPar
|
||||
// Assignment has no effect if NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT is set.
|
||||
*ppThis = pThis;
|
||||
|
||||
// Success
|
||||
return NV_OK;
|
||||
|
||||
// Do not call destructors here since the constructor already called them.
|
||||
__nvoc_objCreate_DebugBufferApi_cleanup:
|
||||
|
||||
// Unlink the child from the parent if it was linked above.
|
||||
if (pParentObj != NULL)
|
||||
objRemoveChild(pParentObj, &pThis->__nvoc_base_GpuResource.__nvoc_base_RmResource.__nvoc_base_RsResource.__nvoc_base_Object);
|
||||
|
||||
// Do not call destructors here since the constructor already called them.
|
||||
// Zero out memory that was allocated by caller.
|
||||
if (createFlags & NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT)
|
||||
portMemSet(pThis, 0, sizeof(DebugBufferApi));
|
||||
|
||||
// Free memory allocated by `__nvoc_handleObjCreateMemAlloc`.
|
||||
else
|
||||
{
|
||||
portMemFree(pThis);
|
||||
*ppThis = NULL;
|
||||
}
|
||||
|
||||
// coverity[leaked_storage:FALSE]
|
||||
// Failure
|
||||
return status;
|
||||
}
|
||||
|
||||
NV_STATUS __nvoc_objCreateDynamic_DebugBufferApi(DebugBufferApi **ppThis, Dynamic *pParent, NvU32 createFlags, va_list args) {
|
||||
NV_STATUS status;
|
||||
CALL_CONTEXT * arg_pCallContext = va_arg(args, CALL_CONTEXT *);
|
||||
struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams = va_arg(args, struct RS_RES_ALLOC_PARAMS_INTERNAL *);
|
||||
CALL_CONTEXT *arg_pCallContext = va_arg(args, CALL_CONTEXT *);
|
||||
struct RS_RES_ALLOC_PARAMS_INTERNAL *arg_pParams = va_arg(args, struct RS_RES_ALLOC_PARAMS_INTERNAL *);
|
||||
|
||||
status = __nvoc_objCreate_DebugBufferApi(ppThis, pParent, createFlags, arg_pCallContext, arg_pParams);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user