--- uae/src/md-i386-gcc/support.c 2018/04/24 16:40:31 1.1.1.2 +++ uae/src/md-i386-gcc/support.c 2018/04/24 16:42:54 1.1.1.3 @@ -13,6 +13,7 @@ #include "config.h" #include "options.h" #include "machdep/m68k.h" +#include "events.h" #ifndef USE_UNDERSCORE #define LARGE_ALIGNMENT ".align 16\n" @@ -211,7 +212,8 @@ int memcmpy(void *foo, const void *bar, return differs; } -#ifdef HAVE_RDTSC +/* All the Win32 configurations handle this in od-win32/win32.c */ +#ifndef _WIN32 #include @@ -235,10 +237,27 @@ static RETSIGTYPE alarmhandler(int foo) } } +#ifdef __cplusplus +static RETSIGTYPE illhandler(...) +#else +static RETSIGTYPE illhandler(int foo) +#endif +{ + rpt_available = 0; +} + void machdep_init (void) { - fprintf(stderr, "Calibrating delay loop.. "); - fflush(stderr); + rpt_available = 1; + signal (SIGILL, illhandler); + read_processor_time (); + signal (SIGILL, SIG_DFL); + if (! rpt_available) { + fprintf (stderr, "Your processor does not support the RDTSC instruction.\n"); + return; + } + fprintf (stderr, "Calibrating delay loop.. "); + fflush (stderr); best_time = (frame_time_t)-1; loops_to_go = 5; signal (SIGALRM, alarmhandler); @@ -247,16 +266,10 @@ void machdep_init (void) last_time = read_processor_time(); alarm (1); while (loops_to_go != 0) - usleep(1000000); + usleep (1000000); fprintf (stderr, "ok - %.2f BogoMIPS\n", ((double)best_time / 1000000), best_time); vsynctime = best_time / 50; } -#else - -void machdep_init (void) -{ -} - #endif