Replace some references to sys_timer_usleep

This commit is contained in:
twinaphex 2015-08-29 15:24:23 +02:00
parent 3824812ac9
commit 5caf0627f8
2 changed files with 8 additions and 21 deletions

View File

@ -46,6 +46,7 @@
#define NETWORK_COMPAT_HEADERS 1 #define NETWORK_COMPAT_HEADERS 1
#endif #endif
#ifdef NETWORK_COMPAT_HEADERS #ifdef NETWORK_COMPAT_HEADERS
#include <sys/socket.h> #include <sys/socket.h>
#include <netdb.h> #include <netdb.h>
@ -71,6 +72,7 @@
#include <compat/strl.h> #include <compat/strl.h>
#include <retro_inline.h> #include <retro_inline.h>
#include <retro_miscellaneous.h>
/* /*
**************************************************************************** ****************************************************************************
@ -748,22 +750,7 @@ static int64_t rsnd_get_time_usec(void)
static void rsnd_sleep(int msec) static void rsnd_sleep(int msec)
{ {
#if defined(__CELLOS_LV2__) && !defined(__PSL1GHT__) rarch_sleep(msec);
sys_timer_usleep(1000 * msec);
#elif defined(PSP)
sceKernelDelayThread(1000 * msec);
#elif defined(_WIN32)
Sleep(msec);
#elif defined(XENON)
udelay(1000 * msec);
#elif defined(GEKKO) || defined(__PSL1GHT__) || defined(__QNX__)
usleep(1000 * msec);
#else
struct timespec tv = {0};
tv.tv_sec = msec / 1000;
tv.tv_nsec = (msec % 1000) * 1000000;
nanosleep(&tv, NULL);
#endif
} }

View File

@ -34,6 +34,8 @@
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
#include <retro_miscellaneous.h>
#ifndef GEKKO #ifndef GEKKO
#include <net/net_compat.h> #include <net/net_compat.h>
#endif #endif
@ -92,7 +94,7 @@ static int if_up_with(int index)
if (state == CELL_NET_CTL_STATE_IPObtained) if (state == CELL_NET_CTL_STATE_IPObtained)
break; break;
sys_timer_usleep(500 * 1000); rarch_sleep(500);
timeout_count--; timeout_count--;
if (index && timeout_count < 0) if (index && timeout_count < 0)
{ {
@ -103,9 +105,7 @@ static int if_up_with(int index)
#elif defined(GEKKO) #elif defined(GEKKO)
char t[16]; char t[16];
if (if_config(t, NULL, NULL, TRUE) < 0) if (if_config(t, NULL, NULL, TRUE) < 0)
{
return -1; return -1;
}
#endif #endif
sock=socket(AF_INET, SOCK_DGRAM, 0); sock=socket(AF_INET, SOCK_DGRAM, 0);