diff --git a/clib/clib_sys.c b/clib/clib_sys.c index 29aeddb..bd336c1 100644 --- a/clib/clib_sys.c +++ b/clib/clib_sys.c @@ -16,6 +16,13 @@ * */ #include "clib_sys.h" +#ifdef __POSIX_UEFI__ +# include +#elif defined(_WIN32) +# include +#elif defined(__GNUC__) && !defined(__POSIX_UEFI__) +# include +#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. */ diff --git a/clib/clib_sys.h b/clib/clib_sys.h index bd25ccd..3a3402b 100644 --- a/clib/clib_sys.h +++ b/clib/clib_sys.h @@ -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);