Date: Sat, 20 Sep 2014 04:31:12 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271889 - head/sys/dev/acpica Message-ID: <201409200431.s8K4VCDa050706@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adrian Date: Sat Sep 20 04:31:12 2014 New Revision: 271889 URL: http://svnweb.freebsd.org/changeset/base/271889 Log: Populate the device info string with _PXM (proximity domain) information. This is primarily useful for debugging right now - it'll show up in devinfo. Reviewed by: jhb Modified: head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_pci.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Sat Sep 20 02:35:21 2014 (r271888) +++ head/sys/dev/acpica/acpi.c Sat Sep 20 04:31:12 2014 (r271889) @@ -851,11 +851,18 @@ acpi_child_location_str_method(device_t size_t buflen) { struct acpi_device *dinfo = device_get_ivars(child); + char buf2[32]; + int pxm; - if (dinfo->ad_handle) - snprintf(buf, buflen, "handle=%s", acpi_name(dinfo->ad_handle)); - else - snprintf(buf, buflen, "unknown"); + if (dinfo->ad_handle) { + snprintf(buf, buflen, "handle=%s", acpi_name(dinfo->ad_handle)); + if (ACPI_SUCCESS(acpi_GetInteger(dinfo->ad_handle, "_PXM", &pxm))) { + snprintf(buf2, 32, " _PXM=%d", pxm); + strlcat(buf, buf2, buflen); + } + } else { + snprintf(buf, buflen, "unknown"); + } return (0); } Modified: head/sys/dev/acpica/acpi_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pci.c Sat Sep 20 02:35:21 2014 (r271888) +++ head/sys/dev/acpica/acpi_pci.c Sat Sep 20 04:31:12 2014 (r271889) @@ -149,12 +149,19 @@ acpi_pci_child_location_str_method(devic size_t buflen) { struct acpi_pci_devinfo *dinfo = device_get_ivars(child); + int pxm; + char buf2[32]; pci_child_location_str_method(cbdev, child, buf, buflen); - + if (dinfo->ap_handle) { - strlcat(buf, " handle=", buflen); - strlcat(buf, acpi_name(dinfo->ap_handle), buflen); + strlcat(buf, " handle=", buflen); + strlcat(buf, acpi_name(dinfo->ap_handle), buflen); + + if (ACPI_SUCCESS(acpi_GetInteger(dinfo->ap_handle, "_PXM", &pxm))) { + snprintf(buf2, 32, " _PXM=%d", pxm); + strlcat(buf, buf2, buflen); + } } return (0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409200431.s8K4VCDa050706>