Restored work-around for hangs when trying to use disk-based handlers
[tangerine.git] / arch / i386-pc / timer / readeclock.c
blob97c3c70c7283fa4a84b3b35fdf45ec1f695ced93
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 <devices/timer.h>
13 #include <proto/timer.h>
14 #include <proto/exec.h>
16 #include "ticks.h"
18 AROS_LH1(ULONG, ReadEClock,
20 /* SYNOPSIS */
21 AROS_LHA(struct EClockVal *, dest, A0),
23 /* LOCATION */
24 struct TimerBase *, TimerBase, 10, Timer)
26 /* FUNCTION
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
30 system.
32 This call is supposed to be very fast.
33 INPUTS
34 dest - Destination EClockVal
36 RESULT
37 The EClock frequency (tics/s)
39 NOTES
40 This function is safe to call from interrupts.
42 EXAMPLE
44 BUGS
46 SEE ALSO
48 INTERNALS
50 HISTORY
51 19-08-2005 schulz Implemented.
53 *****************************************************************************/
55 AROS_LIBFUNC_INIT
57 EClockUpdate(TimerBase);
58 Disable();
59 dest->ev_hi = (ULONG)(TimerBase->tb_ticks_total >> 32);
60 dest->ev_lo = (ULONG)(TimerBase->tb_ticks_total & 0xffffffff);
61 Enable();
62 return 1193180;
64 AROS_LIBFUNC_EXIT
65 } /* CmpTime */