Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc/include Do not use #ifdef SUN4U when testing ...



details:   https://anonhg.NetBSD.org/src/rev/a8e7e6a94e95
branches:  trunk
changeset: 340859:a8e7e6a94e95
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Oct 06 20:03:05 2015 +0000

description:
Do not use #ifdef SUN4U when testing for cpu features of post-v8 CPUs,
it is not good for SUN4V-only kernels. Instead use __sparc_v9__ (which
is also defined by the sparc compiler when called with cpu=ultrasparc).
ok: mrg@

diffstat:

 sys/arch/sparc/include/frame.h    |   4 ++--
 sys/arch/sparc/include/openfirm.h |   8 ++++----
 sys/arch/sparc/include/types.h    |  10 +++++-----
 3 files changed, 11 insertions(+), 11 deletions(-)

diffs (98 lines):

diff -r ff74802f36bb -r a8e7e6a94e95 sys/arch/sparc/include/frame.h
--- a/sys/arch/sparc/include/frame.h    Tue Oct 06 17:36:25 2015 +0000
+++ b/sys/arch/sparc/include/frame.h    Tue Oct 06 20:03:05 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: frame.h,v 1.8 2011/04/12 07:54:16 mrg Exp $ */
+/*     $NetBSD: frame.h,v 1.9 2015/10/06 20:03:05 martin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -56,7 +56,7 @@
  * windows to the stack.
  */
 #ifndef _LOCORE
-#ifndef SUN4U
+#ifndef __sparc_v9__
 struct frame {
        int32_t fr_local[8];    /* space to save locals (%l0..%l7) */
        int32_t fr_arg[6];      /* space to save arguments (%i0..%i5) */
diff -r ff74802f36bb -r a8e7e6a94e95 sys/arch/sparc/include/openfirm.h
--- a/sys/arch/sparc/include/openfirm.h Tue Oct 06 17:36:25 2015 +0000
+++ b/sys/arch/sparc/include/openfirm.h Tue Oct 06 20:03:05 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: openfirm.h,v 1.8 2015/03/27 06:10:25 nakayama Exp $    */
+/*     $NetBSD: openfirm.h,v 1.9 2015/10/06 20:03:05 martin Exp $      */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -39,7 +39,7 @@
 
 #include <dev/ofw/openfirm.h>
 
-#ifdef SUN4U
+#ifdef __sparc_v9__
 /* All cells are 8 byte slots */
 typedef uint64_t cell_t;
 #ifdef __arch64__
@@ -52,14 +52,14 @@
 #define HDQ2CELL_HI(x) (cell_t)(0)
 #define HDQ2CELL_LO(x) (cell_t)(x)
 #define CELL2HDQ(hi,lo)        (lo)
-#else /* SUN4U */
+#else /* __sparc_v9__ */
 /* All cells are 4 byte slots */
 typedef uint32_t cell_t;
 #define HDL2CELL(x)    (cell_t)(x)
 #define ADR2CELL(x)    (cell_t)(x)
 #define HDQ2CELL_HI(x) (cell_t)((x) >> 32)
 #define HDQ2CELL_LO(x) (cell_t)(x)
-#endif /* SUN4U */
+#endif /* __sparc_v9__ */
 
 int    OF_test(const char *);
 int    OF_test_method(int, const char *);
diff -r ff74802f36bb -r a8e7e6a94e95 sys/arch/sparc/include/types.h
--- a/sys/arch/sparc/include/types.h    Tue Oct 06 17:36:25 2015 +0000
+++ b/sys/arch/sparc/include/types.h    Tue Oct 06 20:03:05 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: types.h,v 1.63 2015/08/27 12:30:51 pooka Exp $ */
+/*     $NetBSD: types.h,v 1.64 2015/10/06 20:03:05 martin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -73,7 +73,7 @@
 
 #if defined(_KERNEL)
 typedef struct label_t {
-#ifdef SUN4U
+#ifdef __sparc_v9__
        register64_t val[2];
 #else
        register_t val[3];
@@ -87,7 +87,7 @@
 #define        PRIxVADDR               "lx"
 #define        PRIxVSIZE               "lx"
 #define        PRIuVSIZE               "lu"
-#ifdef SUN4U
+#ifdef __sparc_v9__
 #ifdef __arch64__
 typedef unsigned long int      paddr_t;
 #define        PRIxPADDR               "lx"
@@ -102,7 +102,7 @@
 typedef unsigned long int      paddr_t;
 #define        PRIxPADDR               "lx"
 #define        PRIuPSIZE               "lu"
-#endif /* SUN4U */
+#endif /* __sparc_v9__ */
 typedef paddr_t                        psize_t;
 #define        PRIxPSIZE               PRIxPADDR
 #endif
@@ -124,7 +124,7 @@
 #define        __HAVE_CPU_VMSPACE_EXEC
 #define        __HAVE_RAS
 
-#ifdef SUN4U
+#ifdef __sparc_v9__
 #define        __HAVE_DEVICE_REGISTER_POSTCONFIG
 #define        __HAVE_ATOMIC64_OPS
 #define        __HAVE_CPU_COUNTER      /* sparc v9 CPUs have %tick */



Home | Main Index | Thread Index | Old Index