phunix/minix/lib/liblwip/sys_arch.c
Lionel Sambuc 433d6423c3 New sources layout
Change-Id: Ic716f336b7071063997cf5b4dae6d50e0b4631e9
2014-07-31 16:00:30 +02:00

29 lines
412 B
C

#include <sys/types.h>
#include <minix/sysutil.h>
#include <errno.h>
u32_t sys_jiffies(void)
{
clock_t ticks;
if (getticks(&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();
/* use ticks not realtime as sys_now() is used to calculate timers */
jiffs = sys_jiffies();
return jiffs * (1000 / hz);
}