mirror of
https://github.com/simh/simh.git
synced 2026-01-26 04:01:38 +00:00
SCP: Remove legacy support for OS2 and MetroWerks on Macintosh OS 9
This commit is contained in:
86
sim_timer.c
86
sim_timer.c
@@ -552,92 +552,6 @@ return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#elif defined (__OS2__)
|
||||
|
||||
/* OS/2 routines, from Bruce Ray */
|
||||
|
||||
const t_bool rtc_avail = FALSE;
|
||||
|
||||
static uint32 _sim_os_msec (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sim_os_sleep (unsigned int sec)
|
||||
{
|
||||
}
|
||||
|
||||
uint32 sim_os_ms_sleep_init (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32 sim_os_ms_sleep (unsigned int msec)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Metrowerks CodeWarrior Macintosh routines, from Ben Supnik */
|
||||
|
||||
#elif defined (__MWERKS__) && defined (macintosh)
|
||||
|
||||
#include <Timer.h>
|
||||
#include <Mactypes.h>
|
||||
#include <sioux.h>
|
||||
#include <unistd.h>
|
||||
#include <siouxglobals.h>
|
||||
#define NANOS_PER_MILLI 1000000
|
||||
#define MILLIS_PER_SEC 1000
|
||||
|
||||
const t_bool rtc_avail = TRUE;
|
||||
|
||||
static uint32 _sim_os_msec (void)
|
||||
{
|
||||
unsigned long long micros;
|
||||
UnsignedWide macMicros;
|
||||
unsigned long millis;
|
||||
|
||||
Microseconds (&macMicros);
|
||||
micros = *((unsigned long long *) &macMicros);
|
||||
millis = micros / 1000LL;
|
||||
return (uint32) millis;
|
||||
}
|
||||
|
||||
void sim_os_sleep (unsigned int sec)
|
||||
{
|
||||
sleep (sec);
|
||||
}
|
||||
|
||||
uint32 sim_os_ms_sleep_init (void)
|
||||
{
|
||||
return _compute_minimum_sleep ();
|
||||
}
|
||||
|
||||
uint32 sim_os_ms_sleep (unsigned int milliseconds)
|
||||
{
|
||||
uint32 stime = sim_os_msec ();
|
||||
struct timespec treq;
|
||||
|
||||
treq.tv_sec = milliseconds / MILLIS_PER_SEC;
|
||||
treq.tv_nsec = (milliseconds % MILLIS_PER_SEC) * NANOS_PER_MILLI;
|
||||
(void) nanosleep (&treq, NULL);
|
||||
return sim_os_msec () - stime;
|
||||
}
|
||||
|
||||
#if defined(NEED_CLOCK_GETTIME)
|
||||
int clock_gettime(int clk_id, struct timespec *tp)
|
||||
{
|
||||
struct timeval cur;
|
||||
|
||||
if (clk_id != CLOCK_REALTIME)
|
||||
return -1;
|
||||
gettimeofday (&cur, NULL);
|
||||
tp->tv_sec = cur.tv_sec;
|
||||
tp->tv_nsec = cur.tv_usec*1000;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
/* UNIX routines */
|
||||
|
||||
Reference in New Issue
Block a user