Source-Changes-HG archive

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

[src/nathanw_sa]: src/sys Sync with HEAD (again).



details:   https://anonhg.NetBSD.org/src/rev/04cad6086446
branches:  nathanw_sa
changeset: 506655:04cad6086446
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Jan 03 17:25:02 2003 +0000

description:
Sync with HEAD (again).

diffstat:

 sys/arch/sparc/dev/obio.c         |   12 +-
 sys/arch/sparc/dev/vme_machdep.c  |   14 +-
 sys/arch/sparc/include/bus.h      |  358 ++++++++++++++++++++++++++++++++++++-
 sys/arch/sparc/include/cpu.h      |   10 +-
 sys/arch/sparc/include/proc.h     |    4 +-
 sys/arch/sparc/sparc/cache.c      |   60 ++++-
 sys/arch/sparc/sparc/cpu.c        |   27 +-
 sys/arch/sparc/sparc/cpuvar.h     |   23 ++-
 sys/arch/sparc/sparc/intr.c       |    7 +-
 sys/arch/sparc/sparc/machdep.c    |   37 ++-
 sys/arch/sparc/sparc/msiiep.c     |   26 ++-
 sys/arch/sparc/sparc/pmap.c       |   91 ++++----
 sys/arch/sparc/sparc/trap.c       |   35 +--
 sys/arch/sparc/sparc/vm_machdep.c |   38 ++-
 sys/dev/sbus/stp4020.c            |  131 ++++++++++++-
 15 files changed, 706 insertions(+), 167 deletions(-)

diffs (truncated from 1483 to 300 lines):

diff -r 25520ec8d633 -r 04cad6086446 sys/arch/sparc/dev/obio.c
--- a/sys/arch/sparc/dev/obio.c Fri Jan 03 16:57:11 2003 +0000
+++ b/sys/arch/sparc/dev/obio.c Fri Jan 03 17:25:02 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: obio.c,v 1.50.4.6 2003/01/03 16:55:23 thorpej Exp $    */
+/*     $NetBSD: obio.c,v 1.50.4.7 2003/01/03 17:25:02 thorpej Exp $    */
 
 /*-
  * Copyright (c) 1997,1998 The NetBSD Foundation, Inc.
@@ -108,6 +108,16 @@
        NULL,                           /* bus_space_barrier */ 
        obio_bus_mmap,                  /* bus_space_mmap */ 
        NULL                            /* bus_intr_establish */
+#if __FULL_SPARC_BUS_SPACE
+       NULL,                           /* read_1 */
+       NULL,                           /* read_2 */
+       NULL,                           /* read_4 */
+       NULL,                           /* read_8 */
+       NULL,                           /* write_1 */
+       NULL,                           /* write_2 */
+       NULL,                           /* write_4 */
+       NULL,                           /* write_8 */
+#endif
 }; 
 #endif
 
diff -r 25520ec8d633 -r 04cad6086446 sys/arch/sparc/dev/vme_machdep.c
--- a/sys/arch/sparc/dev/vme_machdep.c  Fri Jan 03 16:57:11 2003 +0000
+++ b/sys/arch/sparc/dev/vme_machdep.c  Fri Jan 03 17:25:02 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vme_machdep.c,v 1.34.4.9 2002/12/29 19:40:12 thorpej Exp $     */
+/*     $NetBSD: vme_machdep.c,v 1.34.4.10 2003/01/03 17:25:03 thorpej Exp $    */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -212,7 +212,17 @@
        NULL, /* bus_subregion */
        NULL, /* barrier */
        NULL, /* mmap */
-       NULL  /* intr_establish */
+       NULL, /* intr_establish */
+#if __FULL_SPARC_BUS_SPACE
+       NULL, /* read_1 */
+       NULL, /* read_2 */
+       NULL, /* read_4 */
+       NULL, /* read_8 */
+       NULL, /* write_1 */
+       NULL, /* write_2 */
+       NULL, /* write_4 */
+       NULL  /* write_8 */
+#endif
 };
 
 struct vme_chipset_tag sparc_vme_chipset_tag = {
diff -r 25520ec8d633 -r 04cad6086446 sys/arch/sparc/include/bus.h
--- a/sys/arch/sparc/include/bus.h      Fri Jan 03 16:57:11 2003 +0000
+++ b/sys/arch/sparc/include/bus.h      Fri Jan 03 17:25:02 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.h,v 1.26.4.6 2002/12/11 06:12:07 thorpej Exp $     */
+/*     $NetBSD: bus.h,v 1.26.4.7 2003/01/03 17:25:04 thorpej Exp $     */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -87,6 +87,22 @@
        ((((u_int64_t)(u_int32_t)(io))<<32) | (u_int32_t)(pa))
 
 /*
+ * If __FULL_SPARC_BUS_SPACE is not defined, define it to 0.  We normally
+ * don't need to deal with bus_space_{read,write}*() needing to be
+ * functions rather than simple memory accesses.  We expose the option
+ * to the user via FULL_SPARC_BUS_SPACE.
+ */
+#ifdef FULL_SPARC_BUS_SPACE
+#define __FULL_SPARC_BUS_SPACE  1
+#endif
+
+#ifndef __FULL_SPARC_BUS_SPACE
+#define __FULL_SPARC_BUS_SPACE  0
+#endif
+
+#define __BUS_SPACE_HAS_STREAM_METHODS 1
+
+/*
  * Access methods for bus resources and address space.
  */
 typedef struct sparc_bus_space_tag     *bus_space_tag_t;
@@ -144,6 +160,51 @@
                                void *,                 /*handler arg*/
                                void (*)(void)));       /*optional fast vector*/
 
