1 #ifndef _TIMER_INTERN_H
2 #define _TIMER_INTERN_H
5 Copyright © 1995-2018, 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_Elapsed
;
42 struct timeval tb_lastsystime
;
44 struct MinList tb_Lists
[NUM_LISTS
];
46 struct Resource
*tb_cia
[2];
48 struct Resource
*tb_eclock_res
;
49 volatile struct CIA
*tb_eclock_cia
;
50 volatile UBYTE
*tb_eclock_cr
, *tb_eclock_lo
, *tb_eclock_hi
;
51 struct Interrupt tb_ciaint_eclock
;
52 UWORD tb_eclock_intbit
;
53 struct EClockVal tb_eclock
;
55 ULONG tb_eclock_to_usec
;
57 struct Resource
*tb_micro_res
;
58 volatile struct CIA
*tb_micro_cia
;
59 volatile UBYTE
*tb_micro_cr
, *tb_micro_lo
, *tb_micro_hi
;
60 struct Interrupt tb_ciaint_timer
;
61 UWORD tb_micro_intbit
;
62 ULONG tb_micro_started
;
63 struct timeval tb_micro_count
;
64 ULONG tb_micro_micros
;
67 struct Interrupt tb_vbint
;
68 struct timeval tb_vb_count
;
70 UWORD tb_vblank_micros
;
73 ULONG tb_eclock_micro_mult
;
74 UWORD tb_micro_eclock_mult
;
75 ULONG lastsystimetweak
;
78 ULONG
GetEClock(struct TimerBase
*TimerBase
);
79 void CheckTimer(struct TimerBase
*TimerBase
, UWORD unitnum
);
80 void addmicro(struct TimerBase
*TimerBase
, struct timeval
*tv
);
81 BOOL
cmp64(struct timeval
*tv1
, struct timeval
*tv2
);
82 ULONG
sub64(struct timeval
*larger
, struct timeval
*smaller
);
83 void add64(struct timeval
*dst
, struct timeval
*src
);
84 void inc64(struct timeval
*dst
);
85 BOOL
equ64(struct timeval
*tv1
, struct timeval
*tv2
);
86 void convertunits(struct TimerBase
*TimerBase
, struct timeval
*tr
, int unit
);
88 #endif /* _TIMER_INTERN_H */