mirror of
https://github.com/86Box/probing-tools.git
synced 2026-02-24 20:35:34 -07:00
clib: Add platform-specific replacements for the Watcom delay function
This commit is contained in:
@@ -16,6 +16,13 @@
|
||||
*
|
||||
*/
|
||||
#include "clib_sys.h"
|
||||
#ifdef __POSIX_UEFI__
|
||||
# include <uefi.h>
|
||||
#elif defined(_WIN32)
|
||||
# include <windows.h>
|
||||
#elif defined(__GNUC__) && !defined(__POSIX_UEFI__)
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
/* Interrupt functions. */
|
||||
#ifdef __WATCOMC__
|
||||
@@ -44,6 +51,19 @@ sti()
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Time functions. */
|
||||
#ifndef __WATCOMC__
|
||||
void
|
||||
delay(unsigned int ms)
|
||||
{
|
||||
# ifdef _WIN32
|
||||
Sleep(ms);
|
||||
# else
|
||||
usleep(ms * 1000);
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Port I/O functions. */
|
||||
#ifdef __WATCOMC__
|
||||
/* Defined in header. */
|
||||
|
||||
@@ -30,6 +30,11 @@ extern void cli();
|
||||
extern void sti();
|
||||
#endif
|
||||
|
||||
/* Time functions. */
|
||||
#ifndef __WATCOMC__
|
||||
extern void delay(unsigned int ms);
|
||||
#endif
|
||||
|
||||
/* Port I/O functions. */
|
||||
#ifdef __WATCOMC__
|
||||
uint8_t inb(uint16_t port);
|
||||
|
||||
Reference in New Issue
Block a user