1 #ifndef _TIMER_INTERN_H
2 #define _TIMER_INTERN_H
5 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
8 Desc: Internal information about the timer.device and HIDD's
12 #include <exec/execbase.h>
13 #include <exec/lists.h>
14 #include <exec/interrupts.h>
16 #include <exec/devices.h>
17 #include <exec/interrupts.h>
18 #include <devices/timer.h>
20 #include <hardware/intbits.h>
21 #include <aros/asmcall.h>
23 /* Platform-specific portion */
24 #include <timer_platform.h>
27 * First two of these correspond to UNIT_MICROHZ and UNIT_VBLANK.
37 /* Required by the system */
38 struct Device tb_Device
; /* Our base */
39 APTR tb_KernelBase
; /* kernel.resource base */
42 struct timeval tb_CurrentTime
; /* Absolute system time. Can be set by TR_SETSYSTIME. */
43 struct timeval tb_Elapsed
; /* Relative system time. Used for measuring intervals. */
45 /* This is required for hardware-specific code */
46 APTR tb_TimerIRQHandle
; /* Timer IRQ handle */
47 struct Interrupt tb_VBlankInt
; /* Used by older implementations, needs to be removed */
50 struct MinList tb_Lists
[NUM_LISTS
];
53 UQUAD tb_ticks_total
; /* Effective EClock value */
54 ULONG tb_ticks_sec
; /* Fraction of second for CurrentTime in ticks */
55 ULONG tb_ticks_elapsed
; /* Fraction of second for Elapsed in ticks */
56 ULONG tb_prev_tick
; /* Hardware-specific */
57 ULONG tb_eclock_rate
; /* EClock frequency */
60 struct timerequest tb_vblank_timerequest
; /* VBlank emulation request */
63 struct PlatformTimer tb_Platform
; /* Platform-specific data */
66 #define GetTimerBase(tb) ((struct TimerBase *)(tb))
67 #define GetDevice(tb) ((struct Device *)(tb))
69 BOOL
common_BeginIO(struct timerequest
*timereq
, struct TimerBase
*TimerBase
);
70 void handleMicroHZ(struct TimerBase
*TimerBase
, struct ExecBase
*SysBase
);
71 void handleVBlank(struct TimerBase
*TimerBase
, struct ExecBase
*SysBase
);
72 void EClockUpdate(struct TimerBase
*TimerBase
);
73 void EClockSet(struct TimerBase
*TimerBase
);
75 /* Call exec VBlank vector, if present */
76 static inline void vblank_Cause(struct ExecBase
*SysBase
)
78 struct IntVector
*iv
= &SysBase
->IntVects
[INTB_VERTB
];
81 AROS_INTC2(iv
->iv_Code
, iv
->iv_Data
, INTF_VERTB
);
84 #endif /* _TIMER_INTERN_H */