CVS commit: src/sys/arch/sh3/include

2020-09-13 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Sep 14 05:04:05 UTC 2020

Modified Files:
src/sys/arch/sh3/include: ptrace.h

Log Message:
apply some parens to make macros safe.  fixes GCC 9 sanitizer issues.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/sh3/include/ptrace.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/ptrace.h
diff -u src/sys/arch/sh3/include/ptrace.h:1.17 src/sys/arch/sh3/include/ptrace.h:1.18
--- src/sys/arch/sh3/include/ptrace.h:1.17	Tue Dec 24 14:50:59 2019
+++ src/sys/arch/sh3/include/ptrace.h	Mon Sep 14 05:04:05 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ptrace.h,v 1.17 2019/12/24 14:50:59 kamil Exp $	*/
+/*	$NetBSD: ptrace.h,v 1.18 2020/09/14 05:04:05 mrg Exp $	*/
 
 /*
  * Copyright (c) 1993 Christopher G. Demetriou
@@ -66,11 +66,11 @@
 	"PT_CLEARSTEP"
 
 #include 
-#define PTRACE_REG_PC(r)	r->r_spc
-#define PTRACE_REG_FP(r)	r->r_r14
-#define PTRACE_REG_SET_PC(r, v)	r->r_spc = (v)
-#define PTRACE_REG_SP(r)	r->r_r15
-#define PTRACE_REG_INTV(r)	r->r_r0
+#define PTRACE_REG_PC(r)	(r)->r_spc
+#define PTRACE_REG_FP(r)	(r)->r_r14
+#define PTRACE_REG_SET_PC(r, v)	(r)->r_spc = (v)
+#define PTRACE_REG_SP(r)	(r)->r_r15
+#define PTRACE_REG_INTV(r)	(r)->r_r0
 
 #define PTRACE_ILLEGAL_ASM	__asm __volatile ("0: bra 0b; bra 0b" : : : "memory")
 



CVS commit: src/sys/arch/sh3/include

2020-07-30 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jul 30 21:25:43 UTC 2020

Modified Files:
src/sys/arch/sh3/include: pmb.h

Log Message:
Publicly declare st40_pmb_init().


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sh3/include/pmb.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/pmb.h
diff -u src/sys/arch/sh3/include/pmb.h:1.3 src/sys/arch/sh3/include/pmb.h:1.4
--- src/sys/arch/sh3/include/pmb.h:1.3	Thu Jul 30 20:59:08 2020
+++ src/sys/arch/sh3/include/pmb.h	Thu Jul 30 21:25:43 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: pmb.h,v 1.3 2020/07/30 20:59:08 uwe Exp $ */
+/* $NetBSD: pmb.h,v 1.4 2020/07/30 21:25:43 uwe Exp $ */
 /*
  * Copyright (c) 2020 Valery Ushakov
  * All rights reserved.
@@ -118,4 +118,9 @@
 	":\01""WT\0"			\
 	":\0" "CB\0"
 
+
+#ifndef _LOCORE
+void st40_pmb_init(int);
+#endif	/* !_LOCORE */
+
 #endif	/* !_SH3_PMB_H_ */



CVS commit: src/sys/arch/sh3/include

2020-07-30 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jul 30 20:59:09 UTC 2020

Modified Files:
src/sys/arch/sh3/include: pmb.h

Log Message:
ST40_PMB_DA_BITS - all values for the non-continuous size field.

Size field has two reserved bits in the middle.  Don't depend on them
being zero, they can be defined in future versions.  Provide exhaustive
list with all possibile "filler" bits in the middle so that we
correctly report the size field value regardless of the unrelated bits.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sh3/include/pmb.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/pmb.h
diff -u src/sys/arch/sh3/include/pmb.h:1.2 src/sys/arch/sh3/include/pmb.h:1.3
--- src/sys/arch/sh3/include/pmb.h:1.2	Thu Jul 30 03:19:33 2020
+++ src/sys/arch/sh3/include/pmb.h	Thu Jul 30 20:59:08 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: pmb.h,v 1.2 2020/07/30 03:19:33 uwe Exp $ */
+/* $NetBSD: pmb.h,v 1.3 2020/07/30 20:59:08 uwe Exp $ */
 /*
  * Copyright (c) 2020 Valery Ushakov
  * All rights reserved.
@@ -87,15 +87,31 @@
 #define   ST40_PMB_DA_PPN_MASK		0xff00
 #define   ST40_PMB_DA_PPN_SHIFT		24
 
+/*
+ * size field is not continuous hence the kludgy list with all the
+ * possible junk bits in the middle.
+ */
 #define   ST40_PMB_DA_BITS			\
 	  "\177\020"\
 	  "f\030\010" "PPN\0"			\
 	  "b\010" "V\0"			\
 	  "F\04\04"   "\0"			\
+	":\017"   "512M\0"			\
+	":\016"   "128M\0"			\
+	":\015"   "512M\0"			\
+	":\014"   "128M\0"			\
+	":\013"   "512M\0"			\
+	":\012"   "128M\0"			\
 	":\011"   "512M\0"			\
 	":\010"   "128M\0"			\
-	":\01""64M\0"			\
-	":\0" "16M\0"			\
+	":\007""64M\0"			\
+	":\006""16M\0"			\
+	":\005""64M\0"			\
+	":\004""16M\0"			\
+	":\003""64M\0"			\
+	":\002""16M\0"			\
+	":\001""64M\0"			\
+	":\000""16M\0"			\
 	  "b\011" "UB\0"			\
 	  "b\03"  "C\0"			\
 	  "F\0\01""\0"			\



CVS commit: src/sys/arch/sh3/include

2020-07-29 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Jul 30 03:19:34 UTC 2020

Modified Files:
src/sys/arch/sh3/include: pmb.h

