Removed autodocs of arch specific variants of ROM modules.
[AROS.git] / arch / m68k-amiga / timer / readeclock.c
blob94c26bb443f1373327e4a2cf310d15b74d58e78c
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: ReadEClock() - read the base frequency of timers.
6 Lang: english
7 */
9 #include <devices/timer.h>
10 #include <proto/timer.h>
11 #include <proto/exec.h>
13 #include <timer_intern.h>
15 /* See rom/timer/readeclock.c for documentation */
17 AROS_LH1(ULONG, ReadEClock,
18 AROS_LHA(struct EClockVal *, dest, A0),
19 struct TimerBase *, TimerBase, 10, Timer)
21 AROS_LIBFUNC_INIT
23 ULONG eclock, old;
25 Disable();
26 old = dest->ev_lo = TimerBase->tb_eclock.ev_lo;
27 dest->ev_hi = TimerBase->tb_eclock.ev_hi;
28 eclock = GetEClock(TimerBase);
29 Enable();
30 dest->ev_lo += eclock;
31 if (old > dest->ev_lo)
32 dest->ev_hi++;
33 return TimerBase->tb_eclock_rate;
35 AROS_LIBFUNC_EXIT
36 } /* CmpTime */