Class does not implement OM_SET method.
[tangerine.git] / arch / i386-pc / timer / readeclock.c
blobba5fd3fc82bdd2db12d9c70f5821e7b402f56c34
1 /*
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.
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
56 AROS_LIBBASE_EXT_DECL(struct TimerBase *,TimerBase)
58 EClockUpdate(TimerBase);
59 Disable();
60 dest->ev_hi = (ULONG)(TimerBase->tb_ticks_total >> 32);
61 dest->ev_lo = (ULONG)(TimerBase->tb_ticks_total & 0xffffffff);
62 Enable();
63 return 1193180;
65 AROS_LIBFUNC_EXIT
66 } /* CmpTime */