/* TBI: get time offset between scheduling timer ticks  */
unsigned long mac_gettimeoffset(void)
/* TBI: get time offset between scheduling timer ticks  */
unsigned long mac_gettimeoffset(void)
{
	unsigned long ticks, offset = 0;
	ticks = via1[vT1CL] | (via1[vT1CH] << 8);
	if (ticks > MAC_CLOCK_TICK - MAC_CLOCK_TICK / 50)
		if (via1[vIFR] & 0x40) offset = TICK_SIZE;
	ticks = MAC_CLOCK_TICK - ticks;
	ticks = ticks * 10000L / MAC_CLOCK_TICK;
	return ticks + offset;
}