From f5ad6af83669c1be507cfb3cded0c5eec2343138 Mon Sep 17 00:00:00 2001 From: kettenis Date: Sat, 25 Aug 2018 16:09:29 +0000 Subject: [PATCH] Fix printing of ioapic remapping messages; avoid printing duplicate info. ok deraadt@ --- sys/arch/amd64/amd64/ioapic.c | 13 ++++++++----- sys/arch/i386/i386/ioapic.c | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/sys/arch/amd64/amd64/ioapic.c b/sys/arch/amd64/amd64/ioapic.c index b39c5f55a0f..0029edf0b56 100644 --- a/sys/arch/amd64/amd64/ioapic.c +++ b/sys/arch/amd64/amd64/ioapic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ioapic.c,v 1.28 2017/10/14 04:44:43 jsg Exp $ */ +/* $OpenBSD: ioapic.c,v 1.29 2018/08/25 16:09:29 kettenis Exp $ */ /* $NetBSD: ioapic.c,v 1.6 2003/05/15 13:30:31 fvdl Exp $ */ /*- @@ -259,9 +259,9 @@ ioapic_set_id(struct ioapic_softc *sc) IOAPIC_ID_SHIFT; if (apic_id != sc->sc_apicid) - printf(", can't remap to apid %d\n", sc->sc_apicid); + printf(", can't remap"); else - printf(", remapped to apid %d\n", sc->sc_apicid); + printf(", remapped"); } /* @@ -330,7 +330,7 @@ ioapic_attach(struct device *parent, struct device *self, void *aux) aaa->flags & IOAPIC_PICMODE ? "PIC" : "virtual wire"); } - printf(", version %x, %d pins\n", sc->sc_apic_vers, sc->sc_apic_sz); + printf(", version %x, %d pins", sc->sc_apic_vers, sc->sc_apic_sz); apic_id = (ioapic_read(sc, IOAPIC_ID) & IOAPIC_ID_MASK) >> IOAPIC_ID_SHIFT; @@ -353,10 +353,13 @@ ioapic_attach(struct device *parent, struct device *self, void *aux) */ if (apic_id != sc->sc_apicid) { if (mp_verbose) - printf("%s: misconfigured as apic %d", + printf("\n%s: misconfigured as apic %d", sc->sc_pic.pic_name, apic_id); ioapic_set_id(sc); } + + printf("\n"); + #if 0 /* output of this was boring. */ if (mp_verbose) diff --git a/sys/arch/i386/i386/ioapic.c b/sys/arch/i386/i386/ioapic.c index 3562599dcc0..72783af8038 100644 --- a/sys/arch/i386/i386/ioapic.c +++ b/sys/arch/i386/i386/ioapic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ioapic.c,v 1.40 2017/08/29 15:19:57 deraadt Exp $ */ +/* $OpenBSD: ioapic.c,v 1.41 2018/08/25 16:09:29 kettenis Exp $ */ /* $NetBSD: ioapic.c,v 1.7 2003/07/14 22:32:40 lukem Exp $ */ /*- @@ -270,9 +270,9 @@ ioapic_set_id(struct ioapic_softc *sc) IOAPIC_ID_SHIFT; if (apic_id != sc->sc_apicid) - printf(", can't remap to apid %d\n", sc->sc_apicid); + printf(", can't remap"); else - printf(", remapped to apid %d\n", sc->sc_apicid); + printf(", remapped"); } /* @@ -330,7 +330,7 @@ ioapic_attach(struct device *parent, struct device *self, void *aux) aaa->flags & IOAPIC_PICMODE ? "PIC" : "virtual wire"); } - printf(", version %x, %d pins\n", sc->sc_apic_vers, sc->sc_apic_sz); + printf(", version %x, %d pins", sc->sc_apic_vers, sc->sc_apic_sz); apic_id = (ioapic_read(sc, IOAPIC_ID) & IOAPIC_ID_MASK) >> IOAPIC_ID_SHIFT; @@ -354,10 +354,13 @@ ioapic_attach(struct device *parent, struct device *self, void *aux) */ if (apic_id != sc->sc_apicid) { if (mp_verbose) - printf("%s: misconfigured as apic %d", + printf("\n%s: misconfigured as apic %d", sc->sc_pic.pic_name, apic_id); ioapic_set_id(sc); } + + printf("\n"); + #if 0 /* output of this was boring. */ if (mp_verbose) -- 2.20.1