mirror of
https://github.com/NVIDIA/open-gpu-kernel-modules.git
synced 2026-02-23 08:23:57 +00:00
550.40.07
This commit is contained in:
@@ -175,6 +175,16 @@ static void __nvoc_init_funcTable_KernelRc_1(KernelRc *pThis, RmHalspecOwner *pR
|
||||
|
||||
pThis->__krcConstructEngine__ = &krcConstructEngine_IMPL;
|
||||
|
||||
// Hal function -- krcWatchdogRecovery
|
||||
if (( ((rmVariantHal_HalVarIdx >> 5) == 0UL) && ((1UL << (rmVariantHal_HalVarIdx & 0x1f)) & 0x00000001UL) )) /* RmVariantHal: VF */
|
||||
{
|
||||
pThis->__krcWatchdogRecovery__ = &krcWatchdogRecovery_f2d351;
|
||||
}
|
||||
else
|
||||
{
|
||||
pThis->__krcWatchdogRecovery__ = &krcWatchdogRecovery_KERNEL;
|
||||
}
|
||||
|
||||
pThis->__nvoc_base_OBJENGSTATE.__engstateConstructEngine__ = &__nvoc_thunk_KernelRc_engstateConstructEngine;
|
||||
|
||||
pThis->__krcStateLoad__ = &__nvoc_thunk_OBJENGSTATE_krcStateLoad;
|
||||
@@ -217,23 +227,31 @@ void __nvoc_init_KernelRc(KernelRc *pThis, RmHalspecOwner *pRmhalspecowner) {
|
||||
__nvoc_init_funcTable_KernelRc(pThis, pRmhalspecowner);
|
||||
}
|
||||
|
||||
NV_STATUS __nvoc_objCreate_KernelRc(KernelRc **ppThis, Dynamic *pParent, NvU32 createFlags) {
|
||||
NV_STATUS __nvoc_objCreate_KernelRc(KernelRc **ppThis, Dynamic *pParent, NvU32 createFlags)
|
||||
{
|
||||
NV_STATUS status;
|
||||
Object *pParentObj;
|
||||
Object *pParentObj = NULL;
|
||||
KernelRc *pThis;
|
||||
RmHalspecOwner *pRmhalspecowner;
|
||||
|
||||
// Assign `pThis`, allocating memory unless suppressed by flag.
|
||||
status = __nvoc_handleObjCreateMemAlloc(createFlags, sizeof(KernelRc), (void**)&pThis, (void**)ppThis);
|
||||
if (status != NV_OK)
|
||||
return status;
|
||||
|
||||
// Zero is the initial value for everything.
|
||||
portMemSet(pThis, 0, sizeof(KernelRc));
|
||||
|
||||
// Initialize runtime type information.
|
||||
__nvoc_initRtti(staticCast(pThis, Dynamic), &__nvoc_class_def_KernelRc);
|
||||
|
||||
pThis->__nvoc_base_OBJENGSTATE.__nvoc_base_Object.createFlags = createFlags;
|
||||
|
||||
if (pParent != NULL && !(createFlags & NVOC_OBJ_CREATE_FLAGS_PARENT_HALSPEC_ONLY))
|
||||
// pParent must be a valid object that derives from a halspec owner class.
|
||||
NV_ASSERT_OR_RETURN(pParent != NULL, NV_ERR_INVALID_ARGUMENT);
|
||||
|
||||
// Link the child into the parent unless flagged not to do so.
|
||||
if (!(createFlags & NVOC_OBJ_CREATE_FLAGS_PARENT_HALSPEC_ONLY))
|
||||
{
|
||||
pParentObj = dynamicCast(pParent, Object);
|
||||
objAddChild(pParentObj, &pThis->__nvoc_base_OBJENGSTATE.__nvoc_base_Object);
|
||||
@@ -251,16 +269,25 @@ NV_STATUS __nvoc_objCreate_KernelRc(KernelRc **ppThis, Dynamic *pParent, NvU32 c
|
||||
status = __nvoc_ctor_KernelRc(pThis, pRmhalspecowner);
|
||||
if (status != NV_OK) goto __nvoc_objCreate_KernelRc_cleanup;
|
||||
|
||||
// Assignment has no effect if NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT is set.
|
||||
*ppThis = pThis;
|
||||
|
||||
return NV_OK;
|
||||
|
||||
__nvoc_objCreate_KernelRc_cleanup:
|
||||
// do not call destructors here since the constructor already called them
|
||||
|
||||
// Unlink the child from the parent if it was linked above.
|
||||
if (pParentObj != NULL)
|
||||
objRemoveChild(pParentObj, &pThis->__nvoc_base_OBJENGSTATE.__nvoc_base_Object);
|
||||
|
||||
// Do not call destructors here since the constructor already called them.
|
||||
if (createFlags & NVOC_OBJ_CREATE_FLAGS_IN_PLACE_CONSTRUCT)
|
||||
portMemSet(pThis, 0, sizeof(KernelRc));
|
||||
else
|
||||
{
|
||||
portMemFree(pThis);
|
||||
*ppThis = NULL;
|
||||
}
|
||||
|
||||
// coverity[leaked_storage:FALSE]
|
||||
return status;
|
||||
|
||||
Reference in New Issue
Block a user