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

2020-12-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec  6 02:26:33 UTC 2020

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

Log Message:
Don't expose register_t


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/m68k/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/m68k/include/proc.h
diff -u src/sys/arch/m68k/include/proc.h:1.7 src/sys/arch/m68k/include/proc.h:1.8
--- src/sys/arch/m68k/include/proc.h:1.7	Thu Jan 13 21:06:27 2011
+++ src/sys/arch/m68k/include/proc.h	Sat Dec  5 21:26:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.7 2011/01/14 02:06:27 rmind Exp $	*/
+/*	$NetBSD: proc.h,v 1.8 2020/12/06 02:26:33 christos Exp $	*/
 
 /*
  * Copyright (c) 1991, 1993
@@ -57,7 +57,7 @@ struct lwp;
  */
 struct mdproc {
 	int	mdp_flags;		/* machine-dependent flags */
-	void	(*md_syscall)(register_t, struct lwp *, struct frame *);
+	void	(*md_syscall)(__register_t, struct lwp *, struct frame *);
 };
 
 /*



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

2020-09-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Sep  7 00:32:00 UTC 2020

Modified Files:
src/sys/arch/m68k/include: mcontext.h

Log Message:
pass a pointer conversion via uintptr_t *and* the desired type casts.
avoids new GCC 9 warnings with C++ code.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/m68k/include/mcontext.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/m68k/include/mcontext.h
diff -u src/sys/arch/m68k/include/mcontext.h:1.10 src/sys/arch/m68k/include/mcontext.h:1.11
--- src/sys/arch/m68k/include/mcontext.h:1.10	Thu Feb 15 15:53:56 2018
+++ src/sys/arch/m68k/include/mcontext.h	Mon Sep  7 00:32:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mcontext.h,v 1.10 2018/02/15 15:53:56 kamil Exp $	*/
+/*	$NetBSD: mcontext.h,v 1.11 2020/09/07 00:32:00 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -126,7 +126,8 @@ static __inline struct tls_tcb *
 __lwp_gettcb_fast(void)
 {
 	unsigned int __tcb = (unsigned int)_lwp_getprivate();
-	return (void *)(__tcb - TLS_TP_OFFSET - sizeof(struct tls_tcb));
+	return (struct tls_tcb *)(uintptr_t)
+	(__tcb - TLS_TP_OFFSET - sizeof(struct tls_tcb));
 }
 
 static inline void



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

2017-11-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov  5 16:16:26 UTC 2017

Modified Files:
src/sys/arch/m68k/include: db_machdep.h

Log Message:
The XXX comment (do not pull in the uvm headers) might have been a nice idea
at the time, but now all other db_machdep files do this, so we follow suit.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/m68k/include/db_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/m68k/include/db_machdep.h
diff -u src/sys/arch/m68k/include/db_machdep.h:1.31 src/sys/arch/m68k/include/db_machdep.h:1.32
--- src/sys/arch/m68k/include/db_machdep.h:1.31	Tue Jan 31 16:17:57 2012
+++ src/sys/arch/m68k/include/db_machdep.h	Sun Nov  5 11:16:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_machdep.h,v 1.31 2012/01/31 21:17:57 mlelstv Exp $	*/
+/*	$NetBSD: db_machdep.h,v 1.32 2017/11/05 16:16:26 christos Exp $	*/
 
 /* 
  * Mach Operating System
@@ -40,11 +40,7 @@
 
 #include 
 
-/*
- * XXX - Would rather not pull in vm headers, but need boolean_t,
- * at least until boolean_t moves to  or someplace.
- */
-#include 
+#include 
 
 #include 
 #include 



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

2017-09-13 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Sep 13 09:55:35 UTC 2017

Modified Files:
src/sys/arch/m68k/include: fenv.h

Log Message:
The __fgetenv() macro operates on a fenv_t, not on a fenv_t *.
Fixes a segfault in fegetenv() and feholdexcept().


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/m68k/include/fenv.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/m68k/include/fenv.h
diff -u src/sys/arch/m68k/include/fenv.h:1.6 src/sys/arch/m68k/include/fenv.h:1.7
--- src/sys/arch/m68k/include/fenv.h:1.6	Wed Mar 22 23:11:09 2017
+++ src/sys/arch/m68k/include/fenv.h	Wed Sep 13 09:55:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.6 2017/03/22 23:11:09 chs Exp $	*/
+/*	$NetBSD: fenv.h,v 1.7 2017/09/13 09:55:35 phx Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -210,7 +210,7 @@ fesetround(int __round)
 __fenv_static inline int
 fegetenv(fenv_t *__envp)
 {
-	__fgetenv(__envp);
+	__fgetenv(*__envp);
 
 	return 0;
 }
@@ -220,7 +220,7 @@ feholdexcept(fenv_t *__envp)
 {
 	fexcept_t __fpcr, __fpsr;
 
-	__fgetenv(__envp);
+	__fgetenv(*__envp);
 	__fpsr = __envp->fpsr & ~FE_ALL_EXCEPT;
 	__set_fpsr(__fpsr);	/* clear all */
 	__fpcr = __envp->fpcr & ~(FE_ALL_EXCEPT << 6);



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

2017-07-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul  2 14:10:23 UTC 2017

Modified Files:
src/sys/arch/m68k/include: cpuframe.h