Log Message:
Add snprintb formats.  Fix PASCR name.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sh3/include/pmb.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/pmb.h
diff -u src/sys/arch/sh3/include/pmb.h:1.1 src/sys/arch/sh3/include/pmb.h:1.2
--- src/sys/arch/sh3/include/pmb.h:1.1	Sat Jul 25 22:26:59 2020
+++ src/sys/arch/sh3/include/pmb.h	Thu Jul 30 03:19:33 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: pmb.h,v 1.1 2020/07/25 22:26:59 uwe Exp $ */
+/* $NetBSD: pmb.h,v 1.2 2020/07/30 03:19:33 uwe Exp $ */
 /*
  * Copyright (c) 2020 Valery Ushakov
  * All rights reserved.
@@ -44,10 +44,15 @@
 
 
 /* Physical address space control register (ST4-300) */
-#define ST40_PMB_PASCR			0xff70
+#define ST40_PASCR			0xff70
 #define   ST40_PASCR_UB_MASK		  0x000f
 #define   ST40_PASCR_SE			  0x8000
 
+#define   ST40_PASCR_BITS			\
+		"\177\020"			\
+		"b\037"  "SE\0"			\
+		"f\0\04" "UB\0"
+
 
 /* Memory-mapped PMB */
 #define ST40_PMB_ENTRY			16
@@ -62,6 +67,11 @@
 #define   ST40_PMB_AA_VPN_MASK		  0xff00
 #define   ST40_PMB_AA_VPN_SHIFT		  24
 
+#define   ST40_PMB_AA_BITS			\
+	  "\177\020"\
+	  "f\030\010" "VPN\0"			\
+	  "b\010" "V\0"
+
 
 /* PMB Data Array */
 #define   ST40_PMB_DA			0xf710
@@ -77,4 +87,19 @@
 #define   ST40_PMB_DA_PPN_MASK		0xff00
 #define   ST40_PMB_DA_PPN_SHIFT		24
 
+#define   ST40_PMB_DA_BITS			\
+	  "\177\020"\
+	  "f\030\010" "PPN\0"			\
+	  "b\010" "V\0"			\
+	  "F\04\04"   "\0"			\
+	":\011"   "512M\0"			\
+	":\010"   "128M\0"			\
+	":\01""64M\0"			\
+	":\0" "16M\0"			\
+	  "b\011" "UB\0"			\
+	  "b\03"  "C\0"			\
+	  "F\0\01""\0"			\
+	":\01""WT\0"			\
+	":\0" "CB\0"
+
 #endif	/* !_SH3_PMB_H_ */



CVS commit: src/sys/arch/sh3/include

2020-07-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jul 28 01:40:43 UTC 2020

Modified Files:
src/sys/arch/sh3/include: cputypes.h

Log Message:
_LKM -> _MODULE


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/sh3/include/cputypes.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/cputypes.h
diff -u src/sys/arch/sh3/include/cputypes.h:1.13 src/sys/arch/sh3/include/cputypes.h:1.14
--- src/sys/arch/sh3/include/cputypes.h:1.13	Sat Jul 25 22:59:55 2020
+++ src/sys/arch/sh3/include/cputypes.h	Tue Jul 28 01:40:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cputypes.h,v 1.13 2020/07/25 22:59:55 uwe Exp $	*/
+/*	$NetBSD: cputypes.h,v 1.14 2020/07/28 01:40:43 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -33,8 +33,8 @@
 
 #if defined(_KERNEL_OPT)
 #include "opt_cputype.h"
-#elif defined(_LKM)
-/* If building an LKM, include both SH3 and SH4 support. */
+#elif defined(_MODULE)
+/* If building a module, include both SH3 and SH4 support. */
 #define	SH3
 #define	SH4
 #endif



CVS commit: src/sys/arch/sh3/include

2020-07-25 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Jul 25 22:59:55 UTC 2020

Modified Files:
src/sys/arch/sh3/include: cputypes.h

Log Message:
Define CPU_PRODUCT_STX7105.

I'm not sure if this should rather be named CPU_PRODUCT_ST40_300, but
that's probably too general.  These constants don't have to be
backward compatible, so we can re-do this properly later if we need to.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sh3/include/cputypes.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/cputypes.h
diff -u src/sys/arch/sh3/include/cputypes.h:1.12 src/sys/arch/sh3/include/cputypes.h:1.13
--- src/sys/arch/sh3/include/cputypes.h:1.12	Tue Apr 21 12:57:41 2009
+++ src/sys/arch/sh3/include/cputypes.h	Sat Jul 25 22:59:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cputypes.h,v 1.12 2009/04/21 12:57:41 nonaka Exp $	*/
+/*	$NetBSD: cputypes.h,v 1.13 2020/07/25 22:59:55 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -57,6 +57,9 @@
 #define	CPU_PRODUCT_7751	10
 #define	CPU_PRODUCT_7751R	11
 
+/* STMicroelectronics ST40 series (SH4) */
+#define CPU_PRODUCT_STX7105	12	/* ST40-300 */
+
 
 #ifndef _LOCORE
 extern int cpu_arch;



CVS commit: src/sys/arch/sh3/include

2020-07-25 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Jul 25 22:26:59 UTC 2020

Added Files:
src/sys/arch/sh3/include: pmb.h

