CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2009-09-02 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Sep  2 07:44:29 UTC 2009

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: syscall.c

Log Message:
Fix a copy  paste error in previous.


To generate a diff of this commit:
cvs rdiff -u -r1.37.12.7 -r1.37.12.8 src/sys/arch/mips/mips/syscall.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/mips/mips/syscall.c
diff -u src/sys/arch/mips/mips/syscall.c:1.37.12.7 src/sys/arch/mips/mips/syscall.c:1.37.12.8
--- src/sys/arch/mips/mips/syscall.c:1.37.12.7	Wed Sep  2 01:36:31 2009
+++ src/sys/arch/mips/mips/syscall.c	Wed Sep  2 07:44:28 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.37.12.7 2009/09/02 01:36:31 matt Exp $	*/
+/*	$NetBSD: syscall.c,v 1.37.12.8 2009/09/02 07:44:28 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -107,7 +107,7 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.37.12.7 2009/09/02 01:36:31 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.37.12.8 2009/09/02 07:44:28 uebayasi Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_sa.h
@@ -415,7 +415,6 @@
 			printf(syscall %u:, code);
 		printf( return error=%d\n, error);
 #endif
-		frame-f_regs[_R_A3] = 0;
 		break;
 	}
 



CVS commit: src

2009-09-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Sep  2 07:48:50 UTC 2009

Modified Files:
src/distrib/shark/instkernel/instkernel: Makefile
src/sys/arch/shark/conf: Makefile.shark.inc

Log Message:
More sections to remove when doing ELF-a.out conversion.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/distrib/shark/instkernel/instkernel/Makefile
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/shark/conf/Makefile.shark.inc

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

Modified files:

Index: src/distrib/shark/instkernel/instkernel/Makefile
diff -u src/distrib/shark/instkernel/instkernel/Makefile:1.17 src/distrib/shark/instkernel/instkernel/Makefile:1.18
--- src/distrib/shark/instkernel/instkernel/Makefile:1.17	Fri Apr  3 22:36:35 2009
+++ src/distrib/shark/instkernel/instkernel/Makefile	Wed Sep  2 07:48:50 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.17 2009/04/03 22:36:35 perry Exp $
+#	$NetBSD: Makefile,v 1.18 2009/09/02 07:48:50 skrll Exp $
 
 .include bsd.own.mk
 .include ${NETBSDSRCDIR}/distrib/common/Makefile.distrib
@@ -11,6 +11,7 @@
 
 MDSET_POST= \
 	${OBJCOPY} -O a.out-arm-netbsd -R .ident -R .arm.atpcs -R .comment \
+	-R .note.netbsd.ident -R .ARM.attributes \
 	${.TARGET} ${.TARGET}.aout; \
 	gzip -9nc ${.TARGET}.aout ${.TARGET}.aout.gz
 

Index: src/sys/arch/shark/conf/Makefile.shark.inc
diff -u src/sys/arch/shark/conf/Makefile.shark.inc:1.11 src/sys/arch/shark/conf/Makefile.shark.inc:1.12
--- src/sys/arch/shark/conf/Makefile.shark.inc:1.11	Sat Jun  7 18:47:41 2008
+++ src/sys/arch/shark/conf/Makefile.shark.inc	Wed Sep  2 07:48:50 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.shark.inc,v 1.11 2008/06/07 18:47:41 he Exp $
+#	$NetBSD: Makefile.shark.inc,v 1.12 2009/09/02 07:48:50 skrll Exp $
 
 MACHINE_ARCH=		arm
 CPPFLAGS+=		-D${MACHINE}
@@ -22,13 +22,13 @@
 		-R .ident -R .arm.atpcs -R .comment -R .note.netbsd.ident \
 		-R .debug_abbrev -R .debug_info -R .debug_line -R .debug_str \
 		-R .debug_frame -R .debug_loc -R .debug_pubnames \
-		-R .debug_aranges \
+		-R .debug_aranges -R .ARM.attributes \
 		$@ $...@.aout; \
 	${OBJCOPY} -O a.out-arm-netbsd \
 		-R .ident -R .arm.atpcs -R .comment -R .note.netbsd.ident \
 		-R .debug_abbrev -R .debug_info -R .debug_line -R .debug_str \
 		-R .debug_frame -R .debug_loc -R .debug_pubnames \
-		-R .debug_aranges \
+		-R .debug_aranges -R .ARM.attributes \
 		$@ $...@.aout
 
 KERNIMAGES=	netbsd netbsd.aout



CVS commit: src/sys

2009-09-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Sep  2 10:34:05 UTC 2009

Modified Files:
src/sys/arch/next68k/dev: esp.c
src/sys/dev/ic: ncr53c9x.c ncr53c9xvar.h

Log Message:
Some backends may use ncr53c9x_abort(), so remove static declaration from
the function and explicitly declare it in ncr53c9xvar.h.  Noticed by h...@.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/next68k/dev/esp.c
cvs rdiff -u -r1.139 -r1.140 src/sys/dev/ic/ncr53c9x.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/ic/ncr53c9xvar.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/next68k/dev/esp.c
diff -u src/sys/arch/next68k/dev/esp.c:1.57 src/sys/arch/next68k/dev/esp.c:1.58
--- src/sys/arch/next68k/dev/esp.c:1.57	Tue Dec 16 22:35:24 2008
+++ src/sys/arch/next68k/dev/esp.c	Wed Sep  2 10:34:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: esp.c,v 1.57 2008/12/16 22:35:24 christos Exp $	*/
+/*	$NetBSD: esp.c,v 1.58 2009/09/02 10:34:05 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: esp.c,v 1.57 2008/12/16 22:35:24 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: esp.c,v 1.58 2009/09/02 10:34:05 tsutsui Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -649,7 +649,6 @@
 }
 xfer_len = esc-sc_dmasize - resid;
 			} else {
-extern void	ncr53c9x_abort(struct ncr53c9x_softc *, struct ncr53c9x_ecb *);
 #define ncr53c9x_sched_msgout(m) \
 	do {			\
 		NCR_MISC((ncr53c9x_sched_msgout %x %d, m, __LINE__));	\

Index: src/sys/dev/ic/ncr53c9x.c
diff -u src/sys/dev/ic/ncr53c9x.c:1.139 src/sys/dev/ic/ncr53c9x.c:1.140
--- src/sys/dev/ic/ncr53c9x.c:1.139	Sat Aug 29 06:05:39 2009
+++ src/sys/dev/ic/ncr53c9x.c	Wed Sep  2 10:34:04 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ncr53c9x.c,v 1.139 2009/08/29 06:05:39 tsutsui Exp $	*/
+/*	$NetBSD: ncr53c9x.c,v 1.140 2009/09/02 10:34:04 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ncr53c9x.c,v 1.139 2009/08/29 06:05:39 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: ncr53c9x.c,v 1.140 2009/09/02 10:34:04 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -115,7 +115,6 @@
 static void	ncr53c9x_msgout(struct ncr53c9x_softc *);
 static void	ncr53c9x_timeout(void *arg);
 static void	ncr53c9x_watch(void *arg);
-static void	ncr53c9x_abort(struct ncr53c9x_softc *, struct ncr53c9x_ecb *);
 static void	ncr53c9x_dequeue(struct ncr53c9x_softc *,
  struct ncr53c9x_ecb *);
 static int	ncr53c9x_ioctl(struct scsipi_channel *, u_long,

Index: src/sys/dev/ic/ncr53c9xvar.h
diff -u src/sys/dev/ic/ncr53c9xvar.h:1.52 src/sys/dev/ic/ncr53c9xvar.h:1.53
--- src/sys/dev/ic/ncr53c9xvar.h:1.52	Tue May 12 14:25:18 2009
+++ src/sys/dev/ic/ncr53c9xvar.h	Wed Sep  2 10:34:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ncr53c9xvar.h,v 1.52 2009/05/12 14:25:18 cegger Exp $	*/
+/*	$NetBSD: ncr53c9xvar.h,v 1.53 2009/09/02 10:34:05 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -443,5 +443,6 @@
 void	ncr53c9x_reset(struct ncr53c9x_softc *);
 int	ncr53c9x_intr(void *);
 void	ncr53c9x_init(struct ncr53c9x_softc *, int);
+void	ncr53c9x_abort(struct ncr53c9x_softc *, struct ncr53c9x_ecb *);
 
 #endif /* _DEV_IC_NCR53C9XVAR_H_ */



CVS commit: src/sys

2009-09-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Sep  2 10:43:25 UTC 2009

Modified Files:
src/sys/arch/sgimips/mace: if_mec.c
src/sys/dev/ic: dp83932.c

Log Message:
Invert logic around nested pmf(9) registrations for readability.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/sgimips/mace/if_mec.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/ic/dp83932.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/sgimips/mace/if_mec.c
diff -u src/sys/arch/sgimips/mace/if_mec.c:1.37 src/sys/arch/sgimips/mace/if_mec.c:1.38
--- src/sys/arch/sgimips/mace/if_mec.c:1.37	Tue Sep  1 17:10:42 2009
+++ src/sys/arch/sgimips/mace/if_mec.c	Wed Sep  2 10:43:24 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mec.c,v 1.37 2009/09/01 17:10:42 tsutsui Exp $ */
+/* $NetBSD: if_mec.c,v 1.38 2009/09/02 10:43:24 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2004, 2008 Izumi Tsutsui.  All rights reserved.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_mec.c,v 1.37 2009/09/01 17:10:42 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_mec.c,v 1.38 2009/09/02 10:43:24 tsutsui Exp $);
 
 #include opt_ddb.h
 #include bpfilter.h
@@ -726,10 +726,10 @@
 #endif
 
 	/* set shutdown hook to reset interface on powerdown */
