/* return Return -1 if the gate is not locked by any domain, otherwise return the domain ID.  */
int32_t RDC_SEMA42_GetLockDomainID(RDC_SEMAPHORE_Type *base, uint8_t gateNum)
/* return Return -1 if the gate is not locked by any domain, otherwise return the domain ID.  */
int32_t RDC_SEMA42_GetLockDomainID(RDC_SEMAPHORE_Type *base, uint8_t gateNum)
{
    assert(gateNum < RDC_SEMA42_GATE_COUNT);
    int32_t ret;
    uint8_t regGate = RDC_SEMA42_GATEn(base, gateNum);
    if (0U == (regGate & RDC_SEMAPHORE_GATE_GTFSM_MASK))
    {
        ret = -1;
    }
    else
    {
        ret = (int32_t)((uint8_t)((regGate & RDC_SEMAPHORE_GATE_LDOM_MASK) >> RDC_SEMAPHORE_GATE_LDOM_SHIFT));
    }
    return ret;
}