Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/ibm4xx Minor style fixes to asm codes. No b...



details:   https://anonhg.NetBSD.org/src/rev/6ec8b30ee650
branches:  trunk
changeset: 371740:6ec8b30ee650
user:      rin <rin%NetBSD.org@localhost>
date:      Wed Oct 05 08:18:00 2022 +0000

description:
Minor style fixes to asm codes. No binary changes.

diffstat:

 sys/arch/powerpc/ibm4xx/clock.c          |  33 ++++++++++++++------------
 sys/arch/powerpc/ibm4xx/copyinstr.c      |   6 ++--
 sys/arch/powerpc/ibm4xx/copyoutstr.c     |   6 ++--
 sys/arch/powerpc/ibm4xx/cpu.c            |   8 +++---
 sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c |  10 ++++----
 sys/arch/powerpc/ibm4xx/pmap.c           |  40 ++++++++++++++++----------------
 sys/arch/powerpc/ibm4xx/trap.c           |   8 +++---
 7 files changed, 57 insertions(+), 54 deletions(-)

diffs (truncated from 348 to 300 lines):

diff -r 5c15f2d131e6 -r 6ec8b30ee650 sys/arch/powerpc/ibm4xx/clock.c
--- a/sys/arch/powerpc/ibm4xx/clock.c   Wed Oct 05 02:56:14 2022 +0000
+++ b/sys/arch/powerpc/ibm4xx/clock.c   Wed Oct 05 08:18:00 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clock.c,v 1.32 2021/03/05 06:06:34 rin Exp $   */
+/*     $NetBSD: clock.c,v 1.33 2022/10/05 08:18:00 rin Exp $   */
 /*      $OpenBSD: clock.c,v 1.3 1997/10/13 13:42:53 pefo Exp $  */
 
 /*
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.32 2021/03/05 06:06:34 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.33 2022/10/05 08:18:00 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ppcarch.h"
@@ -218,9 +218,9 @@
        u_long tb;
        int msr;
 
-       __asm volatile ("mfmsr %0; wrteei 0" : "=r"(msr) :);
+       __asm volatile ("mfmsr %0; wrteei 0" : "=r" (msr));
        tb = mftbl();
-       __asm volatile ("mtmsr %0" :: "r"(msr));
+       __asm volatile ("mtmsr %0" :: "r" (msr));
 
        return tb;
 }
@@ -240,23 +240,26 @@
        tbh = tb >> 32;
        tbl = tb;
        __asm volatile (
+       "1:"
 #ifdef PPC_IBM403
-           "1: mftbhi %0       \n"
+               "mftbhi %0;"
 #else
-           "1: mftbu %0        \n"
+               "mftbu  %0;"
 #endif
-           "   cmplw %0,%1     \n"
-           "   blt 1b          \n"
-           "   bgt 2f          \n"
+               "cmplw  %0,%1;"
+               "blt    1b;"
+               "bgt    2f;"
 #ifdef PPC_IBM403
-           "   mftblo %0       \n"
+               "mftblo %0;"
 #else
-           "   mftb %0         \n"
+               "mftb   %0;"
 #endif
-           "   cmplw %0,%2     \n"
-           "   blt 1b          \n"
-           "2:                 \n"
-           : "=&r"(scratch) : "r"(tbh), "r"(tbl) : "cr0");
+               "cmplw  %0,%2;"
+               "blt    1b;"
+       "2:"
+           : "=&r" (scratch)
+           : "r" (tbh), "r" (tbl)
+           : "cr0");
 }
 
 /*
diff -r 5c15f2d131e6 -r 6ec8b30ee650 sys/arch/powerpc/ibm4xx/copyinstr.c
--- a/sys/arch/powerpc/ibm4xx/copyinstr.c       Wed Oct 05 02:56:14 2022 +0000
+++ b/sys/arch/powerpc/ibm4xx/copyinstr.c       Wed Oct 05 08:18:00 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: copyinstr.c,v 1.23 2022/10/05 02:56:14 rin Exp $       */
+/*     $NetBSD: copyinstr.c,v 1.24 2022/10/05 08:18:00 rin Exp $       */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: copyinstr.c,v 1.23 2022/10/05 02:56:14 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: copyinstr.c,v 1.24 2022/10/05 08:18:00 rin Exp $");
 
 #include <sys/param.h>
 #include <uvm/uvm_extern.h>
@@ -71,7 +71,7 @@
        }
 
        resid = len;
