CVS commit: src/sys/arch/cobalt/cobalt

2020-11-21 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Nov 21 15:26:54 UTC 2020

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

Log Message:
malloc(9) -> kmem(9)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/cobalt/cobalt/interrupt.c

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

Modified files:

Index: src/sys/arch/cobalt/cobalt/interrupt.c
diff -u src/sys/arch/cobalt/cobalt/interrupt.c:1.10 src/sys/arch/cobalt/cobalt/interrupt.c:1.11
--- src/sys/arch/cobalt/cobalt/interrupt.c:1.10	Sun Nov 10 21:16:25 2019
+++ src/sys/arch/cobalt/cobalt/interrupt.c	Sat Nov 21 15:26:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: interrupt.c,v 1.10 2019/11/10 21:16:25 chs Exp $	*/
+/*	$NetBSD: interrupt.c,v 1.11 2020/11/21 15:26:53 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2006 Izumi Tsutsui.  All rights reserved.
@@ -79,12 +79,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.10 2019/11/10 21:16:25 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.11 2020/11/21 15:26:53 thorpej Exp $");
 
 #define __INTR_PRIVATE
 
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -265,7 +265,7 @@ icu_intr_establish(int irq, int type, in
 		return NULL;
 	}
 
-	ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK);
+	ih = kmem_alloc(sizeof(*ih), KM_SLEEP);
 	ih->ih_func = func;
 	ih->ih_arg = arg;
 	ih->ih_irq = irq;
@@ -306,7 +306,7 @@ icu_intr_disestablish(void *cookie)
 			icu_set();
 		}
 		splx(s);
-		free(ih, M_DEVBUF);
+		kmem_free(ih, sizeof(*ih));
 	}
 }
 



CVS commit: src/sys/arch/cobalt/cobalt

2019-02-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Feb  6 21:42:46 UTC 2019

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

Log Message:
compare pointers with NULL not nul.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/cobalt/cobalt/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/cobalt/cobalt/machdep.c
diff -u src/sys/arch/cobalt/cobalt/machdep.c:1.121 src/sys/arch/cobalt/cobalt/machdep.c:1.122
--- src/sys/arch/cobalt/cobalt/machdep.c:1.121	Sat Jan 20 13:56:08 2018
+++ src/sys/arch/cobalt/cobalt/machdep.c	Wed Feb  6 21:42:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.121 2018/01/20 13:56:08 skrll Exp $	*/
+/*	$NetBSD: machdep.c,v 1.122 2019/02/06 21:42:46 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2006 Izumi Tsutsui.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.121 2018/01/20 13:56:08 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.122 2019/02/06 21:42:46 mrg Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -399,7 +399,7 @@ decode_bootstring(void)
 
 	/* break apart bootstring on ' ' boundries and itterate */
 	work = strtok_light(bootstring, ' ');
