summaryrefslogtreecommitdiff
path: root/sys/dev/acpi/acpicpu.c
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2007-11-15 19:05:59 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2007-11-15 19:05:59 +0000
commitb906e151cb6eda2db7e501224eb86086f22c22dc (patch)
treee2d57847e32b42dfd307a08484b0d3fb1cc94554 /sys/dev/acpi/acpicpu.c
parentcdee064d55ea0c7ab8e2776ffa0d3aecb1125c5a (diff)
Nicer dmesg output.
From Oleg Safiullin (form@) ok deraadt
Diffstat (limited to 'sys/dev/acpi/acpicpu.c')
-rw-r--r--sys/dev/acpi/acpicpu.c70
1 files changed, 34 insertions, 36 deletions
diff --git a/sys/dev/acpi/acpicpu.c b/sys/dev/acpi/acpicpu.c
index a449dc932af..130f18427bb 100644
--- a/sys/dev/acpi/acpicpu.c
+++ b/sys/dev/acpi/acpicpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpicpu.c,v 1.31 2007/11/12 21:58:14 deraadt Exp $ */
+/* $OpenBSD: acpicpu.c,v 1.32 2007/11/15 19:05:58 mikeb Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
@@ -234,7 +234,7 @@ acpicpu_attach(struct device *parent, struct device *self, void *aux)
{
struct acpicpu_softc *sc = (struct acpicpu_softc *)self;
struct acpi_attach_args *aa = aux;
- struct aml_value res;
+ struct aml_value res;
int i;
struct acpi_cstate *cx;
@@ -329,37 +329,32 @@ acpicpu_attach(struct device *parent, struct device *self, void *aux)
* Nicely enumerate what power management capabilities
* ACPI CPU provides.
*/
- i = 0;
- printf(":");
- SLIST_FOREACH(cx, &sc->sc_cstates, link) {
- if (i)
- printf(",");
- switch (cx->type) {
- case ACPI_STATE_C0:
- printf(" C0");
- break;
- case ACPI_STATE_C1:
- printf(" C1");
- break;
- case ACPI_STATE_C2:
- printf(" C2");
- break;
- case ACPI_STATE_C3:
- printf(" C3");
- break;
+ if (!SLIST_EMPTY(&sc->sc_cstates)) {
+ printf(":");
+
+ i = 0;
+ SLIST_FOREACH(cx, &sc->sc_cstates, link) {
+ if (i++)
+ printf(",");
+ switch (cx->type) {
+ case ACPI_STATE_C0:
+ printf(" C0");
+ break;
+ case ACPI_STATE_C1:
+ printf(" C1");
+ break;
+ case ACPI_STATE_C2:
+ printf(" C2");
+ break;
+ case ACPI_STATE_C3:
+ printf(" C3");
+ break;
+ }
}
- i++;
}
- if (!(sc->sc_flags & FLAGS_NOPSS) && !(sc->sc_flags & FLAGS_NOPCT)) {
- if (i)
- printf(",");
- printf(" FVS");
- } else if (!(sc->sc_flags & FLAGS_NOPSS)) {
- if (i)
- printf(",");
- printf(" PSS");
- }
- printf("\n");
+
+ if (!(sc->sc_flags & (FLAGS_NOPSS | FLAGS_NOPCT | FLAGS_NOPSS)))
+ printf("%c ", SLIST_EMPTY(&sc->sc_cstates) ? ':' : ',');
/*
* If acpicpu is itself providing the capability to transition
@@ -367,11 +362,14 @@ acpicpu_attach(struct device *parent, struct device *self, void *aux)
* would.
*/
if (!(sc->sc_flags & FLAGS_NOPSS) && !(sc->sc_flags & FLAGS_NOPCT)) {
- printf("%s: ", sc->sc_dev.dv_xname);
- for (i = 0; i < sc->sc_pss_len; i++)
- printf("%d%s", sc->sc_pss[i].pss_core_freq,
- i < sc->sc_pss_len - 1 ? ", " : " MHz\n");
- }
+ printf("FVS, ");
+ for (i = 0; i < sc->sc_pss_len - 1; i++)
+ printf("%d, ", sc->sc_pss[i].pss_core_freq);
+ printf("%d MHz", sc->sc_pss[i].pss_core_freq);
+ } else if (!(sc->sc_flags & FLAGS_NOPSS))
+ printf("PSS");
+
+ printf("\n");
}
int