+#if __FULL_SPARC_BUS_SPACE
+       u_int8_t (*sparc_read_1) __P((
+                               bus_space_tag_t space,
+                               bus_space_handle_t handle,
+                               bus_size_t offset));
+
+       u_int16_t (*sparc_read_2) __P((
+                               bus_space_tag_t space,
+                               bus_space_handle_t handle,
+                               bus_size_t offset));
+
+       u_int32_t (*sparc_read_4) __P((
+                               bus_space_tag_t space,
+                               bus_space_handle_t handle,
+                               bus_size_t offset));
+
+       u_int64_t (*sparc_read_8) __P((
+                               bus_space_tag_t space,
+                               bus_space_handle_t handle,
+                               bus_size_t offset));
+
+       void    (*sparc_write_1) __P((
+                               bus_space_tag_t space,
+                               bus_space_handle_t handle,
+                               bus_size_t offset,
+                               u_int8_t value));
+
+       void    (*sparc_write_2) __P((
+                               bus_space_tag_t space,
+                               bus_space_handle_t handle,
+                               bus_size_t offset,
+                               u_int16_t value));
+
+       void    (*sparc_write_4) __P((
+                               bus_space_tag_t space,
+                               bus_space_handle_t handle,
+                               bus_size_t offset,
+                               u_int32_t value));
+
+       void    (*sparc_write_8) __P((
+                               bus_space_tag_t space,
+                               bus_space_handle_t handle,
+                               bus_size_t offset,
+                               u_int64_t value));
+#endif
 };
 
 #if 0
@@ -364,22 +425,91 @@
  * described by tag/handle/offset.
  */
 
-#define        bus_space_read_1(t, h, o)                                       \
+#define        bus_space_read_1_real(t, h, o)                                  \
            ((void)(t), *(volatile u_int8_t *)((h) + (o)))
 
-#define        bus_space_read_2(t, h, o)                                       \
+#define        bus_space_read_2_real(t, h, o)                                  \
            ((void)(t), *(volatile u_int16_t *)((h) + (o)))
 
-#define        bus_space_read_4(t, h, o)                                       \
+#define        bus_space_read_4_real(t, h, o)                                  \
            ((void)(t), *(volatile u_int32_t *)((h) + (o)))
 
-#define        bus_space_read_8(t, h, o)                                       \
+#define        bus_space_read_8_real(t, h, o)                                  \
            ((void)(t), *(volatile u_int64_t *)((h) + (o)))
 
