CVS commit: src/sys/arch/powerpc/include/booke

2021-04-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Apr 17 13:25:57 UTC 2021

Modified Files:
src/sys/arch/powerpc/include/booke: vmparam.h

Log Message:
Sync MAXfoo params with oea:

  MAXTSIZ: 512MB -> 128MB
  MAXDSIZ: 3.25GB -> 1GB

There should be no particular reasons for having different values.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/include/booke/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/powerpc/include/booke/vmparam.h
diff -u src/sys/arch/powerpc/include/booke/vmparam.h:1.8 src/sys/arch/powerpc/include/booke/vmparam.h:1.9
--- src/sys/arch/powerpc/include/booke/vmparam.h:1.8	Sat Apr 17 13:23:24 2021
+++ src/sys/arch/powerpc/include/booke/vmparam.h	Sat Apr 17 13:25:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.8 2021/04/17 13:23:24 rin Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.9 2021/04/17 13:25:57 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -56,11 +56,11 @@
 #endif
 
 #ifndef	MAXTSIZ
-#define	MAXTSIZ		(2*256*1024*1024)	/* maximum text size */
+#define	MAXTSIZ		(128*1024*1024)		/* maximum text size */
 #endif
 
 #ifndef	MAXDSIZ
-#define	MAXDSIZ		(13*256*1024*1024U)	/* maximum data size */
+#define	MAXDSIZ		(1024*1024*1024)	/* maximum data size */
 #endif
 
 #ifndef	MAXSSIZ



CVS commit: src/sys/arch/powerpc/include/booke

2021-04-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Apr 17 13:23:24 UTC 2021

Modified Files:
src/sys/arch/powerpc/include/booke: vmparam.h

Log Message:
PR port-powerpc/56107

Decrease MAXSSIZ from ~256MB to 32MB (same as oea).

This fixes tests in /usr/tests/usr.bin/make, that run with "ulimit -v 20",
fail with "Cannot map anonymous memory".

Although I'm not fully convinced whether this limit is reasonable or not,
old MAXSSIZ of ~256MB is too much anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/include/booke/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/powerpc/include/booke/vmparam.h
diff -u src/sys/arch/powerpc/include/booke/vmparam.h:1.7 src/sys/arch/powerpc/include/booke/vmparam.h:1.8
--- src/sys/arch/powerpc/include/booke/vmparam.h:1.7	Tue Oct  2 23:51:39 2012
+++ src/sys/arch/powerpc/include/booke/vmparam.h	Sat Apr 17 13:23:24 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.7 2012/10/02 23:51:39 christos Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.8 2021/04/17 13:23:24 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -64,7 +64,7 @@
 #endif
 
 #ifndef	MAXSSIZ
-#define	MAXSSIZ		(1*256*1024*1024-PAGE_SIZE) /* maximum stack size */
+#define	MAXSSIZ		(32*1024*1024)		/* maximum stack size */
 #endif
 
 #ifndef	DFLDSIZ



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

2021-04-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Apr 17 09:22:29 UTC 2021

Modified Files:
src/sys/arch/powerpc/include/oea: vmparam.h

Log Message:
Adjust TABs. No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/powerpc/include/oea/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/powerpc/include/oea/vmparam.h
diff -u src/sys/arch/powerpc/include/oea/vmparam.h:1.20 src/sys/arch/powerpc/include/oea/vmparam.h:1.21
--- src/sys/arch/powerpc/include/oea/vmparam.h:1.20	Thu Aug 17 22:55:47 2017
+++ src/sys/arch/powerpc/include/oea/vmparam.h	Sat Apr 17 09:22:28 2021
@@ -47,54 +47,54 @@
 #define	PAGE_MASK	(PAGE_SIZE - 1)
 
 #ifndef	USRSTACK
-#define	USRSTACK		VM_MAXUSER_ADDRESS
+#define	USRSTACK	VM_MAXUSER_ADDRESS
 #endif
 
 #ifndef	USRSTACK32
-#define	USRSTACK32		VM_MAXUSER_ADDRESS32
+#define	USRSTACK32	VM_MAXUSER_ADDRESS32
 #endif
 
 #ifndef	MAXTSIZ
-#define	MAXTSIZ			(128*1024*1024)		/* maximum text size */
+#define	MAXTSIZ		(128*1024*1024)		/* maximum text size */
 #endif
 
 #ifndef	MAXDSIZ
-#define	MAXDSIZ			(1024*1024*1024)	/* maximum data size */
+#define	MAXDSIZ		(1024*1024*1024)	/* maximum data size */
 #endif
 
 #ifndef	MAXDSIZ32
-#define	MAXDSIZ32		(1024*1024*1024)	/* maximum data size */
+#define	MAXDSIZ32	(1024*1024*1024)	/* maximum data size */
 #endif
 
 #ifndef	MAXSSIZ
-#define	MAXSSIZ			(32*1024*1024)		/* maximum stack size */
+#define	MAXSSIZ		(32*1024*1024)		/* maximum stack size */
 #endif
 
 #ifndef	MAXSSIZ32
-#define	MAXSSIZ32		(32*1024*1024)		/* maximum stack size */
+#define	MAXSSIZ32	(32*1024*1024)		/* maximum stack size */
 #endif
 
 #ifndef	DFLDSIZ
-#define	DFLDSIZ			(256*1024*1024)		/* default data size */
+#define	DFLDSIZ		(256*1024*1024)		/* default data size */
 #endif
 
 #ifndef	DFLDSIZ32
-#define	DFLSSIZ32		(256*1024*1024)
+#define	DFLSSIZ32	(256*1024*1024)
 #endif
 
 #ifndef	DFLSSIZ
-#define	DFLSSIZ			(2*1024*1024)		/* default stack size */
+#define	DFLSSIZ		(2*1024*1024)		/* default stack size */
 #endif
 
 #ifndef	DFLSSIZ32
-#define	DFLSSIZ32		(2*1024*1024)		/* default stack size */
+#define	DFLSSIZ32	(2*1024*1024)		/* default stack size */
 #endif
 
 /*
  * Default number of pages in the user raw I/O map.
  */
 #ifndef USRIOSIZE
-#define	USRIOSIZE		1024
+#define	USRIOSIZE	1024
 #endif
 
 /*
@@ -102,7 +102,7 @@
  * considered very swappable.
  */
 #ifndef MAXSLP
-#define	MAXSLP			20
+#define	MAXSLP		20
 #endif
 
 /*



CVS commit: src/sys/arch/powerpc/include/ibm4xx

2021-04-01 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Apr  2 03:20:54 UTC 2021

Modified Files:
src/sys/arch/powerpc/include/ibm4xx: dcr4xx.h

Log Message:
Add bit-field definitions for DCR_SDRAM0_B[0-3]CR registers.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/include/ibm4xx/dcr4xx.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/powerpc/include/ibm4xx/dcr4xx.h
diff -u src/sys/arch/powerpc/include/ibm4xx/dcr4xx.h:1.3 src/sys/arch/powerpc/include/ibm4xx/dcr4xx.h:1.4
--- src/sys/arch/powerpc/include/ibm4xx/dcr4xx.h:1.3	Thu Nov 21 13:33:15 2013
+++ src/sys/arch/powerpc/include/ibm4xx/dcr4xx.h	Fri Apr  2 03:20:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: dcr4xx.h,v 1.3 2013/11/21 13:33:15 kiyohara Exp $	*/
+/*	$NetBSD: dcr4xx.h,v 1.4 2021/04/02 03:20:53 rin Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -303,6 +303,8 @@
 #define DCR_SDRAM0_B1CR		0x44
 #define DCR_SDRAM0_B2CR		0x48
 #define DCR_SDRAM0_B3CR		0x4c
+#define   SDRAM0_BnCR_EN	  0x0001
+#define   SDRAM0_BnCR_SZ(n)	  (1 << n) >> 17) & 7) + 22))
 #define DCR_SDRAM0_TR		0x80
 #define DCR_SDRAM0_ECCCFG	0x94
 #define DCR_SDRAM0_ECCESR	0x98



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

2021-03-11 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Thu Mar 11 08:33:34 UTC 2021

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

Log Message:
Use ifdef _KERNEL_OPT instead of ifdef _KERNEL before including
"opt_ppcarch.h".


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

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

Modified files:

Index: src/sys/arch/powerpc/include/db_machdep.h
diff -u src/sys/arch/powerpc/include/db_machdep.h:1.29 src/sys/arch/powerpc/include/db_machdep.h:1.30
--- src/sys/arch/powerpc/include/db_machdep.h:1.29	Wed Jan  6 08:14:34 2021
+++ src/sys/arch/powerpc/include/db_machdep.h	Thu Mar 11 08:33:34 2021
@@ -1,5 +1,5 @@
 /*	$OpenBSD: db_machdep.h,v 1.2 1997/03/21 00:48:48 niklas Exp $	*/
-/*	$NetBSD: db_machdep.h,v 1.29 2021/01/06 08:14:34 rin Exp $	*/
+/*	$NetBSD: db_machdep.h,v 1.30 2021/03/11 08:33:34 simonb Exp $	*/
 
 /* 
  * Mach Operating System
@@ -33,7 +33,7 @@
 #ifndef	_PPC_DB_MACHDEP_H_
 #define	_PPC_DB_MACHDEP_H_
 
-#ifdef _KERNEL
+#if defined(_KERNEL_OPT)
 #include "opt_ppcarch.h"
 #endif
 



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

2021-03-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Mar  7 14:42:53 UTC 2021

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

Log Message:
For LP64, remove members of struct cpu_info that exist just for
compatible with booke or ibm4xx. Even if MODULAR || _MODULE,
these members are useless for powerpc64.


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/sys/arch/powerpc/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/powerpc/include/cpu.h
diff -u src/sys/arch/powerpc/include/cpu.h:1.117 src/sys/arch/powerpc/include/cpu.h:1.118
--- src/sys/arch/powerpc/include/cpu.h:1.117	Wed Feb 24 16:42:38 2021
+++ src/sys/arch/powerpc/include/cpu.h	Sun Mar  7 14:42:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.117 2021/02/24 16:42:38 thorpej Exp $	*/
+/*	$NetBSD: cpu.h,v 1.118 2021/03/07 14:42:53 rin Exp $	*/
 
 /*
  * Copyright (C) 1999 Wolfgang Solfrank.
@@ -118,18 +118,20 @@ struct cpu_info {
 	volatile uint32_t ci_pending_ipis;
 	int ci_mtx_oldspl;
 	int ci_mtx_count;
-#if defined(PPC_IBM4XX) || defined(MODULAR) || defined(_MODULE)
+#if defined(PPC_IBM4XX) || \
+((defined(MODULAR) || defined(_MODULE)) && !defined(_LP64))
 	char *ci_intstk;
 #endif
 
 	register_t ci_savearea[CPUSAVE_SIZE];
-#if defined(PPC_BOOKE) || defined(MODULAR) || defined(_MODULE)
+#if defined(PPC_BOOKE) || \
+((defined(MODULAR) || defined(_MODULE)) && !defined(_LP64))
 	uint32_t ci_pmap_asid_cur;
 	union pmap_segtab *ci_pmap_segtabs[2];
 #define	ci_pmap_kern_segtab	ci_pmap_segtabs[0]
 #define	ci_pmap_user_segtab	ci_pmap_segtabs[1]
 	struct pmap_tlb_info *ci_tlb_info;
-#endif /* PPC_BOOKE || MODULAR || _MODULE */
+#endif /* PPC_BOOKE || ((MODULAR || _MODULE) && !_LP64) */
 	struct cache_info ci_ci;		
 	void *ci_sysmon_cookie;
 	void (*ci_idlespin)(void);



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

2021-03-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Mar  7 14:31:53 UTC 2021

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

Log Message:
For _LP64, disable members of struct mdproc just for compatible with
booke and ibm4xx, even if MODULAR or _MODULE is defined.

