521d7f566966c632e7b0844f6c2625908ac9dbcd
[AROS.git] / arch / ppc-chrp / efika / timer / getsystime.c
blob521d7f566966c632e7b0844f6c2625908ac9dbcd
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: GetSysTime() - Find out what time it is.
6 Lang: english
7 */
8 #include "lowlevel.h"
9 #include <proto/exec.h>
11 /*****************************************************************************
13 NAME */
14 #include <devices/timer.h>
15 #include <proto/timer.h>
17 AROS_LH1(void, GetSysTime,
19 /* SYNOPSIS */
20 AROS_LHA(struct timeval *, dest, A0),
22 /* LOCATION */
23 struct Device *, TimerBase, 11, Timer)
25 /* FUNCTION
26 GetSysTime() will fill in the supplied timeval with the current
27 system time.
29 INPUTS
30 dest - A pointer to the timeval you want the time stored in.
32 RESULT
33 The timeval "dest" will be filled with the current system time.
35 NOTES
36 This function is safe to call from interrupts.
38 EXAMPLE
40 BUGS
42 SEE ALSO
43 TR_GETSYSTIME, TR_SETSYSTIME
45 INTERNALS
47 HISTORY
48 18-02-1997 iaint Implemented.
50 *****************************************************************************/
52 AROS_LIBFUNC_INIT
54 struct TimerBase *timerBase = (struct TimerBase *)TimerBase;
56 Disable();
57 EClockUpdate(TimerBase);
58 dest->tv_secs = timerBase->tb_CurrentTime.tv_secs;
59 dest->tv_micro = timerBase->tb_CurrentTime.tv_micro;
60 Enable();
62 AROS_LIBFUNC_EXIT
63 } /* GetSysTime */