Re-enabled use of AROS.Boot file due to lack of general enthusiasm for
[tangerine.git] / arch / all-mingw32 / timer / readeclock.c
blob16050e91257a8b5b58b83d778f570d91363b7c1e
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: ReadEClock() - read the base frequency of timers.
6 Lang: english
7 */
9 /*****************************************************************************
11 NAME */
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,
21 /* SYNOPSIS */
22 AROS_LHA(struct EClockVal *, dest, A0),
24 /* LOCATION */
25 struct TimerBase *, TimerBase, 10, Timer)
27 /* FUNCTION
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
31 system.
33 This call is supposed to be very fast.
34 INPUTS
35 dest - Destination EClockVal
37 RESULT
38 The EClock frequency (tics/s)
40 NOTES
41 This function is safe to call from interrupts.
43 EXAMPLE
45 BUGS
47 SEE ALSO
49 INTERNALS
51 HISTORY
52 19-08-2005 schulz Implemented.
54 *****************************************************************************/
56 AROS_LIBFUNC_INIT
58 Disable();
59 dest->ev_hi = (ULONG)(TimerBase->tb_ticks_total >> 32);
60 dest->ev_lo = (ULONG)(TimerBase->tb_ticks_total & 0xffffffff);
61 Enable();
63 /* TODO: currently we have only VBlank, we should have separate EClock */
64 return (SysBase->VBlankFrequency);
66 AROS_LIBFUNC_EXIT
67 } /* CmpTime */