Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 KNF. No functional change.



details:   https://anonhg.NetBSD.org/src/rev/9affdce4e377
branches:  trunk
changeset: 809505:9affdce4e377
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Jul 17 06:41:18 2015 +0000

description:
KNF. No functional change.

diffstat:

 sys/arch/x86/x86/ioapic.c |  45 +++++++++++++++++---------------
 sys/arch/x86/x86/lapic.c  |  64 ++++++++++++++++++++++------------------------
 sys/arch/x86/x86/mpacpi.c |  20 +++++++-------
 sys/arch/x86/x86/mpbios.c |  56 ++++++++++++++++++++--------------------
 4 files changed, 93 insertions(+), 92 deletions(-)

diffs (truncated from 552 to 300 lines):

diff -r 054ed69e4bbd -r 9affdce4e377 sys/arch/x86/x86/ioapic.c
--- a/sys/arch/x86/x86/ioapic.c Fri Jul 17 06:40:49 2015 +0000
+++ b/sys/arch/x86/x86/ioapic.c Fri Jul 17 06:41:18 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ioapic.c,v 1.50 2015/04/27 07:03:58 knakahara Exp $    */
+/*     $NetBSD: ioapic.c,v 1.51 2015/07/17 06:41:18 msaitoh Exp $      */
 
 /*-
  * Copyright (c) 2000, 2009 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.50 2015/04/27 07:03:58 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.51 2015/07/17 06:41:18 msaitoh Exp $");
 
 #include "opt_ddb.h"
 
@@ -305,7 +305,8 @@
        sc->sc_pic.pic_edge_stubs = ioapic_edge_stubs;
        sc->sc_pic.pic_level_stubs = ioapic_level_stubs;
 
-       apic_id = (ioapic_read(sc,IOAPIC_ID)&IOAPIC_ID_MASK)>>IOAPIC_ID_SHIFT;
+       apic_id = (ioapic_read(sc, IOAPIC_ID) & IOAPIC_ID_MASK)
+           >> IOAPIC_ID_SHIFT;
        ver_sz = ioapic_read(sc, IOAPIC_VER);
 
        if (ver_sz == 0xffffffff) {
@@ -376,19 +377,19 @@
                aprint_debug_dev(sc->sc_dev, "misconfigured as apic %d\n",
                                 apic_id);
 
-               ioapic_write(sc,IOAPIC_ID,
-                   (ioapic_read(sc,IOAPIC_ID)&~IOAPIC_ID_MASK)
-                   |(sc->sc_pic.pic_apicid<<IOAPIC_ID_SHIFT));
+               ioapic_write(sc, IOAPIC_ID,
+                   (ioapic_read(sc, IOAPIC_ID) & ~IOAPIC_ID_MASK)
+                   | (sc->sc_pic.pic_apicid << IOAPIC_ID_SHIFT));
                
-               apic_id = (ioapic_read(sc,IOAPIC_ID)&IOAPIC_ID_MASK)>>IOAPIC_ID_SHIFT;
+               apic_id = (ioapic_read(sc, IOAPIC_ID) & IOAPIC_ID_MASK)
+                   >> IOAPIC_ID_SHIFT;
                
-               if (apic_id != sc->sc_pic.pic_apicid) {
-                       aprint_error_dev(sc->sc_dev, "can't remap to apid %d\n",
-                           sc->sc_pic.pic_apicid);
-               } else {
+               if (apic_id != sc->sc_pic.pic_apicid)
+                       aprint_error_dev(sc->sc_dev,
+                           "can't remap to apid %d\n", sc->sc_pic.pic_apicid);
+               else
                        aprint_debug_dev(sc->sc_dev, "remapped to apic %d\n",
                            sc->sc_pic.pic_apicid);
-               }
        }
 
  out:
@@ -426,7 +427,8 @@
                } else {
                        redhi = (ci->ci_cpuid << IOAPIC_REDHI_DEST_SHIFT);
                        redlo |= (idt_vec & 0xff);
-                       redlo |= (IOAPIC_REDLO_DEL_FIXED<<IOAPIC_REDLO_DEL_SHIFT);
+                       redlo |= IOAPIC_REDLO_DEL_FIXED
+                           << IOAPIC_REDLO_DEL_SHIFT;
                        redlo &= ~IOAPIC_REDLO_DSTMOD;
 
                        /* XXX derive this bit from BIOS info */
