2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
7 #include <aros/debug.h>
9 #include <aros/symbolsets.h>
10 #include <proto/acpica.h>
11 #include <proto/exec.h>
13 #include "battclock_intern.h"
16 /* acpica.library is optional */
17 struct Library
*ACPICABase
= NULL
;
20 static int BattClock_Init(struct BattClockBase
*BattClockBase
)
22 InitSemaphore(&BattClockBase
->sem
);
23 BattClockBase
->century
= CENTURY
; /* Default offset */
25 if ((ACPICABase
= OpenLibrary("acpica.library",0)))
27 ACPI_TABLE_FADT
*fadt
;
30 err
= AcpiGetTable("FACP", 1, (ACPI_TABLE_HEADER
**)&fadt
);
32 if ((fadt
->Header
.Length
>= offsetof(ACPI_TABLE_FADT
, Century
)) &&
35 D(bug("[BattClock] Got RTC century offset 0x%02X from ACPI\n", fadt
->Century
));
36 BattClockBase
->century
= fadt
->Century
;
39 CloseLibrary(ACPICABase
);
46 ADD2INITLIB(BattClock_Init
, 0)