Log Message:
Definitions for ST40 Privileged Mapping Buffer.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/sh3/include/pmb.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/sys/arch/sh3/include/pmb.h
diff -u /dev/null src/sys/arch/sh3/include/pmb.h:1.1
--- /dev/null	Sat Jul 25 22:26:59 2020
+++ src/sys/arch/sh3/include/pmb.h	Sat Jul 25 22:26:59 2020
@@ -0,0 +1,80 @@
+/* $NetBSD: pmb.h,v 1.1 2020/07/25 22:26:59 uwe Exp $ */
+/*
+ * Copyright (c) 2020 Valery Ushakov
+ * All rights reserved.
+ *
+ * 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.
+ *
+ * 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 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) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _SH3_PMB_H_
+#define	_SH3_PMB_H_
+/*
+ * ST40 Privileged Mapping Buffer (PMB)
+ *
+ * Original SuperH can handle only 29-bit external memory space.
+ * "The physical address space is permanently mapped onto 29-bit
+ * external memory space."  See .
+ *
+ * ST40-200, ST40-300 and ST40-500 have "space enhanced" SE mode where
+ * the mapping from the physical address space P1 and P2 segments to
+ * the 32-bit external memory space is defined via 16-entry PMB.
+ */
+
+
+/* on ST40-200 and ST40-500 SE bit is in MMUCR */
+#define ST40_MMUCR_SE			0x0010
+
+
+/* Physical address space control register (ST4-300) */
+#define ST40_PMB_PASCR			0xff70
+#define   ST40_PASCR_UB_MASK		  0x000f
+#define   ST40_PASCR_SE			  0x8000
+
+
+/* Memory-mapped PMB */
+#define ST40_PMB_ENTRY			16
+
+#define ST40_PMB_E_MASK			0x0f00
+#define ST40_PMB_E_SHIFT		8
+
+
+/* PMB Address Array */
+#define ST40_PMB_AA			0xf610
+#define   ST40_PMB_AA_V			  0x0100
+#define   ST40_PMB_AA_VPN_MASK		  0xff00
+#define   ST40_PMB_AA_VPN_SHIFT		  24
+
+
+/* PMB Data Array */
+#define   ST40_PMB_DA			0xf710
+#define   ST40_PMB_DA_WT		0x0001
+#define   ST40_PMB_DA_C			0x0008
+#define   ST40_PMB_DA_UB		0x0200
+#define   ST40_PMB_DA_SZ_MASK		0x0090
+#define ST40_PMB_DA_SZ_16M		0x
+#define ST40_PMB_DA_SZ_64M		0x0010
+#define ST40_PMB_DA_SZ_128M		0x0080
+#define ST40_PMB_DA_SZ_512M		0x0090
+#define   ST40_PMB_DA_V			0x0100
+#define   ST40_PMB_DA_PPN_MASK		0xff00
+#define   ST40_PMB_DA_PPN_SHIFT		24
+
+#endif	/* !_SH3_PMB_H_ */



CVS commit: src/sys/arch/sh3/include

2020-07-10 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Jul 11 03:53:32 UTC 2020

Modified Files:
src/sys/arch/sh3/include: clock.h

Log Message:
Fix doc comment for sh_clock_init.

Forgot to update it back in 2006 when sh3 ports were converted to
todr(9) and its second argument (struct rtc_ops) was removed.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sh3/include/clock.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/clock.h
diff -u src/sys/arch/sh3/include/clock.h:1.4 src/sys/arch/sh3/include/clock.h:1.5
--- src/sys/arch/sh3/include/clock.h:1.4	Mon Apr 28 20:23:35 2008
+++ src/sys/arch/sh3/include/clock.h	Sat Jul 11 03:53:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.h,v 1.4 2008/04/28 20:23:35 martin Exp $	*/
+/*	$NetBSD: clock.h,v 1.5 2020/07/11 03:53:32 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,14 +30,11 @@
  */
 
 /*
- * void sh_clock_init(int flags, struct rtc_ops *):
+ * void sh_clock_init(int flags):
  *   flags:
  *	SH_CLOCK_NORTC		... If SH RTC module is disabled, set this.
  *internal module don't use RTCCLK.
  *	SH_CLOCK_NOINITTODR	... Don't initialize RTC time.
- *   rtc_ops:
- *	Machine dependent RTC ops pointer. If NULL is specified, use SH
- *	internal RTC.
  *
  * void machine_clock_init(void):
  *	Implement machine specific part of clock routines.



CVS commit: src/sys/arch/sh3/include

2020-01-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  7 07:41:20 UTC 2020

Modified Files:
src/sys/arch/sh3/include: userret.h

Log Message:
Fix indentation. NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/sh3/include/userret.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/userret.h
diff -u src/sys/arch/sh3/include/userret.h:1.17 src/sys/arch/sh3/include/userret.h:1.18
--- src/sys/arch/sh3/include/userret.h:1.17	Sun Dec  1 12:19:28 2019
+++ src/sys/arch/sh3/include/userret.h	Tue Jan  7 07:41:20 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: userret.h,v 1.17 2019/12/01 12:19:28 ad Exp $	*/
+/*	$NetBSD: userret.h,v 1.18 2020/01/07 07:41:20 skrll Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -75,7 +75,7 @@ userret(struct lwp *l)
 		if (CPU_IS_SH3) {
 			tf->tf_ubc = UBC_CYCLE_INSN | UBC_CYCLE_READ
 | SH3_UBC_CYCLE_CPU;
-	}
+		}
 #endif
 #ifdef SH4
 		if (CPU_IS_SH4) {



CVS commit: src/sys/arch/sh3/include

2019-01-08 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Jan  8 20:08:28 UTC 2019

Modified Files:
src/sys/arch/sh3/include: proc.h

Log Message:
remove  include, nothing from it is actually used here


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/sh3/include/proc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/proc.h
diff -u src/sys/arch/sh3/include/proc.h:1.17 src/sys/arch/sh3/include/proc.h:1.18
--- src/sys/arch/sh3/include/proc.h:1.17	Sun Jul  8 20:14:11 2012
+++ src/sys/arch/sh3/include/proc.h	Tue Jan  8 20:08:28 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.17 2012/07/08 20:14:11 dsl Exp $	*/
+/*	$NetBSD: proc.h,v 1.18 2019/01/08 20:08:28 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
@@ -39,8 +39,6 @@
  * Machine-dependent part of the proc structure for sh3.
  */
 
