minix/lib/liblwip/sys_arch.c
Tomas Hruby abab24b785 LWIP - liblwip
lwip-1.4.0-rc1 imported as liblwip
2011-04-07 07:43:36 +00:00

27 lines
344 B
C

#include <minix/types.h>
#include <minix/sysutil.h>
#include <errno.h>
u32_t sys_jiffies(void)
{
clock_t ticks;
if (getuptime(&ticks) == OK)
return ticks;
else
panic("getuptime() failed\n");
}
u32_t sys_now(void)
{
static u32_t hz;
u32_t jiffs;
if (!hz)
hz = sys_hz();
jiffs = sys_jiffies();
return jiffs * (1000 / hz);
}