2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: ReadEClock() - read the base frequency of timers.
9 /*****************************************************************************
12 #include <exec/execbase.h>
13 #include <devices/timer.h>
14 #include <proto/timer.h>
15 #include <proto/exec.h>
17 #include "timer_intern.h"
19 AROS_LH1(ULONG
, ReadEClock
,
22 AROS_LHA(struct EClockVal
*, dest
, A0
),
25 struct TimerBase
*, TimerBase
, 10, Timer
)
28 ReadEClock() reads current value of E-Clock and stores
29 it in the destination EClockVal structure passed as
30 argument. It also returns the frequency of EClock of the
33 This call is supposed to be very fast.
35 dest - Destination EClockVal
38 The EClock frequency (tics/s)
41 This function is safe to call from interrupts.
52 19-08-2005 schulz Implemented.
54 *****************************************************************************/
59 dest
->ev_hi
= (ULONG
)(TimerBase
->tb_ticks_total
>> 32);
60 dest
->ev_lo
= (ULONG
)(TimerBase
->tb_ticks_total
& 0xffffffff);
63 /* TODO: currently we have only VBlank, we should have separate EClock */
64 return (SysBase
->VBlankFrequency
);