Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64 Make pbrobeget() and probeset() work for 64...



details:   https://anonhg.NetBSD.org/src/rev/6649c7df89e0
branches:  trunk
changeset: 473500:6649c7df89e0
user:      eeh <eeh%NetBSD.org@localhost>
date:      Sat Jun 05 21:58:16 1999 +0000

description:
Make pbrobeget() and probeset() work for 64-bit values as well.  To do this
the arguments are changed so the address is first and the ASI second so we
can have the address in %o0:%o1 and not worry about unused registers.

Also a bit of copyright cleanup.

diffstat:

 sys/arch/sparc64/dev/cgeight.c     |   4 +-
 sys/arch/sparc64/dev/cgfour.c      |   4 +-
 sys/arch/sparc64/dev/cgthree.c     |   4 +-
 sys/arch/sparc64/dev/cgtwo.c       |   4 +-
 sys/arch/sparc64/dev/fd.c          |   4 +-
 sys/arch/sparc64/dev/pci_machdep.c |  19 +++----
 sys/arch/sparc64/include/cpu.h     |   5 +-
 sys/arch/sparc64/include/ctlreg.h  |  40 ++--------------
 sys/arch/sparc64/include/param.h   |  10 +--
 sys/arch/sparc64/include/pte.h     |  35 ++------------
 sys/arch/sparc64/include/trap.h    |   9 +--
 sys/arch/sparc64/sparc64/locore.s  |  89 +++++++++++++++++++++++++++++--------
 sys/arch/sparc64/sparc64/machdep.c |   4 +-
 13 files changed, 109 insertions(+), 122 deletions(-)

diffs (truncated from 548 to 300 lines):

diff -r 67855d23f866 -r 6649c7df89e0 sys/arch/sparc64/dev/cgeight.c
--- a/sys/arch/sparc64/dev/cgeight.c    Sat Jun 05 20:44:57 1999 +0000
+++ b/sys/arch/sparc64/dev/cgeight.c    Sat Jun 05 21:58:16 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgeight.c,v 1.3 1998/11/19 15:38:24 mrg Exp $  */
+/*     $NetBSD: cgeight.c,v 1.4 1999/06/05 21:58:16 eeh Exp $  */
 
 /*
  * Copyright (c) 1996 Jason R. Thorpe.  All rights reserved.
@@ -155,7 +155,7 @@
        /*
         * Make sure there's hardware there.
         */
-       if (probeget(ra->ra_vaddr, 4) == -1)
+       if (probeget(ra->ra_vaddr, ASI_PRIMARY, 4) == -1)
                return (0);
 
 #if defined(SUN4)
diff -r 67855d23f866 -r 6649c7df89e0 sys/arch/sparc64/dev/cgfour.c
--- a/sys/arch/sparc64/dev/cgfour.c     Sat Jun 05 20:44:57 1999 +0000
+++ b/sys/arch/sparc64/dev/cgfour.c     Sat Jun 05 21:58:16 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgfour.c,v 1.4 1999/06/05 05:05:11 mrg Exp $   */
+/*     $NetBSD: cgfour.c,v 1.5 1999/06/05 21:58:17 eeh Exp $   */
 
 /*
  * Copyright (c) 1996 Jason R. Thorpe.  All rights reserved.
@@ -159,7 +159,7 @@
        /*
         * Make sure there's hardware there.
         */
-       if (probeget(ASI_PRIMARY, ra->ra_vaddr, 4) == -1)
+       if (probeget(ra->ra_vaddr, ASI_PRIMARY, 4) == -1)
                return (0);
 
 #if defined(SUN4)
