/* Wait for one or more Signal Flags to become signaled for the current RUNNING thread.  */
os_InRegs osEvent_type svcSignalWait(int32_t signals, uint32_t millisec)
/* Wait for one or more Signal Flags to become signaled for the current RUNNING thread.  */
os_InRegs osEvent_type svcSignalWait(int32_t signals, uint32_t millisec)
{
    ret.status = osErrorValue;
    return osEvent_ret_status;
  }
  if (signals != 0) {
    res = rt_evt_wait(signals, rt_ms2tick(millisec), __TRUE);
  } else {
    res = rt_evt_wait(0xFFFF,  rt_ms2tick(millisec), __FALSE);
  }
  if (res == OS_R_EVT) {
    ret.status = osEventSignal;
    ret.value.signals = signals ? signals : os_tsk.run->waits;
  } else {
    ret.status = millisec ? osEventTimeout : osOK;
    ret.value.signals = 0;
  }
  return osEvent_ret_value;
}