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

2020-06-29 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Mon Jun 29 17:09:33 UTC 2020

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

Log Message:
Fix for last checkin, don't try use non-existent register from a (currently) 
dummy struct


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/ia64/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/ia64/include/mcontext.h
diff -u src/sys/arch/ia64/include/mcontext.h:1.11 src/sys/arch/ia64/include/mcontext.h:1.12
--- src/sys/arch/ia64/include/mcontext.h:1.11	Mon Jun 29 01:37:27 2020
+++ src/sys/arch/ia64/include/mcontext.h	Mon Jun 29 17:09:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mcontext.h,v 1.11 2020/06/29 01:37:27 scole Exp $	*/
+/*	$NetBSD: mcontext.h,v 1.12 2020/06/29 17:09:33 scole Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -114,7 +114,7 @@ typedef struct __mcontext {
 #define _UC_MACHINE_SP(uc)	((uc)->uc_mcontext.mc_special.sp)  /* gregs[12] */
 #define _UC_MACHINE_FP(uc)	0 /* Not supported in target */
 #define	_UC_MACHINE_PC(uc)	((uc)->uc_mcontext.mc_special.iip)
-#define	_UC_MACHINE_INTRV(uc)	((uc)->uc_mcontext.__gregs[8])
+#define	_UC_MACHINE_INTRV(uc)	((uc)->uc_mcontext.mc_scratch.gr8) /* gregs[8] */
 #define _UC_MACHINE_SET_PC(uc, pc)	(uc)->uc_mcontext.mc_special.iip = (pc)
 
 #if defined(_RTLD_SOURCE) || defined(_LIBC_SOURCE) || \



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

2020-06-28 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Mon Jun 29 01:37:27 UTC 2020

Modified Files:
src/sys/arch/ia64/include: mcontext.h setjmp.h

Log Message:
Allow kernel to compile by preventing "error: stack usage is ..."
too-large errors.  What was there previously was not correct and this
will need to be revisited for debugger to ever become functional
anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/ia64/include/mcontext.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/include/setjmp.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/ia64/include/mcontext.h
diff -u src/sys/arch/ia64/include/mcontext.h:1.10 src/sys/arch/ia64/include/mcontext.h:1.11
--- src/sys/arch/ia64/include/mcontext.h:1.10	Fri Dec 27 00:32:17 2019
+++ src/sys/arch/ia64/include/mcontext.h	Mon Jun 29 01:37:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mcontext.h,v 1.10 2019/12/27 00:32:17 kamil Exp $	*/
+/*	$NetBSD: mcontext.h,v 1.11 2020/06/29 01:37:27 scole Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include 
 
 /* XXX fix this, just get to compile for now */
-#define _NGREG	128 
+#define _NGREG	1
 
 #ifndef __ASSEMBLER__
 typedef unsigned long __greg_t;

Index: src/sys/arch/ia64/include/setjmp.h
diff -u src/sys/arch/ia64/include/setjmp.h:1.3 src/sys/arch/ia64/include/setjmp.h:1.4
--- src/sys/arch/ia64/include/setjmp.h:1.3	Thu May  2 16:55:51 2019
+++ src/sys/arch/ia64/include/setjmp.h	Mon Jun 29 01:37:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: setjmp.h,v 1.3 2019/05/02 16:55:51 scole Exp $	*/
+/*	$NetBSD: setjmp.h,v 1.4 2020/06/29 01:37:27 scole Exp $	*/
 
 /*-
  * Copyright (c) 2000
@@ -86,6 +86,7 @@
 #define	J_SIGMASK	0x1d8
 #define	J_SIGSET	0x1e0
 
-#define	_JBLEN		0x200			/* Size in long XXX: Set to sizeof(mcontext_t)/sizeof(long) */
+/* XXX use FreeBSD value for now, set to sizeof(mcontext_t)/sizeof(long) ? */
+#define	_JBLEN		0x20			/* Size in long doubles */
 
 #endif /* !_MACHINE_SETJMP_H_ */



CVS commit: src/usr.bin/units

2020-04-22 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Wed Apr 22 16:57:58 UTC 2020

Modified Files:
src/usr.bin/units: units.lib

Log Message:
Add troyounce


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/units/units.lib

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

Modified files:

Index: src/usr.bin/units/units.lib
diff -u src/usr.bin/units/units.lib:1.22 src/usr.bin/units/units.lib:1.23
--- src/usr.bin/units/units.lib:1.22	Wed Apr 22 16:35:47 2020
+++ src/usr.bin/units/units.lib	Wed Apr 22 16:57:57 2020
@@ -1,4 +1,4 @@
-/	$NetBSD: units.lib,v 1.22 2020/04/22 16:35:47 scole Exp $
+/	$NetBSD: units.lib,v 1.23 2020/04/22 16:57:57 scole Exp $
 
 / primitive units
 
@@ -136,6 +136,7 @@ apdram			60 grain
 apounce			480 grain
 appound			5760 grain
 troypound		appound
+troyounce		1|12 troypound
 
 / Length
 



CVS commit: src/usr.bin/units

2020-04-22 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Wed Apr 22 16:35:47 UTC 2020

Modified Files:
src/usr.bin/units: units.lib

Log Message:
On second thought, don't include more than one spelling for thai units


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/units/units.lib

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

Modified files:

Index: src/usr.bin/units/units.lib
diff -u src/usr.bin/units/units.lib:1.21 src/usr.bin/units/units.lib:1.22
--- src/usr.bin/units/units.lib:1.21	Wed Apr 22 16:21:37 2020
+++ src/usr.bin/units/units.lib	Wed Apr 22 16:35:47 2020
@@ -1,4 +1,4 @@
-/	$NetBSD: units.lib,v 1.21 2020/04/22 16:21:37 scole Exp $
+/	$NetBSD: units.lib,v 1.22 2020/04/22 16:35:47 scole Exp $
 
 / primitive units
 
@@ -658,15 +658,13 @@ krabiat			0.5208 cm
 nio			4 krabiat
 khuep			12 nio
 sok			2 khuep
-wa			4 sok
-wah			wa
-sen			20 wa
+wah			4 sok
+sen			20 wah
 yot			400 sen
 
 / Thai area
 
 tarangwah		4 m2
-talangwah		tarangwah
 ngan			100 tarangwah
 rai			4 ngan
 
@@ -674,7 +672,6 @@ rai			4 ngan
 
 salueng			3.75 gm
 baht			4 salueng
-bat			baht
 tamlueng		4 baht
 chang			20 tamlueng
 hap			50 chang



CVS commit: src/usr.bin/units

2020-04-22 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Wed Apr 22 16:21:37 UTC 2020

Modified Files:
src/usr.bin/units: units.lib

Log Message:
Add more Thai length, area and weight units


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/units/units.lib

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

Modified files:

Index: src/usr.bin/units/units.lib
diff -u src/usr.bin/units/units.lib:1.20 src/usr.bin/units/units.lib:1.21
--- src/usr.bin/units/units.lib:1.20	Tue Mar 21 01:21:59 2017
+++ src/usr.bin/units/units.lib	Wed Apr 22 16:21:37 2020
@@ -1,4 +1,4 @@
-/	$NetBSD: units.lib,v 1.20 2017/03/21 01:21:59 scole Exp $
+/	$NetBSD: units.lib,v 1.21 2020/04/22 16:21:37 scole Exp $
 
 / primitive units
 
@@ -652,9 +652,30 @@ worstedyarncount	1680 ft/pound
 metricyarncount		meter/gram
 jewlerspoint		2 milligram
 
-/ thai measurements
+/ Thai length
 
-wah			2 m
-ngan			400 m2
-rai			1600 m2
+krabiat			0.5208 cm
+nio			4 krabiat
+khuep			12 nio
+sok			2 khuep
+wa			4 sok
+wah			wa
+sen			20 wa
+yot			400 sen
+
+/ Thai area
+
+tarangwah		4 m2
+talangwah		tarangwah
+ngan			100 tarangwah
+rai			4 ngan
+
+/ Thai weight
+
+salueng			3.75 gm
+baht			4 salueng
+bat			baht
+tamlueng		4 baht
+chang			20 tamlueng
+hap			50 chang
 



CVS commit: src/sys/arch/ia64

2020-02-02 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Mon Feb  3 02:56:25 UTC 2020

Modified Files:
src/sys/arch/ia64: TODO

Log Message:
Update architectures ski is known to run on


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/ia64/TODO

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/ia64/TODO
diff -u src/sys/arch/ia64/TODO:1.9 src/sys/arch/ia64/TODO:1.10
--- src/sys/arch/ia64/TODO:1.9	Sun Nov 17 16:52:29 2019
+++ src/sys/arch/ia64/TODO	Mon Feb  3 02:56:25 2020
@@ -1,9 +1,8 @@
-$ NetBSD: TODO,v 1.1 2018/04/14 12:06:03 scole Exp $
+$ NetBSD: TODO,v 1.10 2020/02/03 02:54:23 scole Exp $
 
 What works:
   The ski simulator (pkgsrc/emulators/ski) is known to work on NetBSD
-  i386 and amd64, and probably will work on other archs as well.  It
-  can run and step through in assembly.
+  i386, amd64 and macppc. It "should" work on other archs as well.
 
   Netbooting may work on some machines, basically you need to boot
   diskless with the loader.efi (from src/sys/arch/ia64/stand/ia64/)



CVS commit: src/sys/arch/ia64/stand/ia64/ski

2020-01-14 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Tue Jan 14 16:23:08 UTC 2020

Modified Files:
src/sys/arch/ia64/stand/ia64/ski: ssc.c

Log Message:
add noinline attribute


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/stand/ia64/ski/ssc.c

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/ia64/stand/ia64/ski/ssc.c
diff -u src/sys/arch/ia64/stand/ia64/ski/ssc.c:1.3 src/sys/arch/ia64/stand/ia64/ski/ssc.c:1.4
--- src/sys/arch/ia64/stand/ia64/ski/ssc.c:1.3	Mon Jul 20 04:59:04 2009
+++ src/sys/arch/ia64/stand/ia64/ski/ssc.c	Tue Jan 14 16:23:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ssc.c,v 1.3 2009/07/20 04:59:04 kiyohara Exp $	*/
+/*	$NetBSD: ssc.c,v 1.4 2020/01/14 16:23:07 scole Exp $	*/
 
 /*-
  * Copyright (c) 2001 Doug Rabson
@@ -41,6 +41,8 @@
  * PSR.dt across the SSC call. We do this by saving and restoring psr.l
  * completely.
  */
+
+__attribute__((__noinline__))
 u_int64_t
 ssc(u_int64_t in0, u_int64_t in1, u_int64_t in2, u_int64_t in3, int which)
 {



CVS commit: src/share/man/man4/man4.macppc

2019-12-11 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Wed Dec 11 21:05:17 UTC 2019

Modified Files:
src/share/man/man4/man4.macppc: platinumfb.4

Log Message:
Synchronize htdocs, manual, comments, and code so that enabling the platinumfb 
is done using "platinum" in openfirmware settings.  Remove "screen" option 
which was somewhat disingenuous.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/man4.macppc/platinumfb.4

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

Modified files:

Index: src/share/man/man4/man4.macppc/platinumfb.4
diff -u src/share/man/man4/man4.macppc/platinumfb.4:1.4 src/share/man/man4/man4.macppc/platinumfb.4:1.5
--- src/share/man/man4/man4.macppc/platinumfb.4:1.4	Thu Sep 15 15:25:11 2016
+++ src/share/man/man4/man4.macppc/platinumfb.4	Wed Dec 11 21:05:17 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: platinumfb.4,v 1.4 2016/09/15 15:25:11 wiz Exp $
+.\" $NetBSD: platinumfb.4,v 1.5 2019/12/11 21:05:17 scole Exp $
 .\"
 .\" Copyright (c) 2016 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd September 14, 2016
+.Dd December 11, 2019
 .Dt PLATINUMFB 4 macppc
 .Os
 .Sh NAME
@@ -41,7 +41,7 @@ couple early model PowerMacs such as the
 This driver should support console output (with rastor ops) and X
 (in unaccelerated modes).
 .Pp
-It may be required to set the output-device to 'screen' in Open Firmware.
+It may be required to set the output-device to 'platinum' in Open Firmware.
 .Sh SEE ALSO
 .Xr wsdisplay 4 ,
 .Xr rasops 9



CVS commit: src/sys/arch/macppc

2019-12-11 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Wed Dec 11 21:04:47 UTC 2019

Modified Files:
src/sys/arch/macppc/conf: GENERIC_601 INSTALL_601
src/sys/arch/macppc/dev: platinumfb.c

Log Message:
Synchronize htdocs, manual, comments, and code so that enabling the platinumfb 
is done using "platinum" in openfirmware settings.  Remove "screen" option 
which was somewhat disingenuous.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/macppc/conf/GENERIC_601
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/macppc/conf/INSTALL_601
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/macppc/dev/platinumfb.c

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/macppc/conf/GENERIC_601
diff -u src/sys/arch/macppc/conf/GENERIC_601:1.24 src/sys/arch/macppc/conf/GENERIC_601:1.25
--- src/sys/arch/macppc/conf/GENERIC_601:1.24	Fri Apr 26 22:46:03 2019
+++ src/sys/arch/macppc/conf/GENERIC_601	Wed Dec 11 21:04:47 2019
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC_601,v 1.24 2019/04/26 22:46:03 sevan Exp $
+# $NetBSD: GENERIC_601,v 1.25 2019/12/11 21:04:47 scole Exp $
 #
 # GENERIC machine description file
 # 
@@ -28,7 +28,7 @@ include 	"arch/macppc/conf/std.macppc.60
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-ident 		"GENERIC-$Revision: 1.24 $"
+ident 		"GENERIC-$Revision: 1.25 $"
 
 maxusers	32
 
@@ -217,8 +217,8 @@ ahc*	at pci? dev ? function ?	# Adaptec 
 # official Macintosh firmware from 3Dfx. The others should work but are
 # untested with OF 1.0.5
 
-# this will take over the console if output-device is set to 'screen' or
-# 'platinum'. It will provide a NetBSD console, but still won't work with OF
+# this will take over the console if output-device is set to 'platinum'.
+# It will provide a NetBSD console, but still won't work with OF
 platinumfb0 	at mainbus?
 
 #gffb*		at pci?	function ?	# NVIDIA GeForce2 MX

Index: src/sys/arch/macppc/conf/INSTALL_601
diff -u src/sys/arch/macppc/conf/INSTALL_601:1.3 src/sys/arch/macppc/conf/INSTALL_601:1.4
--- src/sys/arch/macppc/conf/INSTALL_601:1.3	Sun Dec  8 21:30:00 2019
+++ src/sys/arch/macppc/conf/INSTALL_601	Wed Dec 11 21:04:47 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: INSTALL_601,v 1.3 2019/12/08 21:30:00 scole Exp $
+#	$NetBSD: INSTALL_601,v 1.4 2019/12/11 21:04:47 scole Exp $
 #
 # config file for INSTALL
 #
@@ -82,8 +82,8 @@ ahc*	at pci? dev ? function ?	# Adaptec 
 # The only cards known to work ( so far ) are PCI Voodoo3s flashed with the
 # official Macintosh firmware from 3Dfx. The others should work but are
 # untested with OF 1.0.5
-# this will take over the console if output-device is set to 'screen' or
-# 'platinum'. It will provide a NetBSD console, but still won't work with OF
+# this will take over the console if output-device is set to 'platinum'.
+# It will provide a NetBSD console, but still won't work with OF
 platinumfb0 	at mainbus?
 
 #gffb*		at pci?	function ?	# NVIDIA GeForce2 MX

Index: src/sys/arch/macppc/dev/platinumfb.c
diff -u src/sys/arch/macppc/dev/platinumfb.c:1.3 src/sys/arch/macppc/dev/platinumfb.c:1.4
--- src/sys/arch/macppc/dev/platinumfb.c:1.3	Fri Sep 16 17:32:36 2016
+++ src/sys/arch/macppc/dev/platinumfb.c	Wed Dec 11 21:04:47 2019
@@ -47,7 +47,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: platinumfb.c,v 1.3 2016/09/16 17:32:36 scole Exp $");
+__KERNEL_RCSID(0, "$NetBSD: platinumfb.c,v 1.4 2019/12/11 21:04:47 scole Exp $");
 
 #include 
 #include 
@@ -569,8 +569,8 @@ platinumfb_init(device_t self)
 	int i;
 
 	/*
-	 * become console if OF variable "output-device" is "screen" or
-	 * contains "platinum", since normal OF video variables are unavailable
+	 * become console if OF variable "output-device" contains "platinum",
+	 * since normal OF video variables are unavailable
 	 */
 	int options;
 	char output_device[128];
@@ -582,8 +582,7 @@ platinumfb_init(device_t self)
 		aprint_error_dev(sc->sc_dev,
 		"could not get output-device prop, assuming not console\n");
 	} else {
-		if (strstr(output_device,"platinum") ||
-		strcmp(output_device,"screen") == 0 ) {
+		if (strstr(output_device,"platinum")) {
 			is_console = TRUE;
 		}
 	}	



CVS commit: src/sys/arch/macppc/conf

2019-12-08 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sun Dec  8 21:30:00 UTC 2019

Modified Files:
src/sys/arch/macppc/conf: INSTALL_601

Log Message:
add platinumfb


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/macppc/conf/INSTALL_601

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/macppc/conf/INSTALL_601
diff -u src/sys/arch/macppc/conf/INSTALL_601:1.2 src/sys/arch/macppc/conf/INSTALL_601:1.3
--- src/sys/arch/macppc/conf/INSTALL_601:1.2	Mon Jan  7 01:44:59 2019
+++ src/sys/arch/macppc/conf/INSTALL_601	Sun Dec  8 21:30:00 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: INSTALL_601,v 1.2 2019/01/07 01:44:59 scole Exp $
+#	$NetBSD: INSTALL_601,v 1.3 2019/12/08 21:30:00 scole Exp $
 #
 # config file for INSTALL
 #
@@ -84,7 +84,7 @@ ahc*	at pci? dev ? function ?	# Adaptec 
 # untested with OF 1.0.5
 # this will take over the console if output-device is set to 'screen' or
 # 'platinum'. It will provide a NetBSD console, but still won't work with OF
-#platinumfb0 	at mainbus?
+platinumfb0 	at mainbus?
 
 #gffb*		at pci?	function ?	# NVIDIA GeForce2 MX
 #machfb*		at pci? function ?	# ATI Mach 64, Rage, Rage Pro



CVS commit: src/doc

2019-12-05 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu Dec  5 16:51:06 UTC 2019

Modified Files:
src/doc: CHANGES.prev

Log Message:
Fix date sorting order of previous checkin


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.152 src/doc/CHANGES.prev

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

Modified files:

Index: src/doc/CHANGES.prev
diff -u src/doc/CHANGES.prev:1.151 src/doc/CHANGES.prev:1.152
--- src/doc/CHANGES.prev:1.151	Thu Dec  5 09:36:01 2019
+++ src/doc/CHANGES.prev	Thu Dec  5 16:51:06 2019
@@ -1,4 +1,4 @@
-LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.151 $>
+LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.152 $>
 
 
 Changes from 386bsd 0.1 + patchkit 0.2.2 to NetBSD 0.8:
@@ -12517,11 +12517,11 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 		[christos 20190103]
 	evbarm: Add SMP support for Allwinner multi-cluster SoCs (A83T, A80).
 		[jmcneill 20190103]
-	macppc: Update install media and documentation for powerpc 601
-		machines. [scole 20190107]
 	wpa: Import wpa_supplicant and hostapd 2.7. [christos 20190104]
 	acpi(4): Updated ACPICA to 20181213. [christos 20190104]
 	tmux(1): Imported 2.8. [christos 20190104]
+	macppc: Update install media and documentation for powerpc 601
+		machines. [scole 20190107]
 	TrouSerS: Import trousers-0.3.14. [christos 20190107]
 	tpm-tools: Import tpm-tools-1.3.9.1. [christos 20190107]
 	compiler-rt: Import compiler-rt r350590 LLVM sanitizers.



CVS commit: src/sys/arch/ia64

2019-05-09 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu May  9 15:48:55 UTC 2019

Modified Files:
src/sys/arch/ia64/conf: Makefile.ia64
src/sys/arch/ia64/ia64: pmap.c

Log Message:
Revert -O0 for pmap, avoid RAW dependency compilation warning


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ia64/conf/Makefile.ia64
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/ia64/ia64/pmap.c

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/ia64/conf/Makefile.ia64
diff -u src/sys/arch/ia64/conf/Makefile.ia64:1.7 src/sys/arch/ia64/conf/Makefile.ia64:1.8
--- src/sys/arch/ia64/conf/Makefile.ia64:1.7	Sat May  4 02:06:59 2019
+++ src/sys/arch/ia64/conf/Makefile.ia64	Thu May  9 15:48:55 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.ia64,v 1.7 2019/05/04 02:06:59 scole Exp $
+#	$NetBSD: Makefile.ia64,v 1.8 2019/05/09 15:48:55 scole Exp $
 
 # Makefile for NetBSD
 #
@@ -34,11 +34,6 @@ GENASSYM_CONF=	${IA64}/ia64/genassym.cf
 CPPFLAGS+=	-mconstant-gp -Dia64
 AFLAGS+=	-x assembler-with-cpp -Wa,-x 
 
-# XXX don't optimize pmap.c to get rid of assembler warnings like:
-#   Warning: Use of 'st8' may violate RAW dependency 'RR#' (data)
-# Happening with gcc7 and iirc several years worth of prior gcc versions
-COPTS.pmap.c+=	-O0
-
 ##
 ## (3) libkern and compat
 ##

Index: src/sys/arch/ia64/ia64/pmap.c
diff -u src/sys/arch/ia64/ia64/pmap.c:1.37 src/sys/arch/ia64/ia64/pmap.c:1.38
--- src/sys/arch/ia64/ia64/pmap.c:1.37	Fri May 25 06:34:02 2018
+++ src/sys/arch/ia64/ia64/pmap.c	Thu May  9 15:48:55 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.37 2018/05/25 06:34:02 jdolecek Exp $ */
+/* $NetBSD: pmap.c,v 1.38 2019/05/09 15:48:55 scole Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -81,7 +81,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.37 2018/05/25 06:34:02 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.38 2019/05/09 15:48:55 scole Exp $");
 
 #include 
 #include 
@@ -471,12 +471,13 @@ pmap_bootstrap(void)
 	if (base == 0)
 		panic("Unable to allocate VHPT");
 
-	if (bootverbose)
-		printf("VHPT: address=%#lx, size=%#lx\n", base, size);
-
 	pmap_vhpt_nbuckets = size / sizeof(struct ia64_lpte);
 	pmap_vhpt_bucket = (void *)uvm_pageboot_alloc(pmap_vhpt_nbuckets *
 		  sizeof(struct ia64_bucket));
+	if (bootverbose)
+		printf("VHPT: address=%#lx, size=%#lx, buckets=%ld, address=%lx\n",
+		   base, size, pmap_vhpt_nbuckets, (long unsigned int)_vhpt_bucket[0]);
+
 	for (i = 0; i < pmap_vhpt_nbuckets; i++) {
 		/* Stolen memory is zeroed. */
 		mutex_init(_vhpt_bucket[i].mutex, MUTEX_DEFAULT, IPL_VM);
@@ -2541,6 +2542,8 @@ pmap_switch(pmap_t pm)
 		}
 	}
 
+	/* XXX */
+	ia64_srlz_d();
 	curcpu()->ci_pmap = pm;
 	ia64_srlz_d();
 



CVS commit: src/sys/arch/ia64/stand/efi/libefi

2019-05-06 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Tue May  7 02:05:17 UTC 2019

Modified Files:
src/sys/arch/ia64/stand/efi/libefi: exec.c

Log Message:
Avoid some RAW dependency compilation warnings


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ia64/stand/efi/libefi/exec.c

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/ia64/stand/efi/libefi/exec.c
diff -u src/sys/arch/ia64/stand/efi/libefi/exec.c:1.7 src/sys/arch/ia64/stand/efi/libefi/exec.c:1.8
--- src/sys/arch/ia64/stand/efi/libefi/exec.c:1.7	Thu Aug  4 18:07:43 2016
+++ src/sys/arch/ia64/stand/efi/libefi/exec.c	Tue May  7 02:05:17 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: exec.c,v 1.7 2016/08/04 18:07:43 scole Exp $ */
+/* $NetBSD: exec.c,v 1.8 2019/05/07 02:05:17 scole Exp $ */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -192,13 +192,17 @@ elf64_exec(struct preloaded_file *fp)
 
 	__asm __volatile("mov cr.ifa=%0" :: "r"(IA64_RR_BASE(7)));
 	__asm __volatile("mov cr.itir=%0" :: "r"(28 << 2));
-	__asm __volatile("ptr.i %0,%1" :: "r"(IA64_RR_BASE(7)), "r"(28<<2));
+	__asm __volatile("srlz.d;;");
+	
 	__asm __volatile("ptr.d %0,%1" :: "r"(IA64_RR_BASE(7)), "r"(28<<2));
+	__asm __volatile("srlz.d;;");
+	__asm __volatile("itr.d dtr[%0]=%1;;" :: "r"(0), "r"(pte));
+	__asm __volatile("srlz.d;;");
+	
+	__asm __volatile("ptr.i %0,%1;;" :: "r"(IA64_RR_BASE(7)), "r"(28<<2));
 	__asm __volatile("srlz.i;;");
 	__asm __volatile("itr.i itr[%0]=%1;;" :: "r"(0), "r"(pte));
 	__asm __volatile("srlz.i;;");
-	__asm __volatile("itr.d dtr[%0]=%1;;" :: "r"(0), "r"(pte));
-	__asm __volatile("srlz.i;;");
 
 	enter_kernel(fp->marks[MARK_ENTRY], bi);
 



CVS commit: src/sys/arch/ia64

2019-05-05 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sun May  5 16:45:34 UTC 2019

Modified Files:
src/sys/arch/ia64: TODO

Log Message:
a little bit of clean up, sort ski items, and some notes about libunwind


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/ia64/TODO

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/ia64/TODO
diff -u src/sys/arch/ia64/TODO:1.5 src/sys/arch/ia64/TODO:1.6
--- src/sys/arch/ia64/TODO:1.5	Wed Apr  3 21:03:06 2019
+++ src/sys/arch/ia64/TODO	Sun May  5 16:45:34 2019
@@ -1,7 +1,7 @@
 $ NetBSD: TODO,v 1.1 2018/04/14 12:06:03 scole Exp $
 
 What works:
-  The ski simulator (pkgsrc/emulators/ski) works on NetBSD, can run
+  The ski simulator (pkgsrc/emulators/ski) works on NetBSD/i386, can run
   and step through in assembly.
 
   Netbooting may work on some machines, basically you need to boot
@@ -13,32 +13,29 @@ What works:
   Also, a successful report of booting off the CD is here
   http://mail-index.netbsd.org/port-ia64/2009/06/18/msg000102.html
 
-Tasks remaining, first couple seem most important:
-
-- pmap.c is getting compilation warnings (for gcc6 & gcc7) like
-  /var/tmp//cckQKcKn.s:7614: Warning: Use of 'st8' may violate RAW dependency 'RR#' (data)
-  ...
-  how to change compile flags for specific kernel file like "CFLAGS.pmap.c+= -O0" ?
+Tasks remaining:
 - context switching and forking appear unfinished,
   vm_machdep.c::cpu_lwp_fork() appears incomplete
-- pmap module, imported from freebsd but still needs more work and
-  testing
+- pmap module, imported from freebsd but still needs more work and testing
 - IA64 Stack unwind code: Support remaining unwind descriptor
   types. (See arch/ia64/unwind/TODO). ddb() traces need to print line
-  information also.  Seems like a lot of this could be re-used
-  from freebsd
+  information also.  Seems like there are a few options:
+   1) fix and finish current unwind that is minimal, incomplete, and buggy
+   2) import FreeBSD/ia64 implementation, may be derived from HP originally:
+  http://lists.llvm.org/pipermail/cfe-dev/2016-September/050649.html
+   3) import this version
+  https://www.nongnu.org/libunwind/man/libunwind-ia64(3).html
+  originally written by one of ia64 gurus but still looks maintained
+  and portable
+   4) something else
+- kernel with LOCKDEBUG option crashes in pmap startup somewhere
 - redo _regset.h in netbsd style with __greg_t __gregset_t
-- some commands in ski are not yet implemented, 2 important ones
-  are still missing, "cstack" and "pm", which view the stack and
-  source code lines respectively 
-- create a ski network driver
-- create a ski disk driver
 - implement ld.elf_so, MK_DYNAMICROOT
 - fix memory detection, on real hardware doesn't find all memory
-- implement interrupts (sacpi & pci), can be mostly from freebsd?
+- implement interrupts (sacpi & pci)
 - MKGDB for ia64
 - implement fp[gs]etsticky, [make|get|set|swap]context
-- floating point, fenv functions were imported from freebsd, but haven't been tested
+- floating point, fenv functions were imported from freebsd, but only compile tested
 - implement core_machdep.c
 - implement __cloneS ptrace.S sbrk.S shmat.S
 - implement kvm_ia64.c
@@ -48,10 +45,9 @@ Tasks remaining, first couple seem most 
mutex_spin_enter()/mutex_spin_exit() __HAVE_SPIN_MUTEX_STUBS
 - rwlock.h rw_enter(),rw_exit(),rw_tryenter() __HAVE_RW_STUBS, implemented already?
 - add efipart_dev to read gpt/ffs disks for bootloader
-- fix printf of lx in bootloader/libsa ?
-- sort out bootloader/loader.efi stuff, is freebsd one good enough or
-  do we want commands more like netbsd i386 bootloader? e.g., add
-  command to boot nfs from loader.efi instead of hack now
+- sort out bootloader/loader.efi stuff, make it more like netbsd and
+  less like freebsd, command to boot nfs from loader.efi instead of
+  hack that exists now
 - ia64 implement __HAVE_FAST_SOFTINTS?
 - want or need __HAVE_CPU_UAREA_ROUTINES, cpu_uarea_alloc,  cpu_uarea_free
 - fix all "[Nn]ot yet" and "XXX" functions everywhere
@@ -65,9 +61,16 @@ Tasks remaining, first couple seem most 
 - write console and/or X framebuffer driver.  freebsd has vgapci
   device that may be portable
 - add ia32 emulation, port from freebsd
-- create install EFI/cdrom/netbsd
+- installation media for EFI/cdrom/usb
+
+ski emulator tasks:
+- some commands in ski are not yet implemented. 2 important ones
+  are still missing, "cstack" and "pm", which view the stack and
+  source code lines respectively 
+- create a ski network driver
+- create a ski disk driver
 - fix ski to run on other archs beside i386, or at least amd64
 
-Pie in the sky
+Pie in the sky:
 - Xen and itanium!
 - qemu and itanium



CVS commit: src/lib/csu/arch/ia64

2019-05-04 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat May  4 22:55:32 UTC 2019

Modified Files:
src/lib/csu/arch/ia64: crt0.S

Log Message:
add stop (;;) to elimate WAW dependency compiler warning


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/csu/arch/ia64/crt0.S

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

Modified files:

Index: src/lib/csu/arch/ia64/crt0.S
diff -u src/lib/csu/arch/ia64/crt0.S:1.2 src/lib/csu/arch/ia64/crt0.S:1.3
--- src/lib/csu/arch/ia64/crt0.S:1.2	Mon Nov 26 17:37:45 2018
+++ src/lib/csu/arch/ia64/crt0.S	Sat May  4 22:55:32 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0.S,v 1.2 2018/11/26 17:37:45 joerg Exp $ */
+/* $NetBSD: crt0.S,v 1.3 2019/05/04 22:55:32 scole Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-RCSID("$NetBSD: crt0.S,v 1.2 2018/11/26 17:37:45 joerg Exp $")
+RCSID("$NetBSD: crt0.S,v 1.3 2019/05/04 22:55:32 scole Exp $")
 
 STRONG_ALIAS(_start,__start)
 	
@@ -53,5 +53,6 @@ __start:
 	mov sp = in3 /* Setup Memory Stack Pointer. */
 	mov in1 = in2 /* obj is no longer used. */
 	alloc r31 = ar.pfs, 3, 0, 0, 0 /* Adjust backingstore for ___start() */
