Page MenuHomeFreeBSD

D14399.id39389.diff
No OneTemporary

D14399.id39389.diff

Index: sys/x86/isa/atrtc.c
===================================================================
--- sys/x86/isa/atrtc.c
+++ sys/x86/isa/atrtc.c
@@ -32,6 +32,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_acpi.h"
#include "opt_isa.h"
#include <sys/param.h>
@@ -55,6 +56,10 @@
#include <machine/intr_machdep.h>
#include "clock_if.h"
+#ifdef DEV_ACPI
+#include <contrib/dev/acpica/include/acpi.h>
+#endif
+
/*
* clock_lock protects low-level access to individual hardware registers.
* atrtc_time_lock protects the entire sequence of accessing multiple registers
@@ -241,11 +246,42 @@
{ 0 }
};
+static bool
+atrtc_acpi_disabled(void)
+{
+#ifdef DEV_ACPI
+ ACPI_TABLE_FADT *fadt;
+ vm_paddr_t physaddr;
+ uint16_t flags;
+
+ physaddr = acpi_find_table(ACPI_SIG_FADT);
+ if (physaddr == 0)
+ return (false);
+
+ fadt = acpi_map_table(physaddr, ACPI_SIG_FADT);
+ if (fadt == NULL) {
+ printf("at_rtc: unable to map FADT ACPI table\n");
+ return (false);
+ }
+
+ flags = fadt->BootFlags;
+ acpi_unmap_table(fadt);
+
+ if (flags & ACPI_FADT_NO_CMOS_RTC)
+ return (true);
+#endif
+
+ return (false);
+}
+
static int
atrtc_probe(device_t dev)
{
int result;
-
+
+ if (atrtc_acpi_disabled())
+ return (0);
+
result = ISA_PNP_PROBE(device_get_parent(dev), dev, atrtc_ids);
/* ENOENT means no PnP-ID, device is hinted. */
if (result == ENOENT) {

File Metadata

Mime Type
text/plain
Expires
Wed, May 20, 11:43 AM (8 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33345938
Default Alt Text
D14399.id39389.diff (1 KB)

Event Timeline