2 Copyright © 1995-2011, 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 *****************************************************************************/
60 EClockUpdate(TimerBase
);
61 dest
->ev_hi
= (ULONG
)(TimerBase
->tb_ticks_total
>> 32);
62 dest
->ev_lo
= (ULONG
)(TimerBase
->tb_ticks_total
& 0xffffffff);
66 /* We could use SysBase->ex_EClockFrequency here, but we avoid it for
67 the case if some dumb head attempts to change it */
68 return TimerBase
->tb_eclock_rate
;