-	if (!pmf_device_register1(self, NULL, NULL, mec_shutdown))
-		aprint_error_dev(self, couldn't establish power handler\n);
-	else
+	if (pmf_device_register1(self, NULL, NULL, mec_shutdown))
 		pmf_class_network_register(self, sc-sc_ethercom.ec_if);
+	else
+		aprint_error_dev(self, couldn't establish power handler\n);
 
 	return;
 

Index: src/sys/dev/ic/dp83932.c
diff -u src/sys/dev/ic/dp83932.c:1.29 src/sys/dev/ic/dp83932.c:1.30
--- src/sys/dev/ic/dp83932.c:1.29	Tue Sep  1 17:12:42 2009
+++ src/sys/dev/ic/dp83932.c	Wed Sep  2 10:43:25 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dp83932.c,v 1.29 2009/09/01 17:12:42 tsutsui Exp $	*/
+/*	$NetBSD: dp83932.c,v 1.30 2009/09/02 10:43:25 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dp83932.c,v 1.29 2009/09/01 17:12:42 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: dp83932.c,v 1.30 2009/09/02 10:43:25 tsutsui Exp $);
 
 #include bpfilter.h
 
@@ -222,11 +222,11 @@
 	/*
 	 * Make sure the interface is shutdown during reboot.
 	 */
-	if (!pmf_device_register1(sc-sc_dev, NULL, NULL, sonic_shutdown))
+	if (pmf_device_register1(sc-sc_dev, NULL, NULL, sonic_shutdown))
+		pmf_class_network_register(sc-sc_dev, sc-sc_ethercom.ec_if);
+	else
 		aprint_error_dev(sc-sc_dev,
 		couldn't establish power handler\n);
-	else
-		pmf_class_network_register(sc-sc_dev, sc-sc_ethercom.ec_if);
 
 	return;
 



CVS commit: src/share/man/man9

2009-09-02 Thread Adam Hoka
Module Name:src
Committed By:   ahoka
Date:   Wed Sep  2 10:54:20 UTC 2009

Modified Files:
src/share/man/man9: csf.9

Log Message:
Mention sched_m4.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man9/csf.9

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

Modified files:

Index: src/share/man/man9/csf.9
diff -u src/share/man/man9/csf.9:1.5 src/share/man/man9/csf.9:1.6
--- src/share/man/man9/csf.9:1.5	Sun Mar 15 14:05:18 2009
+++ src/share/man/man9/csf.9	Wed Sep  2 10:54:20 2009
@@ -1,4 +1,4 @@
-.\ $NetBSD: csf.9,v 1.5 2009/03/15 14:05:18 joerg Exp $
+.\ $NetBSD: csf.9,v 1.6 2009/09/02 10:54:20 ahoka Exp $
 .\
 .\ Copyright (c) 2002 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd July 14, 2007
+.Dd September 2, 2009
 .Dt CSF 9
 .Os
 .Sh NAME
@@ -88,9 +88,11 @@
 provides a modular and self-contained interface for
 implementing different thread scheduling algorithms.
 The different schedulers can be selected at compile-time.
-Currently, the only scheduler available is
+Currently, the schedulers available are
 .Xr sched_4bsd 9 ,
-the traditional 4.4BSD thread scheduler.
+the traditional 4.4BSD thread scheduler, and
+.Xr sched_m2 9
+which implements a SVR4/Solaris like apporach.
 .Pp
 The interface is divided into two parts: A set of functions each
 scheduler needs to implement and common functions used by all
@@ -199,10 +201,14 @@
 .Pp
 The traditional 4.4BSD scheduler is implemented in
 .Pa sys/kern/sched_4bsd.c .
+.Pp
+The M2 scheduler is implemented in
+.Pa sys/kern/sched_m2.c .
 .Sh SEE ALSO
 .Xr mi_switch 9 ,
 .Xr preempt 9 ,
-.Xr sched_4bsd 9
+.Xr sched_4bsd 9 ,
+.Xr sched_m2 9
 .Sh HISTORY
 The
 .Nm



CVS commit: src/sys/dev

2009-09-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Sep  2 11:10:38 UTC 2009

Modified Files:
src/sys/dev/ic: aic7xxx_osm.c
src/sys/dev/pci: ahc_pci.c

Log Message:
Call pmf_device_register(9) in ahc_attahc() rather than ahc_pci_attach()
since pmf_device_deregister(9) is called from ahc_detach() so that
cardbus backend also gets proper pmf(9) calls.
PCI backend is tested on on O2, but cardbus is untested.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/ic/aic7xxx_osm.c
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/pci/ahc_pci.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/dev/ic/aic7xxx_osm.c
diff -u src/sys/dev/ic/aic7xxx_osm.c:1.31 src/sys/dev/ic/aic7xxx_osm.c:1.32
--- src/sys/dev/ic/aic7xxx_osm.c:1.31	Sat May 16 06:44:05 2009
+++ src/sys/dev/ic/aic7xxx_osm.c	Wed Sep  2 11:10:37 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic7xxx_osm.c,v 1.31 2009/05/16 06:44:05 tsutsui Exp $	*/
+/*	$NetBSD: aic7xxx_osm.c,v 1.32 2009/09/02 11:10:37 tsutsui Exp $	*/
 
 /*
  * Bus independent FreeBSD shim for the aic7xxx based adaptec SCSI controllers
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: aic7xxx_osm.c,v 1.31 2009/05/16 06:44:05 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: aic7xxx_osm.c,v 1.32 2009/09/02 11:10:37 tsutsui Exp $);
 
 #include dev/ic/aic7xxx_osm.h
 #include dev/ic/aic7xxx_inline.h
@@ -58,6 +58,8 @@
 static int	ahc_ioctl(struct scsipi_channel *channel, u_long cmd,
 			  void *addr, int flag, struct proc *p);
 
+static bool	ahc_pmf_suspend(device_t PMF_FN_PROTO);
+static bool	ahc_pmf_resume(device_t PMF_FN_PROTO);
 
 
 /*
@@ -124,11 +126,44 @@
 	if ((ahc-features  AHC_TWIN)  ahc-flags  AHC_RESET_BUS_B)
 		ahc_reset_channel(ahc, 'B', TRUE);
 
+	if (!pmf_device_register(ahc-sc_dev, ahc_pmf_suspend, ahc_pmf_resume))
+		aprint_error_dev(ahc-sc_dev,
+		couldn't establish power handler\n);
+
 	ahc_unlock(ahc, s);
 	return (1);
 }
 
 /*
+ * XXX we should call the real suspend and resume functions here
+ * but for some reason ahc_suspend() panics on shutdown
+ */
+
+static bool
+ahc_pmf_suspend(device_t dev PMF_FN_ARGS)
+{
+	struct ahc_softc *sc = device_private(dev);
+#if 0
+	return (ahc_suspend(sc) == 0);
+#else
+	ahc_shutdown(sc);
+	return true;
+#endif
+}
+
+static bool
+ahc_pmf_resume(device_t dev PMF_FN_ARGS)
+{
+#if 0
+	struct ahc_softc *sc = device_private(dev);
+
+	return (ahc_resume(sc) == 0);
+#else
+	return true;
+#endif
+}
+
+/*
  * Catch an interrupt from the adapter
  */
 void

Index: src/sys/dev/pci/ahc_pci.c
diff -u src/sys/dev/pci/ahc_pci.c:1.66 src/sys/dev/pci/ahc_pci.c:1.67
--- src/sys/dev/pci/ahc_pci.c:1.66	Wed May  6 09:25:14 2009
+++ src/sys/dev/pci/ahc_pci.c	Wed Sep  2 11:10:37 2009
@@ -39,7 +39,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: ahc_pci.c,v 1.66 2009/05/06 09:25:14 cegger Exp $
+ * $Id: ahc_pci.c,v 1.67 2009/09/02 11:10:37 tsutsui Exp $
  *
  * //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#57 $
  *
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ahc_pci.c,v 1.66 2009/05/06 09:25:14 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: ahc_pci.c,v 1.67 2009/09/02 11:10:37 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -709,9 +709,6 @@
 
 static void ahc_pci_intr(struct ahc_softc *);
 
-static bool ahc_pci_suspend(device_t PMF_FN_PROTO);
-static bool ahc_pci_resume(device_t PMF_FN_PROTO);
-
 static const struct ahc_pci_identity *
 ahc_find_pci_device(pcireg_t id, pcireg_t subid, u_int func)
 {
@@ -1102,7 +1099,6 @@
 	if (ahc_init(ahc))
 		goto error_out;
 
-	pmf_device_register(self, ahc_pci_suspend, ahc_pci_resume);
 	ahc_attach(ahc);
 
 	return;
@@ -1112,35 +1108,6 @@
 	return;
 }
 
-/*
- * XXX we should call the real suspend and resume functions here
- * but for some reason ahc_suspend() panics on shutdown
- */
-
-static bool
-ahc_pci_suspend(device_t dev PMF_FN_ARGS)
-{
-	struct ahc_softc *sc = device_private(dev);
-#if 0
-	return (ahc_suspend(sc) == 0);
-#else
-	ahc_shutdown(sc);
-	return true;
-#endif
-}
-
-static bool
-ahc_pci_resume(device_t dev PMF_FN_ARGS)
-{
-#if 0
-	struct ahc_softc *sc = device_private(dev);
-
-	return (ahc_resume(sc) == 0);
-#else
-	return true;
-#endif
-}
-
 CFATTACH_DECL_NEW(ahc_pci, sizeof(struct ahc_softc),
 ahc_pci_probe, ahc_pci_attach, NULL, NULL);
 



CVS commit: src/sys/dev/ic

2009-09-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Sep  2 11:44:11 UTC 2009

Modified Files:
src/sys/dev/ic: aic7xxx_osm.c

Log Message:
Call ahc_shutdown() during system shutdown via pmf_device_register1(9),
as well as pre-pmf(9)'fied kernel did via shutdownhook_establish(9).
Tested on O2.

ahc_suspend() and ahc_resume() are still disabled due to lack of hardware.
Anyone who can test Cardbus APA-1480?


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/ic/aic7xxx_osm.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/dev/ic/aic7xxx_osm.c
diff -u src/sys/dev/ic/aic7xxx_osm.c:1.32 src/sys/dev/ic/aic7xxx_osm.c:1.33
--- src/sys/dev/ic/aic7xxx_osm.c:1.32	Wed Sep  2 11:10:37 2009
+++ src/sys/dev/ic/aic7xxx_osm.c	Wed Sep  2 11:44:11 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic7xxx_osm.c,v 1.32 2009/09/02 11:10:37 tsutsui Exp $	*/
+/*	$NetBSD: aic7xxx_osm.c,v 1.33 2009/09/02 11:44:11 tsutsui Exp $	*/
 
 /*
  * Bus independent FreeBSD shim for the aic7xxx based adaptec SCSI controllers
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: aic7xxx_osm.c,v 1.32 2009/09/02 11:10:37 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: aic7xxx_osm.c,v 1.33 2009/09/02 11:44:11 tsutsui Exp $);
 
 #include dev/ic/aic7xxx_osm.h
 #include dev/ic/aic7xxx_inline.h
@@ -60,6 +60,7 @@
 
 static bool	ahc_pmf_suspend(device_t PMF_FN_PROTO);
 static bool	ahc_pmf_resume(device_t PMF_FN_PROTO);
+static bool	ahc_pmf_shutdown(device_t, int);
 
 
 /*
@@ -126,7 +127,8 @@
 	if ((ahc-features  AHC_TWIN)  ahc-flags  AHC_RESET_BUS_B)
 		ahc_reset_channel(ahc, 'B', TRUE);
 
-	if (!pmf_device_register(ahc-sc_dev, ahc_pmf_suspend, ahc_pmf_resume))
+	if (!pmf_device_register1(ahc-sc_dev,
+	ahc_pmf_suspend, ahc_pmf_resume, ahc_pmf_shutdown))
 		aprint_error_dev(ahc-sc_dev,
 		couldn't establish power handler\n);
 
@@ -136,7 +138,7 @@
 
 /*
  * XXX we should call the real suspend and resume functions here
- * but for some reason ahc_suspend() panics on shutdown
+ * but pmf(9) stuff on cardbus backend is untested yet
  */
 
 static bool
@@ -163,6 +165,17 @@
 #endif
 }
 
+static bool
+ahc_pmf_shutdown(device_t dev, int howto)
+{
+	struct ahc_softc *sc = device_private(dev);
+
+	/* Disable all interrupt sources by resetting the controller */
+	ahc_shutdown(sc);
+
+	return true;
+}
+
 /*
  * Catch an interrupt from the adapter
  */



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2009-09-02 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Sep  2 13:00:39 UTC 2009

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: fp.S

Log Message:
Fix O32 build.


To generate a diff of this commit:
cvs rdiff -u -r1.33.38.4 -r1.33.38.5 src/sys/arch/mips/mips/fp.S

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/mips/mips/fp.S
diff -u src/sys/arch/mips/mips/fp.S:1.33.38.4 src/sys/arch/mips/mips/fp.S:1.33.38.5
--- src/sys/arch/mips/mips/fp.S:1.33.38.4	Wed Aug 26 14:29:11 2009
+++ src/sys/arch/mips/mips/fp.S	Wed Sep  2 13:00:39 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: fp.S,v 1.33.38.4 2009/08/26 14:29:11 matt Exp $	*/
+/*	$NetBSD: fp.S,v 1.33.38.5 2009/09/02 13:00:39 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -73,6 +73,7 @@
 #define COND_LESS	0x4
 #define COND_SIGNAL	0x8
 
+#if defined(SOFTFLOAT)
 #if defined(__mips_o32) || defined(__mips_o64)
 #define FPX_L			INT_L
 #define FPX_S			INT_S
@@ -92,6 +93,7 @@
 #define	FPX_REGMASK		(0x1F  FPX_SCALESHIFT)
 #define	FPX_REGEVENMASK		(0x1E  FPX_SCALESHIFT)
 #define	REG_REGMASK		(0x1F  REG_SCALESHIFT)
+#endif
 
 /* insns are reordered in the way as MIPS architecture imposes */
 	.set	reorder
@@ -166,7 +168,7 @@
 	sll	v0, v0, PTR_SCALESHIFT
 	PTR_L	v0, func_long_fixed_tbl(v0)
 	j	v0
-#if defined(MIPS3_PLUS)  0
+#if (defined(__mips_n32) || defined(__mips_n64))  0
 paired_single_op:
 	andi	v0, a0, 0x3F		# get FUNC field
 	sll	v0, v0, PTR_SCALESHIFT
@@ -184,7 +186,7 @@
 #define	dmtoc1		ill
 #define	ctoc1		ill
 #define	branchc1	ill
-#elif !defined(MIPS3_PLUS)
+#elif !(defined(__mips_n32) || defined(__mips_n64))
 #define	dmfromc1	ill
 #define	dmtoc1		ill
 #endif
@@ -679,7 +681,7 @@
 
 	b	done
 
-#if defined(MIPS3_PLUS)  defined(SOFTFLOAT)
+#if defined(SOFTFLOAT)  (defined(__mips_n32) || defined(__mips_n64))
 dmfromc1:
 	srl	t1, a0, 11-DFPX_SCALESHIFT	# fs is in bits 15:11
 	PTR_L	t0, L_ADDR(MIPS_CURLWP)		# get pcb of current process
@@ -715,7 +717,7 @@
 	DFPX_S	v0, U_PCB_FPREGS+FRAME_FP0(t0)
 
 	b	done
-#endif /* MIPS3_PLUS  SOFTFLOAT */
+#endif /* SOFTFLOAT  (__mips_n32 || __mips_n64) */
 
 cfromc1:
 	srl	t1, a0, 11



CVS commit: src/sys

2009-09-02 Thread Thor Lancelot Simon
Module Name:src
Committed By:   tls
Date:   Wed Sep  2 14:56:57 UTC 2009

Modified Files:
src/sys/kern: uipc_socket2.c
src/sys/net: if_gre.c
src/sys/netinet: accf_data.c accf_http.c
src/sys/sys: socketvar.h

Log Message:
Add a direction argument to socket upcalls, so they can tell why they've
been called when, for example, they're waiting for space to write.  From
Ritesh Agrawal at Coyote Point.


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/kern/uipc_socket2.c
cvs rdiff -u -r1.140 -r1.141 src/sys/net/if_gre.c
cvs rdiff -u -r1.5 -r1.6 src/sys/netinet/accf_data.c
cvs rdiff -u -r1.6 -r1.7 src/sys/netinet/accf_http.c
cvs rdiff -u -r1.119 -r1.120 src/sys/sys/socketvar.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/kern/uipc_socket2.c
diff -u src/sys/kern/uipc_socket2.c:1.103 src/sys/kern/uipc_socket2.c:1.104
--- src/sys/kern/uipc_socket2.c:1.103	Fri Jul 24 01:09:49 2009
+++ src/sys/kern/uipc_socket2.c	Wed Sep  2 14:56:57 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_socket2.c,v 1.103 2009/07/24 01:09:49 christos Exp $	*/
+/*	$NetBSD: uipc_socket2.c,v 1.104 2009/09/02 14:56:57 tls Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uipc_socket2.c,v 1.103 2009/07/24 01:09:49 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: uipc_socket2.c,v 1.104 2009/09/02 14:56:57 tls Exp $);
 
 #include opt_mbuftrace.h
 #include opt_sb_max.h
@@ -190,7 +190,8 @@
 			so-so_upcallarg = head-so_accf-so_accept_filter_arg;
 			so-so_rcv.sb_flags |= SB_UPCALL;
 			so-so_options = ~SO_ACCEPTFILTER;
-			(*so-so_upcall)(so, so-so_upcallarg, M_DONTWAIT);
+			(*so-so_upcall)(so, so-so_upcallarg,
+	 POLLIN|POLLRDNORM, M_DONTWAIT);
 		}
 	} else {
 		cv_broadcast(so-so_cv);
@@ -472,7 +473,7 @@
 	if (sb-sb_flags  SB_ASYNC)
 		fownsignal(so-so_pgid, SIGIO, code, band, so);
 	if (sb-sb_flags  SB_UPCALL)
-		(*so-so_upcall)(so, so-so_upcallarg, M_DONTWAIT);
+		(*so-so_upcall)(so, so-so_upcallarg, band, M_DONTWAIT);
 }
 
 /*

Index: src/sys/net/if_gre.c
diff -u src/sys/net/if_gre.c:1.140 src/sys/net/if_gre.c:1.141
--- src/sys/net/if_gre.c:1.140	Tue Apr 28 23:05:25 2009
+++ src/sys/net/if_gre.c	Wed Sep  2 14:56:57 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gre.c,v 1.140 2009/04/28 23:05:25 dyoung Exp $ */
+/*	$NetBSD: if_gre.c,v 1.141 2009/09/02 14:56:57 tls Exp $ */
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_gre.c,v 1.140 2009/04/28 23:05:25 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_gre.c,v 1.141 2009/09/02 14:56:57 tls Exp $);
 
 #include opt_atalk.h
 #include opt_gre.h
@@ -419,7 +419,7 @@
 }
 
 static void