+	;;
 	br.call.sptk.many rp = ___start
 



CVS commit: src/sys/arch/ia64/conf

2019-05-03 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat May  4 02:06:59 UTC 2019

Modified Files:
src/sys/arch/ia64/conf: Makefile.ia64

Log Message:
Disable optimization for pmap.c to prevent RAW assembler dependency
warnings.

If port ever becomes more stable, should revert this and figure out
exactly why only pmap seems to have this issue in the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/ia64/conf/Makefile.ia64

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/ia64/conf/Makefile.ia64
diff -u src/sys/arch/ia64/conf/Makefile.ia64:1.6 src/sys/arch/ia64/conf/Makefile.ia64:1.7
--- src/sys/arch/ia64/conf/Makefile.ia64:1.6	Sat Sep 22 12:24:02 2018
+++ src/sys/arch/ia64/conf/Makefile.ia64	Sat May  4 02:06:59 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.ia64,v 1.6 2018/09/22 12:24:02 rin Exp $
+#	$NetBSD: Makefile.ia64,v 1.7 2019/05/04 02:06:59 scole Exp $
 
 # Makefile for NetBSD
 #
@@ -34,6 +34,11 @@ GENASSYM_CONF=	${IA64}/ia64/genassym.cf
 CPPFLAGS+=	-mconstant-gp -Dia64
 AFLAGS+=	-x assembler-with-cpp -Wa,-x 
 
+# XXX don't optimize pmap.c to get rid of assembler warnings like:
+#   Warning: Use of 'st8' may violate RAW dependency 'RR#' (data)
+# Happening with gcc7 and iirc several years worth of prior gcc versions
+COPTS.pmap.c+=	-O0
+
 ##
 ## (3) libkern and compat
 ##



CVS commit: src/sys/arch/ia64/ia64

2019-05-02 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu May  2 17:34:01 UTC 2019

Modified Files:
src/sys/arch/ia64/ia64: syscall_stubs.S

Log Message:
Add more code from FreeBSD, still needs work


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/ia64/ia64/syscall_stubs.S

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/ia64/ia64/syscall_stubs.S
diff -u src/sys/arch/ia64/ia64/syscall_stubs.S:1.5 src/sys/arch/ia64/ia64/syscall_stubs.S:1.6
--- src/sys/arch/ia64/ia64/syscall_stubs.S:1.5	Wed Jan  9 18:03:34 2019
+++ src/sys/arch/ia64/ia64/syscall_stubs.S	Thu May  2 17:34:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall_stubs.S,v 1.5 2019/01/09 18:03:34 scole Exp $	*/
+/*	$NetBSD: syscall_stubs.S,v 1.6 2019/05/02 17:34:01 scole Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2003 Marcel Moolenaar
@@ -74,9 +74,510 @@
  * information they need and we have the freedom to move code around.
  */
 
+/* XXX fix */	
+#define syscall		0	
+#define SYS_sigreturn	0
+	
 	.section	.text.gateway, "ax"
 	.align		PAGE_SIZE
 	.global		ia64_gateway_page
 ia64_gateway_page:
-#warning this is a stub!!!
+{   .mmb
+mov r14=ar.k7   // Memory stack
+mov r15=ar.k6   // Register stack
+epc
+;;
+}
+{   .mlx
+mov r11=psr
+movlr31=epc_syscall
+;;
+}
+{   .mib
+rum psr.be
+mov b7=r31
+br  b7
+;;
+}
+gw_ret:
+{   .mmi
+mov ar.rnat=r22
+;;
+mov ar.rsc=r24
+mov ar.pfs=r20
+}
+{   .mib
+mov ar.fpsr=r25
+mov b0=r18
+br.sptk b6
+;;
+}
+gw_ret_ia32:
+{   .mmi
+flushrs
+nop 0
+nop 0
+;;
+}
+{   .mib
+nop 0
+nop 0
+br.ia.sptk  b6
+;;
+}
 
