src/ssx/occhw/occhw_scom.c
// Common SCOM polling loop with software timeout.  The PMC is always polled
// at least twice to guarantee that we always poll once after a timeout.
Common SCOM polling loop with software timeout.  The PMC is always polled
at least twice to guarantee that we always poll once after a timeout.
Common SCOM polling loop with software timeout . The PMC is always polled at least twice to guarantee that we always poll once after a timeout .
static int
poll_scom(SsxInterval timeout)
{
    SsxTimebase start;
    int timed_out;
    int rc;
    start = ssx_timebase_get();
    timed_out = 0;
    do
    {
        rc = ssx_irq_status_get(OCCHW_IRQ_IPI_SCOM);
        if (!rc)
        {
            break;
        }
        if (timed_out)
        {
            rc = -SCOM_TIMEOUT_ERROR;
            break;
        }
        timed_out =
            ((timeout != SSX_WAIT_FOREVER) &&
             ((ssx_timebase_get() - start) > timeout));
    }
    while (1);
    return rc;
}
static int poll_scom ( SsxInterval timeout ) { SsxTimebase start ; int timed_out ; int rc ; start = ssx_timebase_get ( ) ; timed_out = 0 ; do { rc = ssx_irq_status_get ( OCCHW_IRQ_IPI_SCOM ) ; if ( ! rc ) { break ; } if ( timed_out ) { rc = - SCOM_TIMEOUT_ERROR ; break ; } timed_out = ( ( timeout != SSX_WAIT_FOREVER ) && ( ( ssx_timebase_get ( ) - start ) > timeout ) ) ; } while ( 1 ) ; return rc ; }
Common SCOM polling loop with software timeout.
Common SCOM polling loop with software timeout .