Exemplo n.º 1
0
PUBLIC IX_STATUS
ixOsalSemaphoreWait (IxOsalOsSemaphore *sid, INT32 timeout)
{
    VALID_HANDLE(sid);

    struct semaphore *sem = *sid;
    UINT32 start, duration;

    if (timeout == IX_OSAL_WAIT_FOREVER)
	return ixOsalSemaphoreWaitInternal(sem, /* wait */ true);

    IX_STATUS ixStatus = ixOsalSemaphoreWaitInternal(sem, /* wait */ false);
    if (!timeout || ixStatus == IX_SUCCESS)
	return ixStatus;

    start = IX_OSAL_OEM_TIMESTAMP_GET();
    duration = US_TO_TICKS(timeout * 1000);
    do {
	ixOsalYield();
	ixStatus = ixOsalSemaphoreWaitInternal(sem, /* wait */ false);
    } while (ixStatus != IX_SUCCESS
	  && IX_OSAL_OEM_TIMESTAMP_GET() - start < duration);
    return ixStatus;
}
Exemplo n.º 2
0
PUBLIC UINT32
ixOsalTimestampGet (void)
{
#if CPU==SIMSPARCSOLARIS

    /*
     * no timestamp under VxSim 
     */
    ixOsalLog (IX_OSAL_LOG_LVL_ERROR,
        IX_OSAL_LOG_DEV_STDOUT,
        "ixOsalTimestampGet: not supported in simulation  \n",
        0, 0, 0, 0, 0, 0);
    return 0;

#else
    /*
     * Call OEM timestampGet 
     */
    return IX_OSAL_OEM_TIMESTAMP_GET ();

#endif
}
Exemplo n.º 3
0
/* TimeStamp is implemented in OEM */
PUBLIC UINT32
ixOsalTimestampGet (void)
{
    return IX_OSAL_OEM_TIMESTAMP_GET ();
}