+
+ENTRY_NOPROFILE(break_sigtramp, 0)
+{   .mib
+mov ar.rsc=0
+cmp.ne  p15,p0=0,gp
+cover
+;;
+}
+{   .mmi
+flushrs
+(p15)   invala
+add r16=16+UC_MCONTEXT+MC_SPECIAL,sp
+;;
+}
+{   .mmi
+mov r17=ar.bsp
+mov r18=ar.rnat
+add r14=40,r16
+;;
+}
+{   .mmi
+st8 [r14]=r17,64// bspstore
+(p15)   mov ar.bspstore=gp
+add r15=48,r16
+;;
+}
+{   .mmi
+st8 [r15]=r18   // rnat
+st8 [r14]=r0// ndirty
+nop 0
+;;
+}
+{   .mmi
+alloc   r14=ar.pfs, 0, 0, 3, 0
+mov ar.rsc=15
+mov out0=r8
+;;
+}
+{   .mmi
+ld8 r16=[r10],8 // function address
+;;
+ld8 gp=[r10]// function's gp value
+mov b7=r16
+;;
+}
+{   .mib
+mov out1=r9
+add out2=16,sp
+br.call.sptkrp=b7
+;;
+}
+{   .mmi
+mov r15=SYS_sigreturn
+add out0=16,sp
+break   0x10
+;;
+}
+{   .mmi
+mov r15=SYS_exit
+mov out0=ret0
+break   0x10
+;;
+}
+END(break_sigtramp)
+
+ENTRY_NOPROFILE(epc_sigtramp, 0)
+{   .mmi
+ld8 r16=[r10],8 // function address
+mov ar.rsc=0
+cmp.ne  p15,p0=0,gp
+;;
+}
+{   .mmi
+(p15)   invala
+(p15)   mov ar.bspstore=gp
+mov b7=r16
+;;
+}
+{   .mmi
+alloc   r14=ar.pfs, 0, 0, 3, 0
+mov ar.rsc=15
+nop 0
+;;
+}
+{   .mii
+ld8 gp=[r10]// function's gp value
+mov out0=r8
+mov out1=r9
+}
+{   .mib
+add out2=16,sp
+nop 0
+br.call.sptkrp=b7
+;;
+}
+add out0=16,sp
+/* XXX fix */	
+#if 0
+CALLSYS_NOERROR(sigreturn)
+mov out0=ret0
+CALLSYS_NOERROR(exit)
+#endif	
+END(epc_sigtramp)
+
+.align  PAGE_SIZE
+
+.text
+
+ENTRY_NOPROFILE(epc_syscall, 8)
+.prologue
+.unwabi @svr4, 'E'
+.save   rp, r0
+.body
+{   .mmi
+mov r16=ar.rsc
+mov ar.rsc=0
+nop 0
+;;
+}
+{   .mmi
+mov r18=ar.bspstore
+;;
+mov 

CVS commit: src/sys/arch/ia64/ia64

2019-05-02 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu May  2 17:31:56 UTC 2019

Modified Files:
src/sys/arch/ia64/ia64: genassym.cf

Log Message:
Restore UC_MCONTEXT, UC_MCONTEXT, and clean up some whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/ia64/ia64/genassym.cf

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/ia64/ia64/genassym.cf
diff -u src/sys/arch/ia64/ia64/genassym.cf:1.15 src/sys/arch/ia64/ia64/genassym.cf:1.16
--- src/sys/arch/ia64/ia64/genassym.cf:1.15	Thu May  2 16:55:50 2019
+++ src/sys/arch/ia64/ia64/genassym.cf	Thu May  2 17:31:56 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.15 2019/05/02 16:55:50 scole Exp $
+#	$NetBSD: genassym.cf,v 1.16 2019/05/02 17:31:56 scole Exp $
 
 #
 # Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -85,8 +85,8 @@ define	KSTACK_PAGES		KSTACK_PAGES
 
 define	IA64_VM_MINKERN_REGION	IA64_VM_MINKERN_REGION
 define	IA64_PBVM_RR		IA64_PBVM_RR
-define  IA64_PBVM_PAGE_SHIFT	IA64_PBVM_PAGE_SHIFT
-define  IA64_PSR_I		IA64_PSR_I
+define	IA64_PBVM_PAGE_SHIFT	IA64_PBVM_PAGE_SHIFT
+define	IA64_PSR_I		IA64_PSR_I
 define	IA64_PSR_DT		IA64_PSR_DT
 define	IA64_PSR_DFL		IA64_PSR_DFL
 define	IA64_PSR_DFH		IA64_PSR_DFH
@@ -95,7 +95,7 @@ define	IA64_PSR_RT		IA64_PSR_RT
 define	IA64_PSR_BN		IA64_PSR_BN
 define	IA64_PBVM_BASE		IA64_PBVM_BASE
 define	IA64_PBVM_PGTBL		IA64_PBVM_PGTBL
-define  IA64_DCR_DEFAULT	IA64_DCR_DEFAULT
+define	IA64_DCR_DEFAULT	IA64_DCR_DEFAULT
 
 define	PTE_PRESENT		PTE_PRESENT
 define	PTE_ACCESSED		PTE_ACCESSED
@@ -112,17 +112,20 @@ define	EFAULT			EFAULT
 # Important offsets into the lwp and proc structs & associated constants
 define	L_PCB			offsetof(struct lwp, l_addr)
 
-define  SIZEOF_PCB		sizeof(struct pcb)
-define  SIZEOF_TRAPFRAME	sizeof(struct trapframe)
+define	SIZEOF_PCB		sizeof(struct pcb)
+define	SIZEOF_TRAPFRAME	sizeof(struct trapframe)
 define	SIZEOF_SPECIAL		sizeof(struct _special)
 
+define	MC_SPECIAL		offsetof(struct __mcontext, mc_special)
+define	UC_MCONTEXT		offsetof(struct __ucontext, uc_mcontext)
+
 # general constants 
 define	VM_MAX_ADDRESS		VM_MAX_ADDRESS
 
 # Important offsets into the user struct & associated constants
 define	UPAGES			UPAGES
 
-define 	FRAME_SYSCALL		FRAME_SYSCALL
+define	FRAME_SYSCALL		FRAME_SYSCALL
 
 define	PC_CURLWP		offsetof(struct cpu_info, ci_curlwp) 
 define	PCB_ONFAULT		offsetof(struct pcb, pcb_onfault) 



CVS commit: src/sys/arch/ia64

2019-05-02 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu May  2 16:55:51 UTC 2019

Modified Files:
src/sys/arch/ia64/ia64: genassym.cf support.S
src/sys/arch/ia64/include: setjmp.h

Log Message:
Remove some unused assembly and other variables to reduce compile warnings


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/ia64/ia64/genassym.cf
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/ia64/ia64/support.S
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/include/setjmp.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/ia64/ia64/genassym.cf
diff -u src/sys/arch/ia64/ia64/genassym.cf:1.14 src/sys/arch/ia64/ia64/genassym.cf:1.15
--- src/sys/arch/ia64/ia64/genassym.cf:1.14	Tue Nov 20 20:36:24 2018
+++ src/sys/arch/ia64/ia64/genassym.cf	Thu May  2 16:55:50 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.14 2018/11/20 20:36:24 scole Exp $
+#	$NetBSD: genassym.cf,v 1.15 2019/05/02 16:55:50 scole Exp $
 
 #
 # Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -63,48 +63,22 @@
 #	@(#)genassym.c	5.11 (Berkeley) 5/10/91
 #
 
-if defined(_KERNEL_OPT)
-include "opt_compat_linux.h"
-include "opt_multiprocessor.h"
-endif
-
 include 
 include 
 include 
 include 
-include 
 include 
 include 
 
-include 
-include 
-include 
-include 
-include 
-
 include 
 
 include 
 include 
 include 
-include 
 include 
 include 
 include 
 
-ifdef COMPAT_LINUX
-include 
-include 
-endif
-
-ifdef COMPAT_IA32
-
-endif
-
-ifdef MULTIPROCESSOR
-include 
-endif
-
 define	PAGE_SIZE		PAGE_SIZE
 define	PAGE_SHIFT		PAGE_SHIFT
 define	KSTACK_PAGES		KSTACK_PAGES
@@ -112,7 +86,13 @@ define	KSTACK_PAGES		KSTACK_PAGES
 define	IA64_VM_MINKERN_REGION	IA64_VM_MINKERN_REGION
 define	IA64_PBVM_RR		IA64_PBVM_RR
 define  IA64_PBVM_PAGE_SHIFT	IA64_PBVM_PAGE_SHIFT
+define  IA64_PSR_I		IA64_PSR_I
+define	IA64_PSR_DT		IA64_PSR_DT
+define	IA64_PSR_DFL		IA64_PSR_DFL
 define	IA64_PSR_DFH		IA64_PSR_DFH
+define	IA64_PSR_IT		IA64_PSR_IT
+define	IA64_PSR_RT		IA64_PSR_RT
+define	IA64_PSR_BN		IA64_PSR_BN
 define	IA64_PBVM_BASE		IA64_PBVM_BASE
 define	IA64_PBVM_PGTBL		IA64_PBVM_PGTBL
 define  IA64_DCR_DEFAULT	IA64_DCR_DEFAULT
@@ -125,61 +105,23 @@ define	PTE_AR_RWX		PTE_AR_RWX
 define	PTE_MA_WB		PTE_MA_WB
 define	PTE_MA_UC		PTE_MA_UC
 
-define	DT_NULL			DT_NULL
-define	DT_RELA			DT_RELA
-define	DT_RELAENT		DT_RELAENT
-define	DT_RELASZ		DT_RELASZ
-define	DT_SYMTAB		DT_SYMTAB
-define	DT_SYMENT		DT_SYMENT
-
-
-define	LSRUN			LSRUN
-define	LSONPROC		LSONPROC
-
 # errno values
 define	ENAMETOOLONG		ENAMETOOLONG
 define	EFAULT			EFAULT
 
 # Important offsets into the lwp and proc structs & associated constants
 define	L_PCB			offsetof(struct lwp, l_addr)
-define	L_PRIORITY		offsetof(struct lwp, l_priority)
-define	L_STAT			offsetof(struct lwp, l_stat)
-define	L_WCHAN			offsetof(struct lwp, l_wchan)
-define	L_PROC			offsetof(struct lwp, l_proc)
-define	L_CPU			offsetof(struct lwp, l_cpu)
-define	P_FLAG			offsetof(struct proc, p_flag)
-define	P_RASLIST		offsetof(struct proc, p_raslist)
-
-define	PK_SYSTEM		PK_SYSTEM
-
-define	M_DATA			offsetof(struct mbuf, m_data)
-define	M_LEN			offsetof(struct mbuf, m_len)
-define	M_NEXT			offsetof(struct mbuf, m_next)
-
-define	IP_SRC			offsetof(struct ip, ip_src)
-define	IP_DST			offsetof(struct ip, ip_dst)
-
-define	IP6_SRC			offsetof(struct ip6_hdr, ip6_src)
-define	IP6_DST			offsetof(struct ip6_hdr, ip6_dst)
-
-define	CI_NTRAP		offsetof(struct cpu_info, ci_data.cpu_ntrap)
-define	CI_NINTR		offsetof(struct cpu_info, ci_data.cpu_nintr)
 
 define  SIZEOF_PCB		sizeof(struct pcb)
 define  SIZEOF_TRAPFRAME	sizeof(struct trapframe)
 define	SIZEOF_SPECIAL		sizeof(struct _special)
 
-define	MC_SPECIAL		offsetof(struct __mcontext, mc_special)
-define	UC_MCONTEXT		offsetof(struct __ucontext, uc_mcontext)
-
 # general constants 
 define	VM_MAX_ADDRESS		VM_MAX_ADDRESS
 
 # Important offsets into the user struct & associated constants
 define	UPAGES			UPAGES
 
-#XXX: 
-
 define 	FRAME_SYSCALL		FRAME_SYSCALL
 
 define	PC_CURLWP		offsetof(struct cpu_info, ci_curlwp) 

Index: src/sys/arch/ia64/ia64/support.S
diff -u src/sys/arch/ia64/ia64/support.S:1.8 src/sys/arch/ia64/ia64/support.S:1.9
--- src/sys/arch/ia64/ia64/support.S:1.8	Sat Apr  6 03:06:25 2019
+++ src/sys/arch/ia64/ia64/support.S	Thu May  2 16:55:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: support.S,v 1.8 2019/04/06 03:06:25 thorpej Exp $	*/
+/*	$NetBSD: support.S,v 1.9 2019/05/02 16:55:50 scole Exp $	*/
 
 /*-
  * Copyright (c) 1998 Doug Rabson
@@ -56,7 +56,6 @@
  */
 
 #include 
-#include 
 
 #include "assym.h"
 

Index: src/sys/arch/ia64/include/setjmp.h
diff -u src/sys/arch/ia64/include/setjmp.h:1.2 src/sys/arch/ia64/include/setjmp.h:1.3
--- src/sys/arch/ia64/include/setjmp.h:1.2	Sun Sep 10 21:16:56 2006
+++ src/sys/arch/ia64/include/setjmp.h	Thu May  2 16:55:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: setjmp.h,v 1.2 2006/09/10 21:16:56 cherry Exp $	*/
+/*	$NetBSD: 

CVS commit: src/sys/arch/ia64

2019-04-29 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Mon Apr 29 16:39:58 UTC 2019

Modified Files:
src/sys/arch/ia64/acpi: madt.c
src/sys/arch/ia64/ia64: mainbus.c

Log Message:
Rename ACPI_NAME_SIZE -> ACPI_NAMESEG_SIZE with acpica update, see
src/sys/external/bsd/acpica/dist/changes.txt


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/acpi/madt.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/ia64/ia64/mainbus.c

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/ia64/acpi/madt.c
diff -u src/sys/arch/ia64/acpi/madt.c:1.3 src/sys/arch/ia64/acpi/madt.c:1.4
--- src/sys/arch/ia64/acpi/madt.c:1.3	Sun Apr  7 07:37:51 2013
+++ src/sys/arch/ia64/acpi/madt.c	Mon Apr 29 16:39:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: madt.c,v 1.3 2013/04/07 07:37:51 kiyohara Exp $	*/
+/*	$NetBSD: madt.c,v 1.4 2019/04/29 16:39:58 scole Exp $	*/
 /*-
  * Copyright (c) 2001 Doug Rabson
  * All rights reserved.
@@ -148,7 +148,7 @@ ia64_probe_sapics(void)
 			table->Header.Signature[3], table);
 
 		if (strncmp(table->Header.Signature, ACPI_SIG_MADT,
-		ACPI_NAME_SIZE) != 0 ||
+		ACPI_NAMESEG_SIZE) != 0 ||
 		ACPI_FAILURE(AcpiTbChecksum((void *)table,
 		table->Header.Length)))
 			continue;
@@ -242,7 +242,7 @@ ia64_count_cpus(void)
 		IA64_PHYS_TO_RR7(xsdt->TableOffsetEntry[t]);
 
 		if (strncmp(table->Header.Signature, ACPI_SIG_MADT,
-		ACPI_NAME_SIZE) != 0 ||
+		ACPI_NAMESEG_SIZE) != 0 ||
 		ACPI_FAILURE(AcpiTbChecksum((void *)table,
 			table->Header.Length)))
 			continue;

Index: src/sys/arch/ia64/ia64/mainbus.c
diff -u src/sys/arch/ia64/ia64/mainbus.c:1.10 src/sys/arch/ia64/ia64/mainbus.c:1.11
--- src/sys/arch/ia64/ia64/mainbus.c:1.10	Tue Jun 21 11:33:33 2016
+++ src/sys/arch/ia64/ia64/mainbus.c	Mon Apr 29 16:39:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.10 2016/06/21 11:33:33 nonaka Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.11 2019/04/29 16:39:58 scole Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.10 2016/06/21 11:33:33 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.11 2019/04/29 16:39:58 scole Exp $");
 
 #include "acpica.h"
 
@@ -95,7 +95,7 @@ mainbus_attach(device_t parent, device_t
 		IA64_PHYS_TO_RR7(xsdt->TableOffsetEntry[i]);
 
 		sig = table->Header.Signature;
-		if (strncmp(sig, ACPI_SIG_MADT, ACPI_NAME_SIZE) != 0)
+		if (strncmp(sig, ACPI_SIG_MADT, ACPI_NAMESEG_SIZE) != 0)
 			continue;
 		len = table->Header.Length;
 		if (ACPI_FAILURE(AcpiTbChecksum((void *)table, len)))



CVS commit: src/sys/arch/ia64/ia64

2019-04-19 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Fri Apr 19 16:28:32 UTC 2019

Modified Files:
src/sys/arch/ia64/ia64: machdep.c

Log Message:
In map_vhpt(), read pmap_vhpt_log2size before any memory translation
instructions to avoid "Data Nested TLB faults" with GCC 7.4.0


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/ia64/ia64/machdep.c

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/ia64/ia64/machdep.c
diff -u src/sys/arch/ia64/ia64/machdep.c:1.42 src/sys/arch/ia64/ia64/machdep.c:1.43
--- src/sys/arch/ia64/ia64/machdep.c:1.42	Sat Apr  6 03:06:25 2019
+++ src/sys/arch/ia64/ia64/machdep.c	Fri Apr 19 16:28:32 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.42 2019/04/06 03:06:25 thorpej Exp $	*/
+/*	$NetBSD: machdep.c,v 1.43 2019/04/19 16:28:32 scole Exp $	*/
 
 /*-
  * Copyright (c) 2003,2004 Marcel Moolenaar
@@ -267,18 +267,24 @@ map_vhpt(uintptr_t vhpt)
 pt_entry_t pte;
 uint64_t psr;
 
+	/*
+	 * XXX read pmap_vhpt_log2size before any memory translation
+	 * instructions to avoid "Data Nested TLB faults".  Not
+	 * exactly sure why this is needed with GCC 7.4
+	 */
+	register uint64_t log2size = pmap_vhpt_log2size << 2;
+	
 pte = PTE_PRESENT | PTE_MA_WB | PTE_ACCESSED | PTE_DIRTY |
 		PTE_PL_KERN | PTE_AR_RW;
 pte |= vhpt & PTE_PPN_MASK;
 
-__asm __volatile("ptr.d %0,%1" :: "r"(vhpt),
-			 "r"(pmap_vhpt_log2size << 2));
+__asm __volatile("ptr.d %0,%1" :: "r"(vhpt), "r"(log2size));
 
 __asm __volatile("mov   %0=psr" : "=r"(psr));
 __asm __volatile("rsm   psr.ic|psr.i");
 ia64_srlz_i();
 ia64_set_ifa(vhpt);
-ia64_set_itir(pmap_vhpt_log2size << 2);
+	ia64_set_itir(log2size);
 ia64_srlz_d();
 __asm __volatile("itr.d dtr[%0]=%1" :: "r"(3), "r"(pte));
 __asm __volatile("mov   psr.l=%0" :: "r" (psr));



CVS commit: src/sys/arch/ia64

2019-04-03 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Wed Apr  3 21:03:06 UTC 2019

Modified Files:
src/sys/arch/ia64: TODO

Log Message:
add note about pmap.c compilation warnings


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/ia64/TODO

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/ia64/TODO
diff -u src/sys/arch/ia64/TODO:1.4 src/sys/arch/ia64/TODO:1.5
--- src/sys/arch/ia64/TODO:1.4	Wed Jan 30 22:53:22 2019
+++ src/sys/arch/ia64/TODO	Wed Apr  3 21:03:06 2019
@@ -15,6 +15,10 @@ What works:
 
 Tasks remaining, first couple seem most important:
 
+- pmap.c is getting compilation warnings (for gcc6 & gcc7) like
+  /var/tmp//cckQKcKn.s:7614: Warning: Use of 'st8' may violate RAW dependency 'RR#' (data)
+  ...
+  how to change compile flags for specific kernel file like "CFLAGS.pmap.c+= -O0" ?
 - context switching and forking appear unfinished,
   vm_machdep.c::cpu_lwp_fork() appears incomplete
 - pmap module, imported from freebsd but still needs more work and



CVS commit: src/doc

2019-04-03 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Wed Apr  3 20:34:18 UTC 2019

Modified Files:
src/doc: HACKS

Log Message:
Remove obsoleted ia64 gcc 4.5.3 hacks


To generate a diff of this commit:
cvs rdiff -u -r1.187 -r1.188 src/doc/HACKS

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

Modified files:

Index: src/doc/HACKS
diff -u src/doc/HACKS:1.187 src/doc/HACKS:1.188
--- src/doc/HACKS:1.187	Sun Apr  9 19:02:23 2017
+++ src/doc/HACKS	Wed Apr  3 20:34:18 2019
@@ -1,4 +1,4 @@
-# $NetBSD: HACKS,v 1.187 2017/04/09 19:02:23 scole Exp $
+# $NetBSD: HACKS,v 1.188 2019/04/03 20:34:18 scole Exp $
 #
 # This file is intended to document workarounds for currently unsolved
 # (mostly) compiler bugs.
@@ -811,42 +811,6 @@ port	emips
 
 port	ia64
 
-	hack	libc hesiod.c file does not compile with -O2 (internal
-		compiler error in gcc 4.5.3)
-	cdate	Thu Dec 27 08:05:43 CET 2012
-	who	martin
-	file	src/lib/libc/net/Makefile.inc: 1.82
-	descr
-		workaround for:
-		{standard input}: Assembler messages:
-		{standard input}:1507: Warning: Use of 'mov' may violate WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 15
-		{standard input}:1506: Warning: This is the location of the conflicting usage
-		{standard input}: Error: 2 warnings, treating warnings as errors
-	kcah
-
-	hack	libelf libelf_extended.c compiler error in gcc 4.5.3
-	cdate	Thu Dec 27 09:05:51 CET 2012
-	who	martin
-	file	src/external/bsd/libelf/lib/Makefile: 1.3
-	descr
-		workaround for:
-		{standard input}: Assembler messages:
-		{standard input}:87: Warning: Use of 'adds' may violate RAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 33
-		{standard input}:87: Warning: Only the first path encountering the conflict is reported
-		{standard input}:85: Warning: This is the location of the conflicting usage
-	kcah
-
-	hack	compiler error with gcc 4.5.x
-	cdate	Thu Dec 27 15:15:25 CET 2012
-	who	martin
-	file	src/crypto/external/bsd/netpgp/lib/verify/Makefile: 1.5
-	descr
-		workaround for:
-		{standard input}: Assembler messages:
-		{standard input}:22979: Warning: Use of 'mov' may violate WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 8
-		{standard input}:22978: Warning: This is the location of the conflicting usage
-	kcah
-
 	hack	libgcc unwind dummy function
 	cdate	Fri Apr 17 14:31:03 CEST 2015
 	who	martin



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

2019-03-29 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Fri Mar 29 16:04:54 UTC 2019

Modified Files:
src/sys/arch/ia64/include: vmparam.h

Log Message:
Remove SGROWSIZ parameter which looks like it was imported from FreeBSD and not 
use with NetBSD


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/ia64/include/vmparam.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/ia64/include/vmparam.h
diff -u src/sys/arch/ia64/include/vmparam.h:1.10 src/sys/arch/ia64/include/vmparam.h:1.11
--- src/sys/arch/ia64/include/vmparam.h:1.10	Sat Apr  8 18:05:36 2017
+++ src/sys/arch/ia64/include/vmparam.h	Fri Mar 29 16:04:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.10 2017/04/08 18:05:36 scole Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.11 2019/03/29 16:04:54 scole Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -57,9 +57,6 @@
 #ifndef	MAXSSIZ
 #define	MAXSSIZ		(1<<28)			/* max stack size (256M) */
 #endif
-#ifndef SGROWSIZ
-#define SGROWSIZ	(128UL*1024)		/* amount to grow stack */
-#endif
 
 #define	IA64_VM_MINKERN_REGION	4
 



CVS commit: src/tests/lib/libc/sys

2019-02-09 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Feb  9 23:03:01 UTC 2019

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
use HAVE_FPREGS not HAVE_FPGPREGS and move some register_t inside proper 
#define.  fixes ia64 build. ok 


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/tests/lib/libc/sys/t_ptrace_wait.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.75 src/tests/lib/libc/sys/t_ptrace_wait.c:1.76
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.75	Fri Feb  8 03:08:00 2019
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Sat Feb  9 23:03:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.75 2019/02/08 03:08:00 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.76 2019/02/09 23:03:01 scole Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.75 2019/02/08 03:08:00 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.76 2019/02/09 23:03:01 scole Exp $");
 
 #include 
 #include 
@@ -2613,7 +2613,7 @@ BYTES_TRANSFER(bytes_transfer_piod_read_
 
 /// 
 
-#if defined(HAVE_GPREGS) || defined(HAVE_FPGPREGS)
+#if defined(HAVE_GPREGS) || defined(HAVE_FPREGS)
 static void
 access_regs(const char *regset, const char *aux)
 {
@@ -2625,12 +2625,12 @@ access_regs(const char *regset, const ch
 #endif
 #if defined(HAVE_GPREGS)
 	struct reg gpr;
+	register_t rgstr;
 #endif
 #if defined(HAVE_FPREGS)
 	struct fpreg fpr;
 #endif
-	register_t rgstr;
-
+	
 #if !defined(HAVE_GPREGS)
 	if (strcmp(regset, "regs") == 0)
 		atf_tc_fail("Impossible test scenario!");



CVS commit: src/sys/arch/ia64

2019-01-30 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Wed Jan 30 22:53:22 UTC 2019

Modified Files:
src/sys/arch/ia64: TODO

Log Message:
RUMP building on ia64 now


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/TODO

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/ia64/TODO
diff -u src/sys/arch/ia64/TODO:1.3 src/sys/arch/ia64/TODO:1.4
--- src/sys/arch/ia64/TODO:1.3	Tue Jan 29 19:44:03 2019
+++ src/sys/arch/ia64/TODO	Wed Jan 30 22:53:22 2019
@@ -61,7 +61,6 @@ Tasks remaining, first couple seem most 
 - write console and/or X framebuffer driver.  freebsd has vgapci
   device that may be portable
 - add ia32 emulation, port from freebsd
-- add rump stuff/MKRUMP
 - create install EFI/cdrom/netbsd
 - fix ski to run on other archs beside i386, or at least amd64
 



CVS commit: src/share/mk

2019-01-30 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Wed Jan 30 22:51:33 UTC 2019

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
don't disable MKRUMP by default for ia64 as it can at least build now


To generate a diff of this commit:
cvs rdiff -u -r1.1096 -r1.1097 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1096 src/share/mk/bsd.own.mk:1.1097
--- src/share/mk/bsd.own.mk:1.1096	Tue Jan 29 19:40:42 2019
+++ src/share/mk/bsd.own.mk	Wed Jan 30 22:51:33 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1096 2019/01/29 19:40:42 scole Exp $
+#	$NetBSD: bsd.own.mk,v 1.1097 2019/01/30 22:51:33 scole Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -1105,11 +1105,6 @@ USE_LIBCSANITIZER?=	undefined
 # Exceptions to the above:
 #
 
-# Rump doesn't work yet on ia64
-.if ${MACHINE} == "ia64"
-MKRUMP=		no
-.endif
-
 # RUMP uses -nostdinc which coverity does not like
 # It also does not use many new files, so disable it
 .if defined(COVERITY_TOP_CONFIG)



CVS commit: src/sys/arch/ia64

2019-01-29 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Tue Jan 29 19:44:03 UTC 2019

Modified Files:
src/sys/arch/ia64: TODO

Log Message:
add more items


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/TODO

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/ia64/TODO
diff -u src/sys/arch/ia64/TODO:1.2 src/sys/arch/ia64/TODO:1.3
--- src/sys/arch/ia64/TODO:1.2	Wed Nov 14 20:13:14 2018
+++ src/sys/arch/ia64/TODO	Tue Jan 29 19:44:03 2019
@@ -32,14 +32,14 @@ Tasks remaining, first couple seem most 
 - implement ld.elf_so, MK_DYNAMICROOT
 - fix memory detection, on real hardware doesn't find all memory
 - implement interrupts (sacpi & pci), can be mostly from freebsd?
-- MKLINT and MKGDB for ia64?
+- MKGDB for ia64
 - implement fp[gs]etsticky, [make|get|set|swap]context
 - floating point, fenv functions were imported from freebsd, but haven't been tested
 - implement core_machdep.c
 - implement __cloneS ptrace.S sbrk.S shmat.S
 - implement kvm_ia64.c
 - implement pmc (performance monitoring counters) for ia64 pmc registers
-- cpuctl
+- implement ia64 md code for cpuctl, intrctl as needed
 - optional(?) mutex.h/lock_stubs.S, mutex_enter()/mutex_exit() __HAVE_MUTEX_STUBS
mutex_spin_enter()/mutex_spin_exit() __HAVE_SPIN_MUTEX_STUBS
 - rwlock.h rw_enter(),rw_exit(),rw_tryenter() __HAVE_RW_STUBS, implemented already?
@@ -63,6 +63,7 @@ Tasks remaining, first couple seem most 
 - add ia32 emulation, port from freebsd
 - add rump stuff/MKRUMP
 - create install EFI/cdrom/netbsd
+- fix ski to run on other archs beside i386, or at least amd64
 
 Pie in the sky
 - Xen and itanium!



CVS commit: src/share/mk

2019-01-29 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Tue Jan 29 19:40:42 UTC 2019

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
remove "MKLINT.ia64=no" as default is no anyway, and should compile on 64 bit 
host now


To generate a diff of this commit:
cvs rdiff -u -r1.1095 -r1.1096 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1095 src/share/mk/bsd.own.mk:1.1096
--- src/share/mk/bsd.own.mk:1.1095	Sat Jan 19 12:58:37 2019
+++ src/share/mk/bsd.own.mk	Tue Jan 29 19:40:42 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1095 2019/01/19 12:58:37 mrg Exp $
+#	$NetBSD: bsd.own.mk,v 1.1096 2019/01/29 19:40:42 scole Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -811,7 +811,6 @@ NOPROFILE=	# defined
 #
 # The ia64 port is incomplete.
 #
-MKLINT.ia64=	no
 MKGDB.ia64=	no
 
 #



CVS commit: src/sys/arch/ia64/ia64

2019-01-18 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Fri Jan 18 18:47:16 UTC 2019

Modified Files:
src/sys/arch/ia64/ia64: machdep.c

Log Message:
Add DPRINTF function, use kstack variable for proc0 memory, reorder some 
functions so ci initialized before use


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/ia64/ia64/machdep.c

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/ia64/ia64/machdep.c
diff -u src/sys/arch/ia64/ia64/machdep.c:1.40 src/sys/arch/ia64/ia64/machdep.c:1.41
--- src/sys/arch/ia64/ia64/machdep.c:1.40	Thu Nov 15 20:39:18 2018
+++ src/sys/arch/ia64/ia64/machdep.c	Fri Jan 18 18:47:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.40 2018/11/15 20:39:18 scole Exp $	*/
+/*	$NetBSD: machdep.c,v 1.41 2019/01/18 18:47:16 scole Exp $	*/
 
 /*-
  * Copyright (c) 2003,2004 Marcel Moolenaar
@@ -119,6 +119,12 @@
 #include 
 #include 
 
+#ifdef DEBUG
+#define	DPRINTF(fmt, args...)	printf("%s: " fmt, __func__, ##args)
+#else
+#define	DPRINTF(fmt, args...)	((void)0)
+#endif
+ 
 /* the following is used externally (sysctl_hw) */
 char	machine[] = MACHINE;		/* from  */
 char	machine_arch[] = MACHINE_ARCH;	/* from  */
@@ -387,12 +393,6 @@ ia64_init(void)
 	vaddr_t v;
 
 	/* NO OUTPUT ALLOWED UNTIL FURTHER NOTICE */
-
-	/*
-	 * TODO: Disable interrupts, floating point etc.
-	 * Maybe flush cache and tlb
-	 */
-
 	ia64_set_fpsr(IA64_FPSR_DEFAULT);
 
 	/*
@@ -514,10 +514,8 @@ ia64_init(void)
 
 	for (md = efi_md_first(); md != NULL; md = efi_md_next(md)) {
 
-#ifdef DEBUG
-		printf("MD %p: type %d pa 0x%lx cnt 0x%lx\n", md,
-		md->md_type, md->md_phys, md->md_pages);
-#endif
+		DPRINTF("MD %p: type %d pa 0x%lx cnt 0x%lx\n", md,
+			md->md_type, md->md_phys, md->md_pages);
 
 		pfn0 = ia64_btop(round_page(md->md_phys));
 		pfn1 = ia64_btop(trunc_page(md->md_phys + md->md_pages * 4096));
@@ -553,17 +551,15 @@ ia64_init(void)
 			 * Must compute the location of the kernel
 			 * within the segment.
 			 */
-#ifdef DEBUG
-			printf("Descriptor %p contains kernel\n", md);
-#endif
+			DPRINTF("Descriptor %p contains kernel\n", md);
+
 			if (pfn0 < kernstartpfn) {
 /*
  * There is a chunk before the kernel.
  */
-#ifdef DEBUG
-printf("Loading chunk before kernel: "
-   "0x%lx / 0x%lx\n", pfn0, kernstartpfn);
-#endif
+DPRINTF("Loading chunk before kernel: "
+	"0x%lx / 0x%lx\n", pfn0, kernstartpfn);
+
 uvm_page_physload(pfn0, kernstartpfn,
 pfn0, kernstartpfn, VM_FREELIST_DEFAULT);
 
@@ -572,10 +568,8 @@ ia64_init(void)
 /*
  * There is a chunk after the kernel.
  */
-#ifdef DEBUG
-printf("Loading chunk after kernel: "
-   "0x%lx / 0x%lx\n", kernendpfn, pfn1);
-#endif
+DPRINTF("Loading chunk after kernel: "
+	"0x%lx / 0x%lx\n", kernendpfn, pfn1);
 
 uvm_page_physload(kernendpfn, pfn1,
 kernendpfn, pfn1, VM_FREELIST_DEFAULT);
@@ -585,10 +579,8 @@ ia64_init(void)
 			/*
 			 * Just load this cluster as one chunk.
 			 */
-#ifdef DEBUG
-			printf("Loading descriptor %p: 0x%lx / 0x%lx\n",
-			md, pfn0, pfn1);
-#endif
+			DPRINTF("Loading descriptor %p: 0x%lx / 0x%lx\n",
+md, pfn0, pfn1);
 
 			uvm_page_physload(pfn0, pfn1, pfn0, pfn1,
 			VM_FREELIST_DEFAULT);
@@ -600,21 +592,16 @@ ia64_init(void)
 		panic("can't happen: system seems to have no memory!");
 
 	/*
-	 * Initialize the virtual memory system.
-	 */
-
-	pmap_bootstrap();
-
-	/*
 	 * Initialize error message buffer (at end of core).
 	 */
 	msgbufaddr = (void *) uvm_pageboot_alloc(MSGBUFSIZE);
 	initmsgbuf(msgbufaddr, MSGBUFSIZE);
 
 	/*
-	 * Init mapping for u page(s) for proc 0
+	 * Init mapping for u page(s) for proc 0.  use memory area
+	 * already set up in locore.S
 	 */
-	v = uvm_pageboot_alloc(UPAGES * PAGE_SIZE);
+	v = (vaddr_t)
 	uvm_lwp_setuarea(, v);
 
 	/*
@@ -622,6 +609,8 @@ ia64_init(void)
 	 * and make lwp0's trapframe pointer point to it for sanity.
 	 */
 	lwp0.l_md.md_tf = (struct trapframe *)(v + UAREA_TF_OFFSET);
+	lwp0.l_md.md_tf->tf_length = sizeof(struct trapframe);
+	lwp0.l_md.md_tf->tf_flags = FRAME_SYSCALL;
 
 	lwp0.l_md.user_stack = NULL;
 	lwp0.l_md.user_stack_size = 0;
@@ -630,8 +619,6 @@ ia64_init(void)
 	pcb0->pcb_special.sp = v + UAREA_SP_OFFSET;
 	pcb0->pcb_special.bspstore = v + UAREA_BSPSTORE_OFFSET;
 	
-	mutex_init(>pcb_fpcpu_slock, MUTEX_DEFAULT, 0);
-
 	/*
 	 * Setup global data for the bootstrap cpu.
 	 */
@@ -643,9 +630,8 @@ ia64_init(void)
 	ia64_set_k4((uint64_t) ci);
 	ci->ci_cpuid = cpu_number();
 
-
 	/*
-	 * Initialise process context. XXX: This should really be in cpu_switch
+	 * Initialise process context. XXX: This should really be in cpu_switchto
 	 */
 	ci->ci_curlwp = 
 
@@ -662,6 +648,8 @@ ia64_init(void)
 	ia64_set_tpr(0);
 	ia64_srlz_d();
 
+	mutex_init(>pcb_fpcpu_slock, MUTEX_DEFAULT, 0);
+
 	/*
 	 * Save our current context so that we have a known (maybe 

CVS commit: src/sys/arch/ia64/ia64

2019-01-18 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Fri Jan 18 18:03:06 UTC 2019

Modified Files:
src/sys/arch/ia64/ia64: vm_machdep.c

Log Message:
hopefully fix deadlock issue in cpu_switchto.  pointed out by  (Thanks!)


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/ia64/ia64/vm_machdep.c

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/ia64/ia64/vm_machdep.c
diff -u src/sys/arch/ia64/ia64/vm_machdep.c:1.15 src/sys/arch/ia64/ia64/vm_machdep.c:1.16
--- src/sys/arch/ia64/ia64/vm_machdep.c:1.15	Wed Nov 14 21:10:59 2018
+++ src/sys/arch/ia64/ia64/vm_machdep.c	Fri Jan 18 18:03:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.15 2018/11/14 21:10:59 scole Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.16 2019/01/18 18:03:06 scole Exp $	*/
 
 /*
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -91,8 +91,9 @@ cpu_switchto(lwp_t *oldlwp, lwp_t *newlw
 		KASSERT(oldlwp == l);
 		swapctx(oldpcb, newpcb);
 	}
-	
-	return (oldlwp);
+
+	/* return oldlwp for the original thread that called cpu_switchto */
+	return ((lwp_t *)reg9);
 }
 
 /*
@@ -189,13 +190,12 @@ cpu_lwp_fork(struct lwp *l1, struct lwp 
 		tf->tf_scratch.gr10 = 0;
 	}
 
-	tf->tf_scratch.gr2 = (unsigned long)FDESC_FUNC(func);
-	tf->tf_scratch.gr3 = (unsigned long)arg;
-
-	pcb2->pcb_special.sp = ua2 + UAREA_SP_OFFSET;
-	pcb2->pcb_special.rp = (unsigned long)FDESC_FUNC(lwp_trampoline);
 	pcb2->pcb_special.bspstore = ua2 + UAREA_BSPSTORE_OFFSET + ndirty;
 	pcb2->pcb_special.pfs = 0;
+	pcb2->pcb_special.sp = ua2 + UAREA_SP_OFFSET;
+	pcb2->pcb_special.rp = (unsigned long)FDESC_FUNC(lwp_trampoline);
+	tf->tf_scratch.gr2 = (unsigned long)FDESC_FUNC(func);
+	tf->tf_scratch.gr3 = (unsigned long)arg;
 
 	return;
 }



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

2019-01-10 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu Jan 10 17:05:56 UTC 2019

Modified Files:
src/sys/arch/ia64/include: cpu.h lock.h

Log Message:
consolidate hint@pause in one place. remove mf.a from memory barriers


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/ia64/include/cpu.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/ia64/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/ia64/include/cpu.h
diff -u src/sys/arch/ia64/include/cpu.h:1.16 src/sys/arch/ia64/include/cpu.h:1.17
--- src/sys/arch/ia64/include/cpu.h:1.16	Sat Apr  8 18:01:22 2017
+++ src/sys/arch/ia64/include/cpu.h	Thu Jan 10 17:05:56 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.16 2017/04/08 18:01:22 scole Exp $	*/
+/*	$NetBSD: cpu.h,v 1.17 2019/01/10 17:05:56 scole Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -78,6 +78,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 struct cpu_info {
@@ -178,12 +179,7 @@ int cpu_maxproc(void); /*XXX: Fill in ma
 
 #define DELAY(x)	 __nothing	/* XXX: FIXME */
 
-static inline void cpu_idle(void);
-static inline
-void cpu_idle(void)
-{
-	asm ("hint @pause" ::: "memory");
-}
+#define cpu_idle()	ia64_pause()
 
 #endif /* _KERNEL_ */
 #endif /* _IA64_CPU_H */

Index: src/sys/arch/ia64/include/lock.h
diff -u src/sys/arch/ia64/include/lock.h:1.6 src/sys/arch/ia64/include/lock.h:1.7
--- src/sys/arch/ia64/include/lock.h:1.6	Sun Sep 17 00:01:07 2017
+++ src/sys/arch/ia64/include/lock.h	Thu Jan 10 17:05:56 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock.h,v 1.6 2017/09/17 00:01:07 christos Exp $	*/
+/*	$NetBSD: lock.h,v 1.7 2019/01/10 17:05:56 scole Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@ __cpu_simple_lock_clear(__cpu_simple_loc
 #ifdef _KERNEL
 
 #define	SPINLOCK_SPIN_HOOK	/* nothing */
-#define	SPINLOCK_BACKOFF_HOOK	/* XXX(kochi): hint@pause */
+#define	SPINLOCK_BACKOFF_HOOK	/* XXX ia64_pause() */
 
 #endif
 
@@ -116,26 +116,28 @@ __cpu_simple_unlock(__cpu_simple_lock_t 
 	*lockp = __SIMPLELOCK_UNLOCKED;
 }
 
-/* XXX mf.a overkill for these? */
 static __inline void
 mb_read(void)
 {
-	__asm __volatile("mf.a	\n"
-			 "mf	\n" ::: "memory");
+	__asm __volatile("mf	\n" ::: "memory");
 }
 
 static __inline void
 mb_write(void)
 {
-	__asm __volatile("mf.a	\n"
-			 "mf	\n" ::: "memory");
+	__asm __volatile("mf	\n" ::: "memory");
 }
 
 static __inline void
 mb_memory(void)
 {
-	__asm __volatile("mf.a	\n"
-			 "mf	\n" ::: "memory");
+	__asm __volatile("mf	\n" ::: "memory");
+}
+
+static __inline void
+ia64_pause(void)
+{
+	__asm __volatile("hint @pause" ::: "memory");
 }
 
 #endif /* _IA64_LOCK_H_ */



CVS commit: src/sys/arch/ia64/ia64

2019-01-09 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Wed Jan  9 18:03:34 UTC 2019

Modified Files:
src/sys/arch/ia64/ia64: syscall_stubs.S

Log Message:
whitespace cleanup


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/ia64/ia64/syscall_stubs.S

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/ia64/ia64/syscall_stubs.S
diff -u src/sys/arch/ia64/ia64/syscall_stubs.S:1.4 src/sys/arch/ia64/ia64/syscall_stubs.S:1.5
--- src/sys/arch/ia64/ia64/syscall_stubs.S:1.4	Sat Apr  8 17:46:30 2017
+++ src/sys/arch/ia64/ia64/syscall_stubs.S	Wed Jan  9 18:03:34 2019
@@ -1,6 +1,6 @@
-/*	$NetBSD: syscall_stubs.S,v 1.4 2017/04/08 17:46:30 scole Exp $	*/
+/*	$NetBSD: syscall_stubs.S,v 1.5 2019/01/09 18:03:34 scole Exp $	*/
 
-	/*-
+/*-
  * Copyright (c) 2002, 2003 Marcel Moolenaar
  * All rights reserved.
  *



CVS commit: src/usr.sbin/sysinst/arch/macppc

2019-01-07 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Mon Jan  7 18:08:28 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/macppc: md.h msg.md.de msg.md.en msg.md.es
msg.md.fr msg.md.pl

Log Message:
Add GENERIC.MP and GENERIC_601 kernels to sysinst menu


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/arch/macppc/md.h
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/sysinst/arch/macppc/msg.md.de \
src/usr.sbin/sysinst/arch/macppc/msg.md.en \
src/usr.sbin/sysinst/arch/macppc/msg.md.es \
src/usr.sbin/sysinst/arch/macppc/msg.md.fr \
src/usr.sbin/sysinst/arch/macppc/msg.md.pl

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

Modified files:

Index: src/usr.sbin/sysinst/arch/macppc/md.h
diff -u src/usr.sbin/sysinst/arch/macppc/md.h:1.2 src/usr.sbin/sysinst/arch/macppc/md.h:1.3
--- src/usr.sbin/sysinst/arch/macppc/md.h:1.2	Sun Nov 18 10:34:46 2018
+++ src/usr.sbin/sysinst/arch/macppc/md.h	Mon Jan  7 18:08:28 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.2 2018/11/18 10:34:46 martin Exp $	*/
+/*	$NetBSD: md.h,v 1.3 2019/01/07 18:08:28 scole Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -62,6 +62,8 @@
  * or upgrade.
  */
 #define SET_KERNEL_1_NAME	"kern-GENERIC"
+#define SET_KERNEL_2_NAME	"kern-GENERIC.MP"
+#define SET_KERNEL_3_NAME	"kern-GENERIC_601"
 
 /*
  * Machine-specific command to write a new label to a disk.

Index: src/usr.sbin/sysinst/arch/macppc/msg.md.de
diff -u src/usr.sbin/sysinst/arch/macppc/msg.md.de:1.1 src/usr.sbin/sysinst/arch/macppc/msg.md.de:1.2
--- src/usr.sbin/sysinst/arch/macppc/msg.md.de:1.1	Sat Jul 26 19:30:46 2014
+++ src/usr.sbin/sysinst/arch/macppc/msg.md.de	Mon Jan  7 18:08:28 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.de,v 1.1 2014/07/26 19:30:46 dholland Exp $	*/
+/*	$NetBSD: msg.md.de,v 1.2 2019/01/07 18:08:28 scole Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -52,3 +52,8 @@ message dobootblks
 message set_kernel_1
 {Kernel (GENERIC)}
 
+message set_kernel_2
+{Kernel (GENERIC.MP)}
+
+message set_kernel_3
+{Kernel (GENERIC_601)}
Index: src/usr.sbin/sysinst/arch/macppc/msg.md.en
diff -u src/usr.sbin/sysinst/arch/macppc/msg.md.en:1.1 src/usr.sbin/sysinst/arch/macppc/msg.md.en:1.2
--- src/usr.sbin/sysinst/arch/macppc/msg.md.en:1.1	Sat Jul 26 19:30:46 2014
+++ src/usr.sbin/sysinst/arch/macppc/msg.md.en	Mon Jan  7 18:08:28 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.en,v 1.1 2014/07/26 19:30:46 dholland Exp $	*/
+/*	$NetBSD: msg.md.en,v 1.2 2019/01/07 18:08:28 scole Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -51,3 +51,8 @@ message dobootblks
 message set_kernel_1
 {Kernel (GENERIC)}
 
+message set_kernel_2
+{Kernel (GENERIC.MP)}
+
+message set_kernel_3
+{Kernel (GENERIC_601)}
Index: src/usr.sbin/sysinst/arch/macppc/msg.md.es
diff -u src/usr.sbin/sysinst/arch/macppc/msg.md.es:1.1 src/usr.sbin/sysinst/arch/macppc/msg.md.es:1.2
--- src/usr.sbin/sysinst/arch/macppc/msg.md.es:1.1	Sat Jul 26 19:30:46 2014
+++ src/usr.sbin/sysinst/arch/macppc/msg.md.es	Mon Jan  7 18:08:28 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.es,v 1.1 2014/07/26 19:30:46 dholland Exp $	*/
+/*	$NetBSD: msg.md.es,v 1.2 2019/01/07 18:08:28 scole Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -51,3 +51,8 @@ message dobootblks
 message set_kernel_1
 {Núcleo (GENERIC)}
 
+message set_kernel_2
+{Núcleo (GENERIC.MP)}
+
+message set_kernel_3
+{Núcleo (GENERIC_601)}
Index: src/usr.sbin/sysinst/arch/macppc/msg.md.fr
diff -u src/usr.sbin/sysinst/arch/macppc/msg.md.fr:1.1 src/usr.sbin/sysinst/arch/macppc/msg.md.fr:1.2
--- src/usr.sbin/sysinst/arch/macppc/msg.md.fr:1.1	Sat Jul 26 19:30:46 2014
+++ src/usr.sbin/sysinst/arch/macppc/msg.md.fr	Mon Jan  7 18:08:28 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.fr,v 1.1 2014/07/26 19:30:46 dholland Exp $	*/
+/*	$NetBSD: msg.md.fr,v 1.2 2019/01/07 18:08:28 scole Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -51,3 +51,8 @@ message dobootblks
 message set_kernel_1
 {Kernel (GENERIC)}
 
+message set_kernel_2
+{Kernel (GENERIC.MP)}
+
+message set_kernel_3
+{Kernel (GENERIC_601)}
Index: src/usr.sbin/sysinst/arch/macppc/msg.md.pl
diff -u src/usr.sbin/sysinst/arch/macppc/msg.md.pl:1.1 src/usr.sbin/sysinst/arch/macppc/msg.md.pl:1.2
--- src/usr.sbin/sysinst/arch/macppc/msg.md.pl:1.1	Sat Jul 26 19:30:46 2014
+++ src/usr.sbin/sysinst/arch/macppc/msg.md.pl	Mon Jan  7 18:08:28 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.pl,v 1.1 2014/07/26 19:30:46 dholland Exp $	*/
+/*	$NetBSD: msg.md.pl,v 1.2 2019/01/07 18:08:28 scole Exp $	*/
 /* Based on english version: */
 /*	NetBSD: msg.md.en,v 1.5 2000/12/03 01:54:48 minoura Exp */
 
@@ -53,3 +53,8 @@ message dobootblks
 message set_kernel_1
 {Kernel (GENERIC)}
 
+message set_kernel_2
+{Kernel (GENERIC.MP)}
+
+message set_kernel_3
+{Kernel (GENERIC_601)}



CVS commit: src/sys/arch/macppc/conf

2019-01-06 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Mon Jan  7 01:44:59 UTC 2019

Modified Files:
src/sys/arch/macppc/conf: GENERIC_601 GENERIC_MD INSTALL INSTALL_601

Log Message:
increase MEMORY_DISK_ROOT_SIZE slightly to avoid running out of space
when doing some sysinst options.

Add ahc and rtk options for my testing convenience.  The 601 kernels
are still small enough for netbooting.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/macppc/conf/GENERIC_601
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/macppc/conf/GENERIC_MD
cvs rdiff -u -r1.128 -r1.129 src/sys/arch/macppc/conf/INSTALL
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/macppc/conf/INSTALL_601

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/macppc/conf/GENERIC_601
diff -u src/sys/arch/macppc/conf/GENERIC_601:1.22 src/sys/arch/macppc/conf/GENERIC_601:1.23
--- src/sys/arch/macppc/conf/GENERIC_601:1.22	Mon Nov 12 20:03:42 2018
+++ src/sys/arch/macppc/conf/GENERIC_601	Mon Jan  7 01:44:59 2019
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC_601,v 1.22 2018/11/12 20:03:42 scole Exp $
+# $NetBSD: GENERIC_601,v 1.23 2019/01/07 01:44:59 scole Exp $
 #
 # GENERIC machine description file
 # 
@@ -28,7 +28,7 @@ include 	"arch/macppc/conf/std.macppc.60
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-ident 		"GENERIC-$Revision: 1.22 $"
+ident 		"GENERIC-$Revision: 1.23 $"
 
 maxusers	32
 
@@ -207,7 +207,7 @@ pchb*	at pci? dev ? function ?	# PCI-Hos
 ppb*	at pci? dev ? function ?	# PCI-PCI bridges
 
 # PCI SCSI controllers
-#ahc*	at pci? dev ? function ?	# Adaptec 294x, aic78x0 SCSI
+ahc*	at pci? dev ? function ?	# Adaptec 294x, aic78x0 SCSI
 
 # Display devices
 #
@@ -371,8 +371,8 @@ pseudo-device   drvctl
 
 #options PAX_MPROTECT=0			# PaX mprotect(2) restrictions
 
-#rlphy*	at mii? phy ?			# Realtek 8139/8201L PHYs
-#rtk*	at pci? dev ? function ?	# Realtek 8129/8139
+rlphy*	at mii? phy ?			# Realtek 8139/8201L PHYs
+rtk*	at pci? dev ? function ?	# Realtek 8129/8139
 
 #rgephy* at mii? phy ?			# Realtek 8169S/8110S internal PHYs
 #ral*	at pci? dev ? function ?	# Ralink Technology RT25x0 802.11a/b/g

Index: src/sys/arch/macppc/conf/GENERIC_MD
diff -u src/sys/arch/macppc/conf/GENERIC_MD:1.16 src/sys/arch/macppc/conf/GENERIC_MD:1.17
--- src/sys/arch/macppc/conf/GENERIC_MD:1.16	Sun Aug 10 17:58:51 2014
+++ src/sys/arch/macppc/conf/GENERIC_MD	Mon Jan  7 01:44:59 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: GENERIC_MD,v 1.16 2014/08/10 17:58:51 joerg Exp $
+#	$NetBSD: GENERIC_MD,v 1.17 2019/01/07 01:44:59 scole Exp $
 #
 # GENERIC_MD config file
 #
@@ -8,5 +8,5 @@ include "arch/macppc/conf/GENERIC"
 # Enable the hooks used for initializing the ram-disk.
 options 	MEMORY_DISK_HOOKS
 options 	MEMORY_DISK_IS_ROOT	# Force root on ram-disk
-options 	MEMORY_DISK_ROOT_SIZE=5120	# 2560 KiB
+options 	MEMORY_DISK_ROOT_SIZE=5760	# 2880 KiB
 options 	MEMORY_DISK_RBFLAGS=RB_SINGLE	# boot in single-user mode

Index: src/sys/arch/macppc/conf/INSTALL
diff -u src/sys/arch/macppc/conf/INSTALL:1.128 src/sys/arch/macppc/conf/INSTALL:1.129
--- src/sys/arch/macppc/conf/INSTALL:1.128	Fri Aug 31 18:11:20 2018
+++ src/sys/arch/macppc/conf/INSTALL	Mon Jan  7 01:44:59 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: INSTALL,v 1.128 2018/08/31 18:11:20 sevan Exp $
+#	$NetBSD: INSTALL,v 1.129 2019/01/07 01:44:59 scole Exp $
 #
 # config file for INSTALL FLOPPY
 #
@@ -17,7 +17,7 @@ options 	RTC_OFFSET=0	# hardware clock i
 options 	MEMORY_DISK_HOOKS
 options 	MEMORY_DISK_IS_ROOT	# Force root on ram-disk
 options 	MEMORY_DISK_SERVER=0	# no userspace memory disk support
-options 	MEMORY_DISK_ROOT_SIZE=5120	# 2560 KiB
+options 	MEMORY_DISK_ROOT_SIZE=5760	# 2880 KiB
 options 	MEMORY_DISK_RBFLAGS=RB_SINGLE	# boot in single-user mode
 
 options 	USERCONF	# userconf(4) support

Index: src/sys/arch/macppc/conf/INSTALL_601
diff -u src/sys/arch/macppc/conf/INSTALL_601:1.1 src/sys/arch/macppc/conf/INSTALL_601:1.2
--- src/sys/arch/macppc/conf/INSTALL_601:1.1	Mon Nov 12 20:07:47 2018
+++ src/sys/arch/macppc/conf/INSTALL_601	Mon Jan  7 01:44:59 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: INSTALL_601,v 1.1 2018/11/12 20:07:47 scole Exp $
+#	$NetBSD: INSTALL_601,v 1.2 2019/01/07 01:44:59 scole Exp $
 #
 # config file for INSTALL
 #
@@ -19,7 +19,7 @@ options 	RTC_OFFSET=0	# hardware clock i
 options 	MEMORY_DISK_HOOKS
 options 	MEMORY_DISK_IS_ROOT	# Force root on ram-disk
 options 	MEMORY_DISK_SERVER=0	# no userspace memory disk support
-options 	MEMORY_DISK_ROOT_SIZE=5120	# 2560 KiB
+options 	MEMORY_DISK_ROOT_SIZE=5760	# 2880 KiB
 options 	MEMORY_DISK_RBFLAGS=RB_SINGLE	# boot in single-user mode
 
 options 	USERCONF	# userconf(4) support
@@ -72,6 +72,9 @@ pci*	at ppb? bus ?
 pchb*	at pci? dev ? function ?	# PCI-Host bridges
 ppb*	at pci? dev ? function ?	# PCI-PCI bridges
 
+# PCI SCSI controllers
+ahc*	at pci? dev ? function ?	# Adaptec 294x, aic78x0 SCSI
+
 # Display devices
 #
 # The 7200's onboard 

CVS commit: src/distrib/macppc/floppies/ramdisk

2019-01-06 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Mon Jan  7 01:39:26 UTC 2019

Modified Files:
src/distrib/macppc/floppies/ramdisk: Makefile

Log Message:
increase IMAGESIZE slightly to avoid running out of space when doing some 
sysinst options


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/distrib/macppc/floppies/ramdisk/Makefile

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

Modified files:

Index: src/distrib/macppc/floppies/ramdisk/Makefile
diff -u src/distrib/macppc/floppies/ramdisk/Makefile:1.49 src/distrib/macppc/floppies/ramdisk/Makefile:1.50
--- src/distrib/macppc/floppies/ramdisk/Makefile:1.49	Mon Nov 12 20:11:39 2018
+++ src/distrib/macppc/floppies/ramdisk/Makefile	Mon Jan  7 01:39:26 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.49 2018/11/12 20:11:39 scole Exp $
+#	$NetBSD: Makefile,v 1.50 2019/01/07 01:39:26 scole Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -8,7 +8,7 @@ IMAGE=		ramdisk.fs
 #   src/sys/arch/macppc/conf/INSTALL
 #   src/sys/arch/macppc/conf/INSTALL_601
 #   src/sys/arch/macppc/conf/GENERIC_MD
-IMAGESIZE=	2560k
+IMAGESIZE=	2880k
 MAKEFS_FLAGS+=	-f 15
 
 WARNS=		1



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

2018-12-29 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Dec 29 20:06:49 UTC 2018

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

Log Message:
fix stack size calculation


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/ia64/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/ia64/include/proc.h
diff -u src/sys/arch/ia64/include/proc.h:1.9 src/sys/arch/ia64/include/proc.h:1.10
--- src/sys/arch/ia64/include/proc.h:1.9	Sun Dec  2 16:49:24 2018
+++ src/sys/arch/ia64/include/proc.h	Sat Dec 29 20:06:49 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.9 2018/12/02 16:49:24 scole Exp $	*/
+/*	$NetBSD: proc.h,v 1.10 2018/12/29 20:06:49 scole Exp $	*/
 
 #ifndef _IA64_PROC_H_
 #define _IA64_PROC_H_
@@ -41,8 +41,8 @@ struct mdproc {
 
 #define UAREA_PCB_OFFSET	(USPACE - sizeof(struct pcb))
 #define UAREA_TF_OFFSET		(UAREA_PCB_OFFSET - sizeof(struct trapframe))
-#define UAREA_SP_OFFSET		(UAREA_TF_OFFSET -16)
+#define UAREA_SP_OFFSET		(UAREA_TF_OFFSET - 16)
 #define UAREA_BSPSTORE_OFFSET	(0)
-#define UAREA_STACK_SIZE	(USPACE - UAREA_SP_OFFSET)
+#define UAREA_STACK_SIZE	(USPACE - 16 - sizeof(struct trapframe) - sizeof(struct pcb))
 
 #endif /* _IA64_PROC_H_ */



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

2018-12-02 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sun Dec  2 16:49:24 UTC 2018

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

Log Message:
fix SP offset


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/ia64/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/ia64/include/proc.h
diff -u src/sys/arch/ia64/include/proc.h:1.8 src/sys/arch/ia64/include/proc.h:1.9
--- src/sys/arch/ia64/include/proc.h:1.8	Thu Nov 15 20:06:23 2018
+++ src/sys/arch/ia64/include/proc.h	Sun Dec  2 16:49:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.8 2018/11/15 20:06:23 scole Exp $	*/
+/*	$NetBSD: proc.h,v 1.9 2018/12/02 16:49:24 scole Exp $	*/
 
 #ifndef _IA64_PROC_H_
 #define _IA64_PROC_H_
@@ -41,9 +41,8 @@ struct mdproc {
 
 #define UAREA_PCB_OFFSET	(USPACE - sizeof(struct pcb))
 #define UAREA_TF_OFFSET		(UAREA_PCB_OFFSET - sizeof(struct trapframe))
-#define UAREA_SP_OFFSET		(UAREA_TF_OFFSET -16 -sizeof(uint64_t))
+#define UAREA_SP_OFFSET		(UAREA_TF_OFFSET -16)
 #define UAREA_BSPSTORE_OFFSET	(0)
-#define UAREA_STACK_SIZE	(USPACE - 16 - sizeof(struct trapframe) - \
- sizeof(struct pcb))
+#define UAREA_STACK_SIZE	(USPACE - UAREA_SP_OFFSET)
 
 #endif /* _IA64_PROC_H_ */



CVS commit: src/sys/arch/powerpc/oea

2018-11-21 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Wed Nov 21 17:54:43 UTC 2018

Modified Files:
src/sys/arch/powerpc/oea: ofw_autoconf.c

Log Message:
don't bother reading ofw properties for platinumfb


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/powerpc/oea/ofw_autoconf.c

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/powerpc/oea/ofw_autoconf.c
diff -u src/sys/arch/powerpc/oea/ofw_autoconf.c:1.22 src/sys/arch/powerpc/oea/ofw_autoconf.c:1.23
--- src/sys/arch/powerpc/oea/ofw_autoconf.c:1.22	Fri Aug 17 15:54:35 2018
+++ src/sys/arch/powerpc/oea/ofw_autoconf.c	Wed Nov 21 17:54:42 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ofw_autoconf.c,v 1.22 2018/08/17 15:54:35 macallan Exp $ */
+/* $NetBSD: ofw_autoconf.c,v 1.23 2018/11/21 17:54:42 scole Exp $ */
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
  * Copyright (C) 1995, 1996 TooLs GmbH.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ofw_autoconf.c,v 1.22 2018/08/17 15:54:35 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_autoconf.c,v 1.23 2018/11/21 17:54:42 scole Exp $");
 
 #ifdef ofppc
 #include "gtpci.h"
@@ -244,6 +244,11 @@ device_register(device_t dev, void *aux)
 		copy_disp_props(dev, ca->ca_node, dict);
 	}
 
+	/* cannot read useful display properties for platinum */
+	if (device_is_a(dev, "platinumfb")) {
+		return;
+	}
+
 #if NGTPCI > 0
 	if (device_is_a(dev, "gtpci")) {
 		extern struct gtpci_prot gtpci0_prot, gtpci1_prot;



CVS commit: src/sys/arch/ia64/ia64

2018-11-20 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Tue Nov 20 20:36:24 UTC 2018

Modified Files:
src/sys/arch/ia64/ia64: genassym.cf locore.S

Log Message:
add IA64_DCR_DEFAULT, more changes from FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/ia64/ia64/genassym.cf
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/ia64/ia64/locore.S

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/ia64/ia64/genassym.cf
diff -u src/sys/arch/ia64/ia64/genassym.cf:1.13 src/sys/arch/ia64/ia64/genassym.cf:1.14
--- src/sys/arch/ia64/ia64/genassym.cf:1.13	Thu Aug 10 12:51:22 2017
+++ src/sys/arch/ia64/ia64/genassym.cf	Tue Nov 20 20:36:24 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.13 2017/08/10 12:51:22 maxv Exp $
+#	$NetBSD: genassym.cf,v 1.14 2018/11/20 20:36:24 scole Exp $
 
 #
 # Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -115,6 +115,7 @@ define  IA64_PBVM_PAGE_SHIFT	IA64_PBVM_P
 define	IA64_PSR_DFH		IA64_PSR_DFH
 define	IA64_PBVM_BASE		IA64_PBVM_BASE
 define	IA64_PBVM_PGTBL		IA64_PBVM_PGTBL
+define  IA64_DCR_DEFAULT	IA64_DCR_DEFAULT
 
 define	PTE_PRESENT		PTE_PRESENT
 define	PTE_ACCESSED		PTE_ACCESSED

Index: src/sys/arch/ia64/ia64/locore.S
diff -u src/sys/arch/ia64/ia64/locore.S:1.8 src/sys/arch/ia64/ia64/locore.S:1.9
--- src/sys/arch/ia64/ia64/locore.S:1.8	Wed Nov 14 21:10:59 2018
+++ src/sys/arch/ia64/ia64/locore.S	Tue Nov 20 20:36:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.8 2018/11/14 21:10:59 scole Exp $	*/
+/*	$NetBSD: locore.S,v 1.9 2018/11/20 20:36:24 scole Exp $	*/
 	
 /*-
  * Copyright (c) 1998 Doug Rabson
@@ -81,19 +81,37 @@ ENTRY_NOPROFILE(start, 1)
 	movl	r16=pa_bootinfo
 	;;
 }
+{	.mmi	
 	st8	[r16]=r8		// save the PA of the bootinfo block
 	loadrs// invalidate regs
+	mov r17=IA64_DCR_DEFAULT
 	;;
+}
+{	.mmi
+	mov	cr.dcr=r17
 	mov	ar.rsc=3		// turn rse back on
+	nop	0
 	;;
+}
+{	.mmi
+	srlz.d	
 	alloc	r16=ar.pfs,0,0,1,0
-	;;
-	movl	out0=0			// we are linked at the right address 
+	mov	out0=r0			// we are linked at the right address 
 	;;// we just need to process fptrs
-//	br.call.sptk.many rp=_reloc	// XXX:	Look into relocs
-	;;
+	}
+#if 0  /* XXX: Look into relocs */	
+{	.mib
+	nop	0
+	nop	0
+	br.call.sptk.many rp=_reloc
+}
+#endif	
+{	.mib
+	nop	0
+	nop	0
 	br.call.sptk.many rp=ia64_init
 	;;
+}
 /* We have the new bspstore in r8 and the new sp in r9.
Switch onto the new stack and call mi_startup(). */
 {   .mmi
@@ -109,9 +127,13 @@ ENTRY_NOPROFILE(start, 1)
 mov ar.rsc = 3
 nop 0
 ;;
-}	
+}
+{	.mib
+	nop	0
+	nop	0
 	br.call.sptk.many rp=main
 	;;
+}
 	/* NOTREACHED */
 1:	br.cond.sptk.few 1b
 END(start)



CVS commit: src/sys/arch/ia64/acpi

2018-11-17 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Nov 17 20:53:35 UTC 2018

Modified Files:
src/sys/arch/ia64/acpi: acpi_machdep.c

Log Message:
change "InterruptNumber" to "irq" to fix compilation


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/ia64/acpi/acpi_machdep.c

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/ia64/acpi/acpi_machdep.c
diff -u src/sys/arch/ia64/acpi/acpi_machdep.c:1.8 src/sys/arch/ia64/acpi/acpi_machdep.c:1.9
--- src/sys/arch/ia64/acpi/acpi_machdep.c:1.8	Fri Nov 16 23:03:55 2018
+++ src/sys/arch/ia64/acpi/acpi_machdep.c	Sat Nov 17 20:53:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_machdep.c,v 1.8 2018/11/16 23:03:55 jmcneill Exp $	*/
+/*	$NetBSD: acpi_machdep.c,v 1.9 2018/11/17 20:53:35 scole Exp $	*/
 /*
  * Copyright (c) 2009 KIYOHARA Takashi
  * All rights reserved.
@@ -28,7 +28,7 @@
  * Machine-dependent routines for ACPICA.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.8 2018/11/16 23:03:55 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.9 2018/11/17 20:53:35 scole Exp $");
 
 #include 
 
@@ -84,13 +84,13 @@ acpi_isa_irq_to_vector(UINT32 irq)
 	};
 
 	if (has_i8259 && irq < 16)
-		return isa_irq_to_vector_map[InterruptNumber];
+		return isa_irq_to_vector_map[irq];
 
 	return irq;
 }
 
 ACPI_STATUS
-acpi_md_OsInstallInterruptHandler(UINT32 InterruptNumber,
+acpi_md_OsInstallInterruptHandler(UINT32 irq,
   ACPI_OSD_HANDLER ServiceRoutine,
   void *Context, void **cookiep,
   const char *xname)



CVS commit: src/usr.bin/xlint/common

2018-11-16 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Fri Nov 16 20:49:08 UTC 2018

Modified Files:
src/usr.bin/xlint/common: lp64.h

Log Message:
PR toolchain/53710

allow 64bit target to compile on 32bit host

Ok'ed by 


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/xlint/common/lp64.h

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

Modified files:

Index: src/usr.bin/xlint/common/lp64.h
diff -u src/usr.bin/xlint/common/lp64.h:1.6 src/usr.bin/xlint/common/lp64.h:1.7
--- src/usr.bin/xlint/common/lp64.h:1.6	Sun Oct  7 14:20:01 2018
+++ src/usr.bin/xlint/common/lp64.h	Fri Nov 16 20:49:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: lp64.h,v 1.6 2018/10/07 14:20:01 christos Exp $	*/
+/*	$NetBSD: lp64.h,v 1.7 2018/11/16 20:49:08 scole Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -45,7 +45,9 @@
 #define	LONG_SIZE	(8 * CHAR_BIT)
 #define	QUAD_SIZE	(8 * CHAR_BIT)
 #define	PTR_SIZE	(8 * CHAR_BIT)
+#ifdef _LP64
 #define	INT128_SIZE	(16 * CHAR_BIT)
+#endif
 
 #define	TARG_SCHAR_MAX	((signed char) (((unsigned char) -1) >> 1))
 #define	TARG_SCHAR_MIN	((-TARG_CHAR_MAX) - 1)
@@ -67,7 +69,7 @@
 #define	TARG_QUAD_MIN	((-TARG_QUAD_MAX) - 1)
 #define	TARG_UQUAD_MAX	((uint64_t) -1)
 
-#ifndef _LP64
+#ifdef _LP64
 /* XXX on a 32 build for a 64 build host we skip these */
 #define	TARG_INT128_MAX		((__int128_t) (((__uint128_t) -1) >> 1))
 #define	TARG_INT128_MIN		((-TARG_INT128_MAX) - 1)



CVS commit: src/sys/arch/ia64/ia64

2018-11-15 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu Nov 15 20:39:19 UTC 2018

Modified Files:
src/sys/arch/ia64/ia64: machdep.c

Log Message:
enable some incorrectly commented-out code


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/ia64/ia64/machdep.c

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/ia64/ia64/machdep.c
diff -u src/sys/arch/ia64/ia64/machdep.c:1.39 src/sys/arch/ia64/ia64/machdep.c:1.40
--- src/sys/arch/ia64/ia64/machdep.c:1.39	Wed Nov 14 21:10:59 2018
+++ src/sys/arch/ia64/ia64/machdep.c	Thu Nov 15 20:39:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.39 2018/11/14 21:10:59 scole Exp $	*/
+/*	$NetBSD: machdep.c,v 1.40 2018/11/15 20:39:18 scole Exp $	*/
 
 /*-
  * Copyright (c) 2003,2004 Marcel Moolenaar
@@ -667,10 +667,8 @@ ia64_init(void)
 	 * sane) context as the initial context for new threads that are
 	 * forked from us.
 	 */
-#if 0	/* XXX */
 	if (savectx(pcb0))
 		panic("savectx failed");
-#endif
 
 	/*
 	 * Initialize debuggers, and break into them if appropriate.



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

2018-11-15 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu Nov 15 20:06:23 UTC 2018

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

Log Message:
change "PCB" to "pcb"


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ia64/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/ia64/include/proc.h
diff -u src/sys/arch/ia64/include/proc.h:1.7 src/sys/arch/ia64/include/proc.h:1.8
--- src/sys/arch/ia64/include/proc.h:1.7	Wed Nov 14 21:10:59 2018
+++ src/sys/arch/ia64/include/proc.h	Thu Nov 15 20:06:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.7 2018/11/14 21:10:59 scole Exp $	*/
+/*	$NetBSD: proc.h,v 1.8 2018/11/15 20:06:23 scole Exp $	*/
 
 #ifndef _IA64_PROC_H_
 #define _IA64_PROC_H_
@@ -44,6 +44,6 @@ struct mdproc {
 #define UAREA_SP_OFFSET		(UAREA_TF_OFFSET -16 -sizeof(uint64_t))
 #define UAREA_BSPSTORE_OFFSET	(0)
 #define UAREA_STACK_SIZE	(USPACE - 16 - sizeof(struct trapframe) - \
- sizeof(struct PCB))
+ sizeof(struct pcb))
 
 #endif /* _IA64_PROC_H_ */



CVS commit: src/sys/arch/ia64

2018-11-14 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Wed Nov 14 21:10:59 UTC 2018

Modified Files:
src/sys/arch/ia64/ia64: locore.S machdep.c syscall.c vm_machdep.c
src/sys/arch/ia64/include: md_var.h proc.h

Log Message:
- When forking, use own register stack for each thread
- For UAREA, arrange layout same as FreeBSD for now to hopefully
  ease porting woes.  add some related macros
  locore.S is incorrectly assuming same layout and seems painful
  to change bspstore in startup
- use ia64_init_return same as FreeBSD
- change some "printf" to "panic" for incompleted items

context switching is still broken but maybe less so


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ia64/ia64/locore.S
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/ia64/ia64/machdep.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/ia64/ia64/syscall.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/ia64/ia64/vm_machdep.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/include/md_var.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/ia64/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/ia64/ia64/locore.S
diff -u src/sys/arch/ia64/ia64/locore.S:1.7 src/sys/arch/ia64/ia64/locore.S:1.8
--- src/sys/arch/ia64/ia64/locore.S:1.7	Sat Apr  8 17:45:22 2017
+++ src/sys/arch/ia64/ia64/locore.S	Wed Nov 14 21:10:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.7 2017/04/08 17:45:22 scole Exp $	*/
+/*	$NetBSD: locore.S,v 1.8 2018/11/14 21:10:59 scole Exp $	*/
 	
 /*-
  * Copyright (c) 1998 Doug Rabson
@@ -94,6 +94,22 @@ ENTRY_NOPROFILE(start, 1)
 	;;
 	br.call.sptk.many rp=ia64_init
 	;;
+/* We have the new bspstore in r8 and the new sp in r9.
+   Switch onto the new stack and call mi_startup(). */
+{   .mmi
+mov ar.rsc = 0
+;;
+mov ar.bspstore = r8
+mov sp = r9
+;;
+}
+{   .mmi
+loadrs
+;;
+mov ar.rsc = 3
+nop 0
+;;
+}	
 	br.call.sptk.many rp=main
 	;;
 	/* NOTREACHED */

Index: src/sys/arch/ia64/ia64/machdep.c
diff -u src/sys/arch/ia64/ia64/machdep.c:1.38 src/sys/arch/ia64/ia64/machdep.c:1.39
--- src/sys/arch/ia64/ia64/machdep.c:1.38	Sat Apr  8 17:46:01 2017
+++ src/sys/arch/ia64/ia64/machdep.c	Wed Nov 14 21:10:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.38 2017/04/08 17:46:01 scole Exp $	*/
+/*	$NetBSD: machdep.c,v 1.39 2018/11/14 21:10:59 scole Exp $	*/
 
 /*-
  * Copyright (c) 2003,2004 Marcel Moolenaar
@@ -152,7 +152,7 @@ extern uint64_t ia64_gateway_page[];
 uint64_t pa_bootinfo;
 struct bootinfo bootinfo;
 
-
+extern vaddr_t kstack, kstack_top;
 extern vaddr_t kernel_text, end;
 
 struct fpswa_iface *fpswa_iface;
@@ -377,9 +377,10 @@ calculate_frequencies(void)
 
 /* : Don't allocate 'ci' on stack. */
 register struct cpu_info *ci __asm__("r13");
-void
+struct ia64_init_return
 ia64_init(void)
 {
+	struct ia64_init_return ret;
 	paddr_t kernstartpfn, kernendpfn, pfn0, pfn1;
 	struct pcb *pcb0;
 	struct efi_md *md;
@@ -620,33 +621,15 @@ ia64_init(void)
 	 * Set the kernel sp, reserving space for an (empty) trapframe,
 	 * and make lwp0's trapframe pointer point to it for sanity.
 	 */
+	lwp0.l_md.md_tf = (struct trapframe *)(v + UAREA_TF_OFFSET);
 
-	/*
-	 * Process u-area is organised as follows:
-	 *
-	 *  ---
-	 * |  P  |  || 16Bytes | T |
-	 * |  C  | Register Stack   |  Memory Stack  | <-> | F |
-	 * |  B  | ->   |   <--  | |   |
-	 *  ---
-	 *^  ^
-	 *|___ bspstore  |___ sp
-	 *
-	 * --->
- *   Higher Addresses
-	 *
-	 *	PCB: struct pcb;TF: struct trapframe;
-	 */
-
-
-	lwp0.l_md.md_tf = (struct trapframe *)(v + USPACE) - 1;
-
+	lwp0.l_md.user_stack = NULL;
+	lwp0.l_md.user_stack_size = 0;
+	
 	pcb0 = lwp_getpcb();
-
-	/* 16 bytes is the scratch area defined by the ia64 ABI. */
-	pcb0->pcb_special.sp = (vaddr_t)lwp0.l_md.md_tf - 16;
-	pcb0->pcb_special.bspstore = v + 1;
-
+	pcb0->pcb_special.sp = v + UAREA_SP_OFFSET;
+	pcb0->pcb_special.bspstore = v + UAREA_BSPSTORE_OFFSET;
+	
 	mutex_init(>pcb_fpcpu_slock, MUTEX_DEFAULT, 0);
 
 	/*
@@ -684,8 +667,10 @@ ia64_init(void)
 	 * sane) context as the initial context for new threads that are
 	 * forked from us.
 	 */
+#if 0	/* XXX */
 	if (savectx(pcb0))
 		panic("savectx failed");
+#endif
 
 	/*
 	 * Initialize debuggers, and break into them if appropriate.
@@ -699,6 +684,11 @@ ia64_init(void)
 	if (boothowto & RB_KDB)
 		Debugger();
 #endif
+
+	ret.bspstore = pcb0->pcb_special.bspstore;
+	ret.sp = pcb0->pcb_special.sp;
+	
+	return (ret);
 }
 
 uint64_t

Index: src/sys/arch/ia64/ia64/syscall.c
diff -u 

CVS commit: src/sys/arch/ia64

2018-11-14 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Wed Nov 14 20:13:14 UTC 2018

Modified Files:
src/sys/arch/ia64: TODO

Log Message:
add more items


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/ia64/TODO

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/ia64/TODO
diff -u src/sys/arch/ia64/TODO:1.1 src/sys/arch/ia64/TODO:1.2
--- src/sys/arch/ia64/TODO:1.1	Sat Apr 14 20:21:09 2018
+++ src/sys/arch/ia64/TODO	Wed Nov 14 20:13:14 2018
@@ -39,6 +39,7 @@ Tasks remaining, first couple seem most 
 - implement __cloneS ptrace.S sbrk.S shmat.S
 - implement kvm_ia64.c
 - implement pmc (performance monitoring counters) for ia64 pmc registers
+- cpuctl
 - optional(?) mutex.h/lock_stubs.S, mutex_enter()/mutex_exit() __HAVE_MUTEX_STUBS
mutex_spin_enter()/mutex_spin_exit() __HAVE_SPIN_MUTEX_STUBS
 - rwlock.h rw_enter(),rw_exit(),rw_tryenter() __HAVE_RW_STUBS, implemented already?
@@ -48,6 +49,7 @@ Tasks remaining, first couple seem most 
   do we want commands more like netbsd i386 bootloader? e.g., add
   command to boot nfs from loader.efi instead of hack now
 - ia64 implement __HAVE_FAST_SOFTINTS?
+- want or need __HAVE_CPU_UAREA_ROUTINES, cpu_uarea_alloc,  cpu_uarea_free
 - fix all "[Nn]ot yet" and "XXX" functions everywhere
 - create/fix sys/arch/ia64/include/pci_machdep.h and implement actual functions,
   need to handle "multiple" pci busses like from http://www.openpa.net/systems/il/rp3400-bus.txt,
@@ -61,3 +63,7 @@ Tasks remaining, first couple seem most 
 - add ia32 emulation, port from freebsd
 - add rump stuff/MKRUMP
 - create install EFI/cdrom/netbsd
+
+Pie in the sky
+- Xen and itanium!
+- qemu and itanium



CVS commit: src/distrib/notes

2018-11-13 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Tue Nov 13 18:48:26 UTC 2018

Modified Files:
src/distrib/notes/common: main
src/distrib/notes/macppc: contents install prep.OPENFIRMWARE

Log Message:
Mention macppc 601 needs to use separate boot floppies, kernels, and specific 
kernel on CD


To generate a diff of this commit:
cvs rdiff -u -r1.549 -r1.550 src/distrib/notes/common/main
cvs rdiff -u -r1.14 -r1.15 src/distrib/notes/macppc/contents
cvs rdiff -u -r1.39 -r1.40 src/distrib/notes/macppc/install
cvs rdiff -u -r1.19 -r1.20 src/distrib/notes/macppc/prep.OPENFIRMWARE

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

Modified files:

Index: src/distrib/notes/common/main
diff -u src/distrib/notes/common/main:1.549 src/distrib/notes/common/main:1.550
--- src/distrib/notes/common/main:1.549	Tue Aug  7 08:26:42 2018
+++ src/distrib/notes/common/main	Tue Nov 13 18:48:25 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: main,v 1.549 2018/08/07 08:26:42 martin Exp $
+.\"	$NetBSD: main,v 1.550 2018/11/13 18:48:25 scole Exp $
 .\"
 .\" Copyright (c) 1999-2012 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -381,6 +381,24 @@ kernel is called
 You may want to read the section below on
 .Sx Open Firmware boot syntax
 .\}
+.if \n[macppc] \{\
+.It
+.Pp
+PowerPC 601 machines need to use separate boot floppies 
+.Pa macppc/installation/floppy/boot601_1.fs
+and
+.Pa macppc/installation/floppy/boot602_2.fs ,
+a different kernel set
+.Pa kern-GENERIC_601.tgz ,
+and a different install kernel
+.Pa netbsd-INSTALL_601.gz .
+The same boot CD can be used but at the boot prompt you must specify
+the 601 kernel, i.e., replace
+.Ic netbsd.macppc
+with
+.Ic netbsd.601
+.
+.\}
 .if \n[sparc]:\n[sparc64] \{\
 .It
 You will need to get to the

Index: src/distrib/notes/macppc/contents
diff -u src/distrib/notes/macppc/contents:1.14 src/distrib/notes/macppc/contents:1.15
--- src/distrib/notes/macppc/contents:1.14	Sun Jun 24 09:38:47 2018
+++ src/distrib/notes/macppc/contents	Tue Nov 13 18:48:25 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: contents,v 1.14 2018/06/24 09:38:47 leot Exp $
+.\"	$NetBSD: contents,v 1.15 2018/11/13 18:48:25 scole Exp $
 .\"
 .\" Copyright (c) 1999-2016 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -91,6 +91,15 @@ kernel containing code only for Open Fir
 and 2.4 systems (i.e. those that have floppy drives).
 It has a RAM-disk installer.
 .
+.			It Pa netbsd-INSTALL_601.gz
+.
+A gzipped
+.Nx
+kernel containing code only for PowerPC 601 machines, Open Firmware
+1.0.5, 1.1.22, 2.0.x, and 2.4 systems (i.e. those that have floppy drives).
+It has a RAM-disk installer.
+.
+.
 .		tag) \" binary/kernel/
 .
 .		It Pa sets/
@@ -112,6 +121,13 @@ kernel.  The second image has the instal
 Only usable on models that ship with a floppy drive (pre-Open Firmware 3);
 see below.
 .
+.
+.		It Pa floppy/boot601_1.fs
+.		It Pa floppy/boot601_2.fs
+.
+Same as boot1.fs, boot2.fs, except for PowerPC 601 machines only.
+.
+.
 .		It Pa ofwboot.xcf
 .
 \*M bootloader; see below.

Index: src/distrib/notes/macppc/install
diff -u src/distrib/notes/macppc/install:1.39 src/distrib/notes/macppc/install:1.40
--- src/distrib/notes/macppc/install:1.39	Sat Oct  6 05:28:46 2012
+++ src/distrib/notes/macppc/install	Tue Nov 13 18:48:25 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: install,v 1.39 2012/10/06 05:28:46 jnemeth Exp $
+.\"	$NetBSD: install,v 1.40 2018/11/13 18:48:25 scole Exp $
 .
 .Ss2 Open Firmware boot syntax
 .
@@ -298,6 +298,15 @@ listing if it is present on the disk.  F
 .No 0 \*[Gt] Ic "boot cd:,\eOFWBOOT.XCF;1 NETBSD.MACPPC;1"
 .disp)
 .Note)
+.(Note
+PowerPC 601 machines need to specify the
+.Pa NETBSD.601
+kernel when booting from the install CD, and use the
+.Pa kern-GENERIC_601.tgz
+and
+.Pa netbsd-INSTALL_601.gz
+kernels.
+.Note)
 .Pp
 If the
 .Ic dir
@@ -335,6 +344,7 @@ usually sets their CD-ROM drives to SCSI
 .Pp
 .(disp
 .No 0 \*[Gt] Ic "boot cd:0 NETBSD.MACPPC"
+.No 0 \*[Gt] Ic "boot cd:0 NETBSD.601"
 .No 0 \*[Gt] Ic "boot scsi-int/sd@3:0 NETBSD.MACPPC"
 .No 0 \*[Gt] Ic "boot scsi/sd@3:0 NETBSD.MACPPC"
 .No 0 \*[Gt] Ic "boot ata/atapi-disk:0 NETBSD.MACPPC"

Index: src/distrib/notes/macppc/prep.OPENFIRMWARE
diff -u src/distrib/notes/macppc/prep.OPENFIRMWARE:1.19 src/distrib/notes/macppc/prep.OPENFIRMWARE:1.20
--- src/distrib/notes/macppc/prep.OPENFIRMWARE:1.19	Wed Jun  7 09:14:32 2017
+++ src/distrib/notes/macppc/prep.OPENFIRMWARE	Tue Nov 13 18:48:25 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: prep.OPENFIRMWARE,v 1.19 2017/06/07 09:14:32 he Exp $
+.\"	$NetBSD: prep.OPENFIRMWARE,v 1.20 2018/11/13 18:48:25 scole Exp $
 .if \*[OF_VERSION_3] \{\
 .
 .Ss2 Updating your BootROM
@@ -1257,7 +1257,11 @@ Use a tool to write the boot floppy imag
 .Pa installation/floppy/boot1.fs
 and
 .Pa installation/floppy/boot2.fs
-to two floppy disks.
+to two floppy disks.  PowerPC 601 machines should use
+.Pa installation/floppy/boot601_1.fs
+and
+.Pa 

CVS commit: src/distrib/macppc/cdroms/installcd

2018-11-12 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Tue Nov 13 03:07:21 UTC 2018

Modified Files:
src/distrib/macppc/cdroms/installcd: Makefile

Log Message:
add ppc601 kernel to macppc iso


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/macppc/cdroms/installcd/Makefile

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

Modified files:

Index: src/distrib/macppc/cdroms/installcd/Makefile
diff -u src/distrib/macppc/cdroms/installcd/Makefile:1.3 src/distrib/macppc/cdroms/installcd/Makefile:1.4
--- src/distrib/macppc/cdroms/installcd/Makefile:1.3	Fri Sep 28 15:05:21 2018
+++ src/distrib/macppc/cdroms/installcd/Makefile	Tue Nov 13 03:07:21 2018
@@ -1,8 +1,9 @@
-#	$NetBSD: Makefile,v 1.3 2018/09/28 15:05:21 martin Exp $
+#	$NetBSD: Makefile,v 1.4 2018/11/13 03:07:21 scole Exp $
 CDBASE=		macppccd		# gives ${CDBASE}.iso
 CDRELEASE=	true			# include $RELEASEDIR/$MACHINE
 CDRELEASE_NODEBUG=	true
 CDKERNELS=	netbsd-INSTALL.gz netbsd
+CDKERNELS+=	netbsd-INSTALL_601.gz netbsd.601
 CDINSTKERNEL=	../../floppies/md-kernel
 CDBUILDEXTRA=	${DESTDIR}/usr/mdec/ofwboot.xcf
 



CVS commit: src/distrib/cdrom

2018-11-12 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Tue Nov 13 03:03:22 UTC 2018

Modified Files:
src/distrib/cdrom: NetBSD-current.mk

Log Message:
add ppc601 kernel to macppc iso


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/distrib/cdrom/NetBSD-current.mk

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

Modified files:

Index: src/distrib/cdrom/NetBSD-current.mk
diff -u src/distrib/cdrom/NetBSD-current.mk:1.8 src/distrib/cdrom/NetBSD-current.mk:1.9
--- src/distrib/cdrom/NetBSD-current.mk:1.8	Tue Oct  5 14:16:20 2010
+++ src/distrib/cdrom/NetBSD-current.mk	Tue Nov 13 03:03:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: NetBSD-current.mk,v 1.8 2010/10/05 14:16:20 tsutsui Exp $
+# $NetBSD: NetBSD-current.mk,v 1.9 2018/11/13 03:03:22 scole Exp $
 #
 # Configuration file for NetBSD-current.
 
@@ -31,7 +31,8 @@ EXTFILES.macppc=	macppc.bootxx:macppc/bi
 			macppc.ofwboot:macppc/binary/sets/base.tgz,./usr/mdec/ofwboot
 INTFILES.macppc=	ofwboot.xcf:macppc/installation/ofwboot.xcf,link \
 			ofwboot:macppc/binary/sets/base.tgz,./usr/mdec/ofwboot \
-			netbsd.macppc:macppc/binary/kernel/netbsd-INSTALL.gz,link
+			netbsd.macppc:macppc/binary/kernel/netbsd-INSTALL.gz,link \
+			netbsd.601:macppc/binary/kernel/netbsd-INSTALL_601.gz,link
 
 # BOOTFILE.pmax is absolute
 BOOTFILE.pmax=		${EXTFILEDIR}/pmax.bootxx



CVS commit: src/distrib/macppc/floppies

2018-11-12 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Mon Nov 12 20:16:46 UTC 2018

Added Files:
src/distrib/macppc/floppies/bootfloppy-601: Makefile
src/distrib/macppc/floppies/bootfloppy-common: Makefile.inc

Log Message:
install kernel for ppc601 floppies and iso


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/distrib/macppc/floppies/bootfloppy-601/Makefile
cvs rdiff -u -r0 -r1.1 \
src/distrib/macppc/floppies/bootfloppy-common/Makefile.inc

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

Added files:

Index: src/distrib/macppc/floppies/bootfloppy-601/Makefile
diff -u /dev/null src/distrib/macppc/floppies/bootfloppy-601/Makefile:1.1
--- /dev/null	Mon Nov 12 20:16:46 2018
+++ src/distrib/macppc/floppies/bootfloppy-601/Makefile	Mon Nov 12 20:16:46 2018
@@ -0,0 +1,8 @@
+#	$NetBSD: Makefile,v 1.1 2018/11/12 20:16:46 scole Exp $
+
+FLOPPY_NETBSD=	${KERNOBJ}/netbsd-INSTALL_601.gz
+FLOPPYBASE=	boot601_
+
+.include 
+
+.include "../bootfloppy-common/Makefile.inc"

Index: src/distrib/macppc/floppies/bootfloppy-common/Makefile.inc
diff -u /dev/null src/distrib/macppc/floppies/bootfloppy-common/Makefile.inc:1.1
--- /dev/null	Mon Nov 12 20:16:46 2018
+++ src/distrib/macppc/floppies/bootfloppy-common/Makefile.inc	Mon Nov 12 20:16:46 2018
@@ -0,0 +1,24 @@
+#	$NetBSD: Makefile.inc,v 1.1 2018/11/12 20:16:46 scole Exp $
+
+.include 
+.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
+
+# Required variables:
+#  FLOPPY_NETBSD
+#  FLOPPYBASE
+
+FLOPPYSIZE=	2880
+FLOPPYFILES=	boot netbsd
+FLOPPYMAX=	3
+FLOPPYSUFFIX=	.fs
+
+FLOPPY_RELEASEDIR=	installation/floppy
+
+MDEC=		${DESTDIR}/usr/mdec
+KERNOBJ!=	cd ${.CURDIR}/../md-kernel && ${PRINTOBJDIR}
+FLOPPY_BOOT=	${MDEC}/ofwboot
+FLOPPYINSTBOOT=	"${TOOL_INSTALLBOOT} -v -m ${MACHINE} -t raw -B 17 @IMAGE@ ${MDEC}/bootxx ${FLOPPY_BOOT}"
+
+.include "${DISTRIBDIR}/common/Makefile.tarfloppy"
+
+.include 



CVS commit: src/distrib/macppc/floppies

2018-11-12 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Mon Nov 12 20:11:39 UTC 2018

Modified Files:
src/distrib/macppc/floppies: Makefile
src/distrib/macppc/floppies/bootfloppy: Makefile
src/distrib/macppc/floppies/md-kernel: Makefile
src/distrib/macppc/floppies/ramdisk: Makefile

Log Message:
install kernel for ppc601 floppies and iso


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/distrib/macppc/floppies/Makefile
cvs rdiff -u -r1.28 -r1.29 src/distrib/macppc/floppies/bootfloppy/Makefile
cvs rdiff -u -r1.11 -r1.12 src/distrib/macppc/floppies/md-kernel/Makefile
cvs rdiff -u -r1.48 -r1.49 src/distrib/macppc/floppies/ramdisk/Makefile

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

Modified files:

Index: src/distrib/macppc/floppies/Makefile
diff -u src/distrib/macppc/floppies/Makefile:1.5 src/distrib/macppc/floppies/Makefile:1.6
--- src/distrib/macppc/floppies/Makefile:1.5	Fri Apr 12 02:19:30 2002
+++ src/distrib/macppc/floppies/Makefile	Mon Nov 12 20:11:39 2018
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile,v 1.5 2002/04/12 02:19:30 lukem Exp $
+#	$NetBSD: Makefile,v 1.6 2018/11/12 20:11:39 scole Exp $
 
-SUBDIR=	ramdisk .WAIT md-kernel .WAIT bootfloppy
+SUBDIR=	ramdisk .WAIT md-kernel .WAIT bootfloppy .WAIT bootfloppy-601
 TARGETS+=release
 
 .include 

Index: src/distrib/macppc/floppies/bootfloppy/Makefile
diff -u src/distrib/macppc/floppies/bootfloppy/Makefile:1.28 src/distrib/macppc/floppies/bootfloppy/Makefile:1.29
--- src/distrib/macppc/floppies/bootfloppy/Makefile:1.28	Thu Jan 29 20:47:12 2015
+++ src/distrib/macppc/floppies/bootfloppy/Makefile	Mon Nov 12 20:11:39 2018
@@ -1,22 +1,8 @@
-#	$NetBSD: Makefile,v 1.28 2015/01/29 20:47:12 joerg Exp $
+#	$NetBSD: Makefile,v 1.29 2018/11/12 20:11:39 scole Exp $
 
-.include 
-.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
-
-FLOPPYBASE=	boot
-FLOPPYSIZE=	2880
-FLOPPYFILES=	boot netbsd
-FLOPPYMAX=	3
-FLOPPYSUFFIX=	.fs
-
-FLOPPY_RELEASEDIR=	installation/floppy
-
-MDEC=		${DESTDIR}/usr/mdec
-KERNOBJ!=	cd ${.CURDIR}/../md-kernel && ${PRINTOBJDIR}
 FLOPPY_NETBSD=	${KERNOBJ}/netbsd-INSTALL.gz
-FLOPPY_BOOT=	${MDEC}/ofwboot
-FLOPPYINSTBOOT=	"${TOOL_INSTALLBOOT} -v -m ${MACHINE} -t raw -B 17 @IMAGE@ ${MDEC}/bootxx ${FLOPPY_BOOT}"
+FLOPPYBASE=	boot
 
-.include "${DISTRIBDIR}/common/Makefile.tarfloppy"
+.include 
 
-.include 
+.include "../bootfloppy-common/Makefile.inc"

Index: src/distrib/macppc/floppies/md-kernel/Makefile
diff -u src/distrib/macppc/floppies/md-kernel/Makefile:1.11 src/distrib/macppc/floppies/md-kernel/Makefile:1.12
--- src/distrib/macppc/floppies/md-kernel/Makefile:1.11	Wed May  8 21:44:56 2002
+++ src/distrib/macppc/floppies/md-kernel/Makefile	Mon Nov 12 20:11:39 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.11 2002/05/08 21:44:56 lukem Exp $
+#	$NetBSD: Makefile,v 1.12 2018/11/12 20:11:39 scole Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -7,6 +7,7 @@ RAMDISKDIR!=	cd ${.CURDIR}/../ramdisk &&
 RAMDISK=	${RAMDISKDIR}/ramdisk.fs
 
 MDSETTARGETS=		INSTALL		${RAMDISK}	-	\
+			INSTALL_601	${RAMDISK}	-	\
 			GENERIC_MD	${RAMDISK}	-
 MDSET_RELEASEDIR=	binary/kernel
 

Index: src/distrib/macppc/floppies/ramdisk/Makefile
diff -u src/distrib/macppc/floppies/ramdisk/Makefile:1.48 src/distrib/macppc/floppies/ramdisk/Makefile:1.49
--- src/distrib/macppc/floppies/ramdisk/Makefile:1.48	Tue Jan 24 18:04:03 2017
+++ src/distrib/macppc/floppies/ramdisk/Makefile	Mon Nov 12 20:11:39 2018
@@ -1,12 +1,12 @@
-#	$NetBSD: Makefile,v 1.48 2017/01/24 18:04:03 christos Exp $
+#	$NetBSD: Makefile,v 1.49 2018/11/12 20:11:39 scole Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
 IMAGE=		ramdisk.fs
-# This must be kept in sync with config option MEMORY_DISK_ROOT_SIZE
-# in both
+# This must be kept in sync with config option MEMORY_DISK_ROOT_SIZE in
 #   src/sys/arch/macppc/conf/INSTALL
+#   src/sys/arch/macppc/conf/INSTALL_601
 #   src/sys/arch/macppc/conf/GENERIC_MD
 IMAGESIZE=	2560k
 MAKEFS_FLAGS+=	-f 15



CVS commit: src/etc/etc.macppc

2018-11-12 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Mon Nov 12 20:09:07 UTC 2018

Modified Files:
src/etc/etc.macppc: Makefile.inc

Log Message:
install kernel for ppc601 floppies and iso


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/etc/etc.macppc/Makefile.inc

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

Modified files:

Index: src/etc/etc.macppc/Makefile.inc
diff -u src/etc/etc.macppc/Makefile.inc:1.9 src/etc/etc.macppc/Makefile.inc:1.10
--- src/etc/etc.macppc/Makefile.inc:1.9	Sun Jul 20 14:52:29 2014
+++ src/etc/etc.macppc/Makefile.inc	Mon Nov 12 20:09:07 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.9 2014/07/20 14:52:29 macallan Exp $
+#	$NetBSD: Makefile.inc,v 1.10 2018/11/12 20:09:07 scole Exp $
 #
 #	etc.macppc/Makefile.inc -- macppc-specific etc Makefile targets
 #
@@ -8,6 +8,6 @@
 
 KERNEL_SETS=		GENERIC GENERIC.MP GENERIC_601
 
-BUILD_KERNELS+=		INSTALL GENERIC_MD
+BUILD_KERNELS+=		INSTALL INSTALL_601 GENERIC_MD
 
 INSTALLATION_DIRS+=	installation/floppy



CVS commit: src/sys/arch/macppc/conf

2018-11-12 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Mon Nov 12 20:07:47 UTC 2018

Added Files:
src/sys/arch/macppc/conf: INSTALL_601

Log Message:
install kernel for ppc601 floppies and iso


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/macppc/conf/INSTALL_601

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/macppc/conf/INSTALL_601
diff -u /dev/null src/sys/arch/macppc/conf/INSTALL_601:1.1
--- /dev/null	Mon Nov 12 20:07:47 2018
+++ src/sys/arch/macppc/conf/INSTALL_601	Mon Nov 12 20:07:47 2018
@@ -0,0 +1,173 @@
+#	$NetBSD: INSTALL_601,v 1.1 2018/11/12 20:07:47 scole Exp $
+#
+# config file for INSTALL
+#
+# this config more or less matches a Power Macintosh 7200 with a USB card,
+# and platinumfb
+
+include 	"arch/macppc/conf/std.macppc.601"
+
+#options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
+
+makeoptions	COPTS="-Os" # Reduce size.
+
+maxusers	12
+
+options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
+
+# Enable the hooks used for initializing the ram-disk.
+options 	MEMORY_DISK_HOOKS
+options 	MEMORY_DISK_IS_ROOT	# Force root on ram-disk
+options 	MEMORY_DISK_SERVER=0	# no userspace memory disk support
+options 	MEMORY_DISK_ROOT_SIZE=5120	# 2560 KiB
+options 	MEMORY_DISK_RBFLAGS=RB_SINGLE	# boot in single-user mode
+
+options 	USERCONF	# userconf(4) support
+options 	PIPE_SOCKETPAIR		# smaller, but slower pipe(2)
+#options 	SYSCTL_INCLUDE_DESCR	# Include sysctl descriptions in kernel
+
+# Compatibility options
+include 	"conf/compat_netbsd13.config"
+
+# File systems
+file-system 	FFS		# UFS
+file-system 	MFS		# memory file system
+file-system 	NFS		# Network File System client
+file-system 	CD9660		# ISO 9660 + Rock Ridge file system
+file-system 	MSDOSFS		# MS-DOS file system
+#file-system	PTYFS		# /dev/pts/N support
+
+# Filesystem options
+options 	NFS_V2_ONLY	# Exclude NFS3 code to save space
+options 	APPLE_UFS	# Apple UFS support in FFS
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
+options 	WAPBL		# File system journaling support
+
+# Networking options
+options 	INET		# IP + ICMP + TCP + UDP
+options 	INET6		# IPV6
+options 	NFS_BOOT_DHCP	# Support DHCP NFS root
+
+options 	WSEMUL_VT100	# VT100 / VT220 emulation
+options 	WSDISPLAY_DEFAULTSCREENS=1
+#options 	WSDISPLAY_COMPAT_USL		# wsconscfg VT handling
+options 	FONT_GALLANT12x22	# big, Sun-like font
+options 	FONT_QVSS8x15		# a smaller font for lower resolutions
+
+# Kernel root file system and dump configuration.
+config		netbsd	root on ? type ?
+
+#
+# Device configuration
+#
+
+mainbus* at root
+
+cpu*	at mainbus?
+bandit*	at mainbus?
+
+pci*	at bandit? bus ?
+pci*	at ppb? bus ?
+
+pchb*	at pci? dev ? function ?	# PCI-Host bridges
+ppb*	at pci? dev ? function ?	# PCI-PCI bridges
+
+# Display devices
+#
+# The 7200's onboard video is unsupported by OF so we need either a
+# graphics card that works as OF console or a serial console.
+# The only cards known to work ( so far ) are PCI Voodoo3s flashed with the
+# official Macintosh firmware from 3Dfx. The others should work but are
+# untested with OF 1.0.5
+# this will take over the console if output-device is set to 'screen' or
+# 'platinum'. It will provide a NetBSD console, but still won't work with OF
+#platinumfb0 	at mainbus?
+
+#gffb*		at pci?	function ?	# NVIDIA GeForce2 MX
+#machfb*		at pci? function ?	# ATI Mach 64, Rage, Rage Pro
+#r128fb*		at pci? function ?	# ATI Rage 128
+voodoofb*	at pci? function ?	# 3Dfx Voodoo3 
+
+# ATI Radeon. Still has problems on some hardware
+#radeonfb*	at pci? function ?
+
+# generic PCI framebuffer, should work with everything supported by OF
+genfb*		at pci? function ?
+
+# make sure the console display is always wsdisplay0
+wsdisplay0	at wsemuldisplaydev? console 1
+wsdisplay*	at wsemuldisplaydev? console 0
+
+obio*	at pci? dev ? function ?
+
+mc*	at obio?			# MACE ethernet
+esp*	at obio? flags 0x00ff		# 53c9x SCSI
+# the 7200 has no mesh but other PMacs with 601 cards may
+mesh*	at obio? flags 0x		# MESH SCSI
+nvram*	at obio?			# nvram
+
+# the new, improved ADB subsystem
+
+cuda*	at obio?			# CUDA, for Old World PowerMacs
+nadb*	at adb_bus?			# ADB bus enumerator, at cuda or pmu
+adbkbd* at nadb?			# ADB keyboard
+adbms*	at nadb?			# ADB mice and touchpads
+
+wskbd*		at wskbddev? console ?
+wsmouse*	at wsmousedev?
+
+iic0	at cuda0		# CUDA's IIC bus
+
+zsc*	at obio?
+zstty*	at zsc? channel ?
+mediabay* at obio?
+wdc*	at mediabay? flags 0
+
+# Cryptographic Devices
+
+# PCI cryptographic devices
+# (disabled, requires opencrypto framework which requires generic softints
+#hifn*	at pci? dev ? function ?	# Hifn 7755/7811/795x
+#ubsec*	at pci? dev ? function ?	# Broadcom 5501/5601/580x/582x
+
+scsibus* at scsi?
+
+sd*	at scsibus? target ? lun ?	# SCSI disks
+cd*	at scsibus? target ? lun ?	# SCSI CD-ROM drives
+
+wdc*	at obio? flags 0x1
+atabus* at ata?
+wd*	at atabus? 

CVS commit: src/sys/arch/macppc/conf

2018-11-12 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Mon Nov 12 20:03:42 UTC 2018

Modified Files:
src/sys/arch/macppc/conf: GENERIC_601

Log Message:
Add scroll support, wsmouse


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/macppc/conf/GENERIC_601

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/macppc/conf/GENERIC_601
diff -u src/sys/arch/macppc/conf/GENERIC_601:1.21 src/sys/arch/macppc/conf/GENERIC_601:1.22
--- src/sys/arch/macppc/conf/GENERIC_601:1.21	Wed Aug  1 20:04:12 2018
+++ src/sys/arch/macppc/conf/GENERIC_601	Mon Nov 12 20:03:42 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC_601,v 1.21 2018/08/01 20:04:12 maxv Exp $
+# $NetBSD: GENERIC_601,v 1.22 2018/11/12 20:03:42 scole Exp $
 #
 # GENERIC machine description file
 # 
@@ -28,7 +28,7 @@ include 	"arch/macppc/conf/std.macppc.60
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-ident 		"GENERIC-$Revision: 1.21 $"
+ident 		"GENERIC-$Revision: 1.22 $"
 
 maxusers	32
 
@@ -163,6 +163,7 @@ options 	WS_DEFAULT_FG=WSCOL_BLACK
 options 	WS_DEFAULT_BG=WSCOL_LIGHT_WHITE
 options 	WS_KERNEL_FG=WSCOL_GREEN
 options 	WS_KERNEL_BG=WSCOL_LIGHT_WHITE
+options WSDISPLAY_SCROLLSUPPORT
 
 #options 	WSDISPLAY_COMPAT_RAWKBD		# can get raw scancodes
 options 	FONT_GALLANT12x22
@@ -289,6 +290,7 @@ uhub*	at uhub? port ?
 uhidev*	at uhub? port ? configuration ? interface ?	# USB HID device
 
 ums*	at uhidev? reportid ?# USB Mice
+wsmouse* at ums? mux 0
 ukbd*	at uhidev? reportid ?# USB Keyboards
 uhid*	at uhidev? reportid ?# USB Generic HID
 
@@ -327,13 +329,13 @@ pseudo-device	vnd			# disk-like interfac
 pseudo-device	fss			# file system snapshot device
 #pseudo-device	md			# memory disk device
 pseudo-device	loop			# network loopback
-#pseudo-device	bpfilter		# packet filter
+pseudo-device	bpfilter		# packet filter
 #pseudo-device	npf			# NPF packet filter
 #pseudo-device	ppp			# Point-to-Point Protocol
 #pseudo-device	pppoe			# PPP over Ethernet (RFC 2516)
 #pseudo-device	sl			# Serial Line IP
 #pseudo-device	tun			# network tunneling over tty
-pseudo-device	tap			# virtual Ethernet
+#pseudo-device	tap			# virtual Ethernet
 #pseudo-device	gre			# generic L3 over IP tunnel
 #pseudo-device	gif			# IPv[46] over IPv[46] tunnel (RFC1933)
 #pseudo-device	faith			# IPv[46] tcp relay translation i/f
@@ -368,3 +370,9 @@ pseudo-device   drvctl
 #options VERIFIED_EXEC_FP_SHA512
 
 #options PAX_MPROTECT=0			# PaX mprotect(2) restrictions
+
+#rlphy*	at mii? phy ?			# Realtek 8139/8201L PHYs
+#rtk*	at pci? dev ? function ?	# Realtek 8129/8139
+
+#rgephy* at mii? phy ?			# Realtek 8169S/8110S internal PHYs
+#ral*	at pci? dev ? function ?	# Ralink Technology RT25x0 802.11a/b/g



CVS commit: src/sys/arch/macppc/stand

2018-11-12 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Mon Nov 12 20:00:46 UTC 2018

Modified Files:
src/sys/arch/macppc/stand/bootxx: bootxx.c
src/sys/arch/macppc/stand/ofwboot: Locore.c

Log Message:
PR 51495/port-macppc

Allow ppc601 to boot off hard disk


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/macppc/stand/bootxx/bootxx.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/macppc/stand/ofwboot/Locore.c

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/macppc/stand/bootxx/bootxx.c
diff -u src/sys/arch/macppc/stand/bootxx/bootxx.c:1.18 src/sys/arch/macppc/stand/bootxx/bootxx.c:1.19
--- src/sys/arch/macppc/stand/bootxx/bootxx.c:1.18	Sat Mar 14 21:04:12 2009
+++ src/sys/arch/macppc/stand/bootxx/bootxx.c	Mon Nov 12 20:00:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootxx.c,v 1.18 2009/03/14 21:04:12 dsl Exp $	*/
+/*	$NetBSD: bootxx.c,v 1.19 2018/11/12 20:00:46 scole Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -33,6 +33,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -68,15 +69,21 @@ __asm(
 "	addi	%r8,8,(_start)@l\n"
 "	li	%r9,0x40	\n"	/* loop 64 times (for 2048 bytes of bootxx) */
 "	mtctr	%r9		\n"
-"1:\n"
-"	dcbf	%r0,%r8		\n"
+"\n"
+"1:	dcbf	%r0,%r8		\n"
 "	icbi	%r0,%r8		\n"
 "	addi	%r8,%r8,0x20	\n"
 "	bdnz	1b		\n"
 "	sync			\n"
 
 "	li	%r0,0		\n"
-"	mtdbatu	3,%r0		\n"
+"\n"	/* test for 601 cpu */
+"	mfspr	%r9,287		\n"	/* mfpvbr %r9 PVR = 287 */
+"	srwi	%r9,%r9,0x10	\n"
+"	cmplwi	%r9,0x02	\n"	/* 601 cpu == 0x0001 */
+"	blt	2f		\n"	/* skip over non-601 BAT setup */
+"\n"
+"	mtdbatu 3,%r0		\n"	/* non-601 BAT */
 "	mtibatu	3,%r0		\n"
 "	isync			\n"
 "	li	%r8,0x1ffe	\n"	/* map the lowest 256MB */
@@ -86,13 +93,61 @@ __asm(
 "	mtibatl	3,%r9		\n"
 "	mtibatu	3,%r8		\n"
 "	isync			\n"
-
+"	b	3f		\n"
+"\n"
+"2:	mfmsr	%r8		\n"	/* 601 BAT */
+"	mtmsr	%r0		\n"
+"	isync			\n"
+"\n"
+"	mtibatu 0,%r0		\n"
+"	mtibatu 1,%r0		\n"
+"	mtibatu 2,%r0		\n"
+"	mtibatu 3,%r0		\n"
+"\n"
+"	li	%r9,0x7f	\n"
+"	mtibatl 0,%r9		\n"
+"	li	%r9,0x1a	\n"
+"	mtibatu 0,%r9		\n"
+"\n"
+"	lis %r9,0x80		\n"
+"	addi %r9,%r9,0x7f	\n"
+"	mtibatl 1,%r9		\n"
+"	lis %r9,0x80		\n"
+"	addi %r9,%r9,0x1a	\n"
+"	mtibatu 1,%r9		\n"
+"\n"
+"	lis %r9,0x100		\n"
+"	addi %r9,%r9,0x7f	\n"
+"	mtibatl 2,%r9		\n"
+"	lis %r9,0x100		\n"
+"	addi %r9,%r9,0x1a	\n"
+"	mtibatu 2,%r9		\n"
+"\n"
+"	lis %r9,0x180		\n"
+"	addi %r9,%r9,0x7f	\n"
+"	mtibatl 3,%r9		\n"
+"	lis %r9,0x180		\n"
+"	addi %r9,%r9,0x1a	\n"
+"	mtibatu 3,%r9		\n"
+"\n"
+"	isync			\n"
+"\n"
+"	mtmsr	%r8		\n"
+"	isync			\n"
+"\n"
 	/*
 	 * setup 32 KB of stack with 32 bytes overpad (see above)
 	 */
-"	lis	%r1,(stack+32768)@ha\n"
+"3:	lis	%r1,(stack+32768)@ha\n"
 "	addi	%r1,%r1,(stack+32768)@l\n"
-"	stw	%r0,0(%r1)	\n"	/* terminate the frame link chain */
+	/*
+	 * terminate the frame link chain,
+	 * clear by bytes to avoid ppc601 alignment exceptions
+	 */
+"	stb	%r0,0(%r1)	\n"
+"	stb	%r0,1(%r1)	\n"
+"	stb	%r0,2(%r1)	\n"
+"	stb	%r0,3(%r1)	\n"
 
 "	b	startup		\n"
 );
@@ -258,10 +313,14 @@ void
 startup(int arg1, int arg2, void *openfirm)
 {
 	int fd, blk, chosen, options, j;
+	uint32_t cpuvers;
 	size_t i;
 	char *addr;
 	char bootpath[128];
 
+	__asm volatile ("mfpvr %0" : "=r"(cpuvers));
+	cpuvers >>= 16;
+
 	openfirmware = openfirm;
 
 	chosen = OF_finddevice("/chosen");
@@ -302,17 +361,19 @@ startup(int arg1, int arg2, void *openfi
 	}
 	putstr(". done!\r\nstarting stage 2...\r\n");
 
-	/*
-	 * enable D/I cache
-	 */
-	__asm(
-		"mtdbatu	3,%0\n\t"
-		"mtdbatl	3,%1\n\t"
-		"mtibatu	3,%0\n\t"
-		"mtibatl	3,%1\n\t"
-		"isync"
-	   ::	"r"(BATU(0, BAT_BL_256M, BAT_Vs)),
-		"r"(BATL(0, 0, BAT_PP_RW)));
+	if (cpuvers != MPC601) {
+		/*
+		 * enable D/I cache
+		 */
+		__asm(
+			"mtdbatu	3,%0\n\t"
+			"mtdbatl	3,%1\n\t"
+			"mtibatu	3,%0\n\t"
+			"mtibatl	3,%1\n\t"
+			"isync"
+		::	"r"(BATU(0, BAT_BL_256M, BAT_Vs)),
+			"r"(BATL(0, 0, BAT_PP_RW)));
+	}
 
 	entry_point(0, 0, openfirm);
 	for (;;);			/* just in case */

Index: src/sys/arch/macppc/stand/ofwboot/Locore.c
diff -u src/sys/arch/macppc/stand/ofwboot/Locore.c:1.32 src/sys/arch/macppc/stand/ofwboot/Locore.c:1.33
--- src/sys/arch/macppc/stand/ofwboot/Locore.c:1.32	Fri Aug 17 16:04:39 2018
+++ src/sys/arch/macppc/stand/ofwboot/Locore.c	Mon Nov 12 20:00:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: Locore.c,v 1.32 2018/08/17 16:04:39 macallan Exp $	*/
+/*	$NetBSD: Locore.c,v 1.33 2018/11/12 20:00:46 scole Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -81,11 +81,11 @@ __asm(
 "\n" /* test for 601 */
 "	mfspr	%r0,287		\n" /* mfpvbr %r0 PVR = 287 */
 "	srwi	%r0,%r0,0x10	\n"
-"	cmpi	0,1,%r0,0x02	\n" /* 601 CPU = 0x0001 */
+"	cmplwi	%r0,0x02	\n" /* 601 CPU = 0x0001 */
 "	blt	2f		\n" /* skip over non-601 BAT setup */
-"	cmpi	0,1,%r0,0x39	\n" /* PPC970 */
+"	cmplwi	%r0,0x39	\n" /* PPC970 */
 "	blt	0f		\n"
-"	cmpi	0,1,%r0,0x45	\n" 

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

2018-04-26 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu Apr 26 18:06:25 UTC 2018

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

Log Message:
Update some of the _UC_MACHINE* macros even though gregs[] aren't tied to 
anything yet


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ia64/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/ia64/include/mcontext.h
diff -u src/sys/arch/ia64/include/mcontext.h:1.7 src/sys/arch/ia64/include/mcontext.h:1.8
--- src/sys/arch/ia64/include/mcontext.h:1.7	Tue Feb 27 09:51:28 2018
+++ src/sys/arch/ia64/include/mcontext.h	Thu Apr 26 18:06:25 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mcontext.h,v 1.7 2018/02/27 09:51:28 kamil Exp $	*/
+/*	$NetBSD: mcontext.h,v 1.8 2018/04/26 18:06:25 scole Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -111,11 +111,11 @@ typedef struct __mcontext {
 	__fpregset_t		__fpregs;
 } mcontext_t;
 
-#define _UC_MACHINE_SP(uc)	((uc)->uc_mcontext.mc_special.sp)
+#define _UC_MACHINE_SP(uc)	((uc)->uc_mcontext.mc_special.sp)  /* gregs[12] */
 #define _UC_MACHINE_FP(uc)	((uc)->uc_mcontext.__gregs[79])
-/* XXX or assembly "mov Rn = ip" or ...? */
 #define	_UC_MACHINE_PC(uc)	((uc)->uc_mcontext.mc_special.iip)
-#define	_UC_MACHINE_INTRV(uc)	0 /* XXX */
+#define	_UC_MACHINE_INTRV(uc)	((uc)->uc_mcontext.__gregs[8])
+#define _UC_MACHINE_SET_PC(uc)  _UC_MACHINE_PC(uc) = (pc)  /* XXX */
 
 static __inline void *
 __lwp_getprivate_fast(void)



CVS commit: src/share/man/man9

2018-04-26 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu Apr 26 14:59:11 UTC 2018

Modified Files:
src/share/man/man9: cpu_lwp_fork.9

Log Message:
Rename "cpu_switch" to "cpu_switchto"


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/share/man/man9/cpu_lwp_fork.9

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

Modified files:

Index: src/share/man/man9/cpu_lwp_fork.9
diff -u src/share/man/man9/cpu_lwp_fork.9:1.6 src/share/man/man9/cpu_lwp_fork.9:1.7
--- src/share/man/man9/cpu_lwp_fork.9:1.6	Fri Mar 10 15:30:45 2017
+++ src/share/man/man9/cpu_lwp_fork.9	Thu Apr 26 14:59:11 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: cpu_lwp_fork.9,v 1.6 2017/03/10 15:30:45 wiz Exp $
+.\" $NetBSD: cpu_lwp_fork.9,v 1.7 2018/04/26 14:59:11 scole Exp $
 .\"
 .\" Copyright (c) 2002, 2005, 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd March 10, 2017
+.Dd April 26, 2018
 .Dt CPU_LWP_FORK 9
 .Os
 .Sh NAME
@@ -58,7 +58,7 @@ rigs the child's kernel stack so that it
 .Fn lwp_trampoline .
 .Fn lwp_trampoline
 does not have a normal calling sequence and is entered by
-.Fn cpu_switch .
+.Fn cpu_switchto .
 If an alternate user-level stack is requested (with non-zero values
 in both the
 .Fa stack
@@ -67,7 +67,7 @@ and
 arguments), the user stack pointer is set up accordingly.
 .Pp
 After being entered by
-.Fn cpu_switch
+.Fn cpu_switchto
 and while running in user context (within the kernel)
 .Fn lwp_trampoline
 will invoke the function



CVS commit: src/sys/arch/ia64

2018-04-14 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Apr 14 20:21:09 UTC 2018

Added Files:
src/sys/arch/ia64: TODO

Log Message:
List some obvious remaining items to-do


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/ia64/TODO

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/ia64/TODO
diff -u /dev/null src/sys/arch/ia64/TODO:1.1
--- /dev/null	Sat Apr 14 20:21:09 2018
+++ src/sys/arch/ia64/TODO	Sat Apr 14 20:21:09 2018
@@ -0,0 +1,63 @@
+$ NetBSD: TODO,v 1.1 2018/04/14 12:06:03 scole Exp $
+
+What works:
+  The ski simulator (pkgsrc/emulators/ski) works on NetBSD, can run
+  and step through in assembly.
+
+  Netbooting may work on some machines, basically you need to boot
+  diskless with the loader.efi (from src/sys/arch/ia64/stand/ia64/)
+  using dhcpd and put the kernel in a nfs accessible directory.  There
+  is info here https://www.netbsd.org/docs/network/netboot/ and
+  http://gnats.netbsd.org/49717 about how to setup.
+
+  Also, a successful report of booting off the CD is here
+  http://mail-index.netbsd.org/port-ia64/2009/06/18/msg000102.html
+
+Tasks remaining, first couple seem most important:
+
+- context switching and forking appear unfinished,
+  vm_machdep.c::cpu_lwp_fork() appears incomplete
+- pmap module, imported from freebsd but still needs more work and
+  testing
+- IA64 Stack unwind code: Support remaining unwind descriptor
+  types. (See arch/ia64/unwind/TODO). ddb() traces need to print line
+  information also.  Seems like a lot of this could be re-used
+  from freebsd
+- redo _regset.h in netbsd style with __greg_t __gregset_t
+- some commands in ski are not yet implemented, 2 important ones
+  are still missing, "cstack" and "pm", which view the stack and
+  source code lines respectively 
+- create a ski network driver
+- create a ski disk driver
+- implement ld.elf_so, MK_DYNAMICROOT
+- fix memory detection, on real hardware doesn't find all memory
+- implement interrupts (sacpi & pci), can be mostly from freebsd?
+- MKLINT and MKGDB for ia64?
+- implement fp[gs]etsticky, [make|get|set|swap]context
+- floating point, fenv functions were imported from freebsd, but haven't been tested
+- implement core_machdep.c
+- implement __cloneS ptrace.S sbrk.S shmat.S
+- implement kvm_ia64.c
+- implement pmc (performance monitoring counters) for ia64 pmc registers
+- optional(?) mutex.h/lock_stubs.S, mutex_enter()/mutex_exit() __HAVE_MUTEX_STUBS
+   mutex_spin_enter()/mutex_spin_exit() __HAVE_SPIN_MUTEX_STUBS
+- rwlock.h rw_enter(),rw_exit(),rw_tryenter() __HAVE_RW_STUBS, implemented already?
+- add efipart_dev to read gpt/ffs disks for bootloader
+- fix printf of lx in bootloader/libsa ?
+- sort out bootloader/loader.efi stuff, is freebsd one good enough or
+  do we want commands more like netbsd i386 bootloader? e.g., add
+  command to boot nfs from loader.efi instead of hack now
+- ia64 implement __HAVE_FAST_SOFTINTS?
+- fix all "[Nn]ot yet" and "XXX" functions everywhere
+- create/fix sys/arch/ia64/include/pci_machdep.h and implement actual functions,
+  need to handle "multiple" pci busses like from http://www.openpa.net/systems/il/rp3400-bus.txt,
+  add pchb, looks like one here
+   http://mail-index.netbsd.org/port-ia64/2010/06/29/msg000116.html
+  and/or could port from freebsd
+- Kernel module pre-loading via the bootloader
+- SMP
+- write console and/or X framebuffer driver.  freebsd has vgapci
+  device that may be portable
+- add ia32 emulation, port from freebsd
+- add rump stuff/MKRUMP
+- create install EFI/cdrom/netbsd



CVS commit: src/sys/arch/ia64/ia64

2018-04-14 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Apr 14 19:58:20 UTC 2018

Modified Files:
src/sys/arch/ia64/ia64: vm_machdep.c

Log Message:
Add XXX note regarding incomplete forking


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/ia64/ia64/vm_machdep.c

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/ia64/ia64/vm_machdep.c
diff -u src/sys/arch/ia64/ia64/vm_machdep.c:1.13 src/sys/arch/ia64/ia64/vm_machdep.c:1.14
--- src/sys/arch/ia64/ia64/vm_machdep.c:1.13	Sat Apr  8 17:38:43 2017
+++ src/sys/arch/ia64/ia64/vm_machdep.c	Sat Apr 14 19:58:20 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.13 2017/04/08 17:38:43 scole Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.14 2018/04/14 19:58:20 scole Exp $	*/
 
 /*
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -133,6 +133,14 @@ cpu_lwp_fork(struct lwp *l1, struct lwp 
 		KASSERT(l1 == );
 	}
 
+	/*
+	 * XXX this seems incomplete, each thread apparently needs its
+	 * own stack and bspstore, and to re-adjust the RSE "ndirty"
+	 * registers.  See
+	 * http://fxr.watson.org/fxr/source/ia64/ia64/vm_machdep.c?v=FREEBSD10#L262
+	 * Also should verify u-area usage is consistent, which may be
+	 * different than freebsd.
+	 */
 	*pcb2 = *pcb1;
 
 	l2->l_md.md_flags = l1->l_md.md_flags;



CVS commit: src/sys/dev/acpi

2018-03-04 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sun Mar  4 16:34:20 UTC 2018

Modified Files:
src/sys/dev/acpi: acpi.c

Log Message:
Use "#if NPCI > 0" instead of "#ifdef NPCI" for compiling kernels with acpi, 
without pci.


To generate a diff of this commit:
cvs rdiff -u -r1.267 -r1.268 src/sys/dev/acpi/acpi.c

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

Modified files:

Index: src/sys/dev/acpi/acpi.c
diff -u src/sys/dev/acpi/acpi.c:1.267 src/sys/dev/acpi/acpi.c:1.268
--- src/sys/dev/acpi/acpi.c:1.267	Sat Mar  3 11:23:24 2018
+++ src/sys/dev/acpi/acpi.c	Sun Mar  4 16:34:20 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.267 2018/03/03 11:23:24 maya Exp $	*/
+/*	$NetBSD: acpi.c,v 1.268 2018/03/04 16:34:20 scole Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.267 2018/03/03 11:23:24 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.268 2018/03/04 16:34:20 scole Exp $");
 
 #include "pci.h"
 #include "opt_acpi.h"
@@ -488,7 +488,7 @@ acpi_attach(device_t parent, device_t se
 	 */
 	acpi_build_tree(sc);
 
-#ifdef NPCI
+#if NPCI > 0
 	/*
 	 * Probe MCFG table
 	 */



CVS commit: src/sys/arch/ia64

2018-03-01 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu Mar  1 23:01:19 UTC 2018

Modified Files:
src/sys/arch/ia64/include: pci_machdep.h
src/sys/arch/ia64/pci: pci_machdep.c

Log Message:
Remove empty pci_enumerate_bus() stub specific for ia64.  I think it was 
originally added to allow acpi compilation with pci, which appears to no longer 
be an issue.

PCI will need to be revisited for ia64 at some point.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/include/pci_machdep.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/ia64/pci/pci_machdep.c

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/ia64/include/pci_machdep.h
diff -u src/sys/arch/ia64/include/pci_machdep.h:1.3 src/sys/arch/ia64/include/pci_machdep.h:1.4
--- src/sys/arch/ia64/include/pci_machdep.h:1.3	Fri Aug  5 17:01:56 2016
+++ src/sys/arch/ia64/include/pci_machdep.h	Thu Mar  1 23:01:19 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.h,v 1.3 2016/08/05 17:01:56 scole Exp $	*/
+/*	$NetBSD: pci_machdep.h,v 1.4 2018/03/01 23:01:19 scole Exp $	*/
 /*
  * Copyright (c) 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -42,13 +42,4 @@ void pci_decompose_tag(pci_chipset_tag_t
 pcireg_t pci_conf_read(pci_chipset_tag_t, pcitag_t, int);
 void pci_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t);
 
-/*
- * XXX should ia64_pci_enumerate_bus and
- *  #define PCI_MACHDEP_ENUMERATE_BUS ia64_pci_enumerate_bus
- * be used? acpi_pci appears to require pci_enumerate_bus though.
- */
-int pci_enumerate_bus(struct pci_softc *, const int *,
-		  int (*)(const struct pci_attach_args *),
-		  struct pci_attach_args *);
-
 #endif

Index: src/sys/arch/ia64/pci/pci_machdep.c
diff -u src/sys/arch/ia64/pci/pci_machdep.c:1.5 src/sys/arch/ia64/pci/pci_machdep.c:1.6
--- src/sys/arch/ia64/pci/pci_machdep.c:1.5	Fri Aug  5 17:04:52 2016
+++ src/sys/arch/ia64/pci/pci_machdep.c	Thu Mar  1 23:01:19 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.5 2016/08/05 17:04:52 scole Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.6 2018/03/01 23:01:19 scole Exp $	*/
 /*
  * Copyright (c) 2009, 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.5 2016/08/05 17:04:52 scole Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.6 2018/03/01 23:01:19 scole Exp $");
 
 #include 
 #include 
@@ -102,13 +102,3 @@ pci_conf_write(pci_chipset_tag_t pc, pci
 	if (res.sal_status < 0)
 		printf("pci configuration write failed\n");
 }
-
-int
-pci_enumerate_bus(struct pci_softc *sc, const int *locators,
-		  int (*match)(const struct pci_attach_args *), struct pci_attach_args *pap)
-{
-	/* XXX implement */
-	panic("ia64 pci_enumerate_bus not implemented");
-
-	return -1;
-}



CVS commit: src/sys/arch/ia64

2017-12-13 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Wed Dec 13 16:50:46 UTC 2017

Modified Files:
src/sys/arch/ia64/ia64: interrupt.c
src/sys/arch/ia64/include: intr.h

Log Message:
add intr_string() stub for acpi_util.c:acpi_intr_string() so kernel will still 
compile


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ia64/ia64/interrupt.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/ia64/include/intr.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/ia64/ia64/interrupt.c
diff -u src/sys/arch/ia64/ia64/interrupt.c:1.7 src/sys/arch/ia64/ia64/interrupt.c:1.8
--- src/sys/arch/ia64/ia64/interrupt.c:1.7	Sat Apr  8 17:44:27 2017
+++ src/sys/arch/ia64/ia64/interrupt.c	Wed Dec 13 16:50:46 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: interrupt.c,v 1.7 2017/04/08 17:44:27 scole Exp $ */
+/* $NetBSD: interrupt.c,v 1.8 2017/12/13 16:50:46 scole Exp $ */
 
 /*-
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -33,7 +33,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.7 2017/04/08 17:44:27 scole Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.8 2017/12/13 16:50:46 scole Exp $");
 
 #include "opt_ddb.h"
 
@@ -382,4 +382,10 @@ db_print_vector(u_int vector, int always
 	} else if (always)
 		db_printf("vector %u: unassigned\n", vector);
 }
+
+const char *
+intr_string(intr_handle_t ih, char *buf, size_t len)
+{
+	panic("XXX %s not implemented", __func__);
+}
 #endif

Index: src/sys/arch/ia64/include/intr.h
diff -u src/sys/arch/ia64/include/intr.h:1.6 src/sys/arch/ia64/include/intr.h:1.7
--- src/sys/arch/ia64/include/intr.h:1.6	Sat Apr  8 18:02:21 2017
+++ src/sys/arch/ia64/include/intr.h	Wed Dec 13 16:50:46 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.6 2017/04/08 18:02:21 scole Exp $	*/
+/*	$NetBSD: intr.h,v 1.7 2017/12/13 16:50:46 scole Exp $	*/
 
 /* XXX: cherry: To Be fixed when we switch on interrupts. */
 
@@ -67,6 +67,10 @@ extern uint64_t ia64_lapic_address;
 #define IA64_INTERRUPT_BLOCK \
 	(struct ia64_interrupt_block *)IA64_PHYS_TO_RR6(ia64_lapic_address)
 
+/* XXX acpi */
+typedef uint64_t intr_handle_t;
+const char *intr_string(intr_handle_t, char *, size_t);
+
 void *intr_establish(int, int, int, int (*)(void *), void *);
 void intr_disestablish(void *);
 void ia64_handle_intr(void *);



CVS commit: src/share/man/man4

2017-09-02 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Sep  2 21:27:08 UTC 2017

Modified Files:
src/share/man/man4: mc.4

Log Message:
Add powermac 7200 to list of supported hardware


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/mc.4

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

Modified files:

Index: src/share/man/man4/mc.4
diff -u src/share/man/man4/mc.4:1.5 src/share/man/man4/mc.4:1.6
--- src/share/man/man4/mc.4:1.5	Wed Jun  1 08:14:42 2016
+++ src/share/man/man4/mc.4	Sat Sep  2 21:27:08 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mc.4,v 1.5 2016/06/01 08:14:42 wiz Exp $
+.\"	$NetBSD: mc.4,v 1.6 2017/09/02 21:27:08 scole Exp $
 .\"
 .\" Copyright (c) 1997 David Huang 
 .\" All rights reserved.
@@ -22,7 +22,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd June 1, 2016
+.Dd September 2, 2017
 .Dt MC 4
 .Os
 .Sh NAME
@@ -55,7 +55,7 @@ interface supports the on-board Ethernet
 .It
 Apple Network Server (500 and 700)
 .It
-Apple Power Macintosh (7300, 7500, 7600, 8500, 8600, 9500, and 9600)
+Apple Power Macintosh (7200, 7300, 7500, 7600, 8500, 8600, 9500, and 9600)
 .It
 Power Computing (PowerCenter, PowerCenter Pro, PowerCurve,
 PowerTower, PowerTower Pro, and PowerWave)



CVS commit: src/doc

2017-04-09 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sun Apr  9 19:02:23 UTC 2017

Modified Files:
src/doc: HACKS

Log Message:
Add ia64 ski emulator hack


To generate a diff of this commit:
cvs rdiff -u -r1.186 -r1.187 src/doc/HACKS

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

Modified files:

Index: src/doc/HACKS
diff -u src/doc/HACKS:1.186 src/doc/HACKS:1.187
--- src/doc/HACKS:1.186	Sat Mar 11 09:12:13 2017
+++ src/doc/HACKS	Sun Apr  9 19:02:23 2017
@@ -1,4 +1,4 @@
-# $NetBSD: HACKS,v 1.186 2017/03/11 09:12:13 maya Exp $
+# $NetBSD: HACKS,v 1.187 2017/04/09 19:02:23 scole Exp $
 #
 # This file is intended to document workarounds for currently unsolved
 # (mostly) compiler bugs.
@@ -937,3 +937,13 @@ desc 	asn1_krb5_asn1.po does not produce
 	compilation runs; it is bimodal. Turning optimization to -O0 fixes
 	the issue
 kcah
+
+port	ia64
+hack	ski emulator crashes
+who	scole
+file	/cvsroot/src/sys/external/bsd/acpica/dist/tables/tbxfload.c: 1.6
+desc
+	ski emulator crashes during acpi detection.  Added a check for
+	uninitialized index.  Submitted a request for change with upstream
+	mailing list, but never got a response
+kcah



CVS commit: src/sys/arch/ia64/ia64

2017-04-08 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Apr  8 20:59:27 UTC 2017

Modified Files:
src/sys/arch/ia64/ia64: pmap.c

Log Message:
Fix a possible infinite loop in pmap_kremove()


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/ia64/ia64/pmap.c

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/ia64/ia64/pmap.c
diff -u src/sys/arch/ia64/ia64/pmap.c:1.35 src/sys/arch/ia64/ia64/pmap.c:1.36
--- src/sys/arch/ia64/ia64/pmap.c:1.35	Sat Apr  8 18:08:33 2017
+++ src/sys/arch/ia64/ia64/pmap.c	Sat Apr  8 20:59:27 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.35 2017/04/08 18:08:33 scole Exp $ */
+/* $NetBSD: pmap.c,v 1.36 2017/04/08 20:59:27 scole Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -81,7 +81,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.35 2017/04/08 18:08:33 scole Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.36 2017/04/08 20:59:27 scole Exp $");
 
 #include 
 #include 
@@ -2110,11 +2110,12 @@ void
 pmap_kremove(vaddr_t va, vsize_t size)
 {
 	struct ia64_lpte *pte;
-
+	vaddr_t eva = va + size;
+	
 	UVMHIST_FUNC(__func__); UVMHIST_CALLED(maphist);
 	UVMHIST_LOG(maphist, "(va=%#lx)", va, 0, 0, 0);
 
-	while (size > 0) {
+	while (va < eva) {
 		pte = pmap_find_kpte(va);
 		if (pmap_present(pte)) {
 			KASSERT(pmap_managed(pte) != 0);
@@ -2123,7 +2124,6 @@ pmap_kremove(vaddr_t va, vsize_t size)
 			pmap_clear_present(pte);
 		}
 		va += PAGE_SIZE;
-		size -= PAGE_SIZE;
 	}
 }
 



CVS commit: src/sys/external/bsd/acpica/dist/tables

2017-04-08 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Apr  8 18:10:43 UTC 2017

Modified Files:
src/sys/external/bsd/acpica/dist/tables: tbxfload.c

Log Message:
Add #ifdef so ski emulator won't crash.  This change probably wouldn't
hurt other archs, but just apply to ia64 to be safe.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/acpica/dist/tables/tbxfload.c

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

Modified files:

Index: src/sys/external/bsd/acpica/dist/tables/tbxfload.c
diff -u src/sys/external/bsd/acpica/dist/tables/tbxfload.c:1.5 src/sys/external/bsd/acpica/dist/tables/tbxfload.c:1.6
--- src/sys/external/bsd/acpica/dist/tables/tbxfload.c:1.5	Wed Jan 25 13:38:22 2017
+++ src/sys/external/bsd/acpica/dist/tables/tbxfload.c	Sat Apr  8 18:10:43 2017
@@ -163,6 +163,17 @@ AcpiTbLoadNamespace (
 
 (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
 
+#ifdef __ia64__
+/*
+ * For ia64 ski emulator
+ */
+if (AcpiGbl_DsdtIndex == ACPI_INVALID_TABLE_INDEX)
+{
+Status = AE_NO_ACPI_TABLES;
+goto UnlockAndExit;
+}
+#endif
+
 /*
  * Load the namespace. The DSDT is required, but any SSDT and
  * PSDT tables are optional. Verify the DSDT.



CVS commit: src/sys/arch/ia64

2017-04-08 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Apr  8 18:08:33 UTC 2017

Modified Files:
src/sys/arch/ia64/ia64: pmap.c
src/sys/arch/ia64/include: pmap.h

Log Message:
Attempted port over from FreeBSD with suggestions from .  Still
more work needed, but at least now the ski simulator and hardware die
at the same place.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/ia64/ia64/pmap.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ia64/include/pmap.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/ia64/ia64/pmap.c
diff -u src/sys/arch/ia64/ia64/pmap.c:1.34 src/sys/arch/ia64/ia64/pmap.c:1.35
--- src/sys/arch/ia64/ia64/pmap.c:1.34	Fri Dec 23 17:26:43 2016
+++ src/sys/arch/ia64/ia64/pmap.c	Sat Apr  8 18:08:33 2017
@@ -1,5 +1,4 @@
-/* $NetBSD: pmap.c,v 1.34 2016/12/23 17:26:43 scole Exp $ */
-
+/* $NetBSD: pmap.c,v 1.35 2017/04/08 18:08:33 scole Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -80,18 +79,18 @@
 
 /* __FBSDID("$FreeBSD: src/sys/ia64/ia64/pmap.c,v 1.172 2005/11/20 06:09:48 alc Exp $"); */
 
-
-/* XXX: This module is a mess. Need to clean up Locking, list traversal. etc... */
-
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.34 2016/12/23 17:26:43 scole Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.35 2017/04/08 18:08:33 scole Exp $");
 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -99,47 +98,158 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.3
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
+#include 
+
+/*
+ *	Manages physical address maps.
+ *
+ *	Since the information managed by this module is
+ *	also stored by the logical address mapping module,
+ *	this module may throw away valid virtual-to-physical
+ *	mappings at almost any time.  However, invalidations
+ *	of virtual-to-physical mappings must be done as
+ *	requested.
+ *
+ *	In order to cope with hardware architectures which
+ *	make virtual-to-physical map invalidates expensive,
+ *	this module may delay invalidate or reduced protection
+ *	operations until such time as they are actually
+ *	necessary.  This module is given full information as
+ *	to which processors are currently using which maps,
+ *	and to when physical maps must be made correct.
+ */
+
+/*
+ * Following the Linux model, region IDs are allocated in groups of
+ * eight so that a single region ID can be used for as many RRs as we
+ * want by encoding the RR number into the low bits of the ID.
+ *
+ * We reserve region ID 0 for the kernel and allocate the remaining
+ * IDs for user pmaps.
+ *
+ * Region 0-3:	User virtually mapped
+ * Region 4:	PBVM and special mappings
+ * Region 5:	Kernel virtual memory
+ * Region 6:	Direct-mapped uncacheable
+ * Region 7:	Direct-mapped cacheable
+ */
+
+#if !defined(DIAGNOSTIC)
+#define PMAP_INLINE __inline
+#else
+#define PMAP_INLINE
+#endif
+
+#ifdef PV_STATS
+#define PV_STAT(x)	do { x ; } while (0)
+#else
+#define PV_STAT(x)	do { } while (0)
+#endif
+
+#define	pmap_accessed(lpte)		((lpte)->pte & PTE_ACCESSED)
+#define	pmap_dirty(lpte)		((lpte)->pte & PTE_DIRTY)
+#define	pmap_exec(lpte)			((lpte)->pte & PTE_AR_RX)
+#define	pmap_managed(lpte)		((lpte)->pte & PTE_MANAGED)
+#define	pmap_ppn(lpte)			((lpte)->pte & PTE_PPN_MASK)
+#define	pmap_present(lpte)		((lpte)->pte & PTE_PRESENT)
+#define	pmap_prot(lpte)			(((lpte)->pte & PTE_PROT_MASK) >> 56)
+#define	pmap_wired(lpte)		((lpte)->pte & PTE_WIRED)
+
+#define	pmap_clear_accessed(lpte)	(lpte)->pte &= ~PTE_ACCESSED
+#define	pmap_clear_dirty(lpte)		(lpte)->pte &= ~PTE_DIRTY
+#define	pmap_clear_present(lpte)	(lpte)->pte &= ~PTE_PRESENT
+#define	pmap_clear_wired(lpte)		(lpte)->pte &= ~PTE_WIRED
+
+#define	pmap_set_wired(lpte)		(lpte)->pte |= PTE_WIRED
+
+/*
+ * Individual PV entries are stored in per-pmap chunks.  This saves
+ * space by eliminating the need to record the pmap within every PV
+ * entry.
+ */
+#if PAGE_SIZE == 8192
+#define	_NPCM	6
+#define	_NPCPV	337
+#define	_NPCS	2
+#elif PAGE_SIZE == 16384
+#define	_NPCM	11
+#define	_NPCPV	677
+#define	_NPCS	1
+#else
+#error "invalid page size"
+#endif
+
+struct pv_chunk {
+	pmap_t			pc_pmap;
+	TAILQ_ENTRY(pv_chunk)	pc_list;
+	u_long			pc_map[_NPCM];	/* bitmap; 1 = free */
+	TAILQ_ENTRY(pv_chunk)	pc_lru;
+	u_long			pc_spare[_NPCS];
+	struct pv_entry		pc_pventry[_NPCPV];
+};
+
+/*
+ * The VHPT bucket head structure.
+ */
+struct ia64_bucket {
+	uint64_t	chain;
+	kmutex_t	mutex;
+	u_int		length;
+};
+
+/*
+ * Statically allocated kernel pmap
+ */
+static struct pmap kernel_pmap_store;/* the kernel's pmap (proc0) */
+struct pmap *const kernel_pmap_ptr = _pmap_store;
 
+vaddr_t virtual_avail;	/* VA of first avail page (after kernel bss) */
+vaddr_t virtual_end;	/* VA of last avail page (end of kernel AS) */
+
+/* XXX freebsd, needs to be sorted out */

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

2017-04-08 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Apr  8 18:05:36 UTC 2017

Modified Files:
src/sys/arch/ia64/include: vmparam.h

Log Message:
Add VM_INIT_KERNEL_ADDRESS from FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/ia64/include/vmparam.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/ia64/include/vmparam.h
diff -u src/sys/arch/ia64/include/vmparam.h:1.9 src/sys/arch/ia64/include/vmparam.h:1.10
--- src/sys/arch/ia64/include/vmparam.h:1.9	Sat Aug  6 21:13:30 2016
+++ src/sys/arch/ia64/include/vmparam.h	Sat Apr  8 18:05:36 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.9 2016/08/06 21:13:30 martin Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.10 2017/04/08 18:05:36 scole Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -131,6 +131,9 @@
 #define	IA64_ID_PAGE_SIZE	(1 << IA64_ID_PAGE_SHIFT)
 #define	IA64_ID_PAGE_MASK	(IA64_ID_PAGE_SIZE-1)
 
+/* XXX freebsd uses
+#define IA64_BACKINGSTORE   (USRSTACK - (2 * MAXSSIZ) - PAGE_SIZE)
+*/
 #define	IA64_BACKINGSTORE	IA64_RR_BASE(4)
 
 #define	PAGE_SHIFT	14		/* 16K pages by default. */
@@ -143,6 +146,7 @@
 #define	VM_GATEWAY_SIZE		PAGE_SIZE
 #define	VM_MAXUSER_ADDRESS	(VM_MAX_ADDRESS + VM_GATEWAY_SIZE)
 #define	VM_MIN_KERNEL_ADDRESS	VM_MAXUSER_ADDRESS
+#define VM_INIT_KERNEL_ADDRESS  IA64_RR_BASE(IA64_VM_MINKERN_REGION + 1)
 #define VM_MAX_KERNEL_ADDRESS	((vaddr_t) (IA64_RR_BASE(6) - 1))
 
 #define VM_PHYSSEG_MAX		16		/* XXX: */



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

2017-04-08 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Apr  8 18:04:35 UTC 2017

Modified Files:
src/sys/arch/ia64/include: pcb.h

Log Message:
Make restorectx() and swapctx() match original FreeBSD defs


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/include/pcb.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/ia64/include/pcb.h
diff -u src/sys/arch/ia64/include/pcb.h:1.2 src/sys/arch/ia64/include/pcb.h:1.3
--- src/sys/arch/ia64/include/pcb.h:1.2	Thu Mar 20 09:09:20 2008
+++ src/sys/arch/ia64/include/pcb.h	Sat Apr  8 18:04:34 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcb.h,v 1.2 2008/03/20 09:09:20 kochi Exp $	*/
+/*	$NetBSD: pcb.h,v 1.3 2017/04/08 18:04:34 scole Exp $	*/
 
 /*-
  * Copyright (c) 2003,2004 Marcel Moolenaar
@@ -67,8 +67,9 @@ struct pcb {
 struct trapframe;
 
 void makectx(struct trapframe *, struct pcb *);
-/*void restorectx(struct pcb *) __dead2;*/
-int swapctx(struct pcb *old, struct pcb *new);
+/* XXX not sure about the attributes, for now use equivalent to freebsd */
+void restorectx(struct pcb *) __attribute__ ((__noreturn__)); /* same as __dead2? */
+int swapctx(struct pcb *old, struct pcb *new) __returns_twice;
 
 void ia32_restorectx(struct pcb *);
 void ia32_savectx(struct pcb *);



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

2017-04-08 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Apr  8 18:03:33 UTC 2017

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

Log Message:
Add more defs from FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/ia64/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/ia64/include/param.h
diff -u src/sys/arch/ia64/include/param.h:1.8 src/sys/arch/ia64/include/param.h:1.9
--- src/sys/arch/ia64/include/param.h:1.8	Fri Feb 10 17:35:49 2012
+++ src/sys/arch/ia64/include/param.h	Sat Apr  8 18:03:33 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.8 2012/02/10 17:35:49 para Exp $	*/
+/*	$NetBSD: param.h,v 1.9 2017/04/08 18:03:33 scole Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -80,6 +80,9 @@
 #define ALIGNBYTES32		(sizeof(int) - 1)
 #define ALIGN32(p)		(((u_long)(p) + ALIGNBYTES32) &~ALIGNBYTES32)
 
+#ifndef LOG2_PAGE_SIZE
+#define LOG2_PAGE_SIZE  14  /* 16K pages by default. */
+#endif
 #define	PGSHIFT		14		/* LOG2(NBPG) */
 #define	NBPG		(1 << PGSHIFT)	/* bytes/page */
 #define	PGOFSET		(NBPG-1)	/* byte offset into page */
@@ -108,6 +111,11 @@
 #define	NKMEMPAGES_MIN_DEFAULT	((32 * 1024 * 1024) >> PAGE_SHIFT)
 #define	NKMEMPAGES_MAX_UNLIMITED 1
 
+/* The default size of identity mappings in region 6 & 7. */
+#ifndef LOG2_ID_PAGE_SIZE
+#define LOG2_ID_PAGE_SIZE   16
+#endif
+
 /*
  * Mach derived conversion macros
  */



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

2017-04-08 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Apr  8 18:02:55 UTC 2017

Modified Files:
src/sys/arch/ia64/include: md_var.h

Log Message:
Add more funcs from FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/ia64/include/md_var.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/ia64/include/md_var.h
diff -u src/sys/arch/ia64/include/md_var.h:1.1 src/sys/arch/ia64/include/md_var.h:1.2
--- src/sys/arch/ia64/include/md_var.h:1.1	Fri Apr  7 14:21:18 2006
+++ src/sys/arch/ia64/include/md_var.h	Sat Apr  8 18:02:55 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: md_var.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
+/*	$NetBSD: md_var.h,v 1.2 2017/04/08 18:02:55 scole Exp $	*/
 
 /*-
  * Copyright (c) 1998 Doug Rabson
@@ -83,13 +83,14 @@ void	ia64_probe_sapics(void);
 int	interrupt(uint64_t, struct trapframe *);
 void	map_gateway_page(void);
 void	map_pal_code(void);
+void	map_vhpt(uintptr_t);
 void	os_boot_rendez(void);
 void	os_mca(void);
 int	syscall(struct trapframe *);
 void	trap(int, struct trapframe *);
 void	trap_panic(int, struct trapframe *);
 int	unaligned_fixup(struct trapframe *, struct thread *);
-
+void	ia64_sync_icache(vaddr_t, vaddr_t);
 #endif	/* _KERNEL */
 
 #endif /* !_IA64_MD_VAR_H_ */



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

2017-04-08 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Apr  8 18:02:21 UTC 2017

Modified Files:
src/sys/arch/ia64/include: intr.h

Log Message:
Add ia64_handle_intr() declaration


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/ia64/include/intr.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/ia64/include/intr.h
diff -u src/sys/arch/ia64/include/intr.h:1.5 src/sys/arch/ia64/include/intr.h:1.6
--- src/sys/arch/ia64/include/intr.h:1.5	Mon Jul 20 06:14:15 2009
+++ src/sys/arch/ia64/include/intr.h	Sat Apr  8 18:02:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.5 2009/07/20 06:14:15 kiyohara Exp $	*/
+/*	$NetBSD: intr.h,v 1.6 2017/04/08 18:02:21 scole Exp $	*/
 
 /* XXX: cherry: To Be fixed when we switch on interrupts. */
 
@@ -69,5 +69,6 @@ extern uint64_t ia64_lapic_address;
 
 void *intr_establish(int, int, int, int (*)(void *), void *);
 void intr_disestablish(void *);
+void ia64_handle_intr(void *);
 
 #endif /* ! _IA64_INTR_H_ */



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

2017-04-08 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Apr  8 18:01:22 UTC 2017

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

Log Message:
Add ci_vhpt to cpu_info


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/ia64/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/ia64/include/cpu.h
diff -u src/sys/arch/ia64/include/cpu.h:1.15 src/sys/arch/ia64/include/cpu.h:1.16
--- src/sys/arch/ia64/include/cpu.h:1.15	Wed Feb  8 18:01:12 2017
+++ src/sys/arch/ia64/include/cpu.h	Sat Apr  8 18:01:22 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.15 2017/02/08 18:01:12 christos Exp $	*/
+/*	$NetBSD: cpu.h,v 1.16 2017/04/08 18:01:22 scole Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -102,7 +102,7 @@ struct cpu_info {
 	cpuid_t ci_cpuid;		/* our CPU ID */
 	uint32_t ci_acpiid;		/* our ACPI/MADT ID */
 	uint32_t ci_initapicid;		/* our intitial APIC ID */
-	struct pmap *ci_pmap;		/* current pmap */
+	struct pmap *ci_pmap;		/* current pmap */ /* XXX FreeBSD has *pcb_current_pmap in pcb ? */
 	struct lwp *ci_fpcurlwp;	/* current owner of the FPU */
 	paddr_t ci_curpcb;		/* PA of current HW PCB */
 	struct pcb *ci_idle_pcb;	/* our idle PCB */
@@ -111,6 +111,7 @@ struct cpu_info {
 	struct trapframe *ci_db_regs;	/* registers for debuggers */
 	uint64_t ci_clock;		/* clock counter */
 	uint64_t ci_clockadj;		/* clock adjust */
+	uint64_t ci_vhpt;		/* address of vhpt */
 };
 
 



CVS commit: src/sys/arch/ia64/ia64

2017-04-08 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Apr  8 17:47:14 UTC 2017

Modified Files:
src/sys/arch/ia64/ia64: trap.c

Log Message:
Add include and panic in startlwp()


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/ia64/ia64/trap.c

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/ia64/ia64/trap.c
diff -u src/sys/arch/ia64/ia64/trap.c:1.13 src/sys/arch/ia64/ia64/trap.c:1.14
--- src/sys/arch/ia64/ia64/trap.c:1.13	Mon Mar 10 13:47:45 2014
+++ src/sys/arch/ia64/ia64/trap.c	Sat Apr  8 17:47:14 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.13 2014/03/10 13:47:45 martin Exp $ */
+/* $NetBSD: trap.c,v 1.14 2017/04/08 17:47:14 scole Exp $ */
 
 /*-
  * Copyright (c) 2005 Marcel Moolenaar
@@ -61,7 +61,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.13 2014/03/10 13:47:45 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.14 2017/04/08 17:47:14 scole Exp $");
 
 #include 
 #include 
@@ -74,6 +74,7 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.1
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #ifdef DDB
@@ -319,8 +320,7 @@ trap_decode_break(struct trapframe *tf)
 void
 startlwp(void *arg)
 {
-printf("%s: not yet\n", __func__);
-	return;
+	panic("XXX %s implement", __func__);
 }
 
 #ifdef DDB



CVS commit: src/sys/arch/ia64/ia64

2017-04-08 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Apr  8 17:46:30 UTC 2017

Modified Files:
src/sys/arch/ia64/ia64: syscall_stubs.S

Log Message:
Add vmparam.h include


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/ia64/syscall_stubs.S

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/ia64/ia64/syscall_stubs.S
diff -u src/sys/arch/ia64/ia64/syscall_stubs.S:1.3 src/sys/arch/ia64/ia64/syscall_stubs.S:1.4
--- src/sys/arch/ia64/ia64/syscall_stubs.S:1.3	Mon Jul 20 04:41:37 2009
+++ src/sys/arch/ia64/ia64/syscall_stubs.S	Sat Apr  8 17:46:30 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall_stubs.S,v 1.3 2009/07/20 04:41:37 kiyohara Exp $	*/
+/*	$NetBSD: syscall_stubs.S,v 1.4 2017/04/08 17:46:30 scole Exp $	*/
 
 	/*-
  * Copyright (c) 2002, 2003 Marcel Moolenaar
@@ -33,7 +33,6 @@
 
 
 #include 
-#include 
 #undef VM_MAX_ADDRESS
 
 #include "assym.h"



CVS commit: src/sys/arch/ia64/ia64

2017-04-08 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Apr  8 17:46:01 UTC 2017

Modified Files:
src/sys/arch/ia64/ia64: machdep.c

Log Message:
Add more from FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/ia64/ia64/machdep.c

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/ia64/ia64/machdep.c
diff -u src/sys/arch/ia64/ia64/machdep.c:1.37 src/sys/arch/ia64/ia64/machdep.c:1.38
--- src/sys/arch/ia64/ia64/machdep.c:1.37	Fri Dec 23 07:15:27 2016
+++ src/sys/arch/ia64/ia64/machdep.c	Sat Apr  8 17:46:01 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.37 2016/12/23 07:15:27 cherry Exp $	*/
+/*	$NetBSD: machdep.c,v 1.38 2017/04/08 17:46:01 scole Exp $	*/
 
 /*-
  * Copyright (c) 2003,2004 Marcel Moolenaar
@@ -142,8 +142,10 @@ uint64_t processor_frequency;
 uint64_t bus_frequency;
 uint64_t itc_frequency;
 uint64_t ia64_pal_base;
+uint64_t ia64_pal_size;
 uint64_t ia64_port_base;
 
+int ia64_sync_icache_needed = 0;
 
 extern uint64_t ia64_gateway_page[];
 
@@ -254,6 +256,30 @@ cpu_dumpconf(void)
 }
 
 void
+map_vhpt(uintptr_t vhpt)
+{
+pt_entry_t pte;
+uint64_t psr;
+
+pte = PTE_PRESENT | PTE_MA_WB | PTE_ACCESSED | PTE_DIRTY |
+		PTE_PL_KERN | PTE_AR_RW;
+pte |= vhpt & PTE_PPN_MASK;
+
+__asm __volatile("ptr.d %0,%1" :: "r"(vhpt),
+			 "r"(pmap_vhpt_log2size << 2));
+
+__asm __volatile("mov   %0=psr" : "=r"(psr));
+__asm __volatile("rsm   psr.ic|psr.i");
+ia64_srlz_i();
+ia64_set_ifa(vhpt);
+ia64_set_itir(pmap_vhpt_log2size << 2);
+ia64_srlz_d();
+__asm __volatile("itr.d dtr[%0]=%1" :: "r"(3), "r"(pte));
+__asm __volatile("mov   psr.l=%0" :: "r" (psr));
+ia64_srlz_i();
+}
+
+void
 map_pal_code(void)
 {
 	pt_entry_t pte;
@@ -368,6 +394,15 @@ ia64_init(void)
 
 	ia64_set_fpsr(IA64_FPSR_DEFAULT);
 
+	/*
+	 * Region 6 is direct mapped UC and region 7 is direct mapped
+	 * WC. The details of this is controlled by the Alt {I,D}TLB
+	 * handlers. Here we just make sure that they have the largest
+	 * possible page size to minimise TLB usage.
+	 */
+	ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (LOG2_ID_PAGE_SIZE << 2));
+	ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (LOG2_ID_PAGE_SIZE << 2));
+	ia64_srlz_d();
 
 	/*
 	 * TODO: Get critical system information (if possible, from the
@@ -793,3 +828,37 @@ mm_md_physacc(paddr_t pa, vm_prot_t prot
 
 	return 0; /* TODO: Implement. */
 }
+
+void
+ia64_sync_icache(vaddr_t va, vsize_t sz)
+{
+	vaddr_t lim;
+
+if (!ia64_sync_icache_needed)
+return;
+
+lim = va + sz;
+while (va < lim) {
+ia64_fc_i(va);
+va += 32;   /* XXX */
+}
+
+ia64_sync_i();
+ia64_srlz_i();
+}
+
+/*
+ * Construct a PCB from a trapframe. This is called from kdb_trap() where
+ * we want to start a backtrace from the function that caused us to enter
+ * the debugger. We have the context in the trapframe, but base the trace
+ * on the PCB. The PCB doesn't have to be perfect, as long as it contains
+ * enough for a backtrace.
+ */
+void
+makectx(struct trapframe *tf, struct pcb *pcb)
+{
+pcb->pcb_special = tf->tf_special;
+pcb->pcb_special.__spare = ~0UL;/* XXX see unwind.c */
+save_callee_saved(>pcb_preserved);
+save_callee_saved_fp(>pcb_preserved_fp);
+}



CVS commit: src/sys/arch/ia64/ia64

2017-04-08 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Apr  8 17:45:22 UTC 2017

Modified Files:
src/sys/arch/ia64/ia64: locore.S

Log Message:
Add kstack_top variable


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/ia64/ia64/locore.S

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/ia64/ia64/locore.S
diff -u src/sys/arch/ia64/ia64/locore.S:1.6 src/sys/arch/ia64/ia64/locore.S:1.7
--- src/sys/arch/ia64/ia64/locore.S:1.6	Fri Jun 20 12:41:34 2014
+++ src/sys/arch/ia64/ia64/locore.S	Sat Apr  8 17:45:22 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.6 2014/06/20 12:41:34 joerg Exp $	*/
+/*	$NetBSD: locore.S,v 1.7 2017/04/08 17:45:22 scole Exp $	*/
 	
 /*-
  * Copyright (c) 1998 Doug Rabson
@@ -31,18 +31,18 @@
 #include "opt_multiprocessor.h"
 
 #include 
-#include 
-#include 
 #include 
 #include 
 
 #include "assym.h"
 
 	.section .data.proc0,"aw"
-	.global	kstack
 	.align	PAGE_SIZE
+	.global	kstack
 kstack:	.space KSTACK_PAGES * PAGE_SIZE
-
+	.global kstack_top
+kstack_top:
+	
 	.text
 
 /*



CVS commit: src/sys/arch/ia64/ia64

2017-04-08 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Apr  8 17:44:27 UTC 2017

Modified Files:
src/sys/arch/ia64/ia64: interrupt.c

Log Message:
Add ia64_handle_intr() stub


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/ia64/ia64/interrupt.c

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/ia64/ia64/interrupt.c
diff -u src/sys/arch/ia64/ia64/interrupt.c:1.6 src/sys/arch/ia64/ia64/interrupt.c:1.7
--- src/sys/arch/ia64/ia64/interrupt.c:1.6	Sat Oct  1 15:59:28 2011
+++ src/sys/arch/ia64/ia64/interrupt.c	Sat Apr  8 17:44:27 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: interrupt.c,v 1.6 2011/10/01 15:59:28 chs Exp $ */
+/* $NetBSD: interrupt.c,v 1.7 2017/04/08 17:44:27 scole Exp $ */
 
 /*-
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -33,7 +33,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.6 2011/10/01 15:59:28 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.7 2017/04/08 17:44:27 scole Exp $");
 
 #include "opt_ddb.h"
 
@@ -363,6 +363,12 @@ ia64_dispatch_intr(void *frame, u_int ve
 	return handled;
 }
 
+void
+ia64_handle_intr(void *tf)
+{
+	panic("XXX %s not implemented", __func__);
+}
+
 #ifdef DDB
 void
 db_print_vector(u_int vector, int always)



CVS commit: src/sys/arch/ia64/ia64

2017-04-08 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Apr  8 17:43:42 UTC 2017

Modified Files:
src/sys/arch/ia64/ia64: genassym.cf

Log Message:
Add more PTE and IA64 mem region variables


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/ia64/ia64/genassym.cf

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/ia64/ia64/genassym.cf
diff -u src/sys/arch/ia64/ia64/genassym.cf:1.10 src/sys/arch/ia64/ia64/genassym.cf:1.11
--- src/sys/arch/ia64/ia64/genassym.cf:1.10	Sat Oct  1 15:59:28 2011
+++ src/sys/arch/ia64/ia64/genassym.cf	Sat Apr  8 17:43:41 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.10 2011/10/01 15:59:28 chs Exp $
+#	$NetBSD: genassym.cf,v 1.11 2017/04/08 17:43:41 scole Exp $
 
 #
 # Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -87,6 +87,7 @@ include 
 
 include 
 include 
+include 
 include 
 include 
 include 
@@ -113,6 +114,21 @@ define	PAGE_SIZE		PAGE_SIZE
 define	PAGE_SHIFT		PAGE_SHIFT
 define	KSTACK_PAGES		KSTACK_PAGES
 
+define	IA64_VM_MINKERN_REGION	IA64_VM_MINKERN_REGION
+define	IA64_PBVM_RR		IA64_PBVM_RR
+define  IA64_PBVM_PAGE_SHIFT	IA64_PBVM_PAGE_SHIFT
+define	IA64_PSR_DFH		IA64_PSR_DFH
+define	IA64_PBVM_BASE		IA64_PBVM_BASE
+define	IA64_PBVM_PGTBL		IA64_PBVM_PGTBL
+
+define	PTE_PRESENT		PTE_PRESENT
+define	PTE_ACCESSED		PTE_ACCESSED
+define	PTE_DIRTY		PTE_DIRTY
+define	PTE_PL_KERN		PTE_PL_KERN
+define	PTE_AR_RWX		PTE_AR_RWX
+define	PTE_MA_WB		PTE_MA_WB
+define	PTE_MA_UC		PTE_MA_UC
+
 define	DT_NULL			DT_NULL
 define	DT_RELA			DT_RELA
 define	DT_RELAENT		DT_RELAENT



CVS commit: src/sys/arch/ia64/ia64

2017-04-08 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Apr  8 17:42:47 UTC 2017

Modified Files:
src/sys/arch/ia64/ia64: exception.S

Log Message:
Updates from FreeBSD, mostly compile-tested


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/ia64/ia64/exception.S

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/ia64/ia64/exception.S
diff -u src/sys/arch/ia64/ia64/exception.S:1.5 src/sys/arch/ia64/ia64/exception.S:1.6
--- src/sys/arch/ia64/ia64/exception.S:1.5	Sat Oct  1 15:59:27 2011
+++ src/sys/arch/ia64/ia64/exception.S	Sat Apr  8 17:42:47 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: exception.S,v 1.5 2011/10/01 15:59:27 chs Exp $ */
+/*	$NetBSD: exception.S,v 1.6 2017/04/08 17:42:47 scole Exp $ */
 
 /*-
  * Copyright (c) 2003,2004 Marcel Moolenaar
@@ -28,18 +28,206 @@
  */
 
 #include 
-#include 
+/* __FBSDID("$FreeBSD: releng/10.1/sys/ia64/ia64/exception.S 268200 2014-07-02 23:47:43Z marcel $"); */
 
 #include "assym.h"
 	
 /*
+ * Nested TLB restart tokens. These are used by the
+ * nested TLB handler for jumping back to the code
+ * where the nested TLB was caused.
+ */
+#define	NTLBRT_SAVE	0x12c12c
+#define	NTLBRT_RESTORE  0x12c12d
+
+/*
  * ar.k7 = kernel memory stack
  * ar.k6 = kernel register stack
  * ar.k5 = EPC gateway page
  * ar.k4 = PCPU data
  */
 
-	.text
+	.section .ivt.data, "aw"
+
+	.align	8
+	.global ia64_kptdir
+	.size	ia64_kptdir, 8
+ia64_kptdir:	data8	0
+
+	
+#ifdef XTRACE
+
+	.align	8
+	.global	ia64_xtrace_mask
+	.size	ia64_xtrace_mask, 8
+ia64_xtrace_mask:	data8	0
+
+	.align	4
+	.global	ia64_xtrace_enabled
+	.size	ia64_xtrace_enabled, 4
+ia64_xtrace_enabled:	data4	0
+
+#define	XTRACE_HOOK(offset)			\
+{	.mii ;	\
+	nop		0 ;			\
+	mov		r31 = b7 ;		\
+	mov		r28 = pr ;		\
+} ;		\
+{	.mib ;	\
+	nop		0 ;			\
+	mov		r25 = ip ;		\
+	br.sptk		ia64_xtrace_write ;;	\
+} ;		\
+{	.mii ;	\
+	nop		0 ;			\
+	mov		b7 = r31 ;		\
+	mov		pr = r28, 0x1 ;;	\
+}
+
+	.section .ivt.text, "ax"
+
+// We can only use r25, r26 & r27
+ENTRY_NOPROFILE(ia64_xtrace_write, 0)
+{	.mlx
+	add	r25 = 16, r25
+	movl	r26 = ia64_xtrace_enabled
+	;;
+}
+{	.mmi
+	mov	r27 = ar.k3
+	ld4	r26 = [r26]
+	mov	b7 = r25
+	;;
+}
+{	.mib
+	add	r25 = -32, r25
+	cmp.eq	p15,p0 = r0, r26
+(p15)	br.dptk.few	b7
+	;;
+}
+{	.mib
+	nop	0
+	cmp.eq	p15,p0 = r0, r27
+(p15)	br.dptk.few	b7
+	;;
+}
+{	.mmi
+	st8	[r27] = r25, 8		// 0x00 IVT
+	mov	r26 = ar.itc
+	nop	0
+	;;
+}
+{	.mmi
+	st8	[r27] = r26, 8		// 0x08 ITC
+	mov	r25 = cr.iip
+	nop	0
+	;;
+}
+{	.mmi
+	st8	[r27] = r25, 8		// 0x10 IIP
+	mov	r26 = cr.ifa
+	nop	0
+	;;
+}
+{	.mmi
+	st8	[r27] = r26, 8		// 0x18 IFA
+	mov	r25 = cr.isr
+	nop	0
+	;;
+}
+{	.mmi
+	st8	[r27] = r25, 8		// 0x20 ISR
+	mov	r26 = cr.ipsr
+	nop	0
+	;;
+}
+{	.mmi
+	st8	[r27] = r26, 8		// 0x28 IPSR
+	mov	r25 = cr.itir
+	nop	0
+	;;
+}
+{	.mmi
+	st8	[r27] = r25, 8		// 0x30 ITIR
+	mov	r26 = cr.iipa
+	nop	0
+	;;
+}
+{	.mmi
+	st8	[r27] = r26, 8		// 0x38 IIPA
+	mov	r25 = cr.ifs
+	nop	0
+	;;
+}
+{	.mmi
+	st8	[r27] = r25, 8		// 0x40 IFS
+	mov	r26 = cr.iim
+	nop	0
+	;;
+}
+{	.mmi
+	st8	[r27] = r26, 8		// 0x48 IIM
+	mov	r25 = cr.iha
+	nop	0
+	;;
+}
+{	.mmi
+	st8	[r27] = r25, 8		// 0x50 IHA
+	mov	r26 = ar.unat
+	nop	0
+	;;
+}
+{	.mmi
+	st8	[r27] = r26, 8		// 0x58 UNAT
+	mov	r25 = ar.rsc
+	nop	0
+	;;
+}
+{	.mmi
+	st8	[r27] = r25, 8		// 0x60 RSC
+	mov	r26 = ar.bsp
+	nop	0
+	;;
+}
+{	.mmi
+	st8	[r27] = r26, 8		// 0x68 BSP
+	mov	r25 = r13
+	nop	0
+	;;
+}
+{	.mmi
+	st8	[r27] = r25, 8		// 0x70 PCPU/TLS
+	mov	r26 = r12
+	nop	0
+	;;
+}
+{	.mlx
+	st8	[r27] = r26, 8		// 0x78 SP
+	movl	r25 = ia64_xtrace_mask
+	;;
+}
+{	.mmi
+	ld8	r26 = [r25]
+	;;
+	and	r25 = r27, r26
+	nop	0
+	;;
+}
+{	.mib
+	mov	ar.k3 = r25
+	nop	0
+	br.sptk	b7
+	;;
+}
+END(ia64_xtrace_write)
+
+#else /* XTRACE */
+
+#define	XTRACE_HOOK(offset)
+
+	.section .ivt.text, "ax"
+
+#endif /* XTRACE */
 
 /*
  * exception_save: save interrupted state
@@ -67,7 +255,7 @@ ENTRY_NOPROFILE(exception_save, 0)
 	;;
 }
 {	.mmi
-	cmp.le		p14,p15=5,r31
+	cmp.le		p14,p15=IA64_VM_MINKERN_REGION,r31
 	;;
 (p15)	mov		r23=ar.k7		// kernel memory stack
 (p14)	mov		r23=sp
@@ -82,42 +270,57 @@ ENTRY_NOPROFILE(exception_save, 0)
 }
 {	.mmi
 	mov		ar.rsc=0
-	sub		r19=r23,r30
-	add		r31=8,r30
-	;;
-}
-{	.mlx
 	mov		r22=cr.iip
-	movl		r26=exception_save_restart
+	addl		r29=NTLBRT_SAVE,r0	// 22-bit restart token.
 	;;
 }
 
 	/*
-	 * We have a 1KB aligned trapframe, pointed to by sp. If we write
-	 * to the trapframe, we may trigger a data nested TLB fault. By
-	 * aligning the trapframe on a 1KB boundary, we guarantee that if
-	 * we get a data nested TLB fault, it will be on the very first
-	 * write. Since the data nested TLB fault does not preserve any
-	 * state, we have to be careful what we clobber. Consequently, we
-	 * have to be careful what we use here. Below a list of registers
-	 * that are currently alive:
+	 * We have a 1KB aligned trapframe, 

CVS commit: src/sys/arch/ia64/ia64

2017-04-08 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Apr  8 17:40:50 UTC 2017

Modified Files:
src/sys/arch/ia64/ia64: cpu.c

Log Message:
Add more cpus to identify, from FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/ia64/ia64/cpu.c

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/ia64/ia64/cpu.c
diff -u src/sys/arch/ia64/ia64/cpu.c:1.14 src/sys/arch/ia64/ia64/cpu.c:1.15
--- src/sys/arch/ia64/ia64/cpu.c:1.14	Thu Apr  3 17:04:46 2014
+++ src/sys/arch/ia64/ia64/cpu.c	Sat Apr  8 17:40:50 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.14 2014/04/03 17:04:46 martin Exp $	*/
+/*	$NetBSD: cpu.c,v 1.15 2017/04/08 17:40:50 scole Exp $	*/
 
 /*
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.14 2014/04/03 17:04:46 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.15 2017/04/08 17:40:50 scole Exp $");
 
 #include 
 #include 
@@ -45,6 +45,8 @@ __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.14
 #define MHz	100L
 #define GHz	(1000L * MHz)
 
+extern int ia64_sync_icache_needed;
+
 struct cpu_info cpu_info_primary __aligned(CACHE_LINE_SIZE);
 struct cpu_info *cpu_info_list = _info_primary;
 
@@ -165,6 +167,19 @@ identifycpu(struct cpu_softc *sc)
 			break;
 		}
 		break;
+	case 0x20:
+		ia64_sync_icache_needed = 1;
+
+		family_name = "Itanium 2";
+		switch (model) {
+		case 0x00:
+			model_name = "Montecito";
+			break;
+		case 0x01:
+			model_name = "Montvale";
+			break;
+		}
+		break;
 	}
 	cpu_setmodel("%s", model_name);
 



CVS commit: src/sys/arch/ia64/ia64

2017-04-08 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Apr  8 17:38:44 UTC 2017

Modified Files:
src/sys/arch/ia64/ia64: context.S vm_machdep.c

Log Message:
Convert cpu_switchto() from assembly to C code.  Remove comment about
possible cpu_switchto() bug.  Actual issue appears to be new processes
using lwp0 instead of own memory, which is still not fixed.

Thanks to  for figuring this out.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ia64/ia64/context.S
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/ia64/ia64/vm_machdep.c

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/ia64/ia64/context.S
diff -u src/sys/arch/ia64/ia64/context.S:1.7 src/sys/arch/ia64/ia64/context.S:1.8
--- src/sys/arch/ia64/ia64/context.S:1.7	Mon Dec 26 19:46:59 2016
+++ src/sys/arch/ia64/ia64/context.S	Sat Apr  8 17:38:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: context.S,v 1.7 2016/12/26 19:46:59 scole Exp $	*/
+/*	$NetBSD: context.S,v 1.8 2017/04/08 17:38:43 scole Exp $	*/
 
 /*
  * Copyright (c) 2003 Marcel Moolenaar
@@ -806,93 +806,9 @@ ENTRY(restore_high_fp, 1)
 END(restore_high_fp)
 
 /*
- * lwp_t *
- * cpu_switchto(lwp_t *oldlwp, lwp_t *newlwp, bool returning)
- *
- * Switch to the specified next LWP
- *   in0 is oldlwp
- *   in1 is newlwp
- */
-ENTRY(cpu_switchto, 3)
-{	.mmi
-	alloc		loc0=ar.pfs,3,2,2,0
-
-	/*
-	 * Save old context, unless the LWP is exiting.
-	 */
-	cmp.eq		p6,p0=r0,in0		// p6 = (in0 == 0)
-	add		r14=PC_CURLWP,r13	// r14 = >ci_curlwp
-	;;
-}
-{	.mii
-	add		r2=L_PCB,in0		// r2 = lwp_getpcb()
-	add		r3=L_PCB,in1		// r3 = lwp_getpcb()
-	mov		loc1=rp			// save rp (loc1 = rp)
-	;;
-}
-{	.mmi
-	st8		[r14]=in1		// ci->ci_curlwp = newlwp
-	mov		r9=in0			// r9 = oldlwp
-	nop		0
-	;;
-}
-{	.mmb
-	nop		0
-	/*
-	 * Switch to new context, if p6 == true.
-	 * We assume to return to restorectx_return_here for swapped context.
-	 */
-(p6)	ld8		out0=[r3]		// out0 = pcb of 
-(p6)	br.call.sptk.many rp=restorectx		// if (p6) restorectx(out0)
-	;;
-}
-{	.mmb
-	/*
-	 * Swap to new context.
-	 */
-	ld8		out0=[r2]
-	ld8		out1=[r3]
-	br.call.sptk.many rp=swapctx
-	;;
-}
-	/*
-	 * XXX seems to be a bug here...
-	 *
-	 * swapctx() and restorectx() (which is called by swapctx())
-	 * both adjust the bspstore (and hence bsp) registers.  When
-	 * returning to "restorectx_return_here:" the bspstore can
-	 * be greater than bsp, a state known as an "Incomplete Register Frame".
-	 *
-	 * That is not necessarily fatal in itself, but apparently the RSE
-	 * engine sets bsp=bspstore to adjust, which re-syncs the stacked
-	 * registers (r32-r127).  This clobbers our local registers below
-	 * (loc0 and loc1) on the br return from swapctx(), and you get all
-	 * kind of mysterious exceptions depeding on what gets restored from
-	 * the backing store.
-	 *
-	 * Not sure of a proper fix is yet or how cpu_switchto should/can
-	 * be interacting with restorectx()/swapctx()
-	 * 
-	 */
-restorectx_return_here:
-{	.mib
-	mov		r8=r9			// r8(ret0) = oldlwp
-	mov		rp=loc1
-	nop		0
-	;;
-}
-{	.mib
-	nop		0
-	mov		ar.pfs=loc0
-	br.ret.sptk.many rp
-	;;
-}
-END(cpu_switchto)
-
-/*
  * lwp_trampoline()
  *
- * Arrange for a function to be invoked neatly, after a cpu_switch().
+ * Arrange for a function to be invoked neatly, after a cpu_switchto().
  *
  * Invokes fork_exit() passing in three arguments: a callout function, an
  * argument to the callout, and a trapframe pointer.  For child processes

Index: src/sys/arch/ia64/ia64/vm_machdep.c
diff -u src/sys/arch/ia64/ia64/vm_machdep.c:1.12 src/sys/arch/ia64/ia64/vm_machdep.c:1.13
--- src/sys/arch/ia64/ia64/vm_machdep.c:1.12	Fri Aug 12 02:08:20 2016
+++ src/sys/arch/ia64/ia64/vm_machdep.c	Sat Apr  8 17:38:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.12 2016/08/12 02:08:20 scole Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.13 2017/04/08 17:38:43 scole Exp $	*/
 
 /*
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -62,11 +63,44 @@ cpu_lwp_free2(struct lwp *l)
 }
 
 /*
+ * The cpu_switchto() function saves the context of the LWP which is
+ * currently running on the processor, and restores the context of the LWP
+ * specified by newlwp.  man cpu_switchto(9)
+ */
+lwp_t *
+cpu_switchto(lwp_t *oldlwp, lwp_t *newlwp, bool returning)
+{
+	const struct lwp *l = curlwp;
+	struct pcb *oldpcb = oldlwp ? lwp_getpcb(oldlwp) : NULL;
+	struct pcb *newpcb = lwp_getpcb(newlwp);
+	struct cpu_info *ci = curcpu();
+	register uint64_t reg9 __asm("r9");
+
+	KASSERT(newlwp != NULL);
+	
+	ci->ci_curlwp = newlwp;
+	
+	/* required for lwp_startup, copy oldlwp into r9, "mov r9=in0" */
+	__asm __volatile("mov %0=%1" : "=r"(reg9) : "r"(oldlwp));
+	
+	/* XXX handle RAS eventually */
+	
+	if (oldlwp == NULL) {
+		restorectx(newpcb);
+	} else {
+		KASSERT(oldlwp == l);
+		swapctx(oldpcb, newpcb);
+	}
+	
+	return 

CVS commit: src/sys/arch/ia64/conf

2017-04-07 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Fri Apr  7 17:07:09 UTC 2017

Modified Files:
src/sys/arch/ia64/conf: GENERIC GENERIC.SKI

Log Message:
Add more options, mainly want "options INET" and "pseudo-device loop" so 
context bug occurs


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/ia64/conf/GENERIC
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/ia64/conf/GENERIC.SKI

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/ia64/conf/GENERIC
diff -u src/sys/arch/ia64/conf/GENERIC:1.8 src/sys/arch/ia64/conf/GENERIC:1.9
--- src/sys/arch/ia64/conf/GENERIC:1.8	Fri Aug 21 01:52:08 2015
+++ src/sys/arch/ia64/conf/GENERIC	Fri Apr  7 17:07:09 2017
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.8 2015/08/21 01:52:08 uebayasi Exp $
+# $NetBSD: GENERIC,v 1.9 2017/04/07 17:07:09 scole Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/ia64/conf/std.ia64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.8 $"
+#ident 		"GENERIC-$Revision: 1.9 $"
 
 maxusers	32		# estimated number of users
 
@@ -32,6 +32,18 @@ maxusers	32		# estimated number of users
 # CPU-related options.
 
 # Standard system options
+options 	INSECURE	# disable kernel security levels - X needs this
+options 	NTP		# NTP phase/frequency locked loop
+
+options 	KTRACE		# system call tracing via ktrace(1)
+
+# Note: SysV IPC parameters can be changed dynamically; see sysctl(8).
+options 	SYSVMSG		# System V-like message queues
+options 	SYSVSEM		# System V-like semaphores
+options 	SYSVSHM		# System V-like memory sharing
+
+#options 	MODULAR		# new style module(7) framework
+#options 	MODULAR_DEFAULT_AUTOLOAD
 
 options 	USERCONF	# userconf(4) support
 
@@ -47,18 +59,36 @@ options 	DDB_HISTORY_SIZE=512	# enable h
 #options 	KGDB_DEVNAME="\"com\"",KGDB_DEVADDR=0x3f8,KGDB_DEVRATE=9600
 makeoptions	DEBUG="-g"	# compile full symbol table
 
+#options UVMHIST
+#options UVMHIST_PRINT
+
 # File systems
 file-system	FFS		# UFS
+file-system	NFS		# Network File System client
 file-system 	MFS		# memory file system
+#file-system	LFS		# log-structured file system
+#file-system	NTFS		# Windows/NT file system (experimental)
+file-system	CD9660		# ISO 9660 + Rock Ridge file system
+file-system	MSDOSFS		# MS-DOS file system
+file-system	FDESC		# /dev/fd
+file-system	KERNFS		# /kern
+file-system	NULLFS		# loopback file system
+file-system	OVERLAY		# overlay file system
+#file-system	PROCFS		# /proc
 file-system	TMPFS		# Efficient memory file-system
 
 # These options enable verbose messages for several subsystems.
 # Warning, these may compile large string tables into the kernel!
 options 	ACPIVERBOSE	# verbose ACPI device autoconfig messages
 
+#options 	GATEWAY		# packet forwarding
+options 	INET		# IP + ICMP + TCP + UDP
+#options 	INET6		# IPv6
+#options 	IPSEC		# IP security
 
 # Kernel root file system and dump configuration.
 config		netbsd	root on ? type ?
+#config		netbsd	root on md0a type ffs
 
 #
 # Device configuration
@@ -79,5 +109,26 @@ com*		at acpi?		# Serial communications 
 # PCI bus support
 #pci*		at mainbus? bus ?
 
+#puc* at pci? dev ? function ? 
+#com* at puc? port ?
+
 # Pull in optional local configuration
 cinclude "arch/ia64/conf/GENERIC.local"
+
+# Pseudo-Devices
+
+# Enable the hooks used for initializing the root memory-disk.
+#pseudo-device	md			# memory disk device (ramdisk)
+#options 	MEMORY_DISK_DYNAMIC	# loaded via kernel module(7)
+##options 	MEMORY_DISK_HOOKS	# enable root ramdisk
+##options		MEMORY_DISK_IS_ROOT	# force md RAM disk to be the root device
+#optionsMEMORY_DISK_ROOT_SIZE=2880  # 1.44M, same as a floppy
+##options MEMORY_DISK_ROOT_SIZE=8192  # 4Meg
+##options MEMORY_DISK_SERVER=1# make the ramdisk writeable
+
+# network pseudo-devices
+pseudo-device	loop			# network loopback
+
+# miscellaneous pseudo-devices
+#pseudo-device	pty			# pseudo-terminals
+

Index: src/sys/arch/ia64/conf/GENERIC.SKI
diff -u src/sys/arch/ia64/conf/GENERIC.SKI:1.12 src/sys/arch/ia64/conf/GENERIC.SKI:1.13
--- src/sys/arch/ia64/conf/GENERIC.SKI:1.12	Fri Aug  7 07:29:33 2015
+++ src/sys/arch/ia64/conf/GENERIC.SKI	Fri Apr  7 17:07:09 2017
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC.SKI,v 1.12 2015/08/07 07:29:33 maxv Exp $
+# $NetBSD: GENERIC.SKI,v 1.13 2017/04/07 17:07:09 scole Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/ia64/conf/std.ia64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.12 $"
+#ident 		"GENERIC-$Revision: 1.13 $"
 
 maxusers	32		# estimated number of users
 
@@ -32,27 +32,59 @@ maxusers	32		# estimated number of users
 # CPU-related options.
 
 # Standard system options
+options 	INSECURE	# disable kernel security levels - X needs this
+options 	NTP		# NTP phase/frequency locked loop
+
+options 	KTRACE		# system call 

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

2017-04-03 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Mon Apr  3 17:19:43 UTC 2017

Modified Files:
src/sys/arch/ia64/include: isa_machdep.h

Log Message:
com_isa uses isa_intr_establish_xname now, fixes GENERIC compilation


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/include/isa_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/ia64/include/isa_machdep.h
diff -u src/sys/arch/ia64/include/isa_machdep.h:1.2 src/sys/arch/ia64/include/isa_machdep.h:1.3
--- src/sys/arch/ia64/include/isa_machdep.h:1.2	Tue Oct 18 22:04:34 2016
+++ src/sys/arch/ia64/include/isa_machdep.h	Mon Apr  3 17:19:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: isa_machdep.h,v 1.2 2016/10/18 22:04:34 jdolecek Exp $	*/
+/*	$NetBSD: isa_machdep.h,v 1.3 2017/04/03 17:19:43 scole Exp $	*/
 /*
  * Copyright (c) 2009 KIYOHARA Takashi
  * All rights reserved.
@@ -37,7 +37,8 @@ isa_intr_establish(isa_chipset_tag_t ic,
 	return intr_establish(irq, type, level, ih_func, ih_arg);
 }
 
-void *isa_intr_establish_xname(isa_chipset_tag_t, int, int, int,
-		   int (*)(void *), void *, const char *);
+/* XXX - com_isa.c requires _xname now */
+#define isa_intr_establish_xname(ic, irq, type, level, fun, arg, xname) \
+	isa_intr_establish(ic, irq, type, level, fun, arg)
 
 #endif	/* _ISA_MACHDEP_H_ */



CVS commit: src/usr.bin/units

2017-03-20 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Tue Mar 21 01:21:59 UTC 2017

Modified Files:
src/usr.bin/units: units.lib

Log Message:
Add most common thai length/area measurements of wah rai ngan


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/units/units.lib

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

Modified files:

Index: src/usr.bin/units/units.lib
diff -u src/usr.bin/units/units.lib:1.19 src/usr.bin/units/units.lib:1.20
--- src/usr.bin/units/units.lib:1.19	Fri Feb  5 03:38:50 2016
+++ src/usr.bin/units/units.lib	Tue Mar 21 01:21:59 2017
@@ -1,4 +1,4 @@
-/	$NetBSD: units.lib,v 1.19 2016/02/05 03:38:50 dholland Exp $
+/	$NetBSD: units.lib,v 1.20 2017/03/21 01:21:59 scole Exp $
 
 / primitive units
 
@@ -652,3 +652,9 @@ worstedyarncount	1680 ft/pound
 metricyarncount		meter/gram
 jewlerspoint		2 milligram
 
+/ thai measurements
+
+wah			2 m
+ngan			400 m2
+rai			1600 m2
+



CVS commit: src/include

2017-02-22 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu Feb 23 02:06:12 UTC 2017

Modified Files:
src/include: fenv.h

Log Message:
Add fenv for ia64, imported from FreeBSD, compile tested only.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/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/include/fenv.h
diff -u src/include/fenv.h:1.23 src/include/fenv.h:1.24
--- src/include/fenv.h:1.23	Thu Aug 25 12:12:59 2016
+++ src/include/fenv.h	Thu Feb 23 02:06:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.23 2016/08/25 12:12:59 christos Exp $	*/
+/*	$NetBSD: fenv.h,v 1.24 2017/02/23 02:06:12 scole Exp $	*/
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -30,6 +30,7 @@
 #include 
 
 #if !defined(__aarch64__) && !defined(__arm__) && !defined(__i386__) \
+&& !defined(__ia64__) \
 && !defined(__hppa__) && !defined(__powerpc__) && !defined(__mips__) \
 && !defined(__or1k__) && !defined(__riscv__) && !defined(__sparc__) \
 && !defined(__x86_64__) && !defined(__alpha__) && !defined(__sh__) \



CVS commit: src/lib/libm

2017-02-22 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu Feb 23 02:05:30 UTC 2017

Modified Files:
src/lib/libm: Makefile
Added Files:
src/lib/libm/arch/ia64: fenv.c

Log Message:
Add fenv for ia64, imported from FreeBSD, compile tested only.


To generate a diff of this commit:
cvs rdiff -u -r1.187 -r1.188 src/lib/libm/Makefile
cvs rdiff -u -r0 -r1.1 src/lib/libm/arch/ia64/fenv.c

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

Modified files:

Index: src/lib/libm/Makefile
diff -u src/lib/libm/Makefile:1.187 src/lib/libm/Makefile:1.188
--- src/lib/libm/Makefile:1.187	Thu Dec  8 18:42:01 2016
+++ src/lib/libm/Makefile	Thu Feb 23 02:05:30 2017
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.187 2016/12/08 18:42:01 christos Exp $
+#  $NetBSD: Makefile,v 1.188 2017/02/23 02:05:30 scole Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -77,6 +77,9 @@ COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
 .PATH.S: ${.CURDIR}/arch/arm
 ARCH_SRCS = e_sqrt.S e_sqrtf.S lrint.S lrintf.S s_fabsf.S s_fma.S s_fmaf.S
 .endif
+.elif (${LIBC_MACHINE_ARCH} == "ia64")
+.PATH: ${.CURDIR}/arch/ia64
+COMMON_SRCS += fenv.c
 .elif (${LIBC_MACHINE_ARCH} == "hppa")
 .PATH.c: ${.CURDIR}/arch/hppa
 COMMON_SRCS+= fenv.c s_nexttowardf.c \

Added files:

Index: src/lib/libm/arch/ia64/fenv.c
diff -u /dev/null src/lib/libm/arch/ia64/fenv.c:1.1
--- /dev/null	Thu Feb 23 02:05:30 2017
+++ src/lib/libm/arch/ia64/fenv.c	Thu Feb 23 02:05:30 2017
@@ -0,0 +1,69 @@
+/*	$NetBSD: fenv.c,v 1.1 2017/02/23 02:05:30 scole Exp $	*/
+
+/*-
+ * Copyright (c) 2004 David Schultz 
+ * 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 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 AUTHOR 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.
+ *
+ * $FreeBSD: releng/10.1/lib/msun/ia64/fenv.c 226415 2011-10-16 05:37:56Z das $
+ */
+
+#include 
+__RCSID("$NetBSD: fenv.c,v 1.1 2017/02/23 02:05:30 scole Exp $");
+
+#define	__fenv_static
+#include "fenv.h"
+
+#if defined(__GNUC_GNU_INLINE__) && !defined(__lint__)
+#error "This file must be compiled with C99 'inline' semantics"
+#endif
+
+const fenv_t __fe_dfl_env = 0x0009804c8a70033fULL;
+
+extern inline int feclearexcept(int __excepts);
+extern inline int fegetexceptflag(fexcept_t *__flagp, int __excepts);
+extern inline int fesetexceptflag(const fexcept_t *__flagp, int __excepts);
+extern inline int feraiseexcept(int __excepts);
+extern inline int fetestexcept(int __excepts);
+extern inline int fegetround(void);
+extern inline int fesetround(int __round);
+extern inline int fegetenv(fenv_t *__envp);
+extern inline int feholdexcept(fenv_t *__envp);
+extern inline int fesetenv(const fenv_t *__envp);
+
+/*
+ * It doesn't pay to inline feupdateenv() because it includes one of
+ * the rare uses of feraiseexcept() where the argument is not a
+ * constant.  Thus, no dead code elimination can occur, resulting in
+ * significant bloat.
+ */
+int
+feupdateenv(const fenv_t *envp)
+{
+	fenv_t fpsr;
+
+	__stfpsr();
+	__ldfpsr(*envp);
+	feraiseexcept((fpsr >> _FPUSW_SHIFT) & FE_ALL_EXCEPT);
+	return (0);
+}



CVS commit: src/distrib/sets/lists/comp

2017-02-22 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu Feb 23 02:04:11 UTC 2017

Modified Files:
src/distrib/sets/lists/comp: md.ia64

Log Message:
Add fenv.h for ia64, imported from FreeBSD, compile tested only.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/sets/lists/comp/md.ia64

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

Modified files:

Index: src/distrib/sets/lists/comp/md.ia64
diff -u src/distrib/sets/lists/comp/md.ia64:1.2 src/distrib/sets/lists/comp/md.ia64:1.3
--- src/distrib/sets/lists/comp/md.ia64:1.2	Thu Jan  5 13:45:51 2017
+++ src/distrib/sets/lists/comp/md.ia64	Thu Feb 23 02:04:11 2017
@@ -1,4 +1,4 @@
-# $NetBSD: md.ia64,v 1.2 2017/01/05 13:45:51 wiz Exp $
+# $NetBSD: md.ia64,v 1.3 2017/02/23 02:04:11 scole Exp $
 ./usr/include/gcc-4.8/ia64intrin.h	comp-obsolete			obsolete
 ./usr/include/gcc-4.8/tgmath.h		comp-obsolete			obsolete
 ./usr/include/gcc-5/ia64intrin.h	comp-c-include
@@ -21,6 +21,7 @@
 ./usr/include/ia64/elf_machdep.h	comp-c-include
 ./usr/include/ia64/endian.h		comp-c-include
 ./usr/include/ia64/endian_machdep.h	comp-c-include
+./usr/include/ia64/fenv.h		comp-c-include
 ./usr/include/ia64/float.h		comp-c-include
 ./usr/include/ia64/fpu.h		comp-c-include
 ./usr/include/ia64/frame.h		comp-c-include



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

2017-02-22 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Thu Feb 23 02:03:27 UTC 2017

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

Log Message:
Add fenv.h for ia64, imported from FreeBSD, compile tested only.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ia64/include/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/arch/ia64/include/fenv.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/ia64/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/ia64/include/Makefile
diff -u src/sys/arch/ia64/include/Makefile:1.7 src/sys/arch/ia64/include/Makefile:1.8
--- src/sys/arch/ia64/include/Makefile:1.7	Fri Aug  5 16:56:43 2016
+++ src/sys/arch/ia64/include/Makefile	Thu Feb 23 02:03:27 2017
@@ -1,11 +1,11 @@
-#	$NetBSD: Makefile,v 1.7 2016/08/05 16:56:43 scole Exp $
+#	$NetBSD: Makefile,v 1.8 2017/02/23 02:03:27 scole Exp $
 
 INCSDIR= /usr/include/ia64
 
 INCS=	_regset.h acpi_machdep.h ansi.h \
 	aout_machdep.h asm.h atomic.h bootinfo.h bswap.h cdefs.h \
-	cpu.h cpufunc.h dig64.h disklabel.h efi.h \
-	elf_machdep.h endian.h endian_machdep.h float.h fpu.h frame.h \
+	cpu.h cpufunc.h dig64.h disklabel.h efi.h elf_machdep.h \
+	endian.h endian_machdep.h fenv.h float.h fpu.h frame.h \
 	ia64_cpu.h ieee.h ieeefp.h int_const.h int_fmtio.h int_limits.h \
 	int_mwgwtypes.h int_types.h intr.h limits.h \
 	loadfile_machdep.h lock.h math.h mca_machdep.h mcontext.h md_var.h \

Index: src/sys/arch/ia64/include/ieeefp.h
diff -u src/sys/arch/ia64/include/ieeefp.h:1.1 src/sys/arch/ia64/include/ieeefp.h:1.2
--- src/sys/arch/ia64/include/ieeefp.h:1.1	Wed Dec 26 19:43:10 2012
+++ src/sys/arch/ia64/include/ieeefp.h	Thu Feb 23 02:03:27 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: ieeefp.h,v 1.1 2012/12/26 19:43:10 martin Exp $ */
+/* $NetBSD: ieeefp.h,v 1.2 2017/02/23 02:03:27 scole Exp $ */
 
 /*
  * Written by J.T. Conklin, Apr 28, 1995
@@ -12,26 +12,19 @@
 
 #if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE)
 
-typedef int fenv_t;
-typedef int fexcept_t;
-
-#define	FE_INVALID	0x01	/* invalid operation exception */
-#define	FE_DIVBYZERO	0x02	/* divide-by-zero exception */
-#define	FE_OVERFLOW	0x04	/* overflow exception */
-#define	FE_UNDERFLOW	0x08	/* underflow exception */
-#define	FE_INEXACT	0x10	/* imprecise (loss of precision; "inexact") */
-#define	FE_IOVERFLOW	0x20/* integer overflow */
-
-#define	FE_ALL_EXCEPT	0x3f
+#include 
 
 /*
  * These bits match the fpcr as well as bits 12:11
  * in fp operate instructions
  */
+/* XXX remove since fenv.h now contains (but with different values)? */
+#if 0
 #define	FE_TOWARDZERO	0	/* round to zero (truncate) */
 #define	FE_DOWNWARD	1	/* round toward negative infinity */
 #define	FE_TONEAREST	2	/* round to nearest representable number */
 #define	FE_UPWARD	3	/* round toward positive infinity */
+#endif
 
 #if !defined(_ISOC99_SOURCE)
 

Added files:

Index: src/sys/arch/ia64/include/fenv.h
diff -u /dev/null src/sys/arch/ia64/include/fenv.h:1.1
--- /dev/null	Thu Feb 23 02:03:27 2017
+++ src/sys/arch/ia64/include/fenv.h	Thu Feb 23 02:03:27 2017
@@ -0,0 +1,248 @@
+/*-
+ * Copyright (c) 2004-2005 David Schultz 
+ * 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 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 AUTHOR 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.
+ *
+ * $FreeBSD: releng/10.1/lib/msun/ia64/fenv.h 226218 2011-10-10 15:43:09Z das $
+ */
+
+#ifndef	_IA64_FENV_H_
+#define	_IA64_FENV_H_
+
+#include 
+
+#ifndef	__fenv_static
+#define	__fenv_static	static
+#endif
+
+typedef	__uint64_t	fenv_t;
+typedef	__uint16_t	fexcept_t;
+
+/* Exception flags */
+#define	FE_INVALID	0x01
+#define	FE_DENORMAL	0x02
+#define	

CVS commit: src/sys/arch/ia64/ia64

2016-12-26 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Mon Dec 26 19:46:59 UTC 2016

Modified Files:
src/sys/arch/ia64/ia64: context.S

Log Message:
Fix some comments and add new comment explaining probable bug in 
cpu_switchto().  Not sure of a fix for it yet


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/ia64/ia64/context.S

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/ia64/ia64/context.S
diff -u src/sys/arch/ia64/ia64/context.S:1.6 src/sys/arch/ia64/ia64/context.S:1.7
--- src/sys/arch/ia64/ia64/context.S:1.6	Fri Aug  5 16:46:56 2016
+++ src/sys/arch/ia64/ia64/context.S	Mon Dec 26 19:46:59 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: context.S,v 1.6 2016/08/05 16:46:56 scole Exp $	*/
+/*	$NetBSD: context.S,v 1.7 2016/12/26 19:46:59 scole Exp $	*/
 
 /*
  * Copyright (c) 2003 Marcel Moolenaar
@@ -821,7 +821,7 @@ ENTRY(cpu_switchto, 3)
 	 * Save old context, unless the LWP is exiting.
 	 */
 	cmp.eq		p6,p0=r0,in0		// p6 = (in0 == 0)
-	add		r14=PC_CURLWP,r13	// r2 = >ci_curlwp
+	add		r14=PC_CURLWP,r13	// r14 = >ci_curlwp
 	;;
 }
 {	.mii
@@ -840,7 +840,7 @@ ENTRY(cpu_switchto, 3)
 	nop		0
 	/*
 	 * Switch to new context, if p6 == true.
-	 * We assum to return to restorectx_return_here for swapped context.
+	 * We assume to return to restorectx_return_here for swapped context.
 	 */
 (p6)	ld8		out0=[r3]		// out0 = pcb of 
 (p6)	br.call.sptk.many rp=restorectx		// if (p6) restorectx(out0)
@@ -855,7 +855,25 @@ ENTRY(cpu_switchto, 3)
 	br.call.sptk.many rp=swapctx
 	;;
 }
-
+	/*
+	 * XXX seems to be a bug here...
+	 *
+	 * swapctx() and restorectx() (which is called by swapctx())
+	 * both adjust the bspstore (and hence bsp) registers.  When
+	 * returning to "restorectx_return_here:" the bspstore can
+	 * be greater than bsp, a state known as an "Incomplete Register Frame".
+	 *
+	 * That is not necessarily fatal in itself, but apparently the RSE
+	 * engine sets bsp=bspstore to adjust, which re-syncs the stacked
+	 * registers (r32-r127).  This clobbers our local registers below
+	 * (loc0 and loc1) on the br return from swapctx(), and you get all
+	 * kind of mysterious exceptions depeding on what gets restored from
+	 * the backing store.
+	 *
+	 * Not sure of a proper fix is yet or how cpu_switchto should/can
+	 * be interacting with restorectx()/swapctx()
+	 * 
+	 */
 restorectx_return_here:
 {	.mib
 	mov		r8=r9			// r8(ret0) = oldlwp



CVS commit: src/sys/arch/ia64/ia64

2016-12-23 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Fri Dec 23 17:26:43 UTC 2016

Modified Files:
src/sys/arch/ia64/ia64: pmap.c

Log Message:
make kernel compilable after recent uvm changes


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/ia64/ia64/pmap.c

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/ia64/ia64/pmap.c
diff -u src/sys/arch/ia64/ia64/pmap.c:1.33 src/sys/arch/ia64/ia64/pmap.c:1.34
--- src/sys/arch/ia64/ia64/pmap.c:1.33	Fri Dec 23 07:15:27 2016
+++ src/sys/arch/ia64/ia64/pmap.c	Fri Dec 23 17:26:43 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.33 2016/12/23 07:15:27 cherry Exp $ */
+/* $NetBSD: pmap.c,v 1.34 2016/12/23 17:26:43 scole Exp $ */
 
 
 /*-
@@ -85,7 +85,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.33 2016/12/23 07:15:27 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.34 2016/12/23 17:26:43 scole Exp $");
 
 #include 
 #include 
@@ -342,7 +342,7 @@ pmap_steal_memory(vsize_t size, vaddr_t 
 		/*
 		 * There are enough pages here; steal them!
 		 */
-		pa = ptoa(uvm_physseg_get_start(bank));
+		pa = ptoa(uvm_physseg_get_start(upm));
 		uvm_physseg_unplug(atop(pa), npgs);
 
 		va = IA64_PHYS_TO_RR7(pa);
@@ -370,7 +370,7 @@ pmap_steal_vhpt_memory(vsize_t size)
 	int npgs;
 	uvm_physseg_t upm;
 	vaddr_t va;
-	paddr_t tmppa, pa = 0;
+	paddr_t pa = 0;
 	paddr_t vhpt_start = 0, start1, start2, end1, end2;
 
 	size = round_page(size);



CVS commit: xsrc/external/mit/xorg-cf-files/dist

2016-12-14 Thread Sean Cole
Module Name:xsrc
Committed By:   scole
Date:   Wed Dec 14 16:05:34 UTC 2016

Modified Files:
xsrc/external/mit/xorg-cf-files/dist: Imake.cf

Log Message:
Add "define ia64Architecture" for ia64 case; probably more changes needed later.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 xsrc/external/mit/xorg-cf-files/dist/Imake.cf

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

Modified files:

Index: xsrc/external/mit/xorg-cf-files/dist/Imake.cf
diff -u xsrc/external/mit/xorg-cf-files/dist/Imake.cf:1.5 xsrc/external/mit/xorg-cf-files/dist/Imake.cf:1.6
--- xsrc/external/mit/xorg-cf-files/dist/Imake.cf:1.5	Wed Mar 19 23:45:21 2014
+++ xsrc/external/mit/xorg-cf-files/dist/Imake.cf	Wed Dec 14 16:05:34 2016
@@ -255,6 +255,10 @@ XCOMM $XFree86: xc/config/cf/Imake.cf,v 
 #  define AMD64Architecture
 #  undef __x86_64__
 # endif
+# ifdef __ia64__
+#  define ia64Architecture
+#  undef __ia64__
+# endif
 #endif /* NetBSD */
 
 /* Systems based on kernel of NetBSD */



CVS commit: src/share/mk

2016-12-14 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Wed Dec 14 16:03:19 UTC 2016

Modified Files:
src/share/mk: bsd.x11.mk

Log Message:
Make ia64 considered 64bit for the _XSERVER64 define so a release with x11 will 
at least build.


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/share/mk/bsd.x11.mk

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

Modified files:

Index: src/share/mk/bsd.x11.mk
diff -u src/share/mk/bsd.x11.mk:1.123 src/share/mk/bsd.x11.mk:1.124
--- src/share/mk/bsd.x11.mk:1.123	Fri Oct 14 20:34:29 2016
+++ src/share/mk/bsd.x11.mk	Wed Dec 14 16:03:19 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.x11.mk,v 1.123 2016/10/14 20:34:29 joerg Exp $
+#	$NetBSD: bsd.x11.mk,v 1.124 2016/12/14 16:03:19 scole Exp $
 
 .include 
 
@@ -97,6 +97,7 @@ X11FLAGS.SERVER+=	-DXINPUT -DXFreeXDGA -
 .endif
 
 .if ${MACHINE_ARCH} == "alpha"	|| \
+${MACHINE_ARCH} == "ia64"   || \
 ${MACHINE_ARCH} == "sparc64" || \
 ${MACHINE_ARCH} == "x86_64" || \
 ${MACHINE_CPU} == "aarch64"



CVS commit: src/lib/libc/arch/ia64/sys

2016-12-10 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Dec 10 21:19:15 UTC 2016

Modified Files:
src/lib/libc/arch/ia64/sys: exect.S

Log Message:
Add exect stub so "build.sh distribution" will compile


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/ia64/sys/exect.S

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

Modified files:

Index: src/lib/libc/arch/ia64/sys/exect.S
diff -u src/lib/libc/arch/ia64/sys/exect.S:1.1 src/lib/libc/arch/ia64/sys/exect.S:1.2
--- src/lib/libc/arch/ia64/sys/exect.S:1.1	Sun Sep 10 21:22:34 2006
+++ src/lib/libc/arch/ia64/sys/exect.S	Sat Dec 10 21:19:15 2016
@@ -1,3 +1,12 @@
-/* $NetBSD: exect.S,v 1.1 2006/09/10 21:22:34 cherry Exp $ */
+/* $NetBSD: exect.S,v 1.2 2016/12/10 21:19:15 scole Exp $ */
 	
-/* XXX:	 Stub */
\ No newline at end of file
+/* XXX:	 Stub */
+
+#include 
+
+#include "SYS.h"
+
+ENTRY(exect, 3)
+	// XXX break into debugger in ski
+	break.i 1
+END(exect)	



CVS commit: src/sys/arch/ia64/ia64

2016-11-22 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Tue Nov 22 22:53:09 UTC 2016

Modified Files:
src/sys/arch/ia64/ia64: core_machdep.c

Log Message:
For ski, break into debugger instead of exiting


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/ia64/ia64/core_machdep.c

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/ia64/ia64/core_machdep.c
diff -u src/sys/arch/ia64/ia64/core_machdep.c:1.1 src/sys/arch/ia64/ia64/core_machdep.c:1.2
--- src/sys/arch/ia64/ia64/core_machdep.c:1.1	Fri Aug  5 16:50:07 2016
+++ src/sys/arch/ia64/ia64/core_machdep.c	Tue Nov 22 22:53:09 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: core_machdep.c,v 1.1 2016/08/05 16:50:07 scole Exp $	*/
+/*	$NetBSD: core_machdep.c,v 1.2 2016/11/22 22:53:09 scole Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: core_machdep.c,v 1.1 2016/08/05 16:50:07 scole Exp $");
+__KERNEL_RCSID(0, "$NetBSD: core_machdep.c,v 1.2 2016/11/22 22:53:09 scole Exp $");
 
 #include 
 #include 
@@ -53,7 +53,7 @@ cpu_coredump(struct lwp *l, struct cored
 struct core *chdr)
 {
   /* XXX implement, pause in ski */
-  __asm __volatile("break.i 0");
+  __asm __volatile("break.i 1");
 
   return -1;
 }



CVS commit: src/lib/libc/arch/ia64/sys

2016-11-22 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Tue Nov 22 22:52:14 UTC 2016

Modified Files:
src/lib/libc/arch/ia64/sys: ptrace.S

Log Message:
For ski, break into debugger instead of exiting


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/ia64/sys/ptrace.S

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

Modified files:

Index: src/lib/libc/arch/ia64/sys/ptrace.S
diff -u src/lib/libc/arch/ia64/sys/ptrace.S:1.2 src/lib/libc/arch/ia64/sys/ptrace.S:1.3
--- src/lib/libc/arch/ia64/sys/ptrace.S:1.2	Fri Aug  5 16:40:47 2016
+++ src/lib/libc/arch/ia64/sys/ptrace.S	Tue Nov 22 22:52:14 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.S,v 1.2 2016/08/05 16:40:47 scole Exp $ */
+/* $NetBSD: ptrace.S,v 1.3 2016/11/22 22:52:14 scole Exp $ */
 	
 /*-
  * Copyright (c) 2006,2016 The NetBSD Foundation, Inc.
@@ -31,6 +31,6 @@
 	
 ENTRY(ptrace,0)
 	/* XXX implement, halt in ski */
-	break.i 0
+	break.i 1
 
 END(ptrace)



CVS commit: src/lib/libc/arch/ia64/sys

2016-11-22 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Tue Nov 22 22:51:53 UTC 2016

Modified Files:
src/lib/libc/arch/ia64/sys: __clone.S

Log Message:
For ski, break into debugger instead of exiting


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/ia64/sys/__clone.S

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

Modified files:

Index: src/lib/libc/arch/ia64/sys/__clone.S
diff -u src/lib/libc/arch/ia64/sys/__clone.S:1.2 src/lib/libc/arch/ia64/sys/__clone.S:1.3
--- src/lib/libc/arch/ia64/sys/__clone.S:1.2	Fri Aug  5 16:40:47 2016
+++ src/lib/libc/arch/ia64/sys/__clone.S	Tue Nov 22 22:51:53 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: __clone.S,v 1.2 2016/08/05 16:40:47 scole Exp $ */
+/* $NetBSD: __clone.S,v 1.3 2016/11/22 22:51:53 scole Exp $ */
 
 /*-
  * Copyright (c) 2006,2016 The NetBSD Foundation, Inc.
@@ -37,6 +37,6 @@ WEAK_ALIAS(clone, __clone)
 
 ENTRY(__clone,4)
 	/* XXX implement, break in ski*/
-	break.i 0
+	break.i 1
 	
 END(__clone)



CVS commit: src/lib/libc/arch/ia64/gen

2016-11-22 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Tue Nov 22 22:50:32 UTC 2016

Modified Files:
src/lib/libc/arch/ia64/gen: fpgetsticky.c fpsetsticky.c getcontext.S
makecontext.c swapcontext.S

Log Message:
For ski, break into debugger instead of exiting


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/ia64/gen/fpgetsticky.c \
src/lib/libc/arch/ia64/gen/fpsetsticky.c \
src/lib/libc/arch/ia64/gen/getcontext.S \
src/lib/libc/arch/ia64/gen/makecontext.c \
src/lib/libc/arch/ia64/gen/swapcontext.S

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

Modified files:

Index: src/lib/libc/arch/ia64/gen/fpgetsticky.c
diff -u src/lib/libc/arch/ia64/gen/fpgetsticky.c:1.1 src/lib/libc/arch/ia64/gen/fpgetsticky.c:1.2
--- src/lib/libc/arch/ia64/gen/fpgetsticky.c:1.1	Fri Aug  5 16:40:47 2016
+++ src/lib/libc/arch/ia64/gen/fpgetsticky.c	Tue Nov 22 22:50:32 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpgetsticky.c,v 1.1 2016/08/05 16:40:47 scole Exp $	*/
+/*	$NetBSD: fpgetsticky.c,v 1.2 2016/11/22 22:50:32 scole Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@ fp_except_t
 fpgetsticky(void)
 {
   /* XXX implement, pause in ski */
-  __asm __volatile("break.i 0");
+  __asm __volatile("break.i 1");
 
   return (fp_except_t)0;
 }