@@ -434,7 +436,8 @@
                                redlo |= IOAPIC_REDLO_LEVEL;
                        else
                                redlo &= ~IOAPIC_REDLO_LEVEL;
-                       if (map != NULL && ((map->flags & 3) == MPS_INTPO_DEF)) {
+                       if ((map != NULL)
+                           && ((map->flags & 3) == MPS_INTPO_DEF)) {
                                if (pp->ip_type == IST_LEVEL)
                                        redlo |= IOAPIC_REDLO_ACTLO;
                                else
@@ -480,17 +483,17 @@
        aprint_normal("%s reenabling\n", device_xname(ioapics->sc_dev));
 
        for (sc = ioapics; sc != NULL; sc = sc->sc_next) {
-               apic_id = (ioapic_read(sc,IOAPIC_ID)&IOAPIC_ID_MASK)>>IOAPIC_ID_SHIFT;
+               apic_id = (ioapic_read(sc, IOAPIC_ID) & IOAPIC_ID_MASK)
+                   >> IOAPIC_ID_SHIFT;
                if (apic_id != sc->sc_pic.pic_apicid) {
-                       ioapic_write(sc,IOAPIC_ID,
-                           (ioapic_read(sc,IOAPIC_ID)&~IOAPIC_ID_MASK)
-                           |(sc->sc_pic.pic_apicid<<IOAPIC_ID_SHIFT));
+                       ioapic_write(sc, IOAPIC_ID,
+                           (ioapic_read(sc, IOAPIC_ID) & ~IOAPIC_ID_MASK)
+                           | (sc->sc_pic.pic_apicid << IOAPIC_ID_SHIFT));
                }
 
-               for (p = 0; p < sc->sc_apic_sz; p++) {
+               for (p = 0; p < sc->sc_apic_sz; p++)
                        apic_set_redir(sc, p, sc->sc_pins[p].ip_vector,
                                    sc->sc_pins[p].ip_cpu);
-               }
        }
 
        ioapic_enable();
@@ -554,7 +557,6 @@
 static void
 ioapic_addroute(struct pic *pic, struct cpu_info *ci, int pin,
                int idtvec, int type)
-
 {
        struct ioapic_softc *sc = pic->pic_ioapic;
        struct ioapic_pin *pp;
@@ -570,6 +572,7 @@
 ioapic_delroute(struct pic *pic, struct cpu_info *ci, int pin,
     int idtvec, int type)
 {
+
        ioapic_hwmask(pic, pin);
 }
 
diff -r 054ed69e4bbd -r 9affdce4e377 sys/arch/x86/x86/lapic.c
--- a/sys/arch/x86/x86/lapic.c  Fri Jul 17 06:40:49 2015 +0000
+++ b/sys/arch/x86/x86/lapic.c  Fri Jul 17 06:41:18 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lapic.c,v 1.49 2015/07/15 04:49:02 msaitoh Exp $       */
+/*     $NetBSD: lapic.c,v 1.50 2015/07/17 06:41:18 msaitoh Exp $       */
 
 /*-
  * Copyright (c) 2000, 2008 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.49 2015/07/15 04:49:02 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.50 2015/07/17 06:41:18 msaitoh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"                /* for MPDEBUG */
@@ -155,9 +155,9 @@
 
 #ifdef MULTIPROCESSOR
        if (mp_verbose) {
-               apic_format_redir (device_xname(ci->ci_dev), "prelint", 0, 0,
+               apic_format_redir(device_xname(ci->ci_dev), "prelint", 0, 0,
                    i82489_readreg(LAPIC_LVINT0));
-               apic_format_redir (device_xname(ci->ci_dev), "prelint", 1, 0,
+               apic_format_redir(device_xname(ci->ci_dev), "prelint", 1, 0,
                    i82489_readreg(LAPIC_LVINT1));
        }
 #endif
@@ -317,11 +317,11 @@
         * then set divisor,
         * then unmask and set the vector.
         */
-       i82489_writereg (LAPIC_LVTT, LAPIC_LVTT_TM|LAPIC_LVTT_M);
-       i82489_writereg (LAPIC_DCR_TIMER, LAPIC_DCRT_DIV1);
-       i82489_writereg (LAPIC_ICR_TIMER, lapic_tval);
-       i82489_writereg (LAPIC_LVTT, LAPIC_LVTT_TM|LAPIC_TIMER_VECTOR);
-       i82489_writereg (LAPIC_EOI, 0);
+       i82489_writereg(LAPIC_LVTT, LAPIC_LVTT_TM | LAPIC_LVTT_M);
+       i82489_writereg(LAPIC_DCR_TIMER, LAPIC_DCRT_DIV1);
+       i82489_writereg(LAPIC_ICR_TIMER, lapic_tval);
+       i82489_writereg(LAPIC_LVTT, LAPIC_LVTT_TM | LAPIC_TIMER_VECTOR);
+       i82489_writereg(LAPIC_EOI, 0);
 }
 
 extern unsigned int gettick(void);     /* XXX put in header file */
@@ -354,9 +354,9 @@
         * Configure timer to one-shot, interrupt masked,
         * large positive number.
         */
-       i82489_writereg (LAPIC_LVTT, LAPIC_LVTT_M);
-       i82489_writereg (LAPIC_DCR_TIMER, LAPIC_DCRT_DIV1);
-       i82489_writereg (LAPIC_ICR_TIMER, 0x80000000);
+       i82489_writereg(LAPIC_LVTT, LAPIC_LVTT_M);
+       i82489_writereg(LAPIC_DCR_TIMER, LAPIC_DCRT_DIV1);
+       i82489_writereg(LAPIC_ICR_TIMER, 0x80000000);
 
        x86_disable_intr();
 
@@ -390,10 +390,10 @@
                lapic_tval = (lapic_per_second * 2) / hz;
                lapic_tval = (lapic_tval / 2) + (lapic_tval & 0x1);
 
-               i82489_writereg (LAPIC_LVTT, LAPIC_LVTT_TM|LAPIC_LVTT_M
-                   |LAPIC_TIMER_VECTOR);
-               i82489_writereg (LAPIC_DCR_TIMER, LAPIC_DCRT_DIV1);
-               i82489_writereg (LAPIC_ICR_TIMER, lapic_tval);
+               i82489_writereg(LAPIC_LVTT, LAPIC_LVTT_TM | LAPIC_LVTT_M
+                   | LAPIC_TIMER_VECTOR);
+               i82489_writereg(LAPIC_DCR_TIMER, LAPIC_DCRT_DIV1);
+               i82489_writereg(LAPIC_ICR_TIMER, lapic_tval);
 
                /*
                 * Compute fixed-point ratios between cycles and
@@ -401,10 +401,10 @@
                 * in lapic_delay.
                 */
 
-               tmp = (1000000 * (uint64_t)1<<32) / lapic_per_second;
+               tmp = (1000000 * (uint64_t)1 << 32) / lapic_per_second;
                lapic_frac_usec_per_cycle = tmp;
 
-               tmp = (lapic_per_second * (uint64_t)1<<32) / 1000000;
+               tmp = (lapic_per_second * (uint64_t)1 << 32) / 1000000;
 
                lapic_frac_cycle_per_usec = tmp;
 
@@ -494,9 +494,9 @@
        i82489_writereg(LAPIC_ESR, 0);
        (void)i82489_readreg(LAPIC_ESR);
 
-       if ((target&LAPIC_DEST_MASK)==0) {
+       if ((target&LAPIC_DEST_MASK)==0)
                i82489_writereg(LAPIC_ICRHI, target<<LAPIC_ID_SHIFT);
-       }
+
        i82489_writereg(LAPIC_ICRLO, (target & LAPIC_DEST_MASK) |
            LAPIC_DLMODE_INIT | LAPIC_LEVEL_ASSERT );
        i82489_icr_wait();
@@ -505,13 +505,12 @@
             LAPIC_DLMODE_INIT | LAPIC_TRIGGER_LEVEL | LAPIC_LEVEL_DEASSERT);
        i82489_icr_wait();
 
-       if ((i82489_readreg(LAPIC_ICRLO) & LAPIC_DLSTAT_BUSY) != 0) {
+       if ((i82489_readreg(LAPIC_ICRLO) & LAPIC_DLSTAT_BUSY) != 0)
                return EBUSY;
-       }
+
        esr = i82489_readreg(LAPIC_ESR);
-       if (esr != 0) {
+       if (esr != 0)
                aprint_debug("x86_ipi_init: ESR %08x\n", esr);
-       }
 
        return 0;
 }
@@ -530,13 +529,12 @@
            LAPIC_LEVEL_ASSERT);
        i82489_icr_wait();
 
-       if ((i82489_readreg(LAPIC_ICRLO) & LAPIC_DLSTAT_BUSY) != 0) {
+       if ((i82489_readreg(LAPIC_ICRLO) & LAPIC_DLSTAT_BUSY) != 0)
                return EBUSY;
-       }
+
        esr = i82489_readreg(LAPIC_ESR);
-       if (esr != 0) {
+       if (esr != 0)
                aprint_debug("x86_ipi_startup: ESR %08x\n", esr);
-       }
 
        return 0;
 }