diff -r 67855d23f866 -r 6649c7df89e0 sys/arch/sparc64/dev/cgthree.c
--- a/sys/arch/sparc64/dev/cgthree.c    Sat Jun 05 20:44:57 1999 +0000
+++ b/sys/arch/sparc64/dev/cgthree.c    Sat Jun 05 21:58:16 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgthree.c,v 1.6 1999/06/05 05:05:11 mrg Exp $ */
+/*     $NetBSD: cgthree.c,v 1.7 1999/06/05 21:58:17 eeh Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -153,7 +153,7 @@
        if (ca->ca_bustype == BUS_SBUS)
                return(1);
        ra->ra_len = NBPG;
-       return (probeget(ASI_PRIMARY, ra->ra_vaddr, 4) != -1);
+       return (probeget(ra->ra_vaddr, ASI_PRIMARY, 4) != -1);
 }
 
 /*
diff -r 67855d23f866 -r 6649c7df89e0 sys/arch/sparc64/dev/cgtwo.c
--- a/sys/arch/sparc64/dev/cgtwo.c      Sat Jun 05 20:44:57 1999 +0000
+++ b/sys/arch/sparc64/dev/cgtwo.c      Sat Jun 05 21:58:16 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cgtwo.c,v 1.3 1999/06/05 05:05:11 mrg Exp $ */
+/*     $NetBSD: cgtwo.c,v 1.4 1999/06/05 21:58:17 eeh Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -147,7 +147,7 @@
        /* XXX - Must do our own mapping at CG2_CTLREG_OFF */
        bus_untmp();
        tmp = (caddr_t)mapdev(ra->ra_reg, TMPMAP_VA, CG2_CTLREG_OFF, NBPG);
-       if (probeget(ASI_PRIMARY, tmp, 2) != -1)
+       if (probeget(tmp, ASI_PRIMARY, 2) != -1)
                return 1;
 #endif
        return 0;
diff -r 67855d23f866 -r 6649c7df89e0 sys/arch/sparc64/dev/fd.c
--- a/sys/arch/sparc64/dev/fd.c Sat Jun 05 20:44:57 1999 +0000
+++ b/sys/arch/sparc64/dev/fd.c Sat Jun 05 21:58:16 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fd.c,v 1.6 1999/06/05 05:05:11 mrg Exp $       */
+/*     $NetBSD: fd.c,v 1.7 1999/06/05 21:58:17 eeh Exp $       */
 
 /*-
  * Copyright (c) 1993, 1994, 1995 Charles M. Hannum.
@@ -310,7 +310,7 @@
                return (0);
 
        if (ca->ca_ra.ra_vaddr &&
-           probeget(ASI_PRIMARY, ca->ca_ra.ra_vaddr, 1) == -1) {
+           probeget(ca->ca_ra.ra_vaddr, ASI_PRIMARY, 1) == -1) {
                return (0);
        }
 
diff -r 67855d23f866 -r 6649c7df89e0 sys/arch/sparc64/dev/pci_machdep.c
--- a/sys/arch/sparc64/dev/pci_machdep.c        Sat Jun 05 20:44:57 1999 +0000
+++ b/sys/arch/sparc64/dev/pci_machdep.c        Sat Jun 05 21:58:16 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.c,v 1.2 1999/06/05 05:29:50 mrg Exp $      */
+/*     $NetBSD: pci_machdep.c,v 1.3 1999/06/05 21:58:17 eeh Exp $      */
 
 /*
  * Copyright (c) 1999 Matthew R. Green
@@ -313,10 +313,8 @@
                val = (pcireg_t)~0;
        } else {
 #if 0
-               membar_sync();
-               data = probeget(bus_type_asi[sc->sc_configtag->type],
-                              sc->sc_configaddr + tag + reg, 4);
-               membar_sync();
+               data = probeget(sc->sc_configaddr + tag + reg,
+                               bus_type_asi[sc->sc_configtag->type], 4);
                if (data == -1)
                        val = (pcireg_t)~0;
                else
@@ -351,14 +349,15 @@
        if (confaddr_ok(sc, tag) == 0)
                panic("pci_conf_write: bad addr");
                
+#if 0
+       probeset(sc->sc_configaddr + tag + reg,
+                bus_type_asi[sc->sc_configtag->type],
+                4, data);
+#else
        membar_sync();
-#if 0
-       probeset(bus_type_asi[sc->sc_configtag->type],
-                sc->sc_configaddr + tag + reg, 4, data);
-#else
        bus_space_write_4(sc->sc_configtag, sc->sc_configaddr, tag + reg, data);
+       membar_sync();
 #endif
-       membar_sync();
 }
 
 /*
diff -r 67855d23f866 -r 6649c7df89e0 sys/arch/sparc64/include/cpu.h
--- a/sys/arch/sparc64/include/cpu.h    Sat Jun 05 20:44:57 1999 +0000
+++ b/sys/arch/sparc64/include/cpu.h    Sat Jun 05 21:58:16 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.8 1999/06/05 20:38:25 eeh Exp $ */
+/*     $NetBSD: cpu.h,v 1.9 1999/06/05 21:58:18 eeh Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -180,7 +180,8 @@
 struct fpstate;
 void   savefpstate __P((struct fpstate *));
 void   loadfpstate __P((struct fpstate *));
-int    probeget __P((int, paddr_t, int));
+int    probeget __P((paddr_t, int, int));
+int    probeset __P((paddr_t, int, int, u_int64_t));
 #if 0
 void   write_all_windows __P((void));
 void   write_user_windows __P((void));
diff -r 67855d23f866 -r 6649c7df89e0 sys/arch/sparc64/include/ctlreg.h
--- a/sys/arch/sparc64/include/ctlreg.h Sat Jun 05 20:44:57 1999 +0000
+++ b/sys/arch/sparc64/include/ctlreg.h Sat Jun 05 21:58:16 1999 +0000
@@ -1,41 +1,18 @@
-/*     $NetBSD: ctlreg.h,v 1.10 1999/05/31 00:13:16 eeh Exp $ */
+/*     $NetBSD: ctlreg.h,v 1.11 1999/06/05 21:58:18 eeh Exp $ */
 
 /*
- * Copyright (c) 1996
- *     The President and Fellows of Harvard College. All rights reserved.
- * Copyright (c) 1992, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- *     This product includes software developed by Harvard University.
- *     This product includes software developed by the University of
- *     California, Lawrence Berkeley Laboratory.
+ * Copyright (c) 1996-1999 Eduardo Horvath
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  * 1. Redistributions of source code must retain the above copyright
  *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ *  
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR  ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR  BE LIABLE
  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
@@ -44,13 +21,6 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)ctlreg.h    8.1 (Berkeley) 6/11/93
- */
-
-/*
- * Sun4u support by Eduardo Horvath
- * Changes Copyright (c) 1996 Eduardo Horvath
- * All rights reserved.
  */
 
 /*
diff -r 67855d23f866 -r 6649c7df89e0 sys/arch/sparc64/include/param.h
--- a/sys/arch/sparc64/include/param.h  Sat Jun 05 20:44:57 1999 +0000
+++ b/sys/arch/sparc64/include/param.h  Sat Jun 05 21:58:16 1999 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: param.h,v 1.9 1999/01/31 09:21:20 mrg Exp $ */
+/*     $NetBSD: param.h,v 1.10 1999/06/05 21:58:18 eeh Exp $ */
 
 /*
- * Copyright (c) 1992, 1993
+ * Copyright (c) 1992-1999
  *     The Regents of the University of California.  All rights reserved.
  *
  * This software was developed by the Computer Systems Engineering group
@@ -43,11 +43,7 @@
  *
  *     @(#)param.h     8.1 (Berkeley) 6/11/93
  */
