CVS commit: src/sys/arch/arm/include/arm32

2021-05-30 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun May 30 07:20:00 UTC 2021

Modified Files:
src/sys/arch/arm/include/arm32: param.h

Log Message:
Include opt_param.h for MSGBUFSIZE ifdef _KERNEL_OPT.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/arm/include/arm32/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/arm/include/arm32/param.h
diff -u src/sys/arch/arm/include/arm32/param.h:1.33 src/sys/arch/arm/include/arm32/param.h:1.34
--- src/sys/arch/arm/include/arm32/param.h:1.33	Fri Jul 10 12:25:09 2020
+++ src/sys/arch/arm/include/arm32/param.h	Sun May 30 07:20:00 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.33 2020/07/10 12:25:09 skrll Exp $	*/
+/*	$NetBSD: param.h,v 1.34 2021/05/30 07:20:00 rin Exp $	*/
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe.
@@ -38,6 +38,7 @@
 #ifdef _KERNEL_OPT
 #include "opt_arm32_pmap.h"
 #include "opt_kasan.h"
+#include "opt_param.h"
 #endif
 
 /*



CVS commit: src/sys/arch/arm/include/arm32

2021-05-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue May  4 09:02:21 UTC 2021

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Provide pte_{value,valid_p}


To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.170 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.169 src/sys/arch/arm/include/arm32/pmap.h:1.170
--- src/sys/arch/arm/include/arm32/pmap.h:1.169	Fri Oct 30 18:54:36 2020
+++ src/sys/arch/arm/include/arm32/pmap.h	Tue May  4 09:02:21 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.169 2020/10/30 18:54:36 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.170 2021/05/04 09:02:21 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -627,6 +627,20 @@ l2pte_reset(pt_entry_t *ptep)
 #define	pmap_pte_v(pte)		l2pte_valid_p(*(pte))
 #define	pmap_pte_pa(pte)	l2pte_pa(*(pte))
 
+static inline uint32_t
+pte_value(pt_entry_t pte)
+{
+	return pte;
+}
+
+static inline bool
+pte_valid_p(pt_entry_t pte)
+{
+
+	return l2pte_valid_p(pte);
+}
+
+
 /* Size of the kernel part of the L1 page table */
 #define	KERNEL_PD_SIZE	\
 	(L1_TABLE_SIZE - (KERNEL_BASE >> L1_S_SHIFT) * sizeof(pd_entry_t))



CVS commit: src/sys/arch/arm/include/arm32

2020-10-08 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Thu Oct  8 12:49:06 UTC 2020

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
Bump MAXDSIZ from 1536 to 1836.
1836 is 2048-128(MAXTSIZ)-64(MAXSSIZ).
Gives us a fighting chance to build rust natively.
OK'ed by skrll@


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.55 src/sys/arch/arm/include/arm32/vmparam.h:1.56
--- src/sys/arch/arm/include/arm32/vmparam.h:1.55	Sat Aug 29 06:49:53 2020
+++ src/sys/arch/arm/include/arm32/vmparam.h	Thu Oct  8 12:49:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.55 2020/08/29 06:49:53 skrll Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.56 2020/10/08 12:49:06 he Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -70,7 +70,7 @@
 #define	DFLDSIZ		(384*1024*1024)		/* initial data size limit */
 #endif
 #ifndef	MAXDSIZ
-#define	MAXDSIZ		(1536*1024*1024)	/* max data size */
+#define	MAXDSIZ		(1856*1024*1024)	/* max data size */
 #endif
 #ifndef	DFLSSIZ
 #define	DFLSSIZ		(4*1024*1024)		/* initial stack size limit */



CVS commit: src/sys/arch/arm/include/arm32

2020-08-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Aug 29 06:49:53 UTC 2020

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
Cover the full kernel address range in KASAN


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.54 src/sys/arch/arm/include/arm32/vmparam.h:1.55
--- src/sys/arch/arm/include/arm32/vmparam.h:1.54	Sat Jul 11 06:46:19 2020
+++ src/sys/arch/arm/include/arm32/vmparam.h	Sat Aug 29 06:49:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.54 2020/07/11 06:46:19 skrll Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.55 2020/08/29 06:49:53 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -127,7 +127,7 @@
 
 #ifdef KASAN
 #define VM_KERNEL_KASAN_BASE	0xc000
-#define VM_KERNEL_KASAN_SIZE	(VM_KERNEL_VM_SIZE >> KASAN_SHADOW_SCALE_SHIFT)
+#define VM_KERNEL_KASAN_SIZE	(VM_KERNEL_ADDR_SIZE >> KASAN_SHADOW_SCALE_SHIFT)
 #define VM_KERNEL_KASAN_END	(VM_KERNEL_KASAN_BASE + VM_KERNEL_KASAN_SIZE)
 #define VM_KERNEL_VM_END	VM_KERNEL_KASAN_BASE
 #else
@@ -143,6 +143,7 @@
 #define VM_KERNEL_VM_BASE	0x9000
 #endif
 
+#define VM_KERNEL_ADDR_SIZE	(VM_KERNEL_VM_END - KERNEL_BASE)
 #define VM_KERNEL_VM_SIZE	(VM_KERNEL_VM_END - VM_KERNEL_VM_BASE)
 
 #define VM_KERNEL_IO_ADDRESS	0xf000



CVS commit: src/sys/arch/arm/include/arm32

2020-07-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul 11 06:46:19 UTC 2020

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
Fix ARM builds


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.53 src/sys/arch/arm/include/arm32/vmparam.h:1.54
--- src/sys/arch/arm/include/arm32/vmparam.h:1.53	Fri Jul 10 15:12:33 2020
+++ src/sys/arch/arm/include/arm32/vmparam.h	Sat Jul 11 06:46:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.53 2020/07/10 15:12:33 skrll Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.54 2020/07/11 06:46:19 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -38,7 +38,9 @@
 #ifndef _ARM_ARM32_VMPARAM_H_
 #define	_ARM_ARM32_VMPARAM_H_
 
+#if defined(_KERNEL_OPT)
 #include "opt_kasan.h"
+#endif
 
 /*
  * Virtual Memory parameters common to all arm32 platforms.
@@ -96,6 +98,7 @@
 #define	VM_MIN_KERNEL_ADDRESS	((vaddr_t) KERNEL_BASE)
 #define	VM_MAX_KERNEL_ADDRESS	((vaddr_t) -(PAGE_SIZE+1))
 
+#if defined(_KERNEL)
 // AddressSanitizer dedicates 1/8 of kernel memory to its shadow memory (e.g.
 // 128MB to cover 1GB for ARM) and uses a special KVA range for the shadow
 // address corresponding to a kernel memory address.
@@ -144,5 +147,6 @@
 
 #define VM_KERNEL_IO_ADDRESS	0xf000
 #define VM_KERNEL_IO_SIZE	(VM_MAX_KERNEL_ADDRESS - VM_KERNEL_IO_ADDRESS)
+#endif
 
 #endif /* _ARM_ARM32_VMPARAM_H_ */



CVS commit: src/sys/arch/arm/include/arm32

2020-07-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jul 10 15:12:33 UTC 2020

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
Remove stray #else / #endif block in KASAN support commit


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.52 src/sys/arch/arm/include/arm32/vmparam.h:1.53
--- src/sys/arch/arm/include/arm32/vmparam.h:1.52	Fri Jul 10 12:45:15 2020
+++ src/sys/arch/arm/include/arm32/vmparam.h	Fri Jul 10 15:12:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.52 2020/07/10 12:45:15 skrll Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.53 2020/07/10 15:12:33 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -139,10 +139,6 @@
 #else
 #define VM_KERNEL_VM_BASE	0x9000
 #endif
-#else
-#ifdef KASAN
-#error KASAN is unsupported on pre-ARMv6
-#endif
 
 #define VM_KERNEL_VM_SIZE	(VM_KERNEL_VM_END - VM_KERNEL_VM_BASE)
 



CVS commit: src/sys/arch/arm/include/arm32

2020-07-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jul  8 07:59:49 UTC 2020

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
Remove an unnecessary #ifdef


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.47 src/sys/arch/arm/include/arm32/vmparam.h:1.48
--- src/sys/arch/arm/include/arm32/vmparam.h:1.47	Mon Jan 13 20:36:44 2020
+++ src/sys/arch/arm/include/arm32/vmparam.h	Wed Jul  8 07:59:49 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.47 2020/01/13 20:36:44 christos Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.48 2020/07/08 07:59:49 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -88,11 +88,7 @@
  * Mach derived constants
  */
 #define	VM_MIN_ADDRESS		((vaddr_t) PAGE_SIZE)
-#ifdef ARM_MMU_EXTENDED
-#define	VM_MAXUSER_ADDRESS	((vaddr_t) 0x8000 - PAGE_SIZE)
-#else
 #define	VM_MAXUSER_ADDRESS	((vaddr_t) KERNEL_BASE - PAGE_SIZE)
-#endif
 #define	VM_MAX_ADDRESS		VM_MAXUSER_ADDRESS
 
 #define	VM_MIN_KERNEL_ADDRESS	((vaddr_t) KERNEL_BASE)



CVS commit: src/sys/arch/arm/include/arm32

2020-07-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jul  8 06:58:33 UTC 2020

Modified Files:
src/sys/arch/arm/include/arm32: param.h

Log Message:
Define USPACE in terms of UPAGES (not the other way around) now that
NBPG is fixed at 4K


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/include/arm32/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/arm/include/arm32/param.h
diff -u src/sys/arch/arm/include/arm32/param.h:1.31 src/sys/arch/arm/include/arm32/param.h:1.32
--- src/sys/arch/arm/include/arm32/param.h:1.31	Wed Jul  8 06:54:57 2020
+++ src/sys/arch/arm/include/arm32/param.h	Wed Jul  8 06:58:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.31 2020/07/08 06:54:57 skrll Exp $	*/
+/*	$NetBSD: param.h,v 1.32 2020/07/08 06:58:33 skrll Exp $	*/
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe.
@@ -54,8 +54,8 @@
 
 #define SSIZE		1		/* initial stack size/NBPG */
 #define SINCR		1		/* increment of stack/NBPG */
-#define USPACE		8192		/* total size of u-area */
-#define UPAGES		(USPACE / NBPG)	/* pages of u-area */
+#define UPAGES		2
+#define USPACE		(UPAGES * NBPG)	/* total size of u-area */
 
 #ifndef MSGBUFSIZE
 #define MSGBUFSIZE	16384	 	/* default message buffer size */



CVS commit: src/sys/arch/arm/include/arm32

2020-07-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jul  8 06:54:57 UTC 2020

Modified Files:
src/sys/arch/arm/include/arm32: param.h

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/arm/include/arm32/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/arm/include/arm32/param.h
diff -u src/sys/arch/arm/include/arm32/param.h:1.30 src/sys/arch/arm/include/arm32/param.h:1.31
--- src/sys/arch/arm/include/arm32/param.h:1.30	Thu Feb 13 07:40:24 2020
+++ src/sys/arch/arm/include/arm32/param.h	Wed Jul  8 06:54:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.30 2020/02/13 07:40:24 skrll Exp $	*/
+/*	$NetBSD: param.h,v 1.31 2020/07/08 06:54:57 skrll Exp $	*/
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe.
@@ -36,7 +36,7 @@
 #define	_ARM_ARM32_PARAM_H_
 
 #ifdef _KERNEL_OPT
-# include "opt_arm32_pmap.h"
+#include "opt_arm32_pmap.h"
 #endif
 
 /*



CVS commit: src/sys/arch/arm/include/arm32

2020-07-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul  4 07:02:35 UTC 2020

Modified Files:
src/sys/arch/arm/include/arm32: machdep.h

Log Message:
Protect with #ifdef _KERNEL


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/arm/include/arm32/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/arm/include/arm32/machdep.h
diff -u src/sys/arch/arm/include/arm32/machdep.h:1.33 src/sys/arch/arm/include/arm32/machdep.h:1.34
--- src/sys/arch/arm/include/arm32/machdep.h:1.33	Thu Mar  5 15:18:54 2020
+++ src/sys/arch/arm/include/arm32/machdep.h	Sat Jul  4 07:02:35 2020
@@ -1,8 +1,10 @@
-/* $NetBSD: machdep.h,v 1.33 2020/03/05 15:18:54 riastradh Exp $ */
+/* $NetBSD: machdep.h,v 1.34 2020/07/04 07:02:35 skrll Exp $ */
 
 #ifndef _ARM32_MACHDEP_H_
 #define _ARM32_MACHDEP_H_
 
+#ifdef _KERNEL
+
 /* Define various stack sizes in pages */
 #ifndef IRQ_STACK_SIZE
 #define IRQ_STACK_SIZE	1
@@ -103,4 +105,7 @@ void set_spl_masks(void);
 #ifdef DIAGNOSTIC
 void dump_spl_masks(void);
 #endif
-#endif
+
+#endif	/* _KERNEL */
+
+#endif	/* _ARM32_MACHDEP_H_ */



CVS commit: src/sys/arch/arm/include/arm32

2020-07-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jul  3 06:49:26 UTC 2020

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Consistency...#define


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.167 src/sys/arch/arm/include/arm32/pmap.h:1.168
--- src/sys/arch/arm/include/arm32/pmap.h:1.167	Sat Apr 18 11:00:38 2020
+++ src/sys/arch/arm/include/arm32/pmap.h	Fri Jul  3 06:49:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.167 2020/04/18 11:00:38 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.168 2020/07/03 06:49:26 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -84,20 +84,20 @@
 #endif
 
 #ifdef ARM_MMU_EXTENDED
-#define PMAP_HWPAGEWALKER		1
-#define PMAP_TLB_MAX			1
+#define	PMAP_HWPAGEWALKER		1
+#define	PMAP_TLB_MAX			1
 #if PMAP_TLB_MAX > 1
-#define PMAP_TLB_NEED_SHOOTDOWN		1
+#define	PMAP_TLB_NEED_SHOOTDOWN		1
 #endif
-#define PMAP_TLB_FLUSH_ASID_ON_RESET	(arm_has_tlbiasid_p)
-#define PMAP_TLB_NUM_PIDS		256
-#define cpu_set_tlb_info(ci, ti)((void)((ci)->ci_tlb_info = (ti)))
+#define	PMAP_TLB_FLUSH_ASID_ON_RESET	(arm_has_tlbiasid_p)
+#define	PMAP_TLB_NUM_PIDS		256
+#define	cpu_set_tlb_info(ci, ti)((void)((ci)->ci_tlb_info = (ti)))
 #if PMAP_TLB_MAX > 1
-#define cpu_tlb_info(ci)		((ci)->ci_tlb_info)
+#define	cpu_tlb_info(ci)		((ci)->ci_tlb_info)
 #else
-#define cpu_tlb_info(ci)		(&pmap_tlb0_info)
+#define	cpu_tlb_info(ci)		(&pmap_tlb0_info)
 #endif
-#define pmap_md_tlb_asid_max()		(PMAP_TLB_NUM_PIDS - 1)
+#define	pmap_md_tlb_asid_max()		(PMAP_TLB_NUM_PIDS - 1)
 #include 
 #include 
 
@@ -143,7 +143,7 @@
  * three of these to map their whole working set.
  */
 #define	L2_BUCKET_XLOG2	(L1_S_SHIFT)
-#define L2_BUCKET_XSIZE	(1 << L2_BUCKET_XLOG2)
+#define	L2_BUCKET_XSIZE	(1 << L2_BUCKET_XLOG2)
 #define	L2_BUCKET_LOG2	4
 #define	L2_BUCKET_SIZE	(1 << L2_BUCKET_LOG2)
 
@@ -160,9 +160,9 @@
  * ARMv6 is physically-tagged but all others are virtually-tagged.
  */
 #if (ARM_MMU_V6 + ARM_MMU_V7) > 0
-#define PMAP_CACHE_VIPT
+#define	PMAP_CACHE_VIPT
 #else
-#define PMAP_CACHE_VIVT
+#define	PMAP_CACHE_VIVT
 #endif
 
 #ifndef _LOCORE
@@ -356,13 +356,13 @@ extern int		arm_poolpage_vmfreelist;
 
 #define	pmap_copy(dp, sp, da, l, sa)	/* nothing */
 
-#define pmap_phys_address(ppn)		(arm_ptob((ppn)))
+#define	pmap_phys_address(ppn)		(arm_ptob((ppn)))
 u_int arm32_mmap_flags(paddr_t);
-#define ARM32_MMAP_WRITECOMBINE		0x4000
-#define ARM32_MMAP_CACHEABLE		0x2000
-#define ARM_MMAP_WRITECOMBINE		ARM32_MMAP_WRITECOMBINE
-#define ARM_MMAP_CACHEABLE		ARM32_MMAP_CACHEABLE
-#define pmap_mmap_flags(ppn)		arm32_mmap_flags(ppn)
+#define	ARM32_MMAP_WRITECOMBINE		0x4000
+#define	ARM32_MMAP_CACHEABLE		0x2000
+#define	ARM_MMAP_WRITECOMBINE		ARM32_MMAP_WRITECOMBINE
+#define	ARM_MMAP_CACHEABLE		ARM32_MMAP_CACHEABLE
+#define	pmap_mmap_flags(ppn)		arm32_mmap_flags(ppn)
 
 #define	PMAP_PTE			0x1000 /* kenter_pa */
 #define	PMAP_DEV			0x2000 /* kenter_pa */
@@ -377,7 +377,7 @@ bool	pmap_remove_all(pmap_t);
 bool	pmap_extract(pmap_t, vaddr_t, paddr_t *);
 
 #define	PMAP_NEED_PROCWR
-#define PMAP_GROWKERNEL		/* turn on pmap_growkernel interface */
+#define	PMAP_GROWKERNEL		/* turn on pmap_growkernel interface */
 #define	PMAP_ENABLE_PMAP_KMPAGE	/* enable the PMAP_KMPAGE flag */
 
 #if (ARM_MMU_V6 + ARM_MMU_V7) > 0
