1 #ifndef _TIMER_INTERN_H
2 #define _TIMER_INTERN_H
5 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
8 Desc: Internal information about the timer.device and HIDD's
13 #include <exec/types.h>
16 #include <exec/lists.h>
18 #ifndef EXEC_INTERRUPTS_H
19 #include <exec/interrupts.h>
24 #ifndef EXEC_DEVICES_H
25 #include <exec/devices.h>
27 #ifndef DEVICES_TIMER_H
28 #include <devices/timer.h>
33 #define ECLOCK_BASE 0x10000
37 /* Required by the system */
38 struct Device tb_Device
;
40 struct timeval tb_CurrentTime
; /* system time */
41 struct timeval tb_lastsystime
;
43 struct MinList tb_Lists
[NUM_LISTS
];
45 struct Resource
*tb_cia
[2];
47 struct Resource
*tb_eclock_res
;
48 volatile struct CIA
*tb_eclock_cia
;
49 volatile UBYTE
*tb_eclock_cr
, *tb_eclock_lo
, *tb_eclock_hi
;
50 struct Interrupt tb_ciaint_eclock
;
51 UWORD tb_eclock_intbit
;
52 struct EClockVal tb_eclock
;
54 ULONG tb_eclock_to_usec
;
56 struct Resource
*tb_micro_res
;
57 volatile struct CIA
*tb_micro_cia
;
58 volatile UBYTE
*tb_micro_cr
, *tb_micro_lo
, *tb_micro_hi
;
59 struct Interrupt tb_ciaint_timer
;
60 UWORD tb_micro_intbit
;
61 ULONG tb_micro_started
;
62 struct timeval tb_micro_count
;
63 ULONG tb_micro_micros
;
66 struct Interrupt tb_vbint
;
67 struct timeval tb_vb_count
;
69 UWORD tb_vblank_micros
;
72 ULONG tb_eclock_micro_mult
;
73 UWORD tb_micro_eclock_mult
;
74 ULONG lastsystimetweak
;
77 ULONG
GetEClock(struct TimerBase
*TimerBase
);
78 void CheckTimer(struct TimerBase
*TimerBase
, UWORD unitnum
);
79 void addmicro(struct TimerBase
*TimerBase
, struct timeval
*tv
);
80 BOOL
cmp64(struct timeval
*tv1
, struct timeval
*tv2
);
81 ULONG
sub64(struct timeval
*larger
, struct timeval
*smaller
);
82 void add64(struct timeval
*dst
, struct timeval
*src
);
83 void inc64(struct timeval
*dst
);
84 BOOL
equ64(struct timeval
*tv1
, struct timeval
*tv2
);
85 void convertunits(struct TimerBase
*TimerBase
, struct timeval
*tr
, int unit
);
87 #endif /* _TIMER_INTERN_H */