Print the state information only once. The per-CPU information was quite

pointless as identical parameters are expected across processors.
This commit is contained in:
jruoho 2010-08-11 16:41:19 +00:00
parent 7a63961323
commit 675dfd8bb3
2 changed files with 16 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpi_cpu_cstate.c,v 1.22 2010/08/11 10:44:07 jruoho Exp $ */ /* $NetBSD: acpi_cpu_cstate.c,v 1.23 2010/08/11 16:41:19 jruoho Exp $ */
/*- /*-
* Copyright (c) 2010 Jukka Ruohonen <jruohonen@iki.fi> * Copyright (c) 2010 Jukka Ruohonen <jruohonen@iki.fi>
@ -27,7 +27,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_cstate.c,v 1.22 2010/08/11 10:44:07 jruoho Exp $"); __KERNEL_RCSID(0, "$NetBSD: acpi_cpu_cstate.c,v 1.23 2010/08/11 16:41:19 jruoho Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/cpu.h> #include <sys/cpu.h>
@ -113,9 +113,13 @@ void
acpicpu_cstate_attach_print(struct acpicpu_softc *sc) acpicpu_cstate_attach_print(struct acpicpu_softc *sc)
{ {
struct acpicpu_cstate *cs; struct acpicpu_cstate *cs;
static bool once = false;
const char *str; const char *str;
int i; int i;
if (once != false)
return;
for (i = 0; i < ACPI_C_STATE_COUNT; i++) { for (i = 0; i < ACPI_C_STATE_COUNT; i++) {
cs = &sc->sc_cstate[i]; cs = &sc->sc_cstate[i];
@ -146,6 +150,8 @@ acpicpu_cstate_attach_print(struct acpicpu_softc *sc)
i, str, cs->cs_latency, cs->cs_power, i, str, cs->cs_latency, cs->cs_power,
(uint32_t)cs->cs_addr, cs->cs_flags); (uint32_t)cs->cs_addr, cs->cs_flags);
} }
once = true;
} }
static void static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpi_cpu_pstate.c,v 1.11 2010/08/11 16:22:18 jruoho Exp $ */ /* $NetBSD: acpi_cpu_pstate.c,v 1.12 2010/08/11 16:41:19 jruoho Exp $ */
/*- /*-
* Copyright (c) 2010 Jukka Ruohonen <jruohonen@iki.fi> * Copyright (c) 2010 Jukka Ruohonen <jruohonen@iki.fi>
@ -27,7 +27,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.11 2010/08/11 16:22:18 jruoho Exp $"); __KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.12 2010/08/11 16:41:19 jruoho Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/evcnt.h> #include <sys/evcnt.h>
@ -102,9 +102,13 @@ acpicpu_pstate_attach_print(struct acpicpu_softc *sc)
{ {
const uint8_t method = sc->sc_pstate_control.reg_spaceid; const uint8_t method = sc->sc_pstate_control.reg_spaceid;
struct acpicpu_pstate *ps; struct acpicpu_pstate *ps;
static bool once = false;
const char *str; const char *str;
uint32_t i; uint32_t i;
if (once != false)
return;
str = (method != ACPI_ADR_SPACE_SYSTEM_IO) ? "FFH" : "I/O"; str = (method != ACPI_ADR_SPACE_SYSTEM_IO) ? "FFH" : "I/O";
for (i = 0; i < sc->sc_pstate_count; i++) { for (i = 0; i < sc->sc_pstate_count; i++) {
@ -118,6 +122,8 @@ acpicpu_pstate_attach_print(struct acpicpu_softc *sc)
"lat %3u us, pow %5u mW, %4u MHz\n", "lat %3u us, pow %5u mW, %4u MHz\n",
i, str, ps->ps_latency, ps->ps_power, ps->ps_freq); i, str, ps->ps_latency, ps->ps_power, ps->ps_freq);
} }
once = true;
} }
static void static void