extern uint16_t runticks; /* Number of ticks current process has been swapped in */
extern time_t tod; /* Time of day */
-extern clock_t ticks; /* 32-bit count of ticks since boot */
-extern uint16_t miniticks; /* 16-bit count of ticks since boot */
+
+typedef union { /* this structure is endian dependent */
+ clock_t full; /* 32-bit count of ticks since boot */
+ uint16_t mini; /* 16-bit count of ticks since boot */
+} ticks_t;
+extern ticks_t ticks;
extern uint8_t *swapbase; /* Used by device driver for swapping */
extern unsigned swapcnt;
inoptr root;
uint16_t waitno;
time_t tod; // time of day
-clock_t ticks; // 32-bit system tick counter
-uint16_t miniticks; // 16-bit system tick counter
+ticks_t ticks;
int16_t acct_fh = -1; /* Accounting file handle */
else
udata.u_utime++;
}
- ticks++;
- miniticks++;
+
+ ticks.full++;
/* Do once-per-decisecond things - this doesn't work out well on
boxes with 64 ticks/second.. need a better approach */
uput(&t, tvec, sizeof(t));
return (0);
case 1:
- uput(&t.low, &ticks, sizeof(ticks));
+ uput(&t.low, &ticks.full, sizeof(ticks));
uzero(&t.high, sizeof(t.high));
return 0;
default:
}
/* obvious code is return (miniticks+duration), however we have to do */
/* it this longwinded way or sdcc doesn't load miniticks atomically */
- a = miniticks;
+ a = ticks.mini;
a += duration;
return a;
}
bool timer_expired(timer_t timer_val)
{
- return ((timer_val - miniticks) & 0x8000);
+ return ((timer_val - ticks.mini) & 0x8000);
}
/*-----------------------------------------------------------*/