2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id: readeclock.c 12532 2001-10-27 19:46:10Z chodorowski $
5 Desc: ReadEClock() - read the base frequency of timers.
9 /*****************************************************************************
12 #include <devices/timer.h>
13 #include <proto/timer.h>
14 #include <proto/exec.h>
18 AROS_LH1(ULONG
, ReadEClock
,
21 AROS_LHA(struct EClockVal
*, dest
, A0
),
24 struct TimerBase
*, TimerBase
, 10, Timer
)
27 ReadEClock() reads current value of E-Clock and stores
28 it in the destination EClockVal structure passed as
29 argument. It also returns the frequency of EClock of the
32 This call is supposed to be very fast.
34 dest - Destination EClockVal
37 The EClock frequency (tics/s)
40 This function is safe to call from interrupts.
51 19-08-2005 schulz Implemented.
53 *****************************************************************************/
56 AROS_LIBBASE_EXT_DECL(struct TimerBase
*,TimerBase
)
58 EClockUpdate(TimerBase
);
60 dest
->ev_hi
= (ULONG
)(TimerBase
->tb_ticks_total
>> 32);
61 dest
->ev_lo
= (ULONG
)(TimerBase
->tb_ticks_total
& 0xffffffff);