Fix build failure for evbppc64 due to CTASSERT in COND_SET_STRUCT,
which restricts sizeof(struct mdproc) < 31 for unknown reason...


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/powerpc/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/powerpc/include/proc.h
diff -u src/sys/arch/powerpc/include/proc.h:1.14 src/sys/arch/powerpc/include/proc.h:1.15
--- src/sys/arch/powerpc/include/proc.h:1.14	Sat Mar  6 08:08:19 2021
+++ src/sys/arch/powerpc/include/proc.h	Sun Mar  7 14:31:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.14 2021/03/06 08:08:19 rin Exp $	*/
+/*	$NetBSD: proc.h,v 1.15 2021/03/07 14:31:53 rin Exp $	*/
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -53,7 +53,7 @@ struct trapframe;
 struct mdproc {
 	void (*md_syscall)(struct trapframe *);
 #if defined(PPC_BOOKE) || defined(PPC_IBM4XX) || \
-defined(MODULAR) || defined(_MODULE)
+((defined(MODULAR) || defined(_MODULE)) && !defined(_LP64))
 	vaddr_t md_ss_addr[2];
 	uint32_t md_ss_insn[2];
 #endif



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

2021-02-28 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Feb 28 20:31:33 UTC 2021

Modified Files:
src/sys/arch/powerpc/include: ofw_machdep.h

Log Message:
Bump OFW_MAX_TRANSLATIONS from 32 -> 48.  32 was already tight (at least
on my Macs), and having having translations for the kernel itself present
in the firmware's translation table bumped it over the 32-entry limit.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/powerpc/include/ofw_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/powerpc/include/ofw_machdep.h
diff -u src/sys/arch/powerpc/include/ofw_machdep.h:1.2 src/sys/arch/powerpc/include/ofw_machdep.h:1.3
--- src/sys/arch/powerpc/include/ofw_machdep.h:1.2	Fri Feb 19 05:21:39 2021
+++ src/sys/arch/powerpc/include/ofw_machdep.h	Sun Feb 28 20:31:32 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ofw_machdep.h,v 1.2 2021/02/19 05:21:39 thorpej Exp $ */
+/* $NetBSD: ofw_machdep.h,v 1.3 2021/02/28 20:31:32 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@ struct OF_translation {
 	uint32_t	mode;
 };
 
-#define	OFW_MAX_TRANSLATIONS	32
+#define	OFW_MAX_TRANSLATIONS	48
 
 extern int ofw_chosen;		/* cached handle for "/chosen" */
 extern struct OF_translation ofw_translations[OFW_MAX_TRANSLATIONS];



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

2021-02-03 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Feb  3 10:37:05 UTC 2021

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

Log Message:
Pull out constant definitions inside struct declaration.

Enable CTASSERT(9) for CPUSAVE_SIZE.


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/powerpc/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/powerpc/include/cpu.h
diff -u src/sys/arch/powerpc/include/cpu.h:1.115 src/sys/arch/powerpc/include/cpu.h:1.116
--- src/sys/arch/powerpc/include/cpu.h:1.115	Wed Jul 15 08:58:51 2020
+++ src/sys/arch/powerpc/include/cpu.h	Wed Feb  3 10:37:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.115 2020/07/15 08:58:51 rin Exp $	*/
+/*	$NetBSD: cpu.h,v 1.116 2021/02/03 10:37:05 rin Exp $	*/
 
 /*
  * Copyright (C) 1999 Wolfgang Solfrank.
@@ -60,6 +60,31 @@ struct cache_info {
 
 #include 
 
+#ifdef _KERNEL
+#define	CI_SAVETEMP	(0*CPUSAVE_LEN)
+#define	CI_SAVEDDB	(1*CPUSAVE_LEN)
+#define	CI_SAVEIPKDB	(2*CPUSAVE_LEN)	/* obsolete */
+#define	CI_SAVEMMU	(3*CPUSAVE_LEN)
+#define	CI_SAVEMAX	(4*CPUSAVE_LEN)
+#define	CPUSAVE_LEN	8
+#if defined(PPC_BOOKE) && !defined(MODULAR) && !defined(_MODULE)
+#define	CPUSAVE_SIZE	128
+#else
+#define	CPUSAVE_SIZE	(CI_SAVEMAX*CPUSAVE_LEN)
+CTASSERT(CPUSAVE_SIZE >= 128);
+#endif
+#define	CPUSAVE_R28	0		/* where r28 gets saved */
+#define	CPUSAVE_R29	1		/* where r29 gets saved */
+#define	CPUSAVE_R30	2		/* where r30 gets saved */
+#define	CPUSAVE_R31	3		/* where r31 gets saved */
+#define	CPUSAVE_DEAR	4		/* where IBM4XX SPR_DEAR gets saved */
+#define	CPUSAVE_DAR	4		/* where OEA SPR_DAR gets saved */
+#define	CPUSAVE_ESR	5		/* where IBM4XX SPR_ESR gets saved */
+#define	CPUSAVE_DSISR	5		/* where OEA SPR_DSISR gets saved */
+#define	CPUSAVE_SRR0	6		/* where SRR0 gets saved */
+#define	CPUSAVE_SRR1	7		/* where SRR1 gets saved */
+#endif /* _KERNEL */
+
 struct cpu_info {
 	struct cpu_data ci_data;	/* MI per-cpu data */
 #ifdef _KERNEL
@@ -92,28 +117,7 @@ struct cpu_info {
 #if defined(PPC_IBM4XX) || defined(MODULAR) || defined(_MODULE)
 	char *ci_intstk;
 #endif
-#define	CI_SAVETEMP	(0*CPUSAVE_LEN)
-#define	CI_SAVEDDB	(1*CPUSAVE_LEN)
-#define	CI_SAVEIPKDB	(2*CPUSAVE_LEN)	/* obsolete */
-#define	CI_SAVEMMU	(3*CPUSAVE_LEN)
-#define	CI_SAVEMAX	(4*CPUSAVE_LEN)
-#define	CPUSAVE_LEN	8
-#if defined(PPC_BOOKE) && !defined(MODULAR) && !defined(_MODULE)
-#define	CPUSAVE_SIZE	128
-#else
-#define	CPUSAVE_SIZE	(CI_SAVEMAX*CPUSAVE_LEN)
-// XXX CTASSERT(CPUSAVE_SIZE >= 128);
-#endif
-#define	CPUSAVE_R28	0		/* where r28 gets saved */
-#define	CPUSAVE_R29	1		/* where r29 gets saved */
-#define	CPUSAVE_R30	2		/* where r30 gets saved */
-#define	CPUSAVE_R31	3		/* where r31 gets saved */
-#define	CPUSAVE_DEAR	4		/* where IBM4XX SPR_DEAR gets saved */
-#define	CPUSAVE_DAR	4		/* where OEA SPR_DAR gets saved */
-#define	CPUSAVE_ESR	5		/* where IBM4XX SPR_ESR gets saved */
-#define	CPUSAVE_DSISR	5		/* where OEA SPR_DSISR gets saved */
-#define	CPUSAVE_SRR0	6		/* where SRR0 gets saved */
-#define	CPUSAVE_SRR1	7		/* where SRR1 gets saved */
+
 	register_t ci_savearea[CPUSAVE_SIZE];
 #if defined(PPC_BOOKE) || defined(MODULAR) || defined(_MODULE)
 	uint32_t ci_pmap_asid_cur;



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

2021-01-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jan  6 08:14:35 UTC 2021

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

Log Message:
Switch DDB for powerpc/booke into SOFTWARE_SSTEP.

SR_SINGLESTEP aka PSL_SE bit in MSR is only available for oea, and HW
debug facilities for booke are significantly different from oea.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/powerpc/include/db_machdep.h

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

Modified files:

Index: src/sys/arch/powerpc/include/db_machdep.h
diff -u src/sys/arch/powerpc/include/db_machdep.h:1.28 src/sys/arch/powerpc/include/db_machdep.h:1.29
--- src/sys/arch/powerpc/include/db_machdep.h:1.28	Mon Jul  6 09:34:17 2020
+++ src/sys/arch/powerpc/include/db_machdep.h	Wed Jan  6 08:14:34 2021
@@ -1,5 +1,5 @@
 /*	$OpenBSD: db_machdep.h,v 1.2 1997/03/21 00:48:48 niklas Exp $	*/
-/*	$NetBSD: db_machdep.h,v 1.28 2020/07/06 09:34:17 rin Exp $	*/
+/*	$NetBSD: db_machdep.h,v 1.29 2021/01/06 08:14:34 rin Exp $	*/
 
 /* 
  * Mach Operating System
@@ -71,8 +71,8 @@ extern	db_regs_t	ddb_regs;		/* register 
 #define	BKPT_SIZE	(4)		/* size of breakpoint inst */
 #define	BKPT_SET(inst, addr)	(BKPT_INST)
 
-#ifndef PPC_IBM4XX
-#define SR_SINGLESTEP	0x400
+#if !defined(PPC_BOOKE) && !defined(PPC_IBM4XX)
+#define	SR_SINGLESTEP	0x400		/* PSL_SE, available only for oea */
 #define	db_clear_single_step(regs)	((regs)->msr &= ~SR_SINGLESTEP)
 #define	db_set_single_step(regs)	((regs)->msr |=  SR_SINGLESTEP)
 #else



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

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 13:20:55 UTC 2020

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

Log Message:
Use (CI_SAVEMAX*CPUSAVE_LEN) as CPUSAVE_SIZE for MODULAR || _MODULE,
since it exceeds 128 (256 for now).

XXX
We should use CTASSERT here, but it conflicts with genassym...


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/sys/arch/powerpc/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/powerpc/include/cpu.h
diff -u src/sys/arch/powerpc/include/cpu.h:1.112 src/sys/arch/powerpc/include/cpu.h:1.113
--- src/sys/arch/powerpc/include/cpu.h:1.112	Mon Jul  6 10:50:32 2020
+++ src/sys/arch/powerpc/include/cpu.h	Mon Jul  6 13:20:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.112 2020/07/06 10:50:32 rin Exp $	*/
+/*	$NetBSD: cpu.h,v 1.113 2020/07/06 13:20:55 rin Exp $	*/
 
 /*
  * Copyright (C) 1999 Wolfgang Solfrank.
@@ -98,10 +98,11 @@ struct cpu_info {
 #define	CI_SAVEMMU	(3*CPUSAVE_LEN)
 #define	CI_SAVEMAX	(4*CPUSAVE_LEN)
 #define	CPUSAVE_LEN	8
-#if !defined(PPC_BOOKE) && !defined(MODULAR) && !defined(_MODULE)
-#define	CPUSAVE_SIZE	(CI_SAVEMAX*CPUSAVE_LEN)
-#else
+#if defined(PPC_BOOKE) && !defined(MODULAR) && !defined(_MODULE)
 #define	CPUSAVE_SIZE	128
+#else
+#define	CPUSAVE_SIZE	(CI_SAVEMAX*CPUSAVE_LEN)
+// XXX CTASSERT(CPUSAVE_SIZE >= 128);
 #endif
 #define	CPUSAVE_R28	0		/* where r28 gets saved */
 #define	CPUSAVE_R29	1		/* where r29 gets saved */



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

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 10:57:03 UTC 2020

Modified Files:
src/sys/arch/powerpc/include/oea: pmap.h

Log Message:
Include missing opt_modular.h so that struct vm_page_md is compatible to
that for booke.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/powerpc/include/oea/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/powerpc/include/oea/pmap.h
diff -u src/sys/arch/powerpc/include/oea/pmap.h:1.31 src/sys/arch/powerpc/include/oea/pmap.h:1.32
--- src/sys/arch/powerpc/include/oea/pmap.h:1.31	Mon Jul  6 09:10:02 2020
+++ src/sys/arch/powerpc/include/oea/pmap.h	Mon Jul  6 10:57:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.31 2020/07/06 09:10:02 rin Exp $	*/
+/*	$NetBSD: pmap.h,v 1.32 2020/07/06 10:57:03 rin Exp $	*/
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -44,6 +44,7 @@
 
 #ifdef _KERNEL_OPT
 #include "opt_ppcarch.h"
+#include "opt_modular.h"
 #endif
 #include 
 



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

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 10:50:32 UTC 2020

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

Log Message:
Drop unused opt_lockdebug.h.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/arch/powerpc/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/powerpc/include/cpu.h
diff -u src/sys/arch/powerpc/include/cpu.h:1.111 src/sys/arch/powerpc/include/cpu.h:1.112
--- src/sys/arch/powerpc/include/cpu.h:1.111	Sat Jun 27 07:33:51 2020
+++ src/sys/arch/powerpc/include/cpu.h	Mon Jul  6 10:50:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.111 2020/06/27 07:33:51 macallan Exp $	*/
+/*	$NetBSD: cpu.h,v 1.112 2020/07/06 10:50:32 rin Exp $	*/
 
 /*
  * Copyright (C) 1999 Wolfgang Solfrank.
@@ -45,7 +45,6 @@ struct cache_info {
 
 #if defined(_KERNEL) || defined(_KMEMUSER)
 #if defined(_KERNEL_OPT)
-#include "opt_lockdebug.h"
 #include "opt_modular.h"
 #include "opt_multiprocessor.h"
 #include "opt_ppcarch.h"



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

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 09:10:02 UTC 2020

Modified Files:
src/sys/arch/powerpc/include/oea: pmap.h

Log Message:
LKM was gone.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/powerpc/include/oea/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/powerpc/include/oea/pmap.h
diff -u src/sys/arch/powerpc/include/oea/pmap.h:1.30 src/sys/arch/powerpc/include/oea/pmap.h:1.31
--- src/sys/arch/powerpc/include/oea/pmap.h:1.30	Sat Mar 14 14:05:43 2020
+++ src/sys/arch/powerpc/include/oea/pmap.h	Mon Jul  6 09:10:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.30 2020/03/14 14:05:43 ad Exp $	*/
+/*	$NetBSD: pmap.h,v 1.31 2020/07/06 09:10:02 rin Exp $	*/
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -38,7 +38,7 @@
 #error use assym.h instead
 #endif
 
-#if defined(_LKM) || defined(_MODULE)
+#ifdef _MODULE
 #error this file should not be included by loadable kernel modules
 #endif
 



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

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 08:26:10 UTC 2020

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

Log Message:
Correct #ifdef; _MODULE not _MODULAR here.

Now __HAVE_PMAP_PHYSSEG is defined correctly for modules, which was
missing accidentally.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/powerpc/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/powerpc/include/vmparam.h
diff -u src/sys/arch/powerpc/include/vmparam.h:1.23 src/sys/arch/powerpc/include/vmparam.h:1.24
--- src/sys/arch/powerpc/include/vmparam.h:1.23	Sat Jun 27 02:51:23 2020
+++ src/sys/arch/powerpc/include/vmparam.h	Mon Jul  6 08:26:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.23 2020/06/27 02:51:23 rin Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.24 2020/07/06 08:26:10 rin Exp $	*/
 
 #ifndef _POWERPC_VMPARAM_H_
 #define _POWERPC_VMPARAM_H_
@@ -77,7 +77,7 @@ extern const char __USRSTACK;		/* let th
 
 #endif /* !_MODULE */
 
-#if defined(MODULAR) || defined(_MODULAR)
+#if defined(MODULAR) || defined(_MODULE)
 /*
  * If we are a module or support modules, we need to define a compatible
  * pmap_physseg since IBM4XX uses one.  This will waste a tiny of space



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

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 08:20:40 UTC 2020

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

Log Message:
Consistently use _LP64 instead of __LP64__, although both are defined for
powerpc64.

No binary changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/powerpc/include/asm.h

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

Modified files:

Index: src/sys/arch/powerpc/include/asm.h
diff -u src/sys/arch/powerpc/include/asm.h:1.51 src/sys/arch/powerpc/include/asm.h:1.52
--- src/sys/arch/powerpc/include/asm.h:1.51	Sat Apr 18 10:37:37 2020
+++ src/sys/arch/powerpc/include/asm.h	Mon Jul  6 08:20:40 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.51 2020/04/18 10:37:37 joerg Exp $	*/
+/*	$NetBSD: asm.h,v 1.52 2020/07/06 08:20:40 rin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -81,7 +81,7 @@
 #  define PIC_TOCSETUP(n, r)
 # endif /* __PIC__ */
 
-#endif /* __LP64__ */
+#endif /* _LP64 */
 
 #define	_C_LABEL(x)	x
 #define	_ASM_LABEL(x)	x
@@ -148,7 +148,7 @@ y:	.quad	.##y,.TOC.@tocbase,0;	\
 
 # define ENTRY_NOPROFILE(y) _ENTRY(_C_LABEL(y))
 # define ASENTRY(y)	_ENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE
-#endif /* __LP64__ */
+#endif /* _LP64 */
 
 #define	GLOBAL(y)	_GLOBAL(_C_LABEL(y))
 
@@ -369,7 +369,7 @@ y:	.quad	.##y,.TOC.@tocbase,0;	\
 # define cmplongli	cmplwi
 # define cmpregli	cmplwi
 
-#else /* __LP64__ */
+#else /* _LP64 */
 
 # define ldlong		ld	/* load "C" long */
 # define ldlongu	ldu	/* load "C" long with update */
@@ -414,7 +414,7 @@ y:	.quad	.##y,.TOC.@tocbase,0;	\
 # define cmplongli	cmpldi
 # define cmpregli	cmpldi
 
-#endif /* __LP64__ */
+#endif /* _LP64 */
 
 #ifdef _LOCORE
 .macro	stmd	r,dst
@@ -435,7 +435,7 @@ y:	.quad	.##y,.TOC.@tocbase,0;	\
 #endif /* _LOCORE */
 
 #if defined(IBM405_ERRATA77) || \
-((defined(_MODULE) || !defined(_KERNEL)) && !defined(__LP64__))
+((defined(_MODULE) || !defined(_KERNEL)) && !defined(_LP64))
 /*
  * Workaround for IBM405 Errata 77 (CPU_210): interrupted stwcx. may
  * errantly write data to memory



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

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 08:18:57 UTC 2020

Modified Files:
src/sys/arch/powerpc/include: frame.h

Log Message:
LKM was gone. _KERNEL is always defined for module.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/powerpc/include/frame.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/powerpc/include/frame.h
diff -u src/sys/arch/powerpc/include/frame.h:1.27 src/sys/arch/powerpc/include/frame.h:1.28
--- src/sys/arch/powerpc/include/frame.h:1.27	Sun Jan 24 19:49:35 2016
+++ src/sys/arch/powerpc/include/frame.h	Mon Jul  6 08:18:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.27 2016/01/24 19:49:35 christos Exp $	*/
+/*	$NetBSD: frame.h,v 1.28 2020/07/06 08:18:57 rin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -159,7 +159,7 @@ struct ktrapframe {
 	__register_t ktf_cframe_lr;	/* for DDB */
 };
 
-#if defined(_KERNEL) || defined(_LKM)
+#if defined(_KERNEL)
 #ifdef _LP64
 struct utrapframe32 {
 	__register32_t fixreg[32];
@@ -174,7 +174,7 @@ struct utrapframe32 {
 	int spare;
 };
 #endif
-#endif /* _KERNEL || _LKM */
+#endif /* _KERNEL */
 
 /*
  * This is to ensure alignment of the stackpointer



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

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 08:17:01 UTC 2020

Modified Files:
src/sys/arch/powerpc/include: pmap.h
src/sys/arch/powerpc/include/oea: pte.h

Log Message:
Fix comments. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/powerpc/include/pmap.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/powerpc/include/oea/pte.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/powerpc/include/pmap.h
diff -u src/sys/arch/powerpc/include/pmap.h:1.39 src/sys/arch/powerpc/include/pmap.h:1.40
--- src/sys/arch/powerpc/include/pmap.h:1.39	Sat Jun 27 02:40:24 2020
+++ src/sys/arch/powerpc/include/pmap.h	Mon Jul  6 08:17:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.39 2020/06/27 02:40:24 rin Exp $	*/
+/*	$NetBSD: pmap.h,v 1.40 2020/07/06 08:17:01 rin Exp $	*/
 
 #ifndef _POWERPC_PMAP_H_
 #define _POWERPC_PMAP_H_
@@ -35,7 +35,7 @@
 struct vm_page_md {
 	uintptr_t mdpg_dummy[5];
 };
-#endif /* !__HVE_VM_PAGE_MD */
+#endif /* !__HAVE_VM_PAGE_MD */
 
 __CTASSERT(sizeof(struct vm_page_md) == sizeof(uintptr_t)*5);
 

Index: src/sys/arch/powerpc/include/oea/pte.h
diff -u src/sys/arch/powerpc/include/oea/pte.h:1.9 src/sys/arch/powerpc/include/oea/pte.h:1.10
--- src/sys/arch/powerpc/include/oea/pte.h:1.9	Tue Feb  5 18:10:47 2008
+++ src/sys/arch/powerpc/include/oea/pte.h	Mon Jul  6 08:17:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pte.h,v 1.9 2008/02/05 18:10:47 garbled Exp $	*/
+/*	$NetBSD: pte.h,v 1.10 2020/07/06 08:17:01 rin Exp $	*/
 
 /*-
  * Copyright (C) 2003 Matt Thomas
@@ -46,7 +46,7 @@ struct pte {
 	register64_t pte_hi;
 	register64_t pte_lo;
 };
-#else	/* PPC_OEA || PPC_OEA64 */
+#else	/* PMAP_OEA */
 struct pte {
 	register_t pte_hi;
 	register_t pte_lo;



CVS commit: src/sys/arch/powerpc/include/booke

2020-07-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  6 08:14:54 UTC 2020

Modified Files:
src/sys/arch/powerpc/include/booke: e500var.h

Log Message:
e500_cpunode_submatch() should be declared regardless of _KERNEL_OPT.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/include/booke/e500var.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/powerpc/include/booke/e500var.h
diff -u src/sys/arch/powerpc/include/booke/e500var.h:1.7 src/sys/arch/powerpc/include/booke/e500var.h:1.8
--- src/sys/arch/powerpc/include/booke/e500var.h:1.7	Tue Nov 27 19:24:47 2012
+++ src/sys/arch/powerpc/include/booke/e500var.h	Mon Jul  6 08:14:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: e500var.h,v 1.7 2012/11/27 19:24:47 matt Exp $	*/
+/*	$NetBSD: e500var.h,v 1.8 2020/07/06 08:14:54 rin Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -78,9 +78,7 @@ struct e500_truthtab {
 u_int	e500_truth_decode(u_int, uint32_t, const struct e500_truthtab *,
 	size_t, u_int);
 uint16_t e500_get_svr(void);
-#ifdef _KERNEL_OPT
 int	e500_cpunode_submatch(device_t, cfdata_t, const char *, void *);
-#endif
 
 /*
  * Used by MP hatch code to fetch the TLB1 entries so they be setup on the



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

2020-06-27 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Jun 27 07:33:51 UTC 2020

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

Log Message:
apply __HIDE_DELAY so zfs and friends at least compile


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/arch/powerpc/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/powerpc/include/cpu.h
diff -u src/sys/arch/powerpc/include/cpu.h:1.110 src/sys/arch/powerpc/include/cpu.h:1.111
--- src/sys/arch/powerpc/include/cpu.h:1.110	Sun Dec  1 15:34:45 2019
+++ src/sys/arch/powerpc/include/cpu.h	Sat Jun 27 07:33:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.110 2019/12/01 15:34:45 ad Exp $	*/
+/*	$NetBSD: cpu.h,v 1.111 2020/06/27 07:33:51 macallan Exp $	*/
 
 /*
  * Copyright (C) 1999 Wolfgang Solfrank.
@@ -416,8 +416,10 @@ void	cpu_debug_dump(void);
 
 #define	cpu_proc_fork(p1, p2)
 
+#ifndef __HIDE_DELAY
 #define	DELAY(n)		delay(n)
 void	delay(unsigned int);
+#endif /* __HIDE_DELAY */
 
 #define	CLKF_USERMODE(cf)	cpu_clkf_usermode(cf)
 #define	CLKF_PC(cf)		cpu_clkf_pc(cf)



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

2020-06-26 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 27 02:51:23 UTC 2020

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

Log Message:
Restrict {MIN,MAX}_PAGE_SIZE for MODULAR || _MODULE, which makes
non-MODULAR kernel a little bit efficient.

They are also exposed to userland for jemalloc.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/powerpc/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/powerpc/include/vmparam.h
diff -u src/sys/arch/powerpc/include/vmparam.h:1.22 src/sys/arch/powerpc/include/vmparam.h:1.23
--- src/sys/arch/powerpc/include/vmparam.h:1.22	Fri Mar 29 12:51:15 2019
+++ src/sys/arch/powerpc/include/vmparam.h	Sat Jun 27 02:51:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.22 2019/03/29 12:51:15 christos Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.23 2020/06/27 02:51:23 rin Exp $	*/
 
 #ifndef _POWERPC_VMPARAM_H_
 #define _POWERPC_VMPARAM_H_
@@ -28,15 +28,18 @@
 #define VM_DEFAULT_ADDRESS_BOTTOMUP(da, sz) \
 round_page((vaddr_t)(da) + (vsize_t)maxdmap)
 
+#if defined(MODULAR) || defined(_MODULE) || !defined(_KERNEL)
 /*
  * If we are a module or a modular kernel, then we need to defined the range
  * of our varible page sizes since BOOKE and OEA use 4KB pages while IBM4XX
  * use 16KB pages.
+ * This is also required for userland by jemalloc.
  */
 #define MIN_PAGE_SHIFT	12			/* BOOKE/OEA */
 #define MAX_PAGE_SHIFT	14			/* IBM4XX */
 #define	MIN_PAGE_SIZE	(1 << MIN_PAGE_SHIFT)
 #define	MAX_PAGE_SIZE	(1 << MAX_PAGE_SHIFT)
+#endif /* MODULAR || _MODULE || !_KERNEL */
 
 #if defined(_MODULE)
 #if defined(_RUMPKERNEL)



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

2020-06-26 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 27 02:40:24 UTC 2020

Modified Files:
src/sys/arch/powerpc/include: pmap.h

Log Message:
Fix MODULAR support for ibm4xx by providing __nothing as VM_MDPAGE_INIT().


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/powerpc/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/powerpc/include/pmap.h
diff -u src/sys/arch/powerpc/include/pmap.h:1.38 src/sys/arch/powerpc/include/pmap.h:1.39
--- src/sys/arch/powerpc/include/pmap.h:1.38	Mon Jun 20 21:45:16 2011
+++ src/sys/arch/powerpc/include/pmap.h	Sat Jun 27 02:40:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.38 2011/06/20 21:45:16 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.39 2020/06/27 02:40:24 rin Exp $	*/
 
 #ifndef _POWERPC_PMAP_H_
 #define _POWERPC_PMAP_H_
@@ -30,6 +30,7 @@
  */
 #ifndef __HAVE_VM_PAGE_MD
 #define __HAVE_VM_PAGE_MD
+#define VM_MDPAGE_INIT(pg) __nothing
 
 struct vm_page_md {
 	uintptr_t mdpg_dummy[5];



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

2020-04-18 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Apr 18 10:37:37 UTC 2020

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

Log Message:
It's __RCSID for an extra level of indirection on PPC


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/powerpc/include/asm.h

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

Modified files:

Index: src/sys/arch/powerpc/include/asm.h
diff -u src/sys/arch/powerpc/include/asm.h:1.50 src/sys/arch/powerpc/include/asm.h:1.51
--- src/sys/arch/powerpc/include/asm.h:1.50	Fri Apr 17 14:19:44 2020
+++ src/sys/arch/powerpc/include/asm.h	Sat Apr 18 10:37:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.50 2020/04/17 14:19:44 joerg Exp $	*/
+/*	$NetBSD: asm.h,v 1.51 2020/04/18 10:37:37 joerg Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -156,7 +156,7 @@ y:	.quad	.##y,.TOC.@tocbase,0;	\
 
 #undef __RCSID
 #define RCSID(x)	__RCSID(x)
-#define RCSID(x)	.pushsection ".ident","MS",@progbits,1;		\
+#define __RCSID(x)	.pushsection ".ident","MS",@progbits,1;		\
 			.asciz x;	\
 			.popsection
 



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

2020-04-16 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Apr 16 22:11:12 UTC 2020

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

Log Message:
Discard __HAVE_UNLOCKED_PMAP for 4xx; 4xx is uniprocessor architecture,
and everything gets more than 10 times slower by __HAVE_UNLOCKED_PMAP.

Note that we support three supervisor-level architectures for powerpc:
oea, booke, and 4xx. We have three different implementations of pmap as
a result. Whereas oea and booke support multiprocessor, 4xx does not.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/powerpc/include/types.h

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

Modified files:

Index: src/sys/arch/powerpc/include/types.h
diff -u src/sys/arch/powerpc/include/types.h:1.61 src/sys/arch/powerpc/include/types.h:1.62
--- src/sys/arch/powerpc/include/types.h:1.61	Sun Mar 22 17:33:58 2020
+++ src/sys/arch/powerpc/include/types.h	Thu Apr 16 22:11:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.61 2020/03/22 17:33:58 ad Exp $	*/
+/*	$NetBSD: types.h,v 1.62 2020/04/16 22:11:12 rin Exp $	*/
 
 /*-
  * Copyright (C) 1995 Wolfgang Solfrank.
@@ -34,6 +34,10 @@
 #ifndef	_POWERPC_TYPES_H_
 #define	_POWERPC_TYPES_H_
 
+#ifdef _KERNEL_OPT
+#include "opt_ppcarch.h"
+#endif
+
 #include 
 #include 
 #include 
@@ -103,7 +107,9 @@ typedef __uint32_t tlb_asid_t;		/* for b
 #define	__HAVE_RAS
 #endif
 
+#ifndef PPC_IBM4XX
 /* XXX temporary */
 #define	__HAVE_UNLOCKED_PMAP
+#endif
 
 #endif	/* _POWERPC_TYPES_H_ */



CVS commit: src/sys/arch/powerpc/include/booke

2020-04-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Apr  8 10:57:16 UTC 2020

Modified Files:
src/sys/arch/powerpc/include/booke: pmap.h

Log Message:
Simplify #ifdefs


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/powerpc/include/booke/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/powerpc/include/booke/pmap.h
diff -u src/sys/arch/powerpc/include/booke/pmap.h:1.20 src/sys/arch/powerpc/include/booke/pmap.h:1.21
--- src/sys/arch/powerpc/include/booke/pmap.h:1.20	Thu Mar 12 23:09:59 2020
+++ src/sys/arch/powerpc/include/booke/pmap.h	Wed Apr  8 10:57:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.20 2020/03/12 23:09:59 thorpej Exp $	*/
+/*	$NetBSD: pmap.h,v 1.21 2020/04/08 10:57:16 skrll Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -140,9 +140,7 @@ static __inline void
 pmap_md_vca_clean(struct vm_page *pg, vaddr_t va, int op)
 {
 }
-#endif
 
-#ifdef __PMAP_PRIVATE
 static __inline size_t
 pmap_md_tlb_asid_max(void)
 {



CVS commit: src/sys/arch/powerpc/include/booke

2020-03-12 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Mar 12 23:09:59 UTC 2020

Modified Files:
src/sys/arch/powerpc/include/booke: pmap.h

Log Message:
If we're going to consult the MULTIPROCESSOR option, we should pull in
"opt_multiprocessor.h".


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/powerpc/include/booke/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/powerpc/include/booke/pmap.h
diff -u src/sys/arch/powerpc/include/booke/pmap.h:1.19 src/sys/arch/powerpc/include/booke/pmap.h:1.20
--- src/sys/arch/powerpc/include/booke/pmap.h:1.19	Wed Mar 11 13:30:31 2020
+++ src/sys/arch/powerpc/include/booke/pmap.h	Thu Mar 12 23:09:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.19 2020/03/11 13:30:31 thorpej Exp $	*/
+/*	$NetBSD: pmap.h,v 1.20 2020/03/12 23:09:59 thorpej Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -45,6 +45,7 @@
 #endif
 
 #ifdef _KERNEL_OPT
+#include "opt_multiprocessor.h"
 #include "opt_pmap.h"
 #endif
 



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

2020-02-21 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Feb 21 12:56:37 UTC 2020

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

Log Message:
Reduce UPAGES from 2 to 1 for ibm4xx, which was originally 1 and bumped
to 2 in rev 1.29:


http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/powerpc/include/param.h#rev1.29

Since page size is 16KB on ibm4xx, USPACE is still 16KB, which is the
same size as on other powerpc processors.

This avoids kernel crash described in PR kern/54994. Also, even if the
PR is resolved, fork(2) easily fails with ENOMEM if UPAGES is 2, which
requires physically contiguous pages for u-area. No bad side effect is
observed as far as I can see.

XXX
Even with this commit, kern/54994 still critically affects other archs
with __HAVE_CPU_UAREA_ROUTINES, i.e., alpha, mips, powerpc/{oea,booke},
and riscv.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/powerpc/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/powerpc/include/param.h
diff -u src/sys/arch/powerpc/include/param.h:1.31 src/sys/arch/powerpc/include/param.h:1.32
--- src/sys/arch/powerpc/include/param.h:1.31	Mon Jan  7 22:00:32 2019
+++ src/sys/arch/powerpc/include/param.h	Fri Feb 21 12:56:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.31 2019/01/07 22:00:32 jdolecek Exp $	*/
+/*	$NetBSD: param.h,v 1.32 2020/02/21 12:56:37 rin Exp $	*/
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -67,7 +67,7 @@
 
 #ifdef PPC_IBM4XX
 #define	PGSHIFT		14	/* Use 16KB to reduce TLB thrashing */
-#define	UPAGES		2
+#define	UPAGES		1
 #else
 #define	PGSHIFT		12
 #define	UPAGES		4



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

2020-02-19 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Feb 20 04:59:43 UTC 2020

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

Log Message:
Fix !__HAVE_FAST_SOFTINTS build for debugging.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/powerpc/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/powerpc/include/intr.h
diff -u src/sys/arch/powerpc/include/intr.h:1.14 src/sys/arch/powerpc/include/intr.h:1.15
--- src/sys/arch/powerpc/include/intr.h:1.14	Thu Oct 24 23:03:35 2019
+++ src/sys/arch/powerpc/include/intr.h	Thu Feb 20 04:59:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.14 2019/10/24 23:03:35 macallan Exp $ */
+/*	$NetBSD: intr.h,v 1.15 2020/02/20 04:59:43 rin Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -28,7 +28,7 @@
 
 #ifndef _LOCORE
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.h,v 1.14 2019/10/24 23:03:35 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.h,v 1.15 2020/02/20 04:59:43 rin Exp $");
 #endif
 
 #ifndef _POWERPC_INTR_MACHDEP_H_
@@ -92,8 +92,10 @@ struct intrhand {
 
 void softint_fast_dispatch(struct lwp *, int);
 
+#ifdef __HAVE_FAST_SOFTINTS
 #define softint_init_md		powerpc_softint_init_md
 #define softint_trigger		powerpc_softint_trigger
+#endif
 
 #ifdef __IMASK_T
 typedef __IMASK_T imask_t;



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

2019-12-14 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Dec 15 06:05:00 UTC 2019

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

Log Message:
Do not mask out LK bit (bit 31) from M_BCTR, which distinguishes
bcctr and bcctrl.

Fix build failure for ibm4xx kernels with GCC8.

XXX
pullup to netbsd-9, -8, and -7


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/powerpc/include/db_machdep.h

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

Modified files:

Index: src/sys/arch/powerpc/include/db_machdep.h
diff -u src/sys/arch/powerpc/include/db_machdep.h:1.26 src/sys/arch/powerpc/include/db_machdep.h:1.27
--- src/sys/arch/powerpc/include/db_machdep.h:1.26	Mon Nov  6 03:47:48 2017
+++ src/sys/arch/powerpc/include/db_machdep.h	Sun Dec 15 06:05:00 2019
@@ -1,5 +1,5 @@
 /*	$OpenBSD: db_machdep.h,v 1.2 1997/03/21 00:48:48 niklas Exp $	*/
-/*	$NetBSD: db_machdep.h,v 1.26 2017/11/06 03:47:48 christos Exp $	*/
+/*	$NetBSD: db_machdep.h,v 1.27 2019/12/15 06:05:00 rin Exp $	*/
 
 /* 
  * Mach Operating System
@@ -98,7 +98,7 @@ extern	db_regs_t	ddb_regs;		/* register 
 #define M_B		0xfc01
 #define I_B		0x4800
 #define I_BL		0x4801
-#define	M_BCTR		0xfc0007fe
+#define	M_BCTR		0xfc0007ff
 #define	I_BCTR		0x4c000420
 #define	I_BCTRL		0x4c000421
 #define	M_RFI		0xfc0007fe



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

2019-12-08 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Dec  8 21:46:03 UTC 2019

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

Log Message:
Fix typo in the definition of #ha() in a comment.


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

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

Modified files:

Index: src/sys/arch/powerpc/include/elf_machdep.h
diff -u src/sys/arch/powerpc/include/elf_machdep.h:1.15 src/sys/arch/powerpc/include/elf_machdep.h:1.16
--- src/sys/arch/powerpc/include/elf_machdep.h:1.15	Mon Nov  6 19:20:54 2017
+++ src/sys/arch/powerpc/include/elf_machdep.h	Sun Dec  8 21:46:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf_machdep.h,v 1.15 2017/11/06 19:20:54 christos Exp $	*/
+/*	$NetBSD: elf_machdep.h,v 1.16 2019/12/08 21:46:03 uwe Exp $	*/
 
 #ifndef _POWERPC_ELF_MACHDEP_H_
 #define _POWERPC_ELF_MACHDEP_H_
@@ -71,7 +71,7 @@
 // 
 // #lo(x) = (x & 0x)
 // #hi(x) = ((x >> 16) & 0x)
-// #ha(x) = (((x >> 16) + ((x & 0x8) == 0x8000)) & 0x)
+// #ha(x) = (((x >> 16) + ((x & 0x8000) == 0x8000)) & 0x)
 // #higher(x) = ((x >> 32) & 0x)
 // #highera(x) =
 //(((x >> 32) + ((x & 0x8000) == 0x8000)) & 0x)



CVS commit: src/sys/arch/powerpc/include/ibm4xx

2019-03-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 27 19:30:31 UTC 2019

Modified Files:
src/sys/arch/powerpc/include/ibm4xx: vmparam.h

Log Message:
fix protection


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/powerpc/include/ibm4xx/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/powerpc/include/ibm4xx/vmparam.h
diff -u src/sys/arch/powerpc/include/ibm4xx/vmparam.h:1.11 src/sys/arch/powerpc/include/ibm4xx/vmparam.h:1.12
--- src/sys/arch/powerpc/include/ibm4xx/vmparam.h:1.11	Mon Feb 13 04:46:30 2017
+++ src/sys/arch/powerpc/include/ibm4xx/vmparam.h	Wed Mar 27 15:30:31 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.11 2017/02/13 09:46:30 skrll Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.12 2019/03/27 19:30:31 christos Exp $	*/
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -31,8 +31,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef _MACHINE_VMPARAM_H_
-#define _MACHINE_VMPARAM_H_
+#ifndef _POWERPC_IBM4XX_VMPARAM_H_
+#define _POWERPC_IBM4XX_VMPARAM_H_
 
 /*
  * We use 16K pages on IBM4xx CPUs.  Override the PAGE_* definitions
@@ -101,4 +101,4 @@ struct pmap_physseg {
 
 #define VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH
 
-#endif /* _MACHINE_VMPARAM_H_ */
+#endif /* _POWERPC_IBM4XX_VMPARAM_H_ */



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

2019-03-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 27 16:16:43 UTC 2019

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

Log Message:
Provide the (max) defaults for page size for userland.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/powerpc/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/powerpc/include/vmparam.h
diff -u src/sys/arch/powerpc/include/vmparam.h:1.20 src/sys/arch/powerpc/include/vmparam.h:1.21
--- src/sys/arch/powerpc/include/vmparam.h:1.20	Fri Jun 23 17:28:38 2017
+++ src/sys/arch/powerpc/include/vmparam.h	Wed Mar 27 12:16:43 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.20 2017/06/23 21:28:38 joerg Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.21 2019/03/27 16:16:43 christos Exp $	*/
 
 #ifndef _POWERPC_VMPARAM_H_
 #define _POWERPC_VMPARAM_H_
@@ -28,15 +28,15 @@
 #define VM_DEFAULT_ADDRESS_BOTTOMUP(da, sz) \
 round_page((vaddr_t)(da) + (vsize_t)maxdmap)
 
-#if defined(_MODULE) || defined(MODULAR)
 /*
  * If we are a module or a modular kernel, then we need to defined the range
  * of our varible page sizes since BOOKE and OEA use 4KB pages while IBM4XX
  * use 16KB pages.
  */
-#define	MIN_PAGE_SIZE	4096		/* BOOKE/OEA */
-#define	MAX_PAGE_SIZE	16384		/* IBM4XX */
-#endif
+#define MIN_PAGE_SHIFT	12			/* BOOKE/OEA */
+#define MAX_PAGE_SHIFT	14			/* IBM4XX */
+#define	MIN_PAGE_SIZE	(1 << MIN_PAGE_SHIFT)
+#define	MAX_PAGE_SIZE	(1 << MAX_PAGE_SHIFT)
 
 #if defined(_MODULE)
 #if defined(_RUMPKERNEL)
@@ -70,6 +70,10 @@ extern const char __USRSTACK;		/* let th
 #include 
 #elif defined(_KERNEL)
 #error unknown PPC variant
+#else
+#define PAGE_SHIFT  MAX_PAGE_SHIFT
+#define PAGE_SIZE   (1 << PAGE_SHIFT)
+#define PAGE_MASK   (PAGE_SIZE - 1)
 #endif
 
 #endif /* !_MODULE */



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

2018-06-01 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Jun  1 18:18:11 UTC 2018

Modified Files:
src/sys/arch/powerpc/include/oea: spr.h

Log Message:
add functions to access SCOM registers on 970 CPUs


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/include/oea/spr.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/powerpc/include/oea/spr.h
diff -u src/sys/arch/powerpc/include/oea/spr.h:1.5 src/sys/arch/powerpc/include/oea/spr.h:1.6
--- src/sys/arch/powerpc/include/oea/spr.h:1.5	Fri May  4 16:57:14 2018
+++ src/sys/arch/powerpc/include/oea/spr.h	Fri Jun  1 18:18:11 2018
@@ -1,8 +1,17 @@
-/*	$NetBSD: spr.h,v 1.5 2018/05/04 16:57:14 macallan Exp $	*/
+/*	$NetBSD: spr.h,v 1.6 2018/06/01 18:18:11 macallan Exp $	*/
 
 #ifndef _POWERPC_OEA_SPR_H_
 #define	_POWERPC_OEA_SPR_H_
 
+#if !defined(_LOCORE) && defined(_KERNEL)
+#if defined(PPC_OEA64_BRIDGE) || defined (_ARCH_PPC64)
+
+#include 
+#include 
+
+#endif
+#endif
+
 /*
  * Special Purpose Register declarations.
  *
@@ -299,4 +308,50 @@
 #define	PMCN_TBLTRANS		 3 /* TBL bit transitions */
 #define	PCMN_IDISPATCH		 4 /* Instructions dispatched */
 
+#if !defined(_LOCORE) && defined(_KERNEL)
+
+#if defined(PPC_OEA64_BRIDGE) || defined (_ARCH_PPC64)
+
+static inline uint64_t
+scom_read(register_t address)
+{
+	register_t msr;
+	uint64_t ret;
+
+	msr = mfmsr();
+	mtmsr(msr & ~PSL_EE);
+	__asm volatile("isync;");
+
+	mtspr(SPR_SCOMC, address | SCOMC_READ);
+	__asm volatile("isync;");
+
+	ret = mfspr(SPR_SCOMD);
+	mtmsr(msr);
+	__asm volatile("isync;");
+
+	return ret;
+}
+
+static inline void
+scom_write(register_t address, uint64_t data)
+{
+	register_t msr;
+
+	msr = mfmsr();
+	mtmsr(msr & ~PSL_EE);
+	__asm volatile("isync;");
+
+	mtspr(SPR_SCOMD, data);
+	__asm volatile("isync;");
+	mtspr(SPR_SCOMC, address | SCOMC_WRITE);
+	__asm volatile("isync;");
+	
+	mtmsr(msr);
+	__asm volatile("isync;");
+}
+
+#endif /* defined(PPC_OEA64_BRIDGE) || defined (_ARCH_PPC64) */
+
+#endif /* !defined(_LOCORE) && defined(_KERNEL) */
+
 #endif /* !_POWERPC_SPR_H_ */



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

2018-05-04 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri May  4 16:57:14 UTC 2018

Modified Files:
src/sys/arch/powerpc/include/oea: spr.h

Log Message:
add Hardware Interrupt Offset Register found on 970


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/powerpc/include/oea/spr.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/powerpc/include/oea/spr.h
diff -u src/sys/arch/powerpc/include/oea/spr.h:1.4 src/sys/arch/powerpc/include/oea/spr.h:1.5
--- src/sys/arch/powerpc/include/oea/spr.h:1.4	Fri Feb 16 18:04:06 2018
+++ src/sys/arch/powerpc/include/oea/spr.h	Fri May  4 16:57:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: spr.h,v 1.4 2018/02/16 18:04:06 macallan Exp $	*/
+/*	$NetBSD: spr.h,v 1.5 2018/05/04 16:57:14 macallan Exp $	*/
 
 #ifndef _POWERPC_OEA_SPR_H_
 #define	_POWERPC_OEA_SPR_H_
@@ -85,6 +85,7 @@
 #define   MPCe300c1		  0x8083
 #define   MPCe300c2		  0x8084
 #define   MPCe300c3		  0x8085
+#define SPR_HIOR		0x137	/*  HW Interrupt Offset (970) */
 
 #define	SPR_IBAT0U		0x210	/* ..68 Instruction BAT Reg 0 Upper */
 #define	SPR_IBAT0L		0x211	/* ..6. Instruction BAT Reg 0 Lower */



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

2018-03-22 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Mar 22 21:26:27 UTC 2018

Modified Files:
src/sys/arch/powerpc/include/oea: cpufeat.h

Log Message:
provide a wrapper for mapiodev() - if we have BATs just use the paddr, if
we don't then actually map it


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/powerpc/include/oea/cpufeat.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/powerpc/include/oea/cpufeat.h
diff -u src/sys/arch/powerpc/include/oea/cpufeat.h:1.4 src/sys/arch/powerpc/include/oea/cpufeat.h:1.5
--- src/sys/arch/powerpc/include/oea/cpufeat.h:1.4	Mon Apr 28 20:23:32 2008
+++ src/sys/arch/powerpc/include/oea/cpufeat.h	Thu Mar 22 21:26:27 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: cpufeat.h,v 1.4 2008/04/28 20:23:32 martin Exp $ */
+/* $NetBSD: cpufeat.h,v 1.5 2018/03/22 21:26:27 macallan Exp $ */
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -50,6 +50,10 @@
 #ifdef _KERNEL
 void cpu_model_init(void);
 extern unsigned long oeacpufeat;
+
+#define oea_mapiodev(addr, size) ((oeacpufeat & OEACPU_NOBAT) ? \
+			mapiodev((paddr_t)(addr), (size), 0) : (void *)(addr))
+
 #endif
 
 #endif /* _POWERPC_OEA_OEAFEAT_H_ */



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

2018-03-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar  5 00:20:08 UTC 2018

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

Log Message:
int64 is long for _LP64


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/include/int_fmtio.h

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

Modified files:

Index: src/sys/arch/powerpc/include/int_fmtio.h
diff -u src/sys/arch/powerpc/include/int_fmtio.h:1.6 src/sys/arch/powerpc/include/int_fmtio.h:1.7
--- src/sys/arch/powerpc/include/int_fmtio.h:1.6	Wed Apr  1 19:31:37 2015
+++ src/sys/arch/powerpc/include/int_fmtio.h	Sun Mar  4 19:20:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: int_fmtio.h,v 1.6 2015/04/01 23:31:37 matt Exp $	*/
+/*	$NetBSD: int_fmtio.h,v 1.7 2018/03/05 00:20:08 christos Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -44,38 +44,58 @@
 #define	PRId8		"d"	/* int8_t		*/
 #define	PRId16		"d"	/* int16_t		*/
 #define	PRId32		"d"	/* int32_t		*/
+#ifdef _LP64
+#define	PRId64		"ld"	/* int64_t		*/
+#else
 #define	PRId64		"lld"	/* int64_t		*/
+#endif
 #define	PRIdLEAST8	"d"	/* int_least8_t		*/
 #define	PRIdLEAST16	"d"	/* int_least16_t	*/
 #define	PRIdLEAST32	"d"	/* int_least32_t	*/
+#ifdef _LP64
+#define	PRIdLEAST64	"ld"	/* int_least64_t	*/
+#else
 #define	PRIdLEAST64	"lld"	/* int_least64_t	*/
+#endif
 #define	PRIdFAST8	"d"	/* int_fast8_t		*/
 #define	PRIdFAST16	"d"	/* int_fast16_t		*/
 #define	PRIdFAST32	"d"	/* int_fast32_t		*/
-#define	PRIdFAST64	"lld"	/* int_fast64_t		*/
-#define	PRIdMAX		"lld"	/* intmax_t		*/
 #ifdef _LP64
+#define	PRIdFAST64	"ld"	/* int_fast64_t		*/
+#define	PRIdMAX		"ld"	/* intmax_t		*/
 #define	PRIdPTR		"ld"	/* intptr_t		*/
 #else
+#define	PRIdFAST64	"lld"	/* int_fast64_t		*/
+#define	PRIdMAX		"lld"	/* intmax_t		*/
 #define	PRIdPTR		"d"	/* intptr_t		*/
 #endif
 
 #define	PRIi8		"i"	/* int8_t		*/
 #define	PRIi16		"i"	/* int16_t		*/
 #define	PRIi32		"i"	/* int32_t		*/
+#ifdef _LP64
+#define	PRIi64		"li"	/* int64_t		*/
+#else
 #define	PRIi64		"lli"	/* int64_t		*/
+#endif
 #define	PRIiLEAST8	"i"	/* int_least8_t		*/
 #define	PRIiLEAST16	"i"	/* int_least16_t	*/
 #define	PRIiLEAST32	"i"	/* int_least32_t	*/
+#ifdef _LP64
+#define	PRIiLEAST64	"li"	/* int_least64_t	*/
+#else
 #define	PRIiLEAST64	"lli"	/* int_least64_t	*/
+#endif
 #define	PRIiFAST8	"i"	/* int_fast8_t		*/
 #define	PRIiFAST16	"i"	/* int_fast16_t		*/
 #define	PRIiFAST32	"i"	/* int_fast32_t		*/
-#define	PRIiFAST64	"lli"	/* int_fast64_t		*/
-#define	PRIiMAX		"lli"	/* intmax_t		*/
 #ifdef _LP64
+#define	PRIiFAST64	"li"	/* int_fast64_t		*/
+#define	PRIiMAX		"li"	/* intmax_t		*/
 #define	PRIiPTR		"li"	/* intptr_t		*/
 #else
+#define	PRIiFAST64	"lli"	/* int_fast64_t		*/
+#define	PRIiMAX		"lli"	/* intmax_t		*/
 #define	PRIiPTR		"i"	/* intptr_t		*/
 #endif
 
@@ -84,76 +104,116 @@
 #define	PRIo8		"o"	/* uint8_t		*/
 #define	PRIo16		"o"	/* uint16_t		*/
 #define	PRIo32		"o"	/* uint32_t		*/
+#ifdef _LP64
+#define	PRIo64		"lo"	/* uint64_t		*/
+#else
 #define	PRIo64		"llo"	/* uint64_t		*/
+#endif
 #define	PRIoLEAST8	"o"	/* uint_least8_t	*/
 #define	PRIoLEAST16	"o"	/* uint_least16_t	*/
 #define	PRIoLEAST32	"o"	/* uint_least32_t	*/
+#ifdef _LP64
+#define	PRIoLEAST64	"lo"	/* uint_least64_t	*/
+#else
 #define	PRIoLEAST64	"llo"	/* uint_least64_t	*/
+#endif
 #define	PRIoFAST8	"o"	/* uint_fast8_t		*/
 #define	PRIoFAST16	"o"	/* uint_fast16_t	*/
 #define	PRIoFAST32	"o"	/* uint_fast32_t	*/
-#define	PRIoFAST64	"llo"	/* uint_fast64_t	*/
-#define	PRIoMAX		"llo"	/* uintmax_t		*/
 #ifdef _LP64
+#define	PRIoFAST64	"lo"	/* uint_fast64_t	*/
+#define	PRIoMAX		"lo"	/* uintmax_t		*/
 #define	PRIoPTR		"lo"	/* uintptr_t		*/
 #else
+#define	PRIoFAST64	"llo"	/* uint_fast64_t	*/
+#define	PRIoMAX		"llo"	/* uintmax_t		*/
 #define	PRIoPTR		"o"	/* uintptr_t		*/
 #endif
 
 #define	PRIu8		"u"	/* uint8_t		*/
 #define	PRIu16		"u"	/* uint16_t		*/
 #define	PRIu32		"u"	/* uint32_t		*/
+#ifdef _LP64
+#define	PRIu64		"lu"	/* uint64_t		*/
+#else
 #define	PRIu64		"llu"	/* uint64_t		*/
+#endif
 #define	PRIuLEAST8	"u"	/* uint_least8_t	*/
 #define	PRIuLEAST16	"u"	/* uint_least16_t	*/
 #define	PRIuLEAST32	"u"	/* uint_least32_t	*/
+#ifdef _LP64
+#define	PRIuLEAST64	"lu"	/* uint_least64_t	*/
+#else
 #define	PRIuLEAST64	"llu"	/* uint_least64_t	*/
+#endif
 #define	PRIuFAST8	"u"	/* uint_fast8_t		*/
 #define	PRIuFAST16	"u"	/* uint_fast16_t	*/
 #define	PRIuFAST32	"u"	/* uint_fast32_t	*/
-#define	PRIuFAST64	"llu"	/* uint_fast64_t	*/
-#define	PRIuMAX		"llu"	/* uintmax_t		*/
 #ifdef _LP64
+#define	PRIuFAST64	"lu"	/* uint_fast64_t	*/
+#define	PRIuMAX		"lu"	/* uintmax_t		*/
 #define	PRIuPTR		"lu"	/* uintptr_t		*/
 #else
+#define	PRIuFAST64	"llu"	/* uint_fast64_t	*/
+#define	PRIuMAX		"llu"	/* uintmax_t		*/
 #define	PRIuPTR		"u"	/* uintptr_t		*/
 #endif
 
 #define	PRIx8		"x"	/* uint8_t		*/
 #define	PRIx16		"x"	/* uint16_t		*/
 #define	PRIx32		"x"	/* uint32_t		*/
+#ifdef _LP64
+#define	PRIx64		"lx"	/* uint64_t		*/

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

2018-02-16 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Feb 16 18:04:06 UTC 2018

Modified Files:
src/sys/arch/powerpc/include/oea: hid.h spr.h

Log Message:
add a few pp970-specific bits


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/powerpc/include/oea/hid.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/include/oea/spr.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/powerpc/include/oea/hid.h
diff -u src/sys/arch/powerpc/include/oea/hid.h:1.11 src/sys/arch/powerpc/include/oea/hid.h:1.12
--- src/sys/arch/powerpc/include/oea/hid.h:1.11	Fri Jul  7 22:13:35 2017
+++ src/sys/arch/powerpc/include/oea/hid.h	Fri Feb 16 18:04:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: hid.h,v 1.11 2017/07/07 22:13:35 macallan Exp $	*/
+/*	$NetBSD: hid.h,v 1.12 2018/02/16 18:04:06 macallan Exp $	*/
 
 /*-
  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
@@ -172,4 +172,18 @@
 #define	HID1_SYNCBE	0x0800	/* Enable sync/eieio broadcast */
 #define	HID1_ABE	0x0400	/* Enable address broadcast */
 
+/* PPC970 HID4 */
+#define HID4_RMLR0	0x0020	/* real mode limit bit 0 */
+#define HID4_RMLR1	0x4000	/* real mode limit bit 1 */
+#define HID4_RMLR2	0x2000	/* real mode limit bit 2 */
+/*
+ * real mode limit bits 012
+ * 011 - 64MB
+ * 111 - 128MB
+ * 100 - 256MB
+ * x10 - 1GB
+ * x01 - 16GB
+ * 000 - 256GB
+ */
+
 #endif /* _POWERPC_OEA_HID_H_ */

Index: src/sys/arch/powerpc/include/oea/spr.h
diff -u src/sys/arch/powerpc/include/oea/spr.h:1.3 src/sys/arch/powerpc/include/oea/spr.h:1.4
--- src/sys/arch/powerpc/include/oea/spr.h:1.3	Tue Jul  7 15:41:46 2015
+++ src/sys/arch/powerpc/include/oea/spr.h	Fri Feb 16 18:04:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: spr.h,v 1.3 2015/07/07 15:41:46 macallan Exp $	*/
+/*	$NetBSD: spr.h,v 1.4 2018/02/16 18:04:06 macallan Exp $	*/
 
 #ifndef _POWERPC_OEA_SPR_H_
 #define	_POWERPC_OEA_SPR_H_
@@ -28,6 +28,15 @@
 #define	SPR_RTCL_W		0x015	/* ..6. 601 RTC Lower - Write */
 #define	SPR_SDR1		0x019	/* ..68 Page table base address register */
 #define	SPR_VRSAVE		0x100	/* ..6. AltiVec VRSAVE */
+#define SPR_SCOMC		0x114	/*  SCOM Control Register (970) */
+#define SPR_SCOMD		0x115	/*  SCOM Data Register (970) */
+#define  SCOM_PCR		  0x0aa00100	/* Power Control Register */
+#define  SCOM_PCR_BIT		  0x8000	/* Data bit */
+#define  SCOM_PSR		  0x40800100	/* Power Status Register */
+#define  PSR_RECEIVED		  (1ULL << 61)
+#define  PSR_COMPLETED		  (1ULL << 60)
+#define  SCOMC_READ		  0x8000
+#define  SCOMC_WRITE		  0x
 #define	SPR_ASR			0x118	/* ..6. Address Space Register (PPC64) */
 #define	SPR_EAR			0x11a	/* ..68 External Access Register */
 #define	  MPC601		  0x0001



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

2018-01-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jan 21 09:25:45 UTC 2018

Modified Files:
src/sys/arch/powerpc/include: spr.h

Log Message:
fix some logic errors in the previous and fix non-kernel builds.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/powerpc/include/spr.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/powerpc/include/spr.h
diff -u src/sys/arch/powerpc/include/spr.h:1.49 src/sys/arch/powerpc/include/spr.h:1.50
--- src/sys/arch/powerpc/include/spr.h:1.49	Sun Jan 21 08:46:48 2018
+++ src/sys/arch/powerpc/include/spr.h	Sun Jan 21 09:25:45 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: spr.h,v 1.49 2018/01/21 08:46:48 mrg Exp $	*/
+/*	$NetBSD: spr.h,v 1.50 2018/01/21 09:25:45 mrg Exp $	*/
 
 /*
  * Copyright (c) 2001, The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 #ifndef _POWERPC_SPR_H_
 #define	_POWERPC_SPR_H_
 
-#ifndef _LOCORE
+#if !defined(_LOCORE) && defined(_KERNEL)
 
 #include 
 
@@ -88,7 +88,7 @@ mtspr32(int reg, uint32_t val)
 static inline uint64_t
 mfspr(int reg)
 {
-	if ((oeacpufeat & OEACPU_64_BRIDGE) != 0)
+	if ((oeacpufeat & (OEACPU_64_BRIDGE|OEACPU_64)) != 0)
 		return mfspr64(reg);
 	return mfspr32(reg);
 }
@@ -96,24 +96,24 @@ mfspr(int reg)
 /* This as an inline breaks as 'reg' ends up not being an immediate */
 #define mtspr(reg, val)		\
 ( {\
-	if ((oeacpufeat & OEACPU_64_BRIDGE) != 0)		\
+	if ((oeacpufeat & (OEACPU_64_BRIDGE|OEACPU_64)) != 0)	\
 		mtspr64(reg, (uint64_t)val);			\
 	else			\
 		mtspr32(reg, val);\
 } )
 #else /* PPC_OEA + PPC_OEA64 + PPC_OEA64_BRIDGE != 1 */
 
-#if defined (PPC_OEA) || defined (PPC_OEA64_BRIDGE)
-#define mfspr(r) mfspr32(r)
-#define mtspr(r,v) mtspr32(r,v)
-#else
+#if defined(PPC_OEA64) || defined(PPC_OEA64_BRIDGE)
 #define mfspr(r) mfspr64(r)
 #define mtspr(r,v) mtspr64(r,v)
+#else
+#define mfspr(r) mfspr32(r)
+#define mtspr(r,v) mtspr32(r,v)
 #endif
 
 #endif /* PPC_OEA + PPC_OEA64 + PPC_OEA64_BRIDGE > 1 */
 
-#endif /* _LOCORE */
+#endif /* !_LOCORE && _KERNEL */
 
 /*
  * Special Purpose Register declarations.



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

2018-01-19 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jan 20 03:50:29 UTC 2018

Modified Files:
src/sys/arch/powerpc/include: spr.h

Log Message:
Add a copyright (approx 16.5 years later).


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/powerpc/include/spr.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/powerpc/include/spr.h
diff -u src/sys/arch/powerpc/include/spr.h:1.47 src/sys/arch/powerpc/include/spr.h:1.48
--- src/sys/arch/powerpc/include/spr.h:1.47	Fri Jul  7 22:50:02 2017
+++ src/sys/arch/powerpc/include/spr.h	Sat Jan 20 03:50:28 2018
@@ -1,4 +1,29 @@
-/*	$NetBSD: spr.h,v 1.47 2017/07/07 22:50:02 macallan Exp $	*/
+/*	$NetBSD: spr.h,v 1.48 2018/01/20 03:50:28 simonb Exp $	*/
+
+/*
+ * Copyright (c) 2001, The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
 
 #ifndef _POWERPC_SPR_H_
 #define	_POWERPC_SPR_H_



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

2017-12-17 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun Dec 17 17:18:34 UTC 2017

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

Log Message:
apply the same change for powerpc as mrg did for arm and mips:

CPU_INFO_FOREACH() must always iterate at least the boot cpu.
document this in sys/cpu.h and fix the arm and mips versions
to check ncpu is non zero before using it as an iterator max.

this should fix the new assert in init_main.c.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/powerpc/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/powerpc/include/cpu.h
diff -u src/sys/arch/powerpc/include/cpu.h:1.102 src/sys/arch/powerpc/include/cpu.h:1.103
--- src/sys/arch/powerpc/include/cpu.h:1.102	Wed Oct 19 00:08:42 2016
+++ src/sys/arch/powerpc/include/cpu.h	Sun Dec 17 17:18:34 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.102 2016/10/19 00:08:42 nonaka Exp $	*/
+/*	$NetBSD: cpu.h,v 1.103 2017/12/17 17:18:34 chs Exp $	*/
 
 /*
  * Copyright (C) 1999 Wolfgang Solfrank.
@@ -32,6 +32,7 @@
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 #ifndef	_POWERPC_CPU_H_
 #define	_POWERPC_CPU_H_
 
@@ -54,6 +55,8 @@ struct cache_info {
 #include 
 #include 
 #include 
+#include 
+#include 
 #endif
 
 #include 
@@ -191,7 +194,7 @@ extern struct cpuset_info cpuset_info;
 #define CPU_IS_PRIMARY(ci)	((ci)->ci_cpuid == 0)
 #define CPU_INFO_ITERATOR	int
 #define CPU_INFO_FOREACH(cii, ci)\
-	cii = 0, ci = _info[0]; cii < ncpu; cii++, ci++
+	cii = 0, ci = _info[0]; cii < (ncpu ? ncpu : 1); cii++, ci++
 
 #else
 #define cpu_number()		0



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

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

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

Log Message:
need sigtypes.h for sigset_t, since  includes this directly.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/powerpc/include/signal.h

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

Modified files:

Index: src/sys/arch/powerpc/include/signal.h
diff -u src/sys/arch/powerpc/include/signal.h:1.20 src/sys/arch/powerpc/include/signal.h:1.21
--- src/sys/arch/powerpc/include/signal.h:1.20	Wed Nov 19 17:59:56 2008
+++ src/sys/arch/powerpc/include/signal.h	Wed Nov 29 12:36:16 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.20 2008/11/19 22:59:56 cegger Exp $	*/
+/*	$NetBSD: signal.h,v 1.21 2017/11/29 17:36:16 christos Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -39,6 +39,7 @@
 typedef int sig_atomic_t;
 
 #if defined(_NETBSD_SOURCE)
+#include 
 #include 
 
 #if defined(__LIBC12_SOURCE__) || defined(_KERNEL)



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

2017-11-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov  6 19:20:54 UTC 2017

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

Log Message:
handle ppc64


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/powerpc/include/elf_machdep.h

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

Modified files:

Index: src/sys/arch/powerpc/include/elf_machdep.h
diff -u src/sys/arch/powerpc/include/elf_machdep.h:1.14 src/sys/arch/powerpc/include/elf_machdep.h:1.15
--- src/sys/arch/powerpc/include/elf_machdep.h:1.14	Sun Nov  5 22:47:48 2017
+++ src/sys/arch/powerpc/include/elf_machdep.h	Mon Nov  6 14:20:54 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf_machdep.h,v 1.14 2017/11/06 03:47:48 christos Exp $	*/
+/*	$NetBSD: elf_machdep.h,v 1.15 2017/11/06 19:20:54 christos Exp $	*/
 
 #ifndef _POWERPC_ELF_MACHDEP_H_
 #define _POWERPC_ELF_MACHDEP_H_
@@ -16,15 +16,14 @@
 #define	ELF32_MACHDEP_ID	EM_PPC
 #define	ELF64_MACHDEP_ID	EM_PPC64
 
-#define KERN_ELFSIZE		32
 
-#ifndef ARCH_ELFSIZE
 #ifdef _LP64
+#define KERN_ELFSIZE		64
 #define ARCH_ELFSIZE		64	/* MD native binary size */
 #else
+#define KERN_ELFSIZE		32
 #define ARCH_ELFSIZE		32	/* MD native binary size */
 #endif
-#endif
 
 /* Specify the value of _GLOBAL_OFFSET_TABLE_ */
 #define	DT_PPC_GOT		DT_LOPROC



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

2017-09-18 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Mon Sep 18 23:21:15 UTC 2017

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

Log Message:
Fixed feholdexcept() by copying the actual contents of FPSCR to the fenv_t
instead of a double precision floating point representation of it.


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

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

Modified files:

Index: src/sys/arch/powerpc/include/fenv.h
diff -u src/sys/arch/powerpc/include/fenv.h:1.3 src/sys/arch/powerpc/include/fenv.h:1.4
--- src/sys/arch/powerpc/include/fenv.h:1.3	Wed Mar 22 23:11:09 2017
+++ src/sys/arch/powerpc/include/fenv.h	Mon Sep 18 23:21:15 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.3 2017/03/22 23:11:09 chs Exp $	*/
+/*	$NetBSD: fenv.h,v 1.4 2017/09/18 23:21:15 phx Exp $	*/
 
 /*-
  * Copyright (c) 2004-2005 David Schultz 
@@ -242,7 +242,7 @@ feholdexcept(fenv_t *__envp)
 	uint32_t msr;
 
 	__mffs(&__r.__d);
-	*__envp = __r.__d;
+	*__envp = __r.__bits.__reg;
 	__r.__bits.__reg &= ~(FE_ALL_EXCEPT | _ENABLE_MASK);
 	__mtfsf(__r.__d);
 	__updatemsr(__r.__bits.__reg);



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

2017-08-17 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Aug 17 22:55:47 UTC 2017

Modified Files:
src/sys/arch/powerpc/include/oea: vmparam.h

Log Message:
Raise the maximum text size value to 128MB, this allows binaries such as clang 
which
currently has a text area of around 96MB to execute successfully on macppc.

ok macallan


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/powerpc/include/oea/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/powerpc/include/oea/vmparam.h
diff -u src/sys/arch/powerpc/include/oea/vmparam.h:1.19 src/sys/arch/powerpc/include/oea/vmparam.h:1.20
--- src/sys/arch/powerpc/include/oea/vmparam.h:1.19	Mon Feb 13 09:46:30 2017
+++ src/sys/arch/powerpc/include/oea/vmparam.h	Thu Aug 17 22:55:47 2017
@@ -55,7 +55,7 @@
 #endif
 
 #ifndef	MAXTSIZ
-#define	MAXTSIZ			(64*1024*1024)		/* maximum text size */
+#define	MAXTSIZ			(128*1024*1024)		/* maximum text size */
 #endif
 
 #ifndef	MAXDSIZ



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

2017-07-07 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Jul  7 22:50:02 UTC 2017

Modified Files:
src/sys/arch/powerpc/include: spr.h

Log Message:
fix tpyo


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/powerpc/include/spr.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/powerpc/include/spr.h
diff -u src/sys/arch/powerpc/include/spr.h:1.46 src/sys/arch/powerpc/include/spr.h:1.47
--- src/sys/arch/powerpc/include/spr.h:1.46	Fri Jul  7 22:11:36 2017
+++ src/sys/arch/powerpc/include/spr.h	Fri Jul  7 22:50:02 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: spr.h,v 1.46 2017/07/07 22:11:36 macallan Exp $	*/
+/*	$NetBSD: spr.h,v 1.47 2017/07/07 22:50:02 macallan Exp $	*/
 
 #ifndef _POWERPC_SPR_H_
 #define	_POWERPC_SPR_H_
@@ -28,7 +28,7 @@ mfspr(int reg)
 			"sldi %2,%2,32;" \
 			"or %2,%2,%1;" \
 			"sync;" \
-			"mtspr %0,%1;" \
+			"mtspr %0,%2;" \
 			"mfspr %1,%0;" \
 			"mfspr %1,%0;" \
 			"mfspr %1,%0;" \



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

2017-07-07 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Jul  7 22:13:36 UTC 2017

Modified Files:
src/sys/arch/powerpc/include/oea: hid.h

Log Message:
add bits & masks for ppc970 HID0


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/powerpc/include/oea/hid.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/powerpc/include/oea/hid.h
diff -u src/sys/arch/powerpc/include/oea/hid.h:1.10 src/sys/arch/powerpc/include/oea/hid.h:1.11
--- src/sys/arch/powerpc/include/oea/hid.h:1.10	Sun Sep 22 17:51:31 2013
+++ src/sys/arch/powerpc/include/oea/hid.h	Fri Jul  7 22:13:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: hid.h,v 1.10 2013/09/22 17:51:31 matt Exp $	*/
+/*	$NetBSD: hid.h,v 1.11 2017/07/07 22:13:35 macallan Exp $	*/
 
 /*-
  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
@@ -31,6 +31,28 @@
 
 /* Hardware Implementation Dependent registers for the PowerPC */
 
+#if defined(_ARCH_PPC64) || defined (PPC_OEA64_BRIDGE)
+/* this way we can use the same bit numbers as IBM's PowerPC manuals */
+#define HIDBIT(x) (0x8000LL >> x)
+#define HID0_64_ONE_PPC	HIDBIT(0)   /* one instruction per dispatch group */
+#define HID0_64_DO_SNGL	HIDBIT(1)   /* single group completion mode */
+#define HID0_64_ISYNCSC	HIDBIT(2)   /* Disable isync scoreboard optimization */
+#define HID0_64_SER_GP	HIDBIT(3)   /* Serialize group dispatch */
+#define HID0_64_DEEPNAP	HIDBIT(7)   /* Enable deep nap mode (970) */
+#define HID0_64_DOZE	HIDBIT(8)   /* Enable doze mode */
+#define HID0_64_NAP	HIDBIT(9)   /* Enable nap mode */
+#define HID0_64_DPM	HIDBIT(11)  /* Enable Dynamic power management */
+#define HID0_64_TG	HIDBIT(13)  /* Perfmon threshold granularity control */
+#define HID0_64_HNG_DIS	HIDBIT(14)  /* Disable processor hang-detection */
+#define HID0_64_NHR	HIDBIT(15)  /* No Hard Reset */
+#define HID0_64_INORDER	HIDBIT(16)  /* Serialized group issue mode */
+#define HID0_64_TB_CTRL	HIDBIT(18)  /* TB keeps running if CPU stopped */
+#define HID0_64_EX_TBEN	HIDBIT(19)  /* timebase runs at external clock */
+#define HID0_64_CIABREN	HIDBIT(22)  /* enable CIABR register */
+#define HID0_64_HDICEEN	HIDBIT(23)  /* hypervisor decrementer enable */
+#define HID0_64_EN_ATTN	HIDBIT(31)  /* support processor attention inst. */
+#define HID0_64_EN_MCHK	HIDBIT(32)  /* ext. mchk interrupts */
+#endif
 #define HID0_EMCP	0x8000  /* Enable MCP */
 #define HID0_DBP	0x4000  /* Disable 60x bus parity generation */
 #define HID0_EBA	0x2000  /* Enable 60x bus address parity checking */
@@ -82,6 +104,14 @@
 "\020ICE\017DCE\016ILOCK\015DLOCK\014ICFI\013DCFI\012SPD\011XBSEN" \
 "\010SGE\007b25\006BTIC\005LRSTK\004FOLD\003BHT\002NOPDST\001NOPTI"
 
+#define HID0_970_BITMASK "\020" \
+"\040EMCP"
+
+#define HID0_970_BITMASK_U "\020" \
+"\040ONEPPC\036DOSNGL\036ISYNCSC\035SERGP\034res\033res\032res\031DEEPNAP" \
+"\030DOZE\027NAP\026res\025DPM\024res\023TG\022HNGDIS\021NHR" \
+"\020INORDER\017res\016TBCTRL\015EXTBEN\014res\013res\012CIABREN\011HDICEEN" \
+"\001ENATTN"
 /*
  *  HID0 bit definitions per CPU model
  *



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

2017-07-07 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Jul  7 22:11:37 UTC 2017

Modified Files:
src/sys/arch/powerpc/include: spr.h

Log Message:
add mfspr/mtspr methods suitable for 64bit SPRs on ppc970 in bridge mode


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/powerpc/include/spr.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/powerpc/include/spr.h
diff -u src/sys/arch/powerpc/include/spr.h:1.45 src/sys/arch/powerpc/include/spr.h:1.46
--- src/sys/arch/powerpc/include/spr.h:1.45	Thu Feb 25 23:30:04 2010
+++ src/sys/arch/powerpc/include/spr.h	Fri Jul  7 22:11:36 2017
@@ -1,9 +1,44 @@
-/*	$NetBSD: spr.h,v 1.45 2010/02/25 23:30:04 matt Exp $	*/
+/*	$NetBSD: spr.h,v 1.46 2017/07/07 22:11:36 macallan Exp $	*/
 
 #ifndef _POWERPC_SPR_H_
 #define	_POWERPC_SPR_H_
 
 #ifndef _LOCORE
+#ifdef PPC_OEA64_BRIDGE
+
+static inline uint64_t
+mfspr(int reg)
+{
+	uint64_t ret;
+	register_t h, l;
+	__asm volatile( "mfspr %0,%2;" \
+			"srdi %1,%0,32;" \
+			 : "=r"(l), "=r"(h) : "K"(reg));
+	ret = ((uint64_t)h << 32) | l;
+	return ret;
+}
+
+#define mtspr(reg, v) \
+( {		\
+	volatile register_t h, l;		\
+	uint64_t val = v;			\
+	h = (val >> 32);			\
+	l = val & 0x;			\
+	__asm volatile( \
+			"sldi %2,%2,32;" \
+			"or %2,%2,%1;" \
+			"sync;" \
+			"mtspr %0,%1;" \
+			"mfspr %1,%0;" \
+			"mfspr %1,%0;" \
+			"mfspr %1,%0;" \
+			"mfspr %1,%0;" \
+			"mfspr %1,%0;" \
+			"mfspr %1,%0;" \
+			 : : "K"(reg), "r"(l), "r"(h)); \
+} )
+
+#else
 #define	mtspr(reg, val)			\
 	__asm volatile("mtspr %0,%1" : : "K"(reg), "r"(val))
 #ifdef __GNUC__
@@ -12,6 +47,7 @@
 	  __asm volatile("mfspr %0,%1" : "=r"(val) : "K"(reg));	\
 	  val; } )
 #endif
+#endif /* PPC_OEA64_BRIDGE */
 #endif /* _LOCORE */
 
 /*



CVS commit: src/sys/arch/powerpc/include/booke

2017-06-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jun 24 07:19:59 UTC 2017

Modified Files:
src/sys/arch/powerpc/include/booke: pte.h

Log Message:
Provide a pte_set


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/include/booke/pte.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/powerpc/include/booke/pte.h
diff -u src/sys/arch/powerpc/include/booke/pte.h:1.8 src/sys/arch/powerpc/include/booke/pte.h:1.9
--- src/sys/arch/powerpc/include/booke/pte.h:1.8	Mon Jul 11 16:06:52 2016
+++ src/sys/arch/powerpc/include/booke/pte.h	Sat Jun 24 07:19:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pte.h,v 1.8 2016/07/11 16:06:52 matt Exp $	*/
+/*	$NetBSD: pte.h,v 1.9 2017/06/24 07:19:59 skrll Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -271,6 +271,12 @@ pte_make_kenter_pa(paddr_t pa, struct vm
 	return pt_entry;
 }
 
+static inline void
+pte_set(pt_entry_t *ptep, pt_entry_t pte)
+{
+	*ptep = pte;
+}
+
 #endif /* _KERNEL */
 #endif /* !_LOCORE */
 



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

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

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

Log Message:
update the FE0/FE1 MSR bits as needed when changing the exception mask.


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

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

Modified files:

Index: src/sys/arch/powerpc/include/fenv.h
diff -u src/sys/arch/powerpc/include/fenv.h:1.1 src/sys/arch/powerpc/include/fenv.h:1.2
--- src/sys/arch/powerpc/include/fenv.h:1.1	Sun Dec 20 16:23:14 2015
+++ src/sys/arch/powerpc/include/fenv.h	Mon Feb 27 06:54:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.1 2015/12/20 16:23:14 christos Exp $	*/
+/*	$NetBSD: fenv.h,v 1.2 2017/02/27 06:54:42 chs Exp $	*/
 
 /*-
  * Copyright (c) 2004-2005 David Schultz 
@@ -92,9 +92,45 @@ extern const fenv_t	__fe_dfl_env;
 #ifndef _SOFT_FLOAT
 #define	__mffs(__env)	__asm __volatile("mffs %0" : "=f" (*(__env)))
 #define	__mtfsf(__env)	__asm __volatile("mtfsf 255,%0" : : "f" (__env))
+
+static inline uint32_t
+__mfmsr(void)
+{
+	uint32_t __msr;
+
+	__asm volatile ("mfmsr %0" : "=r"(__msr));
+	return __msr;
+}
+
+static inline void
+__mtmsr(uint32_t __msr)
+{
+
+	__asm volatile ("mtmsr %0" : : "r"(__msr));
+}
+
+#define __MSR_FE_MASK	(0x0800 | 0x0100)
+#define __MSR_FE_DIS	(0)
+#define __MSR_FE_PREC	(0x0800 | 0x0100)
+
+static inline void
+__updatemsr(uint32_t __reg)
+{
+	uint32_t __msr;
+
+	__msr = __mfmsr() & ~__MSR_FE_MASK;
+	if (__reg != 0) {
+		__msr |= __MSR_FE_PREC;
+	} else {
+		__msr |= __MSR_FE_DIS;
+	}
+	__mtmsr(__msr);
+}
+
 #else
 #define	__mffs(__env)
 #define	__mtfsf(__env)
+#define __updatemsr(__reg)
 #endif
 
 union __fpscr {
@@ -201,11 +237,13 @@ __fenv_static inline int
 feholdexcept(fenv_t *__envp)
 {
 	union __fpscr __r;
+	uint32_t msr;
 
 	__mffs(&__r.__d);
 	*__envp = __r.__d;
 	__r.__bits.__reg &= ~(FE_ALL_EXCEPT | _ENABLE_MASK);
 	__mtfsf(__r.__d);
+	__updatemsr(__r.__bits.__reg);
 	return (0);
 }
 
@@ -216,6 +254,7 @@ fesetenv(const fenv_t *__envp)
 
 	__r.__bits.__reg = *__envp;
 	__mtfsf(__r.__d);
+	__updatemsr(__r.__bits.__reg);
 	return (0);
 }
 
@@ -228,6 +267,7 @@ feupdateenv(const fenv_t *__envp)
 	__r.__bits.__reg &= FE_ALL_EXCEPT;
 	__r.__bits.__reg |= *__envp;
 	__mtfsf(__r.__d);
+	__updatemsr(__r.__bits.__reg);
 	return (0);
 }
 
@@ -245,6 +285,7 @@ feenableexcept(int __mask)
 	__oldmask = __r.__bits.__reg;
 	__r.__bits.__reg |= (__mask & FE_ALL_EXCEPT) >> _FPUSW_SHIFT;
 	__mtfsf(__r.__d);
+	__updatemsr(__r.__bits.__reg);
 	return ((__oldmask & _ENABLE_MASK) << _FPUSW_SHIFT);
 }
 
@@ -258,6 +299,7 @@ fedisableexcept(int __mask)
 	__oldmask = __r.__bits.__reg;
 	__r.__bits.__reg &= ~((__mask & FE_ALL_EXCEPT) >> _FPUSW_SHIFT);
 	__mtfsf(__r.__d);
+	__updatemsr(__r.__bits.__reg);
 	return ((__oldmask & _ENABLE_MASK) << _FPUSW_SHIFT);
 }
 



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

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

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/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/powerpc/include/ieeefp.h
diff -u src/sys/arch/powerpc/include/ieeefp.h:1.5 src/sys/arch/powerpc/include/ieeefp.h:1.6
--- src/sys/arch/powerpc/include/ieeefp.h:1.5	Fri Dec 25 06:02:10 2015
+++ src/sys/arch/powerpc/include/ieeefp.h	Mon Feb 27 06:51:46 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieeefp.h,v 1.5 2015/12/25 06:02:10 christos Exp $	*/
+/*	$NetBSD: ieeefp.h,v 1.6 2017/02/27 06:51:46 chs Exp $	*/
 
 /* 
  * Written by J.T. Conklin, Apr 6, 1995
@@ -17,11 +17,15 @@
 #if !defined(_ISOC99_SOURCE)
 
 typedef int fp_except;
-#define FP_X_IMP	FE_INEXACT	/* imprecise (loss of precision) */
-#define FP_X_DZ		FE_DIVBYZERO	/* divide-by-zero exception */
-#define FP_X_UFL	FE_UNDERFLOW	/* underflow exception */
-#define FP_X_OFL	FE_OVERFLOW	/* overflow exception */
-#define FP_X_INV	FE_INVALID	/* invalid operation exception */
+
+/* adjust for FP_* and FE_* value differences */ 
+#define	__FPE(x) ((x) >> 25)
+
+#define FP_X_IMP	__FPE(FE_INEXACT)	/* imprecise (loss of precision) */
+#define FP_X_DZ		__FPE(FE_DIVBYZERO)	/* divide-by-zero exception */
+#define FP_X_UFL	__FPE(FE_UNDERFLOW)	/* underflow exception */
+#define FP_X_OFL	__FPE(FE_OVERFLOW)	/* overflow exception */
+#define FP_X_INV	__FPE(FE_INVALID)	/* invalid operation exception */
 
 typedef enum {
 FP_RN=FE_TONEAREST,		/* round to nearest representable number */



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

2017-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 27 17:22:39 UTC 2017

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

Log Message:
remove __HAVE_COMPAT_NETBSD32


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/powerpc/include/types.h

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

Modified files:

Index: src/sys/arch/powerpc/include/types.h
diff -u src/sys/arch/powerpc/include/types.h:1.55 src/sys/arch/powerpc/include/types.h:1.56
--- src/sys/arch/powerpc/include/types.h:1.55	Thu Jan 26 10:55:10 2017
+++ src/sys/arch/powerpc/include/types.h	Fri Jan 27 12:22:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.55 2017/01/26 15:55:10 christos Exp $	*/
+/*	$NetBSD: types.h,v 1.56 2017/01/27 17:22:39 christos Exp $	*/
 
 /*-
  * Copyright (C) 1995 Wolfgang Solfrank.
@@ -99,6 +99,5 @@ typedef __uint32_t tlb_asid_t;		/* for b
 #if defined(_KERNEL)
 #define	__HAVE_RAS
 #endif
-#define	__HAVE_COMPAT_NETBSD32
 
 #endif	/* _POWERPC_TYPES_H_ */



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

2017-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 14 21:33:09 UTC 2017

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

Log Message:
belatedly fix constants for ppc64 (this does not define __arch64__ like sparc
does?)


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/powerpc/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/powerpc/include/param.h
diff -u src/sys/arch/powerpc/include/param.h:1.29 src/sys/arch/powerpc/include/param.h:1.30
--- src/sys/arch/powerpc/include/param.h:1.29	Tue Jan 29 10:47:16 2013
+++ src/sys/arch/powerpc/include/param.h	Sat Jan 14 16:33:09 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.29 2013/01/29 15:47:16 kiyohara Exp $	*/
+/*	$NetBSD: param.h,v 1.30 2017/01/14 21:33:09 christos Exp $	*/
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -41,17 +41,26 @@
 #endif
 
 /*
- * Machine dependent constants for PowerPC (32-bit only currently)
+ * Machine dependent constants for PowerPC
  * For userland regardless of port, force MACHINE to be "powerpc"
  */
 #ifndef _KERNEL
 #undef MACHINE
 #endif
-#ifndef MACHINE
-#define	MACHINE		"powerpc"
+
+#ifdef _LP64
+# ifndef MACHINE
+#  define	MACHINE		"powerpc64"
+# endif
+# define	MACHINE_ARCH	"powerpc64"
+# define	MID_MACHINE	MID_POWERPC64
+#else
+# ifndef MACHINE
+#  define	MACHINE		"powerpc"
+# endif
+# define	MACHINE_ARCH	"powerpc"
+# define	MID_MACHINE	MID_POWERPC
 #endif
-#define	MACHINE_ARCH	"powerpc"
-#define	MID_MACHINE	MID_POWERPC
 
 /* PowerPC-specific macro to align a stack pointer (downwards). */
 #define	STACK_ALIGNBYTES	(16 - 1)	/* AltiVec */



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

2016-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 24 19:49:35 UTC 2016

Modified Files:
src/sys/arch/powerpc/include: frame.h types.h

Log Message:
expose __register32_t for frame.h


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/powerpc/include/frame.h
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/powerpc/include/types.h

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

Modified files:

Index: src/sys/arch/powerpc/include/frame.h
diff -u src/sys/arch/powerpc/include/frame.h:1.26 src/sys/arch/powerpc/include/frame.h:1.27
--- src/sys/arch/powerpc/include/frame.h:1.26	Fri Feb 28 00:30:24 2014
+++ src/sys/arch/powerpc/include/frame.h	Sun Jan 24 14:49:35 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.26 2014/02/28 05:30:24 matt Exp $	*/
+/*	$NetBSD: frame.h,v 1.27 2016/01/24 19:49:35 christos Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -52,46 +52,46 @@
  * Change ordering to cluster together these register_t's.		XXX
  */
 struct reg_sans_pc {
-	register_t r_fixreg[32];
-	register_t r_lr;
+	__register_t r_fixreg[32];
+	__register_t r_lr;
 	uint32_t r_cr;
 	uint32_t r_xer;
-	register_t r_ctr;
+	__register_t r_ctr;
 };
 
 #ifdef _LP64
 struct reg_sans_pc32 {
-	register32_t r_fixreg[32];
-	register32_t r_lr;
+	__register32_t r_fixreg[32];
+	__register32_t r_lr;
 	uint32_t r_cr;
 	uint32_t r_xer;
-	register32_t r_ctr;
+	__register32_t r_ctr;
 };
 #endif
 
 struct utrapframe {
-	register_t fixreg[32];
-	register_t lr;
+	__register_t fixreg[32];
+	__register_t lr;
 	int cr;
 	int xer;
-	register_t ctr;
-	register_t srr0;
-	register_t srr1;
+	__register_t ctr;
+	__register_t srr0;
+	__register_t srr1;
 	int vrsave;
 	int mq;
 	int spare;
 };
 
 struct clockframe {
-	register_t cf_srr0;
-	register_t cf_srr1;
+	__register_t cf_srr0;
+	__register_t cf_srr1;
 	int cf_idepth;
 };
 
 #ifdef _LP64
 struct clockframe32 {
-	register32_t cf_srr0;
-	register32_t cf_srr1;
+	__register32_t cf_srr0;
+	__register32_t cf_srr1;
 	int cf_idepth;
 };
 #endif
@@ -101,17 +101,17 @@ struct trapframe {
 	struct clockframe tf_cf;
 	uint32_t tf_exc;
 #if defined(PPC_OEA) || defined(PPC_OEA64) || defined(PPC_OEA64_BRIDGE)
-	register_t tf_dar;
-	register_t tf_pad0[2];
+	__register_t tf_dar;
+	__register_t tf_pad0[2];
 	uint32_t tf_dsisr;
 	uint32_t tf_vrsave;
 	uint32_t tf_mq;
 	uint32_t tf_pad1[1];
 #endif
 #if defined(PPC_BOOKE) || defined(PPC_IBM4XX)
-	register_t tf_dear;
-	register_t tf_mcar;
-	register_t tf_sprg1;
+	__register_t tf_dear;
+	__register_t tf_mcar;
+	__register_t tf_sprg1;
 	uint32_t tf_esr;
 	uint32_t tf_mcsr;
 	uint32_t tf_pid;
@@ -125,17 +125,17 @@ struct trapframe32 {
 	struct clockframe32 tf_cf;
 	uint32_t tf_exc;
 #if defined(PPC_OEA) || defined(PPC_OEA64) || defined(PPC_OEA64_BRIDGE)
-	register32_t tf_dar;
-	register32_t tf_pad0[2];
+	__register32_t tf_dar;
+	__register32_t tf_pad0[2];
 	uint32_t tf_dsisr;
 	uint32_t tf_vrsave;
 	uint32_t tf_mq;
 	uint32_t tf_pad1[1];
 #endif
 #if defined(PPC_BOOKE) || defined(PPC_IBM4XX)
-	register32_t tf_dear;
-	register32_t tf_mcar;
-	register32_t tf_sprg1;
+	__register32_t tf_dear;
+	__register32_t tf_mcar;
+	__register32_t tf_sprg1;
 	uint32_t tf_esr;
 	uint32_t tf_mcsr;
 	uint32_t tf_pid;
@@ -153,22 +153,22 @@ struct trapframe32 {
 #define tf_idepth	tf_cf.cf_idepth
 
 struct ktrapframe {
-	register_t ktf_sp;
-	register_t ktf_lr;
+	__register_t ktf_sp;
+	__register_t ktf_lr;
 	struct trapframe ktf_tf;
-	register_t ktf_cframe_lr;	/* for DDB */
+	__register_t ktf_cframe_lr;	/* for DDB */
 };
 
 #if defined(_KERNEL) || defined(_LKM)
 #ifdef _LP64
 struct utrapframe32 {
-	register32_t fixreg[32];
-	register32_t lr;
+	__register32_t fixreg[32];
+	__register32_t lr;
 	int cr;
 	int xer;
-	register32_t ctr;
-	register32_t srr0;
-	register32_t srr1;
+	__register32_t ctr;
+	__register32_t srr0;
+	__register32_t srr1;
 	int vrsave;
 	int mq;
 	int spare;
@@ -185,12 +185,12 @@ struct utrapframe32 {
 
 #define	SFRAMELEN	roundup(sizeof(struct switchframe), CALLFRAMELEN)
 struct switchframe {
-	register_t sf_sp;
-	register_t sf_lr;
-	register_t sf_user_sr;		/* VSID on IBM4XX */
-	register_t sf_cr;		/* why?  CR is volatile. */
-	register_t sf_fixreg2;
-	register_t sf_fixreg[19];	/* R13-R31 */
+	__register_t sf_sp;
+	__register_t sf_lr;
+	__register_t sf_user_sr;		/* VSID on IBM4XX */
+	__register_t sf_cr;		/* why?  CR is volatile. */
+	__register_t sf_fixreg2;
+	__register_t sf_fixreg[19];	/* R13-R31 */
 };
 
 /*
@@ -198,10 +198,10 @@ struct switchframe {
  */
 #define	CALLFRAMELEN	sizeof(struct callframe)
 struct callframe {
-	register_t cf_sp;
-	register_t cf_lr;
-	register_t cf_r30;
-	register_t cf_r31;
+	__register_t cf_sp;
+	__register_t cf_lr;
+	__register_t cf_r30;
+	__register_t cf_r31;
 };
 
 #endif	/* _POWERPC_FRAME_H_ */

Index: src/sys/arch/powerpc/include/types.h
diff -u src/sys/arch/powerpc/include/types.h:1.53 

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

2016-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 24 20:02:39 UTC 2016

Modified Files:
src/sys/arch/powerpc/include: reg.h

Log Message:
use __register_t


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/powerpc/include/reg.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/powerpc/include/reg.h
diff -u src/sys/arch/powerpc/include/reg.h:1.11 src/sys/arch/powerpc/include/reg.h:1.12
--- src/sys/arch/powerpc/include/reg.h:1.11	Tue Aug 12 16:27:10 2014
+++ src/sys/arch/powerpc/include/reg.h	Sun Jan 24 15:02:38 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: reg.h,v 1.11 2014/08/12 20:27:10 joerg Exp $	*/
+/*	$NetBSD: reg.h,v 1.12 2016/01/24 20:02:38 christos Exp $	*/
 
 #ifndef _POWERPC_REG_H_
 #define _POWERPC_REG_H_
@@ -49,12 +49,12 @@
  */
 
 struct reg {/* base registers */
-	register_t fixreg[32];
-	register_t lr;			/* Link Register */
+	__register_t fixreg[32];
+	__register_t lr;			/* Link Register */
 	int cr;/* Condition Register */
 	int xer;			/* SPR 1 */
-	register_t ctr;			/* Count Register */
-	register_t pc;			/* Program Counter */
+	__register_t ctr;			/* Count Register */
+	__register_t pc;			/* Program Counter */
 };
 
 struct fpreg {/* Floating Point registers */
@@ -69,9 +69,9 @@ struct fpreg {/* Floating Point regi
 
 struct vreg {/* Vector registers */
 	uint32_t vreg[32][4];
-	register_t vrsave;		/* SPR 256 */
-	register_t spare[2];		/* filler */
-	register_t vscr;		/* Vector Status And Control Register */
+	__register_t vrsave;		/* SPR 256 */
+	__register_t spare[2];		/* filler */
+	__register_t vscr;		/* Vector Status And Control Register */
 };
 
 #endif /* _POWERPC_REG_H_ */



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

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

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

Log Message:
move fenv inside ifdef


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/powerpc/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/powerpc/include/ieeefp.h
diff -u src/sys/arch/powerpc/include/ieeefp.h:1.4 src/sys/arch/powerpc/include/ieeefp.h:1.5
--- src/sys/arch/powerpc/include/ieeefp.h:1.4	Tue Dec 22 00:28:46 2015
+++ src/sys/arch/powerpc/include/ieeefp.h	Fri Dec 25 01:02:10 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieeefp.h,v 1.4 2015/12/22 05:28:46 christos Exp $	*/
+/*	$NetBSD: ieeefp.h,v 1.5 2015/12/25 06:02:10 christos Exp $	*/
 
 /* 
  * Written by J.T. Conklin, Apr 6, 1995
@@ -10,10 +10,10 @@
 
 #include 
 
-#include 
-
 #if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE)
 
+#include 
+
 #if !defined(_ISOC99_SOURCE)
 
 typedef int fp_except;



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

2015-12-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 22 05:28:47 UTC 2015

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

Log Message:
remove dup definitions from fenv.h


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/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/powerpc/include/ieeefp.h
diff -u src/sys/arch/powerpc/include/ieeefp.h:1.3 src/sys/arch/powerpc/include/ieeefp.h:1.4
--- src/sys/arch/powerpc/include/ieeefp.h:1.3	Tue Aug  5 12:47:42 2008
+++ src/sys/arch/powerpc/include/ieeefp.h	Tue Dec 22 00:28:46 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieeefp.h,v 1.3 2008/08/05 16:47:42 matt Exp $	*/
+/*	$NetBSD: ieeefp.h,v 1.4 2015/12/22 05:28:46 christos Exp $	*/
 
 /* 
  * Written by J.T. Conklin, Apr 6, 1995
@@ -10,23 +10,9 @@
 
 #include 
 
-#if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE)
-
-typedef int fenv_t;
-typedef int fexcept_t;
+#include 
 
-#define	FE_INEXACT	0x01	/* imprecise (loss of precision) */
-#define	FE_DIVBYZERO	0x02	/* divide-by-zero exception */
-#define	FE_OVERFLOW	0x04	/* underflow exception */
-#define	FE_UNDERFLOW	0x08	/* overflow exception */
-#define	FE_INVALID	0x10	/* invalid operation exception */
-
-#define	FE_ALL_EXCEPT	0x1f
-
-#define	FE_TONEAREST	0	/* round to nearest representable number */
-#define	FE_TOWARDZERO	1	/* round to zero (truncate) */
-#define	FE_UPWARD	2	/* round toward positive infinity */
-#define	FE_DOWNWARD	3	/* round toward negative infinity */
+#if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE)
 
 #if !defined(_ISOC99_SOURCE)
 



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

2015-12-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 20 16:23:14 UTC 2015

Added Files:
src/sys/arch/powerpc/include: fenv.h

Log Message:
Add fenv.h for powerpc (from FreeBSD)


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

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

Added files:

Index: src/sys/arch/powerpc/include/fenv.h
diff -u /dev/null src/sys/arch/powerpc/include/fenv.h:1.1
--- /dev/null	Sun Dec 20 11:23:14 2015
+++ src/sys/arch/powerpc/include/fenv.h	Sun Dec 20 11:23:14 2015
@@ -0,0 +1,278 @@
+/*	$NetBSD: fenv.h,v 1.1 2015/12/20 16:23:14 christos Exp $	*/
+
+/*-
+ * 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: head/lib/msun/powerpc/fenv.h 226218 2011-10-10 15:43:09Z das $
+ */
+
+#ifndef	_POWERPC_FENV_H_
+#define	_POWERPC_FENV_H_
+
+#include 
+
+#ifndef	__fenv_static
+#define	__fenv_static	static
+#endif
+
+typedef	uint32_t	fenv_t;
+typedef	uint32_t	fexcept_t;
+
+/* Exception flags */
+#define	FE_INEXACT	0x0200
+#define	FE_DIVBYZERO	0x0400
+#define	FE_UNDERFLOW	0x0800
+#define	FE_OVERFLOW	0x1000
+#define	FE_INVALID	0x2000	/* all types of invalid FP ops */
+
+/*
+ * The PowerPC architecture has extra invalid flags that indicate the
+ * specific type of invalid operation occurred.  These flags may be
+ * tested, set, and cleared---but not masked---separately.  All of
+ * these bits are cleared when FE_INVALID is cleared, but only
+ * FE_VXSOFT is set when FE_INVALID is explicitly set in software.
+ */
+#define	FE_VXCVI	0x0100	/* invalid integer convert */
+#define	FE_VXSQRT	0x0200	/* square root of a negative */
+#define	FE_VXSOFT	0x0400	/* software-requested exception */
+#define	FE_VXVC		0x0008	/* ordered comparison involving NaN */
+#define	FE_VXIMZ	0x0010	/* inf * 0 */
+#define	FE_VXZDZ	0x0020	/* 0 / 0 */
+#define	FE_VXIDI	0x0040	/* inf / inf */
+#define	FE_VXISI	0x0080	/* inf - inf */
+#define	FE_VXSNAN	0x0100	/* operation on a signalling NaN */
+#define	FE_ALL_INVALID	(FE_VXCVI | FE_VXSQRT | FE_VXSOFT | FE_VXVC | \
+			 FE_VXIMZ | FE_VXZDZ | FE_VXIDI | FE_VXISI | \
+			 FE_VXSNAN | FE_INVALID)
+#define	FE_ALL_EXCEPT	(FE_DIVBYZERO | FE_INEXACT | \
+			 FE_ALL_INVALID | FE_OVERFLOW | FE_UNDERFLOW)
+
+/* Rounding modes */
+#define	FE_TONEAREST	0x
+#define	FE_TOWARDZERO	0x0001
+#define	FE_UPWARD	0x0002
+#define	FE_DOWNWARD	0x0003
+#define	_ROUND_MASK	(FE_TONEAREST | FE_DOWNWARD | \
+			 FE_UPWARD | FE_TOWARDZERO)
+
+#ifndef _KERNEL
+__BEGIN_DECLS
+
+/* Default floating-point environment */
+extern const fenv_t	__fe_dfl_env;
+#define	FE_DFL_ENV	(&__fe_dfl_env)
+
+/* We need to be able to map status flag positions to mask flag positions */
+#define	_FPUSW_SHIFT	22
+#define	_ENABLE_MASK	((FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \
+			 FE_OVERFLOW | FE_UNDERFLOW) >> _FPUSW_SHIFT)
+
+#ifndef _SOFT_FLOAT
+#define	__mffs(__env)	__asm __volatile("mffs %0" : "=f" (*(__env)))
+#define	__mtfsf(__env)	__asm __volatile("mtfsf 255,%0" : : "f" (__env))
+#else
+#define	__mffs(__env)
+#define	__mtfsf(__env)
+#endif
+
+union __fpscr {
+	double __d;
+	struct {
+		uint32_t __junk;
+		fenv_t __reg;
+	} __bits;
+};
+
+__fenv_static inline int
+feclearexcept(int __excepts)
+{
+	union __fpscr __r;
+
+	if (__excepts & FE_INVALID)
+		__excepts |= FE_ALL_INVALID;
+	__mffs(&__r.__d);
+	__r.__bits.__reg &= ~__excepts;
+	__mtfsf(__r.__d);
+	return (0);
+}
+
+__fenv_static inline int
+fegetexceptflag(fexcept_t *__flagp, int __excepts)
+{
+	union __fpscr __r;
+
+	__mffs(&__r.__d);
+	*__flagp = 

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

2015-07-07 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Jul  7 15:41:46 UTC 2015

Modified Files:
src/sys/arch/powerpc/include/oea: spr.h

Log Message:
add instruction cache throttling SPR found on 750


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/powerpc/include/oea/spr.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/powerpc/include/oea/spr.h
diff -u src/sys/arch/powerpc/include/oea/spr.h:1.2 src/sys/arch/powerpc/include/oea/spr.h:1.3
--- src/sys/arch/powerpc/include/oea/spr.h:1.2	Wed Feb  1 05:25:57 2012
+++ src/sys/arch/powerpc/include/oea/spr.h	Tue Jul  7 15:41:46 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: spr.h,v 1.2 2012/02/01 05:25:57 matt Exp $	*/
+/*	$NetBSD: spr.h,v 1.3 2015/07/07 15:41:46 macallan Exp $	*/
 
 #ifndef _POWERPC_OEA_SPR_H_
 #define	_POWERPC_OEA_SPR_H_
@@ -262,6 +262,9 @@
 #define	  L3CR_L3DO		  0x0040 /* 25: L3 data-only mode */
 #define	  L3CR_PMEN		  0x0004 /* 29: Private memory enable */
 #define	  L3CR_PMSIZ		  0x0004 /* 31: Private memory size (0=1MB, 1=2MB) */
+#define SPR_ICTC		0x3fb	/* ..6. instruction cache throttling */
+#define  ICTC_ENABLE		  0x0001 /* enable throttling */
+#define  ICTC_COUNT_M		  0x01fe /* number of waits to insert */
 #define	SPR_THRM1		0x3fc	/* ..6. Thermal Management Register */
 #define	SPR_THRM2		0x3fd	/* ..6. Thermal Management Register */
 #define	 SPR_THRM_TIN		  0x8000 /* Thermal interrupt bit (RO) */



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

2015-07-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul  6 05:36:27 UTC 2015

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

Log Message:
Remove PSL_SPV from BOOKE PSL_USERMOD


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

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

Modified files:

Index: src/sys/arch/powerpc/include/psl.h
diff -u src/sys/arch/powerpc/include/psl.h:1.19 src/sys/arch/powerpc/include/psl.h:1.20
--- src/sys/arch/powerpc/include/psl.h:1.19	Fri Feb 28 05:27:38 2014
+++ src/sys/arch/powerpc/include/psl.h	Mon Jul  6 05:36:26 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.19 2014/02/28 05:27:38 matt Exp $	*/
+/*	$NetBSD: psl.h,v 1.20 2015/07/06 05:36:26 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -112,7 +112,7 @@ extern register_t cpu_psluserset, cpu_ps
 #elif defined(PPC_BOOKE)
 #define	PSL_USERSET		(PSL_EE | PSL_PR | PSL_IS | PSL_DS | PSL_ME | PSL_CE | PSL_DE)
 #define	PSL_USERMASK		(PSL_SPV | PSL_CE | 0x)
-#define	PSL_USERMOD		(PSL_SPV)
+#define	PSL_USERMOD		(0)
 #else /* PPC_IBM4XX */
 #ifdef PPC_IBM403
 #define	PSL_USERSET		(PSL_EE | PSL_PR | PSL_IR | PSL_DR | PSL_ME)



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

2015-07-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul  6 05:55:38 UTC 2015

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

Log Message:
Don't clear PSL_FP/PSL_VEC


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

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

Modified files:

Index: src/sys/arch/powerpc/include/userret.h
diff -u src/sys/arch/powerpc/include/userret.h:1.29 src/sys/arch/powerpc/include/userret.h:1.30
--- src/sys/arch/powerpc/include/userret.h:1.29	Mon Jul  6 02:30:22 2015
+++ src/sys/arch/powerpc/include/userret.h	Mon Jul  6 05:55:37 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: userret.h,v 1.29 2015/07/06 02:30:22 matt Exp $	*/
+/*	$NetBSD: userret.h,v 1.30 2015/07/06 05:55:37 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -66,7 +66,8 @@ userret(struct lwp *l, struct trapframe 
 	tf=%p: srr1 (%#lx): PSL_FP set but FPU curlwp %p is not curlwp %p!,
 	tf, tf-tf_srr1, l-l_cpu-ci_data.cpu_pcu_curlwp[PCU_FPU], l);
 
-	tf-tf_srr1 = PSL_USERSRR1;	/* clear SRR1 status bits */
+	/* clear SRR1 status bits */
+	tf-tf_srr1 = (PSL_USERSRR1|PSL_FP|PSL_VEC);
 
 #ifdef ALTIVEC
 	/*



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

2015-07-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jul  6 02:30:22 UTC 2015

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

Log Message:
Add a check to make sure that if PSL_FP is set, we own the FPU.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/powerpc/include/userret.h

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

Modified files:

Index: src/sys/arch/powerpc/include/userret.h
diff -u src/sys/arch/powerpc/include/userret.h:1.28 src/sys/arch/powerpc/include/userret.h:1.29
--- src/sys/arch/powerpc/include/userret.h:1.28	Mon Mar 10 00:04:04 2014
+++ src/sys/arch/powerpc/include/userret.h	Mon Jul  6 02:30:22 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: userret.h,v 1.28 2014/03/10 00:04:04 matt Exp $	*/
+/*	$NetBSD: userret.h,v 1.29 2015/07/06 02:30:22 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -61,6 +61,10 @@ userret(struct lwp *l, struct trapframe 
 	KASSERTMSG((tf-tf_srr1  PSL_PR) != 0,
 	tf=%p: srr1 (%#lx): PSL_PR isn't set!,
 	tf, tf-tf_srr1);
+	KASSERTMSG((tf-tf_srr1  PSL_FP) == 0
+	|| l-l_cpu-ci_data.cpu_pcu_curlwp[PCU_FPU] == l,
+	tf=%p: srr1 (%#lx): PSL_FP set but FPU curlwp %p is not curlwp %p!,
+	tf, tf-tf_srr1, l-l_cpu-ci_data.cpu_pcu_curlwp[PCU_FPU], l);
 
 	tf-tf_srr1 = PSL_USERSRR1;	/* clear SRR1 status bits */
 



CVS commit: src/sys/arch/powerpc/include/booke

2015-06-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jun 16 06:51:16 UTC 2015

Modified Files:
src/sys/arch/powerpc/include/booke: cpuvar.h

Log Message:
This needs to define PRIxPTE too.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/powerpc/include/booke/cpuvar.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/powerpc/include/booke/cpuvar.h
diff -u src/sys/arch/powerpc/include/booke/cpuvar.h:1.17 src/sys/arch/powerpc/include/booke/cpuvar.h:1.18
--- src/sys/arch/powerpc/include/booke/cpuvar.h:1.17	Tue Oct  2 23:51:39 2012
+++ src/sys/arch/powerpc/include/booke/cpuvar.h	Tue Jun 16 06:51:16 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuvar.h,v 1.17 2012/10/02 23:51:39 christos Exp $	*/
+/*	$NetBSD: cpuvar.h,v 1.18 2015/06/16 06:51:16 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -107,6 +107,7 @@ struct generic_attach_args {
 #ifndef __BSD_PT_ENTRY_T
 #define __BSD_PT_ENTRY_T	__uint32_t
 typedef __BSD_PT_ENTRY_T	pt_entry_t;
+#define PRIxPTE			PRIx32
 #endif
 
 #include uvm/pmap/tlb.h



CVS commit: src/sys/arch/powerpc/include/booke

2015-02-25 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Thu Feb 26 02:21:38 UTC 2015

Modified Files:
src/sys/arch/powerpc/include/booke: etsecreg.h

Log Message:
fix offset value of RBASEn.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/include/booke/etsecreg.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/powerpc/include/booke/etsecreg.h
diff -u src/sys/arch/powerpc/include/booke/etsecreg.h:1.6 src/sys/arch/powerpc/include/booke/etsecreg.h:1.7
--- src/sys/arch/powerpc/include/booke/etsecreg.h:1.6	Tue Feb 17 01:53:21 2015
+++ src/sys/arch/powerpc/include/booke/etsecreg.h	Thu Feb 26 02:21:38 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: etsecreg.h,v 1.6 2015/02/17 01:53:21 nonaka Exp $	*/
+/*	$NetBSD: etsecreg.h,v 1.7 2015/02/26 02:21:38 nonaka Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -355,7 +355,7 @@ struct rxfcb {
 #define RBASE5		0x42C /* RxBD base address of ring 5 [TSEC3] */
 #define RBASE6		0x434 /* RxBD base address of ring 6 [TSEC3] */
 #define RBASE7		0x43C /* RxBD base address of ring 7 [TSEC3] */
-#define RBASEn(n)	(RBASE0 + 4*(n))
+#define RBASEn(n)	(RBASE0 + 8*(n))
 #define TMR_RXTS_H	0x4C0 /* Rx timer time stamp register high [TSEC3] */
 #define TMR_RXTS_L	0x4C4 /* Rx timer time stamp register low [TSEC3] */
 



CVS commit: src/sys/arch/powerpc/include/booke

2015-02-25 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Thu Feb 26 02:27:40 UTC 2015

Modified Files:
src/sys/arch/powerpc/include/booke: etsecreg.h

Log Message:
Added some register definitions for multi-queue.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/include/booke/etsecreg.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/powerpc/include/booke/etsecreg.h
diff -u src/sys/arch/powerpc/include/booke/etsecreg.h:1.7 src/sys/arch/powerpc/include/booke/etsecreg.h:1.8
--- src/sys/arch/powerpc/include/booke/etsecreg.h:1.7	Thu Feb 26 02:21:38 2015
+++ src/sys/arch/powerpc/include/booke/etsecreg.h	Thu Feb 26 02:27:40 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: etsecreg.h,v 1.7 2015/02/26 02:21:38 nonaka Exp $	*/
+/*	$NetBSD: etsecreg.h,v 1.8 2015/02/26 02:27:40 nonaka Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -109,15 +109,16 @@ struct rxbd {
 #define	RXFCB_CTU	0x0400	/* TCP or UDP checksum checked */
 #define	RXFCB_EIP	0x0200	/* IPv4 header checksum error */
 #define	RXFCB_ETU	0x0100	/* TCP or UDP header checksum error */
+#define	RXFCB_HASH_VAL	0x0010	/* FLR_HASH value is valid */
 #define	RXFCB_PERR	0x000c	/* Parse Error */
 #define	RXFCB_PERR_L3	0x0008	/* L3 Parse Error */
 
 struct rxfcb {
 	uint16_t rxfcb_flags;
-	uint8_t rxfcb_rq;	/* receive queue index */
-	uint8_t rxfcb_pro;	/* IP Protocol received */
-	uint16_t rxfcb__mbz1;
-	uint16_t rxfcb_vlctl;	/* VLAN control field */
+	uint8_t rxfcb_rq;		/* receive queue index */
+	uint8_t rxfcb_pro;		/* IP Protocol received */
+	uint16_t rxfcb_flr_hash;	/* filer hash value */
+	uint16_t rxfcb_vlctl;		/* VLAN control field */
 };
 
 /* 0x000-0x0ff eTSEC general control/status registers */
@@ -139,7 +140,8 @@ struct rxfcb {
 #define	IEVENT_CRL	__PPCBIT(14)	/* collision retry limit */
 #define	IEVENT_XFUN	__PPCBIT(15)	/* transmit fifo underrun */
 #define	IEVENT_RXB	__PPCBIT(16)	/* receive buffer */
-#define	IEVENT_MAG	__PPCBIT(29)	/* magic packet detected */
+#define	IEVENT_TWK	__PPCBIT(19)	/* timer wakeup */
+#define	IEVENT_MAG	__PPCBIT(20)	/* magic packet detected */
 #define	IEVENT_MMRD	__PPCBIT(21)	/* MMI manangement read complete */
 #define	IEVENT_MMWR	__PPCBIT(22)	/* MMI manangement write complete */
 #define	IEVENT_GRSC	__PPCBIT(23)	/* graceful receive stop complete */
@@ -188,7 +190,10 @@ struct rxfcb {
 #define TCTRL_THDF	__PPCBIT(29) /* Transmit half duplex */
 #define TCTRL_RFC_PAUSE	__PPCBIT(27) /* receive flow control pause frame */
 #define TCTRL_TFC_PAUSE	__PPCBIT(28) /* transmit flow control pause frame */
-#define TXSCHED		__PPCBITS(29,30) /* transmit ring scheduling algorithm */
+#define TCTRL_TXSCHED	__PPCBITS(29,30) /* transmit ring scheduling algorithm */
+#define TCTRL_TXSCHED_SINGLE	__SHIFTIN(0,TCTRL_TXSCHED)
+#define TCTRL_TXSCHED_PRIO	__SHIFTIN(1,TCTRL_TXSCHED)
+#define TCTRL_TXSCHED_MWRR	__SHIFTIN(2,TCTRL_TXSCHED)
 
 #define TSTAT		0x104 /* Transmit status register */
 #define	TSTAT_THLT0	__PPCBIT(0) /* transmit halt of ring 0 */
@@ -264,6 +269,10 @@ struct rxfcb {
 /* 0x300-0x4ff eTSEC receive control/status registers */
 
 #define RCTRL		0x300 /* Receive control register */
+#define	RCTRL_L2OFF	__PPCBITS(0,6)
+#define	RCTRL_L2OFF_SET(n)	__SHIFTIN((n),RCTRL_L2OFF)
+#define	RCTRL_TS	__PPCBIT(7)
+#define	RCTRL_RR	__PPCBIT(10)
 #define	RCTRL_PAL	__PPCBITS(11,15)
 #define	RCTRL_VLEX	__PPCBIT(18)
 #define	RCTRL_FILREN	__PPCBIT(19)
@@ -321,7 +330,7 @@ struct rxfcb {
 #define	RQUEUE_EX6	__PPCBIT(14)
 #define	RQUEUE_EX7	__PPCBIT(15)
 #define	RQUEUE_EXn(n)	(RQUEUE_EX0  (n))
-#define	RQUEUE_EX	__PPCBITS(0,7)
+#define	RQUEUE_EX	__PPCBITS(8,15)
 #define	RQUEUE_EN0	__PPCBIT(24) /* ring is queried for reception */
 #define	RQUEUE_EN1	__PPCBIT(25)
 #define	RQUEUE_EN2	__PPCBIT(26)
@@ -332,10 +341,65 @@ struct rxfcb {
 #define	RQUEUE_EN7	__PPCBIT(31)
 #define	RQUEUE_EN	__PPCBITS(24,31)
 #define	RQUEUE_ENn(n)	(RQUEUE_EN0  (n))
+#define	RIR0		0x318	/* Ring mapping register 0 */
+#define	RIR1		0x31c	/* Ring mapping register 1 */
+#define	RIR2		0x320	/* Ring mapping register 2 */
+#define	RIR3		0x324	/* Ring mapping register 3 */
+#define	RIRn(n)		(RIR0 + 4*(n))
 #define RBIFX		0x330 /* Receive bit field extract control register [TSEC3] */
 #define RQFAR		0x334 /* Receive queue filing table address register [TSEC3] */
 #define RQFCR		0x338 /* Receive queue filing table control register [TSEC3] */
+#define RQFCR_GPI	__PPCBIT(0) /* General purpose interrupt */
+#define RQFCR_HASHTBL	__PPCBITS(12,14) /* Select between filer Q value and RIR fileds. */
+#define RQFCR_HASHTBL_Q	__SHIFTIN(0,RQFCR_HASHTBL)
+#define RQFCR_HASHTBL_0	__SHIFTIN(1,RQFCR_HASHTBL)
+#define RQFCR_HASHTBL_1	__SHIFTIN(2,RQFCR_HASHTBL)
+#define RQFCR_HASHTBL_2	__SHIFTIN(3,RQFCR_HASHTBL)
+#define RQFCR_HASHTBL_3	__SHIFTIN(4,RQFCR_HASHTBL)
+#define RQFCR_HASH	__PPCBIT(15) /* Include parser results in 

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

2015-01-11 Thread Dennis Ferguson
Module Name:src
Committed By:   dennis
Date:   Mon Jan 12 02:32:33 UTC 2015

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

Log Message:
Name the offsets to the remaining fields in the ppc64
stack frame header.  Add a stack frame alignment macro
to avoid hard-coding that.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/powerpc/include/asm.h

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

Modified files:

Index: src/sys/arch/powerpc/include/asm.h
diff -u src/sys/arch/powerpc/include/asm.h:1.47 src/sys/arch/powerpc/include/asm.h:1.48
--- src/sys/arch/powerpc/include/asm.h:1.47	Sat Aug 23 02:21:44 2014
+++ src/sys/arch/powerpc/include/asm.h	Mon Jan 12 02:32:33 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.47 2014/08/23 02:21:44 matt Exp $	*/
+/*	$NetBSD: asm.h,v 1.48 2015/01/12 02:32:33 dennis Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -104,7 +104,11 @@
 # define SF_SP		 0
 # define SF_CR		 8
 # define SF_LR		16
+# define SF_COMP	24
+# define SF_LD		32
+# define SF_TOC		40
 # define SF_PARAM	SF_HEADER_SZ
+# define SF_ALIGN(x)	(((x) + 0xf)  ~0xf)
 
 # define _XENTRY(y)			\
 	.globl	y;			\



CVS commit: src/sys/arch/powerpc/include/booke

2014-12-27 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Dec 27 12:36:48 UTC 2014

Modified Files:
src/sys/arch/powerpc/include/booke: spr.h

Log Message:
Added MMUv2 define.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/powerpc/include/booke/spr.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/powerpc/include/booke/spr.h
diff -u src/sys/arch/powerpc/include/booke/spr.h:1.12 src/sys/arch/powerpc/include/booke/spr.h:1.13
--- src/sys/arch/powerpc/include/booke/spr.h:1.12	Sat Dec 20 16:34:47 2014
+++ src/sys/arch/powerpc/include/booke/spr.h	Sat Dec 27 12:36:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: spr.h,v 1.12 2014/12/20 16:34:47 nonaka Exp $	*/
+/*	$NetBSD: spr.h,v 1.13 2014/12/27 12:36:48 nonaka Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -527,6 +527,7 @@
 #define	  MMUCFG_NTLBS_GET(n)	  (((n)  2)  3) /* NTLBS is max value of MAS0[TLBSEL] */
 #define	  MMUCFG_MAVN		  0x0003 /* MMU Architecture Version Number */
 #define	  MMUCFG_MAVN_V1	  0
+#define	  MMUCFG_MAVN_V2	  1
 #define	SPR_SVR			1023	/* E... System Version Register */
 
 #define	PMR_PMC0		16



CVS commit: src/sys/arch/powerpc/include/booke

2014-12-27 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Dec 27 17:58:22 UTC 2014

Modified Files:
src/sys/arch/powerpc/include/booke: e500reg.h

Log Message:
Added SPI register definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/powerpc/include/booke/e500reg.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/powerpc/include/booke/e500reg.h
diff -u src/sys/arch/powerpc/include/booke/e500reg.h:1.15 src/sys/arch/powerpc/include/booke/e500reg.h:1.16
--- src/sys/arch/powerpc/include/booke/e500reg.h:1.15	Sat Dec 27 16:19:33 2014
+++ src/sys/arch/powerpc/include/booke/e500reg.h	Sat Dec 27 17:58:21 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: e500reg.h,v 1.15 2014/12/27 16:19:33 nonaka Exp $	*/
+/*	$NetBSD: e500reg.h,v 1.16 2014/12/27 17:58:21 nonaka Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -313,6 +313,61 @@
 #define	SPI_BASE	0x7000	/* MPC8536 */
 #define	SPI_SIZE	0x1000
 
+#ifdef SPI_PRIVATE
+#define	SPMODE		0x000	/* mode register */
+#define	SPMODE_EN	__PPCBIT(0)	/* Enable eSPI: 0=disabled, 1=enabled */
+#define	SPMODE_LOOP	__PPCBIT(1)	/* Loop mode: 0=normal, 1=loopback */
+#define	SPMODE_OD	__PPCBIT(2)	/* P1023: Open drain mode: 0=actively driven, 1=open drain */
+#define	SPMODE_HO_ADJ	__PPCBITS(13,15) /* Data output hold adjustment */
+#define	SPMODE_TXTHR	__PPCBITS(18,23) /* Tx FIFO Threshold: 1-32 */
+#define	SPMODE_RXTHR	__PPCBITS(27,31) /* Rx FIFO threshold: 0-31 */
+#define	SPIE		0x004	/* event register */
+#define	SPIE_RXCNT	__PPCBITS(2,7)	/* current number of full Rx FIFO bytes */
+#define	SPIE_TXCNT	__PPCBITS(10,15) /* current number of full Tx FIFO bytes */
+#define	SPIE_TXE	__PPCBIT(16)	/* Tx FIFO is empty */
+#define	SPIE_DON	__PPCBIT(17)	/* Last character was transmitted */
+#define	SPIE_RXT	__PPCBIT(18)	/* Rx FIFO has more than RXTHR bytes */
+#define	SPIE_RXF	__PPCBIT(19)	/* Rx FIFO is full */
+#define	SPIE_TXT	__PPCBIT(20)	/* Tx FIFO has less than TXTHR bytes */
+#define	SPIE_RNE	__PPCBIT(22)	/* Not empty: 0=empty, 1=not empty */
+#define	SPIE_TNF	__PPCBIT(23)	/* Tx FIFO not full: 0=full, 1=not full */
+#define	SPIM		0x008	/* mask register */
+#define	SPIM_TXE	__PPCBIT(16)
+#define	SPIM_DON	__PPCBIT(17)
+#define	SPIM_RXT	__PPCBIT(18)
+#define	SPIM_RXF	__PPCBIT(19)
+#define	SPIM_TXT	__PPCBIT(20)
+#define	SPIM_RNE	__PPCBIT(22)
+#define	SPIM_TNF	__PPCBIT(23)
+#define	SPCOM		0x00c	/* command register */
+#define	SPCOM_CS	__PPCBITS(0,1)	/* Chip select: 0=CS0, 1=CS1, 2=CS2(P1025), 3=CS3(P1025) */
+#define	SPCOM_RXDELAY	__PPCBIT(2)	/* 0=normal eSPI operation */
+#define	SPCOM_DO	__PPCBIT(3)	/* 0=normal eSPI operation, 1=Winbond dual output read */
+#define	SPCOM_TO	__PPCBIT(4)	/* Transmit only: 0=normal operation, 1=No reception is done for the frame */
+#define	SPCOM_HLD	__PPCBIT(5)	/* 0=normal operation, 1=Mask first generated SPI_CLK */
+#define	SPCOM_LS	__PPCBIT(6)	/* P1023: Late sample: 0=normal operation, 1=Late data sample */
+#define	SPCOM_RXSKIP	__PPCBITS(8,15)	/* if RxSKIP != 0: Number of characters skipped for reception from frame start */
+#define	SPCOM_TRANLEN	__PPCBITS(16,31) /* Transaction length */
+#define	SPITF		0x010	/* transmit FIFO access register */
+#define	SPIRF		0x014	/* receive FIFO access register */
+#define	SPMODE0		0x020	/* CS0 mode register */
+#define	SPMODE1		0x024	/* CS1 mode register */
+#define	SPMODE2		0x028	/* CS2 mode register (P1025) */
+#define	SPMODE3		0x02c	/* CS3 mode register (P1025) */
+#define	SPMODEn(n)	(0x020+(n)*4)
+#define	SPMODEn_CI	__PPCBIT(0)	/* Clock invert: 0=inactive state of SPI_CLK is low, 1=high */
+#define	SPMODEn_CP	__PPCBIT(1)	/* Clock phase: SPI_CLK starts toggling at the middle of the data transfer, 1=beginning */
+#define	SPMODEn_REV	__PPCBIT(2)	/* Reverse data mode: 0=LSB of the character sent and received first, 1=MSB */
+#define	SPMODEn_DIV16	__PPCBIT(3)	/* Devide by 16: 0=System clock, 1=System clock/16 */
+#define	SPMODEn_PM	__PPCBITS(4,7)	/* Prescale modulus select */
+#define	SPMODEn_ODD	__PPCBIT(8)	/* 0=Even division, 1=Odd dividion */
+#define	SPMODEn_POL	__PPCBIT(11)	/* CS polarity: 0=Asserted high/Negated low, 1=Asserted low/Negated high */
+#define	SPMODEn_LEN	__PPCBITS(12,15) /* Character length in bits per character */
+#define	SPMODEn_CSBEF	__PPCBITS(16,19) /* CS assertion time in bits before frame start */
+#define	SPMODEn_CSAFT	__PPCBITS(20,23) /* CS assertion time in bits after frame end */
+#define	SPMODEn_CSCG	__PPCBITS(24,28) /* Clock gap */
+#endif
+
 #define	SATA1_BASE	0x18000	/* MPC8536 */
 #define	SATA2_BASE	0x19000	/* MPC8536 */
 #define	SATA_SIZE	0x01000



CVS commit: src/sys/arch/powerpc/include/booke

2014-12-20 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Dec 20 16:34:48 UTC 2014

Modified Files:
src/sys/arch/powerpc/include/booke: spr.h

Log Message:
Added P1023/P1017.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/powerpc/include/booke/spr.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/powerpc/include/booke/spr.h
diff -u src/sys/arch/powerpc/include/booke/spr.h:1.11 src/sys/arch/powerpc/include/booke/spr.h:1.12
--- src/sys/arch/powerpc/include/booke/spr.h:1.11	Wed Aug  1 00:45:18 2012
+++ src/sys/arch/powerpc/include/booke/spr.h	Sat Dec 20 16:34:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: spr.h,v 1.11 2012/08/01 00:45:18 matt Exp $	*/
+/*	$NetBSD: spr.h,v 1.12 2014/12/20 16:34:47 nonaka Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -72,9 +72,11 @@
 #define	SVR_P1013v2		  0x80e70020
 #define	SVR_P1015v1		  0x80e50210
 #define	SVR_P1016v1		  0x80e50310
+#define	SVR_P1017v1		  0x80f70011
 #define	SVR_P1020v2		  0x80e40020
 #define	SVR_P1021v2		  0x80e40120
 #define	SVR_P1022v2		  0x80e60020
+#define	SVR_P1023v1		  0x80f60011
 #define	SVR_P1024v2		  0x80e40210
 #define	SVR_P1025v1		  0x80e40310
 



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

2014-08-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Aug 23 02:21:44 UTC 2014

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

Log Message:
Fix cmpptr/cmpreq/etc to use right mnemonics


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/powerpc/include/asm.h

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

Modified files:

Index: src/sys/arch/powerpc/include/asm.h
diff -u src/sys/arch/powerpc/include/asm.h:1.46 src/sys/arch/powerpc/include/asm.h:1.47
--- src/sys/arch/powerpc/include/asm.h:1.46	Thu Mar  6 19:05:24 2014
+++ src/sys/arch/powerpc/include/asm.h	Sat Aug 23 02:21:44 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.46 2014/03/06 19:05:24 matt Exp $	*/
+/*	$NetBSD: asm.h,v 1.47 2014/08/23 02:21:44 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -356,12 +356,12 @@ y:	.quad	.##y,.TOC.@tocbase,0;	\
 # define cmpptri	cmpwi
 # define cmplongi	cmpwi
 # define cmpregi	cmpwi
-# define cmpptrl	cmpwl
-# define cmplongl	cmpwl
-# define cmpregl	cmpwl
-# define cmpptrli	cmpwli
-# define cmplongli	cmpwli
-# define cmpregli	cmpwli
+# define cmpptrl	cmplw
+# define cmplongl	cmplw
+# define cmpregl	cmplw
+# define cmpptrli	cmplwi
+# define cmplongli	cmplwi
+# define cmpregli	cmplwi
 
 #else /* __LP64__ */
 
@@ -401,12 +401,12 @@ y:	.quad	.##y,.TOC.@tocbase,0;	\
 # define cmpptri	cmpdi
 # define cmplongi	cmpdi
 # define cmpregi	cmpdi
-# define cmpptrl	cmpdl
-# define cmplongl	cmpdl
-# define cmpregl	cmpdl
-# define cmpptrli	cmpdli
-# define cmplongli	cmpdli
-# define cmpregli	cmpdli
+# define cmpptrl	cmpld
+# define cmplongl	cmpld
+# define cmpregl	cmpld
+# define cmpptrli	cmpldi
+# define cmplongli	cmpldi
+# define cmpregli	cmpldi
 
 #endif /* __LP64__ */
 



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

2014-08-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Aug  1 21:56:36 UTC 2014

Modified Files:
src/sys/arch/powerpc/include: instr.h

Log Message:
Add OPC31_OR


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/include/instr.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/powerpc/include/instr.h
diff -u src/sys/arch/powerpc/include/instr.h:1.6 src/sys/arch/powerpc/include/instr.h:1.7
--- src/sys/arch/powerpc/include/instr.h:1.6	Sat Feb 12 18:23:09 2011
+++ src/sys/arch/powerpc/include/instr.h	Fri Aug  1 21:56:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: instr.h,v 1.6 2011/02/12 18:23:09 matt Exp $ */
+/*	$NetBSD: instr.h,v 1.7 2014/08/01 21:56:36 matt Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -315,6 +315,11 @@ union instr {
 #define OPC31_MTSPR	0x1d3
 
 /*
+ * Opcode 31 sub-types (integer only)
+ */
+#define OPC31_OR	0x1bc
+
+/*
  * Opcode 59 sub-types:
  */
 



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

2014-07-24 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Jul 24 18:19:13 UTC 2014

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

Log Message:
Let the assembler bail out if the immediate is too large instead of
truncating it.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/powerpc/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/powerpc/include/mcontext.h
diff -u src/sys/arch/powerpc/include/mcontext.h:1.15 src/sys/arch/powerpc/include/mcontext.h:1.16
--- src/sys/arch/powerpc/include/mcontext.h:1.15	Fri Feb 28 05:27:05 2014
+++ src/sys/arch/powerpc/include/mcontext.h	Thu Jul 24 18:19:13 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mcontext.h,v 1.15 2014/02/28 05:27:05 matt Exp $	*/
+/*	$NetBSD: mcontext.h,v 1.16 2014/07/24 18:19:13 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -152,7 +152,7 @@ __lwp_gettcb_fast(void)
 	void *__tcb;
 
 	__asm __volatile(
-		addi %[__tcb],%%r2,%[__offset]@l
+		addi %[__tcb],%%r2,%[__offset]
 	:	[__tcb] =r (__tcb)
 	:	[__offset] n (-(TLS_TP_OFFSET + sizeof(struct tls_tcb;
 
@@ -163,7 +163,7 @@ static __inline void
 __lwp_settcb(void *__tcb)
 {
 	__asm __volatile(
-		addi %%r2,%[__tcb],%[__offset]@l
+		addi %%r2,%[__tcb],%[__offset]
 	:
 	:	[__tcb] r (__tcb),
 		[__offset] n (TLS_TP_OFFSET + sizeof(struct tls_tcb)));



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

2014-07-22 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Tue Jul 22 20:38:55 UTC 2014

Modified Files:
src/sys/arch/powerpc/include: sljitarch.h

Log Message:
Cast to __syncicache() argument types.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/powerpc/include/sljitarch.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/powerpc/include/sljitarch.h
diff -u src/sys/arch/powerpc/include/sljitarch.h:1.2 src/sys/arch/powerpc/include/sljitarch.h:1.3
--- src/sys/arch/powerpc/include/sljitarch.h:1.2	Mon Nov 25 23:53:44 2013
+++ src/sys/arch/powerpc/include/sljitarch.h	Tue Jul 22 20:38:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sljitarch.h,v 1.2 2013/11/25 23:53:44 alnsn Exp $	*/
+/*	$NetBSD: sljitarch.h,v 1.3 2014/07/22 20:38:55 alnsn Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -39,6 +39,6 @@
 #endif
 
 #define SLJIT_CACHE_FLUSH(from, to) \
-	__syncicache((from), (to)-(from))
+	__syncicache((void *)(from), (size_t)((to) - (from)))
 
 #endif



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

2014-07-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jul  6 08:06:03 UTC 2014

Modified Files:
src/sys/arch/powerpc/include/oea: bat.h

Log Message:
make sure struct bat is aligned to 8 bytes as we shift them 3 bits.

fixes PReP lossage as reported on port-powerpc and port-prep.
thanks to mak...@ki.nu and kiyohara@netbsd.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/powerpc/include/oea/bat.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/powerpc/include/oea/bat.h
diff -u src/sys/arch/powerpc/include/oea/bat.h:1.17 src/sys/arch/powerpc/include/oea/bat.h:1.18
--- src/sys/arch/powerpc/include/oea/bat.h:1.17	Wed Feb 15 04:33:19 2012
+++ src/sys/arch/powerpc/include/oea/bat.h	Sun Jul  6 08:06:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bat.h,v 1.17 2012/02/15 04:33:19 macallan Exp $	*/
+/*	$NetBSD: bat.h,v 1.18 2014/07/06 08:06:03 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
 struct bat {
 	register_t batu;
 	register_t batl;
-};
+} __aligned(8);
 #endif
 
 /* Lower BAT bits (all but PowerPC 601): */



CVS commit: src/sys/arch/powerpc/include/booke

2014-04-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Apr  3 13:55:34 UTC 2014

Modified Files:
src/sys/arch/powerpc/include/booke: pmap.h

Log Message:
Add PMAP_TLB_FLUSH_ASID_ON_RESET define


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/powerpc/include/booke/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/powerpc/include/booke/pmap.h
diff -u src/sys/arch/powerpc/include/booke/pmap.h:1.13 src/sys/arch/powerpc/include/booke/pmap.h:1.14
--- src/sys/arch/powerpc/include/booke/pmap.h:1.13	Tue Mar 18 18:20:41 2014
+++ src/sys/arch/powerpc/include/booke/pmap.h	Thu Apr  3 13:55:34 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.13 2014/03/18 18:20:41 riastradh Exp $	*/
+/*	$NetBSD: pmap.h,v 1.14 2014/04/03 13:55:34 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -72,6 +72,7 @@
 #define	PMAP_TLB_NUM_PIDS		256
 #define	PMAP_TLB_MAX			1
 #define	PMAP_INVALID_SEGTAB_ADDRESS	((pmap_segtab_t *)0xfeeddead)
+#define	PMAP_TLB_FLUSH_ASID_ON_RESET	false
 
 #define	pmap_phys_address(x)		(x)
 



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

2014-03-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 10 00:04:04 UTC 2014

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

Log Message:
same typo


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

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

Modified files:

Index: src/sys/arch/powerpc/include/userret.h
diff -u src/sys/arch/powerpc/include/userret.h:1.27 src/sys/arch/powerpc/include/userret.h:1.28
--- src/sys/arch/powerpc/include/userret.h:1.27	Mon Mar 10 00:03:14 2014
+++ src/sys/arch/powerpc/include/userret.h	Mon Mar 10 00:04:04 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: userret.h,v 1.27 2014/03/10 00:03:14 matt Exp $	*/
+/*	$NetBSD: userret.h,v 1.28 2014/03/10 00:04:04 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -79,7 +79,7 @@ userret(struct lwp *l, struct trapframe 
 	 * use IAC1/IAC2 to match the next PC.
 	 */
 	if (__predict_false(tf-tf_srr1  PSL_SE)) {
-		tf-tf_ssr1 = ~PSL_SE;
+		tf-tf_srr1 = ~PSL_SE;
 		extern void booke_sstep(struct trapframe *); /* ugly */
 		booke_sstep(tf);
 	}



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

2014-03-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 10 00:03:14 UTC 2014

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

Log Message:
Typo


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/powerpc/include/userret.h

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

Modified files:

Index: src/sys/arch/powerpc/include/userret.h
diff -u src/sys/arch/powerpc/include/userret.h:1.26 src/sys/arch/powerpc/include/userret.h:1.27
--- src/sys/arch/powerpc/include/userret.h:1.26	Sun Mar  9 23:09:32 2014
+++ src/sys/arch/powerpc/include/userret.h	Mon Mar 10 00:03:14 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: userret.h,v 1.26 2014/03/09 23:09:32 matt Exp $	*/
+/*	$NetBSD: userret.h,v 1.27 2014/03/10 00:03:14 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -78,7 +78,7 @@ userret(struct lwp *l, struct trapframe 
 	 * completion exception but it needs PSL_DE to fire.  Instead we
 	 * use IAC1/IAC2 to match the next PC.
 	 */
-	if (__predict_false(tf-tf_ssr1  PSL_SE)) {
+	if (__predict_false(tf-tf_srr1  PSL_SE)) {
 		tf-tf_ssr1 = ~PSL_SE;
 		extern void booke_sstep(struct trapframe *); /* ugly */
 		booke_sstep(tf);



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

2014-03-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Mar  6 19:05:24 UTC 2014

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

Log Message:
Add _XENTRY which doesn't set the section to .text


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/powerpc/include/asm.h

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

Modified files:

Index: src/sys/arch/powerpc/include/asm.h
diff -u src/sys/arch/powerpc/include/asm.h:1.45 src/sys/arch/powerpc/include/asm.h:1.46
--- src/sys/arch/powerpc/include/asm.h:1.45	Fri Feb 28 05:26:23 2014
+++ src/sys/arch/powerpc/include/asm.h	Thu Mar  6 19:05:24 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.45 2014/02/28 05:26:23 matt Exp $	*/
+/*	$NetBSD: asm.h,v 1.46 2014/03/06 19:05:24 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -106,7 +106,7 @@
 # define SF_LR		16
 # define SF_PARAM	SF_HEADER_SZ
 
-# define _ENTRY(y)			\
+# define _XENTRY(y)			\
 	.globl	y;			\
 	.pushsection .opd,aw;	\
 	.align	3;			\
@@ -118,6 +118,8 @@ y:	.quad	.##y,.TOC.@tocbase,0;	\
 	.align	3;			\
 .##y:
 
+#define _ENTRY(x)	.text; _XENTRY(x)
+
 # define ENTRY(y) _ENTRY(y)
 
 # define END(y)	.size .##y,. - .##y
@@ -130,8 +132,8 @@ y:	.quad	.##y,.TOC.@tocbase,0;	\
 # define ASENTRY(y)		ENTRY(y)
 #else /* !_LP64 */
 
-# define _ENTRY(x) \
-	.text; .align 2; .globl x; .type x,@function; x:
+# define _XENTRY(x)	.align 2; .globl x; .type x,@function; x:
+# define _ENTRY(x)	.text; _XENTRY(x)
 
 # define ENTRY(y)	_ENTRY(_C_LABEL(y)); _PROF_PROLOGUE
 



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

2014-03-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Mar  6 19:30:39 UTC 2014

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

Log Message:
Add PowerPC64 DTs


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

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

Modified files:

Index: src/sys/arch/powerpc/include/elf_machdep.h
diff -u src/sys/arch/powerpc/include/elf_machdep.h:1.10 src/sys/arch/powerpc/include/elf_machdep.h:1.11
--- src/sys/arch/powerpc/include/elf_machdep.h:1.10	Thu Mar  6 07:48:25 2014
+++ src/sys/arch/powerpc/include/elf_machdep.h	Thu Mar  6 19:30:39 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf_machdep.h,v 1.10 2014/03/06 07:48:25 matt Exp $	*/
+/*	$NetBSD: elf_machdep.h,v 1.11 2014/03/06 19:30:39 matt Exp $	*/
 
 #ifndef _POWERPC_ELF_MACHDEP_H_
 #define _POWERPC_ELF_MACHDEP_H_
@@ -24,6 +24,10 @@
 
 /* Specify the value of _GLOBAL_OFFSET_TABLE_ */
 #define	DT_PPC_GOT		DT_LOPROC
+#define	DT_PPC64_GLINK		(DT_LOPROC + 0)
+#define	DT_PPC64_OPD		(DT_LOPROC + 1)
+#define	DT_PPC64_OPDSZ		(DT_LOPROC + 2)
+#define	DT_PPC64_TLSOPT		(DT_LOPROC + 3)
 
 // A = the addend used to compute the value of relocatable field
 // B = the base address of the shared object



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

2014-03-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Mar  7 04:11:08 UTC 2014

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

Log Message:
Don't define ARCH_ELFSIZE if it's already defined.


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

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

Modified files:

Index: src/sys/arch/powerpc/include/elf_machdep.h
diff -u src/sys/arch/powerpc/include/elf_machdep.h:1.11 src/sys/arch/powerpc/include/elf_machdep.h:1.12
--- src/sys/arch/powerpc/include/elf_machdep.h:1.11	Thu Mar  6 19:30:39 2014
+++ src/sys/arch/powerpc/include/elf_machdep.h	Fri Mar  7 04:11:07 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf_machdep.h,v 1.11 2014/03/06 19:30:39 matt Exp $	*/
+/*	$NetBSD: elf_machdep.h,v 1.12 2014/03/07 04:11:07 matt Exp $	*/
 
 #ifndef _POWERPC_ELF_MACHDEP_H_
 #define _POWERPC_ELF_MACHDEP_H_
@@ -16,11 +16,13 @@
 #define	ELF32_MACHDEP_ID	EM_PPC
 #define	ELF64_MACHDEP_ID	EM_PPC64
 
+#ifndef ARCH_ELFSIZE
 #ifdef _LP64
 #define ARCH_ELFSIZE		64	/* MD native binary size */
 #else
 #define ARCH_ELFSIZE		32	/* MD native binary size */
 #endif
+#endif
 
 /* Specify the value of _GLOBAL_OFFSET_TABLE_ */
 #define	DT_PPC_GOT		DT_LOPROC



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

2014-03-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Mar  6 07:48:25 UTC 2014

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

Log Message:
More comments.
rest of powerpc64 relocs


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

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

Modified files:

Index: src/sys/arch/powerpc/include/elf_machdep.h
diff -u src/sys/arch/powerpc/include/elf_machdep.h:1.9 src/sys/arch/powerpc/include/elf_machdep.h:1.10
--- src/sys/arch/powerpc/include/elf_machdep.h:1.9	Sat Jan 15 10:00:07 2011
+++ src/sys/arch/powerpc/include/elf_machdep.h	Thu Mar  6 07:48:25 2014
@@ -1,4 +1,7 @@
-/*	$NetBSD: elf_machdep.h,v 1.9 2011/01/15 10:00:07 matt Exp $	*/
+/*	$NetBSD: elf_machdep.h,v 1.10 2014/03/06 07:48:25 matt Exp $	*/
+
+#ifndef _POWERPC_ELF_MACHDEP_H_
+#define _POWERPC_ELF_MACHDEP_H_
 
 #define	ELF32_MACHDEP_ENDIANNESS	ELFDATA2MSB
 #define	ELF32_MACHDEP_ID_CASES		\
@@ -22,84 +25,179 @@
 /* Specify the value of _GLOBAL_OFFSET_TABLE_ */
 #define	DT_PPC_GOT		DT_LOPROC
 
+// A = the addend used to compute the value of relocatable field
+// B = the base address of the shared object
+// G = offset into the global offset table
+// L = section offset or address of the procedure link table entry for the
+// symbol + addend
+// M = similar to G except the address which is stored may be the address of
+// the procedure linkage table entry for the symbol
+// P = the place (section offset or address) of the storage unit being
+// relocated (computed using r_offset)
+// R = the offset of the symbol with the section in which the symbol is defined
+// S = the value of the symbol whose index resides in the relocation entry
+//
+// @dtpmod
+//   Computes the load module index of the load module that contains the
+//   definition of sym.  The addend, if present, is ignored.
+// @dtprel
+//   Computes a dtv-relative displacement, the difference between the value of
+//   S + A and the base address of the thread-local storage block that contains
+//   the definition of the symbol, minus 0x8000.
+// @tprel
+//   Computes a tp-relative displacement, the difference between the value of
+//   S + A and the value of the thread pointer (r13).
+// @got@tlsgd
+//   Allocates two contiguous entries in the GOT to hold a tls_index structure,
+//   with values @dtpmod and @dtprel, and computes the offset to the first
+//   entry relative to the TOC base (r2).
+// @got@tlsld
+//   Allocates two contiguous entries in the GOT to hold a tls_index structure,
+//   with values @dtpmod and zero, and computes the offset to the first entry
+//   relative to the TOC base (r2).
+// @got@dtprel
+//   Allocates an entry in the GOT with value @dtprel, and computes the offset
+//   to the entry relative to the TOC base (r2).
+// @got@tprel
+//   Allocates an entry in the GOT with value @tprel, and computes the offset
+//   to the entry relative to the TOC base (r2).
+// 
+// #lo(x) = (x  0x)
+// #hi(x) = ((x  16)  0x)
+// #ha(x) = (((x  16) + ((x  0x8) == 0x8000))  0x)
+// #higher(x) = ((x  32)  0x)
+// #highera(x) =
+//(((x  32) + ((x  0x8000) == 0x8000))  0x)
+// #highest(x) = ((x  48)  0x)
+// #highesta(x) =
+//(((x  48) + ((x  0x8000) == 0x8000))  0x)
+// .TOC. = base TOC base of TOC section for object being relocated
+
 #define	R_PPC_NONE 		0
-#define	R_PPC_32 		1
-#define	R_PPC_24 		2
-#define	R_PPC_16 		3
-#define	R_PPC_16_LO 		4
-#define	R_PPC_16_HI 		5 /* R_PPC_ADDIS */
-#define	R_PPC_16_HA 		6
-#define	R_PPC_14 		7
-#define	R_PPC_14_TAKEN 		8
-#define	R_PPC_14_NTAKEN 	9
-#define	R_PPC_REL24 		10 /* R_PPC_BRANCH */
-#define	R_PPC_REL14 		11
-#define	R_PPC_REL14_TAKEN 	12
-#define	R_PPC_REL14_NTAKEN 	13
-#define	R_PPC_GOT16 		14
-#define	R_PPC_GOT16_LO 		15
-#define	R_PPC_GOT16_HI 		16
-#define	R_PPC_GOT16_HA 		17
-#define	R_PPC_PLT24 		18
-#define	R_PPC_COPY 		19
-#define	R_PPC_GLOB_DAT 		20
+#define	R_PPC_ADDR32 		1	// S + A
+#define	R_PPC_ADDR24 		2	// (S + A)  2
+#define	R_PPC_ADDR16 		3	// S + A
+#define	R_PPC_ADDR16_LO 	4	// #lo(S + A)
+#define	R_PPC_ADDR16_HI 	5	// #hi(S + A)
+#define	R_PPC_ADDR16_HA 	6	// #ha(S + A)
+#define	R_PPC_ADDR14 		7	// (S + A)  2
+#define	R_PPC_ADDR14_TAKEN 	8	// (S + A)  2
+#define	R_PPC_ADDR14_NTAKEN 	9	// (S + A)  2
+#define	R_PPC_REL24 		10 	// (S + A - P)  2
+#define	R_PPC_REL14 		11	// (S + A - P)  2
+#define	R_PPC_REL14_TAKEN 	12	// (S + A - P)  2
+#define	R_PPC_REL14_NTAKEN 	13	// (S + A - P)  2
+#define	R_PPC_GOT16 		14	// G + A
+#define	R_PPC_GOT16_LO 		15	// #lo(G + A)
+#define	R_PPC_GOT16_HI 		16	// #hi(G + A)
+#define	R_PPC_GOT16_HA 		17	// #ha(G + A)
+#define	R_PPC_PLTREL24 		18	// (L + A - P)  2
+#define	R_PPC_COPY 		19	// none
+#define	R_PPC_GLOB_DAT 		20	// S + A
 #define	R_PPC_JMP_SLOT 		21
-#define	R_PPC_RELATIVE 		22
-#define	R_PPC_LOCAL24PC 	23

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

2014-02-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Feb 27 15:58:03 UTC 2014

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

Log Message:
Add P2SZREG to be usign with .p2align


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/powerpc/include/asm.h

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

Modified files:

Index: src/sys/arch/powerpc/include/asm.h
diff -u src/sys/arch/powerpc/include/asm.h:1.42 src/sys/arch/powerpc/include/asm.h:1.43
--- src/sys/arch/powerpc/include/asm.h:1.42	Thu Sep 12 15:36:17 2013
+++ src/sys/arch/powerpc/include/asm.h	Thu Feb 27 15:58:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.42 2013/09/12 15:36:17 joerg Exp $	*/
+/*	$NetBSD: asm.h,v 1.43 2014/02/27 15:58:03 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -334,6 +334,7 @@ y:	.quad	.y,.TOC.@tocbase,0;	\
 # define streg		stw	/* load PPC general register */
 # define stregu		stwu	/* load PPC general register with udpate */
 # define SZREG		4	/* 4 byte registers */
+# define P2SZREG	2
 
 # define lptrarx	lwarx	/* load C pointer with reservation */
 # define llongarx	lwarx	/* load C long with reservation */
@@ -365,6 +366,7 @@ y:	.quad	.y,.TOC.@tocbase,0;	\
 # define lmw		lmd	/* load multiple PPC general registers */
 # define stmw		stmd	/* store multiple PPC general registers */
 # define SZREG		8	/* 8 byte registers */
+# define P2SZREG	3
 
 # define lptrarx	ldarx	/* load C pointer with reservation */
 # define llongarx	ldarx	/* load C long with reservation */



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

2014-02-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Feb 27 18:12:28 UTC 2014

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

Log Message:
Use ## for concatenation


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/powerpc/include/asm.h

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

Modified files:

Index: src/sys/arch/powerpc/include/asm.h
diff -u src/sys/arch/powerpc/include/asm.h:1.43 src/sys/arch/powerpc/include/asm.h:1.44
--- src/sys/arch/powerpc/include/asm.h:1.43	Thu Feb 27 15:58:03 2014
+++ src/sys/arch/powerpc/include/asm.h	Thu Feb 27 18:12:28 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.43 2014/02/27 15:58:03 matt Exp $	*/
+/*	$NetBSD: asm.h,v 1.44 2014/02/27 18:12:28 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -108,19 +108,19 @@
 
 # define _ENTRY(y)			\
 	.globl	y;			\
-	.section .opd,aw;		\
+	.pushsection .opd,aw;	\
 	.align	3;			\
-y:	.quad	.y,.TOC.@tocbase,0;	\
-	.previous;			\
+y:	.quad	.##y,.TOC.@tocbase,0;	\
+	.popsection;			\
 	.size	y,24;			\
-	.type	.y,@function;		\
-	.globl	.y;			\
+	.type	.##y,@function;		\
+	.globl	.##y;			\
 	.align	3;			\
-.y:
+.##y:
 
 # define ENTRY(y) _ENTRY(y)
 
-# define END(y)
+# define END(y)	.size .##y,. - .##y
 
 # define CALL(y)			\
 	bl	.y;			\



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

2014-02-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb 28 05:26:23 UTC 2014

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

Log Message:
Add cmp{ptr,long,reg}{,l}{,i}


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/powerpc/include/asm.h

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

Modified files:

Index: src/sys/arch/powerpc/include/asm.h
diff -u src/sys/arch/powerpc/include/asm.h:1.44 src/sys/arch/powerpc/include/asm.h:1.45
--- src/sys/arch/powerpc/include/asm.h:1.44	Thu Feb 27 18:12:28 2014
+++ src/sys/arch/powerpc/include/asm.h	Fri Feb 28 05:26:23 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.44 2014/02/27 18:12:28 matt Exp $	*/
+/*	$NetBSD: asm.h,v 1.45 2014/02/28 05:26:23 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -348,6 +348,19 @@ y:	.quad	.##y,.TOC.@tocbase,0;	\
 # define clrrlongi	clrrwi	/* clear right C long immediate */
 # define clrrregi	clrrwi	/* clear right PPC general register immediate */
 
+# define cmpptr		cmpw
+# define cmplong	cmpw
+# define cmpreg		cmpw
+# define cmpptri	cmpwi
+# define cmplongi	cmpwi
+# define cmpregi	cmpwi
+# define cmpptrl	cmpwl
+# define cmplongl	cmpwl
+# define cmpregl	cmpwl
+# define cmpptrli	cmpwli
+# define cmplongli	cmpwli
+# define cmpregli	cmpwli
+
 #else /* __LP64__ */
 
 # define ldlong		ld	/* load C long */
@@ -380,6 +393,19 @@ y:	.quad	.##y,.TOC.@tocbase,0;	\
 # define clrrlongi	clrrdi	/* clear right C long immediate */
 # define clrrregi	clrrdi	/* clear right PPC general register immediate */
 
+# define cmpptr		cmpd
+# define cmplong	cmpd
+# define cmpreg		cmpd
+# define cmpptri	cmpdi
+# define cmplongi	cmpdi
+# define cmpregi	cmpdi
+# define cmpptrl	cmpdl
+# define cmplongl	cmpdl
+# define cmpregl	cmpdl
+# define cmpptrli	cmpdli
+# define cmplongli	cmpdli
+# define cmpregli	cmpdli
+
 #endif /* __LP64__ */
 
 #ifdef _LOCORE



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

2014-02-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb 28 05:27:05 UTC 2014

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

Log Message:
Add mcontext32_t


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/powerpc/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/powerpc/include/mcontext.h
diff -u src/sys/arch/powerpc/include/mcontext.h:1.14 src/sys/arch/powerpc/include/mcontext.h:1.15
--- src/sys/arch/powerpc/include/mcontext.h:1.14	Tue Sep 11 00:15:19 2012
+++ src/sys/arch/powerpc/include/mcontext.h	Fri Feb 28 05:27:05 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mcontext.h,v 1.14 2012/09/11 00:15:19 matt Exp $	*/
+/*	$NetBSD: mcontext.h,v 1.15 2014/02/28 05:27:05 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -112,6 +112,17 @@ typedef struct {
 	__vrf_t		__vrf;		/* Vector Register File */
 } mcontext_t;
 
+#if defined(_LP64)
+typedef	int		__greg32_t;
+typedef	__greg32_t	__gregset32_t[_NGREG];
+
+typedef struct {
+	__gregset32_t	__gregs;	/* General Purpose Register set */
+	__fpregset_t	__fpregs;	/* Floating Point Register set */
+	__vrf_t		__vrf;		/* Vector Register File */
+} mcontext32_t;
+#endif
+
 /* Machine-dependent uc_flags */
 #define	_UC_POWERPC_VEC	0x0001	/* Vector Register File valid */
 #define	_UC_POWERPC_SPE	0x0002	/* Vector Register File valid */



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

2014-02-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb 28 05:27:38 UTC 2014

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

Log Message:
support PPC_OEA64


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/powerpc/include/psl.h

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

Modified files:

Index: src/sys/arch/powerpc/include/psl.h
diff -u src/sys/arch/powerpc/include/psl.h:1.18 src/sys/arch/powerpc/include/psl.h:1.19
--- src/sys/arch/powerpc/include/psl.h:1.18	Mon Jun 20 07:23:36 2011
+++ src/sys/arch/powerpc/include/psl.h	Fri Feb 28 05:27:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.18 2011/06/20 07:23:36 matt Exp $	*/
+/*	$NetBSD: psl.h,v 1.19 2014/02/28 05:27:38 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -102,7 +102,8 @@
 #include opt_ppcarch.h
 #endif /* _KERNEL_OPT */
 
-#if defined(PPC_OEA) || defined (PPC_OEA64_BRIDGE) || defined(_MODULE)
+#if defined(PPC_OEA) || defined (PPC_OEA64_BRIDGE) || defined (PPC_OEA64) \
+|| defined(_MODULE)
 extern register_t cpu_psluserset, cpu_pslusermod, cpu_pslusermask;
 
 #define	PSL_USERSET		cpu_psluserset



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

2014-02-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb 28 05:28:40 UTC 2014

Modified Files:
src/sys/arch/powerpc/include: bus_defs.h

Log Message:
Use uintptr_t for bus_size_t, bus_addr_t, bus_space_handler_t since uint32_t
doesn't really work too 64-bit platforms.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/powerpc/include/bus_defs.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/powerpc/include/bus_defs.h
diff -u src/sys/arch/powerpc/include/bus_defs.h:1.1 src/sys/arch/powerpc/include/bus_defs.h:1.2
--- src/sys/arch/powerpc/include/bus_defs.h:1.1	Fri Jul  1 17:10:00 2011
+++ src/sys/arch/powerpc/include/bus_defs.h	Fri Feb 28 05:28:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_defs.h,v 1.1 2011/07/01 17:10:00 dyoung Exp $	*/
+/*	$NetBSD: bus_defs.h,v 1.2 2014/02/28 05:28:40 matt Exp $	*/
 /*	$OpenBSD: bus.h,v 1.1 1997/10/13 10:53:42 pefo Exp $	*/
 
 /*-
@@ -107,11 +107,11 @@
 /*
  * Bus access types.
  */
-typedef uint32_t bus_addr_t;
-typedef uint32_t bus_size_t;
+typedef uintptr_t bus_addr_t;
+typedef uintptr_t bus_size_t;
 
 #ifndef __HAVE_LOCAL_BUS_SPACE
-typedef	uint32_t bus_space_handle_t;
+typedef	uintptr_t bus_space_handle_t;
 typedef	const struct powerpc_bus_space *bus_space_tag_t;
 
 struct extent;



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

2014-02-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb 28 05:29:57 UTC 2014

Modified Files:
src/sys/arch/powerpc/include: cdefs.h

Log Message:
Add ALIGNBYTES32 for COMPAT_NETBSD32


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/powerpc/include/cdefs.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/powerpc/include/cdefs.h
diff -u src/sys/arch/powerpc/include/cdefs.h:1.9 src/sys/arch/powerpc/include/cdefs.h:1.10
--- src/sys/arch/powerpc/include/cdefs.h:1.9	Tue Feb 21 02:19:01 2012
+++ src/sys/arch/powerpc/include/cdefs.h	Fri Feb 28 05:29:57 2014
@@ -1,8 +1,11 @@
-/*	$NetBSD: cdefs.h,v 1.9 2012/02/21 02:19:01 matt Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.10 2014/02/28 05:29:57 matt Exp $	*/
 
 #ifndef	_POWERPC_CDEFS_H_
 #define	_POWERPC_CDEFS_H_
 
 #define	__ALIGNBYTES	(sizeof(double) - 1)
+#ifdef _KERNEL
+#define	ALIGNBYTES32	__ALIGNBYTES
+#endif
 
 #endif /* !_POWERPC_CDEFS_H_ */



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

2014-02-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb 28 05:30:24 UTC 2014

Modified Files:
src/sys/arch/powerpc/include: frame.h

Log Message:
Add trapframe32 for COMPAT_NETBSD32


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/powerpc/include/frame.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/powerpc/include/frame.h
diff -u src/sys/arch/powerpc/include/frame.h:1.25 src/sys/arch/powerpc/include/frame.h:1.26
--- src/sys/arch/powerpc/include/frame.h:1.25	Wed Aug  1 16:19:42 2012
+++ src/sys/arch/powerpc/include/frame.h	Fri Feb 28 05:30:24 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.25 2012/08/01 16:19:42 matt Exp $	*/
+/*	$NetBSD: frame.h,v 1.26 2014/02/28 05:30:24 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -59,6 +59,16 @@ struct reg_sans_pc {
 	register_t r_ctr;
 };
 
+#ifdef _LP64
+struct reg_sans_pc32 {
+	register32_t r_fixreg[32];
+	register32_t r_lr;
+	uint32_t r_cr;
+	uint32_t r_xer;
+	register32_t r_ctr;
+};
+#endif
+
 struct utrapframe {
 	register_t fixreg[32];
 	register_t lr;
@@ -78,6 +88,14 @@ struct clockframe {
 	int cf_idepth;
 };
 
+#ifdef _LP64
+struct clockframe32 {
+	register32_t cf_srr0;
+	register32_t cf_srr1;
+	int cf_idepth;
+};
+#endif
+
 struct trapframe {
 	struct reg_sans_pc tf_ureg;
 	struct clockframe tf_cf;
@@ -100,6 +118,31 @@ struct trapframe {
 	uint32_t tf_spefscr;
 #endif
 };
+
+#ifdef _LP64
+struct trapframe32 {
+	struct reg_sans_pc32 tf_ureg;
+	struct clockframe32 tf_cf;
+	uint32_t tf_exc;
+#if defined(PPC_OEA) || defined(PPC_OEA64) || defined(PPC_OEA64_BRIDGE)
+	register32_t tf_dar;
+	register32_t tf_pad0[2];
+	uint32_t tf_dsisr;
+	uint32_t tf_vrsave;
+	uint32_t tf_mq;
+	uint32_t tf_pad1[1];
+#endif
+#if defined(PPC_BOOKE) || defined(PPC_IBM4XX)
+	register32_t tf_dear;
+	register32_t tf_mcar;
+	register32_t tf_sprg1;
+	uint32_t tf_esr;
+	uint32_t tf_mcsr;
+	uint32_t tf_pid;
+	uint32_t tf_spefscr;
+#endif
+};
+#endif /* _LP64 */
 #define tf_fixreg	tf_ureg.r_fixreg
 #define tf_lr		tf_ureg.r_lr
 #define tf_cr		tf_ureg.r_cr



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

2014-02-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb 28 05:32:01 UTC 2014

Modified Files:
src/sys/arch/powerpc/include/oea: pmap.h

Log Message:
Add pmap_ste_spill


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/powerpc/include/oea/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/powerpc/include/oea/pmap.h
diff -u src/sys/arch/powerpc/include/oea/pmap.h:1.27 src/sys/arch/powerpc/include/oea/pmap.h:1.28
--- src/sys/arch/powerpc/include/oea/pmap.h:1.27	Sat Jul 28 23:11:00 2012
+++ src/sys/arch/powerpc/include/oea/pmap.h	Fri Feb 28 05:32:01 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.27 2012/07/28 23:11:00 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.28 2014/02/28 05:32:01 matt Exp $	*/
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -149,6 +149,7 @@ bool pmap_clear_bit(struct vm_page *, in
 void pmap_real_memory(paddr_t *, psize_t *);
 void pmap_procwr(struct proc *, vaddr_t, size_t);
 int pmap_pte_spill(pmap_t, vaddr_t, bool);
+int pmap_ste_spill(pmap_t, vaddr_t, bool);
 void pmap_pinit(pmap_t);
 
 u_int powerpc_mmap_flags(paddr_t);



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

2014-02-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb 28 05:31:38 UTC 2014

Modified Files:
src/sys/arch/powerpc/include: netbsd32_machdep.h

Log Message:
Make this work.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/include/netbsd32_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/powerpc/include/netbsd32_machdep.h
diff -u src/sys/arch/powerpc/include/netbsd32_machdep.h:1.7 src/sys/arch/powerpc/include/netbsd32_machdep.h:1.8
--- src/sys/arch/powerpc/include/netbsd32_machdep.h:1.7	Mon Jun 20 06:21:45 2011
+++ src/sys/arch/powerpc/include/netbsd32_machdep.h	Fri Feb 28 05:31:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.h,v 1.7 2011/06/20 06:21:45 matt Exp $	*/
+/*	$NetBSD: netbsd32_machdep.h,v 1.8 2014/02/28 05:31:38 matt Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -32,21 +32,17 @@
 #include sys/types.h
 #include sys/proc.h
 
-typedef	u_int32_t netbsd32_pointer_t;
+#define NETBSD32_POINTER_TYPE			uint32_t
+typedef struct { NETBSD32_POINTER_TYPE i32; }	netbsd32_pointer_t;
 
-/*
- * Convert a pointer in the 32-bit world to a valid 64-bit pointer.
- */
-#define	NETBSD32PTR64(p32)	((void *)(u_long)(u_int)(p32))
-
-/* ppc32 has 32bit aligned 64bit integers */
-#define NETBSD32_INT64_ALIGN __attribute__((__aligned__(4)))
+/* ppc32 has normally aligned 64bit integers */
+#define NETBSD32_INT64_ALIGN
 
 #include compat/netbsd32/netbsd32.h
 #include powerpc/frame.h
 
 /* from sparc/include/signal.h */
-typedef u_int32_t netbsd32_sigcontextp_t;
+typedef uint32_t netbsd32_sigcontextp_t;
 
 struct netbsd32_sigcontext {
 	int		sc_onstack;	/* sigstack state to restore */
@@ -65,8 +61,6 @@ struct netbsd32_sigcontext13 {
 
 struct exec_package;
 void netbsd32_setregs (struct lwp *, struct exec_package *, vaddr_t);
-int netbsd32_sigreturn (struct lwp *, void *, register_t *);
-void netbsd32_sendsig (int sig, sigset_t *, u_long);
 
 extern char netbsd32_esigcode[], netbsd32_sigcode[];
 
@@ -74,6 +68,6 @@ extern char netbsd32_esigcode[], netbsd3
  * Need to plug into get sparc specific ioctl's.
  */
 #define	NETBSD32_MD_IOCTL	/* enable netbsd32_md_ioctl() */
-int netbsd32_md_ioctl(struct file *, netbsd32_u_long, void *, struct proc *);
+int netbsd32_md_ioctl(struct file *, netbsd32_u_long, void *, struct lwp *);
 
 #endif /* _MACHINE_NETBSD32_H_ */



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

2014-02-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb 28 05:33:53 UTC 2014

Modified Files:
src/sys/arch/powerpc/include/oea: vmparam.h

Log Message:
Make this 64-bit aware.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/powerpc/include/oea/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/powerpc/include/oea/vmparam.h
diff -u src/sys/arch/powerpc/include/oea/vmparam.h:1.17 src/sys/arch/powerpc/include/oea/vmparam.h:1.18
--- src/sys/arch/powerpc/include/oea/vmparam.h:1.17	Mon Jun 20 20:24:29 2011
+++ src/sys/arch/powerpc/include/oea/vmparam.h	Fri Feb 28 05:33:53 2014
@@ -51,7 +51,7 @@
 #endif
 
 #ifndef	USRSTACK32
-#define	USRSTACK32		((uint32_t)VM_MAXUSER_ADDRESS)
+#define	USRSTACK32		VM_MAXUSER_ADDRESS32
 #endif
 
 #ifndef	MAXTSIZ
@@ -62,18 +62,34 @@
 #define	MAXDSIZ			(1024*1024*1024)	/* maximum data size */
 #endif
 
+#ifndef	MAXDSIZ32
+#define	MAXDSIZ32		(1024*1024*1024)	/* maximum data size */
+#endif
+
 #ifndef	MAXSSIZ
 #define	MAXSSIZ			(32*1024*1024)		/* maximum stack size */
 #endif
 
+#ifndef	MAXSSIZ32
+#define	MAXSSIZ32		(32*1024*1024)		/* maximum stack size */
+#endif
+
 #ifndef	DFLDSIZ
 #define	DFLDSIZ			(256*1024*1024)		/* default data size */
 #endif
 
+#ifndef	DFLDSIZ32
+#define	DFLSSIZ32		(256*1024*1024)
+#endif
+
 #ifndef	DFLSSIZ
 #define	DFLSSIZ			(2*1024*1024)		/* default stack size */
 #endif
 
+#ifndef	DFLSSIZ32
+#define	DFLSSIZ32		(2*1024*1024)		/* default stack size */
+#endif
+
 /*
  * Default number of pages in the user raw I/O map.
  */
@@ -128,6 +144,7 @@
 	(((vsid)  SR_VSID)  (SR_VSID_SHFT + VSID__HASHSHFT))
 #endif /*0*/
 
+#ifndef _LP64
 /*
  * Fixed segments
  */
@@ -141,6 +158,7 @@
 #define	KERNEL2_SR		14
 #endif
 #define	KERNEL2_SEGMENT		VSID_MAKE(KERNEL2_SR, KERNEL_VSIDBITS)
+#endif
 #define	KERNEL_VSIDBITS		0xf
 #define	PHYSMAP_VSIDBITS	0xe
 #define	PHYSMAPN_SEGMENT(s)	VSID_MAKE(s, PHYSMAP_VSIDBITS)
@@ -158,10 +176,20 @@
 #endif
 
 #define	VM_MIN_ADDRESS		((vaddr_t) 0)
-#define	VM_MAXUSER_ADDRESS	((vaddr_t) ~0xfffL)
+#define	VM_MAXUSER_ADDRESS32	((vaddr_t) (uint32_t) ~0xfffL)
+#ifdef _LP64
+#define	VM_MAXUSER_ADDRESS	((vaddr_t) 1UL  48) /* 256TB */
+#else
+#define	VM_MAXUSER_ADDRESS	VM_MAXUSER_ADDRESS32
+#endif
 #define	VM_MAX_ADDRESS		VM_MAXUSER_ADDRESS
+#ifdef _LP64
+#define	VM_MIN_KERNEL_ADDRESS	((vaddr_t) 0xffUL  40) /* top 1TB */
+#define	VM_MAX_KERNEL_ADDRESS	((vaddr_t) -32768)
+#else
 #define	VM_MIN_KERNEL_ADDRESS	((vaddr_t) (KERNEL_SR  ADDR_SR_SHFT))
 #define	VM_MAX_KERNEL_ADDRESS	(VM_MIN_KERNEL_ADDRESS + 2*SEGMENT_LENGTH)
+#endif
 
 #define	VM_PHYSSEG_STRAT	VM_PSTRAT_BIGFIRST
 



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

2013-11-07 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Fri Nov  8 03:59:35 UTC 2013

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

Log Message:
resort the sys/cpu.h way for unused cii iterator in !MULTIPROCESSOR case.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/powerpc/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/powerpc/include/cpu.h
diff -u src/sys/arch/powerpc/include/cpu.h:1.97 src/sys/arch/powerpc/include/cpu.h:1.98
--- src/sys/arch/powerpc/include/cpu.h:1.97	Wed Jul 17 23:27:02 2013
+++ src/sys/arch/powerpc/include/cpu.h	Fri Nov  8 03:59:35 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.97 2013/07/17 23:27:02 matt Exp $	*/
+/*	$NetBSD: cpu.h,v 1.98 2013/11/08 03:59:35 nisimura Exp $	*/
 
 /*
  * Copyright (C) 1999 Wolfgang Solfrank.
@@ -199,7 +199,7 @@ extern struct cpuset_info cpuset_info;
 #define CPU_IS_PRIMARY(ci)	true
 #define CPU_INFO_ITERATOR	int
 #define CPU_INFO_FOREACH(cii, ci)\
-	cii = 0, ci = curcpu(); ci != NULL; ci = NULL
+	(void)cii, ci = curcpu(); ci != NULL; ci = NULL
 
 #endif /* MULTIPROCESSOR || _MODULE */
 



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

2013-09-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Sep 22 17:51:31 UTC 2013

Modified Files:
src/sys/arch/powerpc/include/oea: hid.h

Log Message:
Define HID1_{SYNCBE,ABE} for the 7450


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/powerpc/include/oea/hid.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/powerpc/include/oea/hid.h
diff -u src/sys/arch/powerpc/include/oea/hid.h:1.9 src/sys/arch/powerpc/include/oea/hid.h:1.10
--- src/sys/arch/powerpc/include/oea/hid.h:1.9	Sun May 25 10:52:08 2008
+++ src/sys/arch/powerpc/include/oea/hid.h	Sun Sep 22 17:51:31 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: hid.h,v 1.9 2008/05/25 10:52:08 phx Exp $	*/
+/*	$NetBSD: hid.h,v 1.10 2013/09/22 17:51:31 matt Exp $	*/
 
 /*-
  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
@@ -139,5 +139,7 @@
 #define	HID1_PAR	0x0100	/* Disable Precharge for ... */
 #define	HID1_DFS4	0x0080	/* Dynamic Freq Switch / 4 (7448) */
 #define	HID1_DFS2	0x0040	/* Dynamic Freq Switch / 2 (7447A) */
+#define	HID1_SYNCBE	0x0800	/* Enable sync/eieio broadcast */
+#define	HID1_ABE	0x0400	/* Enable address broadcast */
 
 #endif /* _POWERPC_OEA_HID_H_ */



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

2013-08-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Aug 24 15:42:29 UTC 2013

Modified Files:
src/sys/arch/powerpc/include: softint.h

Log Message:
struct cpu_info;


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/powerpc/include/softint.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/powerpc/include/softint.h
diff -u src/sys/arch/powerpc/include/softint.h:1.2 src/sys/arch/powerpc/include/softint.h:1.3
--- src/sys/arch/powerpc/include/softint.h:1.2	Fri Aug 23 06:18:14 2013
+++ src/sys/arch/powerpc/include/softint.h	Sat Aug 24 15:42:29 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: softint.h,v 1.2 2013/08/23 06:18:14 matt Exp $	*/
+/*	$NetBSD: softint.h,v 1.3 2013/08/24 15:42:29 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -37,8 +37,6 @@
 #ifndef _POWERPC_SOFTINT_H_
 #define _POWERPC_SOFTINT_H_
 
-//#include sys/intr.h
-
 #ifdef __HAVE_FAST_SOFTINTS
 
 #ifdef __INTR_PRIVATE
@@ -69,6 +67,7 @@
 #endif /* __INTR_PRIVATE */
 
 #ifdef _KERNEL
+struct cpu_info;
 void	powerpc_softint(struct cpu_info *, int, vaddr_t);
 void	powerpc_softint_init_md(lwp_t *, u_int, uintptr_t *);
 void	powerpc_softint_trigger(uintptr_t);



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

2013-08-23 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Aug 23 06:18:14 UTC 2013

Modified Files:
src/sys/arch/powerpc/include: intr.h softint.h

Log Message:
Fix kern_softint.c errors (tested with WALNUT  EV64260)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/powerpc/include/intr.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/powerpc/include/softint.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/powerpc/include/intr.h
diff -u src/sys/arch/powerpc/include/intr.h:1.10 src/sys/arch/powerpc/include/intr.h:1.11
--- src/sys/arch/powerpc/include/intr.h:1.10	Sat Jan 14 19:35:58 2012
+++ src/sys/arch/powerpc/include/intr.h	Fri Aug 23 06:18:14 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.10 2012/01/14 19:35:58 phx Exp $ */
+/*	$NetBSD: intr.h,v 1.11 2013/08/23 06:18:14 matt Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -28,11 +28,11 @@
 
 #ifndef _LOCORE
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: intr.h,v 1.10 2012/01/14 19:35:58 phx Exp $);
+__KERNEL_RCSID(0, $NetBSD: intr.h,v 1.11 2013/08/23 06:18:14 matt Exp $);
 #endif
 
-#ifndef POWERPC_INTR_MACHDEP_H
-#define POWERPC_INTR_MACHDEP_H
+#ifndef _POWERPC_INTR_MACHDEP_H_
+#define _POWERPC_INTR_MACHDEP_H_
 
 #define	__HAVE_FAST_SOFTINTS	1
 
@@ -71,6 +71,8 @@ void	splx(int);
 
 #if !defined(_MODULE)
 
+#include powerpc/softint.h
+
 void	genppc_cpu_configure(void);
 
 /*
@@ -136,4 +138,4 @@ splraiseipl(ipl_cookie_t icookie)
 
 #endif /* _LOCORE */
 
-#endif /* POWERPC_INTR_MACHDEP_H */
+#endif /* _POWERPC_INTR_MACHDEP_H_ */

Index: src/sys/arch/powerpc/include/softint.h
diff -u src/sys/arch/powerpc/include/softint.h:1.1 src/sys/arch/powerpc/include/softint.h:1.2
--- src/sys/arch/powerpc/include/softint.h:1.1	Tue Jun 14 22:36:12 2011
+++ src/sys/arch/powerpc/include/softint.h	Fri Aug 23 06:18:14 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: softint.h,v 1.1 2011/06/14 22:36:12 matt Exp $	*/
+/*	$NetBSD: softint.h,v 1.2 2013/08/23 06:18:14 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -34,14 +34,14 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifdef __INTR_PRIVATE
 #ifndef _POWERPC_SOFTINT_H_
 #define _POWERPC_SOFTINT_H_
 
-#include sys/intr.h
+//#include sys/intr.h
 
 #ifdef __HAVE_FAST_SOFTINTS
 
+#ifdef __INTR_PRIVATE
 #ifdef __HAVE_PREEMPTION
 #define	IPL_PREEMPT_SOFTMASK	(1  IPL_NONE)
 #else
@@ -66,6 +66,8 @@
 	|(SOFTINT_CLOCK   (4*IPL_SOFTCLOCK )))
 #define	IPL2SOFTINT(ipl)	((IPL2SOFTINT_MAP  (4 * (ipl)))  0x0f)
 
+#endif /* __INTR_PRIVATE */
+
 #ifdef _KERNEL
 void	powerpc_softint(struct cpu_info *, int, vaddr_t);
 void	powerpc_softint_init_md(lwp_t *, u_int, uintptr_t *);
@@ -74,4 +76,3 @@ void	powerpc_softint_trigger(uintptr_t);
 
 #endif /* __HAVE_FAST_SOFTINTS */
 #endif /* !_POWERPC_SOFTINT_H_ */
-#endif /* __INTR_PRIVATE */



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

2013-07-04 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Jul  5 02:11:59 UTC 2013

Modified Files:
src/sys/arch/powerpc/include: rtas.h

Log Message:
Fix header guard.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/powerpc/include/rtas.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/powerpc/include/rtas.h
diff -u src/sys/arch/powerpc/include/rtas.h:1.4 src/sys/arch/powerpc/include/rtas.h:1.5
--- src/sys/arch/powerpc/include/rtas.h:1.4	Mon Apr 28 20:23:32 2008
+++ src/sys/arch/powerpc/include/rtas.h	Fri Jul  5 02:11:59 2013
@@ -28,7 +28,7 @@
  */
 
 #ifndef _POWERPC_RTAS_H_
-#define _POWERPC_RTAS_H
+#define _POWERPC_RTAS_H_
 
 #define RTAS_MAXARGS 16
 



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

2013-04-24 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Apr 25 00:08:48 UTC 2013

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

Log Message:
we can read the timebase register as a 64bit chunk when _ARCH_PPC64 is defined,
not necessarily LP64


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/powerpc/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/powerpc/include/cpu.h
diff -u src/sys/arch/powerpc/include/cpu.h:1.95 src/sys/arch/powerpc/include/cpu.h:1.96
--- src/sys/arch/powerpc/include/cpu.h:1.95	Tue Nov 27 19:24:45 2012
+++ src/sys/arch/powerpc/include/cpu.h	Thu Apr 25 00:08:48 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.95 2012/11/27 19:24:45 matt Exp $	*/
+/*	$NetBSD: cpu.h,v 1.96 2013/04/25 00:08:48 macallan Exp $	*/
 
 /*
  * Copyright (C) 1999 Wolfgang Solfrank.
@@ -265,7 +265,7 @@ mftb(void)
 {
 	uint64_t tb;
 
-#ifdef _LP64
+#ifdef _ARCH_PPC64
 	__asm volatile (mftb %0 : =r(tb));
 #else
 	int tmp;



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

2013-01-29 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Jan 29 15:45:43 UTC 2013

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

Log Message:
Support 16bits over stack size.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/powerpc/include/asm.h

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

Modified files:

Index: src/sys/arch/powerpc/include/asm.h
diff -u src/sys/arch/powerpc/include/asm.h:1.40 src/sys/arch/powerpc/include/asm.h:1.41
--- src/sys/arch/powerpc/include/asm.h:1.40	Sun Nov 25 01:10:37 2012
+++ src/sys/arch/powerpc/include/asm.h	Tue Jan 29 15:45:43 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.40 2012/11/25 01:10:37 christos Exp $	*/
+/*	$NetBSD: asm.h,v 1.41 2013/01/29 15:45:43 kiyohara Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -192,7 +192,8 @@ y:	.quad	.y,.TOC.@tocbase,0;	\
 
 # ifdef CI_INTSTK
 #  define INIT_CPUINFO_INTSTK(er,tmp1)	\
-	addi	er,er,INTSTK;		\
+	addis	er,er,INTSTK@ha;	\
+	addi	er,er,INTSTK@l;		\
 	stptr	er,CI_INTSTK(tmp1)
 # else
 #  define INIT_CPUINFO_INTSTK(er,tmp1)	/* nothing */
@@ -219,7 +220,8 @@ y:	.quad	.y,.TOC.@tocbase,0;	\
 	ori	%r13,%r13,_C_LABEL(lwp0)@l;\
 	stptr	er,L_PCB(%r13);		/* XXXuvm_lwp_getuarea */	\
 	stptr	tmp1,L_CPU(%r13);	 \
-	addi	er,er,USPACE;		/* stackpointer for lwp0 */	\
+	addis	er,er,USPACE@ha;	/* stackpointer for lwp0 */	\
+	addi	er,er,USPACE@l;		/* stackpointer for lwp0 */	\
 	addi	sp,er,-FRAMELEN-CALLFRAMELEN;	/* stackpointer for lwp0 */ \
 	stptr	sp,L_MD_UTF(%r13);	/* save in lwp0.l_md.md_utf */	\
 		/* er = end of mem reserved for kernel */		\



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

2013-01-29 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Jan 29 15:47:16 UTC 2013

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

Log Message:
More stack for ibm4xx slow machines.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/powerpc/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/powerpc/include/param.h
diff -u src/sys/arch/powerpc/include/param.h:1.28 src/sys/arch/powerpc/include/param.h:1.29
--- src/sys/arch/powerpc/include/param.h:1.28	Sun Sep 23 22:31:39 2012
+++ src/sys/arch/powerpc/include/param.h	Tue Jan 29 15:47:16 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.28 2012/09/23 22:31:39 mrg Exp $	*/
+/*	$NetBSD: param.h,v 1.29 2013/01/29 15:47:16 kiyohara Exp $	*/
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -58,7 +58,7 @@
 
 #ifdef PPC_IBM4XX
 #define	PGSHIFT		14	/* Use 16KB to reduce TLB thrashing */
-#define	UPAGES		1
+#define	UPAGES		2
 #else
 #define	PGSHIFT		12
 #define	UPAGES		4



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

2012-11-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov 25 01:10:37 UTC 2012

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

Log Message:
provide _ENTRY(x) because some code needs it.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/powerpc/include/asm.h

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

Modified files:

Index: src/sys/arch/powerpc/include/asm.h
diff -u src/sys/arch/powerpc/include/asm.h:1.39 src/sys/arch/powerpc/include/asm.h:1.40
--- src/sys/arch/powerpc/include/asm.h:1.39	Tue Oct 25 21:46:11 2011
+++ src/sys/arch/powerpc/include/asm.h	Sat Nov 24 20:10:37 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.39 2011/10/26 01:46:11 christos Exp $	*/
+/*	$NetBSD: asm.h,v 1.40 2012/11/25 01:10:37 christos Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -106,7 +106,7 @@
 # define SF_LR		16
 # define SF_PARAM	SF_HEADER_SZ
 
-# define ENTRY(y)			\
+# define _ENTRY(y)			\
 	.globl	y;			\
 	.section .opd,aw;		\
 	.align	3;			\
@@ -118,6 +118,8 @@ y:	.quad	.y,.TOC.@tocbase,0;	\
 	.align	3;			\
 .y:
 
+# define ENTRY(y) _ENTRY(y)
+
 # define END(y)
 
 # define CALL(y)			\



  1   2   >