-	while (work != '\0') {
+	while (work != NULL) {
 		/* if starts with '-', we got options, walk its decode */
 		if (work[0] == '-') {
 			i = 1;
@@ -410,7 +410,7 @@ decode_bootstring(void)
 		} else
 
 		/* if it has a '=' its an assignment, switch and set */
-		if ((equ = strchr(work, '=')) != '\0') {
+		if ((equ = strchr(work, '=')) != NULL) {
 			if (memcmp("nfsroot=", work, 8) == 0) {
 nfsroot_bstr = (equ + 1);
 			} else



CVS commit: src/sys/arch/cobalt/cobalt

2016-07-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jul 27 11:13:14 UTC 2016

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

Log Message:
Fix RB_KDB by calling the debugger entry points after pmap_bootstrap, etc


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/sys/arch/cobalt/cobalt/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/cobalt/cobalt/machdep.c
diff -u src/sys/arch/cobalt/cobalt/machdep.c:1.117 src/sys/arch/cobalt/cobalt/machdep.c:1.118
--- src/sys/arch/cobalt/cobalt/machdep.c:1.117	Mon Jun 29 17:52:53 2015
+++ src/sys/arch/cobalt/cobalt/machdep.c	Wed Jul 27 11:13:14 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.117 2015/06/29 17:52:53 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.118 2016/07/27 11:13:14 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2006 Izumi Tsutsui.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.117 2015/06/29 17:52:53 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.118 2016/07/27 11:13:14 skrll Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -274,15 +274,6 @@ mach_init(int32_t memsize32, u_int bim, 
 		ksyms_addsyms_elf(esym - ssym, ssym, esym);
 #endif
 	KASSERT( == curlwp);
-#ifdef DDB
-	if (boothowto & RB_KDB)
-		Debugger();
-#endif
-#ifdef KGDB
-	if (boothowto & RB_KDB)
-		kgdb_connect(0);
-#endif
-
 	/*
 	 * Load the rest of the available pages into the VM system.
 	 */
@@ -302,6 +293,16 @@ mach_init(int32_t memsize32, u_int bim, 
 	 * Allocate space for proc0's USPACE.
 	 */
 	mips_init_lwp0_uarea();
+
+#ifdef DDB
+	if (boothowto & RB_KDB)
+		Debugger();
+#endif
+#ifdef KGDB
+	if (boothowto & RB_KDB)
+		kgdb_connect(0);
+#endif
+
 }
 
 /*



CVS commit: src/sys/arch/cobalt/cobalt

2015-06-29 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jun 29 17:52:53 UTC 2015

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

Log Message:
use cpu_startup_common


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/sys/arch/cobalt/cobalt/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/cobalt/cobalt/machdep.c
diff -u src/sys/arch/cobalt/cobalt/machdep.c:1.116 src/sys/arch/cobalt/cobalt/machdep.c:1.117
--- src/sys/arch/cobalt/cobalt/machdep.c:1.116	Thu Apr  3 19:15:43 2014
+++ src/sys/arch/cobalt/cobalt/machdep.c	Mon Jun 29 17:52:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.116 2014/04/03 19:15:43 joerg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.117 2015/06/29 17:52:53 matt Exp $	*/
 
 /*-
  * Copyright (c) 2006 Izumi Tsutsui.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.116 2014/04/03 19:15:43 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.117 2015/06/29 17:52:53 matt Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -310,32 +310,7 @@ mach_init(int32_t memsize32, u_int bim, 
 void
 cpu_startup(void)
 {
-	vaddr_t minaddr, maxaddr;
-	char pbuf[9];
-
-	/*
-	 * Good {morning,afternoon,evening,night}.
-	 */
-	printf(%s%s, copyright, version);
-	printf(%s\n, cpu_getmodel());
-	format_bytes(pbuf, sizeof(pbuf), ctob(physmem));
-	printf(total memory = %s\n, pbuf);
-
-	minaddr = 0;
-	/*
-	 * Allocate a submap for physio.
-	 */
-	phys_map = uvm_km_suballoc(kernel_map, minaddr, maxaddr,
-	VM_PHYS_SIZE, 0, false, NULL);
-
-	/*
-	 * (No need to allocate an mbuf cluster submap.  Mbuf clusters
-	 * are allocated via the pool allocator, and we use KSEG to
-	 * map those pages.)
-	 */
-
-	format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
-	printf(avail memory = %s\n, pbuf);
+	cpu_startup_common();
 }
 
 static int waittime = -1;



CVS commit: src/sys/arch/cobalt/cobalt

2014-04-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Apr  3 19:15:43 UTC 2014

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

Log Message:
GC nsym


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/cobalt/cobalt/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/cobalt/cobalt/machdep.c
diff -u src/sys/arch/cobalt/cobalt/machdep.c:1.115 src/sys/arch/cobalt/cobalt/machdep.c:1.116
--- src/sys/arch/cobalt/cobalt/machdep.c:1.115	Mon Mar 24 20:06:31 2014
+++ src/sys/arch/cobalt/cobalt/machdep.c	Thu Apr  3 19:15:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.115 2014/03/24 20:06:31 christos Exp $	*/
+/*	$NetBSD: machdep.c,v 1.116 2014/04/03 19:15:43 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2006 Izumi Tsutsui.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.115 2014/03/24 20:06:31 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.116 2014/04/03 19:15:43 joerg Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -141,7 +141,6 @@ mach_init(int32_t memsize32, u_int bim, 
 	extern char edata[], end[];
 	const char *bi_msg;
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-	int nsym = 0;
 	char *ssym = 0;
 	struct btinfo_symtab *bi_syms;
 #endif
@@ -206,7 +205,6 @@ mach_init(int32_t memsize32, u_int bim, 
 
 	/* Load symbol table if present */
 	if (bi_syms != NULL) {
-		nsym = bi_syms-nsym;
 		ssym = (void *)(intptr_t)bi_syms-ssym;
 		esym = (void *)(intptr_t)bi_syms-esym;
 		kernend = (void *)mips_round_page(esym);



CVS commit: src/sys/arch/cobalt/cobalt

2011-02-20 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Feb 20 15:47:28 UTC 2011

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

Log Message:
Remove leftover debug stuff.


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/arch/cobalt/cobalt/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/cobalt/cobalt/machdep.c
diff -u src/sys/arch/cobalt/cobalt/machdep.c:1.110 src/sys/arch/cobalt/cobalt/machdep.c:1.111
--- src/sys/arch/cobalt/cobalt/machdep.c:1.110	Sun Feb 20 07:54:10 2011
+++ src/sys/arch/cobalt/cobalt/machdep.c	Sun Feb 20 15:47:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.110 2011/02/20 07:54:10 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.111 2011/02/20 15:47:28 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2006 Izumi Tsutsui.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.110 2011/02/20 07:54:10 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.111 2011/02/20 15:47:28 tsutsui Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -281,7 +281,7 @@
 #endif
 	KASSERT(lwp0 == curlwp);
 #ifdef DDB
-//	if (boothowto  RB_KDB)
+	if (boothowto  RB_KDB)
 		Debugger();
 #endif
 #ifdef KGDB



CVS commit: src/sys/arch/cobalt/cobalt

2009-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Dec 18 23:22:29 UTC 2009

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

Log Message:
Cleanup some messages.
Change arguments to sign extend properly.
GENERIC64 now gets to boot prompt in gxemul.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/cobalt/cobalt/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/cobalt/cobalt/machdep.c
diff -u src/sys/arch/cobalt/cobalt/machdep.c:1.107 src/sys/arch/cobalt/cobalt/machdep.c:1.108
--- src/sys/arch/cobalt/cobalt/machdep.c:1.107	Thu Dec 17 15:29:47 2009
+++ src/sys/arch/cobalt/cobalt/machdep.c	Fri Dec 18 23:22:28 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.107 2009/12/17 15:29:47 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.108 2009/12/18 23:22:28 matt Exp $	*/
 
 /*-
  * Copyright (c) 2006 Izumi Tsutsui.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.107 2009/12/17 15:29:47 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.108 2009/12/18 23:22:28 matt Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -101,7 +101,7 @@
 struct vm_map *phys_map = NULL;
 
 int	physmem;		/* Total physical memory */
-char	*bootinfo = NULL;	/* pointer to bootinfo structure */
+void	*bootinfo = NULL;	/* pointer to bootinfo structure */
 
 char	bootstring[512];	/* Boot command */
 int	netboot;		/* Are we netbooting? */
@@ -126,7 +126,7 @@
 phys_ram_seg_t mem_clusters[VM_PHYSSEG_MAX];
 int mem_cluster_cnt;
 
-void	mach_init(unsigned int, u_int, int32_t);
+void	mach_init(intptr_t, u_int, int32_t);
 void	decode_bootstring(void);
 static char *strtok_light(char *, const char);
 static u_int read_board_id(void);
@@ -143,10 +143,9 @@
  * Do all the stuff that locore normally does before calling main().
  */
 void
-mach_init(unsigned int memsize32, u_int bim, int32_t bip32)
+mach_init(intptr_t memsize, u_int bim, int32_t bip32)
 {
-	size_t memsize = memsize32;
-	char *bip = (void *)(intptr_t)bip32;
+	void *bip = (void *)(intptr_t)bip32;
 	char *kernend;
 	u_long first, last;
 	extern char edata[], end[];
@@ -201,12 +200,17 @@
 
 		bootinfo = bip;
 		bi_magic = lookup_bootinfo(BTINFO_MAGIC);
-		if (bi_magic == NULL || bi_magic-magic != BOOTINFO_MAGIC)
-			bi_msg = invalid bootinfo structure.\n;
-		else
+		if (bi_magic == NULL) {
+			bi_msg = missing bootinfo structure;
+			bim = (uintptr_t)bip;
+		} else if (bi_magic-magic != BOOTINFO_MAGIC) {
+			bi_msg = invalid bootinfo structure;
+			bim = bi_magic-magic;
+		} else
 			bi_msg = NULL;
-	} else
-		bi_msg = invalid bootinfo (standalone boot?)\n;
+	} else {
+		bi_msg = invalid bootinfo (standalone boot?);
+	}
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)
 	bi_syms = lookup_bootinfo(BTINFO_SYMTAB);
@@ -258,7 +262,7 @@
 	consinit();
 
 	if (bi_msg != NULL)
-		printf(bi_msg);
+		printf(%s: magic=%#x\n, bi_msg, bim);
 
 	uvm_setpagesize();
 
@@ -495,7 +499,7 @@
  * Look up information in bootinfo of boot loader.
  */
 void *
-lookup_bootinfo(int type)
+lookup_bootinfo(unsigned int type)
 {
 	struct btinfo_common *bt;
 	char *help = bootinfo;