Log Message:
remove f_pad, conflicts with new  define.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/m68k/include/cpuframe.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/m68k/include/cpuframe.h
diff -u src/sys/arch/m68k/include/cpuframe.h:1.5 src/sys/arch/m68k/include/cpuframe.h:1.6
--- src/sys/arch/m68k/include/cpuframe.h:1.5	Tue Feb  8 15:20:16 2011
+++ src/sys/arch/m68k/include/cpuframe.h	Sun Jul  2 10:10:23 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuframe.h,v 1.5 2011/02/08 20:20:16 rmind Exp $	*/
+/*	$NetBSD: cpuframe.h,v 1.6 2017/07/02 14:10:23 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -128,7 +128,6 @@ struct frame {
 };
 
 #define	f_regs		F_t.tf_regs
-#define	f_pad		F_t.tf_pad
 #define	f_stackadj	F_t.tf_stackadj
 #define	f_sr		F_t.tf_sr
 #define	f_pc		F_t.tf_pc



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

2017-02-26 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Mon Feb 27 06:47:58 UTC 2017

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

Log Message:
the FP_* constants need to be different from the new FE_* constants
to preserve the ABI, so shift them as needed when using them.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/m68k/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/m68k/include/ieeefp.h
diff -u src/sys/arch/m68k/include/ieeefp.h:1.8 src/sys/arch/m68k/include/ieeefp.h:1.9
--- src/sys/arch/m68k/include/ieeefp.h:1.8	Fri Dec 25 06:03:06 2015
+++ src/sys/arch/m68k/include/ieeefp.h	Mon Feb 27 06:47:58 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieeefp.h,v 1.8 2015/12/25 06:03:06 christos Exp $	*/
+/*	$NetBSD: ieeefp.h,v 1.9 2017/02/27 06:47:58 chs Exp $	*/
 
 /* 
  * Written by J.T. Conklin, Apr 6, 1995
@@ -19,17 +19,21 @@
 
 typedef int fp_except;
 
-#define FP_X_IMP	FE_INEXACT	/* imprecise (loss of precision) */
-#define FP_X_DZ		FE_DIVBYZERO	/* divide-by-zero exception */
-#define FP_X_UFL	FE_UNDERFLOW	/* underflow exception */
-#define FP_X_OFL	FE_OVERFLOW	/* overflow exception */
-#define FP_X_INV	FE_INVALID	/* invalid operation exception */
+/* adjust for FP_* and FE_* value differences */ 
+#define	__FPE(x) ((x) >> 3)
+#define	__FPR(x) ((x) >> 4)
+
+#define FP_X_IMP	__FPE(FE_INEXACT)	/* imprecise (loss of precision) */
+#define FP_X_DZ		__FPE(FE_DIVBYZERO)	/* divide-by-zero exception */
+#define FP_X_UFL	__FPE(FE_UNDERFLOW)	/* underflow exception */
+#define FP_X_OFL	__FPE(FE_OVERFLOW)	/* overflow exception */
+#define FP_X_INV	__FPE(FE_INVALID)	/* invalid operation exception */
 
 typedef enum {
-FP_RN=FE_TONEAREST,		/* round to nearest representable number */
-FP_RZ=FE_TOWARDZERO,	/* round to zero (truncate) */
-FP_RM=FE_DOWNWARD,		/* round toward negative infinity */
-FP_RP=FE_UPWARD		/* round toward positive infinity */
+FP_RN=__FPR(FE_TONEAREST),	/* round to nearest representable number */
+FP_RZ=__FPR(FE_TOWARDZERO),	/* round to zero (truncate) */
+FP_RM=__FPR(FE_DOWNWARD),	/* round toward negative infinity */
+FP_RP=__FPR(FE_UPWARD)	/* round toward positive infinity */
 } fp_rnd;
 
 typedef enum {



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

2017-02-26 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Mon Feb 27 06:47:30 UTC 2017

Modified Files:
src/sys/arch/m68k/include: fenv.h

Log Message:
use FPCR instead of FPSR to manipulate the exception mask.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/m68k/include/fenv.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/m68k/include/fenv.h
diff -u src/sys/arch/m68k/include/fenv.h:1.4 src/sys/arch/m68k/include/fenv.h:1.5
--- src/sys/arch/m68k/include/fenv.h:1.4	Tue Jan  5 00:47:08 2016
+++ src/sys/arch/m68k/include/fenv.h	Mon Feb 27 06:47:30 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.4 2016/01/05 00:47:08 ozaki-r Exp $	*/
+/*	$NetBSD: fenv.h,v 1.5 2017/02/27 06:47:30 chs Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
 #define FE_ALL_EXCEPT \
 (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
 
-/* Rounding modes, from FPSR */
+/* Rounding modes, from FPCR */
 #define FE_TONEAREST	FPCR_NEAR
 #define	FE_TOWARDZERO	FPCR_ZERO
 #define	FE_DOWNWARD	FPCR_MINF
@@ -266,12 +266,12 @@ feupdateenv(const fenv_t *__envp)
 static inline int
 feenableexcept(int __mask)
 {
-	fexcept_t __fpsr, __oldmask;
+	fexcept_t __fpcr, __oldmask;
 
-	__get_fpsr(__fpsr);
-	__oldmask = __fpsr & FE_ALL_EXCEPT;
-	__fpsr |= __mask & FE_ALL_EXCEPT;
-	__set_fpsr(__fpsr);
+	__get_fpcr(__fpcr);
+	__oldmask = (__fpcr >> 6) & FE_ALL_EXCEPT;
+	__fpcr |= (__mask & FE_ALL_EXCEPT) << 6;
+	__set_fpcr(__fpcr);
 
 	return __oldmask;
 }
@@ -279,12 +279,12 @@ feenableexcept(int __mask)
 static inline int
 fedisableexcept(int __mask)
 {
-	fexcept_t __fpsr, __oldmask;
+	fexcept_t __fpcr, __oldmask;
 
-	__get_fpsr(__fpsr);
-	__oldmask = __fpsr & FE_ALL_EXCEPT;
-	__fpsr &= ~(__mask & FE_ALL_EXCEPT);
-	__set_fpsr(__fpsr);
+	__get_fpcr(__fpcr);
+	__oldmask = (__fpcr >> 6) & FE_ALL_EXCEPT;
+	__fpcr &= ~((__mask & FE_ALL_EXCEPT) << 6);
+	__set_fpcr(__fpcr);
 
 	return __oldmask;
 }
@@ -292,11 +292,11 @@ fedisableexcept(int __mask)
 static inline int
 fegetexcept(void)
 {
-	fexcept_t __fpsr;
+	fexcept_t __fpcr;
 
-	__get_fpsr(__fpsr);
+	__get_fpcr(__fpcr);
 
-	return __fpsr & FE_ALL_EXCEPT;
+	return (__fpcr >> 6) & FE_ALL_EXCEPT;
 }
 
 #endif /* _NETBSD_SOURCE || _GNU_SOURCE */



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

2016-01-04 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue Jan  5 00:47:08 UTC 2016

Modified Files:
src/sys/arch/m68k/include: fenv.h

Log Message:
Fix #endif; it should be after __END_DECLS

This unbreaks the build of sun2.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/m68k/include/fenv.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/m68k/include/fenv.h
diff -u src/sys/arch/m68k/include/fenv.h:1.3 src/sys/arch/m68k/include/fenv.h:1.4
--- src/sys/arch/m68k/include/fenv.h:1.3	Tue Dec 29 16:02:37 2015
+++ src/sys/arch/m68k/include/fenv.h	Tue Jan  5 00:47:08 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.3 2015/12/29 16:02:37 christos Exp $	*/
+/*	$NetBSD: fenv.h,v 1.4 2016/01/05 00:47:08 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -301,8 +301,8 @@ fegetexcept(void)
 
 #endif /* _NETBSD_SOURCE || _GNU_SOURCE */
 
-#endif /* !__m68010__ && !__mcoldfire__ */
-
 __END_DECLS
 
+#endif /* !__m68010__ && !__mcoldfire__ */
+
 #endif /* _M68K_FENV_H_ */



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

2015-12-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 29 16:02:37 UTC 2015

Modified Files:
src/sys/arch/m68k/include: fenv.h

Log Message:
disable code that does not work for sun2/coldfire


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/m68k/include/fenv.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/m68k/include/fenv.h
diff -u src/sys/arch/m68k/include/fenv.h:1.2 src/sys/arch/m68k/include/fenv.h:1.3
--- src/sys/arch/m68k/include/fenv.h:1.2	Fri Dec 25 11:19:38 2015
+++ src/sys/arch/m68k/include/fenv.h	Tue Dec 29 11:02:37 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.2 2015/12/25 16:19:38 christos Exp $	*/
+/*	$NetBSD: fenv.h,v 1.3 2015/12/29 16:02:37 christos Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -59,6 +59,8 @@
 #define _ROUND_MASK	\
 (FE_TONEAREST | FE_TOWARDZERO | FE_DOWNWARD | FE_UPWARD)
 
+#if !defined(__mc68010__) && !defined(__mcoldfire__)
+
 typedef uint32_t fexcept_t;
 
 /* same layout as fmovem */
@@ -299,6 +301,8 @@ fegetexcept(void)
 
 #endif /* _NETBSD_SOURCE || _GNU_SOURCE */
 
+#endif /* !__m68010__ && !__mcoldfire__ */
+
 __END_DECLS
 
 #endif /* _M68K_FENV_H_ */



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

2015-12-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec 25 16:19:38 UTC 2015

Modified Files:
src/sys/arch/m68k/include: fenv.h

Log Message:
make this compile for c++


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/m68k/include/fenv.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/m68k/include/fenv.h
diff -u src/sys/arch/m68k/include/fenv.h:1.1 src/sys/arch/m68k/include/fenv.h:1.2
--- src/sys/arch/m68k/include/fenv.h:1.1	Thu Dec 24 09:12:39 2015
+++ src/sys/arch/m68k/include/fenv.h	Fri Dec 25 11:19:38 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.1 2015/12/24 14:12:39 christos Exp $	*/
+/*	$NetBSD: fenv.h,v 1.2 2015/12/25 16:19:38 christos Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -104,6 +104,8 @@ typedef struct {
 #define __fsetenv(__envp) \
 __asm__ __volatile__ ("fmovem%.l %0,%/fpcr/%/fpsr/%/fpiar" : : "m" (__envp))
 
+__BEGIN_DECLS
+
 __fenv_static inline int
 feclearexcept(int __excepts)
 {
@@ -218,9 +220,9 @@ feholdexcept(fenv_t *__envp)
 
 	__fgetenv(__envp);
 	__fpsr = __envp->fpsr & ~FE_ALL_EXCEPT;
-	__fset_fpsr(__fpsr);	/* clear all */
+	__set_fpsr(__fpsr);	/* clear all */
 	__fpcr = __envp->fpcr & ~(FE_ALL_EXCEPT << 6);
-	__fset_fpcr(__fpcr);	/* set non/stop */
+	__set_fpcr(__fpcr);	/* set non/stop */
 
 	return 0;
 }



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

2015-12-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec 25 06:03:06 UTC 2015

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

Log Message:
get rid of dup fenv.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/m68k/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/m68k/include/ieeefp.h
diff -u src/sys/arch/m68k/include/ieeefp.h:1.7 src/sys/arch/m68k/include/ieeefp.h:1.8
--- src/sys/arch/m68k/include/ieeefp.h:1.7	Tue Jan 27 14:04:39 2009
+++ src/sys/arch/m68k/include/ieeefp.h	Fri Dec 25 01:03:06 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieeefp.h,v 1.7 2009/01/27 19:04:39 martin Exp $	*/
+/*	$NetBSD: ieeefp.h,v 1.8 2015/12/25 06:03:06 christos Exp $	*/
 
 /* 
  * Written by J.T. Conklin, Apr 6, 1995
@@ -13,21 +13,7 @@
 
 #if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE)
 
-typedef int fenv_t;
-typedef int fexcept_t;
-
-#define	FE_INEXACT	0x01	/* imprecise (loss of precision) */
-#define	FE_DIVBYZERO	0x02	/* divide-by-zero exception */
-#define	FE_UNDERFLOW	0x04	/* overflow exception */
-#define	FE_OVERFLOW	0x08	/* underflow exception */
-#define	FE_INVALID	0x10	/* invalid operation exception */
-
-#define	FE_ALL_EXCEPT	0x1f
-
-#define	FE_TONEAREST	0	/* round to nearest representable number */
-#define	FE_TOWARDZERO	1	/* round to zero (truncate) */
-#define	FE_DOWNWARD	2	/* round toward negative infinity */
-#define	FE_UPWARD	3	/* round toward positive infinity */
+#include 
 
 #if !defined(_ISOC99_SOURCE)
 
@@ -52,11 +38,10 @@ typedef enum {
 FP_PD=2			/* double-precision (53-bit) */
 } fp_prec;
 
-#endif /* defined(_NETBSD_SOURCE) */
+#endif /* !_ISOC99_SOURCE */
 
 #define	__HAVE_FP_PREC
 
-
 #endif	/* _NETBSD_SOURCE || _ISOC99_SOURCE */
 
 #endif /* _M68K_IEEEFP_H_ */



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

2015-12-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 24 14:12:39 UTC 2015

Modified Files:
src/sys/arch/m68k/include: Makefile
Added Files:
src/sys/arch/m68k/include: fenv.h

Log Message:
fenv for m68k


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/m68k/include/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/arch/m68k/include/fenv.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/m68k/include/Makefile
diff -u src/sys/arch/m68k/include/Makefile:1.28 src/sys/arch/m68k/include/Makefile:1.29
--- src/sys/arch/m68k/include/Makefile:1.28	Wed Jul 17 01:42:02 2013
+++ src/sys/arch/m68k/include/Makefile	Thu Dec 24 09:12:39 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.28 2013/07/17 05:42:02 matt Exp $
+#	$NetBSD: Makefile,v 1.29 2015/12/24 14:12:39 christos Exp $
 
 INCSDIR= /usr/include/m68k
 
