CVS commit: src/sys/arch/cats/cats

2022-09-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Sep 29 06:47:06 UTC 2022

Modified Files:
src/sys/arch/cats/cats: autoconf.c

Log Message:
Remove unnecessary include of .


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/cats/cats/autoconf.c

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

Modified files:

Index: src/sys/arch/cats/cats/autoconf.c
diff -u src/sys/arch/cats/cats/autoconf.c:1.20 src/sys/arch/cats/cats/autoconf.c:1.21
--- src/sys/arch/cats/cats/autoconf.c:1.20	Thu Sep 29 06:46:17 2022
+++ src/sys/arch/cats/cats/autoconf.c	Thu Sep 29 06:47:06 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.20 2022/09/29 06:46:17 skrll Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.21 2022/09/29 06:47:06 skrll Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.20 2022/09/29 06:46:17 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.21 2022/09/29 06:47:06 skrll Exp $");
 
 #include "opt_md.h"
 
@@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 



CVS commit: src/sys/arch/cats/cats

2022-09-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Sep 29 06:47:06 UTC 2022

Modified Files:
src/sys/arch/cats/cats: autoconf.c

Log Message:
Remove unnecessary include of .


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/cats/cats/autoconf.c

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



CVS commit: src/sys/arch/cats/cats

2022-09-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Sep 29 06:46:17 UTC 2022

Modified Files:
src/sys/arch/cats/cats: autoconf.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/cats/cats/autoconf.c

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

Modified files:

Index: src/sys/arch/cats/cats/autoconf.c
diff -u src/sys/arch/cats/cats/autoconf.c:1.19 src/sys/arch/cats/cats/autoconf.c:1.20
--- src/sys/arch/cats/cats/autoconf.c:1.19	Wed Apr  2 11:35:36 2014
+++ src/sys/arch/cats/cats/autoconf.c	Thu Sep 29 06:46:17 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.19 2014/04/02 11:35:36 matt Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.20 2022/09/29 06:46:17 skrll Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.19 2014/04/02 11:35:36 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.20 2022/09/29 06:46:17 skrll Exp $");
 
 #include "opt_md.h"
 
