2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <aros/debug.h>
7 #include <aros/symbolsets.h>
8 #include <proto/acpica.h>
9 #include <proto/exec.h>
11 #include "battclock_intern.h"
14 /* acpica.library is optional */
15 struct Library
*ACPICABase
= NULL
;
18 static int BattClock_Init(struct BattClockBase
*BattClockBase
)
20 InitSemaphore(&BattClockBase
->sem
);
21 BattClockBase
->century
= CENTURY
; /* Default offset */
23 if ((ACPICABase
= OpenLibrary("acpica.library",0)))
25 ACPI_TABLE_FADT
*fadt
;
28 err
= AcpiGetTable("FACP", 1, (ACPI_TABLE_HEADER
**)&fadt
);
30 if ((fadt
->Header
.Length
>= offsetof(ACPI_TABLE_FADT
, Century
)) &&
33 D(bug("[BattClock] Got RTC century offset 0x%02X from ACPI\n", fadt
->Century
));
34 BattClockBase
->century
= fadt
->Century
;
37 CloseLibrary(ACPICABase
);
44 ADD2INITLIB(BattClock_Init
, 0)