-       __asm volatile(
+       __asm volatile (
                "mtctr  %[resid];"              /* Set up counter */
                "mfmsr  %[msr];"                /* Save MSR */
                "li     %[tmp],0x20;"           /* Disable IMMU */
diff -r 5c15f2d131e6 -r 6ec8b30ee650 sys/arch/powerpc/ibm4xx/copyoutstr.c
--- a/sys/arch/powerpc/ibm4xx/copyoutstr.c      Wed Oct 05 02:56:14 2022 +0000
+++ b/sys/arch/powerpc/ibm4xx/copyoutstr.c      Wed Oct 05 08:18:00 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: copyoutstr.c,v 1.23 2022/10/05 02:56:14 rin Exp $      */
+/*     $NetBSD: copyoutstr.c,v 1.24 2022/10/05 08:18:00 rin Exp $      */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: copyoutstr.c,v 1.23 2022/10/05 02:56:14 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: copyoutstr.c,v 1.24 2022/10/05 08:18:00 rin Exp $");
 
 #include <sys/param.h>
 #include <uvm/uvm_extern.h>
@@ -71,7 +71,7 @@
        }
 
        resid = len;
-       __asm volatile(
+       __asm volatile (
                "mtctr  %[resid];"              /* Set up counter */
                "mfmsr  %[msr];"                /* Save MSR */
                "li     %[tmp],0x20;"           /* Disable IMMU */
diff -r 5c15f2d131e6 -r 6ec8b30ee650 sys/arch/powerpc/ibm4xx/cpu.c
--- a/sys/arch/powerpc/ibm4xx/cpu.c     Wed Oct 05 02:56:14 2022 +0000
+++ b/sys/arch/powerpc/ibm4xx/cpu.c     Wed Oct 05 08:18:00 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.38 2021/03/30 13:41:46 simonb Exp $  */
+/*     $NetBSD: cpu.c,v 1.39 2022/10/05 08:18:00 rin Exp $     */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.38 2021/03/30 13:41:46 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.39 2022/10/05 08:18:00 rin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -345,8 +345,8 @@
 
        if (dcache_line_size) {
                for (size_t i = 0; i < PAGE_SIZE; i += dcache_line_size) {
-                       __asm volatile("dcbf %0,%1" : : "b" (va), "r" (i));
+                       __asm volatile ("dcbf %0,%1" : : "b" (va), "r" (i));
                }
-               __asm volatile("sync; isync" : : );
+               __asm volatile ("sync; isync");
        }
 }
diff -r 5c15f2d131e6 -r 6ec8b30ee650 sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c
--- a/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c  Wed Oct 05 02:56:14 2022 +0000
+++ b/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c  Wed Oct 05 08:18:00 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ibm4xx_machdep.c,v 1.37 2021/03/30 14:33:10 rin Exp $  */
+/*     $NetBSD: ibm4xx_machdep.c,v 1.38 2022/10/05 08:18:00 rin Exp $  */
 /*     Original: ibm40x_machdep.c,v 1.3 2005/01/17 17:19:36 shige Exp $ */
 
 /*
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ibm4xx_machdep.c,v 1.37 2021/03/30 14:33:10 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibm4xx_machdep.c,v 1.38 2022/10/05 08:18:00 rin Exp $");
 
 #include "ksyms.h"
 
@@ -295,7 +295,7 @@
         * Now enable translation (and machine checks/recoverable interrupts).
         */
        __asm volatile ("mfmsr %0; ori %0,%0,%1; mtmsr %0; isync"
-                     : : "r"(0), "K"(PSL_IR|PSL_DR));
+                     : : "r" (0), "K" (PSL_IR|PSL_DR));
        /* XXXX PSL_ME - With ME set kernel gets stuck... */
 
        /*
@@ -334,12 +334,12 @@
        if (offset > 0x1ffffff)
                panic("install_extint: too far away");
 #endif
-       __asm volatile ("mfmsr %0; wrteei 0" : "=r"(msr));
+       __asm volatile ("mfmsr %0; wrteei 0" : "=r" (msr));
        extint_call = (extint_call & 0xfc000003) | offset;
        memcpy((void *)EXC_EXI, &extint, (size_t)&extsize);
        __syncicache((void *)&extint_call, sizeof extint_call);
        __syncicache((void *)EXC_EXI, (int)&extsize);
-       __asm volatile ("mtmsr %0" :: "r"(msr));
+       __asm volatile ("mtmsr %0" :: "r" (msr));
 }
 
 /*
diff -r 5c15f2d131e6 -r 6ec8b30ee650 sys/arch/powerpc/ibm4xx/pmap.c
--- a/sys/arch/powerpc/ibm4xx/pmap.c    Wed Oct 05 02:56:14 2022 +0000
+++ b/sys/arch/powerpc/ibm4xx/pmap.c    Wed Oct 05 08:18:00 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.106 2022/09/12 08:02:44 rin Exp $   */
+/*     $NetBSD: pmap.c,v 1.107 2022/10/05 08:18:00 rin Exp $   */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.106 2022/09/12 08:02:44 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.107 2022/10/05 08:18:00 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -683,7 +683,7 @@
 #else
 
        for (i = PAGE_SIZE/CACHELINESIZE; i > 0; i--) {
-               __asm volatile ("dcbz 0,%0" : : "r"(pa));
+               __asm volatile ("dcbz 0,%0" : : "r" (pa));
                pa += CACHELINESIZE;
        }
 #endif
@@ -1197,8 +1197,8 @@
                        MTPID(%1)
                        "mtmsr  %0;"
                        "isync;"
-                       : "=&r"(msr), "=&r"(opid)
-                       : "r"(ctx), "r"(va), "r"(len), "r"(CACHELINESIZE));
+                       : "=&r" (msr), "=&r" (opid)
+                       : "r" (ctx), "r" (va), "r" (len), "r" (CACHELINESIZE));
        } else {
                paddr_t pa;
                vaddr_t tva, eva;
@@ -1246,16 +1246,16 @@
                MTPID(%1)
                "mtmsr  %0;"
                "isync;"
-               : "=&r"(msr), "=&r"(pid), "=&r"(hi)
-               : "r"(i), "r"(TLB_VALID));
+               : "=&r" (msr), "=&r" (pid), "=&r" (hi)
+               : "r" (i), "r" (TLB_VALID));
 #else
        /*
         * Just clear entire TLBHI register.
         */
        __asm volatile (
-               "tlbwe %0,%1,0;"
+               "tlbwe  %0,%1,0;"
                "isync;"
-               : : "r"(0), "r"(i));
+               : : "r" (0), "r" (i));
 #endif
 
        tlb_info[i].ti_ctx = 0;