-#include 
-
 /* Kernel stack PTE */
 struct md_upte {
 	uint32_t addr;



CVS commit: src/sys/arch/sh3/include

2017-11-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 29 17:43:20 UTC 2017

Modified Files:
src/sys/arch/sh3/include: signal.h

Log Message:
need  for sigset_t


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/sh3/include/signal.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/signal.h
diff -u src/sys/arch/sh3/include/signal.h:1.13 src/sys/arch/sh3/include/signal.h:1.14
--- src/sys/arch/sh3/include/signal.h:1.13	Wed Nov 19 13:36:00 2008
+++ src/sys/arch/sh3/include/signal.h	Wed Nov 29 12:43:20 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.13 2008/11/19 18:36:00 ad Exp $	*/
+/*	$NetBSD: signal.h,v 1.14 2017/11/29 17:43:20 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991 Regents of the University of California.
@@ -39,7 +39,7 @@
 typedef int sig_atomic_t;
 
 #if defined(_NETBSD_SOURCE)
-
+#include 
 /*
  * Information pushed on stack when a signal is delivered.
  * This is used by the kernel to restore state following



CVS commit: src/sys/arch/sh3/include

2016-12-05 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Dec  5 12:42:33 UTC 2016

Modified Files:
src/sys/arch/sh3/include: elf_machdep.h

Log Message:
binutils decided to shuffle around its extensions a long time ago. Since
we don't actually use them for anything, follow them.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sh3/include/elf_machdep.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/elf_machdep.h
diff -u src/sys/arch/sh3/include/elf_machdep.h:1.11 src/sys/arch/sh3/include/elf_machdep.h:1.12
--- src/sys/arch/sh3/include/elf_machdep.h:1.11	Thu Oct 23 19:39:42 2014
+++ src/sys/arch/sh3/include/elf_machdep.h	Mon Dec  5 12:42:33 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf_machdep.h,v 1.11 2014/10/23 19:39:42 christos Exp $	*/
+/*	$NetBSD: elf_machdep.h,v 1.12 2016/12/05 12:42:33 joerg Exp $	*/
 
 #include 
 
@@ -47,6 +47,11 @@
 #define	R_SH_DIR8BP		7
 #define	R_SH_DIR8W		8
 #define	R_SH_DIR8L		9
+#define	R_SH_LOOP_START		10
+#define	R_SH_LOOP_END		11
+#define	R_SH_GNU_VTINHERIT	22
+#define	R_SH_GNU_VTENTRY	23
+#define	R_SH_SWITCH8		24
 #define	R_SH_SWITCH16		25
 #define	R_SH_SWITCH32		26
 #define	R_SH_USES		27
@@ -55,11 +60,6 @@
 #define	R_SH_CODE		30
 #define	R_SH_DATA		31
 #define	R_SH_LABEL		32
-#define	R_SH_SWITCH8		33
-#define	R_SH_GNU_VTINHERIT	34
-#define	R_SH_GNU_VTENTRY	35
-#define	R_SH_LOOP_START		36
-#define	R_SH_LOOP_END		37
 
 /* TLS relocations */
 #define	R_SH_TLS_GD_32		144



CVS commit: src/sys/arch/sh3/include

2016-08-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 25 12:29:15 UTC 2016

Modified Files:
src/sys/arch/sh3/include: fenv.h ieeefp.h

Log Message:
fake some stuff for softfloat.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sh3/include/fenv.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sh3/include/ieeefp.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/fenv.h
diff -u src/sys/arch/sh3/include/fenv.h:1.1 src/sys/arch/sh3/include/fenv.h:1.2
--- src/sys/arch/sh3/include/fenv.h:1.1	Thu Aug 25 08:14:10 2016
+++ src/sys/arch/sh3/include/fenv.h	Thu Aug 25 08:29:14 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.1 2016/08/25 12:14:10 christos Exp $	*/
+/*	$NetBSD: fenv.h,v 1.2 2016/08/25 12:29:14 christos Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -53,8 +53,9 @@
 /* Rounding modes, from FPSCR */
 #define FE_TONEAREST	FPSCR_ROUND_NEAREST
 #define	FE_TOWARDZERO	FPSCR_ROUND_ZERO
-/* 	FE_DOWNWARD	*/
-/*	FE_UPWARD	*/
+/* These two don't exist and are only defined for the benefit of softfloat */
+#define	FE_DOWNWARD	(FPSCR_ROUND_ZERO + 1)
+#define	FE_UPWARD	(FPSCR_ROUND_ZERO + 2)
 
 #define _ROUND_MASK	\
 (FE_TONEAREST | FE_TOWARDZERO)

Index: src/sys/arch/sh3/include/ieeefp.h
diff -u src/sys/arch/sh3/include/ieeefp.h:1.5 src/sys/arch/sh3/include/ieeefp.h:1.6
--- src/sys/arch/sh3/include/ieeefp.h:1.5	Thu Aug 25 08:19:42 2016
+++ src/sys/arch/sh3/include/ieeefp.h	Thu Aug 25 08:29:14 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: ieeefp.h,v 1.5 2016/08/25 12:19:42 christos Exp $ */
+/* $NetBSD: ieeefp.h,v 1.6 2016/08/25 12:29:14 christos Exp $ */
 
 /*
  * Written by J.T. Conklin, Apr 6, 1995
@@ -16,6 +16,8 @@
 
 #if defined(_NETBSD_SOURCE)
 
+typedef int fp_except;
+
 #define	FP_X_INV	FE_INVALID	/* invalid operation exception */
 #define	FP_X_DZ		FE_DIVBYZERO	/* divide-by-zero exception */
 #define	FP_X_OFL	FE_OVERFLOW	/* overflow exception */
@@ -24,6 +26,8 @@
 
 typedef enum {
 	FP_RN=FE_TONEAREST,	/* round to nearest representable number */
+	FP_RM=FE_DOWNWARD,  /* round toward negative infinity */
+	FP_RP=FE_UPWARD,/* round toward positive infinity */
 	FP_RZ=FE_TOWARDZERO	/* round to zero (truncate) */
 } fp_rnd;
 



CVS commit: src/sys/arch/sh3/include

2016-08-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 25 12:19:42 UTC 2016

Modified Files:
src/sys/arch/sh3/include: ieeefp.h

Log Message:
use fenv.h


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sh3/include/ieeefp.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/ieeefp.h
diff -u src/sys/arch/sh3/include/ieeefp.h:1.4 src/sys/arch/sh3/include/ieeefp.h:1.5
--- src/sys/arch/sh3/include/ieeefp.h:1.4	Tue Aug  5 12:47:42 2008
+++ src/sys/arch/sh3/include/ieeefp.h	Thu Aug 25 08:19:42 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: ieeefp.h,v 1.4 2008/08/05 16:47:42 matt Exp $ */
+/* $NetBSD: ieeefp.h,v 1.5 2016/08/25 12:19:42 christos Exp $ */
 
 /*
  * Written by J.T. Conklin, Apr 6, 1995
@@ -12,28 +12,11 @@
 
 #if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE)
 
-typedef int fenv_t;
-typedef int fexcept_t;
-
-#define	FE_INVALID	0x01	/* invalid operation exception */
-#define	FE_DENORMAL	0x02	/* denormalization exception */
-#define	FE_DIVBYZERO	0x04	/* divide-by-zero exception */
-#define	FE_OVERFLOW	0x08	/* overflow exception */
-#define	FE_UNDERFLOW	0x10	/* underflow exception */
-#define	FE_INEXACT	0x20	/* imprecise (loss of precision) */
-
-#define	FE_ALL_EXCEPT	0x3f
-
-#define	FE_TONEAREST	0	/* round to nearest representable number */
-#define	FE_DOWNWARD	1	/* round toward negative infinity */
-#define	FE_UPWARD	2	/* round toward positive infinity */
-#define	FE_TOWARDZERO	3	/* round to zero (truncate) */
+#include 
 
 #if defined(_NETBSD_SOURCE)
 
-typedef int fp_except;
 #define	FP_X_INV	FE_INVALID	/* invalid operation exception */
-#define	FP_X_DNML	FE_DENORMAL	/* denormalization exception */
 #define	FP_X_DZ		FE_DIVBYZERO	/* divide-by-zero exception */
 #define	FP_X_OFL	FE_OVERFLOW	/* overflow exception */
 #define	FP_X_UFL	FE_UNDERFLOW	/* underflow exception */
@@ -41,8 +24,6 @@ typedef int fp_except;
 
 typedef enum {
 	FP_RN=FE_TONEAREST,	/* round to nearest representable number */
-	FP_RM=FE_DOWNWARD,	/* round toward negative infinity */
-	FP_RP=FE_UPWARD,	/* round toward positive infinity */
 	FP_RZ=FE_TOWARDZERO	/* round to zero (truncate) */
 } fp_rnd;
 



CVS commit: src/sys/arch/sh3/include

2014-10-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 23 19:39:43 UTC 2014

Modified Files:
src/sys/arch/sh3/include: elf_machdep.h

Log Message:
instead of bitching about the missing endianness, get it.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sh3/include/elf_machdep.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/elf_machdep.h
diff -u src/sys/arch/sh3/include/elf_machdep.h:1.10 src/sys/arch/sh3/include/elf_machdep.h:1.11
--- src/sys/arch/sh3/include/elf_machdep.h:1.10	Sat May 30 01:56:53 2009
+++ src/sys/arch/sh3/include/elf_machdep.h	Thu Oct 23 15:39:42 2014
@@ -1,8 +1,6 @@
-/*	$NetBSD: elf_machdep.h,v 1.10 2009/05/30 05:56:53 skrll Exp $	*/
+/*	$NetBSD: elf_machdep.h,v 1.11 2014/10/23 19:39:42 christos Exp $	*/
 
-#if !defined(_BYTE_ORDER)  !defined(HAVE_NBTOOL_CONFIG_H)
-#error Define _BYTE_ORDER!
-#endif
+#include machine/endian_machdep.h
 
 #if _BYTE_ORDER == _LITTLE_ENDIAN
 #define	ELF32_MACHDEP_ENDIANNESS	ELFDATA2LSB



CVS commit: src/sys/arch/sh3/include

2013-05-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 16 18:47:38 UTC 2013

Modified Files:
src/sys/arch/sh3/include: disklabel.h

Log Message:
name it like other ports do


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sh3/include/disklabel.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/disklabel.h
diff -u src/sys/arch/sh3/include/disklabel.h:1.8 src/sys/arch/sh3/include/disklabel.h:1.9
--- src/sys/arch/sh3/include/disklabel.h:1.8	Mon Nov 23 08:40:11 2009
+++ src/sys/arch/sh3/include/disklabel.h	Thu May 16 14:47:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel.h,v 1.8 2009/11/23 13:40:11 pooka Exp $	*/
+/*	$NetBSD: disklabel.h,v 1.9 2013/05/16 18:47:38 christos Exp $	*/
 
 /*
  * Copyright (c) 1994 Christopher G. Demetriou
@@ -52,7 +52,7 @@
 #include sys/dkbad.h
 #endif /* HAVE_NBTOOL_CONFIG_H */
 struct cpu_disklabel {
-	struct mbr_partition dosparts[MBR_PART_COUNT];
+	struct mbr_partition mbrparts[MBR_PART_COUNT];
 #define __HAVE_DISKLABEL_DKBAD
 	struct dkbad bad;
 };



CVS commit: src/sys/arch/sh3/include

2013-05-14 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue May 14 13:53:47 UTC 2013

Modified Files:
src/sys/arch/sh3/include: scireg.h

Log Message:
Add a definition of SCSCMR1, smart card mode register available on 7750 etc.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sh3/include/scireg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/scireg.h
diff -u src/sys/arch/sh3/include/scireg.h:1.9 src/sys/arch/sh3/include/scireg.h:1.10
--- src/sys/arch/sh3/include/scireg.h:1.9	Thu Apr 30 05:19:38 2009
+++ src/sys/arch/sh3/include/scireg.h	Tue May 14 13:53:47 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: scireg.h,v 1.9 2009/04/30 05:19:38 nonaka Exp $ */
+/* $NetBSD: scireg.h,v 1.10 2013/05/14 13:53:47 tsutsui Exp $ */
 
 /*-
  * Copyright (C) 1999 SAITOH Masanobu.  All rights reserved.
@@ -56,6 +56,7 @@
 #define	SHREG_SCTDR	(*(volatile unsigned char *)	0xffec)
 #define	SHREG_SCSSR	(*(volatile unsigned char *)	0xffe00010)
 #define	SHREG_SCRDR	(*(volatile unsigned char *)	0xffe00014)
+#define	SHREG_SCSCMR	(*(volatile unsigned char *)	0xffe00018)
 #define	SHREG_SCSPTR	(*(volatile unsigned char *)	0xffe0001c)
 
 #endif



CVS commit: src/sys/arch/sh3/include

2011-10-31 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Oct 31 19:08:46 UTC 2011

Modified Files:
src/sys/arch/sh3/include: ptrace.h

Log Message:
#if-0'ed defines for PT_GETFPREGS and PT_SETFPREGS.  Not used yet, but
reserve the numbers as they are leaked to readelf(1), that has to know
them as NT_NETBSDCORE_FIRSTMACH + x (see get_netbsd_elfcore_note_type).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sh3/include/ptrace.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/ptrace.h
diff -u src/sys/arch/sh3/include/ptrace.h:1.9 src/sys/arch/sh3/include/ptrace.h:1.10
--- src/sys/arch/sh3/include/ptrace.h:1.9	Fri Jan 28 21:06:07 2011
+++ src/sys/arch/sh3/include/ptrace.h	Mon Oct 31 19:08:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ptrace.h,v 1.9 2011/01/28 21:06:07 uwe Exp $	*/
+/*	$NetBSD: ptrace.h,v 1.10 2011/10/31 19:08:45 uwe Exp $	*/
 
 /*
  * Copyright (c) 1993 Christopher G. Demetriou
@@ -46,6 +46,11 @@
 #define	PT_GETREGS	(PT_FIRSTMACH + 3)
 #define	PT_SETREGS	(PT_FIRSTMACH + 4)
 
+#if 0 /* XXX: not yet, but reserve the numbers leaked to readelf(1). */
+#define	PT_GETFPREGS	(PT_FIRSTMACH + 5)
+#define	PT_SETFPREGS	(PT_FIRSTMACH + 6)
+#endif
+
 #define PT_MACHDEP_STRINGS \
 	PT_STEP, \
 	PT___GETREGS40, \



CVS commit: src/sys/arch/sh3/include

2011-02-03 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Feb  4 04:13:52 UTC 2011

Modified Files:
src/sys/arch/sh3/include: locore.h

Log Message:
Since __INTR_MASK + __EXCEPTION_UNBLOCK is common sequence, provide
__INTR_MASK_EXCEPTION_UNBLOCK combo version that does stc/ldc just once.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/sh3/include/locore.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/locore.h
diff -u src/sys/arch/sh3/include/locore.h:1.21 src/sys/arch/sh3/include/locore.h:1.22
--- src/sys/arch/sh3/include/locore.h:1.21	Fri Feb  4 03:23:33 2011
+++ src/sys/arch/sh3/include/locore.h	Fri Feb  4 04:13:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.h,v 1.21 2011/02/04 03:23:33 uwe Exp $	*/
+/*	$NetBSD: locore.h,v 1.22 2011/02/04 04:13:52 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -201,6 +201,23 @@
 	and	Rn,	Rm		;\
 	ldc	Rm,	sr	/* unmask all interrupts */
 
+
+/*
+ * Since __INTR_MASK + __EXCEPTION_UNBLOCK is common sequence, provide
+ * this combo version that does stc/ldc just once.
+ */
+#define __INTR_MASK_EXCEPTION_UNBLOCK(Rs, Ri, Rb)			 \
+	mov	#0x78, Ri	/* 0xf0  1 */;\
+	mov	#0xef, Rb	/* ~0x10 */;\
+	shll	Ri		/* Ri = PSL_IMASK */			;\
+	swap.b	Rb, Rb			;\
+	stc	sr, Rs			;\
+	swap.w	Rb, Rb		/* Rb = ~PSL_BL */			;\
+	or	Ri, Rs		/* SR |= PSL_IMASK */			;\
+	and	Rb, Rs		/* SR = ~PSL_BL */			;\
+	ldc	Rs, sr
+
+
 #else /* !_LOCORE */
 
 void sh3_switch_setup(struct lwp *);



CVS commit: src/sys/arch/sh3/include

2011-01-26 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Jan 26 19:07:43 UTC 2011

Modified Files:
src/sys/arch/sh3/include: psl.h

Log Message:
Add sh4 PSL_FD - FPU disable bit.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sh3/include/psl.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/psl.h
diff -u src/sys/arch/sh3/include/psl.h:1.10 src/sys/arch/sh3/include/psl.h:1.11
--- src/sys/arch/sh3/include/psl.h:1.10	Fri Jan  4 20:10:12 2008
+++ src/sys/arch/sh3/include/psl.h	Wed Jan 26 19:07:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.10 2008/01/04 20:10:12 uwe Exp $	*/
+/*	$NetBSD: psl.h,v 1.11 2011/01/26 19:07:42 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -45,6 +45,7 @@
 #define	PSL_IMASK	0x00f0	/* Interrupt Mask bit */
 #define	PSL_QBIT	0x0100	/* Q bit */
 #define	PSL_MBIT	0x0200	/* M bit */
+#define	PSL_FD		0x8000	/* FPU Disable bit */
 #define	PSL_BL		0x1000	/* Exception Block bit */
 #define	PSL_RB		0x2000	/* Register Bank bit */
 #define	PSL_MD		0x4000	/* Processor Mode bit */



CVS commit: src/sys/arch/sh3/include

2011-01-26 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Jan 26 23:26:37 UTC 2011

Modified Files:
src/sys/arch/sh3/include: proc.h

Log Message:
Add MDP_SSTEP flag.  Not used yet.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/sh3/include/proc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/proc.h
diff -u src/sys/arch/sh3/include/proc.h:1.15 src/sys/arch/sh3/include/proc.h:1.16
--- src/sys/arch/sh3/include/proc.h:1.15	Fri Jan 14 02:06:30 2011
+++ src/sys/arch/sh3/include/proc.h	Wed Jan 26 23:26:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.15 2011/01/14 02:06:30 rmind Exp $	*/
+/*	$NetBSD: proc.h,v 1.16 2011/01/26 23:26:37 uwe Exp $	*/
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
@@ -58,6 +58,7 @@
 
 /* md_flags */
 #define	MDP_USEDFPU	0x0001	/* has used the FPU */
+#define	MDP_SSTEP	0x0002	/* single-stepped with PT_STEP */
 
 struct lwp;
 



CVS commit: src/sys/arch/sh3/include

2011-01-17 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Jan 18 00:26:58 UTC 2011

Modified Files:
src/sys/arch/sh3/include: locore.h

Log Message:
Allow co-existance of traditional and modern CPP


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/sh3/include/locore.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/locore.h
diff -u src/sys/arch/sh3/include/locore.h:1.19 src/sys/arch/sh3/include/locore.h:1.20
--- src/sys/arch/sh3/include/locore.h:1.19	Sun Jun  1 00:46:01 2008
+++ src/sys/arch/sh3/include/locore.h	Tue Jan 18 00:26:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.h,v 1.19 2008/06/01 00:46:01 uwe Exp $	*/
+/*	$NetBSD: locore.h,v 1.20 2011/01/18 00:26:57 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -28,6 +28,21 @@
 
 #ifdef _LOCORE
 
+#ifdef __STDC__
+#if defined(SH3)  defined(SH4)
+#define	MOV(x, r)	mov.l .L_ ## x, r; mov.l @r, r
+#define	REG_SYMBOL(x)	.L_ ## x:	.long	_C_LABEL(__sh_ ## x)
+#define	FUNC_SYMBOL(x)	.L_ ## x:	.long	_C_LABEL(__sh_ ## x)
+#elif defined(SH3)
+#define	MOV(x, r)	mov.l .L_ ## x, r
+#define	REG_SYMBOL(x)	.L_ ## x:	.long	SH3_ ## x
+#define	FUNC_SYMBOL(x)	.L_ ## x:	.long	_C_LABEL(sh3_ ## x)
+#elif defined(SH4)
+#define	MOV(x, r)	mov.l .L_ ## x, r
+#define	REG_SYMBOL(x)	.L_ ## x:	.long	SH4_ ## x
+#define	FUNC_SYMBOL(x)	.L_ ## x:	.long	_C_LABEL(sh4_ ## x)
+#endif /* SH3  SH4 */
+#else /* !__STDC__ */
 #if defined(SH3)  defined(SH4)
 #define	MOV(x, r)	mov.l .L_/**/x, r; mov.l @r, r
 #define	REG_SYMBOL(x)	.L_/**/x:	.long	_C_LABEL(__sh_/**/x)
@@ -41,6 +56,7 @@
 #define	REG_SYMBOL(x)	.L_/**/x:	.long	SH4_/**/x
 #define	FUNC_SYMBOL(x)	.L_/**/x:	.long	_C_LABEL(sh4_/**/x)
 #endif /* SH3  SH4 */
+#endif /* __STDC__ */
 
 /*
  * BANK1 r6 contains current trapframe pointer.



CVS commit: src/sys/arch/sh3/include

2010-12-21 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 22 02:41:13 UTC 2010

Modified Files:
src/sys/arch/sh3/include: types.h

Log Message:
Add a define __HAVE_CPU_DATA_FIRST which means that cpu_data is the first
member in struct cpu_info.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/sh3/include/types.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/types.h
diff -u src/sys/arch/sh3/include/types.h:1.29 src/sys/arch/sh3/include/types.h:1.30
--- src/sys/arch/sh3/include/types.h:1.29	Fri Dec 11 05:52:04 2009
+++ src/sys/arch/sh3/include/types.h	Wed Dec 22 02:41:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.29 2009/12/11 05:52:04 matt Exp $	*/
+/*	$NetBSD: types.h,v 1.30 2010/12/22 02:41:12 matt Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -71,6 +71,7 @@
 
 #define	__HAVE_AST_PERPROC
 #define	__HAVE_SYSCALL_INTERN
+#define	__HAVE_CPU_DATA_FIRST
 
 #if defined(_KERNEL)
 #define	__HAVE_RAS



CVS commit: src/sys/arch/sh3/include

2009-10-13 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue Oct 13 12:55:53 UTC 2009

Modified Files:
src/sys/arch/sh3/include: lock.h

Log Message:
Fix inline asm for tas.b.  =m is not restrictive enough and gcc may
decide to use addressing modes that tas.b does not support.  'V' is
advertised to be non-offsettable subset of 'm' but there's a bug in
gcc that prevents =V from working.

When in doubt use brute force, so pass lock pointer as r input and
declare memory as clobbered.

Landisk kernel diff is 5 instructions (register choice for lock
address in __cpu_simple_lock_try).

sys/dev/raidframe/rf_copyback.c - where old __asm triggered incorrect code
- successfully compiles (as part of sys/rump/dev/lib/libraidframe).


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/sh3/include/lock.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/lock.h
diff -u src/sys/arch/sh3/include/lock.h:1.15 src/sys/arch/sh3/include/lock.h:1.16
--- src/sys/arch/sh3/include/lock.h:1.15	Mon Apr 28 20:23:35 2008
+++ src/sys/arch/sh3/include/lock.h	Tue Oct 13 12:55:53 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock.h,v 1.15 2008/04/28 20:23:35 martin Exp $	*/
+/*	$NetBSD: lock.h,v 1.16 2009/10/13 12:55:53 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -81,11 +81,11 @@
 {
 
 	 __asm volatile(
-		1:	tas.b	%0	\n
+		1:	tas.b	@%0	\n
 			bf	1b	\n
-		: =m (*alp)
-		: /* no inputs */
-		: cc);
+		: /* no outputs */
+		: r (alp)
+		: cc, memory);
 }
 
 static __inline int