Index: src/lib/libc/arch/ia64/gen/fpsetsticky.c
diff -u src/lib/libc/arch/ia64/gen/fpsetsticky.c:1.1 src/lib/libc/arch/ia64/gen/fpsetsticky.c:1.2
--- src/lib/libc/arch/ia64/gen/fpsetsticky.c:1.1	Fri Aug  5 16:40:47 2016
+++ src/lib/libc/arch/ia64/gen/fpsetsticky.c	Tue Nov 22 22:50:32 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetsticky.c,v 1.1 2016/08/05 16:40:47 scole Exp $	*/
+/*	$NetBSD: fpsetsticky.c,v 1.2 2016/11/22 22:50:32 scole Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@ fp_except_t
 fpsetsticky(fp_except_t sticky)
 {
   /* XXX implement, pause in ski */
-  __asm __volatile("break.i 0");
+  __asm __volatile("break.i 1");
   
   return (fp_except_t)0;
 }
Index: src/lib/libc/arch/ia64/gen/getcontext.S
diff -u src/lib/libc/arch/ia64/gen/getcontext.S:1.1 src/lib/libc/arch/ia64/gen/getcontext.S:1.2
--- src/lib/libc/arch/ia64/gen/getcontext.S:1.1	Fri Aug  5 16:40:47 2016
+++ src/lib/libc/arch/ia64/gen/getcontext.S	Tue Nov 22 22:50:32 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: getcontext.S,v 1.1 2016/08/05 16:40:47 scole Exp $	*/
+/*	$NetBSD: getcontext.S,v 1.2 2016/11/22 22:50:32 scole Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -35,6 +35,6 @@ WEAK_ALIAS(getcontext, _getcontext)
 ENTRY(_getcontext,0)
 	
 	/* XXX implement, halt in ski */