@@ -7,7 +7,7 @@ INCS=	ansi.h aout_machdep.h asm.h asm_si
 	cacheops.h cacheops_20.h cacheops_30.h cacheops_40.h cacheops_60.h \
 	cdefs.h cpu.h cpuframe.h \
 	elf_machdep.h endian.h endian_machdep.h \
-	float.h fpreg.h frame.h \
+	fenv.h float.h fpreg.h frame.h \
 	ieee.h ieeefp.h \
 	int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \
 	kcore.h \

Added files:

Index: src/sys/arch/m68k/include/fenv.h
diff -u /dev/null src/sys/arch/m68k/include/fenv.h:1.1
--- /dev/null	Thu Dec 24 09:12:39 2015
+++ src/sys/arch/m68k/include/fenv.h	Thu Dec 24 09:12:39 2015
@@ -0,0 +1,302 @@
+/*	$NetBSD: fenv.h,v 1.1 2015/12/24 14:12:39 christos Exp $	*/
+
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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 _M68K_FENV_H_
+#define _M68K_FENV_H_
+
+#include 
+#include 
+#include 
+
+#ifndef __fenv_static   
+#define __fenv_static   static
+#endif
+
+/* Exception bits, from FPSR */
+#define	FE_INEXACT	FPSR_AINEX
+#define	FE_DIVBYZERO	FPSR_ADZ
+#define	FE_UNDERFLOW	FPSR_AUNFL
+#define	FE_OVERFLOW	FPSR_AOVFL
+#define	FE_INVALID	FPSR_AIOP
+
+#define FE_ALL_EXCEPT \
+(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
+
+/* Rounding modes, from FPSR */
+#define FE_TONEAREST	FPCR_NEAR
+#define	FE_TOWARDZERO	FPCR_ZERO
+#define	FE_DOWNWARD	FPCR_MINF
+#define	FE_UPWARD	FPCR_PINF
+
+#define _ROUND_MASK	\
+(FE_TONEAREST | FE_TOWARDZERO | FE_DOWNWARD | FE_UPWARD)
+
+typedef uint32_t fexcept_t;
+
+/* same layout as fmovem */
+typedef struct {
+	uint32_t fpcr;
+	uint32_t fpsr;
+	uint32_t fppc;
+} fenv_t;
+
+#define FE_DFL_ENV	((fenv_t *) -1)
+
+#define __get_fpcr(__fpcr) \
+__asm__ __volatile__ ("fmove%.l %!,%0" : "=dm" (__fpcr))
+#define __set_fpcr(__fpcr) \
+__asm__ __volatile__ ("fmove%.l %0,%!" : : "dm" (__fpcr))
+
+#define __get_fpsr(__fpsr) \
+__asm__ __volatile__ ("fmove%.l %/fpsr,%0" : "=dm" (__fpsr))
+#define __set_fpsr(__fpsr) \
+__asm__ __volatile__ ("fmove%.l %0,%/fpsr" : : "dm" (__fpsr))
+
+#define __fmul(__s, __t, __d) \
+do { \
+	__t d = __d; \
+	__asm__ __volatile__ ("fmul" __s "; fnop" : "=f" (d) : "0" (d)); \
+} while (/*CONSTCOND*/0) 
+
+#define __fdiv(__s, __t, __d) \
+do { \
+	__t d = __d; \
+	__asm__ __volatile__ ("fdiv" __s "; fnop" : "=f" (d) : "0" (d)); \
+} while (/*CONSTCOND*/0) 
+
+#define __fetox(__s, __t, __d) \
+do { \
+	__t d = __d; \
+	__asm__ __volatile__ ("fetox" __s "; fnop" : "=f" (d) : "0" (d)); \
+} while (/*CONSTCOND*/0) 
+
+#define __fgetenv(__envp) \
+__asm__ __volatile__ ("fmovem%.l %/fpcr/%/fpsr/%/fpiar,%0" 

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

2014-08-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug 17 20:22:41 UTC 2014

Modified Files:
src/sys/arch/m68k/include: int_fmtio.h

Log Message:
Revert previous (SCN*FAST*) and make PRI*FAST* identical.
Should fix the default (gcc 4.5 based) build.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/m68k/include/int_fmtio.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/m68k/include/int_fmtio.h
diff -u src/sys/arch/m68k/include/int_fmtio.h:1.5 src/sys/arch/m68k/include/int_fmtio.h:1.6
--- src/sys/arch/m68k/include/int_fmtio.h:1.5	Fri Aug 15 08:59:58 2014
+++ src/sys/arch/m68k/include/int_fmtio.h	Sun Aug 17 20:22:41 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: int_fmtio.h,v 1.5 2014/08/15 08:59:58 martin Exp $	*/
+/*	$NetBSD: int_fmtio.h,v 1.6 2014/08/17 20:22:41 martin Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -49,8 +49,8 @@
 #define	PRIdLEAST16	d	/* int_least16_t	*/
 #define	PRIdLEAST32	d	/* int_least32_t	*/
 #define	PRIdLEAST64	lld	/* int_least64_t	*/
-#define	PRIdFAST8	d	/* int_fast8_t		*/
-#define	PRIdFAST16	d	/* int_fast16_t		*/
+#define	PRIdFAST8	hhd	/* int_fast8_t		*/
+#define	PRIdFAST16	hd	/* int_fast16_t		*/
 #define	PRIdFAST32	d	/* int_fast32_t		*/
 #define	PRIdFAST64	lld	/* int_fast64_t		*/
 #define	PRIdMAX		lld	/* intmax_t		*/
@@ -64,8 +64,8 @@
 #define	PRIiLEAST16	i	/* int_least16_t	*/
 #define	PRIiLEAST32	i	/* int_least32_t	*/
 #define	PRIiLEAST64	lli	/* int_least64_t	*/
-#define	PRIiFAST8	i	/* int_fast8_t		*/
-#define	PRIiFAST16	i	/* int_fast16_t		*/
+#define	PRIiFAST8	hhi	/* int_fast8_t		*/
+#define	PRIiFAST16	hi	/* int_fast16_t		*/
 #define	PRIiFAST32	i	/* int_fast32_t		*/
 #define	PRIiFAST64	lli	/* int_fast64_t		*/
 #define	PRIiMAX		lli	/* intmax_t		*/
@@ -81,8 +81,8 @@
 #define	PRIoLEAST16	o	/* uint_least16_t	*/
 #define	PRIoLEAST32	o	/* uint_least32_t	*/
 #define	PRIoLEAST64	llo	/* uint_least64_t	*/
-#define	PRIoFAST8	o	/* uint_fast8_t		*/
-#define	PRIoFAST16	o	/* uint_fast16_t	*/
+#define	PRIoFAST8	hho	/* uint_fast8_t		*/
+#define	PRIoFAST16	ho	/* uint_fast16_t	*/
 #define	PRIoFAST32	o	/* uint_fast32_t	*/
 #define	PRIoFAST64	llo	/* uint_fast64_t	*/
 #define	PRIoMAX		llo	/* uintmax_t		*/
@@ -96,8 +96,8 @@
 #define	PRIuLEAST16	u	/* uint_least16_t	*/
 #define	PRIuLEAST32	u	/* uint_least32_t	*/
 #define	PRIuLEAST64	llu	/* uint_least64_t	*/
-#define	PRIuFAST8	u	/* uint_fast8_t		*/
-#define	PRIuFAST16	u	/* uint_fast16_t	*/
+#define	PRIuFAST8	hhu	/* uint_fast8_t		*/
+#define	PRIuFAST16	hu	/* uint_fast16_t	*/
 #define	PRIuFAST32	u	/* uint_fast32_t	*/
 #define	PRIuFAST64	llu	/* uint_fast64_t	*/
 #define	PRIuMAX		llu	/* uintmax_t		*/
@@ -111,8 +111,8 @@
 #define	PRIxLEAST16	x	/* uint_least16_t	*/
 #define	PRIxLEAST32	x	/* uint_least32_t	*/
 #define	PRIxLEAST64	llx	/* uint_least64_t	*/
-#define	PRIxFAST8	x	/* uint_fast8_t		*/
-#define	PRIxFAST16	x	/* uint_fast16_t	*/
+#define	PRIxFAST8	hhx	/* uint_fast8_t		*/
+#define	PRIxFAST16	hx	/* uint_fast16_t	*/
 #define	PRIxFAST32	x	/* uint_fast32_t	*/
 #define	PRIxFAST64	llx	/* uint_fast64_t	*/
 #define	PRIxMAX		llx	/* uintmax_t		*/
@@ -126,8 +126,8 @@
 #define	PRIXLEAST16	X	/* uint_least16_t	*/
 #define	PRIXLEAST32	X	/* uint_least32_t	*/
 #define	PRIXLEAST64	llX	/* uint_least64_t	*/
-#define	PRIXFAST8	X	/* uint_fast8_t		*/
-#define	PRIXFAST16	X	/* uint_fast16_t	*/
+#define	PRIXFAST8	hhX	/* uint_fast8_t		*/
+#define	PRIXFAST16	hX	/* uint_fast16_t	*/
 #define	PRIXFAST32	X	/* uint_fast32_t	*/
 #define	PRIXFAST64	llX	/* uint_fast64_t	*/
 #define	PRIXMAX		llX	/* uintmax_t		*/
@@ -143,8 +143,8 @@
 #define	SCNdLEAST16	hd	/* int_least16_t	*/
 #define	SCNdLEAST32	d	/* int_least32_t	*/
 #define	SCNdLEAST64	lld	/* int_least64_t	*/
-#define	SCNdFAST8	d	/* int_fast8_t		*/
-#define	SCNdFAST16	d	/* int_fast16_t		*/
+#define	SCNdFAST8	hhd	/* int_fast8_t		*/
+#define	SCNdFAST16	hd	/* int_fast16_t		*/
 #define	SCNdFAST32	d	/* int_fast32_t		*/
 #define	SCNdFAST64	lld	/* int_fast64_t		*/
 #define	SCNdMAX		lld	/* intmax_t		*/
@@ -158,8 +158,8 @@
 #define	SCNiLEAST16	hi	/* int_least16_t	*/
 #define	SCNiLEAST32	i	/* int_least32_t	*/
 #define	SCNiLEAST64	lli	/* int_least64_t	*/
-#define	SCNiFAST8	i	/* int_fast8_t		*/
-#define	SCNiFAST16	i	/* int_fast16_t		*/
+#define	SCNiFAST8	hhi	/* int_fast8_t		*/
+#define	SCNiFAST16	hi	/* int_fast16_t		*/
 #define	SCNiFAST32	i	/* int_fast32_t		*/
 #define	SCNiFAST64	lli	/* int_fast64_t		*/
 #define	SCNiMAX		lli	/* intmax_t		*/
@@ -175,8 +175,8 @@
 #define	SCNoLEAST16	ho	/* uint_least16_t	*/
 #define	SCNoLEAST32	o	/* uint_least32_t	*/
 #define	SCNoLEAST64	llo	/* uint_least64_t	*/
-#define	SCNoFAST8	o	/* uint_fast8_t		*/
-#define	SCNoFAST16	o	/* uint_fast16_t	*/
+#define	SCNoFAST8	hho	/* uint_fast8_t		*/
+#define	SCNoFAST16	ho	/* uint_fast16_t	*/
 #define	SCNoFAST32	o	/* uint_fast32_t	*/
 #define	SCNoFAST64	llo	/* uint_fast64_t	*/
 #define	SCNoMAX		llo	/* uintmax_t		*/
@@ -190,8 

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

2014-08-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Aug 15 07:53:37 UTC 2014

Modified Files:
src/sys/arch/m68k/include: int_mwgwtypes.h

Log Message:
Fix editor mishap


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/m68k/include/int_mwgwtypes.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/m68k/include/int_mwgwtypes.h
diff -u src/sys/arch/m68k/include/int_mwgwtypes.h:1.5 src/sys/arch/m68k/include/int_mwgwtypes.h:1.6
--- src/sys/arch/m68k/include/int_mwgwtypes.h:1.5	Wed Aug 13 22:25:39 2014
+++ src/sys/arch/m68k/include/int_mwgwtypes.h	Fri Aug 15 07:53:37 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: int_mwgwtypes.h,v 1.5 2014/08/13 22:25:39 matt Exp $	*/
+/*	$NetBSD: int_mwgwtypes.h,v 1.6 2014/08/15 07:53:37 martin Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -87,7 +87,6 @@ typedef	long long int		  intmax_t;
 typedef	unsigned long long int	 uintmax_t;
 #endif
 
-#ifdef __UINT_FAST64_TYPE__
-#include sys/common_int_mwgwtypes.h
-#else
+#endif
+
 #endif /* !_M68K_INT_MWGWTYPES_H_ */



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

2014-08-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Aug 15 08:59:58 UTC 2014

Modified Files:
src/sys/arch/m68k/include: int_fmtio.h

Log Message:
Fix the SCN*FAST* defines


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/m68k/include/int_fmtio.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/m68k/include/int_fmtio.h
diff -u src/sys/arch/m68k/include/int_fmtio.h:1.4 src/sys/arch/m68k/include/int_fmtio.h:1.5
--- src/sys/arch/m68k/include/int_fmtio.h:1.4	Wed Aug 13 19:48:17 2014
+++ src/sys/arch/m68k/include/int_fmtio.h	Fri Aug 15 08:59:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: int_fmtio.h,v 1.4 2014/08/13 19:48:17 matt Exp $	*/
+/*	$NetBSD: int_fmtio.h,v 1.5 2014/08/15 08:59:58 martin Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -143,8 +143,8 @@
 #define	SCNdLEAST16	hd	/* int_least16_t	*/
 #define	SCNdLEAST32	d	/* int_least32_t	*/
 #define	SCNdLEAST64	lld	/* int_least64_t	*/
-#define	SCNdFAST8	hhd	/* int_fast8_t		*/
-#define	SCNdFAST16	hd	/* int_fast16_t		*/
+#define	SCNdFAST8	d	/* int_fast8_t		*/
+#define	SCNdFAST16	d	/* int_fast16_t		*/
 #define	SCNdFAST32	d	/* int_fast32_t		*/
 #define	SCNdFAST64	lld	/* int_fast64_t		*/
 #define	SCNdMAX		lld	/* intmax_t		*/
@@ -158,8 +158,8 @@
 #define	SCNiLEAST16	hi	/* int_least16_t	*/
 #define	SCNiLEAST32	i	/* int_least32_t	*/
 #define	SCNiLEAST64	lli	/* int_least64_t	*/
-#define	SCNiFAST8	hhi	/* int_fast8_t		*/
-#define	SCNiFAST16	hi	/* int_fast16_t		*/
+#define	SCNiFAST8	i	/* int_fast8_t		*/
+#define	SCNiFAST16	i	/* int_fast16_t		*/
 #define	SCNiFAST32	i	/* int_fast32_t		*/
 #define	SCNiFAST64	lli	/* int_fast64_t		*/
 #define	SCNiMAX		lli	/* intmax_t		*/
@@ -175,8 +175,8 @@
 #define	SCNoLEAST16	ho	/* uint_least16_t	*/
 #define	SCNoLEAST32	o	/* uint_least32_t	*/
 #define	SCNoLEAST64	llo	/* uint_least64_t	*/
-#define	SCNoFAST8	hho	/* uint_fast8_t		*/
-#define	SCNoFAST16	ho	/* uint_fast16_t	*/
+#define	SCNoFAST8	o	/* uint_fast8_t		*/
+#define	SCNoFAST16	o	/* uint_fast16_t	*/
 #define	SCNoFAST32	o	/* uint_fast32_t	*/
 #define	SCNoFAST64	llo	/* uint_fast64_t	*/
 #define	SCNoMAX		llo	/* uintmax_t		*/
@@ -190,8 +190,8 @@
 #define	SCNuLEAST16	hu	/* uint_least16_t	*/
 #define	SCNuLEAST32	u	/* uint_least32_t	*/
 #define	SCNuLEAST64	llu	/* uint_least64_t	*/
-#define	SCNuFAST8	hhu	/* uint_fast8_t		*/
-#define	SCNuFAST16	hu	/* uint_fast16_t	*/
+#define	SCNuFAST8	u	/* uint_fast8_t		*/
+#define	SCNuFAST16	u	/* uint_fast16_t	*/
 #define	SCNuFAST32	u	/* uint_fast32_t	*/
 #define	SCNuFAST64	llu	/* uint_fast64_t	*/
 #define	SCNuMAX		llu	/* uintmax_t		*/
@@ -205,8 +205,8 @@
 #define	SCNxLEAST16	hx	/* uint_least16_t	*/
 #define	SCNxLEAST32	x	/* uint_least32_t	*/
 #define	SCNxLEAST64	llx	/* uint_least64_t	*/
-#define	SCNxFAST8	hhx	/* uint_fast8_t		*/
-#define	SCNxFAST16	hx	/* uint_fast16_t	*/
+#define	SCNxFAST8	x	/* uint_fast8_t		*/
+#define	SCNxFAST16	x	/* uint_fast16_t	*/
 #define	SCNxFAST32	x	/* uint_fast32_t	*/
 #define	SCNxFAST64	llx	/* uint_fast64_t	*/
 #define	SCNxMAX		llx	/* uintmax_t		*/



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

2013-07-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul 18 22:18:31 UTC 2013

Modified Files:
src/sys/arch/m68k/include: fpreg.h

Log Message:
Fix some definitions


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/m68k/include/fpreg.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/m68k/include/fpreg.h
diff -u src/sys/arch/m68k/include/fpreg.h:1.1 src/sys/arch/m68k/include/fpreg.h:1.2
--- src/sys/arch/m68k/include/fpreg.h:1.1	Tue Jan 27 20:03:12 2009
+++ src/sys/arch/m68k/include/fpreg.h	Thu Jul 18 22:18:31 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpreg.h,v 1.1 2009/01/27 20:03:12 martin Exp $	*/
+/*	$NetBSD: fpreg.h,v 1.2 2013/07/18 22:18:31 matt Exp $	*/
 
 /*
  * Copyright (c) 1995 Gordon Ross
@@ -49,6 +49,7 @@
 # define FPSR_QSG   0x0080
 # define FPSR_QUO   0x007f
 #define FPSR_EXCP   0xff00
+#define FPSR_EXCP2  0x3e00
 # define FPSR_BSUN  0x8000
 # define FPSR_SNAN  0x4000
 # define FPSR_OPERR 0x2000
@@ -57,7 +58,7 @@
 # define FPSR_DZ0x0400
 # define FPSR_INEX2 0x0200
 # define FPSR_INEX1 0x0100
-#define FPSR_AEX0x00ff
+#define FPSR_AEX0x00f8
 # define FPSR_AIOP  0x0080
 # define FPSR_AOVFL 0x0040
 # define FPSR_AUNFL 0x0020
@@ -66,6 +67,7 @@
 
 /* fpcr */
 #define FPCR_EXCP   FPSR_EXCP
+#define FPCR_EXCP2  FPSR_EXCP2
 # define FPCR_BSUN  FPSR_BSUN
 # define FPCR_SNAN  FPSR_SNAN
 # define FPCR_OPERR FPSR_OPERR



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

2013-07-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul 18 22:17:57 UTC 2013

Modified Files:
src/sys/arch/m68k/include: float.h math.h profile.h

Log Message:
Coldfire FPU looks like the 68010 FPU (no long double)


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/m68k/include/float.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/m68k/include/math.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/m68k/include/profile.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/m68k/include/float.h
diff -u src/sys/arch/m68k/include/float.h:1.19 src/sys/arch/m68k/include/float.h:1.20
--- src/sys/arch/m68k/include/float.h:1.19	Sun Dec 11 12:17:53 2005
+++ src/sys/arch/m68k/include/float.h	Thu Jul 18 22:17:57 2013
@@ -1,9 +1,19 @@
-/*	$NetBSD: float.h,v 1.19 2005/12/11 12:17:53 christos Exp $	*/
+/*	$NetBSD: float.h,v 1.20 2013/07/18 22:17:57 matt Exp $	*/
 
 #ifndef _M68K_FLOAT_H_
 #define _M68K_FLOAT_H_
 
-#ifndef __mc68010__
+#if defined(__LDBL_MANT_DIG__)
+#define LDBL_MANT_DIG	__LDBL_MANT_DIG__
+#define LDBL_EPSILON	__LDBL_EPSILON__
+#define LDBL_DIG	__LDBL_DIG__
+#define LDBL_MIN_EXP	__LDBL_MIN_EXP__
+#define LDBL_MIN	__LDBL_MIN__
+#define LDBL_MIN_10_EXP	__LDBL_MIN_10_EXP__
+#define LDBL_MAX_EXP	__LDBL_MAX_EXP__
+#define LDBL_MAX	__LDBL_MAX__
+#define LDBL_MAX_10_EXP	__LDBL_MAX_10_EXP__
+#elif !defined(__mc68010__)  !defined(__mcoldfire__)
 #define LDBL_MANT_DIG	64
 #define LDBL_EPSILON	1.0842021724855044340E-19L
 #define LDBL_DIG	18
@@ -17,7 +27,7 @@
 
 #include sys/float_ieee754.h
 
-#ifndef __mc68010__
+#if !defined(__mc68010__)  !defined(__mcoldfire__)
 #if !defined(_ANSI_SOURCE)  !defined(_POSIX_C_SOURCE)  \
 !defined(_XOPEN_SOURCE) || \
 ((__STDC_VERSION__ - 0) = 199901L) || \
@@ -26,6 +36,6 @@
 defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
 #define	DECIMAL_DIG	21
 #endif /* !defined(_ANSI_SOURCE)  ... */
-#endif /* !__mc68010__ */
+#endif /* !__mc68010__  !__mcoldfire__ */
 
 #endif	/* !_M68K_FLOAT_H_ */

Index: src/sys/arch/m68k/include/math.h
diff -u src/sys/arch/m68k/include/math.h:1.7 src/sys/arch/m68k/include/math.h:1.8
--- src/sys/arch/m68k/include/math.h:1.7	Sun Dec 11 12:17:53 2005
+++ src/sys/arch/m68k/include/math.h	Thu Jul 18 22:17:57 2013
@@ -1,6 +1,6 @@
-/*	$NetBSD: math.h,v 1.7 2005/12/11 12:17:53 christos Exp $	*/
+/*	$NetBSD: math.h,v 1.8 2013/07/18 22:17:57 matt Exp $	*/
 
-#ifndef __mc68010__
+#if !defined(__mc68010__)  !defined(__mcoldfire__)
 #define	__HAVE_LONG_DOUBLE
 #endif
 #define	__HAVE_NANF

Index: src/sys/arch/m68k/include/profile.h
diff -u src/sys/arch/m68k/include/profile.h:1.20 src/sys/arch/m68k/include/profile.h:1.21
--- src/sys/arch/m68k/include/profile.h:1.20	Wed Mar 21 19:59:18 2012
+++ src/sys/arch/m68k/include/profile.h	Thu Jul 18 22:17:57 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: profile.h,v 1.20 2012/03/21 19:59:18 he Exp $	*/
+/*	$NetBSD: profile.h,v 1.21 2013/07/18 22:17:57 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -39,7 +39,7 @@
 #define	MCOUNT_ENTRY	mcount
 #endif
 
-#ifndef	__mc68010__
+#if !defined(__mc68010__)  !defined(__mcoldfire__)
 #define	MCOUNT \
 extern void mcount(void) __asm(MCOUNT_ENTRY) \
 	__attribute__((__no_instrument_function__)); \



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

2013-07-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul 18 22:21:31 UTC 2013

Modified Files:
src/sys/arch/m68k/include: asm.h

Log Message:
Adjust LEA_LCL, GOT_SETUP, INTERRUPT_{SAVE,RESTORE}REG for Coldfire


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/m68k/include/asm.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/m68k/include/asm.h
diff -u src/sys/arch/m68k/include/asm.h:1.31 src/sys/arch/m68k/include/asm.h:1.32
--- src/sys/arch/m68k/include/asm.h:1.31	Tue Jul 16 23:01:05 2013
+++ src/sys/arch/m68k/include/asm.h	Thu Jul 18 22:21:31 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.31 2013/07/16 23:01:05 matt Exp $	*/
+/*	$NetBSD: asm.h,v 1.32 2013/07/18 22:21:31 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -73,12 +73,22 @@
 #ifndef _M68K_ASM_H_
 #define _M68K_ASM_H_
 
-#if defined(PIC)
+#define __IMMEDIATE		#
+
+#if defined(PIC) || defined(__pic__)
 #define PIC_PLT(name)		name@PLTPC
+#ifdef __mcoldfire__
+#define LEA_LCL(name,reg) \
+	movl	__IMMEDIATE name - .,reg ; \
+	lea	(-6,%pc,reg),reg
+#define GOT_SETUP(reg) \
+	movl	__IMMEDIATE _GLOBAL_OFFSET_TABLE_@GOTPC,reg ; \
+	lea	(-6,%pc,reg),reg
+#else
 #define LEA_LCL(name,reg)	lea	(name,%pc),reg
 #define GOT_SETUP(reg)		lea	(_GLOBAL_OFFSET_TABLE_@GOTPC,%pc),reg
+#endif
 #else
-#define	__IMMEDIATE		#
 #define PIC_PLT(name)		name
 #define LEA_LCL(name,reg)	movl	__IMMEDIATE name,reg
 #define GOT_SETUP(reg)		/* nothing */
@@ -166,8 +176,13 @@
  * Need a better place for these but these are common across
  * all m68k ports so let's define just once.
  */
-#define INTERRUPT_SAVEREG	moveml	#0xC0C0,%sp@-
-#define INTERRUPT_RESTOREREG	moveml	%sp@+,#0x0303
+#ifdef __mcoldfire__
+#define INTERRUPT_SAVEREG	lea -16(%sp),%sp; moveml #0xC0C0,(%sp)
+#define INTERRUPT_RESTOREREG	moveml (%sp),#0x0303; lea 16(%sp),%sp
+#else
+#define INTERRUPT_SAVEREG	moveml	#0xC0C0,-(%sp)
+#define INTERRUPT_RESTOREREG	moveml	(%sp)+,#0x0303
+#endif
 
 #ifdef _KERNEL
 /*



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

2013-07-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul 18 22:20:48 UTC 2013

Modified Files:
src/sys/arch/m68k/include: byte_swap.h

Log Message:
Teach to use coldfire isac byterev if available, otherwise let the compiler
figure it since there is rorw instruction to fall back on.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/m68k/include/byte_swap.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/m68k/include/byte_swap.h
diff -u src/sys/arch/m68k/include/byte_swap.h:1.9 src/sys/arch/m68k/include/byte_swap.h:1.10
--- src/sys/arch/m68k/include/byte_swap.h:1.9	Mon Apr 28 20:23:26 2008
+++ src/sys/arch/m68k/include/byte_swap.h	Thu Jul 18 22:20:48 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: byte_swap.h,v 1.9 2008/04/28 20:23:26 martin Exp $	*/
+/*	$NetBSD: byte_swap.h,v 1.10 2013/07/18 22:20:48 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -42,8 +42,14 @@ static __inline uint16_t __byte_swap_u16
 static __inline uint16_t
 __byte_swap_u16_variable(uint16_t var)
 {
+#if defined(__mcfisac__)
+	__asm volatile (swap %0; byterev %0 : =d(var) : 0 (var));
+#elif defined(__mcoldfire__)
+	return (var  8) || (var  8);
+#else
 	__asm volatile (rorw #8, %0 : =d (var) : 0 (var));
 	return (var);
+#endif
 }
 
 #define	__BYTE_SWAP_U32_VARIABLE __byte_swap_u32_variable
@@ -51,8 +57,15 @@ static __inline uint32_t __byte_swap_u32
 static __inline uint32_t
 __byte_swap_u32_variable(uint32_t var)
 {
+#if defined(__mcfisac__)
+	__asm volatile (byterev %0 : =d(var) : 0 (var));
+#elif defined(__mcoldfire__)
+	return (var  24) | (var  24) | ((var  0x00ff)  8)
+	| ((var  8)  0x00ff);
+#else
 	__asm volatile (
 		rorw #8, %0; swap %0; rorw #8, %0 : =d (var) : 0 (var));
+#endif
 	return (var);
 }
 



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

2013-07-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jul 18 22:24:53 UTC 2013

Added Files:
src/sys/arch/m68k/include: pmap_coldfire.h pte_coldfire.h

Log Message:
pte and pmap files for the soft tlb on coldfire cpus.
(uncompiled and mostly probably wrong.)


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/m68k/include/pmap_coldfire.h \
src/sys/arch/m68k/include/pte_coldfire.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/m68k/include/pmap_coldfire.h
diff -u /dev/null src/sys/arch/m68k/include/pmap_coldfire.h:1.1
--- /dev/null	Thu Jul 18 22:24:53 2013
+++ src/sys/arch/m68k/include/pmap_coldfire.h	Thu Jul 18 22:24:53 2013
@@ -0,0 +1,145 @@
+/*	$NetBSD: pmap_coldfire.h,v 1.1 2013/07/18 22:24:53 matt Exp $	*/
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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 _M68K_PMAP_COLDFIRE_H_
+#define M68K_PMAP_COLDFIRE_H_
+
+#ifdef _LOCORE
+#error use assym.h instead
+#endif
+
+#if defined(_MODULE)
+#error this file should not be included by loadable kernel modules
+#endif
+
+#ifdef _KERNEL_OPT
+#include opt_pmap.h
+#endif
+
+#include sys/cpu.h
+#include sys/kcore.h
+#include uvm/uvm_page.h
+#ifdef __PMAP_PRIVATE
+#include powerpc/booke/cpuvar.h
+#include powerpc/cpuset.h
+#endif
+
+#define	PMAP_NEED_PROCWR
+
+#include uvm/pmap/vmpagemd.h
+
+#include m68k/pte_coldfire.h
+
+#define	NBSEG		(NBPG*NPTEPG)
+#define	SEGSHIFT	(PGSHIFT + PGSHIFT - 2)
+#define SEGOFSET	((1  SEGSHIFT) - 1)
+#define PMAP_SEGTABSIZE	(1  (32 - SEGSHIFT))
+#define	NPTEPG		(NBPG  2)
+
+#define	KERNEL_PID	0
+
+#define PMAP_TLB_MAX			  1
+#define	PMAP_TLB_NUM_PIDS		256
+#define	PMAP_INVALID_SEGTAB_ADDRESS	((pmap_segtab_t *)0xfeeddead)
+
+#define	pmap_phys_address(x)		(x)
+
+void	pmap_procwr(struct proc *, vaddr_t, size_t);
+#define	PMAP_NEED_PROCWR
+
+#ifdef __PMAP_PRIVATE
+struct vm_page *
+	pmap_md_alloc_poolpage(int flags);
+vaddr_t	pmap_md_map_poolpage(paddr_t, vsize_t);
+void	pmap_md_unmap_poolpage(vaddr_t, vsize_t);
+bool	pmap_md_direct_mapped_vaddr_p(vaddr_t);
+bool	pmap_md_io_vaddr_p(vaddr_t);
+paddr_t	pmap_md_direct_mapped_vaddr_to_paddr(vaddr_t);
+vaddr_t	pmap_md_direct_map_paddr(paddr_t);
+void	pmap_md_init(void);
+
+bool	pmap_md_tlb_check_entry(void *, vaddr_t, tlb_asid_t, pt_entry_t);
+
+#ifdef PMAP_MINIMALTLB
+vaddr_t	pmap_kvptefill(vaddr_t, vaddr_t, pt_entry_t);
+#endif
+#endif
+
+void	pmap_md_page_syncicache(struct vm_page *, const kcpuset_t *);
+vaddr_t	pmap_bootstrap(vaddr_t, vaddr_t, phys_ram_seg_t *, size_t);
+bool	pmap_extract(struct pmap *, vaddr_t, paddr_t *);
+
+static inline paddr_t vtophys(vaddr_t);
+
+static inline paddr_t
+vtophys(vaddr_t va)
+{
+	paddr_t pa;
+
+	if (pmap_extract(pmap_kernel(), va, pa))
+		return pa;
+	KASSERT(0);
+	return (paddr_t) -1;
+}
+
+#ifdef __PMAP_PRIVATE
+/*
+ * Virtual Cache Alias helper routines.  Not a problem for Booke CPUs.
+ */
+static inline bool
+pmap_md_vca_add(struct vm_page *pg, vaddr_t va, pt_entry_t *nptep)
+{
+	return false;
+}
+
+static inline void
+pmap_md_vca_remove(struct vm_page *pg, vaddr_t va)
+{
+
+}
+
+static inline void
+pmap_md_vca_clean(struct vm_page *pg, vaddr_t va, int op)
+{
+}
+
+static inline size_t
+pmap_md_tlb_asid_max(void)
+{
+	return PMAP_TLB_NUM_PIDS - 1;
+}
+#endif
+
+#define	POOL_VTOPHYS(va)	((paddr_t)(vaddr_t)(va))
+#define	POOL_PHYSTOV(pa)	((vaddr_t)(paddr_t)(pa))
+
+#include uvm/pmap/pmap.h
+
+#endif /* !_M68K_PMAP_COLDFIRE_H_ */
Index: 

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

2013-07-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jul 16 21:01:03 UTC 2013

Modified Files:
src/sys/arch/m68k/include: asm.h

Log Message:
Add an END macro.  reorder EXTBL macro


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/m68k/include/asm.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/m68k/include/asm.h
diff -u src/sys/arch/m68k/include/asm.h:1.28 src/sys/arch/m68k/include/asm.h:1.29
--- src/sys/arch/m68k/include/asm.h:1.28	Sat Feb 12 16:32:36 2011
+++ src/sys/arch/m68k/include/asm.h	Tue Jul 16 21:01:03 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.28 2011/02/12 16:32:36 matt Exp $	*/
+/*	$NetBSD: asm.h,v 1.29 2013/07/16 21:01:03 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -97,6 +97,7 @@
 
 #define	_ENTRY(name) \
 	.text; .even; .globl name; .type name,@function; name:
+#define	END(name)	.size name,.-name
 
 #ifdef __ELF__
 #define	MCOUNT_ENTRY	__mcount
@@ -245,13 +246,13 @@
 /*
  * Macros to hide shortcomings in the 68010.
  */
-#ifndef __mc68010__
-#define	EXTBL(reg)	\
-	extbl	reg
-#else	/* __mc68010__ */
+#ifdef __mc68010__
 #define	EXTBL(reg)	\
 	extw	reg		;			\
 	extl	reg
+#else	/* __mc68010__ */
+#define	EXTBL(reg)	\
+	extbl	reg
 #endif	/* __mc68010__ */
 
 #endif /* _M68K_ASM_H_ */



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

2013-07-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jul 16 22:23:15 UTC 2013

Modified Files:
src/sys/arch/m68k/include: asm.h

Log Message:
Remove non __ELF__ clauses.
Add GOT_SETUP and LEA_LCL macros.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/m68k/include/asm.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/m68k/include/asm.h
diff -u src/sys/arch/m68k/include/asm.h:1.29 src/sys/arch/m68k/include/asm.h:1.30
--- src/sys/arch/m68k/include/asm.h:1.29	Tue Jul 16 21:01:03 2013
+++ src/sys/arch/m68k/include/asm.h	Tue Jul 16 22:23:15 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.29 2013/07/16 21:01:03 matt Exp $	*/
+/*	$NetBSD: asm.h,v 1.30 2013/07/16 22:23:15 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -73,25 +73,22 @@
 #ifndef _M68K_ASM_H_
 #define _M68K_ASM_H_
 
-#if defined(__ELF__)  defined(PIC)
-#define PIC_PLT(name)	name@PLTPC
+#if defined(PIC)
+#define PIC_PLT(name)		name@PLTPC
+#define LEA_LCL(name,reg)	lea	(name,%pc),reg
+#define GOT_SETUP(reg)		lea	(_GLOBAL_OFFSET_TABLE_@GOTPC,%pc),reg
 #else
-#define PIC_PLT(name)	name
+#define	__IMMEDIATE		#
+#define PIC_PLT(name)		name
+#define LEA_LCL(name,reg)	movl	__IMMEDIATE name,reg
+#define GOT_SETUP(reg)		/* nothing */
 #endif
 
-#ifdef __ELF__
-# if __STDC__
-#  define _C_LABEL(name)	name
-# else
-#  define _C_LABEL(name)	name
+#if __STDC__
+# define _C_LABEL(name)	name
+#else
+# define _C_LABEL(name)	name
 #endif /* __STDC__ */
-#else /* __ELF__ */
-# if __STDC__
-#  define _C_LABEL(name)	_ ## name
-# else
-#  define _C_LABEL(name)	_/**/name
-# endif /* __STDC__ */
-#endif /* __ELF__ */
 
 #define	_ASM_LABEL(name)	name
 
@@ -99,11 +96,7 @@
 	.text; .even; .globl name; .type name,@function; name:
 #define	END(name)	.size name,.-name
 
-#ifdef __ELF__
 #define	MCOUNT_ENTRY	__mcount
-#else
-#define	MCOUNT_ENTRY	mcount
-#endif
 
 #ifdef GPROF
 #define _PROF_PROLOG	link %a6,#0; jbsr MCOUNT_ENTRY; unlk %a6
@@ -219,11 +212,10 @@
 #define	VECTOR_UNUSED	\
 	.long	0
 
-#ifdef __ELF__
 #define	WEAK_ALIAS(alias,sym)		\
 	.weak alias;			\
 	alias = sym
-#endif
+
 /*
  * STRONG_ALIAS: create a strong alias.
  */



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

2013-07-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jul 16 23:01:05 UTC 2013

Modified Files:
src/sys/arch/m68k/include: asm.h

Log Message:
Make INTERRUPT_{SAVE,RESTORE}REG visible to userland


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/m68k/include/asm.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/m68k/include/asm.h
diff -u src/sys/arch/m68k/include/asm.h:1.30 src/sys/arch/m68k/include/asm.h:1.31
--- src/sys/arch/m68k/include/asm.h:1.30	Tue Jul 16 22:23:15 2013
+++ src/sys/arch/m68k/include/asm.h	Tue Jul 16 23:01:05 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.30 2013/07/16 22:23:15 matt Exp $	*/
+/*	$NetBSD: asm.h,v 1.31 2013/07/16 23:01:05 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -162,6 +162,13 @@
 #define	ASBSS(name, size)\
 	.comm	_ASM_LABEL(name),size
 
+/*
+ * Need a better place for these but these are common across
+ * all m68k ports so let's define just once.
+ */
+#define INTERRUPT_SAVEREG	moveml	#0xC0C0,%sp@-
+#define INTERRUPT_RESTOREREG	moveml	%sp@+,#0x0303
+
 #ifdef _KERNEL
 /*
  * Shorthand for calling panic().
@@ -173,13 +180,6 @@
 	9:	.asciz	x			;	\
 		.even
 
-/*
- * Need a better place for these but these are common across
- * all m68k ports so let's define just once.
- */
-#define INTERRUPT_SAVEREG	moveml	#0xC0C0,%sp@-
-#define INTERRUPT_RESTOREREG	moveml	%sp@+,#0x0303
-
 /* 64-bit counter increments */
 #define CPUINFO_INCREMENT(n)	\
 	lea	_C_LABEL(cpu_info_store)+(n)+4,%a1;		\



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

2013-07-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jul 17 05:42:02 UTC 2013

Modified Files:
src/sys/arch/m68k/include: Makefile

Log Message:
Export fpreg.h for libc


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/m68k/include/Makefile

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/m68k/include/Makefile
diff -u src/sys/arch/m68k/include/Makefile:1.27 src/sys/arch/m68k/include/Makefile:1.28
--- src/sys/arch/m68k/include/Makefile:1.27	Sun Jul 17 20:54:43 2011
+++ src/sys/arch/m68k/include/Makefile	Wed Jul 17 05:42:02 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.27 2011/07/17 20:54:43 joerg Exp $
+#	$NetBSD: Makefile,v 1.28 2013/07/17 05:42:02 matt Exp $
 
 INCSDIR= /usr/include/m68k
 
@@ -7,7 +7,7 @@ INCS=	ansi.h aout_machdep.h asm.h asm_si
 	cacheops.h cacheops_20.h cacheops_30.h cacheops_40.h cacheops_60.h \
 	cdefs.h cpu.h cpuframe.h \
 	elf_machdep.h endian.h endian_machdep.h \
-	float.h frame.h \
+	float.h fpreg.h frame.h \
 	ieee.h ieeefp.h \
 	int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \
 	kcore.h \



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

2012-03-21 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Wed Mar 21 19:59:18 UTC 2012

Modified Files:
src/sys/arch/m68k/include: profile.h

Log Message:
Use c89 function declarations in MCOUNT definition.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/m68k/include/profile.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/m68k/include/profile.h
diff -u src/sys/arch/m68k/include/profile.h:1.19 src/sys/arch/m68k/include/profile.h:1.20
--- src/sys/arch/m68k/include/profile.h:1.19	Mon Aug  7 23:24:55 2006
+++ src/sys/arch/m68k/include/profile.h	Wed Mar 21 19:59:18 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: profile.h,v 1.19 2006/08/07 23:24:55 tsutsui Exp $	*/
+/*	$NetBSD: profile.h,v 1.20 2012/03/21 19:59:18 he Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -43,7 +43,7 @@
 #define	MCOUNT \
 extern void mcount(void) __asm(MCOUNT_ENTRY) \
 	__attribute__((__no_instrument_function__)); \
-void mcount() { \
+void mcount(void) { \
 	int selfpc, frompcindex; \
 	__asm(movl %%a6@(4),%0 : =r (selfpc)); \
 	__asm(movl %%a6@(0)@(4),%0 : =r (frompcindex)); \
@@ -56,7 +56,7 @@ void mcount() { \
  * to do something different.
  */
 #define	MCOUNT \
-extern void mcount(void) __asm(mcount); void mcount() { \
+extern void mcount(void) __asm(mcount); void mcount(void) { \
 	int selfpc, frompcindex; \
 	__asm(movl %%a6@(4),%0 : =r (selfpc)); \
 	__asm(movl %%a6@(0),%%a0 ; movl %%a0@(4),%0 : =r (frompcindex) : /* no inputs */ : a0); \



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

2011-12-22 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Dec 22 15:07:08 UTC 2011

Removed Files:
src/sys/arch/m68k/include: softintr.h

Log Message:
Remove obsolete header.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r0 src/sys/arch/m68k/include/softintr.h

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



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

2011-12-22 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Dec 22 15:50:37 UTC 2011

Modified Files:
src/sys/arch/m68k/include: m68k.h

Log Message:
Adjust for function merge and move.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/m68k/include/m68k.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/m68k/include/m68k.h
diff -u src/sys/arch/m68k/include/m68k.h:1.20 src/sys/arch/m68k/include/m68k.h:1.21
--- src/sys/arch/m68k/include/m68k.h:1.20	Tue Nov 15 12:23:22 2011
+++ src/sys/arch/m68k/include/m68k.h	Thu Dec 22 15:50:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: m68k.h,v 1.20 2011/11/15 12:23:22 tsutsui Exp $	*/
+/*	$NetBSD: m68k.h,v 1.21 2011/12/22 15:50:37 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -103,14 +103,14 @@ void	copypage040(void *fromaddr, void *t
 void	copypage(void *fromaddr, void *toaddr);
 void	zeropage(void *addr);
 
-/* locore.s (XXX: move to support.s?) */
+/* support.s */
 int 	getdfc(void);
 int 	getsfc(void);
-void	m68881_save(struct fpframe *);
-void	m68881_restore(struct fpframe *); 
 
 /* switch_subr.s */
 void	lwp_trampoline(void);
+void	m68881_save(struct fpframe *);
+void	m68881_restore(struct fpframe *); 
 void	savectx(struct pcb *);
 void	setfunc_trampoline(void);
 



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

2011-03-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Mar  5 14:32:32 UTC 2011

Modified Files:
src/sys/arch/m68k/include: param.h

Log Message:
If _KERNEL is not defined, force MACHINE to be m68k.  Userland should be
using uname/sysctl to get this value.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/m68k/include/param.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/m68k/include/param.h
diff -u src/sys/arch/m68k/include/param.h:1.18 src/sys/arch/m68k/include/param.h:1.19
--- src/sys/arch/m68k/include/param.h:1.18	Tue Feb  8 20:20:16 2011
+++ src/sys/arch/m68k/include/param.h	Sat Mar  5 14:32:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.18 2011/02/08 20:20:16 rmind Exp $	*/
+/*	$NetBSD: param.h,v 1.19 2011/03/05 14:32:32 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -51,6 +51,10 @@
 #ifndef	MID_MACHINE
 #define	MID_MACHINE	MID_M68K
 #endif
+#ifndef _KERNEL
+#undef MACHINE
+#define MACHINE m68k
+#endif
 
 /*
  * Round p (pointer or byte index) up to a correctly-aligned value for all



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

2011-02-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 12 16:32:37 UTC 2011

Modified Files:
src/sys/arch/m68k/include: asm.h

Log Message:
Put RCSIDs in section .ident.  (use .pushsection/.popsection)


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/m68k/include/asm.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/m68k/include/asm.h
diff -u src/sys/arch/m68k/include/asm.h:1.27 src/sys/arch/m68k/include/asm.h:1.28
--- src/sys/arch/m68k/include/asm.h:1.27	Mon Dec 20 21:11:25 2010
+++ src/sys/arch/m68k/include/asm.h	Sat Feb 12 16:32:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.27 2010/12/20 21:11:25 joerg Exp $	*/
+/*	$NetBSD: asm.h,v 1.28 2011/02/12 16:32:36 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -135,9 +135,9 @@
 #define ALTENTRY(name, rname)	_ENTRY(_C_LABEL(name))
 #endif
 
-#define RCSID(x)	.text			;	\
+#define RCSID(x)	.pushsection .ident	;	\
 			.asciz x		;	\
-			.even
+			.popsection
 
 /*
  * Global variables of whatever sort.



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

2010-12-31 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Sat Jan  1 00:37:17 UTC 2011

Modified Files:
src/sys/arch/m68k/include: cpu.h

Log Message:
Protect the include of sys/cpu_data.h with a test for either _KERNEL
or _KMEMUSER.  This should fix the build problem in libkvm for our m68k
ports.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/m68k/include/cpu.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/m68k/include/cpu.h
diff -u src/sys/arch/m68k/include/cpu.h:1.12 src/sys/arch/m68k/include/cpu.h:1.13
--- src/sys/arch/m68k/include/cpu.h:1.12	Wed Dec 22 02:42:28 2010
+++ src/sys/arch/m68k/include/cpu.h	Sat Jan  1 00:37:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.12 2010/12/22 02:42:28 matt Exp $	*/
+/*	$NetBSD: cpu.h,v 1.13 2011/01/01 00:37:16 he Exp $	*/
 
 /*
  * Copyright (c) 1982, 1990, 1993
@@ -197,9 +197,9 @@
 #define	CACHE60_ON	(CACHE40_ON|IC60_CABC|IC60_EBC|DC60_ESB)
 #define	CACHE60_OFF	(CACHE40_OFF|IC60_CABC)
 
+#if defined(_KERNEL) || defined(_KMEMUSER)
 #include sys/cpu_data.h
 
-#if defined(_KERNEL) || defined(_KMEMUSER)
 struct cpu_info {
 	struct cpu_data ci_data;	/* MI per-cpu data */
 	cpuid_t	ci_cpuid;



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

2010-06-06 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Sun Jun  6 11:41:06 UTC 2010

Modified Files:
src/sys/arch/m68k/include: pmap_motorola.h

Log Message:
Only include opt_m68k_arch.h if _KERNEL_OPT is defined, so that librump
builds again.  OK'ed by m...@.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/m68k/include/pmap_motorola.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/m68k/include/pmap_motorola.h
diff -u src/sys/arch/m68k/include/pmap_motorola.h:1.29 src/sys/arch/m68k/include/pmap_motorola.h:1.30
--- src/sys/arch/m68k/include/pmap_motorola.h:1.29	Sun Jun  6 04:50:07 2010
+++ src/sys/arch/m68k/include/pmap_motorola.h	Sun Jun  6 11:41:06 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_motorola.h,v 1.29 2010/06/06 04:50:07 mrg Exp $	*/
+/*	$NetBSD: pmap_motorola.h,v 1.30 2010/06/06 11:41:06 he Exp $	*/
 
 /* 
  * Copyright (c) 1991, 1993
@@ -76,7 +76,9 @@
 #ifndef	_M68K_PMAP_MOTOROLA_H_
 #define	_M68K_PMAP_MOTOROLA_H_
 
+#ifdef _KERNEL_OPT
 #include opt_m68k_arch.h
+#endif
 
 #include sys/simplelock.h
 #include machine/cpu.h



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

2009-12-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Dec 13 12:32:46 UTC 2009

Modified Files:
src/sys/arch/m68k/include: pmap_motorola.h

Log Message:
- update some comments
- use unsigned constant for shift op


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/m68k/include/pmap_motorola.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/m68k/include/pmap_motorola.h
diff -u src/sys/arch/m68k/include/pmap_motorola.h:1.27 src/sys/arch/m68k/include/pmap_motorola.h:1.28
--- src/sys/arch/m68k/include/pmap_motorola.h:1.27	Fri Dec 11 18:57:44 2009
+++ src/sys/arch/m68k/include/pmap_motorola.h	Sun Dec 13 12:32:46 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_motorola.h,v 1.27 2009/12/11 18:57:44 tsutsui Exp $	*/
+/*	$NetBSD: pmap_motorola.h,v 1.28 2009/12/13 12:32:46 tsutsui Exp $	*/
 
 /* 
  * Copyright (c) 1991, 1993
@@ -101,8 +101,8 @@
  * We are using following segment layout in m68k pmap_motorola.c:
  * 68020/030 4KB/page: l1,l2,page== 10,10,12	(%tc = 0x82c0aa00)
  * 68020/030 8KB/page: l1,l2,page==  8,11,13	(%tc = 0x82d08b00)
- * 68040/060 4KB/page: l1,l2,l3,page == 7,7,6,12
- * 68040/060 8KB/page: l1,l2,l3,page == 7,7,5,13
+ * 68040/060 4KB/page: l1,l2,l3,page == 7,7,6,12	(%tc = 0x8000)
+ * 68040/060 8KB/page: l1,l2,l3,page == 7,7,5,13	(%tc = 0xc000)
  *
  * 68020/030 l2 size is chosen per NPTEPG, a number of page table entries
  * per page, to use one whole page for PTEs per one segment table entry,
@@ -152,18 +152,20 @@
  * (block 31).  For convenience, the level 1 table is considered to be
  * block 0.
  *
- * MAX[KU]L2SIZE control how many pages of level 2 descriptors are allowed.
- * for the kernel and users.  8 implies only the initial segment table
- * page is used.  WARNING: don't change MAXUL2SIZE unless you can allocate
- * physically contiguous pages for the ST in pmap.c!
+ * MAX[KU]L2SIZE control how many pages of level 2 descriptors are allowed
+ * for the kernel and users.
+ * 16 or 8 implies only the initial segment table page is used,
+ * i.e. it means PAGE_SIZE / (SG4_LEV1SIZE * sizeof(st_entry_t)).
+ * WARNING: don't change MAXUL2SIZE unless you can allocate
+ * physically contiguous pages for the ST in pmap_motorola.c!
  */
 #define MAXKL2SIZE	32
-#if PAGE_SIZE == 8192
+#if PAGE_SIZE == 8192	/* NBPG / (SG4_LEV1SIZE * sizeof(st_entry_t)) */
 #define MAXUL2SIZE	16
 #else
 #define MAXUL2SIZE	8
 #endif
-#define l2tobm(n)	(1  (n))
+#define l2tobm(n)	(1U  (n))
 #define bmtol2(n)	(ffs(n) - 1)
 
 /*



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

2009-12-08 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Dec  8 15:32:01 UTC 2009

Modified Files:
src/sys/arch/m68k/include: pmap_motorola.h

Log Message:
Remove unused M68K_SEG_SIZE macro. All sources use NBSEG directly.

XXX: It looks NBSEG definitions in machine/param.h
XXX: for all m68k port are incorrect, since 1997 or 2002.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/m68k/include/pmap_motorola.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/m68k/include/pmap_motorola.h
diff -u src/sys/arch/m68k/include/pmap_motorola.h:1.24 src/sys/arch/m68k/include/pmap_motorola.h:1.25
--- src/sys/arch/m68k/include/pmap_motorola.h:1.24	Sun Dec  6 06:41:30 2009
+++ src/sys/arch/m68k/include/pmap_motorola.h	Tue Dec  8 15:32:01 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_motorola.h,v 1.24 2009/12/06 06:41:30 tsutsui Exp $	*/
+/*	$NetBSD: pmap_motorola.h,v 1.25 2009/12/08 15:32:01 tsutsui Exp $	*/
 
 /* 
  * Copyright (c) 1991, 1993
@@ -80,8 +80,6 @@
 #include machine/cpu.h
 #include machine/pte.h
 
-#define M68K_SEG_SIZE	NBSEG
-
 /*
  * Pmap stuff
  */



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

2009-12-07 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Dec  7 14:23:46 UTC 2009

Modified Files:
src/sys/arch/m68k/include: pte_motorola.h

Log Message:
Remove #if defined(amiga) || defined(atari) for PG_SHIFT.
Use PGSHIFT from machine/param.h instead.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/m68k/include/pte_motorola.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/m68k/include/pte_motorola.h
diff -u src/sys/arch/m68k/include/pte_motorola.h:1.6 src/sys/arch/m68k/include/pte_motorola.h:1.7
--- src/sys/arch/m68k/include/pte_motorola.h:1.6	Sat Jan 17 01:38:10 2009
+++ src/sys/arch/m68k/include/pte_motorola.h	Mon Dec  7 14:23:45 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pte_motorola.h,v 1.6 2009/01/17 01:38:10 tsutsui Exp $	*/
+/*	$NetBSD: pte_motorola.h,v 1.7 2009/12/07 14:23:45 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -89,11 +89,7 @@
 #define	PT_ENTRY_NULL	NULL
 #define	ST_ENTRY_NULL	NULL
 
-#if defined(amiga) || defined(atari)
-#define PG_SHIFT	13
-#else
-#define PG_SHIFT	12
-#endif
+#define PG_SHIFT	PGSHIFT
 
 #define	SG_V		0x0002	/* segment is valid */
 #define	SG_NV		0x



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

2009-05-06 Thread Michael L. Hitch
Module Name:src
Committed By:   mhitch
Date:   Wed May  6 21:37:40 UTC 2009

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

Log Message:
Add memory clobber to the instructions that change the IPL in the status
register.  See also kern/38637.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/m68k/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/m68k/include/psl.h
diff -u src/sys/arch/m68k/include/psl.h:1.13 src/sys/arch/m68k/include/psl.h:1.14
--- src/sys/arch/m68k/include/psl.h:1.13	Thu Feb 16 20:17:13 2006
+++ src/sys/arch/m68k/include/psl.h	Wed May  6 21:37:40 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.13 2006/02/16 20:17:13 perry Exp $	*/
+/*	$NetBSD: psl.h,v 1.14 2009/05/06 21:37:40 mhitch Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -79,7 +79,7 @@
 	int sr;
 
 	__asm volatile (movew %%sr,%0; movew %1,%%sr :
-	=d (sr) : di (s));
+	=d (sr) : di (s) : memory);
 
 	return sr;
 }
@@ -92,7 +92,7 @@
 	__asm volatile(movw %%sr,%0 : =d (sr));
 
 	if ((u_int16_t)level = PSL_HIGHIPL || (u_int16_t)level  (u_int16_t)sr)
-		__asm volatile(movw %0,%%sr :: di (level));
+		__asm volatile(movw %0,%%sr :: di (level) : memory);
 
 	return sr;
 }