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

2021-05-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon May 17 22:36:31 UTC 2021

Modified Files:
src/sys/arch/mipsco/stand: Makefile.booters

Log Message:
also strip .eh_frame.  libkern dkcksum pushed bootxx_ffs 7 bytes over a limit.

remove an old comment.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/mipsco/stand/Makefile.booters

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

Modified files:

Index: src/sys/arch/mipsco/stand/Makefile.booters
diff -u src/sys/arch/mipsco/stand/Makefile.booters:1.24 src/sys/arch/mipsco/stand/Makefile.booters:1.25
--- src/sys/arch/mipsco/stand/Makefile.booters:1.24	Sat Apr  8 19:53:21 2017
+++ src/sys/arch/mipsco/stand/Makefile.booters	Mon May 17 22:36:31 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.booters,v 1.24 2017/04/08 19:53:21 christos Exp $
+#	$NetBSD: Makefile.booters,v 1.25 2021/05/17 22:36:31 mrg Exp $
 
 NOMAN=		# defined
 NOPIE=		# defined
@@ -26,8 +26,6 @@ AFLAGS+=	-D_LOCORE -D_KERNEL -DASSEMBLER
 # -I${.CURDIR}/../.. done by Makefile.inc
 CPPFLAGS+=	-nostdinc -D_STANDALONE -DNO_ABICALLS -D_NO_PROM_DEFINES
 CPPFLAGS+=	-I${.OBJDIR} -I${S}
-# compiler flags for smallest code size
-#CFLAGS=		-Os -mmemcpy -mno-abicalls -G 128
 CFLAGS=		-Os -mmemcpy -ffreestanding -mno-abicalls -msoft-float -G 128
 CFLAGS+=	-Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith
 
@@ -68,7 +66,7 @@ CPPFLAGS+=	-DPRIMARY_BOOTBLOCK \
 CHECKSIZE_CMD?=	SIZE=${SIZE} ${HOST_SH} ${.CURDIR}/../common/checksize.sh
 
 STRIPSECTIONS?= -R .reginfo -R .mdebug.abi32 -R .comment -R .pdr \
-	-R .MIPS.abiflags  -R .gnu.attributes
+	-R .MIPS.abiflags  -R .gnu.attributes -R .eh_frame
 
 .elif defined(SECONDARY_PROG)
 PROG=		${SECONDARY_PROG}



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

2021-04-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr 23 06:15:16 UTC 2021

Modified Files:
src/sys/arch/mipsco/include: bus.h

Log Message:
Use sys/cdefs.h __CONCAT3


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mipsco/include/bus.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/mipsco/include/bus.h
diff -u src/sys/arch/mipsco/include/bus.h:1.22 src/sys/arch/mipsco/include/bus.h:1.23
--- src/sys/arch/mipsco/include/bus.h:1.22	Mon Sep 23 16:17:56 2019
+++ src/sys/arch/mipsco/include/bus.h	Fri Apr 23 06:15:16 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.22 2019/09/23 16:17:56 skrll Exp $	*/
+/*	$NetBSD: bus.h,v 1.23 2021/04/23 06:15:16 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -95,15 +95,6 @@
 #endif /* BUS_SPACE_DEBUG */
 
 /*
- * Utility macro; do not use outside this file.
- */
-#ifdef __STDC__
-#define __CONCAT3(a,b,c)	a##b##c
-#else
-#define __CONCAT3(a,b,c)	a/**/b/**/c
-#endif
-
-/*
  * Bus address and size types
  */
 typedef u_long bus_addr_t;



CVS commit: src/sys/arch/mipsco

2020-11-21 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Nov 21 18:28:33 UTC 2020

Modified Files:
src/sys/arch/mipsco/isa: isa_machdep.c
src/sys/arch/mipsco/mipsco: bus_dma.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/mipsco/isa/isa_machdep.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/mipsco/mipsco/bus_dma.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/mipsco/isa/isa_machdep.c
diff -u src/sys/arch/mipsco/isa/isa_machdep.c:1.16 src/sys/arch/mipsco/isa/isa_machdep.c:1.17
--- src/sys/arch/mipsco/isa/isa_machdep.c:1.16	Sun Nov 10 21:16:30 2019
+++ src/sys/arch/mipsco/isa/isa_machdep.c	Sat Nov 21 18:28:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: isa_machdep.c,v 1.16 2019/11/10 21:16:30 chs Exp $	*/
+/*	$NetBSD: isa_machdep.c,v 1.17 2020/11/21 18:28:32 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,12 +30,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.16 2019/11/10 21:16:30 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.17 2020/11/21 18:28:32 thorpej Exp $");
 
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include 
@@ -179,7 +179,7 @@ isa_intr_establish(isa_chipset_tag_t ic,
 {
 	struct mipsco_intrhand *ih;
 
-	ih = malloc(sizeof *ih, M_DEVBUF, M_WAITOK);
+	ih = kmem_alloc(sizeof *ih, KM_SLEEP);
 	ih->ih_fun = ih_fun;
 	ih->ih_arg  = ih_arg;
 	LIST_INSERT_HEAD(&ic->intr_q, ih, ih_q);
@@ -192,7 +192,7 @@ isa_intr_disestablish(isa_chipset_tag_t 
 	struct mipsco_intrhand *ih = cookie;
 
 	LIST_REMOVE(ih, ih_q);
-	free(ih, M_DEVBUF);
+	kmem_free(ih, sizeof(*ih));
 }
 
 int

Index: src/sys/arch/mipsco/mipsco/bus_dma.c
diff -u src/sys/arch/mipsco/mipsco/bus_dma.c:1.29 src/sys/arch/mipsco/mipsco/bus_dma.c:1.30
--- src/sys/arch/mipsco/mipsco/bus_dma.c:1.29	Thu Jun 11 08:22:09 2015
+++ src/sys/arch/mipsco/mipsco/bus_dma.c	Sat Nov 21 18:28:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.29 2015/06/11 08:22:09 matt Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.30 2020/11/21 18:28:33 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,13 +31,14 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.29 2015/06/11 08:22:09 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.30 2020/11/21 18:28:33 thorpej Exp $");
 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -74,6 +75,14 @@ _bus_dma_tag_init(bus_dma_tag_t t)
 	t->_dmamem_mmap = _bus_dmamem_mmap;
 }
 
+static size_t 
+_bus_dmamap_mapsize(int const nsegments)
+{ 
+	KASSERT(nsegments > 0);
+	return sizeof(struct mipsco_bus_dmamap) +
+	(sizeof(bus_dma_segment_t) * (nsegments - 1));
+}
+
 /*
  * Common function for DMA map creation.  May be called by bus-specific
  * DMA map creation functions.
@@ -83,7 +92,6 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_
 {
 	struct mipsco_bus_dmamap *map;
 	void *mapstore;
-	size_t mapsize;
 
 	/*
 	 * Allocate and initialize the DMA map.  The end of the map
@@ -97,13 +105,10 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_
 	 * The bus_dmamap_t includes one bus_dma_segment_t, hence
 	 * the (nsegments - 1).
 	 */
