xref: /reactos/hal/halarm/generic/rtc.c (revision 34593d93)
1 /*
2  * PROJECT:         ReactOS HAL
3  * LICENSE:         BSD - See COPYING.ARM in the top level directory
4  * FILE:            hal/halarm/generic/rtc.c
5  * PURPOSE:         Real Time Clock and Environment Variable Support
6  * PROGRAMMERS:     ReactOS Portable Systems Group
7  */
8 
9 /* INCLUDES *******************************************************************/
10 
11 #include <hal.h>
12 #define NDEBUG
13 #include <debug.h>
14 
15 /* FUNCTIONS ******************************************************************/
16 
17 #define RTC_DATA   (PVOID)0x101E8000
18 
19 /*
20  * @implemented
21  */
22 BOOLEAN
23 NTAPI
HalQueryRealTimeClock(IN PTIME_FIELDS Time)24 HalQueryRealTimeClock(IN PTIME_FIELDS Time)
25 {
26     LARGE_INTEGER LargeTime;
27     ULONG Seconds;
28 
29     /* Query the RTC value */
30     Seconds = READ_REGISTER_ULONG(RTC_DATA);
31 
32     /* Convert to time */
33     RtlSecondsSince1970ToTime(Seconds, &LargeTime);
34 
35     /* Convert to time-fields */
36     RtlTimeToTimeFields(&LargeTime, Time);
37     return TRUE;
38 }
39 
40 /*
41  * @unimplemented
42  */
43 BOOLEAN
44 NTAPI
HalSetRealTimeClock(IN PTIME_FIELDS Time)45 HalSetRealTimeClock(IN PTIME_FIELDS Time)
46 {
47     UNIMPLEMENTED;
48     while (TRUE);
49     return TRUE;
50 }
51 
52 /*
53  * @unimplemented
54  */
55 ARC_STATUS
56 NTAPI
HalSetEnvironmentVariable(IN PCH Name,IN PCH Value)57 HalSetEnvironmentVariable(IN PCH Name,
58                           IN PCH Value)
59 {
60     UNIMPLEMENTED;
61     while (TRUE);
62     return ESUCCESS;
63 }
64 
65 /*
66  * @unimplemented
67  */
68 ARC_STATUS
69 NTAPI
HalGetEnvironmentVariable(IN PCH Name,IN USHORT ValueLength,IN PCH Value)70 HalGetEnvironmentVariable(IN PCH Name,
71                           IN USHORT ValueLength,
72                           IN PCH Value)
73 {
74     UNIMPLEMENTED;
75     while (TRUE);
76     return ENOENT;
77 }
78 
79 /* EOF */
80