@@ -1289,8 +1289,8 @@
                "beq    1f;"
                "li     %1,0;"
        "1:"
-               : "=&r"(i), "=&r"(found), "=&r"(msr)
-               : "r"(va), "r"(pid));
+               : "=&r" (i), "=&r" (found), "=&r" (msr)
+               : "r" (va), "r" (pid));
 
        if (found && !TLB_LOCKED(i)) {
                /* Now flush translation */
@@ -1382,8 +1382,8 @@
                MTPID(%1)                       /* Restore PID */
                "mtmsr  %0;"                    /* and MSR */
                "isync;"
-               : "=&r"(msr), "=&r"(pid)
-               : "r"(ctx), "r"(idx), "r"(tl), "r"(th));
+               : "=&r" (msr), "=&r" (pid)
+               : "r" (ctx), "r" (idx), "r" (tl), "r" (th));
 }
 
 void
@@ -1406,7 +1406,7 @@
        __asm volatile (
                "mtspr  %0,%1;"
                "isync;"
-               : : "K"(SPR_ZPR), "r"(0x1b000000));
+               : : "K" (SPR_ZPR), "r" (0x1b000000));
 }
 
 /*
@@ -1448,10 +1448,10 @@
        /* tlb_nreserved is only allowed to grow, so this is safe. */
        for (i = 0; i < tlb_nreserved; i++) {
                __asm volatile (
-                   "tlbre      %0,%2,1;"       /* TLBLO */
-                   "tlbre      %1,%2,0;"       /* TLBHI */
-                   : "=&r"(lo), "=&r"(hi)
-                   : "r"(i));
+                       "tlbre  %0,%2,1;"       /* TLBLO */
+                       "tlbre  %1,%2,0;"       /* TLBHI */
+                       : "=&r" (lo), "=&r" (hi)
+                       : "r" (i));
 
                KASSERT(hi & TLB_VALID);
                KASSERT(mfspr(SPR_PID) == KERNEL_PID);
@@ -1503,11 +1503,11 @@
        lo |= TLB_I;



Home | Main Index | Thread Index | Old Index