-#define bus_space_read_stream_1 bus_space_read_1
-#define bus_space_read_stream_2 bus_space_read_2
-#define bus_space_read_stream_4 bus_space_read_4
-#define bus_space_read_stream_8 bus_space_read_8
+
+#if __FULL_SPARC_BUS_SPACE
+
+static __inline__ u_int8_t bus_space_read_1 __P((bus_space_tag_t,
+                                                 bus_space_handle_t,
+                                                 bus_size_t));
+static __inline__ u_int16_t bus_space_read_2 __P((bus_space_tag_t,
+                                                 bus_space_handle_t,
+                                                 bus_size_t));
+static __inline__ u_int32_t bus_space_read_4 __P((bus_space_tag_t,
+                                                 bus_space_handle_t,
+                                                 bus_size_t));
+static __inline__ u_int64_t bus_space_read_8 __P((bus_space_tag_t,
+                                                 bus_space_handle_t,
+                                                 bus_size_t));
+
+static __inline__ u_int8_t
+bus_space_read_1(t, h, o)
+       bus_space_tag_t         t;
+       bus_space_handle_t      h;
+       bus_size_t              o;
+{
+       return t->sparc_read_1 ?
+               (*t->sparc_read_1)(t, h, o) :
+               bus_space_read_1_real(t, h, o);
+}
+
+static __inline__ u_int16_t
+bus_space_read_2(t, h, o)
+       bus_space_tag_t         t;
+       bus_space_handle_t      h;
+       bus_size_t              o;
+{
+       return t->sparc_read_2 ?
+               (*t->sparc_read_2)(t, h, o) :
+               bus_space_read_2_real(t, h, o);
+}
+
+static __inline__ u_int32_t
+bus_space_read_4(t, h, o)
+       bus_space_tag_t         t;
+       bus_space_handle_t      h;
+       bus_size_t              o;
+{
+       return t->sparc_read_4 ?
+               (*t->sparc_read_4)(t, h, o) :
+               bus_space_read_4_real(t, h, o);
+}
+
+static __inline__ u_int64_t
+bus_space_read_8(t, h, o)
+       bus_space_tag_t         t;
+       bus_space_handle_t      h;
+       bus_size_t              o;
+{
+       return t->sparc_read_8 ?
+               (*t->sparc_read_8)(t, h, o) :
+               bus_space_read_8_real(t, h, o);
+}
+
+#else /* __FULL_SPARC_BUS_SPACE */
+
+#define        bus_space_read_1        bus_space_read_1_real
+#define        bus_space_read_2        bus_space_read_2_real
+#define        bus_space_read_4        bus_space_read_4_real
+#define        bus_space_read_8        bus_space_read_8_real
+
+#endif /* __FULL_SPARC_BUS_SPACE */
+
+#define bus_space_read_stream_1 bus_space_read_1_real
+#define bus_space_read_stream_2 bus_space_read_2_real
+#define bus_space_read_stream_4 bus_space_read_4_real
+#define bus_space_read_stream_8 bus_space_read_8_real
 
 
 /*
@@ -391,26 +521,107 @@
  * described by tag/handle/offset.
  */
 
-#define        bus_space_write_1(t, h, o, v)   do {                            \
+#define        bus_space_write_1_real(t, h, o, v)      do {                    \
        ((void)(t), (void)(*(volatile u_int8_t *)((h) + (o)) = (v)));   \
 } while (/* CONSTCOND */ 0)
 
-#define        bus_space_write_2(t, h, o, v)   do {                            \
+#define        bus_space_write_2_real(t, h, o, v)      do {                    \
        ((void)(t), (void)(*(volatile u_int16_t *)((h) + (o)) = (v)));  \
 } while (/* CONSTCOND */ 0)
 
-#define        bus_space_write_4(t, h, o, v)   do {                            \
+#define        bus_space_write_4_real(t, h, o, v)      do {                    \
        ((void)(t), (void)(*(volatile u_int32_t *)((h) + (o)) = (v)));  \
 } while (/* CONSTCOND */ 0)
 
-#define        bus_space_write_8(t, h, o, v)   do {                            \
+#define        bus_space_write_8_real(t, h, o, v)      do {                    \
        ((void)(t), (void)(*(volatile u_int64_t *)((h) + (o)) = (v)));  \
 } while (/* CONSTCOND */ 0)
 
-#define bus_space_write_stream_1 bus_space_write_1
-#define bus_space_write_stream_2 bus_space_write_2
-#define bus_space_write_stream_4 bus_space_write_4
-#define bus_space_write_stream_8 bus_space_write_8
+
+#if __FULL_SPARC_BUS_SPACE
+
+static __inline__ void bus_space_write_1 __P((bus_space_tag_t,
+                                             bus_space_handle_t,
+                                             bus_size_t,
+                                             const u_int8_t));
+static __inline__ void bus_space_write_2 __P((bus_space_tag_t,
+                                             bus_space_handle_t,
+                                             bus_size_t,
+                                             const u_int16_t));
+static __inline__ void bus_space_write_4 __P((bus_space_tag_t,
+                                             bus_space_handle_t,
+                                             bus_size_t,
+                                             const u_int32_t));
+static __inline__ void bus_space_write_8 __P((bus_space_tag_t,
+                                             bus_space_handle_t,
+                                             bus_size_t,
+                                             const u_int64_t));
+
+static __inline__ void
+bus_space_write_1(t, h, o, v)
+       bus_space_tag_t         t;
+       bus_space_handle_t      h;
+       bus_size_t              o;
+       u_int8_t                v;
+{
+       if (t->sparc_write_1)
+               (*t->sparc_write_1)(t, h, o, v);
+       else
+               bus_space_write_1_real(t, h, o, v);
+}
+
+static __inline__ void



Home | Main Index | Thread Index | Old Index