Updates to includes for scsi & usbhardware.
[cake.git] / rom / timer / addtime.c
blob728fbf92417693f5bb4cf6c4b970e0eccdabb57e
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: AddTime() - add two timeval's together.
6 Lang: english
7 */
8 #include "timer_intern.h"
10 /*****************************************************************************
12 NAME */
13 #include <devices/timer.h>
14 #include <proto/timer.h>
16 AROS_LH2(void, AddTime,
18 /* SYNOPSIS */
19 AROS_LHA(struct timeval *, dest, A0),
20 AROS_LHA(struct timeval *, src, A1),
22 /* LOCATION */
23 struct Device *, TimerBase, 7, Timer)
25 /* FUNCTION
26 Add two timeval's together. The result will be the sum
27 dest + src --> dest.
29 The values of A0 and A1 will not be changed.
31 INPUTS
32 dest - Destination timeval.
33 src - Source timeval.
35 RESULT
36 dest will contain (src + dest).
38 NOTES
39 This function can be called from Interrupts.
41 EXAMPLE
43 BUGS
45 SEE ALSO
46 SubTime(), CmpTime()
48 INTERNALS
50 HISTORY
51 27-11-96 digulla automatically created from
52 timer_lib.fd and clib/timer_protos.h
54 *****************************************************************************/
56 AROS_LIBFUNC_INIT
58 dest->tv_micro += src->tv_micro;
59 dest->tv_secs += src->tv_secs;
61 /* Normalize the result. */
62 while(dest->tv_micro > 999999)
64 dest->tv_secs++;
65 dest->tv_micro -= 1000000;
68 AROS_LIBFUNC_EXIT
69 } /* AddTime */