ReactOS  0.4.15-dev-1203-g0e5a4d5
rtc.c
Go to the documentation of this file.
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
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
46 {
48  while (TRUE);
49  return TRUE;
50 }
51 
52 /*
53  * @unimplemented
54  */
56 NTAPI
58  IN PCH Value)
59 {
61  while (TRUE);
62  return ESUCCESS;
63 }
64 
65 /*
66  * @unimplemented
67  */
69 NTAPI
72  IN PCH Value)
73 {
75  while (TRUE);
76  return ENOENT;
77 }
78 
79 /* EOF */
#define IN
Definition: typedefs.h:39
BOOLEAN NTAPI HalQueryRealTimeClock(IN PTIME_FIELDS Time)
Definition: rtc.c:24
Definition: arc.h:32
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlSecondsSince1970ToTime(_In_ ULONG SecondsSince1970, _Out_ PLARGE_INTEGER Time)
ULONG ARC_STATUS
Definition: arc.h:4
ARC_STATUS NTAPI HalGetEnvironmentVariable(IN PCH Name, IN USHORT ValueLength, IN PCH Value)
Definition: rtc.c:70
NTKERNELAPI ULONG NTAPI READ_REGISTER_ULONG(IN PULONG Register)
#define RTC_DATA
Definition: rtc.c:17
IN UCHAR Value
Definition: halp.h:394
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
CHAR * PCH
Definition: ntbasedef.h:392
unsigned char BOOLEAN
BOOLEAN RtlTimeToTimeFields(IN PLARGE_INTEGER Time, IN PTIME_FIELDS TimeFields)
_In_ GUID _In_ PVOID _In_ ULONG ValueLength
Definition: hubbusif.h:311
ARC_STATUS NTAPI HalSetEnvironmentVariable(IN PCH Name, IN PCH Value)
Definition: rtc.c:57
unsigned short USHORT
Definition: pedump.c:61
Definition: arc.h:46
unsigned int ULONG
Definition: retypes.h:1
#define UNIMPLEMENTED
Definition: debug.h:115
static PLARGE_INTEGER Time
Definition: time.c:105
BOOLEAN NTAPI HalSetRealTimeClock(IN PTIME_FIELDS Time)
Definition: rtc.c:45