@@ -94,11 +94,11 @@
 	int __rv;
 
 	__asm volatile(
-			tas.b	%0	\n
-			movt	%1	\n
-		: =m (*alp), =r (__rv)
-		: /* no inputs */
-		: cc);
+			tas.b	@%1	\n
+			movt	%0	\n
+		: =r (__rv)
+		: r (alp)
+		: cc, memory);
 
 	return (__rv);
 }



CVS commit: src/sys/arch/sh3/include

2009-05-16 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat May 16 10:11:50 UTC 2009

Modified Files:
src/sys/arch/sh3/include: exception.h

Log Message:
Add SH4 INTEVT codes for GPIO.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sh3/include/exception.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/exception.h
diff -u src/sys/arch/sh3/include/exception.h:1.11 src/sys/arch/sh3/include/exception.h:1.12
--- src/sys/arch/sh3/include/exception.h:1.11	Mon Apr 28 20:23:35 2008
+++ src/sys/arch/sh3/include/exception.h	Sat May 16 10:11:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: exception.h,v 1.11 2008/04/28 20:23:35 martin Exp $	*/
+/*	$NetBSD: exception.h,v 1.12 2009/05/16 10:11:50 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -149,6 +149,8 @@
 #define	SH4_INTEVT_IRQ14	0x3c0
 #define	SH4_INTEVT_IRQ15	0x3e0
 
+#define	SH4_INTEVT_GPIO		0x620
+
 #define	SH4_INTEVT_PCISERR	0xa00
 #define	SH4_INTEVT_PCIDMA3	0xa20
 #define	SH4_INTEVT_PCIDMA2	0xa40



CVS commit: src/sys/arch/sh3/include

2009-05-16 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat May 16 10:13:13 UTC 2009

Modified Files:
src/sys/arch/sh3/include: cache_sh3.h

Log Message:
Added SH7706 cache flush op.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sh3/include/cache_sh3.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/cache_sh3.h
diff -u src/sys/arch/sh3/include/cache_sh3.h:1.9 src/sys/arch/sh3/include/cache_sh3.h:1.10
--- src/sys/arch/sh3/include/cache_sh3.h:1.9	Mon Apr 28 20:23:35 2008
+++ src/sys/arch/sh3/include/cache_sh3.h	Sat May 16 10:13:13 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cache_sh3.h,v 1.9 2008/04/28 20:23:35 martin Exp $	*/
+/*	$NetBSD: cache_sh3.h,v 1.10 2009/05/16 10:13:13 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -143,6 +143,7 @@
 #define	SH7709_CACHE_FLUSH()		SH3_CACHE_8K_FLUSH(4)
 #define	SH7709_CACHE_FLUSH_RAMMODE()	SH3_CACHE_8K_FLUSH(2)
 #define	SH7709A_CACHE_FLUSH()		SH3_CACHE_16K_FLUSH()
+#define	SH7706_CACHE_FLUSH()		SH3_CACHE_16K_FLUSH()
 
 #ifndef _LOCORE
 extern void sh3_cache_config(void);



CVS commit: src/sys/arch/sh3/include

2009-04-29 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Thu Apr 30 05:19:38 UTC 2009

Modified Files:
src/sys/arch/sh3/include: scireg.h

Log Message:
Added some register definition.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sh3/include/scireg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/scireg.h
diff -u src/sys/arch/sh3/include/scireg.h:1.8 src/sys/arch/sh3/include/scireg.h:1.9
--- src/sys/arch/sh3/include/scireg.h:1.8	Tue Jul  1 11:49:37 2003
+++ src/sys/arch/sh3/include/scireg.h	Thu Apr 30 05:19:38 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: scireg.h,v 1.8 2003/07/01 11:49:37 uwe Exp $ */
+/* $NetBSD: scireg.h,v 1.9 2009/04/30 05:19:38 nonaka Exp $ */
 
 /*-
  * Copyright (C) 1999 SAITOH Masanobu.  All rights reserved.
@@ -43,6 +43,7 @@
 #define	SHREG_SCTDR	(*(volatile unsigned char *)	0xFE86)
 #define	SHREG_SCSSR	(*(volatile unsigned char *)	0xFE88)
 #define	SHREG_SCRDR	(*(volatile unsigned char *)	0xFE8A)
+#define	SHREG_SCSCMR	(*(volatile unsigned char *)	0xFE8C)
 #define	SHREG_SCSPDR	(*(volatile unsigned char *)	0xf4000136)
 
 #else
@@ -59,6 +60,15 @@
 
 #endif
 
+#define	SCSMR_CA	0x80
+#define	SCSMR_CHR	0x40
+#define	SCSMR_PE	0x20
+#define	SCSMR_OE	0x10
+#define	SCSMR_STOP	0x08
+#define	SCSMR_MP	0x04
+#define	SCSMR_CKS1	0x02
+#define	SCSMR_CKS0	0x01
+
 #define	SCSCR_TIE	0x80	/* Transmit Interrupt Enable */
 #define	SCSCR_RIE	0x40	/* Receive Interrupt Enable */
 #define	SCSCR_TE	0x20	/* Transmit Enable */