-	mapsize = sizeof(struct mipsco_bus_dmamap) +
-	(sizeof(bus_dma_segment_t) * (nsegments - 1));
-	if ((mapstore = malloc(mapsize, M_DMAMAP,
-	(flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL)
+	if ((mapstore = kmem_zalloc(_bus_dmamap_mapsize(nsegments),
+	(flags & BUS_DMA_NOWAIT) ? KM_NOSLEEP : KM_SLEEP)) == NULL)
 		return (ENOMEM);
 
-	memset(mapstore, 0, mapsize);
 	map = (struct mipsco_bus_dmamap *)mapstore;
 	map->_dm_size = size;
 	map->_dm_segcnt = nsegments;
@@ -126,7 +131,7 @@ void
 _bus_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map)
 {
 
-	free(map, M_DMAMAP);
+	kmem_free(map, _bus_dmamap_mapsize(map->_dm_segcnt));
 }
 
 /*



CVS commit: src/sys/arch/mipsco/stand/installboot

2020-09-07 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Sep  7 10:44:52 UTC 2020

Modified Files:
src/sys/arch/mipsco/stand/installboot: Makefile

Log Message:
apply some GCC_NO_ADDR_OF_PACKED_MEMBER.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mipsco/stand/installboot/Makefile

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

Modified files:

Index: src/sys/arch/mipsco/stand/installboot/Makefile
diff -u src/sys/arch/mipsco/stand/installboot/Makefile:1.1 src/sys/arch/mipsco/stand/installboot/Makefile:1.2
--- src/sys/arch/mipsco/stand/installboot/Makefile:1.1	Tue Sep 26 10:00:19 2000
+++ src/sys/arch/mipsco/stand/installboot/Makefile	Mon Sep  7 10:44:52 2020
@@ -1,5 +1,7 @@
-# $NetBSD: Makefile,v 1.1 2000/09/26 10:00:19 wdk Exp $
+# $NetBSD: Makefile,v 1.2 2020/09/07 10:44:52 mrg Exp $
 
 PROG=	installboot
 
+CWARNFLAGS.gcc+=	${GCC_NO_ADDR_OF_PACKED_MEMBER}
+
 .include 



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

2016-09-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep 18 14:39:15 UTC 2016

Modified Files:
src/sys/arch/mipsco/stand: Makefile.booters

Log Message:
Strip more useless for booters sections so that we fit.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mipsco/stand/Makefile.booters

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

Modified files:

Index: src/sys/arch/mipsco/stand/Makefile.booters
diff -u src/sys/arch/mipsco/stand/Makefile.booters:1.22 src/sys/arch/mipsco/stand/Makefile.booters:1.23
--- src/sys/arch/mipsco/stand/Makefile.booters:1.22	Thu Sep  8 10:40:52 2016
+++ src/sys/arch/mipsco/stand/Makefile.booters	Sun Sep 18 10:39:15 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.booters,v 1.22 2016/09/08 14:40:52 christos Exp $
+#	$NetBSD: Makefile.booters,v 1.23 2016/09/18 14:39:15 christos Exp $
 
 NOMAN=		# defined
 NOPIE=		# defined
@@ -67,7 +67,8 @@ CPPFLAGS+=	-DPRIMARY_BOOTBLOCK \
 
 CHECKSIZE_CMD?=	SIZE=${SIZE} ${HOST_SH} ${.CURDIR}/../common/checksize.sh
 
-STRIPSECTIONS?= -R .reginfo -R .mdebug.abi32 -R .comment -R .pdr
+STRIPSECTIONS?= -R .reginfo -R .mdebug.abi32 -R .comment -R .pdr \
+	-R .MIPS.abiflags  -R .gnu.attributes
 
 .elif defined(SECONDARY_PROG)
 PROG=		${SECONDARY_PROG}



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

2016-09-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  8 14:40:52 UTC 2016

Modified Files:
src/sys/arch/mipsco/stand: Makefile.booters Makefile.inc

Log Message:
Avoid the PIE


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/mipsco/stand/Makefile.booters
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mipsco/stand/Makefile.inc

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

Modified files:

Index: src/sys/arch/mipsco/stand/Makefile.booters
diff -u src/sys/arch/mipsco/stand/Makefile.booters:1.21 src/sys/arch/mipsco/stand/Makefile.booters:1.22
--- src/sys/arch/mipsco/stand/Makefile.booters:1.21	Fri Jan 31 14:38:48 2014
+++ src/sys/arch/mipsco/stand/Makefile.booters	Thu Sep  8 10:40:52 2016
@@ -1,8 +1,9 @@
-#	$NetBSD: Makefile.booters,v 1.21 2014/01/31 19:38:48 tsutsui Exp $
+#	$NetBSD: Makefile.booters,v 1.22 2016/09/08 14:40:52 christos Exp $
 
 NOMAN=		# defined
+NOPIE=		# defined
 
-.include 
+.include 
 
 S=	${.CURDIR}/../../../..
 MIPS=	${S}/arch/mips

Index: src/sys/arch/mipsco/stand/Makefile.inc
diff -u src/sys/arch/mipsco/stand/Makefile.inc:1.4 src/sys/arch/mipsco/stand/Makefile.inc:1.5
--- src/sys/arch/mipsco/stand/Makefile.inc:1.4	Tue Aug 27 04:53:16 2002
+++ src/sys/arch/mipsco/stand/Makefile.inc	Thu Sep  8 10:40:52 2016
@@ -1,8 +1,7 @@
-#	$NetBSD: Makefile.inc,v 1.4 2002/08/27 08:53:16 lukem Exp $
+#	$NetBSD: Makefile.inc,v 1.5 2016/09/08 14:40:52 christos Exp $
 
 NOMAN=		# defined
-
-.include 
+NOPIE=		# defined
 
 BINDIR?=	/usr/mdec
 



CVS commit: src/sys/arch/mipsco/stand/installboot

2016-01-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 21 16:58:36 UTC 2016

Modified Files:
src/sys/arch/mipsco/stand/installboot: installboot.c

Log Message:
PR/50683: David Binderman: Fix memory leak.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/mipsco/stand/installboot/installboot.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/mipsco/stand/installboot/installboot.c
diff -u src/sys/arch/mipsco/stand/installboot/installboot.c:1.9 src/sys/arch/mipsco/stand/installboot/installboot.c:1.10
--- src/sys/arch/mipsco/stand/installboot/installboot.c:1.9	Thu Jun 27 17:23:21 2013
+++ src/sys/arch/mipsco/stand/installboot/installboot.c	Thu Jan 21 11:58:36 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: installboot.c,v 1.9 2013/06/27 21:23:21 christos Exp $	*/
+/*	$NetBSD: installboot.c,v 1.10 2016/01/21 16:58:36 christos Exp $	*/
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -208,6 +208,7 @@ do_install(const char *disk, const char 
 	if (nowrite) {
 	if (verbose)
 		fprintf(stderr, "not writing\n");
+	free(boot_code);
 	return;
 	}
 



CVS commit: src/sys/arch/mipsco/mipsco

2015-06-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jun 26 22:55:41 UTC 2015

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

Log Message:
Cleanup includes
Use cpu_startup_common()


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/mipsco/mipsco/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/mipsco/mipsco/machdep.c
diff -u src/sys/arch/mipsco/mipsco/machdep.c:1.78 src/sys/arch/mipsco/mipsco/machdep.c:1.79
--- src/sys/arch/mipsco/mipsco/machdep.c:1.78	Sun Jun  8 07:01:30 2014
+++ src/sys/arch/mipsco/mipsco/machdep.c	Fri Jun 26 22:55:40 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.78 2014/06/08 07:01:30 he Exp $	*/
+/*	$NetBSD: machdep.c,v 1.79 2015/06/26 22:55:40 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,66 +39,48 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.78 2014/06/08 07:01:30 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.79 2015/06/26 22:55:40 matt Exp $");
 
 /* from: Utah Hdr: machdep.c 1.63 91/04/24 */
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
 #include "opt_modular.h"
+#include "opt_execfmt.h"
+
+#include "zsc.h"			/* XXX */
+#include "com.h"			/* XXX */
+#include "ksyms.h"
 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
+#include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
+#include 
 #include 
-#include 
-#include 
-#include 
+#include 
 #include 
 #include 
-#include 
+#include 
+#include 
+#include 
 
 #include 
 
 #include 		/* mfs_initminiroot() */
 
-#include 
-#include 
-#include 
-#include 
+#include 
+#include 
 
 #ifdef DDB
 #include 
 #include 
 #endif
 
-#include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
-#include 
-
-#include 
-
-#include "opt_execfmt.h"
-
-#include "zsc.h"			/* XXX */
-#include "com.h"			/* XXX */
-#include "ksyms.h"
 
 /* maps for VM objects */
 
@@ -328,41 +310,7 @@ mach_init(int argc, char *argv[], char *
 void
 cpu_startup(void)
 {
-	vaddr_t minaddr, maxaddr;
-	char pbuf[9];
-#ifdef DEBUG
-	extern int pmapdebug;
-	int opmapdebug = pmapdebug;
-
-	pmapdebug = 0;
-#endif
-
-	/*
-	 * 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, true, 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.
-	 */
-
-#ifdef DEBUG
-	pmapdebug = opmapdebug;
-#endif
-	format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
-	printf("avail memory = %s\n", pbuf);
+	cpu_startup_common();
 }
 
 /*



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

2015-06-23 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 24 06:18:11 UTC 2015

Added Files:
src/sys/arch/mipsco/include: cpu_counter.h

Log Message:
All mips ports will need it.


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

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

Added files:

Index: src/sys/arch/mipsco/include/cpu_counter.h
diff -u /dev/null src/sys/arch/mipsco/include/cpu_counter.h:1.1
--- /dev/null	Wed Jun 24 06:18:11 2015
+++ src/sys/arch/mipsco/include/cpu_counter.h	Wed Jun 24 06:18:11 2015
@@ -0,0 +1,2 @@
+/* $NetBSD: cpu_counter.h,v 1.1 2015/06/24 06:18:11 matt Exp $ */
+#include 



CVS commit: src/sys/arch/mipsco/obio

2014-06-08 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Sun Jun  8 10:40:52 UTC 2014

Modified Files:
src/sys/arch/mipsco/obio: zs.c

Log Message:
Move the rest of real_bps handling in under #if 0, so
that we don't get set-but-not-used warnings from the compiler.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/mipsco/obio/zs.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/mipsco/obio/zs.c
diff -u src/sys/arch/mipsco/obio/zs.c:1.24 src/sys/arch/mipsco/obio/zs.c:1.25
--- src/sys/arch/mipsco/obio/zs.c:1.24	Fri Jun 13 12:25:37 2008
+++ src/sys/arch/mipsco/obio/zs.c	Sun Jun  8 10:40:52 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs.c,v 1.24 2008/06/13 12:25:37 cegger Exp $	*/
+/*	$NetBSD: zs.c,v 1.25 2014/06/08 10:40:52 he Exp $	*/
 
 /*-
  * Copyright (c) 1996, 2000 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.24 2008/06/13 12:25:37 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.25 2014/06/08 10:40:52 he Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -393,7 +393,10 @@ zs_get_speed(struct zs_chanstate *cs)
 int
 zs_set_speed(struct zs_chanstate *cs, int bps)
 {
-	int tconst, real_bps;
+	int tconst;
+#if 0
+	int real_bps;
+#endif
 
 #if 0
 	while (!(zs_read_csr(cs) & ZSRR0_TX_READY))
@@ -413,11 +416,11 @@ zs_set_speed(struct zs_chanstate *cs, in
 	if (tconst < 0)
 		return (EINVAL);
 
+#if 0
 	/* Convert back to make sure we can do it. */
 	real_bps = TCONST_TO_BPS(cs->cs_brg_clk, tconst);
 
 	/* XXX - Allow some tolerance here? */
-#if 0
 	if (real_bps != bps)
 		return (EINVAL);
 #endif



CVS commit: src/sys/arch/mipsco/mipsco

2014-06-08 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Sun Jun  8 07:01:30 UTC 2014

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

Log Message:
Kill a pair of set-but-not-used local variables.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/mipsco/mipsco/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/mipsco/mipsco/machdep.c
diff -u src/sys/arch/mipsco/mipsco/machdep.c:1.77 src/sys/arch/mipsco/mipsco/machdep.c:1.78
--- src/sys/arch/mipsco/mipsco/machdep.c:1.77	Mon Mar 24 20:06:32 2014
+++ src/sys/arch/mipsco/mipsco/machdep.c	Sun Jun  8 07:01:30 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.77 2014/03/24 20:06:32 christos Exp $	*/
+/*	$NetBSD: machdep.c,v 1.78 2014/06/08 07:01:30 he Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.77 2014/03/24 20:06:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.78 2014/06/08 07:01:30 he Exp $");
 
 /* from: Utah Hdr: machdep.c 1.63 91/04/24 */
 
@@ -183,7 +183,6 @@ mach_init(int argc, char *argv[], char *
 	extern char edata[], end[];
 	const char *bi_msg;
 #if NKSYMS || defined(DDB) || defined(MODULAR)
-	int nsym = 0;
 	char *ssym = 0;
 	char *esym = 0;
 	struct btinfo_symtab *bi_syms;
@@ -218,7 +217,6 @@ mach_init(int argc, char *argv[], char *
 
 	/* Load sysmbol table if present */
 	if (bi_syms != NULL) {
-		nsym = bi_syms->nsym;
 		ssym = (void *)bi_syms->ssym;
 		esym = (void *)bi_syms->esym;
 		kernend = (void *)mips_round_page(esym);
@@ -591,9 +589,7 @@ null_cnpollc(dev_t dev, int on)
 void
 consinit(void)
 {
-	int zs_unit;
 
-	zs_unit = 0;
 	cn_tab = &consdev_zs;
 
 	(*cn_tab->cn_init)(cn_tab);



CVS commit: src/sys/arch/mipsco/mipsco

2014-05-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu May 29 10:11:41 UTC 2014

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

Log Message:
Remove unused variable.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/mipsco/mipsco/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/mipsco/mipsco/autoconf.c
diff -u src/sys/arch/mipsco/mipsco/autoconf.c:1.26 src/sys/arch/mipsco/mipsco/autoconf.c:1.27
--- src/sys/arch/mipsco/mipsco/autoconf.c:1.26	Sat Oct 27 17:18:03 2012
+++ src/sys/arch/mipsco/mipsco/autoconf.c	Thu May 29 10:11:41 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.26 2012/10/27 17:18:03 chs Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.27 2014/05/29 10:11:41 skrll Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -48,7 +48,7 @@
 
 #define __INTR_PRIVATE
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.26 2012/10/27 17:18:03 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.27 2014/05/29 10:11:41 skrll Exp $");
 
 #include 
 #include 
@@ -88,12 +88,11 @@ struct mipsco_intrhand intrtab[MAX_INTR_
 void
 cpu_configure(void)
 {
-  	int s;
 
 	/*
 	 * Kick off autoconfiguration
 	 */
-	s = splhigh();
+	(void) splhigh();
 	if (config_rootfound("mainbus", NULL) == NULL)
 		panic("no mainbus found");
 	initcpu();



CVS commit: src/sys/arch/mipsco/stand/common

2014-02-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 14 16:04:44 UTC 2014

Modified Files:
src/sys/arch/mipsco/stand/common: boot.c

Log Message:
make sure kernel is initialized properly.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/mipsco/stand/common/boot.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/mipsco/stand/common/boot.c
diff -u src/sys/arch/mipsco/stand/common/boot.c:1.9 src/sys/arch/mipsco/stand/common/boot.c:1.10
--- src/sys/arch/mipsco/stand/common/boot.c:1.9	Sat Jan 22 14:19:20 2011
+++ src/sys/arch/mipsco/stand/common/boot.c	Fri Feb 14 11:04:44 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.9 2011/01/22 19:19:20 joerg Exp $	*/
+/*	$NetBSD: boot.c,v 1.10 2014/02/14 16:04:44 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -133,7 +133,9 @@ main(int argc, char **argv)
 			--argc;
 		}
 
-	}
+	} else
+		kernel = NULL;
+
 	if (dev == NULL) {
 		(void) devsplit(argv[0], bootname);
 		dev = bootname;
@@ -156,7 +158,7 @@ main(int argc, char **argv)
 			}
 		}
 	}
-	if (!win)
+	if (!win || !kernel)
 		goto fail;
 
 	strncpy(bi_bpath.bootpath, kernel, BTINFO_BOOTPATH_LEN);



CVS commit: src/sys/arch/mipsco/stand/common

2014-02-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  6 18:45:35 UTC 2014

Modified Files:
src/sys/arch/mipsco/stand/common: saio.c

Log Message:
fix the second copy of this file. XXX: merge them.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/mipsco/stand/common/saio.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/mipsco/stand/common/saio.c
diff -u src/sys/arch/mipsco/stand/common/saio.c:1.13 src/sys/arch/mipsco/stand/common/saio.c:1.14
--- src/sys/arch/mipsco/stand/common/saio.c:1.13	Sun Jul 17 16:54:44 2011
+++ src/sys/arch/mipsco/stand/common/saio.c	Thu Feb  6 13:45:35 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: saio.c,v 1.13 2011/07/17 20:54:44 joerg Exp $	*/
+/*	$NetBSD: saio.c,v 1.14 2014/02/06 18:45:35 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -150,7 +150,7 @@ saioopen(struct open_file *f, ...)
 	int i;
 	char *msg;
 	char buf[DEV_BSIZE];
-	int cnt;
+	size_t cnt;
 	static char device[] = "dksd(0,0,10)";
 
 	va_list ap;



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

2014-01-31 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jan 31 19:38:48 UTC 2014

Modified Files:
src/sys/arch/mipsco/stand: Makefile.booters

Log Message:
Make sure to define NOMAN before including .


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/mipsco/stand/Makefile.booters

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

Modified files:

Index: src/sys/arch/mipsco/stand/Makefile.booters
diff -u src/sys/arch/mipsco/stand/Makefile.booters:1.20 src/sys/arch/mipsco/stand/Makefile.booters:1.21
--- src/sys/arch/mipsco/stand/Makefile.booters:1.20	Thu Jan 16 01:15:34 2014
+++ src/sys/arch/mipsco/stand/Makefile.booters	Fri Jan 31 19:38:48 2014
@@ -1,4 +1,6 @@
-#	$NetBSD: Makefile.booters,v 1.20 2014/01/16 01:15:34 christos Exp $
+#	$NetBSD: Makefile.booters,v 1.21 2014/01/31 19:38:48 tsutsui Exp $
+
+NOMAN=		# defined
 
 .include 
 
@@ -8,7 +10,6 @@ MIPSCO=	${S}/arch/mipsco
 
 .PATH:	${.CURDIR}/../common
 
-NOMAN=		# defined
 BINMODE?= 444
 
 # XXX SHOULD NOT NEED TO DEFINE THESE!



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

2013-08-21 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Aug 21 07:13:51 UTC 2013

Modified Files:
src/sys/arch/mipsco/stand: Makefile.booters

Log Message:
Use 
Add missing ${_MKTARGET_LINK}


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/mipsco/stand/Makefile.booters

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

Modified files:

Index: src/sys/arch/mipsco/stand/Makefile.booters
diff -u src/sys/arch/mipsco/stand/Makefile.booters:1.17 src/sys/arch/mipsco/stand/Makefile.booters:1.18
--- src/sys/arch/mipsco/stand/Makefile.booters:1.17	Sat Jan 22 19:19:19 2011
+++ src/sys/arch/mipsco/stand/Makefile.booters	Wed Aug 21 07:13:51 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.booters,v 1.17 2011/01/22 19:19:19 joerg Exp $
+#	$NetBSD: Makefile.booters,v 1.18 2013/08/21 07:13:51 matt Exp $
 
 .include 		# for HOST_SH
 
@@ -17,21 +17,7 @@ LIBC=
 LIBCRTBEGIN=
 LIBCRTEND=
 
-.PHONY:		machine-links
-beforedepend: machine-links
-
-machine-links:	machine mipsco mips
-machine mipsco:
-	-rm -f ${.TARGET}
-	ln -s ${MIPSCO}/include ${.TARGET}
-
-mips:
-	-rm -f ${.TARGET}
-	ln -s ${MIPS}/include ${.TARGET}
-
-CLEANFILES+=	machine mipsco mips
-
-realall: machine-links ${PROG}
+realall: ${PROG}
 
 AFLAGS+=	-D_LOCORE -D_KERNEL -DASSEMBLER -mno-abicalls
 # -I${.CURDIR}/../.. done by Makefile.inc
@@ -124,7 +110,8 @@ vers.c: ${.CURDIR}/version
 	${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
 	-N ${.CURDIR}/version "mipsco"
 
-${PROG}: machine-links ${LDSCRIPT} ${OBJS} ${LIBS}
+${PROG}: ${LDSCRIPT} ${OBJS} ${LIBS}
+	${_MKTARGET_LINK}
 	${LD} ${OFORMAT} -Map ${PROG}.map -N -x -Ttext ${LOAD_ADDRESS} \
 	-T ${LDSCRIPT} -e start -o ${PROG} ${OBJS} ${LIBS}
 	@${SIZE} ${PROG}
@@ -146,3 +133,4 @@ cleanlibdir:
 	-rm -rf lib
 
 .include 
+.include 



CVS commit: src/sys/arch/mipsco/stand/installboot

2013-06-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jun 27 21:23:21 UTC 2013

Modified Files:
src/sys/arch/mipsco/stand/installboot: installboot.c

Log Message:
free boot_code
http://M00nBSD.net/ae123a9bae03f7dde5c6d654412daf5a.html


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/mipsco/stand/installboot/installboot.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/mipsco/stand/installboot/installboot.c
diff -u src/sys/arch/mipsco/stand/installboot/installboot.c:1.8 src/sys/arch/mipsco/stand/installboot/installboot.c:1.9
--- src/sys/arch/mipsco/stand/installboot/installboot.c:1.8	Wed Mar 18 06:22:32 2009
+++ src/sys/arch/mipsco/stand/installboot/installboot.c	Thu Jun 27 17:23:21 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: installboot.c,v 1.8 2009/03/18 10:22:32 cegger Exp $	*/
+/*	$NetBSD: installboot.c,v 1.9 2013/06/27 21:23:21 christos Exp $	*/
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -219,6 +219,7 @@ do_install(const char *disk, const char 
 	if ((fd = open(disk, O_WRONLY)) == -1)
 		FATALIO("open %s", bootstrap);
 	len = pwrite(fd, boot_code, boot_size, BOOTBLOCK_OFFSET);
+	free(boot_code);
 	if (len == -1)
 		FATAL("write %s", disk);
 	if (len != boot_size)



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

2011-03-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Mar 18 16:37:19 UTC 2011

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

Log Message:
- include  after MACHINE is defined
- remove redundant comment


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/mipsco/include/param.h

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

Modified files:

Index: src/sys/arch/mipsco/include/param.h
diff -u src/sys/arch/mipsco/include/param.h:1.13 src/sys/arch/mipsco/include/param.h:1.14
--- src/sys/arch/mipsco/include/param.h:1.13	Tue Feb  8 20:20:19 2011
+++ src/sys/arch/mipsco/include/param.h	Fri Mar 18 16:37:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.13 2011/02/08 20:20:19 rmind Exp $	*/
+/*	$NetBSD: param.h,v 1.14 2011/03/18 16:37:18 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -38,15 +38,9 @@
  *	@(#)param.h	8.1 (Berkeley) 6/10/93
  */
 
-/*
- * Machine-dependent constants (VM, etc) common across MIPS cpus
- */
-
 #ifndef	_MIPSCO_PARAM_H_
 #define	_MIPSCO_PARAM_H_
 
-#include 
-
 /*
  * Machine dependent constants for Mips Corp. machines
  */
@@ -54,6 +48,8 @@
 #define	_MACHINE	mipsco
 #define	MACHINE		"mipsco"
 
+#include 
+
 #define	KERNBASE	0x8000	/* start of kernel virtual */
 #define KERNTEXTOFF	0x80001000	/* start of kernel text for kvm_mkdb */
 #define	BTOPKERNBASE	((u_long)KERNBASE >> PGSHIFT)



CVS commit: src/sys/arch/mipsco/mipsco

2011-03-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Mar 10 17:30:12 UTC 2011

Modified Files:
src/sys/arch/mipsco/mipsco: mips_3x30.c

Log Message:
Set correct struct clockframe .intr value for hardclock(9).


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/mipsco/mipsco/mips_3x30.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/mipsco/mipsco/mips_3x30.c
diff -u src/sys/arch/mipsco/mipsco/mips_3x30.c:1.13 src/sys/arch/mipsco/mipsco/mips_3x30.c:1.14
--- src/sys/arch/mipsco/mipsco/mips_3x30.c:1.13	Sun Feb 20 07:56:16 2011
+++ src/sys/arch/mipsco/mipsco/mips_3x30.c	Thu Mar 10 17:30:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_3x30.c,v 1.13 2011/02/20 07:56:16 matt Exp $	*/
+/*	$NetBSD: mips_3x30.c,v 1.14 2011/03/10 17:30:12 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #define	__INTR_PRIVATE
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mips_3x30.c,v 1.13 2011/02/20 07:56:16 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_3x30.c,v 1.14 2011/03/10 17:30:12 tsutsui Exp $");
 
 #include 
 #include 
@@ -89,7 +89,7 @@
 		
 		cf.pc = pc;
 		cf.sr = status;
-		cf.intr = (curcpu()->ci_idepth > 0);
+		cf.intr = (curcpu()->ci_idepth > 1);
 
 		rambo_clkintr(&cf);
 	}



CVS commit: src/sys/arch/mipsco

2011-02-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Feb 20 07:56:16 UTC 2011

Modified Files:
src/sys/arch/mipsco/include: intr.h sysconf.h
src/sys/arch/mipsco/mipsco: autoconf.c bus_dma.c cpu.c interrupt.c
machdep.c mainbus.c mips_3x30.c

Log Message:
Merge forward matt-nb5-mips64
Adapt to new interrupt/spl framework


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/mipsco/include/intr.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/mipsco/include/sysconf.h
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/mipsco/mipsco/autoconf.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/mipsco/mipsco/bus_dma.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/mipsco/mipsco/cpu.c \
src/sys/arch/mipsco/mipsco/mainbus.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/mipsco/mipsco/interrupt.c
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/mipsco/mipsco/machdep.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mipsco/mipsco/mips_3x30.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/mipsco/include/intr.h
diff -u src/sys/arch/mipsco/include/intr.h:1.18 src/sys/arch/mipsco/include/intr.h:1.19
--- src/sys/arch/mipsco/include/intr.h:1.18	Mon Apr 13 09:37:50 2009
+++ src/sys/arch/mipsco/include/intr.h	Sun Feb 20 07:56:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.18 2009/04/13 09:37:50 he Exp $	*/
+/*	$NetBSD: intr.h,v 1.19 2011/02/20 07:56:16 matt Exp $	*/
 
 /*
  * Copyright (c) 1998 Jonathan Stone.  All rights reserved.
@@ -33,42 +33,12 @@
 #ifndef _MACHINE_INTR_H_
 #define _MACHINE_INTR_H_
 
-#define	IPL_NONE	0	/* disable only this interrupt */
-#define	IPL_SOFTCLOCK	1	/* generic software interrupts */
-#define	IPL_SOFTBIO	1	/* clock software interrupts */
-#define	IPL_SOFTNET	2	/* network software interrupts */
-#define	IPL_SOFTSERIAL	2	/* serial software interrupts */
-#define	IPL_VM		3
-#define	IPL_SCHED	4
-#define	IPL_HIGH	4	/* disable all interrupts */
-
-#define	IPL_N		5
-
-/* Interrupt sharing types. */
-#define IST_NONE	0	/* none */
-#define IST_PULSE	1	/* pulsed */
-#define IST_EDGE	2	/* edge-triggered */
-#define IST_LEVEL	3	/* level-triggered */
+#include 
 
 #ifdef _KERNEL
-#ifndef _LOCORE
-#include 
+#ifdef __INTR_PRIVATE
 #include 
-#include 
-#include 
-
-/*
- * software simulated interrupt
- */
-#define setsoft(x)	do {			\
-	extern u_int ssir;			\
-	int _s;	\
-		\
-	_s = splhigh();\
-	ssir |= 1 << (x);			\
-	_setsoftintr(MIPS_SOFT_INT_MASK_1);	\
-	splx(_s);\
-} while (0)
+#include 
 
 /*
  * nesting interrupt masks.
@@ -82,34 +52,8 @@
 #define MIPS_INT_MASK_SPL4	(MIPS_INT_MASK_4|MIPS_INT_MASK_SPL3)
 #define MIPS_INT_MASK_SPL5	(MIPS_INT_MASK_5|MIPS_INT_MASK_SPL4)
 
-#define spl0()		(void)_spllower(0)
-#define splx(s)		(void)_splset(s)
-#define splvm()		_splraise(MIPS_INT_MASK_SPL2)
-#define splsched()	_splraise(MIPS_INT_MASK_SPL2)
-#define splhigh()	_splraise(MIPS_INT_MASK_SPL2)
-
-#define splsoftclock()	_splraise(MIPS_INT_MASK_SPL_SOFT0)
-#define splsoftbio()	_splraise(MIPS_INT_MASK_SPL_SOFT0)
-#define	splsoftnet()	_splraise(MIPS_INT_MASK_SPL_SOFT1)
-#define	splsoftserial()	_splraise(MIPS_INT_MASK_SPL_SOFT1)
-
-typedef int ipl_t;
-typedef struct {
-	int _sr;
-} ipl_cookie_t;
-
-ipl_cookie_t makeiplcookie(ipl_t ipl);
-
-static inline int
-splraiseipl(ipl_cookie_t icookie)
-{
-
-	return _splraise(icookie._sr);
-}
-
 struct mipsco_intrhand {
-	LIST_ENTRY(mipsco_intrhand)
-		ih_q;
+	LIST_ENTRY(mipsco_intrhand) ih_q;
 	int	(*ih_fun)(void *);
 	void	 *ih_arg;
 	struct	mipsco_intr *ih_intrhead;
@@ -117,14 +61,18 @@
 };
 
 struct mipsco_intr {
-	LIST_HEAD(,mipsco_intrhand)
-		intr_q;
+	LIST_HEAD(,mipsco_intrhand) intr_q;
 	struct	evcnt ih_evcnt;
 	unsigned long intr_siq;
 };
 
-
+extern const struct ipl_sr_map mipsco_ipl_sr_map;
 extern struct mipsco_intrhand intrtab[];
+#define	CALL_INTR(lev)	((*intrtab[lev].ih_fun)(intrtab[lev].ih_arg))
+
+#define MAX_INTR_COOKIES 16
+
+#endif /* __INTR_PRIVATE */
 
 #define SYS_INTR_LEVEL0	0
 #define SYS_INTR_LEVEL1	1
@@ -139,10 +87,5 @@
 #define SYS_INTR_FDC	10
 #define SYS_INTR_ATBUS	11
 
-#define MAX_INTR_COOKIES 16
-
-#define	CALL_INTR(lev)	((*intrtab[lev].ih_fun)(intrtab[lev].ih_arg))
-
-#endif /* !_LOCORE */
 #endif /* _KERNEL */
 #endif /* _MACHINE_INTR_H_ */

Index: src/sys/arch/mipsco/include/sysconf.h
diff -u src/sys/arch/mipsco/include/sysconf.h:1.5 src/sys/arch/mipsco/include/sysconf.h:1.6
--- src/sys/arch/mipsco/include/sysconf.h:1.5	Sat Mar 14 14:46:02 2009
+++ src/sys/arch/mipsco/include/sysconf.h	Sun Feb 20 07:56:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysconf.h,v 1.5 2009/03/14 14:46:02 dsl Exp $	*/
+/*	$NetBSD: sysconf.h,v 1.6 2011/02/20 07:56:16 matt Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -54,7 +54,7 @@
 	 *	clkinit		-	Initialize clocks
 	 */
 	void	(*cons_init)(void);
-	void	(*iointr)(unsigned, unsigned, unsigned, unsigned);
+	void	(*iointr)(uint32_t, vaddr_t, uint32_t);
 	int	(*mems

CVS commit: src/sys/arch/mipsco

2009-08-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Aug 21 04:00:57 UTC 2009

Modified Files:
src/sys/arch/mipsco/conf: files.mipsco
src/sys/arch/mipsco/mipsco: bus_dma.c

Log Message:
Use bus_dmamem_common.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/mipsco/conf/files.mipsco
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/mipsco/mipsco/bus_dma.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/mipsco/conf/files.mipsco
diff -u src/sys/arch/mipsco/conf/files.mipsco:1.13 src/sys/arch/mipsco/conf/files.mipsco:1.14
--- src/sys/arch/mipsco/conf/files.mipsco:1.13	Fri Sep  1 13:28:17 2006
+++ src/sys/arch/mipsco/conf/files.mipsco	Fri Aug 21 04:00:56 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mipsco,v 1.13 2006/09/01 13:28:17 cube Exp $
+#	$NetBSD: files.mipsco,v 1.14 2009/08/21 04:00:56 thorpej Exp $
 
 #  MIPS Computer Corp -specific configuration info
 
@@ -61,6 +61,8 @@
 file arch/mipsco/mipsco/prom.c
 file dev/cons.c
 
+file common/bus_dma/bus_dmamem_common.c
+
 # Memory Disk
 file dev/md_root.c			memory_disk_hooks
 

Index: src/sys/arch/mipsco/mipsco/bus_dma.c
diff -u src/sys/arch/mipsco/mipsco/bus_dma.c:1.24 src/sys/arch/mipsco/mipsco/bus_dma.c:1.25
--- src/sys/arch/mipsco/mipsco/bus_dma.c:1.24	Sat Mar 14 21:04:12 2009
+++ src/sys/arch/mipsco/mipsco/bus_dma.c	Fri Aug 21 04:00:57 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.24 2009/03/14 21:04:12 dsl Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.25 2009/08/21 04:00:57 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.24 2009/03/14 21:04:12 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.25 2009/08/21 04:00:57 thorpej Exp $");
 
 #include 
 #include 
@@ -44,6 +44,8 @@
 #define _MIPSCO_BUS_DMA_PRIVATE
 #include 
 
+#include 
+
 #include 
 
 paddr_t	kvtophys(vaddr_t);	/* XXX */
@@ -510,58 +512,10 @@
 	paddr_t low;
 	paddr_t high;
 {
-	paddr_t curaddr, lastaddr;
-	struct vm_page *m;
-	struct pglist mlist;
-	int curseg, error;
-
-	/* Always round the size. */
-	size = round_page(size);
-
-	high = avail_end - PAGE_SIZE;
-
-	/*
-	 * Allocate pages from the VM system.
-	 */
-	error = uvm_pglistalloc(size, low, high, alignment, boundary,
-	&mlist, nsegs, (flags & BUS_DMA_NOWAIT) == 0);
-	if (error)
-		return (error);
-
-	/*
-	 * Compute the location, size, and number of segments actually
-	 * returned by the VM code.
-	 */
-	m = mlist.tqh_first;
-	curseg = 0;
-	lastaddr = segs[curseg]._ds_paddr = VM_PAGE_TO_PHYS(m);
-	segs[curseg].ds_addr = segs[curseg]._ds_paddr + t->dma_offset;
-	segs[curseg].ds_len = PAGE_SIZE;
-	m = m->pageq.queue.tqe_next;
 
-	for (; m != NULL; m = m->pageq.queue.tqe_next) {
-		curaddr = VM_PAGE_TO_PHYS(m);
-#ifdef DIAGNOSTIC
-		if (curaddr < avail_start || curaddr >= high) {
-			printf("uvm_pglistalloc returned non-sensical"
-			" address 0x%llx\n", (long long)curaddr);
-			panic("_bus_dmamem_alloc_range");
-		}
-#endif
-		if (curaddr == (lastaddr + PAGE_SIZE))
-			segs[curseg].ds_len += PAGE_SIZE;
-		else {
-			curseg++;
-			segs[curseg].ds_addr = curaddr + t->dma_offset;
-			segs[curseg].ds_len = PAGE_SIZE;
-			segs[curseg]._ds_paddr = curaddr;
-		}
-		lastaddr = curaddr;
-	}
-
-	*rsegs = curseg + 1;
-
-	return (0);
+	return (_bus_dmamem_alloc_range_common(t, size, alignment, boundary,
+	   segs, nsegs, rsegs, flags,
+	   low, high));
 }
 
 /*
@@ -571,25 +525,8 @@
 void
 _bus_dmamem_free(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs)
 {
-	struct vm_page *m;
-	bus_addr_t addr;
-	struct pglist mlist;
-	int curseg;
-
-	/*
-	 * Build a list of pages to free back to the VM system.
-	 */
-	TAILQ_INIT(&mlist);
-	for (curseg = 0; curseg < nsegs; curseg++) {
-		for (addr = segs[curseg]._ds_paddr;
-		addr < (segs[curseg]._ds_paddr + segs[curseg].ds_len);
-		addr += PAGE_SIZE) {
-			m = PHYS_TO_VM_PAGE(addr);
-			TAILQ_INSERT_TAIL(&mlist, m, pageq.queue);
-		}
-	}
 
-	uvm_pglistfree(&mlist);
+	_bus_dmamem_free_common(t, segs, nsegs);
 }
 
 /*
@@ -599,11 +536,6 @@
 int
 _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, size_t size, void **kvap, int flags)
 {
-	vaddr_t va;
-	bus_addr_t addr;
-	int curseg;
-	const uvm_flag_t kmflags =
-	(flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0;
 
 	/*
 	 * If we're only mapping 1 segment, use KSEG0 or KSEG1, to avoid
@@ -617,32 +549,8 @@
 		return (0);
 	}
 
-	size = round_page(size);
-
-	va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags);
-
-	if (va == 0)
-		return (ENOMEM);
-
-	*kvap = (void *)va;
-
-	for (curseg = 0; curseg < nsegs; curseg++) {
-		segs[curseg]._ds_vaddr = va;
-		for (addr = segs[curseg]._ds_paddr;
-		addr < (segs[curseg]._ds_paddr + segs[curseg].ds_len);
-		addr += PAGE_SIZE, va += PAGE_SIZE, size -= PAGE_SIZE) {
-			if (size == 0)
-panic("_bus_dmamem_

CVS commit: src/sys/arch/mipsco/isa

2009-08-19 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Aug 19 15:11:53 UTC 2009

Modified Files:
src/sys/arch/mipsco/isa: isa_machdep.c

Log Message:
isa_detach_hook() needs two arguments, the first an isa_chipset_tag_t.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/mipsco/isa/isa_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/mipsco/isa/isa_machdep.c
diff -u src/sys/arch/mipsco/isa/isa_machdep.c:1.13 src/sys/arch/mipsco/isa/isa_machdep.c:1.14
--- src/sys/arch/mipsco/isa/isa_machdep.c:1.13	Tue Aug 18 17:02:00 2009
+++ src/sys/arch/mipsco/isa/isa_machdep.c	Wed Aug 19 15:11:53 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: isa_machdep.c,v 1.13 2009/08/18 17:02:00 dyoung Exp $	*/
+/*	$NetBSD: isa_machdep.c,v 1.14 2009/08/19 15:11:53 dyoung Exp $	*/
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.13 2009/08/18 17:02:00 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.14 2009/08/19 15:11:53 dyoung Exp $");
 
 #include 
 #include 
@@ -162,7 +162,7 @@
 }
 
 void
-isa_detach_hook(device_t self)
+isa_detach_hook(isa_chipset_tag_t ic, device_t self)
 {
 }
 



CVS commit: src/sys/arch/mipsco/obio

2009-06-29 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Mon Jun 29 20:49:25 UTC 2009

Modified Files:
src/sys/arch/mipsco/obio: rambo.h

Log Message:
Fix integer constant RB_FREQUENC, 25MHz/4 is 625L, not 625000L

This fixes PR 39931

PR and fix from Miod Vallat , many thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mipsco/obio/rambo.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/mipsco/obio/rambo.h
diff -u src/sys/arch/mipsco/obio/rambo.h:1.6 src/sys/arch/mipsco/obio/rambo.h:1.7
--- src/sys/arch/mipsco/obio/rambo.h:1.6	Mon Apr 28 20:23:28 2008
+++ src/sys/arch/mipsco/obio/rambo.h	Mon Jun 29 20:49:25 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rambo.h,v 1.6 2008/04/28 20:23:28 martin Exp $	*/
+/*	$NetBSD: rambo.h,v 1.7 2009/06/29 20:49:25 mbalmer Exp $	*/
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -109,7 +109,7 @@
 #define	RB_BOUNDRY	(1<

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

2009-04-13 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Mon Apr 13 09:37:51 UTC 2009

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

Log Message:
Include  instead of  to break circular
dependency graph.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/mipsco/include/intr.h

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

Modified files:

Index: src/sys/arch/mipsco/include/intr.h
diff -u src/sys/arch/mipsco/include/intr.h:1.17 src/sys/arch/mipsco/include/intr.h:1.18
--- src/sys/arch/mipsco/include/intr.h:1.17	Sat Mar 14 14:46:02 2009
+++ src/sys/arch/mipsco/include/intr.h	Mon Apr 13 09:37:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.17 2009/03/14 14:46:02 dsl Exp $	*/
+/*	$NetBSD: intr.h,v 1.18 2009/04/13 09:37:50 he Exp $	*/
 
 /*
  * Copyright (c) 1998 Jonathan Stone.  All rights reserved.
@@ -53,7 +53,7 @@
 #ifdef _KERNEL
 #ifndef _LOCORE
 #include 
-#include 
+#include 
 #include 
 #include