#define staticfast static
-/* FIXME: need to add 64bit helper/struct magic for this compiler */
-typedef unsigned long time_t;
+typedef struct {
+ uint32_t low;
+ uint32_t high;
+} time_t;
/* We don't yet have bank attributes and banking for Z80 */
#define CODE1
#define staticfast auto
/* FIXME: should be 64bits - need to add helpers and struct variants */
-typedef unsigned long long time_t;
+typedef struct {
+ uint32_t low;
+ uint32_t high;
+} time_t;
#define cpu_to_le16(x) swab(x)
#define le16_to_cpu(x) swab(x)
#define staticfast static
-typedef unsigned long long time_t;
+/* Must match native ordering of long long */
+typedef struct {
+ uint32_t low;
+ uint32_t high;
+} time_t;
/* We don't yet have bank attributes and banking for Z80 */
#define CODE1
return NULL;
}
rdtime(&t);
- devfs->s_time = (uint32_t)t;
- devfs->s_timeh = (uint8_t)(t >> 32);
+ devfs->s_time = t.low;
+ devfs->s_timeh = t.high;
devfs->s_fmod = true;
((bufptr)devfs)->bf_dirty = true;
return devfs;
uget(buf, t, 2 * sizeof(time_t));
/* FIXME: needs updating once we pack top bits
elsewhere in the inode */
- ino->c_node.i_atime = t[0];
- ino->c_node.i_mtime = t[1];
+ ino->c_node.i_atime = t[0].low;
+ ino->c_node.i_mtime = t[1].low;
setftime(ino, C_TIME);
i_deref(ino);
return (0);
void rdtime32(uint32_t *tloc)
{
irqflags_t irq = di();
- *tloc = (uint32_t)tod;
+ *tloc = tod.low;
irqrestore(irq);
}
if (++tod_deci != 10)
return;
tod_deci = 0;
- tod++;
+ if (!++tod.low)
+ ++tod.high;
}
#endif /* NO_RTC */