1 #include <aros/debug.h>
2 #include <aros/symbolsets.h>
3 #include <proto/acpica.h>
4 #include <proto/exec.h>
6 #include "battclock_intern.h"
10 static int BattClock_Init(struct BattClockBase
*BattClockBase
)
12 struct Library
*ACPICABase
;
13 InitSemaphore(&BattClockBase
->sem
);
14 BattClockBase
->century
= CENTURY
; /* Default offset */
16 if ((ACPICABase
= OpenLibrary("acpica.library",0)))
18 ACPI_TABLE_FADT
*fadt
;
21 err
= AcpiGetTable("FACP", 1, (ACPI_TABLE_HEADER
**)&fadt
);
23 if ((fadt
->Header
.Length
>= offsetof(ACPI_TABLE_FADT
, Century
)) &&
26 D(bug("[BattClock] Got RTC century offset 0x%02X from ACPI\n", fadt
->Century
));
27 BattClockBase
->century
= fadt
->Century
;
35 ADD2INITLIB(BattClock_Init
, 0)