-/*
- * Sun4M support by Aaron Brown, Harvard University.
- * Changes Copyright (c) 1995 The President and Fellows of Harvard College.
- * All rights reserved.
- */
+
 #define        _MACHINE        sparc64
 #define        MACHINE         "sparc64"
 #ifdef __arch64__
diff -r 67855d23f866 -r 6649c7df89e0 sys/arch/sparc64/include/pte.h
--- a/sys/arch/sparc64/include/pte.h    Sat Jun 05 20:44:57 1999 +0000
+++ b/sys/arch/sparc64/include/pte.h    Sat Jun 05 21:58:16 1999 +0000
@@ -1,42 +1,18 @@
-/*     $NetBSD: pte.h,v 1.4 1999/05/30 19:01:50 eeh Exp $ */
+/*     $NetBSD: pte.h,v 1.5 1999/06/05 21:58:18 eeh Exp $ */
 
 /*
- * Copyright (c) 1996
- *     The President and Fellows of Harvard College. All rights reserved.
- * Copyright (c) 1992, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * This software was developed by the Computer Systems Engineering group
- * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
- * contributed to Berkeley.
- *
- * All advertising materials mentioning features or use of this software
- * must display the following acknowledgements:
- *     This product includes software developed by Harvard University.
- *     This product includes software developed by the University of
- *     California, Lawrence Berkeley Laboratory.
+ * Copyright (c) 1996-1999 Eduardo Horvath
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  * 1. Redistributions of source code must retain the above copyright
  *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgements:
- *     This product includes software developed by Harvard University.
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ *  
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR  ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR  BE LIABLE
  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
@@ -45,7 +21,6 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)pte.h       8.1 (Berkeley) 6/11/93
  */
 



Home | Main Index | Thread Index | Old Index