-gre_receive(struct socket *so, void *arg, int waitflag)
+gre_receive(struct socket *so, void *arg, int events, int waitflag)
 {
 	struct gre_softc *sc = (struct gre_softc *)arg;
 	int rc;

Index: src/sys/netinet/accf_data.c
diff -u src/sys/netinet/accf_data.c:1.5 src/sys/netinet/accf_data.c:1.6
--- src/sys/netinet/accf_data.c:1.5	Thu Nov 20 10:22:11 2008
+++ src/sys/netinet/accf_data.c	Wed Sep  2 14:56:57 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: accf_data.c,v 1.5 2008/11/20 10:22:11 ad Exp $	*/
+/*	$NetBSD: accf_data.c,v 1.6 2009/09/02 14:56:57 tls Exp $	*/
 
 /*-
  * Copyright (c) 2000 Alfred Perlstein alf...@freebsd.org
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: accf_data.c,v 1.5 2008/11/20 10:22:11 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: accf_data.c,v 1.6 2009/09/02 14:56:57 tls Exp $);
 
 #define ACCEPT_FILTER_MOD
 
@@ -44,7 +44,7 @@
 
 /* accept filter that holds a socket until data arrives */
 
-static void	sohasdata(struct socket *so, void *arg, int waitflag);
+static void	sohasdata(struct socket *so, void *arg, int events, int waitflag);
 
 static struct accept_filter accf_data_filter = {
 	.accf_name = dataready,
@@ -77,7 +77,7 @@
 }
 
 static void
-sohasdata(struct socket *so, void *arg, int waitflag)
+sohasdata(struct socket *so, void *arg, int events, int waitflag)
 {
 
 	if (!soreadable(so))

Index: src/sys/netinet/accf_http.c
diff -u src/sys/netinet/accf_http.c:1.6 src/sys/netinet/accf_http.c:1.7
--- src/sys/netinet/accf_http.c:1.6	Fri Nov 21 16:08:57 2008
+++ src/sys/netinet/accf_http.c	Wed Sep  2 14:56:57 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: accf_http.c,v 1.6 2008/11/21 16:08:57 joerg Exp $	*/
+/*	$NetBSD: accf_http.c,v 1.7 2009/09/02 14:56:57 tls Exp $	*/
 
 /*-
  * Copyright (c) 2000 Paycounter, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: accf_http.c,v 1.6 2008/11/21 16:08:57 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: accf_http.c,v 1.7 2009/09/02 14:56:57 tls Exp $);
 
 #define ACCEPT_FILTER_MOD
 
@@ -46,11 +46,11 @@
 MODULE(MODULE_CLASS_MISC, accf_httpready, NULL);
 
 /* check for GET/HEAD */
-static void 

CVS commit: src/sys/arch/x86/acpi

2009-09-02 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Sep  2 15:25:07 UTC 2009

Modified Files:
src/sys/arch/x86/acpi: acpi_wakeup.c

Log Message:
Don't allow machdep.acpi_vbios_reset=2 if option VGA_POST is missing.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/x86/acpi/acpi_wakeup.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/x86/acpi/acpi_wakeup.c
diff -u src/sys/arch/x86/acpi/acpi_wakeup.c:1.16 src/sys/arch/x86/acpi/acpi_wakeup.c:1.17
--- src/sys/arch/x86/acpi/acpi_wakeup.c:1.16	Mon Aug 24 02:15:46 2009
+++ src/sys/arch/x86/acpi/acpi_wakeup.c	Wed Sep  2 15:25:07 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_wakeup.c,v 1.16 2009/08/24 02:15:46 jmcneill Exp $	*/
+/*	$NetBSD: acpi_wakeup.c,v 1.17 2009/09/02 15:25:07 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_wakeup.c,v 1.16 2009/08/24 02:15:46 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_wakeup.c,v 1.17 2009/09/02 15:25:07 joerg Exp $);
 
 /*-
  * Copyright (c) 2001 Takanori Watanabe takaw...@jp.freebsd.org
@@ -103,6 +103,8 @@
 #include x86/cpuvar.h
 #include x86/x86/tsc.h
 
+#include opt_vga.h
+
 #include acpi_wakecode.h
 
 /* Address is also hard-coded in acpi_wakecode.S */
@@ -463,6 +465,11 @@
 	if (t  0 || t  2)
 		return EINVAL;
 
+#ifndef VGA_POST
+	if (t == 2)
+		return EINVAL;
+#endif
+
 	acpi_md_vbios_reset = t;
 
 	return 0;



CVS commit: src/sys/arch/x86/acpi

2009-09-02 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Sep  2 15:42:31 UTC 2009

Modified Files:
src/sys/arch/x86/acpi: acpi_wakeup.c

Log Message:
Be a bit more noisy by telling the user VGA_POST is missing in the
kernel config when trying machdep.acpi_vbios_reset=2.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/x86/acpi/acpi_wakeup.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/x86/acpi/acpi_wakeup.c
diff -u src/sys/arch/x86/acpi/acpi_wakeup.c:1.17 src/sys/arch/x86/acpi/acpi_wakeup.c:1.18
--- src/sys/arch/x86/acpi/acpi_wakeup.c:1.17	Wed Sep  2 15:25:07 2009
+++ src/sys/arch/x86/acpi/acpi_wakeup.c	Wed Sep  2 15:42:31 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_wakeup.c,v 1.17 2009/09/02 15:25:07 joerg Exp $	*/
+/*	$NetBSD: acpi_wakeup.c,v 1.18 2009/09/02 15:42:31 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_wakeup.c,v 1.17 2009/09/02 15:25:07 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_wakeup.c,v 1.18 2009/09/02 15:42:31 joerg Exp $);
 
 /*-
  * Copyright (c) 2001 Takanori Watanabe takaw...@jp.freebsd.org
@@ -466,8 +466,11 @@
 		return EINVAL;
 
 #ifndef VGA_POST
-	if (t == 2)
+	if (t == 2) {
+		aprint_error(WARNING: machdep.acpi_vbios_reset=2 
+		unsupported (no option VGA_POST in kernel config)\n);
 		return EINVAL;
+	}
 #endif
 
 	acpi_md_vbios_reset = t;



CVS commit: [matt-nb5-mips64] src/libexec/ld.elf_so/arch/mips

2009-09-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep  2 15:49:42 UTC 2009

Modified Files:
src/libexec/ld.elf_so/arch/mips [matt-nb5-mips64]: rtld_start.S

Log Message:
Readjust sp by correct amount.


To generate a diff of this commit:
cvs rdiff -u -r1.9.44.1 -r1.9.44.2 \
src/libexec/ld.elf_so/arch/mips/rtld_start.S

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

Modified files:

Index: src/libexec/ld.elf_so/arch/mips/rtld_start.S
diff -u src/libexec/ld.elf_so/arch/mips/rtld_start.S:1.9.44.1 src/libexec/ld.elf_so/arch/mips/rtld_start.S:1.9.44.2
--- src/libexec/ld.elf_so/arch/mips/rtld_start.S:1.9.44.1	Wed Aug 26 03:32:53 2009
+++ src/libexec/ld.elf_so/arch/mips/rtld_start.S	Wed Sep  2 15:49:42 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld_start.S,v 1.9.44.1 2009/08/26 03:32:53 matt Exp $	*/
+/*	$NetBSD: rtld_start.S,v 1.9.44.2 2009/09/02 15:49:42 matt Exp $	*/
 
 /*
  * Copyright 1997 Michael L. Hitch mhi...@montana.edu
@@ -61,7 +61,7 @@
 
 	PTR_L	a1, 0*SZREG(sp)		# our atexit function
 	PTR_L	a2, 1*SZREG(sp)		# obj_main entry
-	PTR_ADDU sp, 3*SZREG		# readjust stack
+	PTR_ADDU sp, 2*SZREG		# readjust stack
 	move	a0, s0			# stack pointer
 	move	t9, v0
 	jr	t9			# _start(sp, cleanup, obj);



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2009-09-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep  2 15:55:17 UTC 2009

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: genassym.cf

Log Message:
If N32/N64, define FRAME_A[4-7]


To generate a diff of this commit:
cvs rdiff -u -r1.44.12.2 -r1.44.12.3 src/sys/arch/mips/mips/genassym.cf

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/mips/mips/genassym.cf
diff -u src/sys/arch/mips/mips/genassym.cf:1.44.12.2 src/sys/arch/mips/mips/genassym.cf:1.44.12.3
--- src/sys/arch/mips/mips/genassym.cf:1.44.12.2	Fri Aug 21 17:47:08 2009
+++ src/sys/arch/mips/mips/genassym.cf	Wed Sep  2 15:55:17 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.44.12.2 2009/08/21 17:47:08 matt Exp $
+#	$NetBSD: genassym.cf,v 1.44.12.3 2009/09/02 15:55:17 matt Exp $
 #
 # Copyright (c) 1992, 1993
 #	The Regents of the University of California.  All rights reserved.
@@ -169,6 +169,11 @@
 define	FRAME_T5		offsetof(struct frame, f_regs[_R_T5])
 define	FRAME_T6		offsetof(struct frame, f_regs[_R_T6])
 define	FRAME_T7		offsetof(struct frame, f_regs[_R_T7])
+else
+define	FRAME_A4		offsetof(struct frame, f_regs[_R_A4])
+define	FRAME_A5		offsetof(struct frame, f_regs[_R_A5])
+define	FRAME_A6		offsetof(struct frame, f_regs[_R_A6])
+define	FRAME_A7		offsetof(struct frame, f_regs[_R_A7])
 endif
 
 define	FRAME_S0		offsetof(struct frame, f_regs[_R_S0])



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2009-09-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep  2 15:56:52 UTC 2009

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: mipsX_subr.S

Log Message:
If N32/N64, in SystemCall save and restore A4-A7 into/from the frame.


To generate a diff of this commit:
cvs rdiff -u -r1.26.36.1.2.4 -r1.26.36.1.2.5 \
src/sys/arch/mips/mips/mipsX_subr.S

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/mips/mips/mipsX_subr.S
diff -u src/sys/arch/mips/mips/mipsX_subr.S:1.26.36.1.2.4 src/sys/arch/mips/mips/mipsX_subr.S:1.26.36.1.2.5
--- src/sys/arch/mips/mips/mipsX_subr.S:1.26.36.1.2.4	Wed Sep  2 01:34:55 2009
+++ src/sys/arch/mips/mips/mipsX_subr.S	Wed Sep  2 15:56:52 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: mipsX_subr.S,v 1.26.36.1.2.4 2009/09/02 01:34:55 matt Exp $	*/
+/*	$NetBSD: mipsX_subr.S,v 1.26.36.1.2.5 2009/09/02 15:56:52 matt Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -876,10 +876,17 @@
 	move	s2, t2# stash most of temporary regs
 	REG_S	t3, FRAME_T3(k1)		# syscall saved gp for fork
 	mfc0	a1, MIPS_COP_0_STATUS		# 2nd arg is STATUS
+#if defined(__mips_n32) || defined(__mips_n64)
+	REG_S	a4, FRAME_A4(k1)
+	REG_S	a5, FRAME_A5(k1)
+	REG_S	a6, FRAME_A6(k1)
+	REG_S	a7, FRAME_A7(k1)
+#else
 	move	s4, ta0
 	move	s5, ta1
 	move	s6, ta2
 	move	s7, ta3
+#endif
 	#REG_S	t8, FRAME_T8(k1)
 	#REG_S	t9, FRAME_T9(k1)
 	REG_S	gp, FRAME_GP(k1)
@@ -982,10 +989,17 @@
 	move	t1, s1
 	move	t2, s2
 	REG_L	t3, FRAME_T3(k1)	# restore the syscall saved gp
+#if defined(__mips_n32) || defined(__mips_n64)
+	REG_L	a4, FRAME_A4(k1)
+	REG_L	a5, FRAME_A5(k1)
+	REG_L	a6, FRAME_A6(k1)
+	REG_L	a7, FRAME_A7(k1)
+#else
 	move	ta0, s4
 	move	ta1, s5
 	move	ta2, s6
 	move	ta3, s7
+#endif
 	REG_L	s0, FRAME_S0(k1)
 	REG_L	s1, FRAME_S1(k1)
 	REG_L	s2, FRAME_S2(k1)



CVS commit: src/sys/dev/ic

2009-09-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Sep  2 16:38:17 UTC 2009

Modified Files:
src/sys/dev/ic: aic79xx.c aic79xx_osm.c

Log Message:
Replace shutdownhook_establish(9) with pmf_device_register1(9).
Untested, but mostly copied from ahc(4).

This may fix reboot failure problem on ahd(4) after pmf(9) merge:
http://mail-index.NetBSD.org/current-users/2007/12/10/0008.html
which was also seen on old ahc(4):
http://mail-index.NetBSD.org/port-sgimips/2008/01/05/msg03.html


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/ic/aic79xx.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/ic/aic79xx_osm.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/dev/ic/aic79xx.c
diff -u src/sys/dev/ic/aic79xx.c:1.41 src/sys/dev/ic/aic79xx.c:1.42
--- src/sys/dev/ic/aic79xx.c:1.41	Wed Mar 18 16:00:18 2009
+++ src/sys/dev/ic/aic79xx.c	Wed Sep  2 16:38:17 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic79xx.c,v 1.41 2009/03/18 16:00:18 cegger Exp $	*/
+/*	$NetBSD: aic79xx.c,v 1.42 2009/09/02 16:38:17 tsutsui Exp $	*/
 
 /*
  * Core routines and tables shareable across OS platforms.
@@ -49,7 +49,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: aic79xx.c,v 1.41 2009/03/18 16:00:18 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: aic79xx.c,v 1.42 2009/09/02 16:38:17 tsutsui Exp $);
 
 #include dev/ic/aic79xx_osm.h
 #include dev/ic/aic79xx_inline.h
@@ -6177,9 +6177,6 @@
 	ahd_timer_reset(ahd-stat_timer, AHD_STAT_UPDATE_US,
 			ahd_stat_timer, ahd);
 
-	/* We have to wait until after any system dumps... */
-	ahd-shutdown_hook = shutdownhook_establish(ahd_shutdown, ahd);
-
 	return (0);
 }
 

Index: src/sys/dev/ic/aic79xx_osm.c
diff -u src/sys/dev/ic/aic79xx_osm.c:1.21 src/sys/dev/ic/aic79xx_osm.c:1.22
--- src/sys/dev/ic/aic79xx_osm.c:1.21	Tue May 12 14:25:17 2009
+++ src/sys/dev/ic/aic79xx_osm.c	Wed Sep  2 16:38:17 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic79xx_osm.c,v 1.21 2009/05/12 14:25:17 cegger Exp $	*/
+/*	$NetBSD: aic79xx_osm.c,v 1.22 2009/09/02 16:38:17 tsutsui Exp $	*/
 
 /*
  * Bus independent NetBSD shim for the aic7xxx based adaptec SCSI controllers
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: aic79xx_osm.c,v 1.21 2009/05/12 14:25:17 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: aic79xx_osm.c,v 1.22 2009/09/02 16:38:17 tsutsui Exp $);
 
 #include dev/ic/aic79xx_osm.h
 #include dev/ic/aic79xx_inline.h
@@ -64,6 +64,10 @@
 static void	ahd_set_recoveryscb(struct ahd_softc *ahd, struct scb *scb);
 #endif
 
+static bool	ahd_pmf_suspend(device_t PMF_FN_PROTO);
+static bool	ahd_pmf_resume(device_t PMF_FN_PROTO);
+static bool	ahd_pmf_shutdown(device_t, int);
+
 /*
  * Attach all the sub-devices we can find
  */
@@ -103,11 +107,51 @@
 	if (ahd-flags  AHD_RESET_BUS_A)
 		ahd_reset_channel(ahd, 'A', TRUE);
 
+	if (!pmf_device_register1(ahd-sc_dev,
+	ahd_pmf_suspend, ahd_pmf_resume, ahd_pmf_shutdown))
+		aprint_error_dev(ahd-sc_dev,
+		couldn't establish power handler\n);
+
 ahd_unlock(ahd, s);
 
 	return (1);
 }
 
+static bool
+ahd_pmf_suspend(device_t dev PMF_FN_ARGS)
+{
+	struct ahd_softc *sc = device_private(dev);
+#if 0
+	return (ahd_suspend(sc) == 0);
+#else
+	ahd_shutdown(sc);
+	return true;
+#endif
+}
+
+static bool
+ahd_pmf_resume(device_t dev PMF_FN_ARGS)
+{
+#if 0
+	struct ahd_softc *sc = device_private(dev);
+
+	return (ahd_resume(sc) == 0);
+#else
+	return true;
+#endif
+}
+
+static bool
+ahd_pmf_shutdown(device_t dev, int howto)
+{
+	struct ahd_softc *sc = device_private(dev);
+
+	/* Disable all interrupt sources by resetting the controller */
+	ahd_shutdown(sc);
+
+	return true;
+}
+
 static int
 ahd_ioctl(struct scsipi_channel *channel, u_long cmd,
 	  void *addr, int flag, struct proc *p)
@@ -766,7 +810,7 @@
 	if (ahd-sc_child != NULL)
 		rv = config_detach((void *)ahd-sc_child, flags);
 
-	shutdownhook_disestablish(ahd-shutdown_hook);
+	pmf_device_deregister(ahd-sc_dev);
 
 	ahd_free(ahd);
 



CVS commit: src/sys/rump/librump/rumpdev

2009-09-02 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Sep  2 16:55:07 UTC 2009

Modified Files:
src/sys/rump/librump/rumpdev: devnodes.c

Log Message:
add address space specifiers to do_sys_mk{dir,nod} calls


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/librump/rumpdev/devnodes.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/rump/librump/rumpdev/devnodes.c
diff -u src/sys/rump/librump/rumpdev/devnodes.c:1.1 src/sys/rump/librump/rumpdev/devnodes.c:1.2
--- src/sys/rump/librump/rumpdev/devnodes.c:1.1	Mon Jul 20 18:04:13 2009
+++ src/sys/rump/librump/rumpdev/devnodes.c	Wed Sep  2 16:55:07 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: devnodes.c,v 1.1 2009/07/20 18:04:13 pooka Exp $	*/
+/*	$NetBSD: devnodes.c,v 1.2 2009/09/02 16:55:07 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -26,10 +26,11 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: devnodes.c,v 1.1 2009/07/20 18:04:13 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: devnodes.c,v 1.2 2009/09/02 16:55:07 pooka Exp $);
 
 #include sys/param.h
 #include sys/device.h
+#include sys/filedesc.h
 #include sys/kmem.h
 #include sys/stat.h
 #include sys/vfs_syscalls.h
@@ -46,7 +47,7 @@
 	size_t devlen;
 	register_t retval;
 
-	error = do_sys_mkdir(/dev, 0777);
+	error = do_sys_mkdir(/dev, 0777, UIO_SYSSPACE);
 	if (error != 0  error != EEXIST)
 		return error;
 
@@ -61,7 +62,7 @@
 		*p = minchar;
 
 		if ((error = do_sys_mknod(curlwp, devname, 0666 | devtype,
-		makedev(maj, minnum), retval)))
+		makedev(maj, minnum), retval, UIO_SYSSPACE)))
 			goto out;
 	}
 



CVS commit: src/sys/dev/ic

2009-09-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Sep  2 17:08:13 UTC 2009

Modified Files:
src/sys/dev/ic: aic79xx.c aic79xx_inline.h aic79xx_osm.c aic79xx_osm.h
aic79xxvar.h

Log Message:
TAB vs space cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/ic/aic79xx.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/ic/aic79xx_inline.h \
src/sys/dev/ic/aic79xx_osm.h
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/ic/aic79xx_osm.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/ic/aic79xxvar.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/dev/ic/aic79xx.c
diff -u src/sys/dev/ic/aic79xx.c:1.42 src/sys/dev/ic/aic79xx.c:1.43
--- src/sys/dev/ic/aic79xx.c:1.42	Wed Sep  2 16:38:17 2009
+++ src/sys/dev/ic/aic79xx.c	Wed Sep  2 17:08:12 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic79xx.c,v 1.42 2009/09/02 16:38:17 tsutsui Exp $	*/
+/*	$NetBSD: aic79xx.c,v 1.43 2009/09/02 17:08:12 tsutsui Exp $	*/
 
 /*
  * Core routines and tables shareable across OS platforms.
@@ -49,7 +49,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: aic79xx.c,v 1.42 2009/09/02 16:38:17 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: aic79xx.c,v 1.43 2009/09/02 17:08:12 tsutsui Exp $);
 
 #include dev/ic/aic79xx_osm.h
 #include dev/ic/aic79xx_inline.h
@@ -75,7 +75,7 @@
  * Hardware error codes.
  */
 struct ahd_hard_error_entry {
-uint8_t errno;
+	uint8_t errno;
 	const char *errmesg;
 };
 
@@ -1445,7 +1445,7 @@
 			/*
 			 * Remove the second instance of this SCB from
 			 * the QINFIFO if it is still there.
- */
+			 */
 			ahd_print_path(ahd, scb);
 			printf(SCB completes before TMF\n);
 			/*
@@ -1790,7 +1790,7 @@
 	silent = FALSE;
 	if (lqistat1 == 0
 	 || (lqistat1  LQICRCI_NLQ) != 0) {
-	 	if ((lqistat1  (LQICRCI_NLQ|LQIOVERI_NLQ)) != 0)
+		if ((lqistat1  (LQICRCI_NLQ|LQIOVERI_NLQ)) != 0)
 			ahd_set_active_fifo(ahd);
 		scbid = ahd_get_scbptr(ahd);
 		scb = ahd_lookup_scb(ahd, scbid);
@@ -2008,7 +2008,7 @@
 		scbid = ahd_inw(ahd, CURRSCB);
 		scb = ahd_lookup_scb(ahd, scbid);
 		if (scb == NULL)
-		   panic(SCB not valid during LQOBUSFREE);
+			panic(SCB not valid during LQOBUSFREE);
 		/*
 		 * Clear the status.
 		 */
@@ -2530,8 +2530,8 @@
 		if (stepping == FALSE) {
 
 			first_instr = seqaddr;
-  			ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
-  			simode0 = ahd_inb(ahd, SIMODE0);
+			ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG);
+			simode0 = ahd_inb(ahd, SIMODE0);
 			simode3 = ahd_inb(ahd, SIMODE3);
 			lqimode0 = ahd_inb(ahd, LQIMODE0);
 			lqimode1 = ahd_inb(ahd, LQIMODE1);
@@ -2573,7 +2573,7 @@
 		ahd_outb(ahd, LQOMODE1, lqomode1);
 		ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
 		ahd_outb(ahd, SEQCTL0, ahd_inb(ahd, SEQCTL0)  ~STEP);
-  		ahd_outb(ahd, SIMODE1, simode1);
+		ahd_outb(ahd, SIMODE1, simode1);
 		/*
 		 * SCSIINT seems to glitch occassionally when
 		 * the interrupt masks are restored.  Clear SCSIINT
@@ -2990,7 +2990,7 @@
 
 	old_period = tinfo-curr.period;
 	old_offset = tinfo-curr.offset;
-	old_ppr	   = tinfo-curr.ppr_options;
+	old_ppr= tinfo-curr.ppr_options;
 
 	if ((type  AHD_TRANS_CUR) != 0
 	  (old_period != period
@@ -4265,7 +4265,7 @@
 /*
  * Send our own SDTR in reply
  */
-			  	if (bootverbose
+if (bootverbose
   devinfo-role == ROLE_INITIATOR) {
 	printf((%s:%c:%d:%d): Target 
 	   Initiated SDTR\n,
@@ -4338,7 +4338,7 @@
  */
 if (bootverbose
   devinfo-role == ROLE_INITIATOR) {
-  	printf((%s:%c:%d:%d): Target 
+	printf((%s:%c:%d:%d): Target 
 	   Initiated WDTR\n,
 	   ahd_name(ahd), devinfo-channel,
 	   devinfo-target, devinfo-lun);
@@ -4607,7 +4607,7 @@
 			 * Attempt to negotiate 80MHz which will turn
 			 * off these options.
 			 */
-		  	if (bootverbose) {
+			if (bootverbose) {
 printf((%s:%c:%d:%d): PPR Rejected. 
    Trying simple U160 PPR\n,
    ahd_name(ahd), devinfo-channel,
@@ -4622,7 +4622,7 @@
 			 * Target does not support the PPR message.
 			 * Attempt to negotiate SPI-2 style.
 			 */
-		  if (bootverbose) {
+			if (bootverbose) {
 printf((%s:%c:%d:%d): PPR Rejected. 
    Trying WDTR/SDTR\n,
    ahd_name(ahd), devinfo-channel,
@@ -4700,7 +4700,7 @@
 		 */
 		ahd_outb(ahd, SCB_CONTROL,
 			 ahd_inb_scbram(ahd, SCB_CONTROL)  mask);
-	 	scb-hscb-control = mask;
+		scb-hscb-control = mask;
 		ahd_set_transaction_tag(scb, /*enabled*/FALSE,
 	/*type*/MSG_SIMPLE_TASK);
 		ahd_outb(ahd, MSG_OUT, MSG_IDENTIFYFLAG);
@@ -4871,7 +4871,7 @@
 	 */
 	sg++;
 	sgptr = ahd_sg_virt_to_bus(ahd, scb,
-  sg);
+   sg);
 }
 			}
 			/*
@@ -5167,13 +5167,13 @@
 		TAILQ_REMOVE(ahd_tailq, ahd, links);
 		/* FALLTHROUGH */
 	case 1:
-	  	bus_dmamap_unload(ahd-parent_dmat, ahd-shared_data_map.dmamap);
+		bus_dmamap_unload(ahd-parent_dmat, 

CVS commit: src/sys

2009-09-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Sep  2 17:22:53 UTC 2009

Modified Files:
src/sys/arch/sgimips/mace: if_mec.c
src/sys/dev/ic: dp83932.c

Log Message:
Use a proper local variable.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/sgimips/mace/if_mec.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/ic/dp83932.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/sgimips/mace/if_mec.c
diff -u src/sys/arch/sgimips/mace/if_mec.c:1.38 src/sys/arch/sgimips/mace/if_mec.c:1.39
--- src/sys/arch/sgimips/mace/if_mec.c:1.38	Wed Sep  2 10:43:24 2009
+++ src/sys/arch/sgimips/mace/if_mec.c	Wed Sep  2 17:22:53 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mec.c,v 1.38 2009/09/02 10:43:24 tsutsui Exp $ */
+/* $NetBSD: if_mec.c,v 1.39 2009/09/02 17:22:53 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2004, 2008 Izumi Tsutsui.  All rights reserved.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_mec.c,v 1.38 2009/09/02 10:43:24 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_mec.c,v 1.39 2009/09/02 17:22:53 tsutsui Exp $);
 
 #include opt_ddb.h
 #include bpfilter.h
@@ -727,7 +727,7 @@
 
 	/* set shutdown hook to reset interface on powerdown */
 	if (pmf_device_register1(self, NULL, NULL, mec_shutdown))
-		pmf_class_network_register(self, sc-sc_ethercom.ec_if);
+		pmf_class_network_register(self, ifp);
 	else
 		aprint_error_dev(self, couldn't establish power handler\n);
 

Index: src/sys/dev/ic/dp83932.c
diff -u src/sys/dev/ic/dp83932.c:1.31 src/sys/dev/ic/dp83932.c:1.32
--- src/sys/dev/ic/dp83932.c:1.31	Wed Sep  2 14:58:38 2009
+++ src/sys/dev/ic/dp83932.c	Wed Sep  2 17:22:53 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dp83932.c,v 1.31 2009/09/02 14:58:38 tsutsui Exp $	*/
+/*	$NetBSD: dp83932.c,v 1.32 2009/09/02 17:22:53 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dp83932.c,v 1.31 2009/09/02 14:58:38 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: dp83932.c,v 1.32 2009/09/02 17:22:53 tsutsui Exp $);
 
 #include bpfilter.h
 
@@ -223,7 +223,7 @@
 	 * Make sure the interface is shutdown during reboot.
 	 */
 	if (pmf_device_register1(sc-sc_dev, NULL, NULL, sonic_shutdown))
-		pmf_class_network_register(sc-sc_dev, sc-sc_ethercom.ec_if);
+		pmf_class_network_register(sc-sc_dev, ifp);
 	else
 		aprint_error_dev(sc-sc_dev,
 		couldn't establish power handler\n);



CVS commit: [matt-nb5-mips64] src/sys/kern

2009-09-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep  2 17:50:25 UTC 2009

Modified Files:
src/sys/kern [matt-nb5-mips64]: exec_elf32.c

Log Message:
If we have a ELF_MD_PROBE_FUNC, let it deal with ELF_INTERP_NON_RELOCATABLE.


To generate a diff of this commit:
cvs rdiff -u -r1.136.8.1 -r1.136.8.2 src/sys/kern/exec_elf32.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/kern/exec_elf32.c
diff -u src/sys/kern/exec_elf32.c:1.136.8.1 src/sys/kern/exec_elf32.c:1.136.8.2
--- src/sys/kern/exec_elf32.c:1.136.8.1	Fri Aug 21 18:00:36 2009
+++ src/sys/kern/exec_elf32.c	Wed Sep  2 17:50:25 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_elf32.c,v 1.136.8.1 2009/08/21 18:00:36 matt Exp $	*/
+/*	$NetBSD: exec_elf32.c,v 1.136.8.2 2009/09/02 17:50:25 matt Exp $	*/
 
 /*-
  * Copyright (c) 1994, 2000, 2005 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(1, $NetBSD: exec_elf32.c,v 1.136.8.1 2009/08/21 18:00:36 matt Exp $);
+__KERNEL_RCSID(1, $NetBSD: exec_elf32.c,v 1.136.8.2 2009/09/02 17:50:25 matt Exp $);
 
 /* If not included by exec_elf64.c, ELFSIZE won't be defined. */
 #ifndef ELFSIZE
@@ -916,8 +916,7 @@
 #ifdef ELF_MD_PROBE_FUNC
 	if ((error = ELF_MD_PROBE_FUNC(l, epp, eh, itp, pos)) != 0)
 		return error;
-#endif
-#ifdef ELF_INTERP_NON_RELOCATABLE
+#elif defined(ELF_INTERP_NON_RELOCATABLE)
 	*pos = ELF_LINK_ADDR;
 #endif
 	return 0;



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2009-09-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Sep  2 17:52:10 UTC 2009

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: cpu_exec.c

Log Message:
s/entry_p/start_p/ in mips_netbsd_elfXX_probe


To generate a diff of this commit:
cvs rdiff -u -r1.50.54.1.4.5 -r1.50.54.1.4.6 \
src/sys/arch/mips/mips/cpu_exec.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/mips/mips/cpu_exec.c
diff -u src/sys/arch/mips/mips/cpu_exec.c:1.50.54.1.4.5 src/sys/arch/mips/mips/cpu_exec.c:1.50.54.1.4.6
--- src/sys/arch/mips/mips/cpu_exec.c:1.50.54.1.4.5	Wed Sep  2 01:36:03 2009
+++ src/sys/arch/mips/mips/cpu_exec.c	Wed Sep  2 17:52:10 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_exec.c,v 1.50.54.1.4.5 2009/09/02 01:36:03 matt Exp $	*/
+/*	$NetBSD: cpu_exec.c,v 1.50.54.1.4.6 2009/09/02 17:52:10 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu_exec.c,v 1.50.54.1.4.5 2009/09/02 01:36:03 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu_exec.c,v 1.50.54.1.4.6 2009/09/02 17:52:10 matt Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_compat_ultrix.h
@@ -312,7 +312,7 @@
 #if EXEC_ELF32
 int
 mips_netbsd_elf32_probe(struct lwp *l, struct exec_package *epp, void *eh0,
-	char *idt, vaddr_t *entry_p)
+	char *idt, vaddr_t *start_p)
 {
 	struct proc * const p = l-l_proc;
 	const Elf32_Ehdr * const eh = eh0;
@@ -404,7 +404,7 @@
 #if EXEC_ELF64
 int
 mips_netbsd_elf64_probe(struct lwp *l, struct exec_package *epp, void *eh0,
-	char *idt, vaddr_t *entry_p)
+	char *idt, vaddr_t *start_p)
 {
 	struct proc * const p = l-l_proc;
 	const Elf64_Ehdr * const eh = eh0;



CVS commit: src/sys/rump

2009-09-02 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Sep  2 19:02:51 UTC 2009

Modified Files:
src/sys/rump/include/rump: rumpuser.h
src/sys/rump/librump/rumpuser: rumpuser_net.c

Log Message:
add rumpuser_net_setsockopt()


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/rump/include/rump/rumpuser.h
cvs rdiff -u -r1.6 -r1.7 src/sys/rump/librump/rumpuser/rumpuser_net.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/rump/include/rump/rumpuser.h
diff -u src/sys/rump/include/rump/rumpuser.h:1.24 src/sys/rump/include/rump/rumpuser.h:1.25
--- src/sys/rump/include/rump/rumpuser.h:1.24	Wed Jun 10 18:34:49 2009
+++ src/sys/rump/include/rump/rumpuser.h	Wed Sep  2 19:02:51 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpuser.h,v 1.24 2009/06/10 18:34:49 pooka Exp $	*/
+/*	$NetBSD: rumpuser.h,v 1.25 2009/09/02 19:02:51 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -179,5 +179,6 @@
 enum rumpuser_getnametype { RUMPUSER_SOCKNAME, RUMPUSER_PEERNAME };
 int  rumpuser_net_getname(int, struct sockaddr *, int *,
 			  enum rumpuser_getnametype, int *);
+int  rumpuser_net_setsockopt(int, int, int, const void *, int, int *);
 
 #endif /* _RUMP_RUMPUSER_H_ */

Index: src/sys/rump/librump/rumpuser/rumpuser_net.c
diff -u src/sys/rump/librump/rumpuser/rumpuser_net.c:1.6 src/sys/rump/librump/rumpuser/rumpuser_net.c:1.7
--- src/sys/rump/librump/rumpuser/rumpuser_net.c:1.6	Mon Jan 26 12:08:39 2009
+++ src/sys/rump/librump/rumpuser/rumpuser_net.c	Wed Sep  2 19:02:51 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpuser_net.c,v 1.6 2009/01/26 12:08:39 pooka Exp $	*/
+/*	$NetBSD: rumpuser_net.c,v 1.7 2009/09/02 19:02:51 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -27,7 +27,7 @@
 
 #include sys/cdefs.h
 #if !defined(lint)
-__RCSID($NetBSD: rumpuser_net.c,v 1.6 2009/01/26 12:08:39 pooka Exp $);
+__RCSID($NetBSD: rumpuser_net.c,v 1.7 2009/09/02 19:02:51 pooka Exp $);
 #endif /* !lint */
 
 #include sys/types.h
@@ -108,3 +108,18 @@
 
 	return rv;
 }
+
+int
+rumpuser_net_setsockopt(int s, int level, int name,
+	const void *data, int dlen, int *error)
+{
+	socklen_t slen = dlen;
+	int rv;
+
+	rv = setsockopt(s, level, name, data, slen);
+	if (rv == -1)
+		*error = errno;
+	else
+		*error = 0;
+	return rv;
+}



CVS commit: src/sys/rump/net/lib/libsockin

2009-09-02 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Sep  2 19:04:52 UTC 2009

Modified Files:
src/sys/rump/net/lib/libsockin: sockin.c

Log Message:
* implement pr_ctloutput
* check for errno before more costly checks


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/rump/net/lib/libsockin/sockin.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/rump/net/lib/libsockin/sockin.c
diff -u src/sys/rump/net/lib/libsockin/sockin.c:1.15 src/sys/rump/net/lib/libsockin/sockin.c:1.16
--- src/sys/rump/net/lib/libsockin/sockin.c:1.15	Wed Mar 18 10:22:45 2009
+++ src/sys/rump/net/lib/libsockin/sockin.c	Wed Sep  2 19:04:51 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: sockin.c,v 1.15 2009/03/18 10:22:45 cegger Exp $	*/
+/*	$NetBSD: sockin.c,v 1.16 2009/09/02 19:04:51 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008, 2009 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sockin.c,v 1.15 2009/03/18 10:22:45 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: sockin.c,v 1.16 2009/09/02 19:04:51 pooka Exp $);
 
 #include sys/param.h
 #include sys/condvar.h
@@ -197,7 +197,7 @@
 		m_freem(m);
 
 		/* Treat a TCP socket a goner */
-		if (so-so_proto-pr_type == SOCK_STREAM  error != EAGAIN) {
+		if (error != EAGAIN  so-so_proto-pr_type == SOCK_STREAM) {
 			mutex_enter(softnet_lock);
 			soisdisconnected(so);
 			mutex_exit(softnet_lock);
@@ -464,7 +464,9 @@
 static int
 sockin_ctloutput(int op, struct socket *so, struct sockopt *sopt)
 {
+	int error;
 
-	/* XXX: we should also do something here */
-	return 0;
+	rumpuser_net_setsockopt(SO2S(so), sopt-sopt_level,
+	sopt-sopt_name, sopt-sopt_data, sopt-sopt_size, error);
+	return error;
 }



CVS commit: src/sys/net80211

2009-09-02 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Sep  2 22:03:08 UTC 2009

Modified Files:
src/sys/net80211: ieee80211_input.c

Log Message:
Fix ALTQ for bridge mode. Based on FreeBSD's revision 1.115.
Tested by r...@.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/net80211/ieee80211_input.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/net80211/ieee80211_input.c
diff -u src/sys/net80211/ieee80211_input.c:1.67 src/sys/net80211/ieee80211_input.c:1.68
--- src/sys/net80211/ieee80211_input.c:1.67	Wed Dec 17 20:51:37 2008
+++ src/sys/net80211/ieee80211_input.c	Wed Sep  2 22:03:08 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211_input.c,v 1.67 2008/12/17 20:51:37 cegger Exp $	*/
+/*	$NetBSD: ieee80211_input.c,v 1.68 2009/09/02 22:03:08 joerg Exp $	*/
 /*-
  * Copyright (c) 2001 Atsushi Onoe
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -36,7 +36,7 @@
 __FBSDID($FreeBSD: src/sys/net80211/ieee80211_input.c,v 1.81 2005/08/10 16:22:29 sam Exp $);
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, $NetBSD: ieee80211_input.c,v 1.67 2008/12/17 20:51:37 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: ieee80211_input.c,v 1.68 2009/09/02 22:03:08 joerg Exp $);
 #endif
 
 #include opt_inet.h
@@ -710,6 +710,7 @@
 	struct ether_header *eh = mtod(m, struct ether_header *);
 	struct ifnet *ifp = ic-ic_ifp;
 	ALTQ_DECL(struct altq_pktattr pktattr;)
+	int error;
 
 	/* perform as a bridge within the AP */
 	if (ic-ic_opmode == IEEE80211_M_HOSTAP 
@@ -756,9 +757,11 @@
 			}
 #endif
 			len = m1-m_pkthdr.len;
-			IF_ENQUEUE(ifp-if_snd, m1);
-			if (m != NULL)
+			IFQ_ENQUEUE(ifp-if_snd, m1, pktattr, error);
+			if (error) {
 ifp-if_omcasts++;
+m = NULL;
+			}
 			ifp-if_obytes += len;
 		}
 	}



CVS commit: [matt-nb5-mips64] src/distrib/sets

2009-09-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Sep  3 00:22:48 UTC 2009

Modified Files:
src/distrib/sets [matt-nb5-mips64]: sets.subr

Log Message:
Teach it about MKATF, MKCXX, and MKGROFF


To generate a diff of this commit:
cvs rdiff -u -r1.71.2.5 -r1.71.2.5.4.1 src/distrib/sets/sets.subr

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

Modified files:

Index: src/distrib/sets/sets.subr
diff -u src/distrib/sets/sets.subr:1.71.2.5 src/distrib/sets/sets.subr:1.71.2.5.4.1
--- src/distrib/sets/sets.subr:1.71.2.5	Wed Apr  8 00:09:27 2009
+++ src/distrib/sets/sets.subr	Thu Sep  3 00:22:48 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: sets.subr,v 1.71.2.5 2009/04/08 00:09:27 snj Exp $
+#	$NetBSD: sets.subr,v 1.71.2.5.4.1 2009/09/03 00:22:48 matt Exp $
 #
 
 #
@@ -22,6 +22,7 @@
 # as well as:
 #
 MKVARS=\
+	MKATF		\
 	MKBFD		\
 	MKCATPAGES	\
 	MKCOMPAT	\
@@ -30,6 +31,7 @@
 	MKCRYPTO_MDC2	\
 	MKCRYPTO_RC5	\
 	MKCVS		\
+	MKCXX		\
 	MKDEBUG		\
 	MKDEBUGLIB	\
 	MKDOC		\
@@ -37,6 +39,7 @@
 	MKGCC		\
 	MKGCCCMDS	\
 	MKGDB		\
+	MKGROFF		\
 	MKHESIOD	\
 	MKHTML		\
 	MKINET6		\
@@ -228,7 +231,7 @@
 # In each file, a record consists of a path and a System Package name,
 # separated by whitespace. E.g.,
 #
-# 	# $NetBSD: sets.subr,v 1.71.2.5 2009/04/08 00:09:27 snj Exp $
+# 	# $NetBSD: sets.subr,v 1.71.2.5.4.1 2009/09/03 00:22:48 matt Exp $
 # 	.			base-sys-root	[keyword[,...]]
 # 	./altroot		base-sys-root
 # 	./bin			base-sys-root



CVS commit: [matt-nb5-mips64] src/distrib/sets/lists/comp

2009-09-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Sep  3 00:23:38 UTC 2009

Modified Files:
src/distrib/sets/lists/comp [matt-nb5-mips64]: mi

Log Message:
Fix typo (at - atf)


To generate a diff of this commit:
cvs rdiff -u -r1.1201.2.9.2.1.2.2 -r1.1201.2.9.2.1.2.3 \
src/distrib/sets/lists/comp/mi

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1201.2.9.2.1.2.2 src/distrib/sets/lists/comp/mi:1.1201.2.9.2.1.2.3
--- src/distrib/sets/lists/comp/mi:1.1201.2.9.2.1.2.2	Wed Aug 26 04:41:36 2009
+++ src/distrib/sets/lists/comp/mi	Thu Sep  3 00:23:38 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1201.2.9.2.1.2.2 2009/08/26 04:41:36 matt Exp $
+#	$NetBSD: mi,v 1.1201.2.9.2.1.2.3 2009/09/03 00:23:38 matt Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -2232,7 +2232,7 @@
 ./usr/lib/libasn1_p.acomp-krb5-proflib	kerberos,profile
 ./usr/lib/libatf-c++.acomp-atf-lib		atf
 ./usr/lib/libatf-c++_g.a		-unknown-	debuglib
-./usr/lib/libatf-c++_p.a			comp-atf-lib		profile,at
+./usr/lib/libatf-c++_p.a			comp-atf-lib		profile,atf
 ./usr/lib/libatf-c.acomp-atf-lib		atf
 ./usr/lib/libatf-c_g.a		-unknown-	debuglib
 ./usr/lib/libatf-c_p.acomp-atf-lib		profile,cxx



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2009-09-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Sep  3 00:10:19 UTC 2009

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: trap.c

Log Message:
If DEBUG, if a lwp gets a fatal signal, print signo, cause, pc, va and
a register dump.


To generate a diff of this commit:
cvs rdiff -u -r1.217.12.7 -r1.217.12.8 src/sys/arch/mips/mips/trap.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/mips/mips/trap.c
diff -u src/sys/arch/mips/mips/trap.c:1.217.12.7 src/sys/arch/mips/mips/trap.c:1.217.12.8
--- src/sys/arch/mips/mips/trap.c:1.217.12.7	Wed Sep  2 01:35:22 2009
+++ src/sys/arch/mips/mips/trap.c	Thu Sep  3 00:10:18 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.217.12.7 2009/09/02 01:35:22 matt Exp $	*/
+/*	$NetBSD: trap.c,v 1.217.12.8 2009/09/03 00:10:18 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -78,7 +78,7 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.217.12.7 2009/09/02 01:35:22 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.217.12.8 2009/09/03 00:10:18 matt Exp $);
 
 #include opt_cputype.h	/* which mips CPU levels do we support? */
 #include opt_ddb.h
@@ -565,10 +565,18 @@
 	fp-f_regs[_R_CAUSE] = cause;
 	fp-f_regs[_R_BADVADDR] = vaddr;
 #if defined(DEBUG)
-	printf(trap: pid %d(%s): sig %d: cause=%#x pc=%#PRIxREGISTER
-	 ra=%#PRIxREGISTER va=%#PRIxVADDR  gp=%#PRIxREGISTER\n,
-	p-p_pid, p-p_comm, ksi.ksi_signo, cause, fp-f_regs[_R_PC],
-	fp-f_regs[_R_RA], vaddr, fp-f_regs[_R_GP]);
+	printf(trap: pid %d(%s): sig %d: cause=%#x epc=%#PRIxREGISTER
+	 va=%#PRIxVADDR\n,
+	p-p_pid, p-p_comm, ksi.ksi_signo, cause,
+	fp-f_regs[_R_PC], vaddr);
+	printf(registers:\n);
+	for (size_t i = 0; i  32; i += 4) {
+		printf(
+		[%2zu]=%08PRIxREGISTER [%2zu]=%08PRIxREGISTER
+		 [%2zu]=%08PRIxREGISTER [%2zu]=%08PRIxREGISTER \n,
+		i+0, fp-f_regs[i+0], i+1, fp-f_regs[i+1],
+		i+2, fp-f_regs[i+2], i+3, fp-f_regs[i+3]);
+	}
 #endif
 	(*p-p_emul-e_trapsignal)(l, ksi);
 	if ((type  T_USER) == 0)



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include

2009-09-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Sep  3 00:02:53 UTC 2009

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: asm.h

Log Message:
Don't use .set noorder/.set reorder.
instead use .set push; .set noreorder; .set pop
This will preserve noorder


To generate a diff of this commit:
cvs rdiff -u -r1.40.38.6 -r1.40.38.7 src/sys/arch/mips/include/asm.h

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

Modified files:

Index: src/sys/arch/mips/include/asm.h
diff -u src/sys/arch/mips/include/asm.h:1.40.38.6 src/sys/arch/mips/include/asm.h:1.40.38.7
--- src/sys/arch/mips/include/asm.h:1.40.38.6	Fri Aug 21 17:33:17 2009
+++ src/sys/arch/mips/include/asm.h	Thu Sep  3 00:02:53 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.40.38.6 2009/08/21 17:33:17 matt Exp $	*/
+/*	$NetBSD: asm.h,v 1.40.38.7 2009/09/03 00:02:53 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -542,29 +542,32 @@
 #endif
 
 #define	SETUP_GP	\
+			.set push;\
 			.set noreorder;\
 			.cpload	t9;\
-			.set reorder
+			.set pop
 #define	SETUP_GPX(r)	\
+			.set push;\
 			.set noreorder;\
 			move	r,ra;	/* save old ra */	\
 			bal	7f;\
 			nop;	\
 		7:	.cpload	ra;\
 			move	ra,r;\
-			.set reorder
+			.set pop
 #define	SETUP_GPX_L(r,lbl)	\
+			.set push;\
 			.set noreorder;\
 			move	r,ra;	/* save old ra */	\
 			bal	lbl;\
 			nop;	\
 		lbl:	.cpload	ra;\
 			move	ra,r;\
-			.set reorder
+			.set pop
 #define	SAVE_GP(x)	.cprestore x
 
 #define	SETUP_GP64(a,b)		/* n32/n64 specific */
-#define	SETUP_GP64_R(a,b)		/* n32/n64 specific */
+#define	SETUP_GP64_R(a,b)	/* n32/n64 specific */
 #define	SETUP_GPX64(a,b)	/* n32/n64 specific */
 #define	SETUP_GPX64_L(a,b,c)	/* n32/n64 specific */
 #define	RESTORE_GP64		/* n32/n64 specific */
@@ -587,19 +590,21 @@
 #define	SAVE_GP(x)		/* o32 specific */
 #define	SETUP_GP64(a,b)		.cpsetup $25, a, b
 #define	SETUP_GPX64(a,b)	\
+.set push;			\
 move	b,ra;			\
 .set noreorder;			\
 bal	7f;			\
 nop;\
-			7:	.set reorder;			\
+			7:	.set pop;			\
 .cpsetup ra, a, 7b;		\
 move	ra,b
 #define	SETUP_GPX64_L(a,b,c)	\
+.set push;			\
 move	b,ra;			\
 .set noreorder;			\
 bal	c;			\
 nop;\
-			c:	.set reorder;			\
+			c:	.set pop;			\
 .cpsetup ra, a, c;		\
 move	ra,b
 #define	RESTORE_GP64		.cpreturn



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2009-09-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Sep  3 00:08:19 UTC 2009

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: cpu_exec.c

Log Message:
If loading O32, and COMPAT_16 is defined, set *startp to ELFS32_LINK_ADDR
so that the interpeter will be loaded at its link address.


To generate a diff of this commit:
cvs rdiff -u -r1.50.54.1.4.6 -r1.50.54.1.4.7 \
src/sys/arch/mips/mips/cpu_exec.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/mips/mips/cpu_exec.c
diff -u src/sys/arch/mips/mips/cpu_exec.c:1.50.54.1.4.6 src/sys/arch/mips/mips/cpu_exec.c:1.50.54.1.4.7
--- src/sys/arch/mips/mips/cpu_exec.c:1.50.54.1.4.6	Wed Sep  2 17:52:10 2009
+++ src/sys/arch/mips/mips/cpu_exec.c	Thu Sep  3 00:08:19 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_exec.c,v 1.50.54.1.4.6 2009/09/02 17:52:10 matt Exp $	*/
+/*	$NetBSD: cpu_exec.c,v 1.50.54.1.4.7 2009/09/03 00:08:19 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu_exec.c,v 1.50.54.1.4.6 2009/09/02 17:52:10 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu_exec.c,v 1.50.54.1.4.7 2009/09/03 00:08:19 matt Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_compat_ultrix.h
@@ -357,6 +357,9 @@
 #endif
 	case EF_MIPS_ABI_O32:
 		p-p_md.md_abi = _MIPS_BSD_API_O32;
+#ifdef COMPAT_16
+		*start_p = ELF32_LINK_ADDR;
+#endif
 		if (old_abi != p-p_md.md_abi)
 			printf(pid %d(%s): ABI set to O32 (e_flags=%#x)\n, p-p_pid, p-p_comm, eh-e_flags);
 		return 0;



CVS commit: src

2009-09-02 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Sep  3 01:17:30 UTC 2009

Modified Files:
src/distrib/sets/lists/base: mi
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/man: mi
src/usr.bin: Makefile

Log Message:
Enable libarchive-based unzip frontend.


To generate a diff of this commit:
cvs rdiff -u -r1.824 -r1.825 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.1294 -r1.1295 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.1153 -r1.1154 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.178 -r1.179 src/usr.bin/Makefile

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.824 src/distrib/sets/lists/base/mi:1.825
--- src/distrib/sets/lists/base/mi:1.824	Sun Aug 23 09:05:44 2009
+++ src/distrib/sets/lists/base/mi	Thu Sep  3 01:17:29 2009
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.824 2009/08/23 09:05:44 mrg Exp $
+# $NetBSD: mi,v 1.825 2009/09/03 01:17:29 joerg Exp $
 #
 # Note:	Don't delete entries from here - mark them as obsolete instead,
 #	unless otherwise stated below.
@@ -978,6 +978,7 @@
 ./usr/bin/uniq	base-util-bin
 ./usr/bin/units	base-util-bin
 ./usr/bin/unvis	base-util-bin
+./usr/bin/unzip	base-util-bin
 ./usr/bin/uptimebase-util-bin
 ./usr/bin/usbhidactionbase-util-bin
 ./usr/bin/usbhidctlbase-util-bin

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1294 src/distrib/sets/lists/comp/mi:1.1295
--- src/distrib/sets/lists/comp/mi:1.1294	Thu Aug 20 22:07:49 2009
+++ src/distrib/sets/lists/comp/mi	Thu Sep  3 01:17:29 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1294 2009/08/20 22:07:49 he Exp $
+#	$NetBSD: mi,v 1.1295 2009/09/03 01:17:29 joerg Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -3111,6 +3111,7 @@
 ./usr/libdata/debug/usr/bin/units.debug		comp-util-debug		debug
 ./usr/libdata/debug/usr/bin/unprotoize.debug	comp-c-debug		gcccmds,debug
 ./usr/libdata/debug/usr/bin/unvis.debug		comp-util-debug		debug
+./usr/libdata/debug/usr/bin/unzip.debug		comp-util-debug		debug
 ./usr/libdata/debug/usr/bin/usbhidaction.debug	comp-util-debug		debug
 ./usr/libdata/debug/usr/bin/usbhidctl.debug	comp-util-debug		debug
 ./usr/libdata/debug/usr/bin/users.debug		comp-util-debug		debug

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1153 src/distrib/sets/lists/man/mi:1.1154
--- src/distrib/sets/lists/man/mi:1.1153	Fri Aug 14 21:17:21 2009
+++ src/distrib/sets/lists/man/mi	Thu Sep  3 01:17:30 2009
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1153 2009/08/14 21:17:21 mbalmer Exp $
+# $NetBSD: mi,v 1.1154 2009/09/03 01:17:30 joerg Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -507,6 +507,7 @@
 ./usr/share/man/cat1/uniq.0			man-util-catman		.cat
 ./usr/share/man/cat1/units.0			man-util-catman		.cat
 ./usr/share/man/cat1/unvis.0			man-util-catman		.cat
+./usr/share/man/cat1/unzip.0			man-util-catman		.cat
 ./usr/share/man/cat1/uptime.0			man-util-catman		.cat
 ./usr/share/man/cat1/usbhidaction.0		man-util-catman		.cat
 ./usr/share/man/cat1/usbhidctl.0		man-util-catman		.cat
@@ -3176,6 +3177,7 @@
 ./usr/share/man/html1/uniq.html			man-util-htmlman	html
 ./usr/share/man/html1/units.html		man-util-htmlman	html
 ./usr/share/man/html1/unvis.html		man-util-htmlman	html
+./usr/share/man/html1/unzip.html		man-util-htmlman	html
 ./usr/share/man/html1/uptime.html		man-util-htmlman	html
 ./usr/share/man/html1/usbhidaction.html		man-util-htmlman	html
 ./usr/share/man/html1/usbhidctl.html		man-util-htmlman	html
@@ -5507,6 +5509,7 @@
 ./usr/share/man/man1/uniq.1			man-util-man		.man
 ./usr/share/man/man1/units.1			man-util-man		.man
 ./usr/share/man/man1/unvis.1			man-util-man		.man
+./usr/share/man/man1/unzip.1			man-util-man		.man
 ./usr/share/man/man1/uptime.1			man-util-man		.man
 ./usr/share/man/man1/usbhidaction.1		man-util-man		.man
 ./usr/share/man/man1/usbhidctl.1		man-util-man		.man

Index: src/usr.bin/Makefile
diff -u src/usr.bin/Makefile:1.178 src/usr.bin/Makefile:1.179
--- src/usr.bin/Makefile:1.178	Sat Aug 15 16:21:04 2009
+++ src/usr.bin/Makefile	Thu Sep  3 01:17:29 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.178 2009/08/15 16:21:04 joerg Exp $
+#	$NetBSD: Makefile,v 1.179 2009/09/03 01:17:29 joerg Exp $
 #	from: @(#)Makefile	8.3 (Berkeley) 1/7/94
 
 .include bsd.own.mk
@@ -25,7 +25,7 @@
 	showmount shuffle sockstat soelim sort spell split stat su systat \
 	tabs tail talk tcopy tee telnet tftp time tip tn3270 touch tput \
 	tr true tset tsort tty ul uname unexpand unifdef \
-	uniq units unvis usbhidaction usbhidctl users utoppya \
+	uniq units unvis unzip usbhidaction usbhidctl users utoppya \
 	uudecode uuencode uuidgen vacation vgrind vis vmstat vndcompress w \
 	wall wc what whatis whereis who whois window \
 	write xargs xinstall xlint xstr yacc yes



CVS commit: src/sys

2009-09-02 Thread Elad Efrat
Module Name:src
Committed By:   elad
Date:   Thu Sep  3 04:45:28 UTC 2009

Modified Files:
src/sys/fs/tmpfs: tmpfs_subr.c tmpfs_vnops.c
src/sys/kern: kern_auth.c
src/sys/secmodel/bsd44: secmodel_bsd44_suser.c suser.h
src/sys/secmodel/securelevel: secmodel_securelevel.c securelevel.h
src/sys/sys: kauth.h

Log Message:
Implement the vnode scope and adapt tmpfs to use it.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/07/04/msg005404.html


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/fs/tmpfs/tmpfs_subr.c
cvs rdiff -u -r1.61 -r1.62 src/sys/fs/tmpfs/tmpfs_vnops.c
cvs rdiff -u -r1.63 -r1.64 src/sys/kern/kern_auth.c
cvs rdiff -u -r1.70 -r1.71 src/sys/secmodel/bsd44/secmodel_bsd44_suser.c
cvs rdiff -u -r1.5 -r1.6 src/sys/secmodel/bsd44/suser.h
cvs rdiff -u -r1.12 -r1.13 \
src/sys/secmodel/securelevel/secmodel_securelevel.c
cvs rdiff -u -r1.1 -r1.2 src/sys/secmodel/securelevel/securelevel.h
cvs rdiff -u -r1.62 -r1.63 src/sys/sys/kauth.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/fs/tmpfs/tmpfs_subr.c
diff -u src/sys/fs/tmpfs/tmpfs_subr.c:1.53 src/sys/fs/tmpfs/tmpfs_subr.c:1.54
--- src/sys/fs/tmpfs/tmpfs_subr.c:1.53	Thu May  7 19:30:30 2009
+++ src/sys/fs/tmpfs/tmpfs_subr.c	Thu Sep  3 04:45:28 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_subr.c,v 1.53 2009/05/07 19:30:30 elad Exp $	*/
+/*	$NetBSD: tmpfs_subr.c,v 1.54 2009/09/03 04:45:28 elad Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tmpfs_subr.c,v 1.53 2009/05/07 19:30:30 elad Exp $);
+__KERNEL_RCSID(0, $NetBSD: tmpfs_subr.c,v 1.54 2009/09/03 04:45:28 elad Exp $);
 
 #include sys/param.h
 #include sys/dirent.h
@@ -964,6 +964,8 @@
 {
 	int error;
 	struct tmpfs_node *node;
+	kauth_action_t = KAUTH_VNODE_WRITE_FLAGS;
+	int fs_decision = 0;
 
 	KASSERT(VOP_ISLOCKED(vp));
 
@@ -973,30 +975,44 @@
 	if (vp-v_mount-mnt_flag  MNT_RDONLY)
 		return EROFS;
 
-	/* XXX: The following comes from UFS code, and can be found in
-	 * several other file systems.  Shouldn't this be centralized
-	 * somewhere? */
-	if (kauth_cred_geteuid(cred) != node-tn_uid 
-	(error = kauth_authorize_generic(cred, KAUTH_GENERIC_ISSUSER,
-	NULL)))
+	if (kauth_cred_geteuid(cred) != node-tn_uid)
+		fs_decision = EACCES;
+
+	/*
+	 * If the new flags have non-user flags that are different than
+	 * those on the node, we need special permission to change them.
+	 */
+	if ((flags  SF_SETTABLE) != (node-tn_flags  SF_SETTABLE)) {
+		action |= KAUTH_VNODE_WRITE_SYSFLAGS;
+		if (!fs_decision)
+			fs_decision = EPERM;
+	}
+
+	/*
+	 * Indicate that this node's flags have system attributes in them if
+	 * that's the case.
+	 */
+	if (node-tn_flags  (SF_IMMUTABLE | SF_APPEND)) {
+		action |= KAUTH_VNODE_HAS_SYSFLAGS;
+	}
+
+	error = kauth_authorize_vnode(cred, action, vp, NULL, fs_decision);
+	if (error)
 		return error;
-	if (kauth_authorize_generic(cred, KAUTH_GENERIC_ISSUSER, NULL) == 0) {
-		/* The super-user is only allowed to change flags if the file
-		 * wasn't protected before and the securelevel is zero. */
-		if ((node-tn_flags  (SF_IMMUTABLE | SF_APPEND)) 
-		kauth_authorize_system(l-l_cred, KAUTH_SYSTEM_CHSYSFLAGS,
-		 0, NULL, NULL, NULL))
-			return EPERM;
+
+	/*
+	 * Set the flags. If we're not setting non-user flags, be careful not
+	 * to overwrite them.
+	 *
+	 * XXX: Can't we always assign here? if the system flags are different,
+	 *  the code above should catch attempts to change them without
+	 *  proper permissions, and if we're here it means it's okay to
+	 *  change them...
+	 */
+	if (action  KAUTH_VNODE_WRITE_SYSFLAGS) {
 		node-tn_flags = flags;
 	} else {
-		/* Regular users can change flags provided they only want to
-		 * change user-specific ones, not those reserved for the
-		 * super-user. */
-		if ((node-tn_flags  (SF_IMMUTABLE | SF_APPEND)) ||
-		(flags  UF_SETTABLE) != flags)
-			return EPERM;
-		if ((node-tn_flags  SF_SETTABLE) != (flags  SF_SETTABLE))
-			return EPERM;
+		/* Clear all user-settable flags and re-set them. */
 		node-tn_flags = SF_SETTABLE;
 		node-tn_flags |= (flags  UF_SETTABLE);
 	}
@@ -1036,6 +1052,9 @@
 
 	error = genfs_can_chmod(vp, cred, node-tn_uid, node-tn_gid,
 	mode);
+
+	error = kauth_authorize_vnode(cred, KAUTH_VNODE_WRITE_SECURITY, vp,
+	NULL, error);
 	if (error)
 		return (error);
 
@@ -1087,6 +1106,9 @@
 
 	error = genfs_can_chown(vp, cred, node-tn_uid, node-tn_gid, uid,
 	gid);
+
+	error = kauth_authorize_vnode(cred, KAUTH_VNODE_CHANGE_OWNERSHIP, vp,
+	NULL, error);
 	if (error)
 		return (error);
 
@@ -1186,6 +1208,9 @@
 		return EPERM;
 
 	error = genfs_can_chtimes(vp, vaflags, node-tn_uid, cred);
+
+	error = kauth_authorize_vnode(cred, KAUTH_VNODE_WRITE_TIMES, vp, NULL,
+