@@ -426,7 +426,7 @@ void	pmap_devmap_register(const struct p
  * Special page zero routine for use by the idle loop (no cache cleans).
  */
 bool	pmap_pageidlezero(paddr_t);
-#define PMAP_PAGEIDLEZERO(pa)	pmap_pageidlezero((pa))
+#define	PMAP_PAGEIDLEZERO(pa)	pmap_pageidlezero((pa))
 
 #ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
 /*
@@ -546,14 +546,14 @@ pmap_ptesync(pt_entry_t *ptep, size_t cn
 #define	PTE_SYNC(ptep)			pmap_ptesync((ptep), PAGE_SIZE / L2_S_SIZE)
 #define	PTE_SYNC_RANGE(ptep, cnt)	pmap_ptesync((ptep), (cnt))
 
-#define l1pte_valid_p(pde)	((pde) != 0)
-#define l1pte_section_p(pde)	(((pde) & L1_TYPE_MASK) == L1_TYPE_S)
-#define l1pte_supersection_p(pde) (l1pte_section_p(pde)	\
+#define	l1pte_valid_p(pde)	((pde) != 0)
+#define	l1pte_section_p(pde)	(((pde) & L1_TYPE_MASK) == L1_TYPE_S)
+#define	l1pte_supersection_p(pde) (l1pte_section_p(pde)	\
 && ((pde) & L1_S_V6_SUPER) != 0)
-#define l1pte_page_p(pde)	(((pde) & L1_TYPE_MASK) == L1_TYPE_C)
-#define l1pte_fpage_p(pde)	(((pde) & L1_TYPE_MASK) == L1_TYPE_F)
-#define l1pte_pa(pde)		((pde) & L1_C_ADDR_MASK)
-#define l1pte_index(v)		((vaddr_t)(v) >> L1_S_SHIFT)
+#define	l1pte_page_p(pde)	(((pde) & L1_TYPE_MASK) == L1_TYPE_C)
+#define	l1pte_fpage_p(pde)	(((pde) & L1_TYPE_MASK) == L1_TYPE_F)
+#define	l1pte_pa(pde)		((pde) & L1_C_ADDR_MASK)
+#define	l1pte_index(v)		((vaddr_t)(v) >> L1_S_SHIFT)
 
 static inline voi

CVS commit: src/sys/arch/arm/include/arm32

2020-05-04 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon May  4 18:36:24 UTC 2020

Modified Files:
src/sys/arch/arm/include/arm32: pte.h

Log Message:
Prevent double definition of pt_entry_t from machine/param.h


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pte.h
diff -u src/sys/arch/arm/include/arm32/pte.h:1.22 src/sys/arch/arm/include/arm32/pte.h:1.23
--- src/sys/arch/arm/include/arm32/pte.h:1.22	Sun Feb  2 09:19:48 2020
+++ src/sys/arch/arm/include/arm32/pte.h	Mon May  4 18:36:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pte.h,v 1.22 2020/02/02 09:19:48 skrll Exp $	*/
+/*	$NetBSD: pte.h,v 1.23 2020/05/04 18:36:24 joerg Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -89,7 +89,11 @@
 
 #ifndef _LOCORE
 typedef uint32_t	pd_entry_t;	/* L1 table entry */
-typedef uint32_t	pt_entry_t;	/* L2 table entry */
+#ifndef	__BSD_PTENTRY_T__
+#define	__BSD_PTENTRY_T__
+typedef uint32_t pt_entry_t;
+#define PRIxPTE		PRIx32
+#endif
 #endif /* _LOCORE */
 
 #define	L1_SS_SIZE	0x0100	/* 16M */



CVS commit: src/sys/arch/arm/include/arm32

2020-03-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Mar 29 21:34:33 UTC 2020

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Don't define pt_entry_t if _LOCORE

Reported by Patrick Welche


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.165 src/sys/arch/arm/include/arm32/pmap.h:1.166
--- src/sys/arch/arm/include/arm32/pmap.h:1.165	Sun Mar 29 09:01:32 2020
+++ src/sys/arch/arm/include/arm32/pmap.h	Sun Mar 29 21:34:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.165 2020/03/29 09:01:32 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.166 2020/03/29 21:34:33 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -1184,14 +1184,14 @@ do {	\
 	(pg)->mdpage.k_mappings = 0;	\
 } while (/*CONSTCOND*/0)
 
-#endif /* !_LOCORE */
-
 #ifndef	__BSD_PTENTRY_T__
 #define	__BSD_PTENTRY_T__
 typedef uint32_t pt_entry_t;
 #define PRIxPTE		PRIx32
 #endif
 
+#endif /* !_LOCORE */
+
 #endif /* _KERNEL */
 
 #endif	/* _ARM32_PMAP_H_ */



CVS commit: src/sys/arch/arm/include/arm32

2020-03-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Mar 29 09:01:32 UTC 2020

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Provide a pt_entry_t and PRIxPTE


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.165 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.164 src/sys/arch/arm/include/arm32/pmap.h:1.165
--- src/sys/arch/arm/include/arm32/pmap.h:1.164	Sat Mar 14 14:05:42 2020
+++ src/sys/arch/arm/include/arm32/pmap.h	Sun Mar 29 09:01:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.164 2020/03/14 14:05:42 ad Exp $	*/
+/*	$NetBSD: pmap.h,v 1.165 2020/03/29 09:01:32 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -1186,6 +1186,12 @@ do {	\
 
 #endif /* !_LOCORE */
 
+#ifndef	__BSD_PTENTRY_T__
+#define	__BSD_PTENTRY_T__
+typedef uint32_t pt_entry_t;
+#define PRIxPTE		PRIx32
+#endif
+
 #endif /* _KERNEL */
 
 #endif	/* _ARM32_PMAP_H_ */



CVS commit: src/sys/arch/arm/include/arm32

2020-02-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Feb 23 15:12:19 UTC 2020

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
G/C l1pte_pgindex


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.161 src/sys/arch/arm/include/arm32/pmap.h:1.162
--- src/sys/arch/arm/include/arm32/pmap.h:1.161	Wed Feb  5 07:37:36 2020
+++ src/sys/arch/arm/include/arm32/pmap.h	Sun Feb 23 15:12:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.161 2020/02/05 07:37:36 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.162 2020/02/23 15:12:18 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -557,8 +557,6 @@ pmap_ptesync(pt_entry_t *ptep, size_t cn
 #define l1pte_fpage_p(pde)	(((pde) & L1_TYPE_MASK) == L1_TYPE_F)
 #define l1pte_pa(pde)		((pde) & L1_C_ADDR_MASK)
 #define l1pte_index(v)		((vaddr_t)(v) >> L1_S_SHIFT)
-#define l1pte_pgindex(v)	l1pte_index((v) & L1_ADDR_BITS \
-		& ~(PAGE_SIZE * PAGE_SIZE / sizeof(pt_entry_t) - 1))
 
 static inline void
 l1pte_setone(pt_entry_t *pdep, pt_entry_t pde)



CVS commit: src/sys/arch/arm/include/arm32

2020-02-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Feb 13 07:40:24 UTC 2020

Modified Files:
src/sys/arch/arm/include/arm32: param.h

Log Message:
Bump the amount of KMEM allowed to 1/3rd of KVM.  _ARCH_ARM_6 has a split
of 2:2 and others have a split of 3:1.

Tested by martin@  Thanks


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/include/arm32/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/arm/include/arm32/param.h
diff -u src/sys/arch/arm/include/arm32/param.h:1.29 src/sys/arch/arm/include/arm32/param.h:1.30
--- src/sys/arch/arm/include/arm32/param.h:1.29	Sat Feb  1 09:21:49 2020
+++ src/sys/arch/arm/include/arm32/param.h	Thu Feb 13 07:40:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.29 2020/02/01 09:21:49 skrll Exp $	*/
+/*	$NetBSD: param.h,v 1.30 2020/02/13 07:40:24 skrll Exp $	*/
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe.
@@ -66,7 +66,12 @@
  * logical pages.
  */
 #define	NKMEMPAGES_MIN_DEFAULT	((8 * 1024 * 1024) >> PAGE_SHIFT)
-#define	NKMEMPAGES_MAX_DEFAULT	((128 * 1024 * 1024) >> PAGE_SHIFT)
+
+#if defined(_ARM_ARCH_6)
+#define	NKMEMPAGES_MAX_DEFAULT	((768 * 1024 * 1024) >> PAGE_SHIFT)
+#else
+#define	NKMEMPAGES_MAX_DEFAULT	((256 * 1024 * 1024) >> PAGE_SHIFT)
+#endif
 
 /* Constants used to divide the USPACE area */
 



CVS commit: src/sys/arch/arm/include/arm32

2020-02-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Feb 11 13:31:23 UTC 2020

Modified Files:
src/sys/arch/arm/include/arm32: types.h

Log Message:
G/C


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/include/arm32/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/arm/include/arm32/types.h
diff -u src/sys/arch/arm/include/arm32/types.h:1.12 src/sys/arch/arm/include/arm32/types.h:1.13
--- src/sys/arch/arm/include/arm32/types.h:1.12	Wed Jan 24 09:04:45 2018
+++ src/sys/arch/arm/include/arm32/types.h	Tue Feb 11 13:31:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.12 2018/01/24 09:04:45 skrll Exp $	*/
+/*	$NetBSD: types.h,v 1.13 2020/02/11 13:31:23 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -38,13 +38,6 @@
 #ifndef _ARM_ARM32_TYPES_H_
 #define	_ARM_ARM32_TYPES_H_
 
-#ifdef _KERNEL
-
-#ifdef _KERNEL_OPT
-#include "opt_arm32_pmap.h"
-#endif
-#endif
-
 #include 		/* pull in generic ARM definitions */
 
 #define	__HAVE_CPU_LWP_SETPRIVATE



CVS commit: src/sys/arch/arm/include/arm32

2020-01-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 13 20:36:44 UTC 2020

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
Revert previous; we don't want arm to have variable page size. Instead
nick@ is fixing the cache pages issue to use a separate pool.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.46 src/sys/arch/arm/include/arm32/vmparam.h:1.47
--- src/sys/arch/arm/include/arm32/vmparam.h:1.46	Sat Jan 11 14:06:34 2020
+++ src/sys/arch/arm/include/arm32/vmparam.h	Mon Jan 13 15:36:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.46 2020/01/11 19:06:34 christos Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.47 2020/01/13 20:36:44 christos Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -84,11 +84,6 @@
 #define	PAGE_SIZE	(1 << PAGE_SHIFT)
 #define	PAGE_MASK	(PAGE_SIZE - 1)
 
-#define	MIN_PAGE_SHIFT	12			/* normal */
-#define	MAX_PAGE_SHIFT	13			/* _ARM_ARCH_6 */
-#define	MIN_PAGE_SIZE	(1 << MIN_PAGE_SHIFT)
-#define	MAX_PAGE_SIZE	(1 << MAX_PAGE_SHIFT)
-
 /*
  * Mach derived constants
  */



CVS commit: src/sys/arch/arm/include/arm32

2020-01-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 12 20:06:52 UTC 2020

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
fix -Wsign-compare because module tests trigger it.


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.157 src/sys/arch/arm/include/arm32/pmap.h:1.158
--- src/sys/arch/arm/include/arm32/pmap.h:1.157	Tue Dec 10 13:02:14 2019
+++ src/sys/arch/arm/include/arm32/pmap.h	Sun Jan 12 15:06:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.157 2019/12/10 18:02:14 ad Exp $	*/
+/*	$NetBSD: pmap.h,v 1.158 2020/01/12 20:06:52 christos Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -564,13 +564,13 @@ l1pte_set(pt_entry_t *pdep, pt_entry_t p
 	*pdep = pde;
 	if (l1pte_page_p(pde)) {
 		KASSERTMSGuintptr_t)pdep / sizeof(pde)) & (PAGE_SIZE / L2_T_SIZE - 1)) == 0, "%p", pdep);
-		for (size_t k = 1; k < PAGE_SIZE / L2_T_SIZE; k++) {
+		for (int k = 1; k < PAGE_SIZE / L2_T_SIZE; k++) {
 			pde += L2_T_SIZE;
 			pdep[k] = pde;
 		}
 	} else if (l1pte_supersection_p(pde)) {
 		KASSERTMSGuintptr_t)pdep / sizeof(pde)) & (L1_SS_SIZE / L1_S_SIZE - 1)) == 0, "%p", pdep);
-		for (size_t k = 1; k < L1_SS_SIZE / L1_S_SIZE; k++) {
+		for (int k = 1; k < L1_SS_SIZE / L1_S_SIZE; k++) {
 			pdep[k] = pde;
 		}
 	}
@@ -589,12 +589,12 @@ l2pte_set(pt_entry_t *ptep, pt_entry_t p
 {
 	if (l1pte_lpage_p(pte)) {
 		KASSERTMSGuintptr_t)ptep / sizeof(pte)) & (L2_L_SIZE / L2_S_SIZE - 1)) == 0, "%p", ptep);
-		for (size_t k = 0; k < L2_L_SIZE / L2_S_SIZE; k++) {
+		for (int k = 0; k < L2_L_SIZE / L2_S_SIZE; k++) {
 			*ptep++ = pte;
 		}
 	} else {
 		KASSERTMSGuintptr_t)ptep / sizeof(pte)) & (PAGE_SIZE / L2_S_SIZE - 1)) == 0, "%p", ptep);
-		for (size_t k = 0; k < PAGE_SIZE / L2_S_SIZE; k++) {
+		for (int k = 0; k < PAGE_SIZE / L2_S_SIZE; k++) {
 			KASSERTMSG(*ptep == opte, "%#x [*%p] != %#x", *ptep, ptep, opte);
 			*ptep++ = pte;
 			pte += L2_S_SIZE;
@@ -609,7 +609,7 @@ l2pte_reset(pt_entry_t *ptep)
 {
 	KASSERTMSGuintptr_t)ptep / sizeof(*ptep)) & (PAGE_SIZE / L2_S_SIZE - 1)) == 0, "%p", ptep);
 	*ptep = 0;
-	for (vsize_t k = 1; k < PAGE_SIZE / L2_S_SIZE; k++) {
+	for (int k = 1; k < PAGE_SIZE / L2_S_SIZE; k++) {
 		ptep[k] = 0;
 	}
 }



CVS commit: src/sys/arch/arm/include/arm32

2020-01-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 11 19:06:35 UTC 2020

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
Define the min and max page size supported for the benefit of jemalloc


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.45 src/sys/arch/arm/include/arm32/vmparam.h:1.46
--- src/sys/arch/arm/include/arm32/vmparam.h:1.45	Wed Jun 19 05:54:42 2019
+++ src/sys/arch/arm/include/arm32/vmparam.h	Sat Jan 11 14:06:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.45 2019/06/19 09:54:42 skrll Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.46 2020/01/11 19:06:34 christos Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -84,6 +84,11 @@
 #define	PAGE_SIZE	(1 << PAGE_SHIFT)
 #define	PAGE_MASK	(PAGE_SIZE - 1)
 
+#define	MIN_PAGE_SHIFT	12			/* normal */
+#define	MAX_PAGE_SHIFT	13			/* _ARM_ARCH_6 */
+#define	MIN_PAGE_SIZE	(1 << MIN_PAGE_SHIFT)
+#define	MAX_PAGE_SIZE	(1 << MAX_PAGE_SHIFT)
+
 /*
  * Mach derived constants
  */



CVS commit: src/sys/arch/arm/include/arm32

2019-12-10 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Dec 10 18:02:14 UTC 2019

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
pg->phys_addr -> VM_PAGE_TO_PHYS(pg)


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.157 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.156 src/sys/arch/arm/include/arm32/pmap.h:1.157
--- src/sys/arch/arm/include/arm32/pmap.h:1.156	Thu Oct 18 09:01:52 2018
+++ src/sys/arch/arm/include/arm32/pmap.h	Tue Dec 10 18:02:14 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.156 2018/10/18 09:01:52 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.157 2019/12/10 18:02:14 ad Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -1158,7 +1158,7 @@ struct vm_page_md {
  */
 #if ARM_MMU_V6 > 0
 #define	VM_MDPAGE_PVH_ATTRS_INIT(pg) \
-	(pg)->mdpage.pvh_attrs = (pg)->phys_addr & arm_cache_prefer_mask
+	(pg)->mdpage.pvh_attrs = VM_PAGE_TO_PHYS(pg) & arm_cache_prefer_mask
 #else
 #define	VM_MDPAGE_PVH_ATTRS_INIT(pg) \
 	(pg)->mdpage.pvh_attrs = 0



CVS commit: src/sys/arch/arm/include/arm32

2019-03-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Mar 30 21:06:42 UTC 2019

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
Need to include  so that the _ARM_CPU* macros get defined
so that we always select the correct page size (8K for armv6+).


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.43 src/sys/arch/arm/include/arm32/vmparam.h:1.44
--- src/sys/arch/arm/include/arm32/vmparam.h:1.43	Wed Mar 27 13:15:29 2019
+++ src/sys/arch/arm/include/arm32/vmparam.h	Sat Mar 30 17:06:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.43 2019/03/27 17:15:29 christos Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.44 2019/03/30 21:06:42 christos Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -43,6 +43,7 @@
  * Virtual Memory parameters common to all arm32 platforms.
  */
 
+#include 
 #include 
 #include 
 



CVS commit: src/sys/arch/arm/include/arm32

2019-02-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Feb  4 13:06:39 UTC 2019

Modified Files:
src/sys/arch/arm/include/arm32: param.h

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/include/arm32/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/arm/include/arm32/param.h
diff -u src/sys/arch/arm/include/arm32/param.h:1.25 src/sys/arch/arm/include/arm32/param.h:1.26
--- src/sys/arch/arm/include/arm32/param.h:1.25	Fri Jun  9 01:16:54 2017
+++ src/sys/arch/arm/include/arm32/param.h	Mon Feb  4 13:06:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.25 2017/06/09 01:16:54 chs Exp $	*/
+/*	$NetBSD: param.h,v 1.26 2019/02/04 13:06:39 skrll Exp $	*/
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe.
@@ -98,7 +98,7 @@
 #define arm_btop(x)			((unsigned)(x) >> PGSHIFT)
 #define arm_ptob(x)			((unsigned)(x) << PGSHIFT)
 #define arm_trunc_page(x)		((unsigned)(x) & ~PGOFSET)
-
+
 #ifdef _KERNEL
 #ifndef _LOCORE
 #ifndef __HIDE_DELAY



CVS commit: src/sys/arch/arm/include/arm32

2018-10-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 28 14:46:59 UTC 2018

Modified Files:
src/sys/arch/arm/include/arm32: frame.h

Log Message:
Consistency - NFC


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/arm/include/arm32/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/arm/include/arm32/frame.h
diff -u src/sys/arch/arm/include/arm32/frame.h:1.46 src/sys/arch/arm/include/arm32/frame.h:1.47
--- src/sys/arch/arm/include/arm32/frame.h:1.46	Sun Oct 28 14:45:02 2018
+++ src/sys/arch/arm/include/arm32/frame.h	Sun Oct 28 14:46:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.46 2018/10/28 14:45:02 skrll Exp $	*/
+/*	$NetBSD: frame.h,v 1.47 2018/10/28 14:46:59 skrll Exp $	*/
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -402,7 +402,7 @@ LOCK_CAS_DEBUG_LOCALS
 	ldmia   sp, {r0-r14}^;		/* Restore registers (usr mode) */ \
 	mov r0, r0; /* NOP for previous instruction */ \
 	add	sp, sp, #(TF_PC-TF_R0);	/* Adjust the stack pointer */	   \
- 	ldr	lr, [sp], #0x0004	/* Pop the return address */
+ 	ldr	lr, [sp], #4		/* Pop the return address */
 
 #define PULLIDLEFRAME			   \
 	add	sp, sp, #TF_R4;		/* Adjust the stack pointer */	   \



CVS commit: src/sys/arch/arm/include/arm32

2018-10-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 28 14:45:02 UTC 2018

Modified Files:
src/sys/arch/arm/include/arm32: frame.h

Log Message:
Remove magic number


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/arm/include/arm32/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/arm/include/arm32/frame.h
diff -u src/sys/arch/arm/include/arm32/frame.h:1.45 src/sys/arch/arm/include/arm32/frame.h:1.46
--- src/sys/arch/arm/include/arm32/frame.h:1.45	Fri Jul  7 16:59:35 2017
+++ src/sys/arch/arm/include/arm32/frame.h	Sun Oct 28 14:45:02 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.45 2017/07/07 16:59:35 skrll Exp $	*/
+/*	$NetBSD: frame.h,v 1.46 2018/10/28 14:45:02 skrll Exp $	*/
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -484,7 +484,7 @@ LOCK_CAS_DEBUG_LOCALS
  */
 
 #define PULLFRAMEFROMSVCANDEXIT		   \
-	ldr r0, [sp], #0x0008;	/* Pop the SPSR from stack */	   \
+	ldr r0, [sp], #TF_R0;	/* Pop the SPSR from stack */	   \
 	msr spsr_fsxc, r0;		/* restore SPSR */		   \
 	ldmia   sp, {r0-r14}^;		/* Restore registers (usr mode) */ \
 	mov r0, r0;	  		/* NOP for previous instruction */ \



CVS commit: src/sys/arch/arm/include/arm32

2018-10-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 27 13:26:23 UTC 2018

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.41 src/sys/arch/arm/include/arm32/vmparam.h:1.42
--- src/sys/arch/arm/include/arm32/vmparam.h:1.41	Mon Feb 13 09:46:30 2017
+++ src/sys/arch/arm/include/arm32/vmparam.h	Sat Oct 27 13:26:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.41 2017/02/13 09:46:30 skrll Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.42 2018/10/27 13:26:23 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -48,7 +48,7 @@
 #include 
 #include 	/* pt_entry_t */
 
-#define	__USE_TOPDOWN_VM 
+#define	__USE_TOPDOWN_VM
 #define	USRSTACK	VM_MAXUSER_ADDRESS
 
 /*



CVS commit: src/sys/arch/arm/include/arm32

2018-08-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug  5 06:18:05 UTC 2018

Modified Files:
src/sys/arch/arm/include/arm32: machdep.h

Log Message:
Expose kern_vtopdiff


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/include/arm32/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/arm/include/arm32/machdep.h
diff -u src/sys/arch/arm/include/arm32/machdep.h:1.24 src/sys/arch/arm/include/arm32/machdep.h:1.25
--- src/sys/arch/arm/include/arm32/machdep.h:1.24	Fri Aug  3 15:46:41 2018
+++ src/sys/arch/arm/include/arm32/machdep.h	Sun Aug  5 06:18:05 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.h,v 1.24 2018/08/03 15:46:41 skrll Exp $ */
+/* $NetBSD: machdep.h,v 1.25 2018/08/05 06:18:05 skrll Exp $ */
 
 #ifndef _ARM32_MACHDEP_H_
 #define _ARM32_MACHDEP_H_
@@ -52,6 +52,8 @@ extern char *booted_kernel;
 extern volatile uint32_t arm_cpu_hatched;
 extern volatile uint32_t arm_cpu_mbox;
 extern u_int arm_cpu_max;
+extern u_long kern_vtopdiff;
+
 
 /* misc prototypes used by the many arm machdeps */
 void cortex_pmc_ccnt_init(void);
@@ -74,16 +76,12 @@ struct boot_physmem;
 static inline paddr_t
 aarch32_kern_vtophys(vaddr_t va)
 {
-	extern u_long kern_vtopdiff;
-
 	return va - kern_vtopdiff;
 }
 
 static inline vaddr_t
 aarch32_kern_phystov(paddr_t pa)
 {
-	extern u_long kern_vtopdiff;
-
 	return pa + kern_vtopdiff;
 }
 



CVS commit: src/sys/arch/arm/include/arm32

2018-08-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Aug  1 13:48:01 UTC 2018

Modified Files:
src/sys/arch/arm/include/arm32: machdep.h

Log Message:
s/_ARM32_BOOT_MACHDEP_H_/_ARM32_MACHDEP_H_/ in multiple inclusion
protection.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/include/arm32/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/arm/include/arm32/machdep.h
diff -u src/sys/arch/arm/include/arm32/machdep.h:1.22 src/sys/arch/arm/include/arm32/machdep.h:1.23
--- src/sys/arch/arm/include/arm32/machdep.h:1.22	Sun Jul 15 05:16:41 2018
+++ src/sys/arch/arm/include/arm32/machdep.h	Wed Aug  1 13:48:00 2018
@@ -1,7 +1,7 @@
-/* $NetBSD: machdep.h,v 1.22 2018/07/15 05:16:41 maxv Exp $ */
+/* $NetBSD: machdep.h,v 1.23 2018/08/01 13:48:00 skrll Exp $ */
 
-#ifndef _ARM32_BOOT_MACHDEP_H_
-#define _ARM32_BOOT_MACHDEP_H_
+#ifndef _ARM32_MACHDEP_H_
+#define _ARM32_MACHDEP_H_
 
 /* Define various stack sizes in pages */
 #ifndef IRQ_STACK_SIZE



CVS commit: src/sys/arch/arm/include/arm32

2017-08-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 29 06:28:27 UTC 2017

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Revert the *_PROT_RO_* define changes and do all the work in the *_PROT()
macros for RO kernel pages.

cats boots again - no idea how it slipped through my testing previously


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.152 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.151 src/sys/arch/arm/include/arm32/pmap.h:1.152
--- src/sys/arch/arm/include/arm32/pmap.h:1.151	Tue Jul 11 20:42:17 2017
+++ src/sys/arch/arm/include/arm32/pmap.h	Tue Aug 29 06:28:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.151 2017/07/11 20:42:17 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.152 2017/08/29 06:28:26 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -728,12 +728,12 @@ extern void (*pmap_zero_page_func)(paddr
  */
 #define	L1_S_PROT_U_generic	(L1_S_AP(AP_U))
 #define	L1_S_PROT_W_generic	(L1_S_AP(AP_W))
-#define	L1_S_PROT_RO_generic	(L1_S_AP(AP_R))	/* AP_W == AP_R */
+#define	L1_S_PROT_RO_generic	(0)
 #define	L1_S_PROT_MASK_generic	(L1_S_PROT_U|L1_S_PROT_W|L1_S_PROT_RO)
 
 #define	L1_S_PROT_U_xscale	(L1_S_AP(AP_U))
 #define	L1_S_PROT_W_xscale	(L1_S_AP(AP_W))
-#define	L1_S_PROT_RO_xscale	(L1_S_AP(AP_R))	/* AP_W == AP_R */
+#define	L1_S_PROT_RO_xscale	(0)
 #define	L1_S_PROT_MASK_xscale	(L1_S_PROT_U|L1_S_PROT_W|L1_S_PROT_RO)
 
 #define	L1_S_PROT_U_armv6	(L1_S_AP(AP_R) | L1_S_AP(AP_U))
@@ -754,12 +754,12 @@ extern void (*pmap_zero_page_func)(paddr
 
 #define	L2_L_PROT_U_generic	(L2_AP(AP_U))
 #define	L2_L_PROT_W_generic	(L2_AP(AP_W))
-#define	L2_L_PROT_RO_generic	(L2_AP(AP_R))
+#define	L2_L_PROT_RO_generic	(0)
 #define	L2_L_PROT_MASK_generic	(L2_L_PROT_U|L2_L_PROT_W|L2_L_PROT_RO)
 
 #define	L2_L_PROT_U_xscale	(L2_AP(AP_U))
 #define	L2_L_PROT_W_xscale	(L2_AP(AP_W))
-#define	L2_L_PROT_RO_xscale	(L2_AP(AP_R))
+#define	L2_L_PROT_RO_xscale	(0)
 #define	L2_L_PROT_MASK_xscale	(L2_L_PROT_U|L2_L_PROT_W|L2_L_PROT_RO)
 
 #define	L2_L_PROT_U_armv6n	(L2_AP0(AP_R) | L2_AP0(AP_U))
@@ -780,12 +780,12 @@ extern void (*pmap_zero_page_func)(paddr
 
 #define	L2_S_PROT_U_generic	(L2_AP(AP_U))
 #define	L2_S_PROT_W_generic	(L2_AP(AP_W))
-#define	L2_S_PROT_RO_generic	(L2_AP(AP_R))
+#define	L2_S_PROT_RO_generic	(0)
 #define	L2_S_PROT_MASK_generic	(L2_S_PROT_U|L2_S_PROT_W|L2_S_PROT_RO)
 
 #define	L2_S_PROT_U_xscale	(L2_AP0(AP_U))
 #define	L2_S_PROT_W_xscale	(L2_AP0(AP_W))
-#define	L2_S_PROT_RO_xscale	(L2_AP(AP_R))
+#define	L2_S_PROT_RO_xscale	(0)
 #define	L2_S_PROT_MASK_xscale	(L2_S_PROT_U|L2_S_PROT_W|L2_S_PROT_RO)
 
 #define	L2_S_PROT_U_armv6n	(L2_AP0(AP_R) | L2_AP0(AP_U))
@@ -1028,31 +1028,44 @@ extern void (*pmap_zero_page_func)(paddr
 #define l1pte_set_writable(pte)	(((pte) & ~L1_S_PROT_RO) | L1_S_PROT_W)
 #define l1pte_set_readonly(pte)	(((pte) & ~L1_S_PROT_W) | L1_S_PROT_RO)
 
-#define l2pte_set_writable(pte)	(L2_S_PROT_W == L2_S_PROT_RO ? \
-((pte) | L2_S_PROT_W) : (((pte) & ~L2_S_PROT_RO) | L2_S_PROT_W))
-
-#define l2pte_set_readonly(pte)	(L2_S_PROT_W == L2_S_PROT_RO ? \
-((pte) & ~L2_S_PROT_RO) : (((pte) & ~L2_S_PROT_W) | L2_S_PROT_RO))
+#define l2pte_set_writable(pte)	(((pte) & ~L2_S_PROT_RO) | L2_S_PROT_W)
+#define l2pte_set_readonly(pte)	(((pte) & ~L2_S_PROT_W) | L2_S_PROT_RO)
 
 #define l2pte_writable_p(pte)	(((pte) & L2_S_PROT_W) == L2_S_PROT_W && \
- (L2_S_PROT_W == L2_S_PROT_RO || \
+ (L2_S_PROT_RO == 0 || \
   ((pte) & L2_S_PROT_RO) != L2_S_PROT_RO))
 
 /*
  * These macros return various bits based on kernel/user and protection.
  * Note that the compiler will usually fold these at compile time.
  */
-#define	L1_S_PROT(ku, pr)	ku) == PTE_USER) ? L1_S_PROT_U : 0) | \
-	(((pr) & VM_PROT_WRITE) ? L1_S_PROT_W :  \
-	(L1_S_PROT_W == L1_S_PROT_RO ? 0 : L1_S_PROT_RO)))
-
-#define	L2_L_PROT(ku, pr)	ku) == PTE_USER) ? L2_L_PROT_U : 0) | \
-	(((pr) & VM_PROT_WRITE) ? L2_L_PROT_W :  \
-	(L2_L_PROT_W == L2_L_PROT_RO ? 0 : L2_L_PROT_RO)))
-
-#define	L2_S_PROT(ku, pr)	ku) == PTE_USER) ? L2_S_PROT_U : 0) | \
-	(((pr) & VM_PROT_WRITE) ? L2_S_PROT_W :  \
-	(L2_S_PROT_W == L2_S_PROT_RO ? 0 : L2_S_PROT_RO)))
+
+#define	L1_S_PROT(ku, pr)	(	   \
+	(((ku) == PTE_USER) ? 		   \
+	L1_S_PROT_U | (((pr) & VM_PROT_WRITE) ? L1_S_PROT_W : 0)	   \
+	:    \
+	(((L1_S_PROT_RO && 		   \
+		((pr) & (VM_PROT_READ | VM_PROT_WRITE)) == VM_PROT_READ) ? \
+		L1_S_PROT_RO : L1_S_PROT_W)))			   \
+)
+
+#define	L2_L_PROT(ku, pr)	(	   \
+	(((ku) == PTE_USER) ?		   \
+	L2_L_PROT_U | (((pr) & VM_PROT_WRITE) ? L2_L_PROT_W : 0)	   \
+	:   \
+	(((L2_L_PROT_RO && 		   \
+		((pr) & (VM_PROT_READ | VM_PROT_WRITE)) == VM_PROT_READ) ? \
+		L2_L_PROT_RO : L2_L_P

CVS commit: src/sys/arch/arm/include/arm32

2017-07-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jul 11 20:42:17 UTC 2017

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Fix up L{1_S,2_L,2_S}_PROT for recent changes to the
L{1_S,2_L,2_S}_PROT_RO* values.


To generate a diff of this commit:
cvs rdiff -u -r1.150 -r1.151 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.150 src/sys/arch/arm/include/arm32/pmap.h:1.151
--- src/sys/arch/arm/include/arm32/pmap.h:1.150	Thu Jul  6 15:17:47 2017
+++ src/sys/arch/arm/include/arm32/pmap.h	Tue Jul 11 20:42:17 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.150 2017/07/06 15:17:47 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.151 2017/07/11 20:42:17 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -1043,13 +1043,16 @@ extern void (*pmap_zero_page_func)(paddr
  * Note that the compiler will usually fold these at compile time.
  */
 #define	L1_S_PROT(ku, pr)	ku) == PTE_USER) ? L1_S_PROT_U : 0) | \
- (((pr) & VM_PROT_WRITE) ? L1_S_PROT_W : L1_S_PROT_RO))
+	(((pr) & VM_PROT_WRITE) ? L1_S_PROT_W :  \
+	(L1_S_PROT_W == L1_S_PROT_RO ? 0 : L1_S_PROT_RO)))
 
 #define	L2_L_PROT(ku, pr)	ku) == PTE_USER) ? L2_L_PROT_U : 0) | \
- (((pr) & VM_PROT_WRITE) ? L2_L_PROT_W : L2_L_PROT_RO))
+	(((pr) & VM_PROT_WRITE) ? L2_L_PROT_W :  \
+	(L2_L_PROT_W == L2_L_PROT_RO ? 0 : L2_L_PROT_RO)))
 
 #define	L2_S_PROT(ku, pr)	ku) == PTE_USER) ? L2_S_PROT_U : 0) | \
