/* param base XRDC2 peripheral base address. param memSlot The memory slot to operate. retval kStatus_Fail Failed to lock. retval kStatus_Success Locked succussfully.  */
status_t XRDC2_TryLockMemSlotExclAccess(XRDC2_Type *base, xrdc2_mem_slot_t memSlot)
/* param base XRDC2 peripheral base address. param memSlot The memory slot to operate. retval kStatus_Fail Failed to lock. retval kStatus_Success Locked succussfully.  */
status_t XRDC2_TryLockMemSlotExclAccess(XRDC2_Type *base, xrdc2_mem_slot_t memSlot)
{
    status_t status;
    uint8_t curDomainID;
    volatile uint32_t *lockReg = &(base->MSCI_MSAC_WK[(uint32_t)memSlot].MSC_MSAC_W1);
    curDomainID = XRDC2_GetCurrentMasterDomainId(base);
    *lockReg = XRDC2_EAL_LOCKED;
    if (curDomainID != XRDC2_GetMemSlotExclAccessLockDomainOwner(base, memSlot))
    {
        status = kStatus_Fail;
    }
    else
    {
        status = kStatus_Success;
    }
    return status;
}