/* Get the time offset from the system PIT. Note that if we have missed an interrupt, then the PIT counter will roll over (ie, be negative). This actually works out to be convenient.  */
static unsigned long ebsa110_gettimeoffset(void)
/* Get the time offset from the system PIT. Note that if we have missed an interrupt, then the PIT counter will roll over (ie, be negative). This actually works out to be convenient.  */
static unsigned long ebsa110_gettimeoffset(void)
{
	unsigned long offset, count;
	__raw_writeb(0x40, PIT_CTRL);
	count = __raw_readb(PIT_T1);
	count |= __raw_readb(PIT_T1) << 8;
	if (count > COUNT)
		count |= 0xffff0000;
	offset = COUNT;
	offset -= count;
	offset = offset * (1000000 / HZ) / COUNT;
	return offset;
}