- (((pr) & VM_PROT_WRITE) ? L2_S_PROT_W : L2_S_PROT_RO))
+	(((pr) & VM_PROT_WRITE) ? L2_S_PROT_W :  \
+	(L2_S_PROT_W == L2_S_PROT_RO ? 0 : L2_S_PROT_RO)))
 
 /*
  * Macros to test if a mapping is mappable with an L1 SuperSection,



CVS commit: src/sys/arch/arm/include/arm32

2017-07-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jul  7 16:59:35 UTC 2017

Modified Files:
src/sys/arch/arm/include/arm32: frame.h

Log Message:
Fixup the non-KDTRACE_HOOKS case of PUSHDTRACEGAP - we need to copy the
stack pointer to r2.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/arm/include/arm32/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/arm/include/arm32/frame.h
diff -u src/sys/arch/arm/include/arm32/frame.h:1.44 src/sys/arch/arm/include/arm32/frame.h:1.45
--- src/sys/arch/arm/include/arm32/frame.h:1.44	Fri Jul  7 00:34:09 2017
+++ src/sys/arch/arm/include/arm32/frame.h	Fri Jul  7 16:59:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.44 2017/07/07 00:34:09 chs Exp $	*/
+/*	$NetBSD: frame.h,v 1.45 2017/07/07 16:59:35 skrll Exp $	*/
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -455,7 +455,8 @@ LOCK_CAS_DEBUG_LOCALS
 	mov	r2, sp;			   \
 	subeq	r2, r2, #(4 * 16);	/* if so, leave a gap for dtrace */
 #else
-#define PUSHDTRACEGAP			/* nothing */
+#define PUSHDTRACEGAP			   \
+	mov	r2, sp
 #endif
 
 #define PUSHTRAPFRAME(rX)		   \



CVS commit: src/sys/arch/arm/include/arm32

2017-07-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jul  6 15:17:47 UTC 2017

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
KNF two comments