-	break.i 0
+	break.i 1
 
 END(_getcontext)
Index: src/lib/libc/arch/ia64/gen/makecontext.c
diff -u src/lib/libc/arch/ia64/gen/makecontext.c:1.1 src/lib/libc/arch/ia64/gen/makecontext.c:1.2
--- src/lib/libc/arch/ia64/gen/makecontext.c:1.1	Fri Aug  5 16:40:47 2016
+++ src/lib/libc/arch/ia64/gen/makecontext.c	Tue Nov 22 22:50:32 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: makecontext.c,v 1.1 2016/08/05 16:40:47 scole Exp $	*/
+/*	$NetBSD: makecontext.c,v 1.2 2016/11/22 22:50:32 scole Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -41,5 +41,5 @@ void
 makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
 {
   /* XXX implement, halt in ski */
-  __asm __volatile("break.i 0");
+  __asm __volatile("break.i 1");
 }
Index: src/lib/libc/arch/ia64/gen/swapcontext.S
diff -u src/lib/libc/arch/ia64/gen/swapcontext.S:1.1 src/lib/libc/arch/ia64/gen/swapcontext.S:1.2
--- src/lib/libc/arch/ia64/gen/swapcontext.S:1.1	Fri Aug  5 16:40:47 2016
+++ src/lib/libc/arch/ia64/gen/swapcontext.S	Tue Nov 22 22:50:32 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.1 2016/08/05 16:40:47 scole Exp $	*/
+/*	$NetBSD: swapcontext.S,v 1.2 2016/11/22 22:50:32 scole Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 ENTRY(swapcontext,0)
 	
 	/* XXX implement, halt in ski */
