Date: Sat, 6 Feb 2010 12:48:06 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r203546 - head/sys/dev/acpica Message-ID: <201002061248.o16Cm6kA028229@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Sat Feb 6 12:48:06 2010 New Revision: 203546 URL: http://svn.freebsd.org/changeset/base/203546 Log: acpi_cpu: prefer _OSC over _PDC, just in case _PDC was deprecated in favor of _OSC long time ago, but it seems that they still peacefully coexist and in some case only _PDC is present. Still _OSC provides a reacher interface and is capable to report back its status. If the status is non-zero, then report it, we may find it useful to understand what firmware expects from OS. Also clean up some comments that became less useful over time. Reviewed by: njl, jhb, rpaulo MFC after: 3 weeks Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Sat Feb 6 12:17:20 2010 (r203545) +++ head/sys/dev/acpica/acpi_cpu.c Sat Feb 6 12:48:06 2010 (r203546) @@ -345,28 +345,11 @@ acpi_cpu_attach(device_t dev) } /* - * CPU capabilities are specified as a buffer of 32-bit integers: - * revision, count, and one or more capabilities. The revision of - * "1" is not specified anywhere but seems to match Linux. + * CPU capabilities are specified in + * Intel Processor Vendor-Specific ACPI Interface Specification. */ if (sc->cpu_features) { arglist.Pointer = arg; - arglist.Count = 1; - arg[0].Type = ACPI_TYPE_BUFFER; - arg[0].Buffer.Length = sizeof(cap_set); - arg[0].Buffer.Pointer = (uint8_t *)cap_set; - cap_set[0] = 1; /* revision */ - cap_set[1] = 1; /* number of capabilities integers */ - cap_set[2] = sc->cpu_features; - AcpiEvaluateObject(sc->cpu_handle, "_PDC", &arglist, NULL); - - /* - * On some systems we need to evaluate _OSC so that the ASL - * loads the _PSS and/or _PDC methods at runtime. - * - * TODO: evaluate failure of _OSC. - */ - arglist.Pointer = arg; arglist.Count = 4; arg[0].Type = ACPI_TYPE_BUFFER; arg[0].Buffer.Length = sizeof(cpu_oscuuid); @@ -380,7 +363,22 @@ acpi_cpu_attach(device_t dev) arg[3].Buffer.Pointer = (uint8_t *)cap_set; cap_set[0] = 0; /* status */ cap_set[1] = sc->cpu_features; - AcpiEvaluateObject(sc->cpu_handle, "_OSC", &arglist, NULL); + status = AcpiEvaluateObject(sc->cpu_handle, "_OSC", &arglist, NULL); + if (ACPI_SUCCESS(status)) { + if (cap_set[0] != 0) + device_printf(dev, "_OSC returned status %#x\n", cap_set[0]); + } + else { + arglist.Pointer = arg; + arglist.Count = 1; + arg[0].Type = ACPI_TYPE_BUFFER; + arg[0].Buffer.Length = sizeof(cap_set); + arg[0].Buffer.Pointer = (uint8_t *)cap_set; + cap_set[0] = 1; /* revision */ + cap_set[1] = 1; /* number of capabilities integers */ + cap_set[2] = sc->cpu_features; + AcpiEvaluateObject(sc->cpu_handle, "_PDC", &arglist, NULL); + } } /* Probe for Cx state support. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002061248.o16Cm6kA028229>