To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.150 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.149 src/sys/arch/arm/include/arm32/pmap.h:1.150
--- src/sys/arch/arm/include/arm32/pmap.h:1.149	Thu Jul  6 15:07:56 2017
+++ src/sys/arch/arm/include/arm32/pmap.h	Thu Jul  6 15:17:47 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.149 2017/07/06 15:07:56 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.150 2017/07/06 15:17:47 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -924,8 +924,10 @@ extern void (*pmap_zero_page_func)(paddr
 #define	L2_L_CACHE_MASK		L2_L_CACHE_MASK_armv6n
 #define	L2_S_CACHE_MASK		L2_S_CACHE_MASK_armv6n
 
-/* These prototypes make writeable mappings, while the other MMU types
- * make read-only mappings. */
+/*
+ * These prototypes make writeable mappings, while the other MMU types
+ * make read-only mappings.
+ */
 #define	L1_SS_PROTO		L1_SS_PROTO_armv6
 #define	L1_S_PROTO		L1_S_PROTO_armv6
 #define	L1_C_PROTO		L1_C_PROTO_armv6
@@ -1007,8 +1009,10 @@ extern void (*pmap_zero_page_func)(paddr
 #define	L2_L_CACHE_MASK		L2_L_CACHE_MASK_armv7
 #define	L2_S_CACHE_MASK		L2_S_CACHE_MASK_armv7
 
-/* These prototypes make writeable mappings, while the other MMU types
- * make read-only mappings. */
+/*
+ * These prototypes make writeable mappings, while the other MMU types
+ * make read-only mappings.
+ */
 #define	L1_SS_PROTO		L1_SS_PROTO_armv7
 #define	L1_S_PROTO		L1_S_PROTO_armv7
 #define	L1_C_PROTO		L1_C_PROTO_armv7



CVS commit: src/sys/arch/arm/include/arm32

2017-07-06 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jul  6 15:07:56 UTC 2017

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Re-define the L*_PROT_RO for MMUs that don't really support RO mapping
and adjust l2pte_set_{writeable,readony} to the new values.

This allows RO mappings for MMUs that actually support them.


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.148 src/sys/arch/arm/include/arm32/pmap.h:1.149
--- src/sys/arch/arm/include/arm32/pmap.h:1.148	Thu Jul  6 06:31:24 2017
+++ src/sys/arch/arm/include/arm32/pmap.h	Thu Jul  6 15:07:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.148 2017/07/06 06:31:24 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.149 2017/07/06 15:07:56 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -728,12 +728,12 @@ extern void (*pmap_zero_page_func)(paddr
  */
 #define	L1_S_PROT_U_generic	(L1_S_AP(AP_U))
 #define	L1_S_PROT_W_generic	(L1_S_AP(AP_W))
-#define	L1_S_PROT_RO_generic	(0)
+#define	L1_S_PROT_RO_generic	(L1_S_AP(AP_R))	/* AP_W == AP_R */
 #define	L1_S_PROT_MASK_generic	(L1_S_PROT_U|L1_S_PROT_W|L1_S_PROT_RO)
 
 #define	L1_S_PROT_U_xscale	(L1_S_AP(AP_U))
 #define	L1_S_PROT_W_xscale	(L1_S_AP(AP_W))
-#define	L1_S_PROT_RO_xscale	(0)
+#define	L1_S_PROT_RO_xscale	(L1_S_AP(AP_R))	/* AP_W == AP_R */
 #define	L1_S_PROT_MASK_xscale	(L1_S_PROT_U|L1_S_PROT_W|L1_S_PROT_RO)
 
 #define	L1_S_PROT_U_armv6	(L1_S_AP(AP_R) | L1_S_AP(AP_U))
@@ -754,12 +754,12 @@ extern void (*pmap_zero_page_func)(paddr
 
 #define	L2_L_PROT_U_generic	(L2_AP(AP_U))
 #define	L2_L_PROT_W_generic	(L2_AP(AP_W))
-#define	L2_L_PROT_RO_generic	(0)
+#define	L2_L_PROT_RO_generic	(L2_AP(AP_R))
 #define	L2_L_PROT_MASK_generic	(L2_L_PROT_U|L2_L_PROT_W|L2_L_PROT_RO)
 
 #define	L2_L_PROT_U_xscale	(L2_AP(AP_U))
 #define	L2_L_PROT_W_xscale	(L2_AP(AP_W))
-#define	L2_L_PROT_RO_xscale	(0)
+#define	L2_L_PROT_RO_xscale	(L2_AP(AP_R))
 #define	L2_L_PROT_MASK_xscale	(L2_L_PROT_U|L2_L_PROT_W|L2_L_PROT_RO)
 
 #define	L2_L_PROT_U_armv6n	(L2_AP0(AP_R) | L2_AP0(AP_U))
@@ -780,12 +780,12 @@ extern void (*pmap_zero_page_func)(paddr
 
 #define	L2_S_PROT_U_generic	(L2_AP(AP_U))
 #define	L2_S_PROT_W_generic	(L2_AP(AP_W))
-#define	L2_S_PROT_RO_generic	(0)
+#define	L2_S_PROT_RO_generic	(L2_AP(AP_R))
 #define	L2_S_PROT_MASK_generic	(L2_S_PROT_U|L2_S_PROT_W|L2_S_PROT_RO)
 
 #define	L2_S_PROT_U_xscale	(L2_AP0(AP_U))
 #define	L2_S_PROT_W_xscale	(L2_AP0(AP_W))
-#define	L2_S_PROT_RO_xscale	(0)
+#define	L2_S_PROT_RO_xscale	(L2_AP(AP_R))
 #define	L2_S_PROT_MASK_xscale	(L2_S_PROT_U|L2_S_PROT_W|L2_S_PROT_RO)
 
 #define	L2_S_PROT_U_armv6n	(L2_AP0(AP_R) | L2_AP0(AP_U))
@@ -1023,11 +1023,15 @@ extern void (*pmap_zero_page_func)(paddr
  */
 #define l1pte_set_writable(pte)	(((pte) & ~L1_S_PROT_RO) | L1_S_PROT_W)
 #define l1pte_set_readonly(pte)	(((pte) & ~L1_S_PROT_W) | L1_S_PROT_RO)
-#define l2pte_set_writable(pte)	(((pte) & ~L2_S_PROT_RO) | L2_S_PROT_W)
-#define l2pte_set_readonly(pte)	(((pte) & ~L2_S_PROT_W) | L2_S_PROT_RO)
+
+#define l2pte_set_writable(pte)	(L2_S_PROT_W == L2_S_PROT_RO ? \
+((pte) | L2_S_PROT_W) : (((pte) & ~L2_S_PROT_RO) | L2_S_PROT_W))
+
+#define l2pte_set_readonly(pte)	(L2_S_PROT_W == L2_S_PROT_RO ? \
+((pte) & ~L2_S_PROT_RO) : (((pte) & ~L2_S_PROT_W) | L2_S_PROT_RO))
 
 #define l2pte_writable_p(pte)	(((pte) & L2_S_PROT_W) == L2_S_PROT_W && \
- (L2_S_PROT_RO == 0 || \
+ (L2_S_PROT_W == L2_S_PROT_RO || \
   ((pte) & L2_S_PROT_RO) != L2_S_PROT_RO))
 
 /*



CVS commit: src/sys/arch/arm/include/arm32

2017-07-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jul  6 06:31:24 UTC 2017

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.147 src/sys/arch/arm/include/arm32/pmap.h:1.148
--- src/sys/arch/arm/include/arm32/pmap.h:1.147	Thu May 25 20:42:41 2017
+++ src/sys/arch/arm/include/arm32/pmap.h	Thu Jul  6 06:31:24 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.147 2017/05/25 20:42:41 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.148 2017/07/06 06:31:24 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -488,7 +488,7 @@ extern int pmap_needs_pte_sync;
  * Finally, MEMC, GENERIC and XSCALE MMUs do not need PTE syncs.
  *
  * Use run time evaluation for all other cases.
- * 
+ *
  */
 #if (ARM_NMMUS == 1)
 #if (ARM_MMU_SA1 + ARM_MMU_V6 != 0)



CVS commit: src/sys/arch/arm/include/arm32

2017-06-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jun 22 08:44:21 UTC 2017

Modified Files:
src/sys/arch/arm/include/arm32: frame.h

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/arm/include/arm32/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/arm/include/arm32/frame.h
diff -u src/sys/arch/arm/include/arm32/frame.h:1.42 src/sys/arch/arm/include/arm32/frame.h:1.43
--- src/sys/arch/arm/include/arm32/frame.h:1.42	Fri Apr 17 17:28:33 2015
+++ src/sys/arch/arm/include/arm32/frame.h	Thu Jun 22 08:44:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.42 2015/04/17 17:28:33 matt Exp $	*/
+/*	$NetBSD: frame.h,v 1.43 2017/06/22 08:44:21 skrll Exp $	*/
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -64,7 +64,7 @@ struct switchframe {
 	u_int	sf_sp;
 	u_int	sf_pc;
 };
- 
+
 /*
  * System stack frames.
  */
@@ -240,7 +240,7 @@ void validate_trapframe(trapframe_t *, i
 #define	ENABLE_ALIGNMENT_FAULTS		\
 	and	r7, r0, #(PSR_MODE)	/* Test for USR32 mode */	;\
 	GET_CURCPU(r4)			/* r4 = cpuinfo */
-	
+
 
 #define	DO_AST_AND_RESTORE_ALIGNMENT_FAULTS\
 	DO_PENDING_SOFTINTS		;\
@@ -423,7 +423,7 @@ LOCK_CAS_DEBUG_LOCALS
  * This should only be used if the processor is not currently in SVC32
  * mode. The processor mode is switched to SVC mode and the trap frame is
  * stored. The SVC lr field is used to store the previous value of
- * lr in SVC mode.  
+ * lr in SVC mode.
  *
  * NOTE: r13 and r14 are stored separately as a work around for the
  * SA110 rev 2 STM^ bug



CVS commit: src/sys/arch/arm/include/arm32

2017-05-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu May 25 20:42:41 UTC 2017

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Use the define name PMAP_HWPAGEWALKER and not PMAP_TLB_HWPAGEWALKER


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.146 src/sys/arch/arm/include/arm32/pmap.h:1.147
--- src/sys/arch/arm/include/arm32/pmap.h:1.146	Thu May 25 20:32:48 2017
+++ src/sys/arch/arm/include/arm32/pmap.h	Thu May 25 20:42:41 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.146 2017/05/25 20:32:48 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.147 2017/05/25 20:42:41 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -84,8 +84,8 @@
 #endif
 
 #ifdef ARM_MMU_EXTENDED
+#define PMAP_HWPAGEWALKER		1
 #define PMAP_TLB_MAX			1
-#define PMAP_TLB_HWPAGEWALKER		1
 #if PMAP_TLB_MAX > 1
 #define PMAP_TLB_NEED_SHOOTDOWN		1
 #endif



CVS commit: src/sys/arch/arm/include/arm32

2017-05-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu May 25 20:32:48 UTC 2017

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Spell ARM_MMU_EXTENDED correctly


To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.146 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.145 src/sys/arch/arm/include/arm32/pmap.h:1.146
--- src/sys/arch/arm/include/arm32/pmap.h:1.145	Thu Feb 23 08:22:20 2017
+++ src/sys/arch/arm/include/arm32/pmap.h	Thu May 25 20:32:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.145 2017/02/23 08:22:20 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.146 2017/05/25 20:32:48 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -167,7 +167,7 @@
 
 #ifndef _LOCORE
 
-#ifndef PMAP_MMU_EXTENDED
+#ifndef ARM_MMU_EXTENDED
 struct l1_ttable;
 struct l2_dtable;
 



CVS commit: src/sys/arch/arm/include/arm32

2017-02-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Feb 20 17:23:54 UTC 2017

Modified Files:
src/sys/arch/arm/include/arm32: machdep.h

Log Message:
Whitespace in comment


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/include/arm32/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/arm/include/arm32/machdep.h
diff -u src/sys/arch/arm/include/arm32/machdep.h:1.20 src/sys/arch/arm/include/arm32/machdep.h:1.21
--- src/sys/arch/arm/include/arm32/machdep.h:1.20	Mon Feb 20 17:22:26 2017
+++ src/sys/arch/arm/include/arm32/machdep.h	Mon Feb 20 17:23:54 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.h,v 1.20 2017/02/20 17:22:26 skrll Exp $ */
+/* $NetBSD: machdep.h,v 1.21 2017/02/20 17:23:54 skrll Exp $ */
 
 #ifndef _ARM32_BOOT_MACHDEP_H_
 #define _ARM32_BOOT_MACHDEP_H_
@@ -69,7 +69,7 @@ void undefinedinstruction_bounce(trapfra
 void dumpsys(void);
 
 /*
- * note that we use void *as all the platforms have different ideas on what
+ * note that we use void * as all the platforms have different ideas on what
  * the structure is
  */
 u_int initarm(void *);



CVS commit: src/sys/arch/arm/include/arm32

2017-02-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Feb 20 17:22:26 UTC 2017

Modified Files:
src/sys/arch/arm/include/arm32: machdep.h

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/include/arm32/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/arm/include/arm32/machdep.h
diff -u src/sys/arch/arm/include/arm32/machdep.h:1.19 src/sys/arch/arm/include/arm32/machdep.h:1.20
--- src/sys/arch/arm/include/arm32/machdep.h:1.19	Wed Nov 11 12:37:13 2015
+++ src/sys/arch/arm/include/arm32/machdep.h	Mon Feb 20 17:22:26 2017
@@ -1,9 +1,9 @@
-/* $NetBSD: machdep.h,v 1.19 2015/11/11 12:37:13 jmcneill Exp $ */
+/* $NetBSD: machdep.h,v 1.20 2017/02/20 17:22:26 skrll Exp $ */
 
 #ifndef _ARM32_BOOT_MACHDEP_H_
 #define _ARM32_BOOT_MACHDEP_H_
 
-/* Define various stack sizes in pages */ 
+/* Define various stack sizes in pages */
 #ifndef IRQ_STACK_SIZE
 #define IRQ_STACK_SIZE	1
 #endif
@@ -68,7 +68,7 @@ void prefetch_abort_handler(trapframe_t 
 void undefinedinstruction_bounce(trapframe_t *);
 void dumpsys(void);
 
-/* 
+/*
  * note that we use void *as all the platforms have different ideas on what
  * the structure is
  */



CVS commit: src/sys/arch/arm/include/arm32

2015-10-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Oct 18 00:28:32 UTC 2015

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
pull in arm/arm32/param.h


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.39 src/sys/arch/arm/include/arm32/vmparam.h:1.40
--- src/sys/arch/arm/include/arm32/vmparam.h:1.39	Sat Jun 20 07:13:25 2015
+++ src/sys/arch/arm/include/arm32/vmparam.h	Sun Oct 18 00:28:32 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.39 2015/06/20 07:13:25 skrll Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.40 2015/10/18 00:28:32 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -45,6 +45,7 @@
  */
 
 #include 
+#include 
 #include 	/* pt_entry_t */
 
 #define	__USE_TOPDOWN_VM 



CVS commit: src/sys/arch/arm/include/arm32

2015-09-09 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Sep  9 07:37:36 UTC 2015

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Make L2_S_CACHE_MASK_armv6n consistent with other *_CACHE_MASK_armv6n


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.141 src/sys/arch/arm/include/arm32/pmap.h:1.142
--- src/sys/arch/arm/include/arm32/pmap.h:1.141	Mon Jun  1 19:16:44 2015
+++ src/sys/arch/arm/include/arm32/pmap.h	Wed Sep  9 07:37:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.141 2015/06/01 19:16:44 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.142 2015/09/09 07:37:36 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -794,12 +794,12 @@ extern void (*pmap_zero_page_func)(paddr
 #define	L2_S_CACHE_MASK_generic	(L2_B|L2_C)
 #define	L2_S_CACHE_MASK_xscale	(L2_B|L2_C|L2_XS_T_TEX(TEX_XSCALE_X))
 #define	L2_XS_CACHE_MASK_armv6	(L2_B|L2_C|L2_V6_XS_TEX(TEX_ARMV6_TEX))
-#define	L2_S_CACHE_MASK_armv6n	L2_XS_CACHE_MASK_armv6
 #ifdef	ARMV6_EXTENDED_SMALL_PAGE
 #define	L2_S_CACHE_MASK_armv6c	L2_XS_CACHE_MASK_armv6
 #else
 #define	L2_S_CACHE_MASK_armv6c	L2_S_CACHE_MASK_generic
 #endif
+#define	L2_S_CACHE_MASK_armv6n	(L2_B|L2_C|L2_V6_XS_TEX(TEX_ARMV6_TEX)|L2_XS_S)
 #define	L2_S_CACHE_MASK_armv7	(L2_B|L2_C|L2_V6_XS_TEX(TEX_ARMV6_TEX)|L2_XS_S)
 
 



CVS commit: src/sys/arch/arm/include/arm32

2015-06-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jun 20 07:13:25 UTC 2015

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
__USE_TOPDOWN_VM

Fixes PR/49974: mmap(2) of large anonymous regions is broken

"go for it" from matt@


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.38 src/sys/arch/arm/include/arm32/vmparam.h:1.39
--- src/sys/arch/arm/include/arm32/vmparam.h:1.38	Tue Jun  2 05:54:23 2015
+++ src/sys/arch/arm/include/arm32/vmparam.h	Sat Jun 20 07:13:25 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.38 2015/06/02 05:54:23 matt Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.39 2015/06/20 07:13:25 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -47,6 +47,7 @@
 #include 
 #include 	/* pt_entry_t */
 
+#define	__USE_TOPDOWN_VM 
 #define	USRSTACK	VM_MAXUSER_ADDRESS
 
 /*



CVS commit: src/sys/arch/arm/include/arm32

2015-06-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jun  2 05:54:23 UTC 2015

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
Back off MAXDSIZ to 1.5GB to avoid some virtual memory exhausted messages.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.37 src/sys/arch/arm/include/arm32/vmparam.h:1.38
--- src/sys/arch/arm/include/arm32/vmparam.h:1.37	Thu May 28 02:24:23 2015
+++ src/sys/arch/arm/include/arm32/vmparam.h	Tue Jun  2 05:54:23 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.37 2015/05/28 02:24:23 matt Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.38 2015/06/02 05:54:23 matt Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -66,7 +66,7 @@
 #define	DFLDSIZ		(384*1024*1024)		/* initial data size limit */
 #endif
 #ifndef	MAXDSIZ
-#define	MAXDSIZ		(1856*1024*1024)	/* max data size */
+#define	MAXDSIZ		(1536*1024*1024)	/* max data size */
 #endif
 #ifndef	DFLSSIZ
 #define	DFLSSIZ		(4*1024*1024)		/* initial stack size limit */



CVS commit: src/sys/arch/arm/include/arm32

2015-05-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu May 28 02:24:23 UTC 2015

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
ARM systems are no longer small, increase MAXTSIZ/MAXDSIZ/MAXSSIZ.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.36 src/sys/arch/arm/include/arm32/vmparam.h:1.37
--- src/sys/arch/arm/include/arm32/vmparam.h:1.36	Tue Feb 24 22:02:40 2015
+++ src/sys/arch/arm/include/arm32/vmparam.h	Thu May 28 02:24:23 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.36 2015/02/24 22:02:40 joerg Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.37 2015/05/28 02:24:23 matt Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -61,18 +61,18 @@
  * Note that MAXTSIZ can't be larger than 32M, otherwise the compiler
  * would have to be changed to not generate "bl" instructions.
  */
-#define	MAXTSIZ		(64*1024*1024)		/* max text size */
+#define	MAXTSIZ		(128*1024*1024)		/* max text size */
 #ifndef	DFLDSIZ
-#define	DFLDSIZ		(128*1024*1024)		/* initial data size limit */
+#define	DFLDSIZ		(384*1024*1024)		/* initial data size limit */
 #endif
 #ifndef	MAXDSIZ
-#define	MAXDSIZ		(1024*1024*1024)	/* max data size */
+#define	MAXDSIZ		(1856*1024*1024)	/* max data size */
 #endif
 #ifndef	DFLSSIZ
-#define	DFLSSIZ		(2*1024*1024)		/* initial stack size limit */
+#define	DFLSSIZ		(4*1024*1024)		/* initial stack size limit */
 #endif
 #ifndef	MAXSSIZ
-#define	MAXSSIZ		(32*1024*1024)		/* max stack size */
+#define	MAXSSIZ		(64*1024*1024)		/* max stack size */
 #endif
 
 /*



CVS commit: src/sys/arch/arm/include/arm32

2015-05-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue May 12 07:07:16 UTC 2015

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Add some KASSERTs to catch similar bugs to the cnptes/nptes one


To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.138 src/sys/arch/arm/include/arm32/pmap.h:1.139
--- src/sys/arch/arm/include/arm32/pmap.h:1.138	Wed Feb 25 13:52:42 2015
+++ src/sys/arch/arm/include/arm32/pmap.h	Tue May 12 07:07:16 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.138 2015/02/25 13:52:42 joerg Exp $	*/
+/*	$NetBSD: pmap.h,v 1.139 2015/05/12 07:07:16 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -567,10 +567,12 @@ static inline void
 l2pte_set(pt_entry_t *ptep, pt_entry_t pte, pt_entry_t opte)
 {
 	if (l1pte_lpage_p(pte)) {
+		KASSERTMSGuintptr_t)ptep / sizeof(pte)) & (L2_L_SIZE / L2_S_SIZE - 1)) == 0, "%p", ptep);
 		for (size_t k = 0; k < L2_L_SIZE / L2_S_SIZE; k++) {
 			*ptep++ = pte;
 		}
 	} else {
+		KASSERTMSGuintptr_t)ptep / sizeof(pte)) & (PAGE_SIZE / L2_S_SIZE - 1)) == 0, "%p", ptep);
 		for (size_t k = 0; k < PAGE_SIZE / L2_S_SIZE; k++) {
 			KASSERTMSG(*ptep == opte, "%#x [*%p] != %#x", *ptep, ptep, opte);
 			*ptep++ = pte;
@@ -584,6 +586,7 @@ l2pte_set(pt_entry_t *ptep, pt_entry_t p
 static inline void
 l2pte_reset(pt_entry_t *ptep)
 {
+	KASSERTMSGuintptr_t)ptep / sizeof(*ptep)) & (PAGE_SIZE / L2_S_SIZE - 1)) == 0, "%p", ptep);
 	*ptep = 0;
 	for (vsize_t k = 1; k < PAGE_SIZE / L2_S_SIZE; k++) {
 		ptep[k] = 0;



CVS commit: src/sys/arch/arm/include/arm32

2015-04-08 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Apr  8 16:38:42 UTC 2015

Modified Files:
src/sys/arch/arm/include/arm32: frame.h

Log Message:
CI_ASTPENDING is now a bitfield and low bit is for user ASTs.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/arm/include/arm32/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/arm/include/arm32/frame.h
diff -u src/sys/arch/arm/include/arm32/frame.h:1.39 src/sys/arch/arm/include/arm32/frame.h:1.40
--- src/sys/arch/arm/include/arm32/frame.h:1.39	Wed Feb 26 01:56:51 2014
+++ src/sys/arch/arm/include/arm32/frame.h	Wed Apr  8 16:38:42 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.39 2014/02/26 01:56:51 matt Exp $	*/
+/*	$NetBSD: frame.h,v 1.40 2015/04/08 16:38:42 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -174,7 +174,7 @@ void validate_trapframe(trapframe_t *, i
  */
 #define	ENABLE_ALIGNMENT_FAULTS		\
 	and	r7, r0, #(PSR_MODE)	/* Test for USR32 mode */	;\
-	teq	r7, #(PSR_USR32_MODE)	;\
+	cmp	r7, #(PSR_USR32_MODE)	;\
 	GET_CURCPU(r4)			/* r4 = cpuinfo */		;\
 	bne	1f			/* Not USR mode skip AFLT */	;\
 	ldr	r1, [r4, #CI_CURLWP]	/* get curlwp from cpu_info */	;\
@@ -197,10 +197,10 @@ void validate_trapframe(trapframe_t *, i
 	DO_PENDING_SOFTINTS		;\
 	GET_CPSR(r5)			/* save CPSR */			;\
 	CPSID_I(r1, r5)			/* Disable interrupts */	;\
-	teq	r7, #(PSR_USR32_MODE)	/* Returning to USR mode? */	;\
+	cmp	r7, #(PSR_USR32_MODE)	/* Returning to USR mode? */	;\
 	bne	3f			/* Nope, get out now */		;\
 1:	ldr	r1, [r4, #CI_ASTPENDING] /* Pending AST? */		;\
-	teq	r1, #0x		;\
+	tst	r1, #0x0001		;\
 	bne	2f			/* Yup. Go deal with it */	;\
 	ldr	r1, [r4, #CI_CURLWP]	/* get curlwp from cpu_info */	;\
 	ldr	r0, [r1, #L_MD_FLAGS]	/* get md_flags from lwp */	;\
@@ -213,7 +213,7 @@ void validate_trapframe(trapframe_t *, i
 	adr	lr, 3f			;\
 	B_CF_CONTROL(r2)		/* Set new CTRL reg value */	;\
 	/* NOTREACHED */		\
-2:	mov	r1, #0x		;\
+2:	bic	r1, r1, #0x0001	;\
 	str	r1, [r4, #CI_ASTPENDING] /* Clear astpending */		;\
 	CPSIE_I(r5, r5)			/* Restore interrupts */	;\
 	mov	r0, sp			;\
@@ -235,12 +235,12 @@ void validate_trapframe(trapframe_t *, i
 	DO_PENDING_SOFTINTS		;\
 	GET_CPSR(r5)			/* save CPSR */			;\
 	CPSID_I(r1, r5)			/* Disable interrupts */	;\
-	teq	r7, #(PSR_USR32_MODE)	;\
+	cmp	r7, #(PSR_USR32_MODE)	;\
 	bne	2f			/* Nope, get out now */		;\
 1:	ldr	r1, [r4, #CI_ASTPENDING] /* Pending AST? */		;\
-	teq	r1, #0x		;\
+	tst	r1, #0x0001		;\
 	beq	2f			/* Nope. Just bail */		;\
-	mov	r1, #0x		;\
+	bic	r1, r1, #0x0001	;\
 	str	r1, [r4, #CI_ASTPENDING] /* Clear astpending */		;\
 	CPSIE_I(r5, r5)			/* Restore interrupts */	;\
 	mov	r0, sp			;\
@@ -288,7 +288,7 @@ LOCK_CAS_DEBUG_LOCALS
 #define	LOCK_CAS_CHECK			 \
 	ldr	r0, [sp]		/* get saved PSR */		;\
 	and	r0, r0, #(PSR_MODE)	/* check for SVC32 mode */	;\
-	teq	r0, #(PSR_SVC32_MODE)	;\
+	cmp	r0, #(PSR_SVC32_MODE)	;\
 	bne	99f			/* nope, get out now */		;\
 	ldr	r0, [sp, #(TF_PC)]	;\
 	ldr	r1, .L_lock_cas_end	;\



CVS commit: src/sys/arch/arm/include/arm32

2015-04-01 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Apr  2 03:11:01 UTC 2015

Modified Files:
src/sys/arch/arm/include/arm32: param.h

Log Message:
Don't include 


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/arm/include/arm32/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/arm/include/arm32/param.h
diff -u src/sys/arch/arm/include/arm32/param.h:1.23 src/sys/arch/arm/include/arm32/param.h:1.24
--- src/sys/arch/arm/include/arm32/param.h:1.23	Sat Apr  5 10:35:09 2014
+++ src/sys/arch/arm/include/arm32/param.h	Thu Apr  2 03:11:01 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.23 2014/04/05 10:35:09 skrll Exp $	*/
+/*	$NetBSD: param.h,v 1.24 2015/04/02 03:11:01 matt Exp $	*/
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe.
@@ -35,9 +35,6 @@
 #ifndef	_ARM_ARM32_PARAM_H_
 #define	_ARM_ARM32_PARAM_H_
 
-#ifdef _KERNEL
-# include 
-#endif
 #ifdef _KERNEL_OPT
 # include "opt_arm32_pmap.h"
 #endif



CVS commit: src/sys/arch/arm/include/arm32

2015-02-24 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Feb 24 22:02:40 UTC 2015

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
Restore PAGER_MAP_DEFAULT_SIZE for ARMv4, they typically have only 256MB
KVA.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.35 src/sys/arch/arm/include/arm32/vmparam.h:1.36
--- src/sys/arch/arm/include/arm32/vmparam.h:1.35	Sun Jul 27 21:31:34 2014
+++ src/sys/arch/arm/include/arm32/vmparam.h	Tue Feb 24 22:02:40 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.35 2014/07/27 21:31:34 skrll Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.36 2015/02/24 22:02:40 joerg Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -50,6 +50,14 @@
 #define	USRSTACK	VM_MAXUSER_ADDRESS
 
 /*
+ * ARMv4 systems are normaly configured for 256MB KVA only, so restrict
+ * the size of the pager map to 4MB.
+ */
+#ifndef _ARM_ARCH_5
+#define PAGER_MAP_DEFAULT_SIZE  (4 * 1024 * 1024)
+#endif
+
+/*
  * Note that MAXTSIZ can't be larger than 32M, otherwise the compiler
  * would have to be changed to not generate "bl" instructions.
  */



CVS commit: src/sys/arch/arm/include/arm32

2014-11-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Nov  8 17:18:22 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.136 src/sys/arch/arm/include/arm32/pmap.h:1.137
--- src/sys/arch/arm/include/arm32/pmap.h:1.136	Wed Oct 29 14:14:14 2014
+++ src/sys/arch/arm/include/arm32/pmap.h	Sat Nov  8 17:18:22 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.136 2014/10/29 14:14:14 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.137 2014/11/08 17:18:22 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -345,9 +345,9 @@ extern int		arm_poolpage_vmfreelist;
 
 #define pmap_phys_address(ppn)		(arm_ptob((ppn)))
 u_int arm32_mmap_flags(paddr_t);
-#define ARM32_MMAP_WRITECOMBINE	0x4000
+#define ARM32_MMAP_WRITECOMBINE		0x4000
 #define ARM32_MMAP_CACHEABLE		0x2000
-#define pmap_mmap_flags(ppn)			arm32_mmap_flags(ppn)
+#define pmap_mmap_flags(ppn)		arm32_mmap_flags(ppn)
 
 #define	PMAP_PTE			0x1000 /* kenter_pa */
 



CVS commit: src/sys/arch/arm/include/arm32

2014-10-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Oct 29 10:59:48 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: pte.h

Log Message:
Update a comment to reflect ARM ARMv7


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pte.h
diff -u src/sys/arch/arm/include/arm32/pte.h:1.18 src/sys/arch/arm/include/arm32/pte.h:1.19
--- src/sys/arch/arm/include/arm32/pte.h:1.18	Fri Aug  8 07:47:24 2014
+++ src/sys/arch/arm/include/arm32/pte.h	Wed Oct 29 10:59:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pte.h,v 1.18 2014/08/08 07:47:24 skrll Exp $	*/
+/*	$NetBSD: pte.h,v 1.19 2014/10/29 10:59:48 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -304,34 +304,32 @@ typedef uint32_t	pt_entry_t;	/* L2 table
 /*
  * Type Extension bits for ARM V6 and V7 MMU
  *
- * TEX C BShared
- * 000 0 0  Strong order  yes
- * 000 0 1  Shared device yes
- * 000 1 0  write through, no write alloc S-bit
- * 000 1 1  write back, no write allocS-bit
- * 001 0 0  non-cacheable S-bit
+ * TEX C BShared
+ * 000 0 0  Strong order  yes
+ * 000 0 1  Shared device yes
+ * 000 1 0  Outer and Inner write through, no write alloc S-bit
+ * 000 1 1  Outer and Inner write back, no write allocS-bit
+ * 001 0 0  Outer and Inner non-cacheable S-bit
  * 001 0 1  reserved
  * 001 1 0  reserved
- * 001 1 1  write back, write alloc   S-bit
- * 010 0 0  Non-shared device no
+ * 001 1 1  Outer and Inner write back, write alloc   S-bit
+ * 010 0 0  Non-shared device no
  * 010 0 1  reserved
  * 010 1 X  reserved
  * 011 X X  reserved
- * 1BB A A  BB for internal, AA for external  S-bit
+ * 1BB A A  BB for inner, AA for outerS-bit
  *
- *BBinternal cache
- *0 0   Non-cacheable non-buffered
- *0 1   Write back, write alloc, buffered
- *1 0   Write through, no write alloc, buffered
- *  (non-cacheable for MPCore)
- *1 1   Write back, no write alloc, buffered
- *  (write back, write alloc for MPCore)
- *
- *AAexternal cache
- *0 0   Non-cacheable non-buffered
- *0 1   Write back, write alloc, buffered
- *1 0   Write through, no write alloc, buffered
- *1 1   Write back, no write alloc, buffered
+ *BBinner cache
+ *0 0   Non-cacheable
+ *0 1   Write back, write alloc
+ *1 0   Write through, no write alloc
+ *1 1   Write back, no write alloc
+ *
+ *AAouter cache
+ *0 0   Non-cacheable
+ *0 1   Write back, write alloc
+ *1 0   Write through, no write alloc
+ *1 1   Write back, no write alloc
  */
 
 #define	TEX_ARMV6_TEX	0x07		/* 3 bits in TEX */



CVS commit: src/sys/arch/arm/include/arm32

2014-08-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Aug  8 07:47:05 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: pte.h

Log Message:
Spell user with an e.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pte.h
diff -u src/sys/arch/arm/include/arm32/pte.h:1.16 src/sys/arch/arm/include/arm32/pte.h:1.17
--- src/sys/arch/arm/include/arm32/pte.h:1.16	Thu Jul 31 08:04:57 2014
+++ src/sys/arch/arm/include/arm32/pte.h	Fri Aug  8 07:47:05 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pte.h,v 1.16 2014/07/31 08:04:57 skrll Exp $	*/
+/*	$NetBSD: pte.h,v 1.17 2014/08/08 07:47:05 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -250,8 +250,8 @@ typedef uint32_t	pt_entry_t;	/* L2 table
  */
 #define	AP_KR		0x00		/* kernel read */
 #define	AP_KRW		0x01		/* kernel read/write */
-#define	AP_KRWUR	0x02		/* kernel read/write usr read */
-#define	AP_KRWURW	0x03		/* kernel read/write usr read/write */
+#define	AP_KRWUR	0x02		/* kernel read/write user read */
+#define	AP_KRWURW	0x03		/* kernel read/write user read/write */
 
 /*
  * Note: These values assume the S (System) and the R (ROM) bits are clear and
@@ -269,9 +269,9 @@ typedef uint32_t	pt_entry_t;	/* L2 table
  * Also used for ARMv6 with XP bit set.
  */
 #define	AP7_KR		0x21		/* kernel read */
-#define	AP7_KRUR	0x23		/* kernel read usr read */
+#define	AP7_KRUR	0x23		/* kernel read user read */
 #define	AP7_KRW		0x01		/* kernel read/write */
-#define	AP7_KRWURW	0x03		/* kernel read/write usr read/write */
+#define	AP7_KRWURW	0x03		/* kernel read/write user read/write */
 
 /*
  * Domain Types for the Domain Access Control Register.



CVS commit: src/sys/arch/arm/include/arm32

2014-08-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Aug  8 07:47:24 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: pte.h

Log Message:
Comment whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pte.h
diff -u src/sys/arch/arm/include/arm32/pte.h:1.17 src/sys/arch/arm/include/arm32/pte.h:1.18
--- src/sys/arch/arm/include/arm32/pte.h:1.17	Fri Aug  8 07:47:05 2014
+++ src/sys/arch/arm/include/arm32/pte.h	Fri Aug  8 07:47:24 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pte.h,v 1.17 2014/08/08 07:47:05 skrll Exp $	*/
+/*	$NetBSD: pte.h,v 1.18 2014/08/08 07:47:24 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -202,13 +202,13 @@ typedef uint32_t	pt_entry_t;	/* L2 table
 #define	L2_TYPE_T	0x03		/* Tiny Page (not armv7) */
 #define	L2_TYPE_MASK	0x03		/* mask of type bits */
 
-	/*
-	 * This L2 Descriptor type is available on XScale processors
-	 * when using a Coarse L1 Descriptor.  The Extended Small
-	 * Descriptor has the same format as the XScale Tiny Descriptor,
-	 * but describes a 4K page, rather than a 1K page.
-	 * For V6 MMU, this is used when XP bit is cleared.
-	 */
+/*
+ * This L2 Descriptor type is available on XScale processors
+ * when using a Coarse L1 Descriptor.  The Extended Small
+ * Descriptor has the same format as the XScale Tiny Descriptor,
+ * but describes a 4K page, rather than a 1K page.
+ * For V6 MMU, this is used when XP bit is cleared.
+ */
 #define	L2_TYPE_XS	0x03		/* XScale/ARMv6 Extended Small Page */
 
 #define	L2_B		0x0004	/* Bufferable page */



CVS commit: src/sys/arch/arm/include/arm32

2014-07-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jul 31 08:04:57 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h pte.h

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/sys/arch/arm/include/arm32/pmap.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.134 src/sys/arch/arm/include/arm32/pmap.h:1.135
--- src/sys/arch/arm/include/arm32/pmap.h:1.134	Sun Jul 27 21:31:34 2014
+++ src/sys/arch/arm/include/arm32/pmap.h	Thu Jul 31 08:04:57 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.134 2014/07/27 21:31:34 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.135 2014/07/31 08:04:57 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -98,14 +98,14 @@
 #include 
 #include 
 
-/* 
+/*
  * If we have an EXTENDED MMU and the address space is split evenly between
  * user and kernel, we can use the TTBR0/TTBR1 to have separate L1 tables for
  * user and kernel address spaces.
- */  
+ */
 #if (KERNEL_BASE & 0x8000) == 0
 #error ARMv6 or later systems must have a KERNEL_BASE >= 0x8000
-#endif  
+#endif
 #endif  /* ARM_MMU_EXTENDED */
 
 /*
@@ -401,7 +401,7 @@ void	pmap_devmap_bootstrap(vaddr_t, cons
 void	pmap_devmap_register(const struct pmap_devmap *);
 
 /*
- * Special page zero routine for use by the idle loop (no cache cleans). 
+ * Special page zero routine for use by the idle loop (no cache cleans).
  */
 bool	pmap_pageidlezero(paddr_t);
 #define PMAP_PAGEIDLEZERO(pa)	pmap_pageidlezero((pa))
@@ -432,7 +432,7 @@ extern vaddr_t pmap_directbase;
 #endif
 
 /*
- * Useful macros and constants 
+ * Useful macros and constants
  */
 
 /* Virtual address to page table entry */
@@ -481,7 +481,7 @@ extern int pmap_needs_pte_sync;
  * we need to do PTE syncs.  If only SA-1 is configured, then evaluate
  * this at compile time.
  */
-#if (ARM_MMU_SA1 + ARM_MMU_V6 != 0) && (ARM_NMMUS == 1) 
+#if (ARM_MMU_SA1 + ARM_MMU_V6 != 0) && (ARM_NMMUS == 1)
 #define	PMAP_INCLUDE_PTE_SYNC
 #if (ARM_MMU_V6 > 0)
 #define	PMAP_NEEDS_PTE_SYNC	1
@@ -588,7 +588,7 @@ l2pte_reset(pt_entry_t *ptep)
 	for (vsize_t k = 1; k < PAGE_SIZE / L2_S_SIZE; k++) {
 		ptep[k] = 0;
 	}
-}   
+}
 
 /* L1 and L2 page table macros */
 #define pmap_pde_v(pde)		l1pte_valid(*(pde))
@@ -1091,7 +1091,7 @@ struct vm_page_md {
 #define	VM_MDPAGE_PVH_ATTRS_INIT(pg) \
 	(pg)->mdpage.pvh_attrs = 0
 #endif
- 
+
 #define	VM_MDPAGE_INIT(pg)		\
 do {	\
 	SLIST_INIT(&(pg)->mdpage.pvh_list);\

Index: src/sys/arch/arm/include/arm32/pte.h
diff -u src/sys/arch/arm/include/arm32/pte.h:1.15 src/sys/arch/arm/include/arm32/pte.h:1.16
--- src/sys/arch/arm/include/arm32/pte.h:1.15	Wed Feb 26 01:53:23 2014
+++ src/sys/arch/arm/include/arm32/pte.h	Thu Jul 31 08:04:57 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pte.h,v 1.15 2014/02/26 01:53:23 matt Exp $	*/
+/*	$NetBSD: pte.h,v 1.16 2014/07/31 08:04:57 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -326,8 +326,8 @@ typedef uint32_t	pt_entry_t;	/* L2 table
  *  (non-cacheable for MPCore)
  *1 1   Write back, no write alloc, buffered
  *  (write back, write alloc for MPCore)
- *
- *AAexternal cache 
+ *
+ *AAexternal cache
  *0 0   Non-cacheable non-buffered
  *0 1   Write back, write alloc, buffered
  *1 0   Write through, no write alloc, buffered



CVS commit: src/sys/arch/arm/include/arm32

2014-06-14 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Sun Jun 15 03:27:46 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Fix macro name; PMAP_TLB_NEED_SHOOTDOWN => PMAP_NEED_TLB_SHOOTDOWN


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.132 src/sys/arch/arm/include/arm32/pmap.h:1.133
--- src/sys/arch/arm/include/arm32/pmap.h:1.132	Wed Apr 16 07:29:52 2014
+++ src/sys/arch/arm/include/arm32/pmap.h	Sun Jun 15 03:27:46 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.132 2014/04/16 07:29:52 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.133 2014/06/15 03:27:46 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -84,7 +84,7 @@
 #define PMAP_TLB_MAX			1
 #define PMAP_TLB_HWPAGEWALKER		1
 #if PMAP_TLB_MAX > 1
-#define PMAP_TLB_NEED_SHOOTDOWN		1
+#define PMAP_NEED_TLB_SHOOTDOWN		1
 #endif
 #define PMAP_TLB_FLUSH_ASID_ON_RESET	(arm_has_tlbiasid_p)
 #define PMAP_TLB_NUM_PIDS		256



CVS commit: src/sys/arch/arm/include/arm32

2014-04-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Apr 16 07:29:52 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Make to flush the secondary cache when syncing PTEs when the Sheeva L2 cache
is used.


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.131 src/sys/arch/arm/include/arm32/pmap.h:1.132
--- src/sys/arch/arm/include/arm32/pmap.h:1.131	Fri Apr 11 04:19:47 2014
+++ src/sys/arch/arm/include/arm32/pmap.h	Wed Apr 16 07:29:52 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.131 2014/04/11 04:19:47 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.132 2014/04/16 07:29:52 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -503,8 +503,13 @@ extern int pmap_needs_pte_sync;
 static inline void
 pmap_ptesync(pt_entry_t *ptep, size_t cnt)
 {
-	if (PMAP_NEEDS_PTE_SYNC)
+	if (PMAP_NEEDS_PTE_SYNC) {
 		cpu_dcache_wb_range((vaddr_t)ptep, cnt * sizeof(pt_entry_t));
+#ifdef SHEEVA_L2_CACHE
+		cpu_sdcache_wb_range((vaddr_t)ptep, -1,
+		cnt * sizeof(pt_entry_t));
+#endif
+	}
 #if ARM_MMU_V7 > 0
 	__asm("dsb");
 #endif



CVS commit: src/sys/arch/arm/include/arm32

2014-04-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr  5 10:35:09 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: param.h

Log Message:
On second thoughts don't do the RPI hack for everyone.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/include/arm32/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/arm/include/arm32/param.h
diff -u src/sys/arch/arm/include/arm32/param.h:1.22 src/sys/arch/arm/include/arm32/param.h:1.23
--- src/sys/arch/arm/include/arm32/param.h:1.22	Sat Apr  5 10:28:18 2014
+++ src/sys/arch/arm/include/arm32/param.h	Sat Apr  5 10:35:09 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.22 2014/04/05 10:28:18 skrll Exp $	*/
+/*	$NetBSD: param.h,v 1.23 2014/04/05 10:35:09 skrll Exp $	*/
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe.
@@ -49,7 +49,7 @@
  * this file. */
 
 #ifndef PGSHIFT
-#if 0 && defined(_ARM_ARCH_6)
+#if defined(_ARM_ARCH_6)
 #define	PGSHIFT		13		/* LOG2(NBPG) */
 #else
 #define	PGSHIFT		12		/* LOG2(NBPG) */



CVS commit: src/sys/arch/arm/include/arm32

2014-04-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr  5 10:28:18 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: param.h

Log Message:
Drop down to 4KB pages on armv6 for now.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/arm/include/arm32/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/arm/include/arm32/param.h
diff -u src/sys/arch/arm/include/arm32/param.h:1.21 src/sys/arch/arm/include/arm32/param.h:1.22
--- src/sys/arch/arm/include/arm32/param.h:1.21	Sun Mar 30 15:50:51 2014
+++ src/sys/arch/arm/include/arm32/param.h	Sat Apr  5 10:28:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.21 2014/03/30 15:50:51 matt Exp $	*/
+/*	$NetBSD: param.h,v 1.22 2014/04/05 10:28:18 skrll Exp $	*/
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe.
@@ -49,7 +49,7 @@
  * this file. */
 
 #ifndef PGSHIFT
-#if defined(_ARM_ARCH_6)
+#if 0 && defined(_ARM_ARCH_6)
 #define	PGSHIFT		13		/* LOG2(NBPG) */
 #else
 #define	PGSHIFT		12		/* LOG2(NBPG) */



CVS commit: src/sys/arch/arm/include/arm32

2014-04-04 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Apr  4 16:12:28 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
For ARM_MMU_V6C enable supersections


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.129 src/sys/arch/arm/include/arm32/pmap.h:1.130
--- src/sys/arch/arm/include/arm32/pmap.h:1.129	Mon Mar 31 18:33:21 2014
+++ src/sys/arch/arm/include/arm32/pmap.h	Fri Apr  4 16:12:28 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.129 2014/03/31 18:33:21 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.130 2014/04/04 16:12:28 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -916,7 +916,7 @@ extern void (*pmap_zero_page_func)(paddr
 #define	L2_L_CACHE_MASK		L2_L_CACHE_MASK_generic
 #define	L2_S_CACHE_MASK		L2_S_CACHE_MASK_generic
 
-#define	L1_SS_PROTO		L1_SS_PROTO_generic
+#define	L1_SS_PROTO		L1_SS_PROTO_armv6
 #define	L1_S_PROTO		L1_S_PROTO_generic
 #define	L1_C_PROTO		L1_C_PROTO_generic
 #define	L2_S_PROTO		L2_S_PROTO_generic



CVS commit: src/sys/arch/arm/include/arm32

2014-03-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Mar 31 18:33:21 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Deal with large page mappings in l2pte_set.

Now the RPI can get passed setting the new TTB.

ok matt@


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.128 src/sys/arch/arm/include/arm32/pmap.h:1.129
--- src/sys/arch/arm/include/arm32/pmap.h:1.128	Mon Mar 31 01:48:37 2014
+++ src/sys/arch/arm/include/arm32/pmap.h	Mon Mar 31 18:33:21 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.128 2014/03/31 01:48:37 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.129 2014/03/31 18:33:21 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -545,14 +545,20 @@ l1pte_set(pt_entry_t *pdep, pt_entry_t p
 static inline void
 l2pte_set(pt_entry_t *ptep, pt_entry_t pte, pt_entry_t opte)
 {
-	for (size_t k = 0; k < PAGE_SIZE / L2_S_SIZE; k++) {
-		KASSERTMSG(*ptep == opte, "%#x [*%p] != %#x", *ptep, ptep, opte);
-		*ptep++ = pte;
-		pte += L2_S_SIZE;
-		if (opte)
-			opte += L2_S_SIZE;
+	if (l1pte_lpage_p(pte)) {
+		for (size_t k = 0; k < L2_L_SIZE / L2_S_SIZE; k++) {
+			*ptep++ = pte;
+		}
+	} else {
+		for (size_t k = 0; k < PAGE_SIZE / L2_S_SIZE; k++) {
+			KASSERTMSG(*ptep == opte, "%#x [*%p] != %#x", *ptep, ptep, opte);
+			*ptep++ = pte;
+			pte += L2_S_SIZE;
+			if (opte)
+opte += L2_S_SIZE;
+		}
 	}
-}   
+}
 
 static inline void
 l2pte_reset(pt_entry_t *ptep)



CVS commit: src/sys/arch/arm/include/arm32

2014-03-30 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 31 01:48:37 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h vmparam.h

Log Message:
For ARM_MMU_EXTENDED, a KERNEL_BASE >= 0x8000 is ok but a
VM_USER_MAXADDRESS can not be more than 0x8000 - PAGE_SIZE.


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/sys/arch/arm/include/arm32/pmap.h
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.127 src/sys/arch/arm/include/arm32/pmap.h:1.128
--- src/sys/arch/arm/include/arm32/pmap.h:1.127	Mon Mar 31 01:35:05 2014
+++ src/sys/arch/arm/include/arm32/pmap.h	Mon Mar 31 01:48:37 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.127 2014/03/31 01:35:05 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.128 2014/03/31 01:48:37 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -103,8 +103,8 @@
  * user and kernel, we can use the TTBR0/TTBR1 to have separate L1 tables for
  * user and kernel address spaces.
  */  
-#if KERNEL_BASE != 0x8000
-#error ARMv6 or later systems must have a KERNEL_BASE of 0x8000
+#if (KERNEL_BASE & 0x8000) == 0
+#error ARMv6 or later systems must have a KERNEL_BASE >= 0x8000
 #endif  
 #endif  /* ARM_MMU_EXTENDED */
 

Index: src/sys/arch/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.33 src/sys/arch/arm/include/arm32/vmparam.h:1.34
--- src/sys/arch/arm/include/arm32/vmparam.h:1.33	Wed Feb 26 16:16:18 2014
+++ src/sys/arch/arm/include/arm32/vmparam.h	Mon Mar 31 01:48:37 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.33 2014/02/26 16:16:18 martin Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.34 2014/03/31 01:48:37 matt Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -78,7 +78,11 @@
  * Mach derived constants
  */
 #define	VM_MIN_ADDRESS		((vaddr_t) PAGE_SIZE)
+#ifdef ARM_MMU_EXTENDED
+#define	VM_MAXUSER_ADDRESS	((vaddr_t) 0x8000 - PAGE_SIZE)
+#else
 #define	VM_MAXUSER_ADDRESS	((vaddr_t) KERNEL_BASE - PAGE_SIZE)
+#endif
 #define	VM_MAX_ADDRESS		VM_MAXUSER_ADDRESS
 
 #define	VM_MIN_KERNEL_ADDRESS	((vaddr_t) KERNEL_BASE)



CVS commit: src/sys/arch/arm/include/arm32

2014-03-30 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 31 01:35:05 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Add a missing 0 to an #error


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.126 src/sys/arch/arm/include/arm32/pmap.h:1.127
--- src/sys/arch/arm/include/arm32/pmap.h:1.126	Sun Mar 30 15:50:51 2014
+++ src/sys/arch/arm/include/arm32/pmap.h	Mon Mar 31 01:35:05 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.126 2014/03/30 15:50:51 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.127 2014/03/31 01:35:05 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -104,7 +104,7 @@
  * user and kernel address spaces.
  */  
 #if KERNEL_BASE != 0x8000
-#error ARMv6 or later systems must have a KERNEL_BASE of 0x800
+#error ARMv6 or later systems must have a KERNEL_BASE of 0x8000
 #endif  
 #endif  /* ARM_MMU_EXTENDED */
 



CVS commit: src/sys/arch/arm/include/arm32

2014-03-28 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Mar 28 21:51:59 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: machdep.h

Log Message:
Change arm_cpu_mbox to volatile


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/include/arm32/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/arm/include/arm32/machdep.h
diff -u src/sys/arch/arm/include/arm32/machdep.h:1.17 src/sys/arch/arm/include/arm32/machdep.h:1.18
--- src/sys/arch/arm/include/arm32/machdep.h:1.17	Sat Oct 20 14:42:20 2012
+++ src/sys/arch/arm/include/arm32/machdep.h	Fri Mar 28 21:51:59 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.h,v 1.17 2012/10/20 14:42:20 matt Exp $ */
+/* $NetBSD: machdep.h,v 1.18 2014/03/28 21:51:59 matt Exp $ */
 
 #ifndef _ARM32_BOOT_MACHDEP_H_
 #define _ARM32_BOOT_MACHDEP_H_
@@ -53,7 +53,7 @@ extern struct bootmem_info bootmem_info;
 extern char *booted_kernel;
 
 extern volatile uint32_t arm_cpu_hatched;
-extern uint32_t arm_cpu_mbox;
+extern volatile uint32_t arm_cpu_mbox;
 extern u_int arm_cpu_max;
 
 /* misc prototypes used by the many arm machdeps */



CVS commit: src/sys/arch/arm/include/arm32

2014-02-28 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Mar  1 05:28:23 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: db_machdep.h

Log Message:
Add db_show_tlb_cmd prototype


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/include/arm32/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/arm/include/arm32/db_machdep.h
diff -u src/sys/arch/arm/include/arm32/db_machdep.h:1.7 src/sys/arch/arm/include/arm32/db_machdep.h:1.8
--- src/sys/arch/arm/include/arm32/db_machdep.h:1.7	Sat Jan  5 15:06:51 2013
+++ src/sys/arch/arm/include/arm32/db_machdep.h	Sat Mar  1 05:28:23 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.h,v 1.7 2013/01/05 15:06:51 christos Exp $ */
+/* $NetBSD: db_machdep.h,v 1.8 2014/03/01 05:28:23 matt Exp $ */
 
 #ifndef _ARM32_DB_MACHDEP_H_
 #define _ARM32_DB_MACHDEP_H_
@@ -7,5 +7,8 @@
 
 void db_show_frame_cmd(db_expr_t, bool, db_expr_t, const char *);
 void db_show_fault_cmd(db_expr_t, bool, db_expr_t, const char *);
+#ifdef _KERNEL
+void db_show_tlb_cmd(db_expr_t, bool, db_expr_t, const char *);
+#endif
 
 #endif



CVS commit: src/sys/arch/arm/include/arm32

2014-02-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb 26 16:16:18 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
Revert previous - will fix userland with new sysctls for VM_MIN_ADDRESS/
VM_MAXADDESS.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.32 src/sys/arch/arm/include/arm32/vmparam.h:1.33
--- src/sys/arch/arm/include/arm32/vmparam.h:1.32	Wed Feb 26 11:00:40 2014
+++ src/sys/arch/arm/include/arm32/vmparam.h	Wed Feb 26 16:16:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.32 2014/02/26 11:00:40 martin Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.33 2014/02/26 16:16:18 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -45,7 +45,6 @@
  */
 
 #include 	/* pt_entry_t */
-#include 	/* PGSHIFT for PAGE_SIZE */
 
 #define	USRSTACK	VM_MAXUSER_ADDRESS
 



CVS commit: src/sys/arch/arm/include/arm32

2014-02-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb 26 11:00:40 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
Include param.h here - userland expects VM_* defines to work with just
this include, but PAGE_SIZE relies on PGSHIFT now, which is not defined
here.

Matt: please rearrange/cleanup differently if you prefer (but test build
src/tests/lib/libc/sys/t_mlock for example.)


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.31 src/sys/arch/arm/include/arm32/vmparam.h:1.32
--- src/sys/arch/arm/include/arm32/vmparam.h:1.31	Wed Feb 26 01:55:02 2014
+++ src/sys/arch/arm/include/arm32/vmparam.h	Wed Feb 26 11:00:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.31 2014/02/26 01:55:02 matt Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.32 2014/02/26 11:00:40 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -45,6 +45,7 @@
  */
 
 #include 	/* pt_entry_t */
+#include 	/* PGSHIFT for PAGE_SIZE */
 
 #define	USRSTACK	VM_MAXUSER_ADDRESS
 



CVS commit: src/sys/arch/arm/include/arm32

2014-02-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Feb 26 01:56:51 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: frame.h

Log Message:
Remove KERNEL_LOCK/KERNEL_UNLOCK


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/arm/include/arm32/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/arm/include/arm32/frame.h
diff -u src/sys/arch/arm/include/arm32/frame.h:1.38 src/sys/arch/arm/include/arm32/frame.h:1.39
--- src/sys/arch/arm/include/arm32/frame.h:1.38	Fri Dec 20 07:01:06 2013
+++ src/sys/arch/arm/include/arm32/frame.h	Wed Feb 26 01:56:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.38 2013/12/20 07:01:06 matt Exp $	*/
+/*	$NetBSD: frame.h,v 1.39 2014/02/26 01:56:51 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -133,22 +133,6 @@ void validate_trapframe(trapframe_t *, i
 #define	DO_PENDING_SOFTINTS		/* nothing */
 #endif
 
-#ifdef MULTIPROCESSOR
-#define	KERNEL_LOCK			\
-	mov	r0, #1			;\
-	mov	r1, #0			;\
-	bl	_C_LABEL(_kernel_lock)
-
-#define	KERNEL_UNLOCK			\
-	mov	r0, #1			;\
-	mov	r1, #0			;\
-	mov	r2, #0			;\
-	bl	_C_LABEL(_kernel_unlock)
-#else
-#define	KERNEL_LOCK			/* nothing */
-#define	KERNEL_UNLOCK			/* nothing */
-#endif
-
 #ifdef _ARM_ARCH_6
 #define	GET_CPSR(rb)			/* nothing */
 #define	CPSID_I(ra,rb)			cpsid	i
@@ -201,7 +185,7 @@ void validate_trapframe(trapframe_t *, i
 	ldr	r1, [r4, #CI_CTRL]	/* Fetch control register */	;\
 	mov	r0, #-1			;\
 	BL_CF_CONTROL(r2)		/* Enable alignment faults */	;\
-1:	KERNEL_LOCK
+1:	/* done */
 
 /*
  * This macro must be invoked just before PULLFRAMEFROMSVCANDEXIT or
@@ -236,7 +220,7 @@ void validate_trapframe(trapframe_t *, i
 	bl	_C_LABEL(ast)		/* ast(frame) */		;\
 	CPSID_I(r0, r5)			/* Disable interrupts */	;\
 	b	1b			/* Back around again */		;\
-3:	KERNEL_UNLOCK
+3:	/* done */
 
 #else	/* !EXEC_AOUT */
 
@@ -244,8 +228,8 @@ void validate_trapframe(trapframe_t *, i
 
 #define	ENABLE_ALIGNMENT_FAULTS		\
 	and	r7, r0, #(PSR_MODE)	/* Test for USR32 mode */	;\
-	GET_CURCPU(r4)			/* r4 = cpuinfo */		;\
-	KERNEL_LOCK
+	GET_CURCPU(r4)			/* r4 = cpuinfo */
+	
 
 #define	DO_AST_AND_RESTORE_ALIGNMENT_FAULTS\
 	DO_PENDING_SOFTINTS		;\
@@ -263,7 +247,7 @@ void validate_trapframe(trapframe_t *, i
 	bl	_C_LABEL(ast)		/* ast(frame) */		;\
 	CPSID_I(r0, r5)			/* Disable interrupts */	;\
 	b	1b			;\
-2:	KERNEL_UNLOCK			/* unlock the kernel */
+2:	/* done */
 #endif /* EXEC_AOUT */
 
 #ifndef _ARM_ARCH_6



CVS commit: src/sys/arch/arm/include/arm32

2014-02-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Feb 26 01:55:02 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
Use PAGE_SIZE instead of 1000


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.30 src/sys/arch/arm/include/arm32/vmparam.h:1.31
--- src/sys/arch/arm/include/arm32/vmparam.h:1.30	Fri Feb 21 22:05:58 2014
+++ src/sys/arch/arm/include/arm32/vmparam.h	Wed Feb 26 01:55:02 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.30 2014/02/21 22:05:58 skrll Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.31 2014/02/26 01:55:02 matt Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -77,12 +77,12 @@
 /*
  * Mach derived constants
  */
-#define	VM_MIN_ADDRESS		((vaddr_t) 0x1000)
-#define	VM_MAXUSER_ADDRESS	((vaddr_t) KERNEL_BASE - 0x1000)
+#define	VM_MIN_ADDRESS		((vaddr_t) PAGE_SIZE)
+#define	VM_MAXUSER_ADDRESS	((vaddr_t) KERNEL_BASE - PAGE_SIZE)
 #define	VM_MAX_ADDRESS		VM_MAXUSER_ADDRESS
 
 #define	VM_MIN_KERNEL_ADDRESS	((vaddr_t) KERNEL_BASE)
-#define	VM_MAX_KERNEL_ADDRESS	((vaddr_t) 0xefff)
+#define	VM_MAX_KERNEL_ADDRESS	((vaddr_t) -(PAGE_SIZE+1))
 
 #ifndef __ASSEMBLER__
 /* XXX max. amount of KVM to be used by buffers. */



CVS commit: src/sys/arch/arm/include/arm32

2014-02-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Feb 26 01:53:23 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: pte.h

Log Message:
Add XN bit L2 large pages.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pte.h
diff -u src/sys/arch/arm/include/arm32/pte.h:1.14 src/sys/arch/arm/include/arm32/pte.h:1.15
--- src/sys/arch/arm/include/arm32/pte.h:1.14	Sat Feb 22 20:46:35 2014
+++ src/sys/arch/arm/include/arm32/pte.h	Wed Feb 26 01:53:23 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pte.h,v 1.14 2014/02/22 20:46:35 matt Exp $	*/
+/*	$NetBSD: pte.h,v 1.15 2014/02/26 01:53:23 matt Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -227,6 +227,7 @@ typedef uint32_t	pt_entry_t;	/* L2 table
 #define	L2_XS_nG	0x0800	/* ARMv6 Not-Global */
 #define	L2_V6_L_TEX	L2_XS_L_TEX
 #define	L2_V6_XS_TEX	L2_XS_T_TEX
+#define	L2_XS_L_XN	0x8000	/* ARMv6 eXecute Never */
 
 
 /*
@@ -239,7 +240,7 @@ typedef uint32_t	pt_entry_t;	/* L2 table
  * Access Permissions for L1 and L2 of ARMv6 with XP=1 and ARMv7
  */
 #define	AP_R		0x01		/* readable */
-#define	AP_RO		0x20		/* read-only */
+#define	AP_RO		0x20		/* read-only (L2_XS_APX >> 4) */
 
 /*
  * Short-hand for common AP_* constants.



CVS commit: src/sys/arch/arm/include/arm32

2014-02-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Feb 26 01:51:51 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Remove duplicate PMAP_PTE


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.124 src/sys/arch/arm/include/arm32/pmap.h:1.125
--- src/sys/arch/arm/include/arm32/pmap.h:1.124	Wed Feb 26 01:45:33 2014
+++ src/sys/arch/arm/include/arm32/pmap.h	Wed Feb 26 01:51:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.124 2014/02/26 01:45:33 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.125 2014/02/26 01:51:51 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -351,7 +351,6 @@ bool	pmap_extract(pmap_t, vaddr_t, paddr
 #define	PMAP_NEED_PROCWR
 #define PMAP_GROWKERNEL		/* turn on pmap_growkernel interface */
 #define	PMAP_ENABLE_PMAP_KMPAGE	/* enable the PMAP_KMPAGE flag */
-#define PMAP_PTE		0x0100	/* Use PTE cache settings */
 
 #if (ARM_MMU_V6 + ARM_MMU_V7) > 0
 #define	PMAP_PREFER(hint, vap, sz, td)	pmap_prefer((hint), (vap), (td))



CVS commit: src/sys/arch/arm/include/arm32

2014-02-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Feb 26 01:45:33 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Replace 1000 with PAGE_SIZE


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.123 src/sys/arch/arm/include/arm32/pmap.h:1.124
--- src/sys/arch/arm/include/arm32/pmap.h:1.123	Wed Feb 26 01:03:03 2014
+++ src/sys/arch/arm/include/arm32/pmap.h	Wed Feb 26 01:45:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.123 2014/02/26 01:03:03 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.124 2014/02/26 01:45:33 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -80,6 +80,30 @@
 #include 
 #endif
 
+#ifdef ARM_MMU_EXTENDED
+#define PMAP_TLB_MAX			1
+#define PMAP_TLB_HWPAGEWALKER		1
+#define PMAP_TLB_NUM_PIDS		256
+#define cpu_set_tlb_info(ci, ti)((void)((ci)->ci_tlb_info = (ti)))
+#if PMAP_TLB_MAX > 1
+#define cpu_tlb_info(ci)		((ci)->ci_tlb_info)
+#else
+#define cpu_tlb_info(ci)		(&pmap_tlb0_info)
+#endif
+#define pmap_md_tlb_asid_max()		(PMAP_TLB_NUM_PIDS - 1)
+#include 
+#include 
+
+/* 
+ * If we have an EXTENDED MMU and the address space is split evenly between
+ * user and kernel, we can use the TTBR0/TTBR1 to have separate L1 tables for
+ * user and kernel address spaces.
+ */  
+#if KERNEL_BASE != 0x8000
+#error ARMv6 or later systems must have a KERNEL_BASE of 0x800
+#endif  
+#endif  /* ARM_MMU_EXTENDED */
+
 /*
  * a pmap describes a processes' 4GB virtual address space.  this
  * virtual address space can be broken up into 4096 1MB regions which
@@ -111,6 +135,8 @@
  * space per l2_dtable. Most processes will, therefore, require only two or
  * three of these to map their whole working set.
  */
+#define	L2_BUCKET_XLOG2	(L1_S_SHIFT)
+#define L2_BUCKET_XSIZE	(1 << L2_BUCKET_XLOG2)
 #define	L2_BUCKET_LOG2	4
 #define	L2_BUCKET_SIZE	(1 << L2_BUCKET_LOG2)
 
@@ -119,7 +145,7 @@
  * of l2_dtable structures required to track all possible page descriptors
  * mappable by an L1 translation table is given by the following constants:
  */
-#define	L2_LOG2		((32 - L1_S_SHIFT) - L2_BUCKET_LOG2)
+#define	L2_LOG2		(32 - (L2_BUCKET_XLOG2 + L2_BUCKET_LOG2))
 #define	L2_SIZE		(1 << L2_LOG2)
 
 /*
@@ -134,6 +160,7 @@
 
 #ifndef _LOCORE
 
+#ifndef PMAP_MMU_EXTENDED
 struct l1_ttable;
 struct l2_dtable;
 
@@ -165,6 +192,7 @@ union pmap_cache_state {
  * Assigned to cs_all to force cacheops to work for a particular pmap
  */
 #define	PMAP_CACHE_STATE_ALL	0xu
+#endif /* !ARM_MMU_EXTENDED */
 
 /*
  * This structure is used by machine-dependent code to describe
@@ -182,21 +210,38 @@ struct pmap_devmap {
  * The pmap structure itself
  */
 struct pmap {
-	uint8_t			pm_domain;
-	bool			pm_remove_all;
-	bool			pm_activated;
-	struct l1_ttable	*pm_l1;
-#ifndef ARM_HAS_VBAR
-	pd_entry_t		*pm_pl1vec;
-#endif
-	pd_entry_t		pm_l1vec;
-	union pmap_cache_state	pm_cstate;
 	struct uvm_object	pm_obj;
 	kmutex_t		pm_obj_lock;
 #define	pm_lock pm_obj.vmobjlock
+#ifndef ARM_HAS_VBAR
+	pd_entry_t		*pm_pl1vec;
+	pd_entry_t		pm_l1vec;
+#endif
 	struct l2_dtable	*pm_l2[L2_SIZE];
 	struct pmap_statistics	pm_stats;
 	LIST_ENTRY(pmap)	pm_list;
+#ifdef ARM_MMU_EXTENDED
+	pd_entry_t		*pm_l1;
+	paddr_t			pm_l1_pa;
+	bool			pm_remove_all;
+#ifdef MULTIPROCESSOR
+	kcpuset_t		*pm_onproc;
+	kcpuset_t		*pm_active;
+	struct pmap_asid_info	pm_pai[2];
+#else
+	struct pmap_asid_info	pm_pai[1];
+#endif
+#else
+	struct l1_ttable	*pm_l1;
+	union pmap_cache_state	pm_cstate;
+	uint8_t			pm_domain;
+	bool			pm_activated;
+	bool			pm_remove_all;
+#endif
+};
+
+struct pmap_kernel {
+	struct pmap		kernel_pmap;
 };
 
 /*
@@ -306,6 +351,7 @@ bool	pmap_extract(pmap_t, vaddr_t, paddr
 #define	PMAP_NEED_PROCWR
 #define PMAP_GROWKERNEL		/* turn on pmap_growkernel interface */
 #define	PMAP_ENABLE_PMAP_KMPAGE	/* enable the PMAP_KMPAGE flag */
+#define PMAP_PTE		0x0100	/* Use PTE cache settings */
 
 #if (ARM_MMU_V6 + ARM_MMU_V7) > 0
 #define	PMAP_PREFER(hint, vap, sz, td)	pmap_prefer((hint), (vap), (td))
@@ -324,6 +370,7 @@ void	pmap_bootstrap(vaddr_t, vaddr_t);
 
 void	pmap_do_remove(pmap_t, vaddr_t, vaddr_t, int);
 int	pmap_fault_fixup(pmap_t, vaddr_t, vm_prot_t, int);
+int	pmap_prefetchabt_fixup(void *);
 bool	pmap_get_pde_pte(pmap_t, vaddr_t, pd_entry_t **, pt_entry_t **);
 bool	pmap_get_pde(pmap_t, vaddr_t, pd_entry_t **);
 struct pcb;
@@ -371,6 +418,8 @@ vtopte(vaddr_t va)
 	pd_entry_t *pdep;
 	pt_entry_t *ptep;
 
+	KASSERT(trunc_page(va) == va);
+
 	if (pmap_get_pde_pte(pmap_kernel(), va, &pdep, &ptep) == false)
 		return (NULL);
 	return (ptep);
@@ -437,32 +486,63 @@ pmap_ptesync(pt_entry_t *ptep, size_t cn
 #endif
 }
 
-#define	PTE_SYNC(ptep)			pmap_ptesync((ptep), 1)
+#define	PDE_SYNC(pdep)			pma

CVS commit: src/sys/arch/arm/include/arm32

2014-02-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Feb 26 01:03:03 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Add PMAP_PTE flag.  (map page so it can be used as a PDE or PTE page)


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.122 src/sys/arch/arm/include/arm32/pmap.h:1.123
--- src/sys/arch/arm/include/arm32/pmap.h:1.122	Sun Aug 18 05:01:47 2013
+++ src/sys/arch/arm/include/arm32/pmap.h	Wed Feb 26 01:03:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.122 2013/08/18 05:01:47 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.123 2014/02/26 01:03:03 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -294,6 +294,8 @@ u_int arm32_mmap_flags(paddr_t);
 #define ARM32_MMAP_CACHEABLE		0x2000
 #define pmap_mmap_flags(ppn)			arm32_mmap_flags(ppn)
 
+#define	PMAP_PTE			0x1000 /* kenter_pa */
+
 /*
  * Functions that we need to export
  */



CVS commit: src/sys/arch/arm/include/arm32

2014-02-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 22 20:46:35 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: pte.h

Log Message:
Add L1_TABLE_SIZE_REAL


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pte.h
diff -u src/sys/arch/arm/include/arm32/pte.h:1.13 src/sys/arch/arm/include/arm32/pte.h:1.14
--- src/sys/arch/arm/include/arm32/pte.h:1.13	Tue Sep 11 15:28:14 2012
+++ src/sys/arch/arm/include/arm32/pte.h	Sat Feb 22 20:46:35 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pte.h,v 1.13 2012/09/11 15:28:14 matt Exp $	*/
+/*	$NetBSD: pte.h,v 1.14 2014/02/22 20:46:35 matt Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -137,6 +137,7 @@ typedef uint32_t	pt_entry_t;	/* L2 table
  * keep the old L2_TABLE_SIZE define lying around. Converted ports
  * should use L2_TABLE_SIZE_REAL until then.
  */
+#define	L1_TABLE_SIZE_REAL	0x4000	/* 16K */
 #define	L2_TABLE_SIZE_REAL	0x400	/* 1K */
 
 /*



CVS commit: src/sys/arch/arm/include/arm32

2014-02-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Feb 21 22:05:58 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
Remove unnecessary include of sys/simplelock.h


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.29 src/sys/arch/arm/include/arm32/vmparam.h:1.30
--- src/sys/arch/arm/include/arm32/vmparam.h:1.29	Wed Feb 27 17:50:07 2013
+++ src/sys/arch/arm/include/arm32/vmparam.h	Fri Feb 21 22:05:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.29 2013/02/27 17:50:07 matt Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.30 2014/02/21 22:05:58 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -44,9 +44,6 @@
  * Virtual Memory parameters common to all arm32 platforms.
  */
 
-#ifndef __ASSEMBLER__
-#include 	/* struct simplelock */ 
-#endif /* __ASSEMBLER__ */
 #include 	/* pt_entry_t */
 
 #define	USRSTACK	VM_MAXUSER_ADDRESS



CVS commit: src/sys/arch/arm/include/arm32

2013-12-19 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Dec 20 07:01:06 UTC 2013

Modified Files:
src/sys/arch/arm/include/arm32: frame.h

Log Message:
When restoring SPRSR, use spsr_fsxc not spsr_all so bits[23-8] are restored.
This should fix use of simd instructions that rely on the GE bits.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/arm/include/arm32/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/arm/include/arm32/frame.h
diff -u src/sys/arch/arm/include/arm32/frame.h:1.37 src/sys/arch/arm/include/arm32/frame.h:1.38
--- src/sys/arch/arm/include/arm32/frame.h:1.37	Mon Dec  2 18:36:10 2013
+++ src/sys/arch/arm/include/arm32/frame.h	Fri Dec 20 07:01:06 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.37 2013/12/02 18:36:10 joerg Exp $	*/
+/*	$NetBSD: frame.h,v 1.38 2013/12/20 07:01:06 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -411,7 +411,7 @@ LOCK_CAS_DEBUG_LOCALS
 
 #define PULLFRAME			   \
 	ldr r0, [sp], #TF_R0;	/* Pop the SPSR from stack */	   \
-	msr spsr_all, r0;		   \
+	msr spsr_fsxc, r0;		   \
 	ldmia   sp, {r0-r14}^;		/* Restore registers (usr mode) */ \
 	mov r0, r0; /* NOP for previous instruction */ \
 	add	sp, sp, #(TF_PC-TF_R0);	/* Adjust the stack pointer */	   \
@@ -464,7 +464,7 @@ LOCK_CAS_DEBUG_LOCALS
 	str	r0, [r2, #-4]!;		/* Push return address */	   \
 	stmdb	r2!, {sp, lr};		/* Push SVC sp, lr */		   \
 	mov	sp, r2;			/* Keep stack aligned */	   \
-	msr spsr_all, r3;		/* Restore correct spsr */	   \
+	msr spsr_fsxc, r3;		/* Restore correct spsr */	   \
 	ldmdb	r1, {r0-r3};		/* Restore 4 regs from xxx mode */ \
 	sub	sp, sp, #(TF_SVC_SP-TF_R0); /* Adjust the stack pointer */ \
 	PUSHUSERREGS;			/* Push the user mode registers */ \
@@ -481,7 +481,7 @@ LOCK_CAS_DEBUG_LOCALS
 
 #define PULLFRAMEFROMSVCANDEXIT		   \
 	ldr r0, [sp], #0x0008;	/* Pop the SPSR from stack */	   \
-	msr spsr_all, r0;		/* restore SPSR */		   \
+	msr spsr_fsxc, r0;		/* restore SPSR */		   \
 	ldmia   sp, {r0-r14}^;		/* Restore registers (usr mode) */ \
 	mov r0, r0;	  		/* NOP for previous instruction */ \
 	add	sp, sp, #(TF_SVC_SP-TF_R0); /* Adjust the stack pointer */ \



CVS commit: src/sys/arch/arm/include/arm32

2013-08-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Aug 18 06:37:02 UTC 2013

Modified Files:
src/sys/arch/arm/include/arm32: frame.h

Log Message:
Use blx ip if _ARM_ARCH_5
prepare to get of switchframe


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arm/include/arm32/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/arm/include/arm32/frame.h
diff -u src/sys/arch/arm/include/arm32/frame.h:1.35 src/sys/arch/arm/include/arm32/frame.h:1.36
--- src/sys/arch/arm/include/arm32/frame.h:1.35	Sun Oct 21 15:46:00 2012
+++ src/sys/arch/arm/include/arm32/frame.h	Sun Aug 18 06:37:02 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.35 2012/10/21 15:46:00 matt Exp $	*/
+/*	$NetBSD: frame.h,v 1.36 2013/08/18 06:37:02 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -51,14 +51,6 @@
 #ifndef _LOCORE
 
 /*
- * System stack frames.
- */
-
-struct clockframe {
-	struct trapframe cf_tf;
-};
-
-/*
  * Switch frame.
  *
  * Should be a multiple of 8 bytes for dumpsys.
@@ -74,6 +66,14 @@ struct switchframe {
 };
  
 /*
+ * System stack frames.
+ */
+
+struct clockframe {
+	struct trapframe cf_tf;
+};
+
+/*
  * Stack frame. Used during stack traces (db_trace.c)
  */
 struct frame {
@@ -96,16 +96,33 @@ void validate_trapframe(trapframe_t *, i
 #include "opt_arm_debug.h"
 #include "opt_cputypes.h"
 
-#include 
+#include 
 
 /*
  * This macro is used by DO_AST_AND_RESTORE_ALIGNMENT_FAULTS to process
  * any pending softints.
  */
+#ifdef _ARM_ARCH_4T
+#define	B_CF_CONTROL(rX)		;\
+	ldr	ip, [rX, #CF_CONTROL]	/* get function addr */		;\
+	bx	ip			/* branch to cpu_control */
+#else
+#define	B_CF_CONTROL(rX)		;\
+	ldr	pc, [rX, #CF_CONTROL]	/* branch to cpu_control */
+#endif
+#ifdef _ARM_ARCH_5T
+#define	BL_CF_CONTROL(rX)		;\
+	ldr	ip, [rX, #CF_CONTROL]	/* get function addr */		;\
+	blx	ip			/* call cpu_control */
+#else
+#define	BL_CF_CONTROL(rX)		;\
+	mov	lr, pc			;\
+	ldr	pc, [rX, #CF_CONTROL]	/* call cpu_control */
+#endif
 #if defined(__HAVE_FAST_SOFTINTS) && !defined(__HAVE_PIC_FAST_SOFTINTS)
 #define	DO_PENDING_SOFTINTS		\
 	ldr	r0, [r4, #CI_INTR_DEPTH]/* Get current intr depth */	;\
-	teq	r0, #0			/* Test for 0. */		;\
+	cmp	r0, #0			/* Test for 0. */		;\
 	bne	10f			/*   skip softints if != 0 */	;\
 	ldr	r0, [r4, #CI_CPL]	/* Get current priority level */;\
 	ldr	r1, [r4, #CI_SOFTINTS]	/* Get pending softint mask */	;\
@@ -183,8 +200,7 @@ void validate_trapframe(trapframe_t *, i
 	ldr	r2, .Laflt_cpufuncs	;\
 	ldr	r1, [r4, #CI_CTRL]	/* Fetch control register */	;\
 	mov	r0, #-1			;\
-	mov	lr, pc			;\
-	ldr	pc, [r2, #CF_CONTROL]	/* Enable alignment faults */	;\
+	BL_CF_CONTROL(r2)		/* Enable alignment faults */	;\
 1:	KERNEL_LOCK
 
 /*
@@ -211,7 +227,7 @@ void validate_trapframe(trapframe_t *, i
 	mov	r0, #-1			;\
 	bic	r1, r1, #CPU_CONTROL_AFLT_ENABLE  /* Disable AFLTs */	;\
 	adr	lr, 3f			;\
-	ldr	pc, [r2, #CF_CONTROL]	/* Set new CTRL reg value */	;\
+	B_CF_CONTROL(r2)		/* Set new CTRL reg value */	;\
 	/* NOTREACHED */		\
 2:	mov	r1, #0x		;\
 	str	r1, [r4, #CI_ASTPENDING] /* Clear astpending */		;\
@@ -352,6 +368,43 @@ LOCK_CAS_DEBUG_LOCALS
 	str	r0, [sp, #(-TF_R4)]!	/* Push the CPSR on the stack */
 
 /*
+ * Push a trapframe to be used by cpu_switchto
+ */
+#define PUSHSWITCHFRAME(rX)		\
+	mov	ip, sp;			\
+	sub	sp, sp, #(TRAPFRAMESIZE-TF_R12); /* Adjust the stack pointer */ \
+	push	{r4-r11};		/* Push the callee saved registers */ \
+	sub	sp, sp, #TF_R4;		/* reserve rest of trapframe */	\
+	str	ip, [sp, #TF_SVC_SP];	\
+	str	lr, [sp, #TF_SVC_LR];	\
+	str	lr, [sp, #TF_PC];	\
+	mrs	rX, cpsr_all;		/* Get the CPSR */		\
+	str	rX, [sp, #TF_SPSR]	/* save in trapframe */
+
+#define PUSHSWITCHFRAME1		   \
+	mov	ip, sp;			   \
+	sub	sp, sp, #(TRAPFRAMESIZE-TF_R8); /* Adjust the stack pointer */ \
+	push	{r4-r7};		/* Push some of the callee saved registers */ \
+	sub	sp, sp, #TF_R4;		/* reserve rest of trapframe */	\
+	str	ip, [sp, #TF_SVC_SP];	\
+	str	lr, [sp, #TF_SVC_LR];	\
+	str	lr, [sp, #TF_PC]
+
+#if defined(_ARM_ARCH_DWORD_OK) && __ARM_EABI__
+#define	PUSHSWITCHFRAME2		\
+	strd	r10, [sp, #TF_R10];	/* save r10 & r11 */		\
+	strd	r8, [sp, #TF_R8];	/* save r8 & r9 */		\
+	mrs	r0, cpsr_all;		/* Get the CPSR */		\
+	str	r0, [sp, #TF_SPSR]	/* save in trapframe */
+#else
+#define	PUSHSWITCHFRAME2		\
+	add	r0, sp, #TF_R8;		/* get ptr to r8 and above */	\
+	stmia	r0, {r8-r11};		/* save rest of registers */	\
+	mrs	r0, cpsr_all;		/* Get the CPSR */		\
+	str	r0, [sp, #TF_SPSR]	/* save in trapframe */
+#endif
+
+/*
  * PULLFRAME - macro to pull a trap frame from the stack in the current mode
  * Since the current mode is used, the SVC lr field is ignored.
  */
@@ -371,6 +424,15 @@ LOCK_CAS_DEBUG_LOCALS
  	ldr	lr, [sp], #4		/* Pop the return address */
 
 /*
+ * Pop a trapfram

CVS commit: src/sys/arch/arm/include/arm32

2013-08-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Aug 18 05:01:47 UTC 2013

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
struct pcb; for a function prototype.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.121 src/sys/arch/arm/include/arm32/pmap.h:1.122
--- src/sys/arch/arm/include/arm32/pmap.h:1.121	Wed Jul  3 21:37:35 2013
+++ src/sys/arch/arm/include/arm32/pmap.h	Sun Aug 18 05:01:47 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.121 2013/07/03 21:37:35 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.122 2013/08/18 05:01:47 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -324,6 +324,7 @@ void	pmap_do_remove(pmap_t, vaddr_t, vad
 int	pmap_fault_fixup(pmap_t, vaddr_t, vm_prot_t, int);
 bool	pmap_get_pde_pte(pmap_t, vaddr_t, pd_entry_t **, pt_entry_t **);
 bool	pmap_get_pde(pmap_t, vaddr_t, pd_entry_t **);
+struct pcb;
 void	pmap_set_pcb_pagedir(pmap_t, struct pcb *);
 
 void	pmap_debug(int);



CVS commit: src/sys/arch/arm/include/arm32

2013-05-29 Thread Radoslaw Kujawa
Module Name:src
Committed By:   rkujawa
Date:   Wed May 29 23:29:44 UTC 2013

Modified Files:
src/sys/arch/arm/include/arm32: param.h

Log Message:
Explicitely cast to unsigned. Avoid bugs caused by misintepreting the result as
signed.

riastradh@ suggested to change these macros into static inline functions.
But I'm still not convinced...

Obtained from Marvell, Semihalf.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/include/arm32/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/arm/include/arm32/param.h
diff -u src/sys/arch/arm/include/arm32/param.h:1.19 src/sys/arch/arm/include/arm32/param.h:1.20
--- src/sys/arch/arm/include/arm32/param.h:1.19	Wed Mar 20 13:43:39 2013
+++ src/sys/arch/arm/include/arm32/param.h	Wed May 29 23:29:44 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.19 2013/03/20 13:43:39 skrll Exp $	*/
+/*	$NetBSD: param.h,v 1.20 2013/05/29 23:29:44 rkujawa Exp $	*/
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe.
@@ -89,8 +89,8 @@
 #define USPACE_SVC_STACK_TOP		(USPACE)
 #define USPACE_SVC_STACK_BOTTOM		(sizeof(struct pcb))
 
-#define arm_btop(x)			((x) >> PGSHIFT)
-#define arm_ptob(x)			((x) << PGSHIFT)
+#define arm_btop(x)			((unsigned)(x) >> PGSHIFT)
+#define arm_ptob(x)			((unsigned)(x) << PGSHIFT)
 #define arm_trunc_page(x)		((unsigned)(x) & ~PGOFSET)
 
 #ifdef _KERNEL



CVS commit: src/sys/arch/arm/include/arm32

2013-03-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Mar 20 13:43:39 UTC 2013

Modified Files:
src/sys/arch/arm/include/arm32: param.h

Log Message:
Bump MSGBUFSIZE on arm ports to 16KB.

OK matt@


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/include/arm32/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/arm/include/arm32/param.h
diff -u src/sys/arch/arm/include/arm32/param.h:1.18 src/sys/arch/arm/include/arm32/param.h:1.19
--- src/sys/arch/arm/include/arm32/param.h:1.18	Fri Dec  7 18:46:50 2012
+++ src/sys/arch/arm/include/arm32/param.h	Wed Mar 20 13:43:39 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.18 2012/12/07 18:46:50 matt Exp $	*/
+/*	$NetBSD: param.h,v 1.19 2013/03/20 13:43:39 skrll Exp $	*/
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe.
@@ -57,7 +57,7 @@
 #define USPACE  (UPAGES * NBPG) /* total size of u-area */
 
 #ifndef MSGBUFSIZE
-#define MSGBUFSIZE	NBPG		/* default message buffer size */
+#define MSGBUFSIZE	16384	 	/* default message buffer size */
 #endif
 
 /*



CVS commit: src/sys/arch/arm/include/arm32

2013-02-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Feb 27 17:50:07 UTC 2013

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
Define PAGESHIFT using PGSHIFT


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.28 src/sys/arch/arm/include/arm32/vmparam.h:1.29
--- src/sys/arch/arm/include/arm32/vmparam.h:1.28	Mon Feb 25 16:12:13 2013
+++ src/sys/arch/arm/include/arm32/vmparam.h	Wed Feb 27 17:50:07 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.28 2013/02/25 16:12:13 matt Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.29 2013/02/27 17:50:07 matt Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -73,7 +73,7 @@
  * While the ARM architecture defines Section mappings, large pages,
  * and small pages, the standard page size is (and will always be) 4K.
  */
-#define	PAGE_SHIFT	12
+#define	PAGE_SHIFT	PGSHIFT
 #define	PAGE_SIZE	(1 << PAGE_SHIFT)
 #define	PAGE_MASK	(PAGE_SIZE - 1)
 



CVS commit: src/sys/arch/arm/include/arm32

2013-02-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Feb 25 16:12:13 UTC 2013

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
Bump max text/data/stack sizes to more reasonable values.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.27 src/sys/arch/arm/include/arm32/vmparam.h:1.28
--- src/sys/arch/arm/include/arm32/vmparam.h:1.27	Thu Aug 16 07:25:37 2012
+++ src/sys/arch/arm/include/arm32/vmparam.h	Mon Feb 25 16:12:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.27 2012/08/16 07:25:37 matt Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.28 2013/02/25 16:12:13 matt Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -55,18 +55,18 @@
  * Note that MAXTSIZ can't be larger than 32M, otherwise the compiler
  * would have to be changed to not generate "bl" instructions.
  */
-#define	MAXTSIZ		(16*1024*1024)		/* max text size */
+#define	MAXTSIZ		(64*1024*1024)		/* max text size */
 #ifndef	DFLDSIZ
 #define	DFLDSIZ		(128*1024*1024)		/* initial data size limit */
 #endif
 #ifndef	MAXDSIZ
-#define	MAXDSIZ		(512*1024*1024)		/* max data size */
+#define	MAXDSIZ		(1024*1024*1024)	/* max data size */
 #endif
 #ifndef	DFLSSIZ
 #define	DFLSSIZ		(2*1024*1024)		/* initial stack size limit */
 #endif
 #ifndef	MAXSSIZ
-#define	MAXSSIZ		(8*1024*1024)		/* max stack size */
+#define	MAXSSIZ		(32*1024*1024)		/* max stack size */
 #endif
 
 /*



CVS commit: src/sys/arch/arm/include/arm32

2012-12-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 12 15:09:37 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Protect more definitions with #ifndef _LOCORE


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.118 src/sys/arch/arm/include/arm32/pmap.h:1.119
--- src/sys/arch/arm/include/arm32/pmap.h:1.118	Wed Dec 12 00:29:17 2012
+++ src/sys/arch/arm/include/arm32/pmap.h	Wed Dec 12 15:09:37 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.118 2012/12/12 00:29:17 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.119 2012/12/12 15:09:37 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -890,6 +890,7 @@ extern void (*pmap_zero_page_func)(paddr
 #define	L2_L_MAPPABLE_P(va, pa, size)	\
 	va) | (pa)) & L2_L_OFFSET) == 0 && (size) >= L2_L_SIZE)
 
+#ifndef _LOCORE
 /*
  * Hooks for the pool allocator.
  */
@@ -906,8 +907,6 @@ struct vm_page *arm_pmap_alloc_poolpage(
 ((paddr_t)((vaddr_t)(va) - KERNEL_BASE + physical_start))
 #endif
 
-#ifndef _LOCORE
-
 /*
  * pmap-specific data store in the vm_page structure.
  */



CVS commit: src/sys/arch/arm/include/arm32

2012-12-11 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 12 00:29:20 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Enable direct-mapped poolpages if __HAVE_MM_MD_DIRECT_MAPPED_PHYS is defined.


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.117 src/sys/arch/arm/include/arm32/pmap.h:1.118
--- src/sys/arch/arm/include/arm32/pmap.h:1.117	Mon Dec 10 08:19:59 2012
+++ src/sys/arch/arm/include/arm32/pmap.h	Wed Dec 12 00:29:17 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.117 2012/12/10 08:19:59 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.118 2012/12/12 00:29:17 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -898,6 +898,8 @@ extern paddr_t physical_start, physical_
 #ifdef PMAP_NEED_ALLOC_POOLPAGE
 struct vm_page *arm_pmap_alloc_poolpage(int);
 #define	PMAP_ALLOC_POOLPAGE	arm_pmap_alloc_poolpage
+#endif
+#if defined(PMAP_NEED_ALLOC_POOLPAGE) || defined(__HAVE_MM_MD_DIRECT_MAPPED_PHYS)
 #define	PMAP_MAP_POOLPAGE(pa) \
 ((vaddr_t)((paddr_t)(pa) - physical_start + KERNEL_BASE))
 #define PMAP_UNMAP_POOLPAGE(va) \



CVS commit: src/sys/arch/arm/include/arm32

2012-12-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Dec 10 08:19:59 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Add b{zero,copy}_page{,_vfp} and physical_end


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.116 src/sys/arch/arm/include/arm32/pmap.h:1.117
--- src/sys/arch/arm/include/arm32/pmap.h:1.116	Mon Dec 10 06:53:52 2012
+++ src/sys/arch/arm/include/arm32/pmap.h	Mon Dec 10 08:19:59 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.116 2012/12/10 06:53:52 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.117 2012/12/10 08:19:59 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -463,13 +463,16 @@ pmap_ptesync(pt_entry_t *ptep, size_t cn
 #define KERNEL_PD_SIZE	\
 	(L1_TABLE_SIZE - (KERNEL_BASE >> L1_S_SHIFT) * sizeof(pd_entry_t))
 
-/* ARM MMU configuration */
+void	bzero_page(vaddr_t);
+void	bcopy_page(vaddr_t, vaddr_t);
 
 #ifdef FPU_VFP
-void	pmap_copy_page_vfp(paddr_t, paddr_t);
-void	pmap_zero_page_vfp(paddr_t);
+void	bzero_page_vfp(vaddr_t);
+void	bcopy_page_vfp(vaddr_t, vaddr_t);
 #endif
 
+/* ARM MMU configuration */
+
 #if (ARM_MMU_GENERIC + ARM_MMU_SA1 + ARM_MMU_V6 + ARM_MMU_V7) != 0
 void	pmap_copy_page_generic(paddr_t, paddr_t);
 void	pmap_zero_page_generic(paddr_t);
@@ -891,8 +894,8 @@ extern void (*pmap_zero_page_func)(paddr
  * Hooks for the pool allocator.
  */
 #define	POOL_VTOPHYS(va)	vtophys((vaddr_t) (va))
+extern paddr_t physical_start, physical_end;
 #ifdef PMAP_NEED_ALLOC_POOLPAGE
-extern paddr_t physical_start;
 struct vm_page *arm_pmap_alloc_poolpage(int);
 #define	PMAP_ALLOC_POOLPAGE	arm_pmap_alloc_poolpage
 #define	PMAP_MAP_POOLPAGE(pa) \



CVS commit: src/sys/arch/arm/include/arm32

2012-12-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Dec 10 06:53:52 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Add pmap_{copy,zero}_page_vfp


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.115 src/sys/arch/arm/include/arm32/pmap.h:1.116
--- src/sys/arch/arm/include/arm32/pmap.h:1.115	Mon Nov 12 18:00:37 2012
+++ src/sys/arch/arm/include/arm32/pmap.h	Mon Dec 10 06:53:52 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.115 2012/11/12 18:00:37 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.116 2012/12/10 06:53:52 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -465,6 +465,11 @@ pmap_ptesync(pt_entry_t *ptep, size_t cn
 
 /* ARM MMU configuration */
 
+#ifdef FPU_VFP
+void	pmap_copy_page_vfp(paddr_t, paddr_t);
+void	pmap_zero_page_vfp(paddr_t);
+#endif
+
 #if (ARM_MMU_GENERIC + ARM_MMU_SA1 + ARM_MMU_V6 + ARM_MMU_V7) != 0
 void	pmap_copy_page_generic(paddr_t, paddr_t);
 void	pmap_zero_page_generic(paddr_t);



CVS commit: src/sys/arch/arm/include/arm32

2012-12-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Dec  7 18:46:50 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: param.h

Log Message:
FPCONTEXTSIZE is dead.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/include/arm32/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/arm/include/arm32/param.h
diff -u src/sys/arch/arm/include/arm32/param.h:1.17 src/sys/arch/arm/include/arm32/param.h:1.18
--- src/sys/arch/arm/include/arm32/param.h:1.17	Sat Feb  4 17:56:16 2012
+++ src/sys/arch/arm/include/arm32/param.h	Fri Dec  7 18:46:50 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.17 2012/02/04 17:56:16 para Exp $	*/
+/*	$NetBSD: param.h,v 1.18 2012/12/07 18:46:50 matt Exp $	*/
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe.
@@ -72,17 +72,13 @@
 /*
  * The USPACE area contains :
  * 1. the pcb structure for the process
- * 2. the fp context for FP emulation
- * 3. the kernel (svc) stack
+ * 2. the kernel (svc) stack
  *
  * The layout of the area looks like this
  *
- * | uarea | FP context | kernel stack |
+ * | uarea | kernel stack |
  *
  * The size of the uarea is known.
- * The size of the FP context is variable depending of the FP emulator
- * in use and whether there is hardware FP support. However we can put
- * an upper limit on it.
  * The kernel stack should be at least 4K is size.
  *
  * The stack top addresses are used to set the stack pointers. The stack bottom
@@ -90,9 +86,8 @@
  *
  */
 
-#define FPCONTEXTSIZE			(0x100)
 #define USPACE_SVC_STACK_TOP		(USPACE)
-#define USPACE_SVC_STACK_BOTTOM		(sizeof(struct pcb) + FPCONTEXTSIZE + 10)
+#define USPACE_SVC_STACK_BOTTOM		(sizeof(struct pcb))
 
 #define arm_btop(x)			((x) >> PGSHIFT)
 #define arm_ptob(x)			((x) << PGSHIFT)



CVS commit: src/sys/arch/arm/include/arm32

2012-10-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Oct 20 14:42:20 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: machdep.h

Log Message:
Increase l2pts to accomodate large memory disks.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/include/arm32/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/arm/include/arm32/machdep.h
diff -u src/sys/arch/arm/include/arm32/machdep.h:1.16 src/sys/arch/arm/include/arm32/machdep.h:1.17
--- src/sys/arch/arm/include/arm32/machdep.h:1.16	Sat Sep  1 12:19:32 2012
+++ src/sys/arch/arm/include/arm32/machdep.h	Sat Oct 20 14:42:20 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.h,v 1.16 2012/09/01 12:19:32 martin Exp $ */
+/* $NetBSD: machdep.h,v 1.17 2012/10/20 14:42:20 matt Exp $ */
 
 #ifndef _ARM32_BOOT_MACHDEP_H_
 #define _ARM32_BOOT_MACHDEP_H_
@@ -43,7 +43,7 @@ struct bootmem_info {
 	 */
 	pv_addr_t bmi_vector_l2pt;
 	pv_addr_t bmi_io_l2pt;
-	pv_addr_t bmi_l2pts[16];
+	pv_addr_t bmi_l2pts[32];	// for large memory disks.
 	u_int bmi_freepages;
 	u_int bmi_nfreeblocks;
 };



CVS commit: src/sys/arch/arm/include/arm32

2012-10-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Oct 17 20:15:41 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Add PMAP_MAP_POOLPAGE / PMAP_UNMAP_POOLPAGE if PMAP_NEED_ALLOC_POOLPAGE is
defined.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.113 src/sys/arch/arm/include/arm32/pmap.h:1.114
--- src/sys/arch/arm/include/arm32/pmap.h:1.113	Wed Oct 17 18:52:15 2012
+++ src/sys/arch/arm/include/arm32/pmap.h	Wed Oct 17 20:15:41 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.113 2012/10/17 18:52:15 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.114 2012/10/17 20:15:41 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -887,8 +887,13 @@ extern void (*pmap_zero_page_func)(paddr
  */
 #define	POOL_VTOPHYS(va)	vtophys((vaddr_t) (va))
 #ifdef PMAP_NEED_ALLOC_POOLPAGE
-#define	PMAP_ALLOC_POOLPAGE	arm_pmap_alloc_poolpage
+extern paddr_t physical_start;
 struct vm_page *arm_pmap_alloc_poolpage(int);
+#define	PMAP_ALLOC_POOLPAGE	arm_pmap_alloc_poolpage
+#define	PMAP_MAP_POOLPAGE(pa) \
+((vaddr_t)((paddr_t)(pa) - physical_start + KERNEL_BASE))
+#define PMAP_UNMAP_POOLPAGE(va) \
+((paddr_t)((vaddr_t)(va) - KERNEL_BASE + physical_start))
 #endif
 
 #ifndef _LOCORE



CVS commit: src/sys/arch/arm/include/arm32

2012-09-11 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Sep 11 15:28:15 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h pte.h

Log Message:
Fix the CACHE_MASKs for armv6 to include TEX and S bits.
Fix a comment in pte.h


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/arch/arm/include/arm32/pmap.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.110 src/sys/arch/arm/include/arm32/pmap.h:1.111
--- src/sys/arch/arm/include/arm32/pmap.h:1.110	Fri Sep  7 11:48:59 2012
+++ src/sys/arch/arm/include/arm32/pmap.h	Tue Sep 11 15:28:14 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.110 2012/09/07 11:48:59 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.111 2012/09/11 15:28:14 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -595,7 +595,7 @@ extern void (*pmap_zero_page_func)(paddr
 #define	L1_S_CACHE_MASK_generic	(L1_S_B|L1_S_C)
 #define	L1_S_CACHE_MASK_xscale	(L1_S_B|L1_S_C|L1_S_XS_TEX(TEX_XSCALE_X))
 #define	L1_S_CACHE_MASK_armv6	(L1_S_B|L1_S_C|L1_S_XS_TEX(TEX_ARMV6_TEX))
-#define	L1_S_CACHE_MASK_armv7	(L1_S_B|L1_S_C)
+#define	L1_S_CACHE_MASK_armv7	(L1_S_B|L1_S_C|L1_S_XS_TEX(TEX_ARMV6_TEX)|L1_S_V6_S)
 
 #define	L2_L_PROT_U_generic	(L2_AP(AP_U))
 #define	L2_L_PROT_W_generic	(L2_AP(AP_W))
@@ -620,7 +620,7 @@ extern void (*pmap_zero_page_func)(paddr
 #define	L2_L_CACHE_MASK_generic	(L2_B|L2_C)
 #define	L2_L_CACHE_MASK_xscale	(L2_B|L2_C|L2_XS_L_TEX(TEX_XSCALE_X))
 #define	L2_L_CACHE_MASK_armv6	(L2_B|L2_C|L2_V6_L_TEX(TEX_ARMV6_TEX))
-#define	L2_L_CACHE_MASK_armv7	(L2_B|L2_C)
+#define	L2_L_CACHE_MASK_armv7	(L2_B|L2_C|L2_V6_L_TEX(TEX_ARMV6_TEX)|L2_XS_S)
 
 #define	L2_S_PROT_U_generic	(L2_AP(AP_U))
 #define	L2_S_PROT_W_generic	(L2_AP(AP_W))
@@ -651,7 +651,7 @@ extern void (*pmap_zero_page_func)(paddr
 #else
 #define	L2_S_CACHE_MASK_armv6c	L2_S_CACHE_MASK_generic
 #endif
-#define	L2_S_CACHE_MASK_armv7	(L2_B|L2_C)
+#define	L2_S_CACHE_MASK_armv7	(L2_B|L2_C|L2_V6_XS_TEX(TEX_ARMV6_TEX)|L2_XS_S)
 
 
 #define	L1_S_PROTO_generic	(L1_TYPE_S | L1_S_IMP)

Index: src/sys/arch/arm/include/arm32/pte.h
diff -u src/sys/arch/arm/include/arm32/pte.h:1.12 src/sys/arch/arm/include/arm32/pte.h:1.13
--- src/sys/arch/arm/include/arm32/pte.h:1.12	Mon Aug 20 13:03:41 2012
+++ src/sys/arch/arm/include/arm32/pte.h	Tue Sep 11 15:28:14 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pte.h,v 1.12 2012/08/20 13:03:41 matt Exp $	*/
+/*	$NetBSD: pte.h,v 1.13 2012/09/11 15:28:14 matt Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -198,7 +198,7 @@ typedef uint32_t	pt_entry_t;	/* L2 table
 #define	L2_TYPE_INV	0x00		/* Invalid (fault) */
 #define	L2_TYPE_L	0x01		/* Large Page */
 #define	L2_TYPE_S	0x02		/* Small Page */
-#define	L2_TYPE_T	0x03		/* Tiny Page */
+#define	L2_TYPE_T	0x03		/* Tiny Page (not armv7) */
 #define	L2_TYPE_MASK	0x03		/* mask of type bits */
 
 	/*



CVS commit: src/sys/arch/arm/include/arm32

2012-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Sep  6 04:42:39 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Alas, Cortex-A8 can't TLB walk out of their caches so they need to sync each 
PTE.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.108 src/sys/arch/arm/include/arm32/pmap.h:1.109
--- src/sys/arch/arm/include/arm32/pmap.h:1.108	Thu Sep  6 02:07:25 2012
+++ src/sys/arch/arm/include/arm32/pmap.h	Thu Sep  6 04:42:39 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.108 2012/09/06 02:07:25 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.109 2012/09/06 04:42:39 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -405,7 +405,16 @@ extern int pmap_needs_pte_sync;
 #if (ARM_MMU_SA1 + ARM_MMU_V6 + ARM_MMU_V7 != 0) && (ARM_NMMUS == 1) 
 #define	PMAP_INCLUDE_PTE_SYNC
 #if (ARM_MMU_V7 > 0)
+#if defined(CPU_CORTEXA8)
+#if defined(CPU_CORTEXA5) || defined(CPU_CORTEXA7) || defined(CPU_CORTEXA9) \
+|| defined(CPU_CORTEXA15)
+#define	PMAP_NEEDS_PTE_SYNC	CPU_ID_IS_CORTEX_A8(curcpu()->ci_arm_cpuid)
+#else
+#define	PMAP_NEEDS_PTE_SYNC	1
+#endif
+#else
 #define	PMAP_NEEDS_PTE_SYNC	0
+#endif
 #else
 #define	PMAP_NEEDS_PTE_SYNC	1
 #endif



CVS commit: src/sys/arch/arm/include/arm32

2012-09-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep  1 12:19:32 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: machdep.h pmap.h

Log Message:
Backout previous, Matt fixed it differently


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/include/arm32/machdep.h
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/arm/include/arm32/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/arm/include/arm32/machdep.h
diff -u src/sys/arch/arm/include/arm32/machdep.h:1.15 src/sys/arch/arm/include/arm32/machdep.h:1.16
--- src/sys/arch/arm/include/arm32/machdep.h:1.15	Sat Sep  1 12:05:09 2012
+++ src/sys/arch/arm/include/arm32/machdep.h	Sat Sep  1 12:19:32 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.h,v 1.15 2012/09/01 12:05:09 martin Exp $ */
+/* $NetBSD: machdep.h,v 1.16 2012/09/01 12:19:32 martin Exp $ */
 
 #ifndef _ARM32_BOOT_MACHDEP_H_
 #define _ARM32_BOOT_MACHDEP_H_
@@ -30,21 +30,6 @@ extern u_int prefetch_abort_handler_addr
 // extern u_int undefined_handler_address;
 #define	undefined_handler_address (curcpu()->ci_undefsave[2])
 
-/*
- * Physical / virtual address structure. In a number of places (particularly
- * during bootstrapping) we need to keep track of the physical and virtual
- * addresses of various pages
- */
-typedef struct pv_addr {
-	SLIST_ENTRY(pv_addr) pv_list;
-	paddr_t pv_pa;
-	vaddr_t pv_va;
-	vsize_t pv_size;
-	uint8_t pv_cache;
-	uint8_t pv_prot;
-} pv_addr_t;
-typedef SLIST_HEAD(, pv_addr) pv_addrqh_t;
-
 struct bootmem_info {
 	paddr_t bmi_start;
 	paddr_t bmi_kernelstart;

Index: src/sys/arch/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.105 src/sys/arch/arm/include/arm32/pmap.h:1.106
--- src/sys/arch/arm/include/arm32/pmap.h:1.105	Sat Sep  1 12:05:09 2012
+++ src/sys/arch/arm/include/arm32/pmap.h	Sat Sep  1 12:19:32 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.105 2012/09/01 12:05:09 martin Exp $	*/
+/*	$NetBSD: pmap.h,v 1.106 2012/09/01 12:19:32 martin Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -72,7 +72,6 @@
 
 #include 
 #include 
-#include 
 #ifndef _LOCORE
 #if defined(_KERNEL_OPT)
 #include "opt_arm32_pmap.h"
@@ -198,6 +197,21 @@ struct pmap {
 	LIST_ENTRY(pmap)	pm_list;
 };
 
+/*
+ * Physical / virtual address structure. In a number of places (particularly
+ * during bootstrapping) we need to keep track of the physical and virtual
+ * addresses of various pages
+ */
+typedef struct pv_addr {
+	SLIST_ENTRY(pv_addr) pv_list;
+	paddr_t pv_pa;
+	vaddr_t pv_va;
+	vsize_t pv_size;
+	uint8_t pv_cache;
+	uint8_t pv_prot;
+} pv_addr_t;
+typedef SLIST_HEAD(, pv_addr) pv_addrqh_t;
+
 extern pv_addrqh_t pmap_freeq;
 extern pv_addr_t kernelstack;
 extern pv_addr_t abtstack;



CVS commit: src/sys/arch/arm/include/arm32

2012-09-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep  1 12:05:09 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: machdep.h pmap.h

Log Message:
Move struct pv_addr next to struct bootmem_info into machdep.h and have
pmap.h include that.
Seems to be the least intrusive build fix; Matt: feel free to revamp.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/include/arm32/machdep.h
cvs rdiff -u -r1.104 -r1.105 src/sys/arch/arm/include/arm32/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/arm/include/arm32/machdep.h
diff -u src/sys/arch/arm/include/arm32/machdep.h:1.14 src/sys/arch/arm/include/arm32/machdep.h:1.15
--- src/sys/arch/arm/include/arm32/machdep.h:1.14	Fri Aug 31 23:59:52 2012
+++ src/sys/arch/arm/include/arm32/machdep.h	Sat Sep  1 12:05:09 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.h,v 1.14 2012/08/31 23:59:52 matt Exp $ */
+/* $NetBSD: machdep.h,v 1.15 2012/09/01 12:05:09 martin Exp $ */
 
 #ifndef _ARM32_BOOT_MACHDEP_H_
 #define _ARM32_BOOT_MACHDEP_H_
@@ -30,6 +30,21 @@ extern u_int prefetch_abort_handler_addr
 // extern u_int undefined_handler_address;
 #define	undefined_handler_address (curcpu()->ci_undefsave[2])
 
+/*
+ * Physical / virtual address structure. In a number of places (particularly
+ * during bootstrapping) we need to keep track of the physical and virtual
+ * addresses of various pages
+ */
+typedef struct pv_addr {
+	SLIST_ENTRY(pv_addr) pv_list;
+	paddr_t pv_pa;
+	vaddr_t pv_va;
+	vsize_t pv_size;
+	uint8_t pv_cache;
+	uint8_t pv_prot;
+} pv_addr_t;
+typedef SLIST_HEAD(, pv_addr) pv_addrqh_t;
+
 struct bootmem_info {
 	paddr_t bmi_start;
 	paddr_t bmi_kernelstart;

Index: src/sys/arch/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.104 src/sys/arch/arm/include/arm32/pmap.h:1.105
--- src/sys/arch/arm/include/arm32/pmap.h:1.104	Thu Aug 30 02:10:15 2012
+++ src/sys/arch/arm/include/arm32/pmap.h	Sat Sep  1 12:05:09 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.104 2012/08/30 02:10:15 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.105 2012/09/01 12:05:09 martin Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -72,6 +72,7 @@
 
 #include 
 #include 
+#include 
 #ifndef _LOCORE
 #if defined(_KERNEL_OPT)
 #include "opt_arm32_pmap.h"
@@ -197,21 +198,6 @@ struct pmap {
 	LIST_ENTRY(pmap)	pm_list;
 };
 
-/*
- * Physical / virtual address structure. In a number of places (particularly
- * during bootstrapping) we need to keep track of the physical and virtual
- * addresses of various pages
- */
-typedef struct pv_addr {
-	SLIST_ENTRY(pv_addr) pv_list;
-	paddr_t pv_pa;
-	vaddr_t pv_va;
-	vsize_t pv_size;
-	uint8_t pv_cache;
-	uint8_t pv_prot;
-} pv_addr_t;
-typedef SLIST_HEAD(, pv_addr) pv_addrqh_t;
-
 extern pv_addrqh_t pmap_freeq;
 extern pv_addr_t kernelstack;
 extern pv_addr_t abtstack;



CVS commit: src/sys/arch/arm/include/arm32

2012-08-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug 30 02:10:15 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Add a l1pte_supersection_p macro.


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.103 src/sys/arch/arm/include/arm32/pmap.h:1.104
--- src/sys/arch/arm/include/arm32/pmap.h:1.103	Mon Aug 20 13:03:41 2012
+++ src/sys/arch/arm/include/arm32/pmap.h	Thu Aug 30 02:10:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.103 2012/08/20 13:03:41 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.104 2012/08/30 02:10:15 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -403,8 +403,12 @@ extern int pmap_needs_pte_sync;
  * this at compile time.
  */
 #if (ARM_MMU_SA1 + ARM_MMU_V6 + ARM_MMU_V7 != 0) && (ARM_NMMUS == 1) 
-#define	PMAP_NEEDS_PTE_SYNC	1
 #define	PMAP_INCLUDE_PTE_SYNC
+#if (ARM_MMU_V7 > 0)
+#define	PMAP_NEEDS_PTE_SYNC	1
+#else
+#define	PMAP_NEEDS_PTE_SYNC	1
+#endif
 #elif (ARM_MMU_SA1 == 0)
 #define	PMAP_NEEDS_PTE_SYNC	0
 #endif
@@ -419,22 +423,23 @@ extern int pmap_needs_pte_sync;
 #define	PMAP_INCLUDE_PTE_SYNC
 #endif
 
-#define	PTE_SYNC(pte)			\
-do {	\
-	if (PMAP_NEEDS_PTE_SYNC)	\
-		cpu_dcache_wb_range((vaddr_t)(pte), sizeof(pt_entry_t));\
-} while (/*CONSTCOND*/0)
+static inline void
+pmap_ptesync(pt_entry_t *ptep, size_t cnt)
+{
+	if (PMAP_NEEDS_PTE_SYNC)
+		cpu_dcache_wb_range((vaddr_t)ptep, cnt * sizeof(pt_entry_t));
+#if ARM_MMU_V7 > 0
+	__asm("dsb");
+#endif
+}
 
-#define	PTE_SYNC_RANGE(pte, cnt)	\
-do {	\
-	if (PMAP_NEEDS_PTE_SYNC) {	\
-		cpu_dcache_wb_range((vaddr_t)(pte),			\
-		(cnt) << 2); /* * sizeof(pt_entry_t) */		\
-	}\
-} while (/*CONSTCOND*/0)
+#define	PTE_SYNC(ptep)			pmap_ptesync((ptep), 1)
+#define	PTE_SYNC_RANGE(ptep, cnt)	pmap_ptesync((ptep), (cnt))
 
 #define	l1pte_valid(pde)	((pde) != 0)
 #define	l1pte_section_p(pde)	(((pde) & L1_TYPE_MASK) == L1_TYPE_S)
+#define	l1pte_supersection_p(pde) (l1pte_section_p(pde)	\
+&& ((pde) & L1_S_V6_SUPER) != 0)
 #define	l1pte_page_p(pde)	(((pde) & L1_TYPE_MASK) == L1_TYPE_C)
 #define	l1pte_fpage_p(pde)	(((pde) & L1_TYPE_MASK) == L1_TYPE_F)
 



CVS commit: src/sys/arch/arm/include/arm32

2012-08-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Aug 25 14:08:18 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: frame.h

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/include/arm32/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/arm/include/arm32/frame.h
diff -u src/sys/arch/arm/include/arm32/frame.h:1.31 src/sys/arch/arm/include/arm32/frame.h:1.32
--- src/sys/arch/arm/include/arm32/frame.h:1.31	Thu Aug 16 17:35:01 2012
+++ src/sys/arch/arm/include/arm32/frame.h	Sat Aug 25 14:08:17 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.31 2012/08/16 17:35:01 matt Exp $	*/
+/*	$NetBSD: frame.h,v 1.32 2012/08/25 14:08:17 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -143,7 +143,7 @@ void validate_trapframe(trapframe_t *, i
 	teq	r0, #(PSR_USR32_MODE)	;\
 	GET_CURCPU(r4)			/* r4 = cpuinfo */		;\
 	bne	1f			/* Not USR mode skip AFLT */	;\
-	ldr	r1, [r1, #CI_CURLWP]	/* get curlwp from cpu_info */	;\
+	ldr	r1, [r4, #CI_CURLWP]	/* get curlwp from cpu_info */	;\
 	ldr	r1, [r1, #L_MD_FLAGS]	/* Fetch l_md.md_flags */	;\
 	tst	r1, #MDLWP_NOALIGNFLT	;\
 	beq	1f			/* AFLTs already enabled */	;\



CVS commit: src/sys/arch/arm/include/arm32

2012-08-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug 16 07:26:23 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: pte.h

Log Message:
Add L2_S_SEGSIZE which is the number of bytes that a L2 page table will map.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/include/arm32/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/arm/include/arm32/pte.h
diff -u src/sys/arch/arm/include/arm32/pte.h:1.10 src/sys/arch/arm/include/arm32/pte.h:1.11
--- src/sys/arch/arm/include/arm32/pte.h:1.10	Thu Mar 10 07:47:15 2011
+++ src/sys/arch/arm/include/arm32/pte.h	Thu Aug 16 07:26:23 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pte.h,v 1.10 2011/03/10 07:47:15 bsh Exp $	*/
+/*	$NetBSD: pte.h,v 1.11 2012/08/16 07:26:23 matt Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -107,6 +107,7 @@ typedef uint32_t	pt_entry_t;	/* L2 table
 #define	L2_L_FRAME	(~L2_L_OFFSET)
 #define	L2_L_SHIFT	16
 
+#define	L2_S_SEGSIZE	(PAGE_SIZE * L2_S_SIZE / 4)
 #define	L2_S_SIZE	0x1000	/* 4K */
 #define	L2_S_OFFSET	(L2_S_SIZE - 1)
 #define	L2_S_FRAME	(~L2_S_OFFSET)



CVS commit: src/sys/arch/arm/include/arm32

2012-08-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug 16 07:25:37 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
Tweak max addresses a bit so that [r1, #off] can't overflow them.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.26 src/sys/arch/arm/include/arm32/vmparam.h:1.27
--- src/sys/arch/arm/include/arm32/vmparam.h:1.26	Thu Feb 16 02:27:11 2012
+++ src/sys/arch/arm/include/arm32/vmparam.h	Thu Aug 16 07:25:37 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.26 2012/02/16 02:27:11 christos Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.27 2012/08/16 07:25:37 matt Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -81,11 +81,11 @@
  * Mach derived constants
  */
 #define	VM_MIN_ADDRESS		((vaddr_t) 0x1000)
-#define	VM_MAXUSER_ADDRESS	((vaddr_t) KERNEL_BASE)
+#define	VM_MAXUSER_ADDRESS	((vaddr_t) KERNEL_BASE - 0x1000)
 #define	VM_MAX_ADDRESS		VM_MAXUSER_ADDRESS
 
 #define	VM_MIN_KERNEL_ADDRESS	((vaddr_t) KERNEL_BASE)
-#define	VM_MAX_KERNEL_ADDRESS	((vaddr_t) 0x)
+#define	VM_MAX_KERNEL_ADDRESS	((vaddr_t) 0xefff)
 
 #ifndef __ASSEMBLER__
 /* XXX max. amount of KVM to be used by buffers. */



CVS commit: src/sys/arch/arm/include/arm32

2012-07-31 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Aug  1 05:40:20 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: frame.h

Log Message:
Shrink PUSHFRAMEINSVC by 4 more instructions.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/include/arm32/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/arm/include/arm32/frame.h
diff -u src/sys/arch/arm/include/arm32/frame.h:1.27 src/sys/arch/arm/include/arm32/frame.h:1.28
--- src/sys/arch/arm/include/arm32/frame.h:1.27	Tue Jul 31 15:47:58 2012
+++ src/sys/arch/arm/include/arm32/frame.h	Wed Aug  1 05:40:20 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.27 2012/07/31 15:47:58 matt Exp $	*/
+/*	$NetBSD: frame.h,v 1.28 2012/08/01 05:40:20 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -371,13 +371,10 @@ LOCK_CAS_DEBUG_LOCALS
 	mov	r1, sp;			/* Save xxx32 sp */		   \
 	mrs	r3, spsr;		/* Save xxx32 spsr */		   \
 	SET_CPSR_MODE(r2, PSR_SVC32_MODE);   \
-	mov	r2, sp;			/* Save	SVC sp */		   \
-	tst	sp, #4;			/* check for alignment */	   \
-	subne	sp, sp, #4;		/* adjust if not aligned */	   \
-	str	r0, [sp, #-4]!;		/* Push return address */	   \
-	str	lr, [sp, #-4]!;		/* Push SVC lr */		   \
-	str	r2, [sp, #-4]!;		/* Push SVC sp */		   \
-	sub	sp, sp, #4;		/* Keep stack aligned */	   \
+	bic	r2, sp, #7;		/* Align new SVC sp */		   \
+	str	r0, [r2, #-4]!;		/* Push return address */	   \
+	stmdb	r2!, {sp, lr};		/* Push SVC sp, lr */		   \
+	sub	sp, r2, #4;		/* Keep stack aligned */	   \
 	msr spsr_all, r3;		/* Restore correct spsr */	   \
 	ldmdb	r1, {r0-r3};		/* Restore 4 regs from xxx mode */ \
 	sub	sp, sp, #(4*15);	/* Adjust the stack pointer */	   \



CVS commit: src/sys/arch/arm/include/arm32

2012-07-31 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jul 31 15:47:58 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: frame.h

Log Message:
Add code to make sure the trapframe is aligned to a doubleword boundary.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/include/arm32/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/arm/include/arm32/frame.h
diff -u src/sys/arch/arm/include/arm32/frame.h:1.26 src/sys/arch/arm/include/arm32/frame.h:1.27
--- src/sys/arch/arm/include/arm32/frame.h:1.26	Tue Jul 31 08:01:30 2012
+++ src/sys/arch/arm/include/arm32/frame.h	Tue Jul 31 15:47:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.26 2012/07/31 08:01:30 matt Exp $	*/
+/*	$NetBSD: frame.h,v 1.27 2012/07/31 15:47:58 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -372,6 +372,8 @@ LOCK_CAS_DEBUG_LOCALS
 	mrs	r3, spsr;		/* Save xxx32 spsr */		   \
 	SET_CPSR_MODE(r2, PSR_SVC32_MODE);   \
 	mov	r2, sp;			/* Save	SVC sp */		   \
+	tst	sp, #4;			/* check for alignment */	   \
+	subne	sp, sp, #4;		/* adjust if not aligned */	   \
 	str	r0, [sp, #-4]!;		/* Push return address */	   \
 	str	lr, [sp, #-4]!;		/* Push SVC lr */		   \
 	str	r2, [sp, #-4]!;		/* Push SVC sp */		   \



CVS commit: src/sys/arch/arm/include/arm32

2012-07-31 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jul 31 08:01:30 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: frame.h

Log Message:
Only do the SA110 user register save workaround on kernel using SA110s.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/include/arm32/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/arm/include/arm32/frame.h
diff -u src/sys/arch/arm/include/arm32/frame.h:1.25 src/sys/arch/arm/include/arm32/frame.h:1.26
--- src/sys/arch/arm/include/arm32/frame.h:1.25	Tue Jul 31 07:23:16 2012
+++ src/sys/arch/arm/include/arm32/frame.h	Tue Jul 31 08:01:30 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.25 2012/07/31 07:23:16 matt Exp $	*/
+/*	$NetBSD: frame.h,v 1.26 2012/07/31 08:01:30 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -117,6 +117,7 @@ void validate_trapframe(trapframe_t *, i
 #include "opt_multiprocessor.h"
 #include "opt_cpuoptions.h"
 #include "opt_arm_debug.h"
+#include "opt_cputypes.h"
 
 #include 
 
@@ -305,17 +306,26 @@ LOCK_CAS_DEBUG_LOCALS
 /*
  * PUSHFRAME - macro to push a trap frame on the stack in the current mode
  * Since the current mode is used, the SVC lr field is not defined.
- *
+ */
+
+#ifdef CPU_SA110
+/*
  * NOTE: r13 and r14 are stored separately as a work around for the
  * SA110 rev 2 STM^ bug
  */
+#define	PUSHUSERREGS			   \
+	stmia	sp, {r0-r12};		/* Push the user mode registers */ \
+	add	r0, sp, #(4*13);	/* Adjust the stack pointer */	   \
+	stmia	r0, {r13-r14}^		/* Push the user mode registers */
+#else
+#define	PUSHUSERREGS			   \
+	stmia	sp, {r0-r14}^		/* Push the user mode registers */
+#endif
 
 #define PUSHFRAME			   \
 	str	lr, [sp, #-4]!;		/* Push the return address */	   \
 	sub	sp, sp, #(4*18);	/* Adjust the stack pointer */	   \
-	stmia	sp, {r0-r12};		/* Push the user mode registers */ \
-	add	r0, sp, #(4*13);	/* Adjust the stack pointer */	   \
-	stmia	r0, {r13-r14}^;		/* Push the user mode registers */ \
+	PUSHUSERREGS;			/* Push the user mode registers */ \
 	mov r0, r0; /* NOP for previous instruction */ \
 	mrs	r0, spsr_all;		/* Get the SPSR */		   \
 	str	r0, [sp, #-4]!		/* Push the SPSR on the stack */
@@ -369,9 +379,7 @@ LOCK_CAS_DEBUG_LOCALS
 	msr spsr_all, r3;		/* Restore correct spsr */	   \
 	ldmdb	r1, {r0-r3};		/* Restore 4 regs from xxx mode */ \
 	sub	sp, sp, #(4*15);	/* Adjust the stack pointer */	   \
-	stmia	sp, {r0-r12};		/* Push the user mode registers */ \
-	add	r0, sp, #(4*13);	/* Adjust the stack pointer */	   \
-	stmia	r0, {r13-r14}^;		/* Push the user mode registers */ \
+	PUSHUSERREGS;			/* Push the user mode registers */ \
 	mov r0, r0; /* NOP for previous instruction */ \
 	mrs	r0, spsr_all;		/* Get the SPSR */		   \
 	str	r0, [sp, #-4]!		/* Push the SPSR onto the stack */



CVS commit: src/sys/arch/arm/include/arm32

2012-07-30 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jul 31 06:56:57 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: frame.h

Log Message:
whitespace cleanup


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/arm/include/arm32/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/arm/include/arm32/frame.h
diff -u src/sys/arch/arm/include/arm32/frame.h:1.23 src/sys/arch/arm/include/arm32/frame.h:1.24
--- src/sys/arch/arm/include/arm32/frame.h:1.23	Sun Jan 18 01:19:33 2009
+++ src/sys/arch/arm/include/arm32/frame.h	Tue Jul 31 06:56:57 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.23 2009/01/18 01:19:33 bjh21 Exp $	*/
+/*	$NetBSD: frame.h,v 1.24 2012/07/31 06:56:57 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -315,7 +315,7 @@ LOCK_CAS_DEBUG_LOCALS
 	stmia	sp, {r0-r12};		/* Push the user mode registers */ \
 	add	r0, sp, #(4*13);	/* Adjust the stack pointer */	   \
 	stmia	r0, {r13-r14}^;		/* Push the user mode registers */ \
-mov r0, r0; /* NOP for previous instruction */ \
+	mov r0, r0; /* NOP for previous instruction */ \
 	mrs	r0, spsr_all;		/* Put the SPSR on the stack */	   \
 	str	r0, [sp, #-4]!
 
@@ -325,10 +325,10 @@ LOCK_CAS_DEBUG_LOCALS
  */
 
 #define PULLFRAME			   \
-ldr r0, [sp], #0x0004;  /* Get the SPSR from stack */	   \
-msr spsr_all, r0;		   \
-ldmia   sp, {r0-r14}^;		/* Restore registers (usr mode) */ \
-mov r0, r0; /* NOP for previous instruction */ \
+	ldr r0, [sp], #0x0004;  /* Get the SPSR from stack */	   \
+	msr spsr_all, r0;		   \
+	ldmia   sp, {r0-r14}^;		/* Restore registers (usr mode) */ \
+	mov r0, r0; /* NOP for previous instruction */ \
 	add	sp, sp, #(4*17);	/* Adjust the stack pointer */	   \
  	ldr	lr, [sp], #0x0004	/* Pull the return address */
 
@@ -362,7 +362,7 @@ LOCK_CAS_DEBUG_LOCALS
 	stmia	sp, {r0-r12};		/* Push the user mode registers */ \
 	add	r0, sp, #(4*13);	/* Adjust the stack pointer */	   \
 	stmia	r0, {r13-r14}^;		/* Push the user mode registers */ \
-mov r0, r0; /* NOP for previous instruction */ \
+	mov r0, r0; /* NOP for previous instruction */ \
 	mrs	r0, spsr_all;		/* Put the SPSR on the stack */	   \
 	str	r0, [sp, #-4]!
 
@@ -374,10 +374,10 @@ LOCK_CAS_DEBUG_LOCALS
  */
 
 #define PULLFRAMEFROMSVCANDEXIT		   \
-ldr r0, [sp], #0x0004;	/* Get the SPSR from stack */	   \
-msr spsr_all, r0;		/* restore SPSR */		   \
-ldmia   sp, {r0-r14}^;		/* Restore registers (usr mode) */ \
-mov r0, r0;	  		/* NOP for previous instruction */ \
+	ldr r0, [sp], #0x0004;	/* Get the SPSR from stack */	   \
+	msr spsr_all, r0;		/* restore SPSR */		   \
+	ldmia   sp, {r0-r14}^;		/* Restore registers (usr mode) */ \
+	mov r0, r0;	  		/* NOP for previous instruction */ \
 	add	sp, sp, #(4*15);	/* Adjust the stack pointer */	   \
 	ldmia	sp, {sp, lr, pc}^	/* Restore lr and exit */
 



CVS commit: src/sys/arch/arm/include/arm32

2012-02-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb 16 02:27:11 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: vmparam.h

Log Message:
expose stuff that crash needs to kmemuser


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/include/arm32/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/arm/include/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.25 src/sys/arch/arm/include/arm32/vmparam.h:1.26
--- src/sys/arch/arm/include/arm32/vmparam.h:1.25	Sun Nov 14 08:33:21 2010
+++ src/sys/arch/arm/include/arm32/vmparam.h	Wed Feb 15 21:27:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.25 2010/11/14 13:33:21 uebayasi Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.26 2012/02/16 02:27:11 christos Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -38,7 +38,7 @@
 #ifndef _ARM_ARM32_VMPARAM_H_
 #define	_ARM_ARM32_VMPARAM_H_
 
-#ifdef _KERNEL
+#if defined(_KERNEL) || defined(_KMEMUSER)
 
 /*
  * Virtual Memory parameters common to all arm32 platforms.
@@ -98,6 +98,6 @@ extern vaddr_t virtual_end;
 #endif
 #endif /* __ASSEMBLER__ */
 
-#endif /* _KERNEL */
+#endif /* _KERNEL || _KMEMUSER */
 
 #endif /* _ARM_ARM32_VMPARAM_H_ */



  1   2   >