Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/isa Honor ACPI FADT Century byte; should fix ma...



details:   https://anonhg.NetBSD.org/src/rev/d61bdb44fe78
branches:  trunk
changeset: 372856:d61bdb44fe78
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Fri Dec 30 21:40:20 2022 +0000

description:
Honor ACPI FADT Century byte; should fix many "unknown CMOS layout" messages.

diffstat:

 sys/arch/x86/isa/rtc.c |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (43 lines):

diff -r 2c7d132b654d -r d61bdb44fe78 sys/arch/x86/isa/rtc.c
--- a/sys/arch/x86/isa/rtc.c    Fri Dec 30 21:38:13 2022 +0000
+++ b/sys/arch/x86/isa/rtc.c    Fri Dec 30 21:40:20 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtc.c,v 1.1 2009/06/16 21:05:34 bouyer Exp $   */
+/*     $NetBSD: rtc.c,v 1.2 2022/12/30 21:40:20 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -121,7 +121,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtc.c,v 1.1 2009/06/16 21:05:34 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtc.c,v 1.2 2022/12/30 21:40:20 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -145,6 +145,11 @@
 #include <machine/mca_machdep.h>       /* for MCA_system */
 #endif
 
+#include "acpica.h"
+#if NACPICA > 0
+#include <dev/acpi/acpivar.h>
+#endif
+
 static void    rtcinit(void);
 static int     rtcget(mc_todregs *);
 static void    rtcput(mc_todregs *);
@@ -269,6 +274,12 @@
                return (clockyear);
 
        s = splclock();
+#if NACPICA > 0
+       if (acpi_active)
+               cmoscentury = mc146818_read(NULL,
+                   (centb = AcpiGbl_FADT.Century));
+       else
+#endif
        if (cmoscheck())
                cmoscentury = mc146818_read(NULL, NVRAM_CENTURY);
 #if NMCA > 0



Home | Main Index | Thread Index | Old Index