/* note This function must be called when the lock is not disabled.  */
void XRDC2_LockPeriphExclAccess(XRDC2_Type *base, xrdc2_periph_t periph)
/* note This function must be called when the lock is not disabled.  */
void XRDC2_LockPeriphExclAccess(XRDC2_Type *base, xrdc2_periph_t periph)
{
    uint8_t curDomainID;
    uint32_t pac  = XRDC2_GET_PAC((uint32_t)periph);
    uint32_t pdac = XRDC2_GET_PDAC((uint32_t)periph);
    volatile uint32_t *lockReg = &(base->PACI_PDACJ[pac][pdac].PAC_PDAC_W1);
    curDomainID = XRDC2_GetCurrentMasterDomainId(base);
    while (true)
    {
        *lockReg = XRDC2_EAL_LOCKED;
        if (curDomainID == XRDC2_GetPeriphExclAccessLockDomainOwner(base, periph))
        {
            break;
        }
    }
    return;
}