@@ -73,6 +83,9 @@
 #define	SCSSR_ORER	0x20
 #define	SCSSR_FER	0x10
 #define	SCSSR_PER	0x08
+#define	SCSSR_TEND	0x04
+#define	SCSSR_MPB	0x02
+#define	SCSSR_MPBT	0x01
 
 #define	SCSPTR_SPB1IO	0x08
 #define	SCSPTR_SPB1DT	0x04



CVS commit: src/sys/arch/sh3/include

2009-04-21 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue Apr 21 12:57:41 UTC 2009

Modified Files:
src/sys/arch/sh3/include: cputypes.h

Log Message:
Add SH7706


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sh3/include/cputypes.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sh3/include/cputypes.h
diff -u src/sys/arch/sh3/include/cputypes.h:1.11 src/sys/arch/sh3/include/cputypes.h:1.12
--- src/sys/arch/sh3/include/cputypes.h:1.11	Mon Apr 28 20:23:35 2008
+++ src/sys/arch/sh3/include/cputypes.h	Tue Apr 21 12:57:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cputypes.h,v 1.11 2008/04/28 20:23:35 martin Exp $	*/
+/*	$NetBSD: cputypes.h,v 1.12 2009/04/21 12:57:41 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -48,13 +48,14 @@
 #define	CPU_PRODUCT_7708R	3
 #define	CPU_PRODUCT_7709	4
 #define	CPU_PRODUCT_7709A	5
+#define	CPU_PRODUCT_7706	6
 
 /* SH4 series */
-#define	CPU_PRODUCT_7750	6
-#define	CPU_PRODUCT_7750S	7
-#define	CPU_PRODUCT_7750R	8
-#define	CPU_PRODUCT_7751	9
-#define	CPU_PRODUCT_7751R	10
+#define	CPU_PRODUCT_7750	7
+#define	CPU_PRODUCT_7750S	8
+#define	CPU_PRODUCT_7750R	9
+#define	CPU_PRODUCT_7751	10
+#define	CPU_PRODUCT_7751R	11
 
 
 #ifndef _LOCORE