@@ -104,7 +104,7 @@ static void
 set_root_device(void)
 {
 	char *ptr;
-
+
 	if (boot_file)
 		get_device(boot_file);
 	if (boot_args &&
@@ -174,7 +174,7 @@ device_register(device_t dev, void *aux)
 		 */
 		struct pci_attach_args *pa = aux;
 		if (((pa)->pa_bus == 0
-		&& (pa)->pa_device == 16 
+		&& (pa)->pa_device == 16
 		&& (pa)->pa_function == 0)) {
 			if (prop_dictionary_set_bool(device_properties(dev),
 		"ali1543-ide-force-compat-mode",



CVS commit: src/sys/arch/cats/cats

2022-09-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Sep 29 06:46:17 UTC 2022

Modified Files:
src/sys/arch/cats/cats: autoconf.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/cats/cats/autoconf.c

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



CVS commit: src/sys/arch/cats/cats

2021-08-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Aug 27 09:29:05 UTC 2021

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
Do the VPRINTF thing and #include "opt_arm/debug.h" for VERBOSE_INIT_ARM


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/cats/cats/cats_machdep.c

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

Modified files:

Index: src/sys/arch/cats/cats/cats_machdep.c
diff -u src/sys/arch/cats/cats/cats_machdep.c:1.91 src/sys/arch/cats/cats/cats_machdep.c:1.92
--- src/sys/arch/cats/cats/cats_machdep.c:1.91	Fri Aug 27 09:23:27 2021
+++ src/sys/arch/cats/cats/cats_machdep.c	Fri Aug 27 09:29:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cats_machdep.c,v 1.91 2021/08/27 09:23:27 skrll Exp $	*/
+/*	$NetBSD: cats_machdep.c,v 1.92 2021/08/27 09:29:05 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,8 +40,9 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.91 2021/08/27 09:23:27 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.92 2021/08/27 09:29:05 skrll Exp $");
 
+#include "opt_arm_debug.h"
 #include "opt_ddb.h"
 #include "opt_modular.h"
 
@@ -86,6 +87,12 @@ __KERNEL_RCSID(0, "$NetBSD: cats_machdep
 #include 
 #endif
 
+#ifdef VERBOSE_INIT_ARM
+#define VPRINTF(...)	printf(__VA_ARGS__)
+#else
+#define VPRINTF(...)	__nothing
+#endif
+
 /* Kernel text starts at the base of the kernel address space. */
 #define	KERNEL_TEXT_BASE	(KERNEL_BASE + 0x)
 #define	KERNEL_VM_BASE		(KERNEL_BASE + 0x0100)
@@ -269,23 +276,21 @@ initarm(void *arm_bootargs)
 		panic("Incompatible magic number %#x passed in boot args",
 		ebsabootinfo.bt_magic);
 
-#ifdef VERBOSE_INIT_ARM
 	/* output the incoming bootinfo */
-	printf("bootinfo @ %p\n", arm_bootargs);
-	printf("bt_magic= 0x%08x\n", ebsabootinfo.bt_magic);
-	printf("bt_vargp= 0x%08x\n", ebsabootinfo.bt_vargp);
-	printf("bt_pargp= 0x%08x\n", ebsabootinfo.bt_pargp);
-	printf("bt_args @ %p, contents = \"%s\"\n", ebsabootinfo.bt_args, ebsabootinfo.bt_args);
-	printf("bt_l1   = %p\n", ebsabootinfo.bt_l1);
-
-	printf("bt_memstart = 0x%08x\n", ebsabootinfo.bt_memstart);
-	printf("bt_memend   = 0x%08x\n", ebsabootinfo.bt_memend);
-	printf("bt_memavail = 0x%08x\n", ebsabootinfo.bt_memavail);
-	printf("bt_fclk = 0x%08x\n", ebsabootinfo.bt_fclk);
-	printf("bt_pciclk   = 0x%08x\n", ebsabootinfo.bt_pciclk);
-	printf("bt_vers = 0x%08x\n", ebsabootinfo.bt_vers);
-	printf("bt_features = 0x%08x\n", ebsabootinfo.bt_features);
-#endif
+	VPRINTF("bootinfo @ %p\n", arm_bootargs);
+	VPRINTF("bt_magic= 0x%08x\n", ebsabootinfo.bt_magic);
+	VPRINTF("bt_vargp= 0x%08x\n", ebsabootinfo.bt_vargp);
+	VPRINTF("bt_pargp= 0x%08x\n", ebsabootinfo.bt_pargp);
+	VPRINTF("bt_args @ %p, contents = \"%s\"\n", ebsabootinfo.bt_args, ebsabootinfo.bt_args);
+	VPRINTF("bt_l1   = %p\n", ebsabootinfo.bt_l1);
+
+	VPRINTF("bt_memstart = 0x%08x\n", ebsabootinfo.bt_memstart);
+	VPRINTF("bt_memend   = 0x%08x\n", ebsabootinfo.bt_memend);
+	VPRINTF("bt_memavail = 0x%08x\n", ebsabootinfo.bt_memavail);
+	VPRINTF("bt_fclk = 0x%08x\n", ebsabootinfo.bt_fclk);
+	VPRINTF("bt_pciclk   = 0x%08x\n", ebsabootinfo.bt_pciclk);
+	VPRINTF("bt_vers = 0x%08x\n", ebsabootinfo.bt_vers);
+	VPRINTF("bt_features = 0x%08x\n", ebsabootinfo.bt_features);
 
 	/*
 	 * Examine the boot args string for options we need to know about
@@ -301,7 +306,7 @@ initarm(void *arm_bootargs)
 #ifdef MEMSIZE
 	if (ram_size == 0 || ram_size > (unsigned)MEMSIZE * 1024 * 1024)
 		ram_size = (unsigned)MEMSIZE * 1024 * 1024;
-	DPRINTF("ram_size = 0x%x\n", (int)ram_size);
+	VPRINTF("ram_size = 0x%x\n", (int)ram_size);
 #else
 	KASSERTMSG(ram_size > 0, "RAM size unknown and MEMSIZE undefined");
 #endif
@@ -388,9 +393,7 @@ initarm(void *arm_bootargs)
 		extern int footbridge_isa_dma_nranges;
 #endif
 
-#if 0
-		printf("%zu: %lx -> %lx\n", i, start, end - 1);
-#endif
+		VPRINTF("%zu: 0x08%lx -> 0x08%lx\n", i, start, end - 1);
 
 #if NISADMA > 0
 		if (arm32_dma_range_intersect(footbridge_isa_dma_ranges,
@@ -400,10 +403,8 @@ initarm(void *arm_bootargs)
 			 * Place the pages that intersect with the
 			 * ISA DMA range onto the ISA DMA free list.
 			 */
-#if 0
-			printf("ISADMA 0x%lx -> 0x%lx\n", istart,
+			VPRINTF("ISADMA 0x08%lx -> 0x%08lx\n", istart,
 			istart + isize - 1);
-#endif
 			bp = _physmem[ncats_physmem++];
 			KASSERT(ncats_physmem < MAX_PHYSMEM);
 			bp->bp_start = atop(istart);
@@ -415,10 +416,8 @@ initarm(void *arm_bootargs)
 			 * intersection onto the default free list.
 			 */
 			if (start < istart) {
-#if 0
-printf("BEFORE 0x%lx -> 0x%lx\n",
+VPRINTF("BEFORE 0x08%lx -> 0x08%lx\n",
 start, istart - 1);
-#endif
 bp = _physmem[ncats_physmem++];
 KASSERT(ncats_physmem < MAX_PHYSMEM);
 bp->bp_start = atop(start);
@@ -431,10 +430,8 @@ initarm(void *arm_bootargs)
 			 * 

CVS commit: src/sys/arch/cats/cats

2021-08-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Aug 27 09:29:05 UTC 2021

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
Do the VPRINTF thing and #include "opt_arm/debug.h" for VERBOSE_INIT_ARM


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/cats/cats/cats_machdep.c

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



CVS commit: src/sys/arch/cats/cats

2021-08-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Aug 27 09:23:28 UTC 2021

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
initarm_common already calls db_machine_init, so don't do it for a second
time otherwise the handlers list just loops.


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/cats/cats/cats_machdep.c

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



CVS commit: src/sys/arch/cats/cats

2021-08-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Aug 27 09:23:28 UTC 2021

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
initarm_common already calls db_machine_init, so don't do it for a second
time otherwise the handlers list just loops.


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/cats/cats/cats_machdep.c

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

Modified files:

Index: src/sys/arch/cats/cats/cats_machdep.c
diff -u src/sys/arch/cats/cats/cats_machdep.c:1.90 src/sys/arch/cats/cats/cats_machdep.c:1.91
--- src/sys/arch/cats/cats/cats_machdep.c:1.90	Fri Aug 27 09:14:55 2021
+++ src/sys/arch/cats/cats/cats_machdep.c	Fri Aug 27 09:23:27 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cats_machdep.c,v 1.90 2021/08/27 09:14:55 skrll Exp $	*/
+/*	$NetBSD: cats_machdep.c,v 1.91 2021/08/27 09:23:27 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.90 2021/08/27 09:14:55 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.91 2021/08/27 09:23:27 skrll Exp $");
 
 #include "opt_ddb.h"
 #include "opt_modular.h"
@@ -475,7 +475,6 @@ initarm(void *arm_bootargs)
 #endif
 
 #ifdef DDB
-	db_machine_init();
 	if (boothowto & RB_KDB)
 		Debugger();
 #endif



CVS commit: src/sys/arch/cats/cats

2021-08-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Aug 27 09:14:55 UTC 2021

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
lower case for hex values.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/arch/cats/cats/cats_machdep.c

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

Modified files:

Index: src/sys/arch/cats/cats/cats_machdep.c
diff -u src/sys/arch/cats/cats/cats_machdep.c:1.89 src/sys/arch/cats/cats/cats_machdep.c:1.90
--- src/sys/arch/cats/cats/cats_machdep.c:1.89	Sat Apr 18 11:00:38 2020
+++ src/sys/arch/cats/cats/cats_machdep.c	Fri Aug 27 09:14:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cats_machdep.c,v 1.89 2020/04/18 11:00:38 skrll Exp $	*/
+/*	$NetBSD: cats_machdep.c,v 1.90 2021/08/27 09:14:55 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.89 2020/04/18 11:00:38 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.90 2021/08/27 09:14:55 skrll Exp $");
 
 #include "opt_ddb.h"
 #include "opt_modular.h"
@@ -98,7 +98,7 @@ __KERNEL_RCSID(0, "$NetBSD: cats_machdep
 /*
  * Size of available KVM space, note that growkernel will grow into this.
  */
-#define KERNEL_VM_SIZE	0x0C00
+#define KERNEL_VM_SIZE	0x0c00
 
 /*
  * Address to call from cpu_reset() to reset the machine.



CVS commit: src/sys/arch/cats/cats

2021-08-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Aug 27 09:14:55 UTC 2021

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
lower case for hex values.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/arch/cats/cats/cats_machdep.c

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



CVS commit: src/sys/arch/cats/cats

2019-04-26 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr 26 07:32:41 UTC 2019

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
The free block after the kernel from arm32_bootmem_init doesn't
account for bt_memavail.  Adjust for this.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/cats/cats/cats_machdep.c

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

Modified files:

Index: src/sys/arch/cats/cats/cats_machdep.c
diff -u src/sys/arch/cats/cats/cats_machdep.c:1.86 src/sys/arch/cats/cats/cats_machdep.c:1.87
--- src/sys/arch/cats/cats/cats_machdep.c:1.86	Tue Aug 15 08:52:41 2017
+++ src/sys/arch/cats/cats/cats_machdep.c	Fri Apr 26 07:32:40 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cats_machdep.c,v 1.86 2017/08/15 08:52:41 maya Exp $	*/
+/*	$NetBSD: cats_machdep.c,v 1.87 2019/04/26 07:32:40 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.86 2017/08/15 08:52:41 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.87 2019/04/26 07:32:40 skrll Exp $");
 
 #include "opt_ddb.h"
 #include "opt_modular.h"
@@ -333,6 +333,24 @@ initarm(void *arm_bootargs)
 	arm32_bootmem_init(ebsabootinfo.bt_memstart, ram_size,
 	ebsabootinfo.bt_memstart);
 
+	/*
+	 * The free block after the kernel from arm32_bootmem_init doesn't
+	 * account for bt_memavail.  Adjust for this.
+	 */
+	extern struct bootmem_info bootmem_info;
+	struct bootmem_info * const bmi = _info;
+
+	pv_addr_t *pv0 = >bmi_freeblocks[0];
+	KASSERTMSG(pv0->pv_pa == bmi->bmi_kernelend,
+	"pv_pa %#lx kernelend %#lx", pv0->pv_pa, bmi->bmi_kernelend);
+
+	pv0->pv_pa = ebsabootinfo.bt_memavail;
+	pv0->pv_va = KERN_PHYSTOV(pv0->pv_pa);
+	pv0->pv_size = bmi->bmi_end - pv0->pv_pa;
+
+	printf("First freeblock adjusted to: %lx -> %lx\n", pv0->pv_pa,
+	pv0->pv_pa + pv0->pv_size - 1);
+
 	arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_LOW, 0, cats_devmap,
 	mapallmem_p);
 
@@ -364,9 +382,6 @@ initarm(void *arm_bootargs)
 		ebsabootinfo.bt_pargp, VM_PROT_READ, PTE_CACHE);
 	}
 
-	extern struct bootmem_info bootmem_info;
-	struct bootmem_info * const bmi = _info;
-
 	printf("Doing freeblocks: %d\n", bmi->bmi_nfreeblocks);
 
 	for (size_t i = 0; i < bmi->bmi_nfreeblocks; i++) {



CVS commit: src/sys/arch/cats/cats

2019-04-26 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr 26 07:32:41 UTC 2019

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
The free block after the kernel from arm32_bootmem_init doesn't
account for bt_memavail.  Adjust for this.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/cats/cats/cats_machdep.c

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



CVS commit: src/sys/arch/cats/cats

2017-08-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug 15 08:52:41 UTC 2017

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
remove unnecessary include. no aout code here!


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/cats/cats/cats_machdep.c

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



CVS commit: src/sys/arch/cats/cats

2017-08-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug 15 08:52:41 UTC 2017

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
remove unnecessary include. no aout code here!


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/cats/cats/cats_machdep.c

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

Modified files:

Index: src/sys/arch/cats/cats/cats_machdep.c
diff -u src/sys/arch/cats/cats/cats_machdep.c:1.85 src/sys/arch/cats/cats/cats_machdep.c:1.86
--- src/sys/arch/cats/cats/cats_machdep.c:1.85	Tue Aug 15 08:47:39 2017
+++ src/sys/arch/cats/cats/cats_machdep.c	Tue Aug 15 08:52:41 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cats_machdep.c,v 1.85 2017/08/15 08:47:39 maya Exp $	*/
+/*	$NetBSD: cats_machdep.c,v 1.86 2017/08/15 08:52:41 maya Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.85 2017/08/15 08:47:39 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.86 2017/08/15 08:52:41 maya Exp $");
 
 #include "opt_ddb.h"
 #include "opt_modular.h"
@@ -53,7 +53,6 @@ __KERNEL_RCSID(0, "$NetBSD: cats_machdep
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 



CVS commit: src/sys/arch/cats/cats

2017-08-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug 15 08:47:39 UTC 2017

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
Remove dead code. it isn't possible to do non-__ELF__ builds


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/cats/cats/cats_machdep.c

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



CVS commit: src/sys/arch/cats/cats

2017-08-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug 15 08:47:39 UTC 2017

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
Remove dead code. it isn't possible to do non-__ELF__ builds


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/cats/cats/cats_machdep.c

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

Modified files:

Index: src/sys/arch/cats/cats/cats_machdep.c
diff -u src/sys/arch/cats/cats/cats_machdep.c:1.84 src/sys/arch/cats/cats/cats_machdep.c:1.85
--- src/sys/arch/cats/cats/cats_machdep.c:1.84	Tue Jun 13 15:24:05 2017
+++ src/sys/arch/cats/cats/cats_machdep.c	Tue Aug 15 08:47:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cats_machdep.c,v 1.84 2017/06/13 15:24:05 skrll Exp $	*/
+/*	$NetBSD: cats_machdep.c,v 1.85 2017/08/15 08:47:39 maya Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.84 2017/06/13 15:24:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.85 2017/08/15 08:47:39 maya Exp $");
 
 #include "opt_ddb.h"
 #include "opt_modular.h"
@@ -467,18 +467,6 @@ initarm(void *arm_bootargs)
 	fcomcndetach();
 #endif
 
-
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-#ifndef __ELF__		/* XXX */
-	{
-		extern int end;
-		extern int *esym;
-
-		ksyms_addsyms_elf(*(int *), ((int *)) + 1, esym);
-	}
-#endif /* __ELF__ */
-#endif
-
 #ifdef DDB
 	db_machine_init();
 	if (boothowto & RB_KDB)



CVS commit: src/sys/arch/cats/cats

2017-06-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jun 13 15:24:05 UTC 2017

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
Now that bus_space can use devmap - use it for early console


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/cats/cats/cats_machdep.c

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



CVS commit: src/sys/arch/cats/cats

2017-06-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jun 13 15:24:05 UTC 2017

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
Now that bus_space can use devmap - use it for early console


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/cats/cats/cats_machdep.c

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

Modified files:

Index: src/sys/arch/cats/cats/cats_machdep.c
diff -u src/sys/arch/cats/cats/cats_machdep.c:1.83 src/sys/arch/cats/cats/cats_machdep.c:1.84
--- src/sys/arch/cats/cats/cats_machdep.c:1.83	Sun Mar 19 12:46:21 2017
+++ src/sys/arch/cats/cats/cats_machdep.c	Tue Jun 13 15:24:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cats_machdep.c,v 1.83 2017/03/19 12:46:21 skrll Exp $	*/
+/*	$NetBSD: cats_machdep.c,v 1.84 2017/06/13 15:24:05 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.83 2017/03/19 12:46:21 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.84 2017/06/13 15:24:05 skrll Exp $");
 
 #include "opt_ddb.h"
 #include "opt_modular.h"
@@ -266,7 +266,7 @@ initarm(void *arm_bootargs)
 	pmap_devmap_bootstrap((vaddr_t)ebsabootinfo.bt_l1, cats_devmap);
 
 #ifdef FCOM_INIT_ARM
-	fcomcnattach(DC21285_ARMCSR_BASE, comcnspeed, comcnmode);
+	fcomcnattach(DC21285_ARMCSR_VBASE, comcnspeed, comcnmode);
 #endif
 
 	/* Talk to the user */



CVS commit: src/sys/arch/cats/cats

2017-03-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Mar 19 12:46:21 UTC 2017

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
Support __HAVE_MM_MD_DIRECT_MAPPED_PHYS


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/cats/cats/cats_machdep.c

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

Modified files:

Index: src/sys/arch/cats/cats/cats_machdep.c
diff -u src/sys/arch/cats/cats/cats_machdep.c:1.82 src/sys/arch/cats/cats/cats_machdep.c:1.83
--- src/sys/arch/cats/cats/cats_machdep.c:1.82	Fri Apr  4 07:33:53 2014
+++ src/sys/arch/cats/cats/cats_machdep.c	Sun Mar 19 12:46:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cats_machdep.c,v 1.82 2014/04/04 07:33:53 skrll Exp $	*/
+/*	$NetBSD: cats_machdep.c,v 1.83 2017/03/19 12:46:21 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.82 2014/04/04 07:33:53 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.83 2017/03/19 12:46:21 skrll Exp $");
 
 #include "opt_ddb.h"
 #include "opt_modular.h"
@@ -301,12 +301,41 @@ initarm(void *arm_bootargs)
 	 */
 	process_kernel_args(ebsabootinfo.bt_args);
 
-	arm32_bootmem_init(ebsabootinfo.bt_memstart,
-	ebsabootinfo.bt_memend - ebsabootinfo.bt_memstart,
+	psize_t ram_size = ebsabootinfo.bt_memend - ebsabootinfo.bt_memstart;
+	/*
+	 * If MEMSIZE specified less than what we really have, limit ourselves
+	 * to that.
+	*/
+#ifdef MEMSIZE
+	if (ram_size == 0 || ram_size > (unsigned)MEMSIZE * 1024 * 1024)
+		ram_size = (unsigned)MEMSIZE * 1024 * 1024;
+	DPRINTF("ram_size = 0x%x\n", (int)ram_size);
+#else
+	KASSERTMSG(ram_size > 0, "RAM size unknown and MEMSIZE undefined");
+#endif
+
+#ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
+	const bool mapallmem_p = true;
+
+#ifndef PMAP_NEED_ALLOC_POOLPAGE
+	if (ram_size > KERNEL_VM_BASE - KERNEL_BASE) {
+		printf("%s: dropping RAM size from %luMB to %uMB\n",
+		__func__, (unsigned long) (ram_size >> 20),
+		(KERNEL_VM_BASE - KERNEL_BASE) >> 20);
+		ram_size = KERNEL_VM_BASE - KERNEL_BASE;
+}
+#endif
+#else
+const bool mapallmem_p = false;
+#endif
+
+	printf("ram_size = 0x%08lx\n", ram_size);
+
+	arm32_bootmem_init(ebsabootinfo.bt_memstart, ram_size,
 	ebsabootinfo.bt_memstart);
 
 	arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_LOW, 0, cats_devmap,
-	false);
+	mapallmem_p);
 
 	printf("init subsystems: patch ");
 



CVS commit: src/sys/arch/cats/cats

2017-03-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Mar 19 12:46:21 UTC 2017

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
Support __HAVE_MM_MD_DIRECT_MAPPED_PHYS


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/cats/cats/cats_machdep.c

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



CVS commit: src/sys/arch/cats/cats

2014-04-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr  4 06:25:00 UTC 2014

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/cats/cats/cats_machdep.c

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

Modified files:

Index: src/sys/arch/cats/cats/cats_machdep.c
diff -u src/sys/arch/cats/cats/cats_machdep.c:1.80 src/sys/arch/cats/cats/cats_machdep.c:1.81
--- src/sys/arch/cats/cats/cats_machdep.c:1.80	Fri Apr  4 06:04:54 2014
+++ src/sys/arch/cats/cats/cats_machdep.c	Fri Apr  4 06:25:00 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cats_machdep.c,v 1.80 2014/04/04 06:04:54 skrll Exp $	*/
+/*	$NetBSD: cats_machdep.c,v 1.81 2014/04/04 06:25:00 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cats_machdep.c,v 1.80 2014/04/04 06:04:54 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: cats_machdep.c,v 1.81 2014/04/04 06:25:00 skrll Exp $);
 
 #include opt_ddb.h
 #include opt_modular.h
@@ -359,7 +359,7 @@ initarm(void *arm_bootargs)
 	 * and not have to worry about things moving.
 	 */
 #ifdef FCOM_INIT_ARM
-	 fcomcnattach(DC21285_ARMCSR_BASE, comcnspeed, comcnmode);
+	fcomcnattach(DC21285_ARMCSR_BASE, comcnspeed, comcnmode);
 #endif
 
 	/* Talk to the user */



CVS commit: src/sys/arch/cats/cats

2014-04-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr  4 06:25:00 UTC 2014

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/cats/cats/cats_machdep.c

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



CVS commit: src/sys/arch/cats/cats

2014-04-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Apr  2 11:36:50 UTC 2014

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
Don't map ebsabootinfo.bt_vargp if it is the same address as the vector page


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/cats/cats/cats_machdep.c

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

Modified files:

Index: src/sys/arch/cats/cats/cats_machdep.c
diff -u src/sys/arch/cats/cats/cats_machdep.c:1.77 src/sys/arch/cats/cats/cats_machdep.c:1.78
--- src/sys/arch/cats/cats/cats_machdep.c:1.77	Sun Aug 18 06:50:31 2013
+++ src/sys/arch/cats/cats/cats_machdep.c	Wed Apr  2 11:36:50 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cats_machdep.c,v 1.77 2013/08/18 06:50:31 matt Exp $	*/
+/*	$NetBSD: cats_machdep.c,v 1.78 2014/04/02 11:36:50 matt Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cats_machdep.c,v 1.77 2013/08/18 06:50:31 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cats_machdep.c,v 1.78 2014/04/02 11:36:50 matt Exp $);
 
 #include opt_ddb.h
 #include opt_modular.h
@@ -622,8 +622,10 @@ initarm(void *arm_bootargs)
 #endif
 
 	/* Map the boot arguments page */
-	pmap_map_entry(l1pagetable, ebsabootinfo.bt_vargp,
-	ebsabootinfo.bt_pargp, VM_PROT_READ, PTE_CACHE);
+	if (ebsabootinfo.bt_vargp != vector_page) {
+		pmap_map_entry(l1pagetable, ebsabootinfo.bt_vargp,
+		ebsabootinfo.bt_pargp, VM_PROT_READ, PTE_CACHE);
+	}
 
 	/* Map the stack pages */
 	pmap_map_chunk(l1pagetable, irqstack.pv_va, irqstack.pv_pa,



CVS commit: src/sys/arch/cats/cats

2014-04-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Apr  2 11:36:50 UTC 2014

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
Don't map ebsabootinfo.bt_vargp if it is the same address as the vector page


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/cats/cats/cats_machdep.c

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



CVS commit: src/sys/arch/cats/cats

2012-02-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Feb  6 17:51:48 UTC 2012

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
Make this compile with VERBOSE_ARM_INIT.
If the AOUT magic is not ZMAGIC, assume kernel is ELF.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/cats/cats/cats_machdep.c

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

Modified files:

Index: src/sys/arch/cats/cats/cats_machdep.c
diff -u src/sys/arch/cats/cats/cats_machdep.c:1.71 src/sys/arch/cats/cats/cats_machdep.c:1.72
--- src/sys/arch/cats/cats/cats_machdep.c:1.71	Fri Jul  1 20:35:31 2011
+++ src/sys/arch/cats/cats/cats_machdep.c	Mon Feb  6 17:51:47 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cats_machdep.c,v 1.71 2011/07/01 20:35:31 dyoung Exp $	*/
+/*	$NetBSD: cats_machdep.c,v 1.72 2012/02/06 17:51:47 matt Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cats_machdep.c,v 1.71 2011/07/01 20:35:31 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: cats_machdep.c,v 1.72 2012/02/06 17:51:47 matt Exp $);
 
 #include opt_ddb.h
 #include opt_modular.h
@@ -385,7 +385,8 @@ initarm(void *arm_bootargs)
 
 	if (ebsabootinfo.bt_magic != BT_MAGIC_NUMBER_EBSA
 	 ebsabootinfo.bt_magic != BT_MAGIC_NUMBER_CATS)
-		panic(Incompatible magic number passed in boot args);
+		panic(Incompatible magic number %#x passed in boot args,
+		ebsabootinfo.bt_magic);
 
 #ifdef VERBOSE_INIT_ARM
 	/* output the incoming bootinfo */
@@ -581,8 +582,11 @@ initarm(void *arm_bootargs)
 #endif
 
 	/* Now we fill in the L2 pagetable for the kernel static code/data */
-#ifdef ABLEELF
-	{
+	struct exec *kernexec = (struct exec *)KERNEL_TEXT_BASE;
+	if (N_GETMAGIC(kernexec[0]) != ZMAGIC) {
+		/*
+		 * If it's not a.out, assume ELF.
+		 */
 		extern char etext[], _end[];
 		size_t textsize = (uintptr_t) etext - KERNEL_BASE;
 		size_t totalsize = (uintptr_t) _end - KERNEL_BASE;
@@ -598,35 +602,27 @@ initarm(void *arm_bootargs)
 		(void) pmap_map_chunk(l1pagetable, KERNEL_BASE + logical,
 		physical_start + logical, totalsize - textsize,
 		VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
-	}
-#else
-	{
-		struct exec *kernexec = (struct exec *)KERNEL_TEXT_BASE;
-		if (N_GETMAGIC(kernexec[0]) != ZMAGIC)
-			panic(Illegal kernel format);
-		else {
-			extern int end;
-			u_int logical;
+	} else {
+		extern int end;
+		u_int logical;
 			
-			logical = pmap_map_chunk(l1pagetable, KERNEL_TEXT_BASE,
-	physical_start, kernexec-a_text,
-	VM_PROT_READ, PTE_CACHE);
-			logical += pmap_map_chunk(l1pagetable,
-	KERNEL_TEXT_BASE + logical,
-	physical_start + logical, kernexec-a_data,
-	VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
-			logical += pmap_map_chunk(l1pagetable,
-	KERNEL_TEXT_BASE + logical,
-	physical_start + logical, kernexec-a_bss,
-	VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
-			logical += pmap_map_chunk(l1pagetable,
-	KERNEL_TEXT_BASE + logical,
-	physical_start + logical, kernexec-a_syms + sizeof(int)
-	+ *(u_int *)((int)end + kernexec-a_syms + sizeof(int)),
-	VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
-		}
+		logical = pmap_map_chunk(l1pagetable, KERNEL_TEXT_BASE,
+			physical_start, kernexec-a_text,
+			VM_PROT_READ, PTE_CACHE);
+		logical += pmap_map_chunk(l1pagetable,
+			KERNEL_TEXT_BASE + logical,
+			physical_start + logical, kernexec-a_data,
+			VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
+		logical += pmap_map_chunk(l1pagetable,
+			KERNEL_TEXT_BASE + logical,
+			physical_start + logical, kernexec-a_bss,
+			VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
+		logical += pmap_map_chunk(l1pagetable,
+			KERNEL_TEXT_BASE + logical,
+			physical_start + logical, kernexec-a_syms + sizeof(int)
+			+ *(u_int *)((int)end + kernexec-a_syms + sizeof(int)),
+			VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
 	}
-#endif
 
 	/*
 	 * PATCH PATCH ...
@@ -695,7 +691,7 @@ initarm(void *arm_bootargs)
 	 */
 #ifdef VERBOSE_INIT_ARM
 	/* checking sttb address */
-	printf(cpu_setttb address = %p\n, cpu_setttb);
+	printf(cpu_setttb address = %p\n, cpufuncs.cf_setttb);
 
 	printf(kernel_l1pt=0x%08x old = 0x%08x, phys = 0x%08x\n,
 			((uint*)kernel_l1pt.pv_va)[0xf00],



CVS commit: src/sys/arch/cats/cats

2012-02-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Feb  6 17:51:48 UTC 2012

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
Make this compile with VERBOSE_ARM_INIT.
If the AOUT magic is not ZMAGIC, assume kernel is ELF.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/cats/cats/cats_machdep.c

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



CVS commit: src/sys/arch/cats/cats

2009-08-18 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Tue Aug 18 09:22:47 UTC 2009

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
No longer rely on sys/exec.h including sys/exec_aout.h.
Hi, m...@!


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/cats/cats/cats_machdep.c

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

Modified files:

Index: src/sys/arch/cats/cats/cats_machdep.c
diff -u src/sys/arch/cats/cats/cats_machdep.c:1.65 src/sys/arch/cats/cats/cats_machdep.c:1.66
--- src/sys/arch/cats/cats/cats_machdep.c:1.65	Tue Aug 11 17:04:15 2009
+++ src/sys/arch/cats/cats/cats_machdep.c	Tue Aug 18 09:22:47 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cats_machdep.c,v 1.65 2009/08/11 17:04:15 matt Exp $	*/
+/*	$NetBSD: cats_machdep.c,v 1.66 2009/08/18 09:22:47 he Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cats_machdep.c,v 1.65 2009/08/11 17:04:15 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cats_machdep.c,v 1.66 2009/08/18 09:22:47 he Exp $);
 
 #include opt_ddb.h
 #include opt_modular.h
@@ -53,6 +53,7 @@
 #include sys/systm.h
 #include sys/kernel.h
 #include sys/exec.h
+#include sys/exec_aout.h
 #include sys/proc.h
 #include sys/msgbuf.h
 #include sys/reboot.h