-	break.i 0
+	break.i 1
 	
 END(swapcontext)
 



Re: CVS commit: src/tests/dev/cgd

2016-11-07 Thread Sean Cole
Alexander Nasonov <al...@yandex.ru> writes:

> Sean Cole wrote:
>> Module Name: src
>> Committed By:scole
>> Date:Mon Nov  7 16:33:37 UTC 2016
>> 
>> Modified Files:
>>  src/tests/dev/cgd: Makefile
>> 
>> Log Message:
>> Only build t_cgd_aes if MKCRYPTO==yes and MKRUMP==yes.
>
> In my opinion, the whole directory should be excluded if MKRUMP=no.
>
> Alex

I don't have an opinion on this either way, feel free to fix how you
like if others have no objections.

I was just trying to fix distribution build for ia64, which doesn't have
a compiling-rump yet.

Thanks


CVS commit: src/tests/dev/cgd

2016-11-07 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Mon Nov  7 16:33:37 UTC 2016

Modified Files:
src/tests/dev/cgd: Makefile

Log Message:
Only build t_cgd_aes if MKCRYPTO==yes and MKRUMP==yes.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/dev/cgd/Makefile

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

Modified files:

Index: src/tests/dev/cgd/Makefile
diff -u src/tests/dev/cgd/Makefile:1.4 src/tests/dev/cgd/Makefile:1.5
--- src/tests/dev/cgd/Makefile:1.4	Sun Nov  6 21:29:54 2016
+++ src/tests/dev/cgd/Makefile	Mon Nov  7 16:33:37 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2016/11/06 21:29:54 alnsn Exp $
+#	$NetBSD: Makefile,v 1.5 2016/11/07 16:33:37 scole Exp $
 #
 
 .include 
@@ -9,7 +9,7 @@ FILESDIR=	${TESTSDIR}
 
 TESTS_SH=	t_cgd
 
-.if ${MKCRYPTO} != "no"
+.if ${MKCRYPTO} == "yes" && ${MKRUMP} == "yes"
 TESTS_C=	t_cgd_aes
 
 WARNS=	4



  1   2   >