@@ -614,14 +612,14 @@
 {
        struct cpu_info *ci = curcpu();
 
-       apic_format_redir (device_xname(ci->ci_dev), "timer", 0, 0,
+       apic_format_redir(device_xname(ci->ci_dev), "timer", 0, 0,
            i82489_readreg(LAPIC_LVTT));
-       apic_format_redir (device_xname(ci->ci_dev), "pcint", 0, 0,
+       apic_format_redir(device_xname(ci->ci_dev), "pcint", 0, 0,
            i82489_readreg(LAPIC_PCINT));
-       apic_format_redir (device_xname(ci->ci_dev), "lint", 0, 0,
+       apic_format_redir(device_xname(ci->ci_dev), "lint", 0, 0,
            i82489_readreg(LAPIC_LVINT0));
-       apic_format_redir (device_xname(ci->ci_dev), "lint", 1, 0,
+       apic_format_redir(device_xname(ci->ci_dev), "lint", 1, 0,
            i82489_readreg(LAPIC_LVINT1));
-       apic_format_redir (device_xname(ci->ci_dev), "err", 0, 0,
+       apic_format_redir(device_xname(ci->ci_dev), "err", 0, 0,
            i82489_readreg(LAPIC_LVERR));
 }
diff -r 054ed69e4bbd -r 9affdce4e377 sys/arch/x86/x86/mpacpi.c
--- a/sys/arch/x86/x86/mpacpi.c Fri Jul 17 06:40:49 2015 +0000
+++ b/sys/arch/x86/x86/mpacpi.c Fri Jul 17 06:41:18 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mpacpi.c,v 1.100 2015/07/15 07:29:13 msaitoh Exp $     */
+/*     $NetBSD: mpacpi.c,v 1.101 2015/07/17 06:41:18 msaitoh Exp $     */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.100 2015/07/15 07:29:13 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.101 2015/07/17 06:41:18 msaitoh Exp $");
 
 #include "acpica.h"
 #include "opt_acpi.h"
@@ -201,7 +201,7 @@
                pin = ioapic_nmi->GlobalIrq - pic->pic_vecbase;
                mpi->ioapic_pin = pin;
                mpi->bus_pin = -1;
-               mpi->redir = (IOAPIC_REDLO_DEL_NMI<<IOAPIC_REDLO_DEL_SHIFT);
+               mpi->redir = (IOAPIC_REDLO_DEL_NMI << IOAPIC_REDLO_DEL_SHIFT);
 #if NIOAPIC > 0
                if (pic->pic_type == PIC_IOAPIC) {
                        pic->pic_ioapic->sc_pins[pin].ip_map = mpi;
@@ -224,7 +224,7 @@
                mpi->type = MPS_INTTYPE_NMI;



Home | Main Index | Thread Index | Old Index