Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/acpi Some pretty printing for ACPIVERBOSE.



details:   https://anonhg.NetBSD.org/src/rev/2762fe20710a
branches:  trunk
changeset: 752890:2762fe20710a
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Wed Mar 10 08:12:44 2010 +0000

description:
Some pretty printing for ACPIVERBOSE.

diffstat:

 sys/dev/acpi/acpi.c |  36 ++++++++++++++++++++----------------
 1 files changed, 20 insertions(+), 16 deletions(-)

diffs (64 lines):

diff -r 350b67a361e2 -r 2762fe20710a sys/dev/acpi/acpi.c
--- a/sys/dev/acpi/acpi.c       Wed Mar 10 06:57:22 2010 +0000
+++ b/sys/dev/acpi/acpi.c       Wed Mar 10 08:12:44 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi.c,v 1.157 2010/03/09 18:15:21 jruoho Exp $        */
+/*     $NetBSD: acpi.c,v 1.158 2010/03/10 08:12:44 jruoho Exp $        */
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.157 2010/03/09 18:15:21 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.158 2010/03/10 08:12:44 jruoho Exp $");
 
 #include "opt_acpi.h"
 #include "opt_pcifixup.h"
@@ -894,27 +894,31 @@
 
                SIMPLEQ_INSERT_TAIL(&sc->sc_devnodes, ad, ad_list);
 
+#ifdef ACPIVERBOSE
+
                if (type != ACPI_TYPE_DEVICE)
                        return AE_OK;
 
-               if ((ad->ad_devinfo->Valid & ACPI_VALID_HID) == 0)
-                       return AE_OK;
+               aprint_normal_dev(sc->sc_dev, "%-5s ", ad->ad_name);
 
-#ifdef ACPIVERBOSE
-               aprint_normal("       HID %s\n",
-                   ad->ad_devinfo->HardwareId.String);
+               aprint_normal("HID %-10s ",
+                   ((devinfo->Valid & ACPI_VALID_HID) != 0) ?
+                   devinfo->HardwareId.String: "-");
+
+               aprint_normal("UID %-4s ",
+                   ((devinfo->Valid & ACPI_VALID_UID) != 0) ?
+                   devinfo->UniqueId.String : "-");
 
-               if (ad->ad_devinfo->Valid & ACPI_VALID_UID)
-                       aprint_normal("       UID %s\n",
-                           ad->ad_devinfo->UniqueId.String);
+               if ((devinfo->Valid & ACPI_VALID_STA) != 0)
+                       aprint_normal("STA 0x%08X ", devinfo->CurrentStatus);
+               else
+                       aprint_normal("STA %10s ", "-");
 
-               if (ad->ad_devinfo->Valid & ACPI_VALID_ADR)
-                       aprint_normal("       ADR 0x%016" PRIx64 "\n",
-                           ad->ad_devinfo->Address);
+               if ((devinfo->Valid & ACPI_VALID_ADR) != 0)
+                       aprint_normal("ADR 0x%016" PRIX64"",
+                           devinfo->Address);
 
-               if (ad->ad_devinfo->Valid & ACPI_VALID_STA)
-                       aprint_normal("       STA 0x%08x\n",
-                           ad->ad_devinfo->CurrentStatus);
+               aprint_normal("\n");
 #endif
        }
 



Home | Main Index | Thread Index | Old Index