2 Copyright � 1995-2007, The AROS Development Team. All rights reserved.
3 $Id: writebattclock.c 26020 2007-05-07 19:49:07Z verhaegs $
8 #include "battclock_intern.h"
10 static int rtas_call(const char *method
, int nargs
, int nret
, void *output
, ...);
12 /*****************************************************************************
15 #include <proto/battclock.h>
16 #include <proto/utility.h>
17 #include <proto/rtas.h>
18 #include <proto/exec.h>
19 #include <utility/date.h>
22 AROS_LH1(void, WriteBattClock
,
25 AROS_LHA(ULONG
, time
, D0
),
28 APTR
*, BattClockBase
, 3, Battclock
)
31 Set the systems battery backed up clock to the time specified. The
32 value should be the number of seconds since 00:00:00 on 1.1.1978.
35 time - The number of seconds elapsed since 00:00:00 1.1.1978
38 The clock will be set.
41 This may not do anything on some systems where the battery backed
42 up clock either doesn't exist, or may not be writable.
49 ReadBattClock, ResetBattClock
54 27-11-96 digulla automatically created from
55 battclock_lib.fd and clib/battclock_protos.h
57 *****************************************************************************/
61 struct ClockData date
;
64 Amiga2Date(time
, &date
);
66 rtas_call("set-time-of-day", 7, 1, NULL
, (ULONG
)date
.year
, (ULONG
)date
.month
, (ULONG
)date
.mday
, (ULONG
)date
.hour
, (ULONG
)date
.min
, (ULONG
)date
.sec
, 0);
69 } /* WriteBattClock */
71 static int rtas_call(const char *method
, int nargs
, int nret
, void *output
, ...)
74 void *RTASBase
= OpenResource("rtas.resource");
77 va_start(args
, output
);
78 retval
= RTASCall(method
, nargs
, nret
, output
, args
);