CVS commit: src/sys/dev/ic

2013-09-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Sep 22 06:52:11 UTC 2013

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

Log Message:
Remove trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/ic/sl811hs.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/sl811hs.c
diff -u src/sys/dev/ic/sl811hs.c:1.35 src/sys/dev/ic/sl811hs.c:1.36
--- src/sys/dev/ic/sl811hs.c:1.35	Mon Sep  2 12:27:18 2013
+++ src/sys/dev/ic/sl811hs.c	Sun Sep 22 06:52:11 2013
@@ -1,11 +1,11 @@
-/*	$NetBSD: sl811hs.c,v 1.35 2013/09/02 12:27:18 skrll Exp $	*/
+/*	$NetBSD: sl811hs.c,v 1.36 2013/09/22 06:52:11 skrll Exp $	*/
 
 /*
  * Not (c) 2007 Matthew Orgass
- * This file is public domain, meaning anyone can make any use of part or all 
- * of this file including copying into other works without credit.  Any use, 
- * modified or not, is solely the responsibility of the user.  If this file is 
- * part of a collection then use in the collection is governed by the terms of 
+ * This file is public domain, meaning anyone can make any use of part or all
+ * of this file including copying into other works without credit.  Any use,
+ * modified or not, is solely the responsibility of the user.  If this file is
+ * part of a collection then use in the collection is governed by the terms of
  * the collection.
  */
 
@@ -13,64 +13,64 @@
  * Cypress/ScanLogic SL811HS/T USB Host Controller
  * Datasheet, Errata, and App Note available at www.cypress.com
  *
- * Uses: Ratoc CFU1U PCMCIA USB Host Controller, Nereid X68k USB HC, ISA 
+ * Uses: Ratoc CFU1U PCMCIA USB Host Controller, Nereid X68k USB HC, ISA
  * HCs.  The Ratoc CFU2 uses a different chip.
  *
- * This chip puts the serial in USB.  It implements USB by means of an eight 
- * bit I/O interface.  It can be used for ISA, PCMCIA/CF, parallel port, 
- * serial port, or any eight bit interface.  It has 256 bytes of memory, the 
- * first 16 of which are used for register access.  There are two sets of 
- * registers for sending individual bus transactions.  Because USB is polled, 
- * this organization means that some amount of card access must often be made 
- * when devices are attached, even if when they are not directly being used.  
- * A per-ms frame interrupt is necessary and many devices will poll with a 
+ * This chip puts the serial in USB.  It implements USB by means of an eight
+ * bit I/O interface.  It can be used for ISA, PCMCIA/CF, parallel port,
+ * serial port, or any eight bit interface.  It has 256 bytes of memory, the
+ * first 16 of which are used for register access.  There are two sets of
+ * registers for sending individual bus transactions.  Because USB is polled,
+ * this organization means that some amount of card access must often be made
+ * when devices are attached, even if when they are not directly being used.
+ * A per-ms frame interrupt is necessary and many devices will poll with a
  * per-frame bulk transfer.
  *
- * It is possible to write a little over two bytes to the chip (auto 
- * incremented) per full speed byte time on the USB.  Unfortunately, 
- * auto-increment does not work reliably so write and bus speed is 
+ * It is possible to write a little over two bytes to the chip (auto
+ * incremented) per full speed byte time on the USB.  Unfortunately,
+ * auto-increment does not work reliably so write and bus speed is
  * approximately the same for full speed devices.
  *
- * In addition to the 240 byte packet size limit for isochronous transfers, 
- * this chip has no means of determining the current frame number other than 
- * getting all 1ms SOF interrupts, which is not always possible even on a fast 
- * system.  Isochronous transfers guarantee that transfers will never be 
- * retried in a later frame, so this can cause problems with devices beyond 
- * the difficulty in actually performing the transfer most frames.  I tried 
- * implementing isoc transfers and was able to play CD-derrived audio via an 
+ * In addition to the 240 byte packet size limit for isochronous transfers,
+ * this chip has no means of determining the current frame number other than
+ * getting all 1ms SOF interrupts, which is not always possible even on a fast
+ * system.  Isochronous transfers guarantee that transfers will never be
+ * retried in a later frame, so this can cause problems with devices beyond
+ * the difficulty in actually performing the transfer most frames.  I tried
+ * implementing isoc transfers and was able to play CD-derrived audio via an
  * iMic on a 2GHz PC, however it would still be interrupted at times and
- * once interrupted, would stay out of sync.  All isoc support has been 
+ * once interrupted, would stay out of sync.  All isoc support has been
  * removed.
  *
- * BUGS: all chip revisions have problems with low speed devices through hubs.  
- * The chip stops generating SOF 

CVS commit: src/sys/dev/ic

2013-09-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Sep 22 06:54:35 UTC 2013

Modified Files:
src/sys/dev/ic: sl811hs.c sl811hsreg.h sl811hsvar.h

Log Message:
Remove all trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/ic/sl811hs.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/ic/sl811hsreg.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/ic/sl811hsvar.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/sl811hs.c
diff -u src/sys/dev/ic/sl811hs.c:1.36 src/sys/dev/ic/sl811hs.c:1.37
--- src/sys/dev/ic/sl811hs.c:1.36	Sun Sep 22 06:52:11 2013
+++ src/sys/dev/ic/sl811hs.c	Sun Sep 22 06:54:35 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: sl811hs.c,v 1.36 2013/09/22 06:52:11 skrll Exp $	*/
+/*	$NetBSD: sl811hs.c,v 1.37 2013/09/22 06:54:35 skrll Exp $	*/
 
 /*
  * Not (c) 2007 Matthew Orgass
@@ -85,7 +85,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sl811hs.c,v 1.36 2013/09/22 06:52:11 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: sl811hs.c,v 1.37 2013/09/22 06:54:35 skrll Exp $);
 
 #include opt_slhci.h
 
@@ -191,11 +191,11 @@ pnames(int ptype)
 
 /*
  * Maximum allowable reserved bus time.  Since intr/isoc transfers have
- * unconditional priority, this is all that ensures control and bulk transfers 
- * get a chance.  It is a single value for all frames since all transfers can 
- * use multiple consecutive frames if an error is encountered.  Note that it 
- * is not really possible to fill the bus with transfers, so this value should 
- * be on the low side.  Defaults to giving a warning unless SLHCI_NO_OVERTIME 
+ * unconditional priority, this is all that ensures control and bulk transfers
+ * get a chance.  It is a single value for all frames since all transfers can
+ * use multiple consecutive frames if an error is encountered.  Note that it
+ * is not really possible to fill the bus with transfers, so this value should
+ * be on the low side.  Defaults to giving a warning unless SLHCI_NO_OVERTIME
  * is defined.  Full time is 12000 - END_BUSTIME.
  */
 #ifndef SLHCI_RESERVED_BUSTIME
@@ -204,7 +204,7 @@ pnames(int ptype)
 
 /*
  * Rate for exceeds reserved bus time warnings (default) or errors.
- * Warnings only happen when an endpoint open causes the time to go above 
+ * Warnings only happen when an endpoint open causes the time to go above
  * SLHCI_RESERVED_BUSTIME, not if it is already above.
  */
 #ifndef SLHCI_OVERTIME_WARNING_RATE
@@ -233,8 +233,8 @@ static const struct timeval overflow_war
 
 /*
  * This is an approximation of the USB worst-case timings presented on p. 54 of
- * the USB 1.1 spec translated to full speed bit times.  
- * FS = full speed with handshake, FSII = isoc in, FSIO = isoc out, 
+ * the USB 1.1 spec translated to full speed bit times.
+ * FS = full speed with handshake, FSII = isoc in, FSIO = isoc out,
  * FSI = isoc (worst case), LS = low speed
  */
 #define SLHCI_FS_CONST		114
@@ -618,8 +618,8 @@ struct kern_history_ent slhci_he[SLHCI_N
 #define DLOG(x, f, a, b, c, d) SLHCI_DEXEC(x, DDOLOG(f, a, b, c, d))
 /*
  * DLOGFLAG8 is a macro not a function so that flag name expressions are not
- * evaluated unless the flag bit is set (which could save a register read). 
- * x is debug mask, y is flag identifier, z is flag variable, 
+ * evaluated unless the flag bit is set (which could save a register read).
+ * x is debug mask, y is flag identifier, z is flag variable,
  * a-h are flag names (must evaluate to string constants, msb first).
  */
 #define DDOLOGFLAG8(y, z, a, b, c, d, e, f, g, h) do { uint8_t _DLF8 = (z);   \
@@ -1003,10 +1003,10 @@ slhci_start(struct usbd_xfer *xfer)
 
 	/*
 	 * The goal of newbustime and newlen is to avoid bustime calculation
-	 * in the interrupt.  The calculations are not too complex, but they 
-	 * complicate the conditional logic somewhat and doing them all in the 
-	 * same place shares constants. Index 0 is short length for bulk and 
-	 * ctrl data and 1 is full length for ctrl data (bulk/intr are 
+	 * in the interrupt.  The calculations are not too complex, but they
+	 * complicate the conditional logic somewhat and doing them all in the
+	 * same place shares constants. Index 0 is short length for bulk and
+	 * ctrl data and 1 is full length for ctrl data (bulk/intr are
 	 * already set to full length).
 	 */
 	if (spipe-pflags  PF_LS) {
@@ -1041,10 +1041,10 @@ slhci_start(struct usbd_xfer *xfer)
 
 	/*
 	 * The datasheet incorrectly indicates that DIRECTION is for
-	 * transmit to host.  It is for OUT and SETUP.  The app note 
+	 * transmit to host.  It is for OUT and SETUP.  The app note
 	 * describes its use correctly.
 	 */
-	if ((spipe-tregs[PID]  SL11_PID_BITS) != SL11_PID_IN) 
+	if ((spipe-tregs[PID]  SL11_PID_BITS) != SL11_PID_IN)
 		spipe-control |= SL11_EPCTRL_DIRECTION;
 
 	slhci_start_entry(sc, spipe);
@@ -1095,7 +1095,7 @@ slhci_open(struct usbd_pipe *pipe)
 
 	/*
 	 * The 

CVS commit: src/sys/arch/mips/adm5120/dev

2013-09-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Sep 22 07:26:42 UTC 2013

Modified Files:
src/sys/arch/mips/adm5120/dev: ahci.c

Log Message:
Remove trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/mips/adm5120/dev/ahci.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/adm5120/dev/ahci.c
diff -u src/sys/arch/mips/adm5120/dev/ahci.c:1.10 src/sys/arch/mips/adm5120/dev/ahci.c:1.11
--- src/sys/arch/mips/adm5120/dev/ahci.c:1.10	Mon Sep  2 15:48:08 2013
+++ src/sys/arch/mips/adm5120/dev/ahci.c	Sun Sep 22 07:26:42 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahci.c,v 1.10 2013/09/02 15:48:08 skrll Exp $	*/
+/*	$NetBSD: ahci.c,v 1.11 2013/09/22 07:26:42 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@@ -64,7 +64,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ahci.c,v 1.10 2013/09/02 15:48:08 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: ahci.c,v 1.11 2013/09/22 07:26:42 skrll Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -302,7 +302,7 @@ ahci_attach(device_t parent, device_t se
 	REG_WRITE(ADMHCD_REG_INTENABLE, 0); /* disable interrupts */
 	REG_WRITE(ADMHCD_REG_CONTROL, ADMHCD_SW_RESET); /* reset */
 	delay_ms(10);
-while (REG_READ(ADMHCD_REG_CONTROL)  ADMHCD_SW_RESET) 
+while (REG_READ(ADMHCD_REG_CONTROL)  ADMHCD_SW_RESET)
 delay_ms(1);
 
 	REG_WRITE(ADMHCD_REG_CONTROL, ADMHCD_HOST_EN);
@@ -354,7 +354,7 @@ ahci_intr(void *arg)
 	? \20\x8D+\7RESUME\6INSERT\5SOF\4res\3BABBLE\2USBB\1USBA
 	: \20\x8D+\7RESET\6INSERT\5SOF\4res\3BABBLE\2USBB\1USBA),
 	r);
-		
+
 	DPRINTF(D_XFER, (I=%s , bitbuf));
 #endif /* AHCI_DEBUG */
 #endif
@@ -1048,7 +1048,7 @@ ahci_device_ctrl_start(usbd_xfer_handle 
 usb_device_request_t *req = xfer-request;
 	struct ahci_softc *sc = (struct ahci_softc *)pipe-device-bus;
 	int len, isread;
-	
+
 
 #if 0
 	struct ahci_pipe *apipe = (struct ahci_pipe *)xfer-pipe;
@@ -1070,11 +1070,11 @@ ahci_device_ctrl_start(usbd_xfer_handle 
 #define KSEG1ADDR(x) (0xa000 | (((u_int32_t)x)  0x1fff))
 	DPRINTF(D_TRACE, (st ));
 	if (!ep) {
-	ep = (struct admhcd_ed *)KSEG1ADDR(ep_v); 
-		td = (struct admhcd_td *)KSEG1ADDR(td_v[0]); 
-		td1 = (struct admhcd_td *)KSEG1ADDR(td_v[1]); 
-		td2 = (struct admhcd_td *)KSEG1ADDR(td_v[2]); 
-		td3 = (struct admhcd_td *)KSEG1ADDR(td_v[3]); 
+	ep = (struct admhcd_ed *)KSEG1ADDR(ep_v);
+		td = (struct admhcd_td *)KSEG1ADDR(td_v[0]);
+		td1 = (struct admhcd_td *)KSEG1ADDR(td_v[1]);
+		td2 = (struct admhcd_td *)KSEG1ADDR(td_v[2]);
+		td3 = (struct admhcd_td *)KSEG1ADDR(td_v[3]);
 		err = usb_allocmem(sc-sc_bus,
 			sizeof(usb_device_request_t),
 			0, reqdma);
@@ -1242,7 +1242,7 @@ ahci_device_intr_start(usbd_xfer_handle 
 
 	/* initialize callout */
 	callout_init(sx-sx_callout_t, 0);
-	callout_reset(sx-sx_callout_t, 
+	callout_reset(sx-sx_callout_t,
 		MS_TO_TICKS(pipe-endpoint-edesc-bInterval),
 		ahci_poll_device, sx);
 
@@ -1400,9 +1400,9 @@ ahci_device_bulk_start(usbd_xfer_handle 
 /* 	printf(bulk_start\n); */
 
 	if (!ep) {
-	ep = (struct admhcd_ed *)KSEG1ADDR(ep_v); 
+	ep = (struct admhcd_ed *)KSEG1ADDR(ep_v);
 		for (i=0; iNBULK_TDS; i++) {
-			td[i] = (struct admhcd_td *)KSEG1ADDR(td_v[i]); 
+			td[i] = (struct admhcd_td *)KSEG1ADDR(td_v[i]);
 		};
 /*		printf(ep: %p\n,ep);*/
 	};
@@ -1489,7 +1489,7 @@ ahci_device_bulk_start(usbd_xfer_handle 
 			status = USBD_IOERROR;
 break;
 };
-		
+
 		i++;
 		if (i==segs) {
 			status = USBD_NORMAL_COMPLETION;



CVS commit: src/sys/arch/mips/adm5120/dev

2013-09-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Sep 22 08:30:22 UTC 2013

Modified Files:
src/sys/arch/mips/adm5120/dev: ahci.c ahcivar.h

Log Message:
Adapt to usbmp. Compile tested only.

Did this ever work?


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/mips/adm5120/dev/ahci.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/adm5120/dev/ahcivar.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/adm5120/dev/ahci.c
diff -u src/sys/arch/mips/adm5120/dev/ahci.c:1.11 src/sys/arch/mips/adm5120/dev/ahci.c:1.12
--- src/sys/arch/mips/adm5120/dev/ahci.c:1.11	Sun Sep 22 07:26:42 2013
+++ src/sys/arch/mips/adm5120/dev/ahci.c	Sun Sep 22 08:30:22 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahci.c,v 1.11 2013/09/22 07:26:42 skrll Exp $	*/
+/*	$NetBSD: ahci.c,v 1.12 2013/09/22 08:30:22 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@@ -64,7 +64,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ahci.c,v 1.11 2013/09/22 07:26:42 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: ahci.c,v 1.12 2013/09/22 08:30:22 skrll Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -99,6 +99,8 @@ static void		ahci_freem(struct usbd_bus 
 static usbd_xfer_handle ahci_allocx(struct usbd_bus *);
 static void		ahci_freex(struct usbd_bus *, usbd_xfer_handle);
 
+static void		ahci_get_lock(struct usbd_bus *, kmutex_t **);
+
 static int		ahci_str(usb_string_descriptor_t *, int, const char *);
 
 static usbd_status	ahci_root_ctrl_transfer(usbd_xfer_handle);
@@ -178,6 +180,7 @@ struct usbd_bus_methods ahci_bus_methods
 	.freem = ahci_freem,
 	.allocx = ahci_allocx,
 	.freex = ahci_freex,
+	.get_lock = ahci_get_lock,
 };
 
 struct usbd_pipe_methods ahci_root_ctrl_methods = {
@@ -277,7 +280,6 @@ ahci_attach(device_t parent, device_t se
 	sc-sc_bus.methods = ahci_bus_methods;
 	sc-sc_bus.pipe_size = sizeof(struct ahci_pipe);
 	sc-sc_bus.dmatag = sc-sc_dmat;
-	sc-busy = 0;
 
 	/* Map the device. */
 	if (bus_space_map(sc-sc_st, aa-oba_addr,
@@ -299,6 +301,9 @@ ahci_attach(device_t parent, device_t se
 
 	callout_init(sc-sc_poll_handle, 0);
 
+	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_SOFTUSB);
+	mutex_init(sc-sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED /* XXXNH */);
+
 	REG_WRITE(ADMHCD_REG_INTENABLE, 0); /* disable interrupts */
 	REG_WRITE(ADMHCD_REG_CONTROL, ADMHCD_SW_RESET); /* reset */
 	delay_ms(10);
@@ -432,7 +437,6 @@ ahci_poll_hub(void *arg)
 	usbd_xfer_handle xfer = arg;
 	usbd_pipe_handle pipe = xfer-pipe;
 	struct ahci_softc *sc = (struct ahci_softc *)pipe-device-bus;
-	int s;
 	u_char *p;
 	static int p0_state=0;
 	static int p1_state=0;
@@ -459,9 +463,9 @@ ahci_poll_hub(void *arg)
 
 	xfer-actlen = 1;
 	xfer-status = USBD_NORMAL_COMPLETION;
-	s = splusb();
+	mutex_enter(sc-sc_lock);
 	usb_transfer_complete(xfer);
-	splx(s);
+	mutex_exit(sc-sc_lock);
 }
 
 usbd_status
@@ -531,6 +535,14 @@ ahci_freex(struct usbd_bus *bus, usbd_xf
 	SIMPLEQ_INSERT_HEAD(sc-sc_free_xfers, xfer, next);
 }
 
+static void
+ahci_get_lock(struct usbd_bus *bus, kmutex_t **lock)
+{
+	struct ahci_softc *sc = bus-hci_private;
+
+	*lock = sc-sc_lock;
+}
+
 void
 ahci_noop(usbd_pipe_handle pipe)
 {
@@ -623,12 +635,15 @@ ahci_str(usb_string_descriptor_t *p, int
 usbd_status
 ahci_root_ctrl_transfer(usbd_xfer_handle xfer)
 {
+	struct ahci_softc *sc = (struct ahci_softc *)xfer-pipe-device-bus;
 	usbd_status error;
 
 	DPRINTF(D_TRACE, (SLRCtrans ));
 
 	/* Insert last in queue */
+	mutex_enter(sc-sc_lock);
 	error = usb_insert_transfer(xfer);
+	mutex_exit(sc-sc_lock);
 	if (error) {
 		DPRINTF(D_MSG, (usb_insert_transfer returns err! ));
 		return error;
@@ -646,7 +661,7 @@ ahci_root_ctrl_start(usbd_xfer_handle xf
 {
 	struct ahci_softc *sc = (struct ahci_softc *)xfer-pipe-device-bus;
 	usb_device_request_t *req;
-	int len, value, index, l, s, status;
+	int len, value, index, l, status;
 	int totlen = 0;
 	void *buf = NULL;
 	usb_port_status_t ps;
@@ -942,9 +957,9 @@ ahci_root_ctrl_start(usbd_xfer_handle xf
 	error = USBD_NORMAL_COMPLETION;
  ret:
 	xfer-status = error;
-	s = splusb();
+	mutex_enter(sc-sc_lock);
 	usb_transfer_complete(xfer);
-	splx(s);
+	mutex_exit(sc-sc_lock);
 	return USBD_IN_PROGRESS;
 }
 
@@ -969,12 +984,15 @@ ahci_root_ctrl_done(usbd_xfer_handle xfe
 static usbd_status
 ahci_root_intr_transfer(usbd_xfer_handle xfer)
 {
+	struct ahci_softc *sc = (struct ahci_softc *)xfer-pipe-device-bus;
 	usbd_status error;
 
 	DPRINTF(D_TRACE, (SLRItransfer ));
 
 	/* Insert last in queue */
+	mutex_enter(sc-sc_lock);
 	error = usb_insert_transfer(xfer);
+	mutex_exit(sc-sc_lock);
 	if (error)
 		return error;
 
@@ -1025,11 +1043,14 @@ ahci_root_intr_done(usbd_xfer_handle xfe
 static usbd_status
 ahci_device_ctrl_transfer(usbd_xfer_handle xfer)
 {
+	struct ahci_softc *sc = (struct ahci_softc *)xfer-pipe-device-bus;
 	usbd_status error;
 
 	DPRINTF(D_TRACE, (C));
 
+	

CVS commit: src/sys/dev/ic

2013-09-22 Thread Adam Ciarcinski
Module Name:src
Committed By:   adam
Date:   Sun Sep 22 09:21:56 UTC 2013

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

Log Message:
Removed duplicated lines introduced in version 1.36.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/ic/sl811hs.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/sl811hs.c
diff -u src/sys/dev/ic/sl811hs.c:1.37 src/sys/dev/ic/sl811hs.c:1.38
--- src/sys/dev/ic/sl811hs.c:1.37	Sun Sep 22 06:54:35 2013
+++ src/sys/dev/ic/sl811hs.c	Sun Sep 22 09:21:56 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: sl811hs.c,v 1.37 2013/09/22 06:54:35 skrll Exp $	*/
+/*	$NetBSD: sl811hs.c,v 1.38 2013/09/22 09:21:56 adam Exp $	*/
 
 /*
  * Not (c) 2007 Matthew Orgass
@@ -85,7 +85,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sl811hs.c,v 1.37 2013/09/22 06:54:35 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: sl811hs.c,v 1.38 2013/09/22 09:21:56 adam Exp $);
 
 #include opt_slhci.h
 
@@ -2326,12 +2326,6 @@ slhci_dotransfer(struct slhci_softc *sc)
 		PT_ROOT_INTR, sc, spipe, NULL, return);
 
 		/* Check that this transfer can fit in the remaining memory. */
-		spipe, t))) {
-		LK_SLASSERT(spipe-xfer != NULL, sc, spipe, NULL, return);
-		LK_SLASSERT(spipe-ptype != PT_ROOT_CTRL  spipe-ptype !=
-		PT_ROOT_INTR, sc, spipe, NULL, return);
-
-		/* Check that this transfer can fit in the remaining memory. */
 		if (t-len[A] + t-len[B] + spipe-tregs[LEN] + 1 
 		SL11_MAX_PACKET_SIZE) {
 			DLOG(D_XFER, Transfer does not fit. alen %d blen %d 



CVS commit: src/lib/libc/sys

2013-09-22 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Sun Sep 22 10:02:05 UTC 2013

Modified Files:
src/lib/libc/sys: fsync.2

Log Message:
Attempt to clarify that fsync() is like fsync_range() with the
FFILESYNC flag but not the FDISKSYNC flag.

Add a paragraph of weasel words about how writing to a permanent
storage device does not necessarily write to permanent storage media
within that device.

Move the description of FDISKSYNC into the same list as FDATASYNC
and FFILESYNC.

Change the order of paragraphs or sentences in an attempt to
improve the flow.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/sys/fsync.2

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

Modified files:

Index: src/lib/libc/sys/fsync.2
diff -u src/lib/libc/sys/fsync.2:1.17 src/lib/libc/sys/fsync.2:1.18
--- src/lib/libc/sys/fsync.2:1.17	Mon May 17 12:38:04 2010
+++ src/lib/libc/sys/fsync.2	Sun Sep 22 10:02:05 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: fsync.2,v 1.17 2010/05/17 12:38:04 jruoho Exp $
+.\	$NetBSD: fsync.2,v 1.18 2013/09/22 10:02:05 apb Exp $
 .\
 .\ Copyright (c) 1983, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\ @(#)fsync.2	8.1 (Berkeley) 6/4/93
 .\
-.Dd May 17, 2010
+.Dd September 22, 2013
 .Dt FSYNC 2
 .Os
 .Sh NAME
@@ -48,15 +48,36 @@
 .Fn fsync
 causes all modified data and attributes of
 .Fa fd
-to be moved to a permanent storage device.
+to be written to a permanent storage device.
 This normally results in all in-core modified copies
 of buffers for the associated file to be written to a disk.
 .Pp
-.Fn fsync
-should be used by programs that require a file to be
+.Fn fsync_range
+is similar, but provides control over the region of the file
+to be synchronized, and the method of synchronization.
+.Pp
+These functions should be used by programs that require a file to be
 in a known state, for example, in building a simple transaction
 facility.
 .Pp
+Note that writing the data to a permanent storage device
+does not necessarily write the data to permanent storage media
+within that device;
+for example, after writing data to a disk device, the data might
+reside in a cache within the device, but not yet on
+more permanent storage within the device.
+Neither
+.Fn fsync
+nor the default behavior of
+.Fn fsync_range
+(without the
+.Dv FDISKSYNC
+flag)
+will flush disk caches,
+because they assume that storage devices are able to ensure that
+completed writes are transferred to media some time between the
+write and a power failure or system crash.
+.Pp
 .Fn fsync_range
 causes all modified data starting at
 .Fa start
@@ -64,38 +85,52 @@ for length
 .Fa length
 of
 .Fa fd
-to be written to permanent storage.
-Note that
+to be written to a permanent storage device.
+If the
+.Fa length
+parameter is zero,
 .Fn fsync_range
-requires that the file
-.Fa fd
-must be open for writing.
+will synchronize all of the file data.
 .Pp
 .Fn fsync_range
-may flush the file data in one of two manners:
+takes a
+.Fa how
+parameter which contains one or more of the following flags:
 .Bl -tag -width FDATASYNC -offset indent
 .It Dv FDATASYNC
 Synchronize the file data and sufficient meta-data to retrieve the
 data for the specified range.
+This is equivalent to
+.Xr fdatasync 2
+on the specified range.
 .It Dv FFILESYNC
 Synchronize all modified file data and meta-data for the specified range.
+This is equivalent to
+.Xr fsync 2
+on the specified range.
+.It Dv FDISKSYNC
+Request the destination device to ensure that the relevant data
+and meta-data is flushed from any cache to permanent storage media.
+In the present implementation, the entire cache on the affected device will
+be flushed, and this may have a significant impact on performance.
 .El
 .Pp
-By default,
-.Fn fsync_range
-does not flush disk caches, assuming that storage media are able to ensure
-completed writes are transfered to media.
 The
+.Dv FDATASYNC
+and
+.Dv FFILESYNC
+flags are mutually exclusive.
+Either of those flags may be combined with the
 .Dv FDISKSYNC
-flag may be included in the
-.Fa how
-parameter to trigger flushing of all disk caches for the file.
+flag.
 .Pp
-If the
-.Fa length
-parameter is zero,
+Note that
 .Fn fsync_range
-will synchronize all of the file data.
+requires that the file
+.Fa fd
+must be open for writing, whereas
+.Fn fsync
+does not.
 .Sh RETURN VALUES
 A 0 value is returned on success.
 A \-1 value indicates an error.
@@ -140,6 +175,7 @@ not support partial synchronization, the
 and the call will be the equivalent of calling
 .Fn fsync .
 .Sh SEE ALSO
+.Xr fdatasync 2 ,
 .Xr sync 2 ,
 .Xr sync 8
 .Sh HISTORY



CVS commit: src/sys/kern

2013-09-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Sep 22 14:55:07 UTC 2013

Modified Files:
src/sys/kern: kern_mutex.c

Log Message:
Revert previous - it was wrong. hi joerg.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/kern/kern_mutex.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/kern_mutex.c
diff -u src/sys/kern/kern_mutex.c:1.55 src/sys/kern/kern_mutex.c:1.56
--- src/sys/kern/kern_mutex.c:1.55	Sat Sep 14 13:19:18 2013
+++ src/sys/kern/kern_mutex.c	Sun Sep 22 14:55:07 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_mutex.c,v 1.55 2013/09/14 13:19:18 joerg Exp $	*/
+/*	$NetBSD: kern_mutex.c,v 1.56 2013/09/22 14:55:07 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 #define	__MUTEX_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_mutex.c,v 1.55 2013/09/14 13:19:18 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_mutex.c,v 1.56 2013/09/22 14:55:07 skrll Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -218,7 +218,7 @@ MUTEX_RELEASE(kmutex_t *mtx)
 	MUTEX_INHERITDEBUG(new, mtx-mtx_owner);
 	mtx-mtx_owner = new;
 }
-#else
+
 static inline void
 MUTEX_CLEAR_WAITERS(kmutex_t *mtx)
 {



CVS commit: src/sys/kern

2013-09-22 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun Sep 22 14:59:07 UTC 2013

Modified Files:
src/sys/kern: kern_mutex.c

Log Message:
Remove redundant declaration of MUTEX_CLEAR_WAITERS without checking if
any of the !__HAVE_SIMPLE_MUTEX architectures need it based on the
assumption that HPPA is the only member of that category.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/kern/kern_mutex.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/kern_mutex.c
diff -u src/sys/kern/kern_mutex.c:1.56 src/sys/kern/kern_mutex.c:1.57
--- src/sys/kern/kern_mutex.c:1.56	Sun Sep 22 14:55:07 2013
+++ src/sys/kern/kern_mutex.c	Sun Sep 22 14:59:07 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_mutex.c,v 1.56 2013/09/22 14:55:07 skrll Exp $	*/
+/*	$NetBSD: kern_mutex.c,v 1.57 2013/09/22 14:59:07 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 #define	__MUTEX_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_mutex.c,v 1.56 2013/09/22 14:55:07 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_mutex.c,v 1.57 2013/09/22 14:59:07 joerg Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -218,12 +218,6 @@ MUTEX_RELEASE(kmutex_t *mtx)
 	MUTEX_INHERITDEBUG(new, mtx-mtx_owner);
 	mtx-mtx_owner = new;
 }
-
-static inline void
-MUTEX_CLEAR_WAITERS(kmutex_t *mtx)
-{
-	/* nothing */
-}
 #endif	/* __HAVE_SIMPLE_MUTEXES */
 
 /*



CVS commit: [netbsd-6-1] src/sys/net/npf

2013-09-22 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Sep 22 17:27:45 UTC 2013

Modified Files:
src/sys/net/npf [netbsd-6-1]: npf_ctl.c

Log Message:
Pull up following revision(s) (requested by rmind in ticket #952):
sys/net/npf/npf_ctl.c: revision 1.27
npfctl_rule: fixes for the dynamic rules.


To generate a diff of this commit:
cvs rdiff -u -r1.12.2.9 -r1.12.2.9.2.1 src/sys/net/npf/npf_ctl.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/net/npf/npf_ctl.c
diff -u src/sys/net/npf/npf_ctl.c:1.12.2.9 src/sys/net/npf/npf_ctl.c:1.12.2.9.2.1
--- src/sys/net/npf/npf_ctl.c:1.12.2.9	Mon Feb 18 18:26:14 2013
+++ src/sys/net/npf/npf_ctl.c	Sun Sep 22 17:27:45 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf_ctl.c,v 1.12.2.9 2013/02/18 18:26:14 riz Exp $	*/
+/*	$NetBSD: npf_ctl.c,v 1.12.2.9.2.1 2013/09/22 17:27:45 riz Exp $	*/
 
 /*-
  * Copyright (c) 2009-2013 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: npf_ctl.c,v 1.12.2.9 2013/02/18 18:26:14 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: npf_ctl.c,v 1.12.2.9.2.1 2013/09/22 17:27:45 riz Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -244,7 +244,7 @@ npf_mk_code(prop_object_t obj, int type,
 		}
 		break;
 	case NPF_CODE_BPF:
-		if (!bpf_validate(cptr, clen)) {
+		if (!bpf_validate(cptr, clen / sizeof(struct bpf_insn))) {
 			return EINVAL;
 		}
 		break;
@@ -550,14 +550,16 @@ npfctl_rule(u_long cmd, void *data)
 	prop_dictionary_get_uint32(npf_rule, command, rcmd);
 	if (!prop_dictionary_get_cstring_nocopy(npf_rule,
 	ruleset-name, ruleset_name)) {
-		return EINVAL;
+		error = EINVAL;
+		goto out;
 	}
 
 	if (rcmd == NPF_CMD_RULE_ADD) {
-		if ((rl = npf_rule_alloc(npf_rule)) == NULL) {
-			return EINVAL;
-		}
 		retdict = prop_dictionary_create();
+		if (npf_mk_singlerule(npf_rule, NULL, rl, retdict) != 0) {
+			error = EINVAL;
+			goto out;
+		}
 	}
 
 	npf_config_enter();
@@ -618,6 +620,7 @@ npfctl_rule(u_long cmd, void *data)
 	if (rl) {
 		npf_rule_free(rl);
 	}
+out:
 	if (retdict) {
 		prop_object_release(npf_rule);
 		prop_dictionary_copyout_ioctl(pref, cmd, retdict);



CVS commit: [netbsd-6] src/sys/net/npf

2013-09-22 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Sep 22 17:29:05 UTC 2013

Modified Files:
src/sys/net/npf [netbsd-6]: npf_ctl.c

Log Message:
Pull up following revision(s) (requested by rmind in ticket #952):
sys/net/npf/npf_ctl.c: revision 1.27
npfctl_rule: fixes for the dynamic rules.


To generate a diff of this commit:
cvs rdiff -u -r1.12.2.9 -r1.12.2.10 src/sys/net/npf/npf_ctl.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/net/npf/npf_ctl.c
diff -u src/sys/net/npf/npf_ctl.c:1.12.2.9 src/sys/net/npf/npf_ctl.c:1.12.2.10
--- src/sys/net/npf/npf_ctl.c:1.12.2.9	Mon Feb 18 18:26:14 2013
+++ src/sys/net/npf/npf_ctl.c	Sun Sep 22 17:29:05 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf_ctl.c,v 1.12.2.9 2013/02/18 18:26:14 riz Exp $	*/
+/*	$NetBSD: npf_ctl.c,v 1.12.2.10 2013/09/22 17:29:05 riz Exp $	*/
 
 /*-
  * Copyright (c) 2009-2013 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: npf_ctl.c,v 1.12.2.9 2013/02/18 18:26:14 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: npf_ctl.c,v 1.12.2.10 2013/09/22 17:29:05 riz Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -244,7 +244,7 @@ npf_mk_code(prop_object_t obj, int type,
 		}
 		break;
 	case NPF_CODE_BPF:
-		if (!bpf_validate(cptr, clen)) {
+		if (!bpf_validate(cptr, clen / sizeof(struct bpf_insn))) {
 			return EINVAL;
 		}
 		break;
@@ -550,14 +550,16 @@ npfctl_rule(u_long cmd, void *data)
 	prop_dictionary_get_uint32(npf_rule, command, rcmd);
 	if (!prop_dictionary_get_cstring_nocopy(npf_rule,
 	ruleset-name, ruleset_name)) {
-		return EINVAL;
+		error = EINVAL;
+		goto out;
 	}
 
 	if (rcmd == NPF_CMD_RULE_ADD) {
-		if ((rl = npf_rule_alloc(npf_rule)) == NULL) {
-			return EINVAL;
-		}
 		retdict = prop_dictionary_create();
+		if (npf_mk_singlerule(npf_rule, NULL, rl, retdict) != 0) {
+			error = EINVAL;
+			goto out;
+		}
 	}
 
 	npf_config_enter();
@@ -618,6 +620,7 @@ npfctl_rule(u_long cmd, void *data)
 	if (rl) {
 		npf_rule_free(rl);
 	}
+out:
 	if (retdict) {
 		prop_object_release(npf_rule);
 		prop_dictionary_copyout_ioctl(pref, cmd, retdict);



CVS commit: [netbsd-6-1] src/doc

2013-09-22 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Sep 22 17:28:34 UTC 2013

Modified Files:
src/doc [netbsd-6-1]: CHANGES-6.1.2

Log Message:
Ticket 952.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.13 -r1.1.2.14 src/doc/CHANGES-6.1.2

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

Modified files:

Index: src/doc/CHANGES-6.1.2
diff -u src/doc/CHANGES-6.1.2:1.1.2.13 src/doc/CHANGES-6.1.2:1.1.2.14
--- src/doc/CHANGES-6.1.2:1.1.2.13	Sun Sep 22 05:15:57 2013
+++ src/doc/CHANGES-6.1.2	Sun Sep 22 17:28:34 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1.2,v 1.1.2.13 2013/09/22 05:15:57 riz Exp $
+# $NetBSD: CHANGES-6.1.2,v 1.1.2.14 2013/09/22 17:28:34 riz Exp $
 
 A complete list of changes from the NetBSD 6.1.1 release to the NetBSD 6.1.2
 release:
@@ -108,3 +108,8 @@ usr.bin/flock/flock.11.9
 	flock(1) really appeared first in NetBSD 6.1
 	[khorben, ticket #951]
 
+sys/net/npf/npf_ctl.c1.27
+
+	npfctl_rule: fix filtering of dynamic rules.
+	[rmind, ticket #952]
+



CVS commit: [netbsd-6] src/doc

2013-09-22 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Sep 22 17:29:34 UTC 2013

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
Ticket 952


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.47 -r1.1.2.48 src/doc/CHANGES-6.2

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

Modified files:

Index: src/doc/CHANGES-6.2
diff -u src/doc/CHANGES-6.2:1.1.2.47 src/doc/CHANGES-6.2:1.1.2.48
--- src/doc/CHANGES-6.2:1.1.2.47	Sat Sep 21 16:40:20 2013
+++ src/doc/CHANGES-6.2	Sun Sep 22 17:29:34 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.47 2013/09/21 16:40:20 riz Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.48 2013/09/22 17:29:34 riz Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -759,3 +759,8 @@ usr.bin/flock/flock.11.9
 	flock(1) really appeared first in NetBSD 6.1
 	[khorben, ticket #951]
 
+sys/net/npf/npf_ctl.c1.27
+
+	npfctl_rule: fix filtering of dynamic rules.
+	[rmind, ticket #952]
+



CVS commit: [netbsd-6] src/sys/arch/mvme68k/mvme68k

2013-09-22 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Sep 22 17:33:31 UTC 2013

Modified Files:
src/sys/arch/mvme68k/mvme68k [netbsd-6]: pmap_bootstrap.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #953):
sys/arch/mvme68k/mvme68k/pmap_bootstrap.c: revision 1.52
Move physmem calculations before nptpage initialization.
Fixes mvme68k specific part of PR port-m68k/45915
(panic: pmap_enter_ptpage: can't get KPT page).
Reported and confirmed by Andrew Gillham on his MVME177:
http://mail-index.NetBSD.org/port-mvme68k/2013/09/17/msg82.html
Should be pulled up to all netbsd-6 branches.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.51.2.1 src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.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/mvme68k/mvme68k/pmap_bootstrap.c
diff -u src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c:1.51 src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c:1.51.2.1
--- src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c:1.51	Fri Feb 10 06:28:39 2012
+++ src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c	Sun Sep 22 17:33:31 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.51 2012/02/10 06:28:39 mhitch Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.51.2.1 2013/09/22 17:33:31 riz Exp $	*/
 
 /* 
  * Copyright (c) 1991, 1993
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.51 2012/02/10 06:28:39 mhitch Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.51.2.1 2013/09/22 17:33:31 riz Exp $);
 
 #include opt_m68k_arch.h
 
@@ -100,6 +100,42 @@ pmap_bootstrap(paddr_t nextpa, paddr_t f
 #endif
 
 	/*
+	 * Initialize the mem_clusters[] array for the crash dump
+	 * code.  While we're at it, compute the total amount of
+	 * physical memory in the system.
+	 */
+	for (i = 0; i  VM_PHYSSEG_MAX; i++) {
+		if (RELOC(phys_seg_list[i].ps_start, paddr_t) ==
+		RELOC(phys_seg_list[i].ps_end, paddr_t)) {
+			/*
+			 * No more memory.
+			 */
+			break;
+		}
+
+		/*
+		 * Make sure these are properly rounded.
+		 */
+		RELOC(phys_seg_list[i].ps_start, paddr_t) =
+		m68k_round_page(RELOC(phys_seg_list[i].ps_start,
+	  paddr_t));
+		RELOC(phys_seg_list[i].ps_end, paddr_t) =
+		m68k_trunc_page(RELOC(phys_seg_list[i].ps_end,
+	  paddr_t));
+
+		size = RELOC(phys_seg_list[i].ps_end, paddr_t) -
+		RELOC(phys_seg_list[i].ps_start, paddr_t);
+
+		RELOC(mem_clusters[i].start, u_quad_t) =
+		RELOC(phys_seg_list[i].ps_start, paddr_t);
+		RELOC(mem_clusters[i].size, u_quad_t) = size;
+
+		RELOC(physmem, int) += size  PGSHIFT;
+
+		RELOC(mem_cluster_cnt, int) += 1;
+	}
+
+	/*
 	 * Calculate important physical addresses:
 	 *
 	 *	lwp0upa		lwp0 u-area		UPAGES pages
@@ -409,42 +445,6 @@ pmap_bootstrap(paddr_t nextpa, paddr_t f
 	RELOC(lwp0uarea, vaddr_t) = lwp0upa - firstpa;
 
 	/*
-	 * Initialize the mem_clusters[] array for the crash dump
-	 * code.  While we're at it, compute the total amount of
-	 * physical memory in the system.
-	 */
-	for (i = 0; i  VM_PHYSSEG_MAX; i++) {
-		if (RELOC(phys_seg_list[i].ps_start, paddr_t) ==
-		RELOC(phys_seg_list[i].ps_end, paddr_t)) {
-			/*
-			 * No more memory.
-			 */
-			break;
-		}
-
-		/*
-		 * Make sure these are properly rounded.
-		 */
-		RELOC(phys_seg_list[i].ps_start, paddr_t) =
-		m68k_round_page(RELOC(phys_seg_list[i].ps_start,
-	  paddr_t));
-		RELOC(phys_seg_list[i].ps_end, paddr_t) =
-		m68k_trunc_page(RELOC(phys_seg_list[i].ps_end,
-	  paddr_t));
-
-		size = RELOC(phys_seg_list[i].ps_end, paddr_t) -
-		RELOC(phys_seg_list[i].ps_start, paddr_t);
-
-		RELOC(mem_clusters[i].start, u_quad_t) =
-		RELOC(phys_seg_list[i].ps_start, paddr_t);
-		RELOC(mem_clusters[i].size, u_quad_t) = size;
-
-		RELOC(physmem, int) += size  PGSHIFT;
-
-		RELOC(mem_cluster_cnt, int) += 1;
-	}
-
-	/*
 	 * Scoot the start of available on-board RAM forward to
 	 * account for:
 	 *



CVS commit: [netbsd-6] src/doc

2013-09-22 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Sep 22 17:34:22 UTC 2013

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
Ticket 953


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.48 -r1.1.2.49 src/doc/CHANGES-6.2

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

Modified files:

Index: src/doc/CHANGES-6.2
diff -u src/doc/CHANGES-6.2:1.1.2.48 src/doc/CHANGES-6.2:1.1.2.49
--- src/doc/CHANGES-6.2:1.1.2.48	Sun Sep 22 17:29:34 2013
+++ src/doc/CHANGES-6.2	Sun Sep 22 17:34:22 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.48 2013/09/22 17:29:34 riz Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.49 2013/09/22 17:34:22 riz Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -764,3 +764,9 @@ sys/net/npf/npf_ctl.c1.27
 	npfctl_rule: fix filtering of dynamic rules.
 	[rmind, ticket #952]
 
+sys/arch/mvme68k/mvme68k/pmap_bootstrap.c	1.52
+
+	Fix panic: pmap_enter_ptpage: can't get KPT page.
+	Addresses mvme68k-specific part of PR#45915.
+	[tsutsui, ticket #953]
+



CVS commit: [netbsd-6-0] src/sys/arch/mvme68k/mvme68k

2013-09-22 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Sep 22 17:34:48 UTC 2013

Modified Files:
src/sys/arch/mvme68k/mvme68k [netbsd-6-0]: pmap_bootstrap.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #953):
sys/arch/mvme68k/mvme68k/pmap_bootstrap.c: revision 1.52
Move physmem calculations before nptpage initialization.
Fixes mvme68k specific part of PR port-m68k/45915
(panic: pmap_enter_ptpage: can't get KPT page).
Reported and confirmed by Andrew Gillham on his MVME177:
http://mail-index.NetBSD.org/port-mvme68k/2013/09/17/msg82.html
Should be pulled up to all netbsd-6 branches.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.51.8.1 src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.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/mvme68k/mvme68k/pmap_bootstrap.c
diff -u src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c:1.51 src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c:1.51.8.1
--- src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c:1.51	Fri Feb 10 06:28:39 2012
+++ src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c	Sun Sep 22 17:34:48 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.51 2012/02/10 06:28:39 mhitch Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.51.8.1 2013/09/22 17:34:48 riz Exp $	*/
 
 /* 
  * Copyright (c) 1991, 1993
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.51 2012/02/10 06:28:39 mhitch Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.51.8.1 2013/09/22 17:34:48 riz Exp $);
 
 #include opt_m68k_arch.h
 
@@ -100,6 +100,42 @@ pmap_bootstrap(paddr_t nextpa, paddr_t f
 #endif
 
 	/*
+	 * Initialize the mem_clusters[] array for the crash dump
+	 * code.  While we're at it, compute the total amount of
+	 * physical memory in the system.
+	 */
+	for (i = 0; i  VM_PHYSSEG_MAX; i++) {
+		if (RELOC(phys_seg_list[i].ps_start, paddr_t) ==
+		RELOC(phys_seg_list[i].ps_end, paddr_t)) {
+			/*
+			 * No more memory.
+			 */
+			break;
+		}
+
+		/*
+		 * Make sure these are properly rounded.
+		 */
+		RELOC(phys_seg_list[i].ps_start, paddr_t) =
+		m68k_round_page(RELOC(phys_seg_list[i].ps_start,
+	  paddr_t));
+		RELOC(phys_seg_list[i].ps_end, paddr_t) =
+		m68k_trunc_page(RELOC(phys_seg_list[i].ps_end,
+	  paddr_t));
+
+		size = RELOC(phys_seg_list[i].ps_end, paddr_t) -
+		RELOC(phys_seg_list[i].ps_start, paddr_t);
+
+		RELOC(mem_clusters[i].start, u_quad_t) =
+		RELOC(phys_seg_list[i].ps_start, paddr_t);
+		RELOC(mem_clusters[i].size, u_quad_t) = size;
+
+		RELOC(physmem, int) += size  PGSHIFT;
+
+		RELOC(mem_cluster_cnt, int) += 1;
+	}
+
+	/*
 	 * Calculate important physical addresses:
 	 *
 	 *	lwp0upa		lwp0 u-area		UPAGES pages
@@ -409,42 +445,6 @@ pmap_bootstrap(paddr_t nextpa, paddr_t f
 	RELOC(lwp0uarea, vaddr_t) = lwp0upa - firstpa;
 
 	/*
-	 * Initialize the mem_clusters[] array for the crash dump
-	 * code.  While we're at it, compute the total amount of
-	 * physical memory in the system.
-	 */
-	for (i = 0; i  VM_PHYSSEG_MAX; i++) {
-		if (RELOC(phys_seg_list[i].ps_start, paddr_t) ==
-		RELOC(phys_seg_list[i].ps_end, paddr_t)) {
-			/*
-			 * No more memory.
-			 */
-			break;
-		}
-
-		/*
-		 * Make sure these are properly rounded.
-		 */
-		RELOC(phys_seg_list[i].ps_start, paddr_t) =
-		m68k_round_page(RELOC(phys_seg_list[i].ps_start,
-	  paddr_t));
-		RELOC(phys_seg_list[i].ps_end, paddr_t) =
-		m68k_trunc_page(RELOC(phys_seg_list[i].ps_end,
-	  paddr_t));
-
-		size = RELOC(phys_seg_list[i].ps_end, paddr_t) -
-		RELOC(phys_seg_list[i].ps_start, paddr_t);
-
-		RELOC(mem_clusters[i].start, u_quad_t) =
-		RELOC(phys_seg_list[i].ps_start, paddr_t);
-		RELOC(mem_clusters[i].size, u_quad_t) = size;
-
-		RELOC(physmem, int) += size  PGSHIFT;
-
-		RELOC(mem_cluster_cnt, int) += 1;
-	}
-
-	/*
 	 * Scoot the start of available on-board RAM forward to
 	 * account for:
 	 *



CVS commit: [netbsd-6-0] src/doc

2013-09-22 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Sep 22 17:35:09 UTC 2013

Modified Files:
src/doc [netbsd-6-0]: CHANGES-6.0.3

Log Message:
Ticket 953


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.27 -r1.1.2.28 src/doc/CHANGES-6.0.3

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

Modified files:

Index: src/doc/CHANGES-6.0.3
diff -u src/doc/CHANGES-6.0.3:1.1.2.27 src/doc/CHANGES-6.0.3:1.1.2.28
--- src/doc/CHANGES-6.0.3:1.1.2.27	Sun Sep 22 05:16:34 2013
+++ src/doc/CHANGES-6.0.3	Sun Sep 22 17:35:09 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0.3,v 1.1.2.27 2013/09/22 05:16:34 riz Exp $
+# $NetBSD: CHANGES-6.0.3,v 1.1.2.28 2013/09/22 17:35:09 riz Exp $
 
 A complete list of changes from the NetBSD 6.0.2 release to the NetBSD 6.0.3
 release:
@@ -251,3 +251,9 @@ share/zoneinfo/australasia			1.33
 	This year Fiji will start DST on October 27, not October 20.
 	[apb, ticket #949]
 
+sys/arch/mvme68k/mvme68k/pmap_bootstrap.c	1.52
+
+	Fix panic: pmap_enter_ptpage: can't get KPT page.
+	Addresses mvme68k-specific part of PR#45915.
+	[tsutsui, ticket #953]
+



CVS commit: [netbsd-6-1] src/sys/arch/mvme68k/mvme68k

2013-09-22 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Sep 22 17:35:35 UTC 2013

Modified Files:
src/sys/arch/mvme68k/mvme68k [netbsd-6-1]: pmap_bootstrap.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #953):
sys/arch/mvme68k/mvme68k/pmap_bootstrap.c: revision 1.52
Move physmem calculations before nptpage initialization.
Fixes mvme68k specific part of PR port-m68k/45915
(panic: pmap_enter_ptpage: can't get KPT page).
Reported and confirmed by Andrew Gillham on his MVME177:
http://mail-index.NetBSD.org/port-mvme68k/2013/09/17/msg82.html
Should be pulled up to all netbsd-6 branches.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.51.16.1 src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.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/mvme68k/mvme68k/pmap_bootstrap.c
diff -u src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c:1.51 src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c:1.51.16.1
--- src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c:1.51	Fri Feb 10 06:28:39 2012
+++ src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c	Sun Sep 22 17:35:35 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.51 2012/02/10 06:28:39 mhitch Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.51.16.1 2013/09/22 17:35:35 riz Exp $	*/
 
 /* 
  * Copyright (c) 1991, 1993
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.51 2012/02/10 06:28:39 mhitch Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.51.16.1 2013/09/22 17:35:35 riz Exp $);
 
 #include opt_m68k_arch.h
 
@@ -100,6 +100,42 @@ pmap_bootstrap(paddr_t nextpa, paddr_t f
 #endif
 
 	/*
+	 * Initialize the mem_clusters[] array for the crash dump
+	 * code.  While we're at it, compute the total amount of
+	 * physical memory in the system.
+	 */
+	for (i = 0; i  VM_PHYSSEG_MAX; i++) {
+		if (RELOC(phys_seg_list[i].ps_start, paddr_t) ==
+		RELOC(phys_seg_list[i].ps_end, paddr_t)) {
+			/*
+			 * No more memory.
+			 */
+			break;
+		}
+
+		/*
+		 * Make sure these are properly rounded.
+		 */
+		RELOC(phys_seg_list[i].ps_start, paddr_t) =
+		m68k_round_page(RELOC(phys_seg_list[i].ps_start,
+	  paddr_t));
+		RELOC(phys_seg_list[i].ps_end, paddr_t) =
+		m68k_trunc_page(RELOC(phys_seg_list[i].ps_end,
+	  paddr_t));
+
+		size = RELOC(phys_seg_list[i].ps_end, paddr_t) -
+		RELOC(phys_seg_list[i].ps_start, paddr_t);
+
+		RELOC(mem_clusters[i].start, u_quad_t) =
+		RELOC(phys_seg_list[i].ps_start, paddr_t);
+		RELOC(mem_clusters[i].size, u_quad_t) = size;
+
+		RELOC(physmem, int) += size  PGSHIFT;
+
+		RELOC(mem_cluster_cnt, int) += 1;
+	}
+
+	/*
 	 * Calculate important physical addresses:
 	 *
 	 *	lwp0upa		lwp0 u-area		UPAGES pages
@@ -409,42 +445,6 @@ pmap_bootstrap(paddr_t nextpa, paddr_t f
 	RELOC(lwp0uarea, vaddr_t) = lwp0upa - firstpa;
 
 	/*
-	 * Initialize the mem_clusters[] array for the crash dump
-	 * code.  While we're at it, compute the total amount of
-	 * physical memory in the system.
-	 */
-	for (i = 0; i  VM_PHYSSEG_MAX; i++) {
-		if (RELOC(phys_seg_list[i].ps_start, paddr_t) ==
-		RELOC(phys_seg_list[i].ps_end, paddr_t)) {
-			/*
-			 * No more memory.
-			 */
-			break;
-		}
-
-		/*
-		 * Make sure these are properly rounded.
-		 */
-		RELOC(phys_seg_list[i].ps_start, paddr_t) =
-		m68k_round_page(RELOC(phys_seg_list[i].ps_start,
-	  paddr_t));
-		RELOC(phys_seg_list[i].ps_end, paddr_t) =
-		m68k_trunc_page(RELOC(phys_seg_list[i].ps_end,
-	  paddr_t));
-
-		size = RELOC(phys_seg_list[i].ps_end, paddr_t) -
-		RELOC(phys_seg_list[i].ps_start, paddr_t);
-
-		RELOC(mem_clusters[i].start, u_quad_t) =
-		RELOC(phys_seg_list[i].ps_start, paddr_t);
-		RELOC(mem_clusters[i].size, u_quad_t) = size;
-
-		RELOC(physmem, int) += size  PGSHIFT;
-
-		RELOC(mem_cluster_cnt, int) += 1;
-	}
-
-	/*
 	 * Scoot the start of available on-board RAM forward to
 	 * account for:
 	 *



CVS commit: [netbsd-6-1] src/doc

2013-09-22 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Sep 22 17:35:52 UTC 2013

Modified Files:
src/doc [netbsd-6-1]: CHANGES-6.1.2

Log Message:
Ticket 953


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.14 -r1.1.2.15 src/doc/CHANGES-6.1.2

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

Modified files:

Index: src/doc/CHANGES-6.1.2
diff -u src/doc/CHANGES-6.1.2:1.1.2.14 src/doc/CHANGES-6.1.2:1.1.2.15
--- src/doc/CHANGES-6.1.2:1.1.2.14	Sun Sep 22 17:28:34 2013
+++ src/doc/CHANGES-6.1.2	Sun Sep 22 17:35:52 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1.2,v 1.1.2.14 2013/09/22 17:28:34 riz Exp $
+# $NetBSD: CHANGES-6.1.2,v 1.1.2.15 2013/09/22 17:35:52 riz Exp $
 
 A complete list of changes from the NetBSD 6.1.1 release to the NetBSD 6.1.2
 release:
@@ -113,3 +113,9 @@ sys/net/npf/npf_ctl.c1.27
 	npfctl_rule: fix filtering of dynamic rules.
 	[rmind, ticket #952]
 
+sys/arch/mvme68k/mvme68k/pmap_bootstrap.c	1.52
+
+	Fix panic: pmap_enter_ptpage: can't get KPT page.
+	Addresses mvme68k-specific part of PR#45915.
+	[tsutsui, ticket #953]
+



CVS commit: src/sys/arch/powerpc/include/oea

2013-09-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Sep 22 17:51:31 UTC 2013

Modified Files:
src/sys/arch/powerpc/include/oea: hid.h

Log Message:
Define HID1_{SYNCBE,ABE} for the 7450


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/powerpc/include/oea/hid.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/powerpc/include/oea/hid.h
diff -u src/sys/arch/powerpc/include/oea/hid.h:1.9 src/sys/arch/powerpc/include/oea/hid.h:1.10
--- src/sys/arch/powerpc/include/oea/hid.h:1.9	Sun May 25 10:52:08 2008
+++ src/sys/arch/powerpc/include/oea/hid.h	Sun Sep 22 17:51:31 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: hid.h,v 1.9 2008/05/25 10:52:08 phx Exp $	*/
+/*	$NetBSD: hid.h,v 1.10 2013/09/22 17:51:31 matt Exp $	*/
 
 /*-
  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
@@ -139,5 +139,7 @@
 #define	HID1_PAR	0x0100	/* Disable Precharge for ... */
 #define	HID1_DFS4	0x0080	/* Dynamic Freq Switch / 4 (7448) */
 #define	HID1_DFS2	0x0040	/* Dynamic Freq Switch / 2 (7447A) */
+#define	HID1_SYNCBE	0x0800	/* Enable sync/eieio broadcast */
+#define	HID1_ABE	0x0400	/* Enable address broadcast */
 
 #endif /* _POWERPC_OEA_HID_H_ */



CVS commit: src/sys/arch/powerpc/oea

2013-09-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Sep 22 18:05:16 UTC 2013

Modified Files:
src/sys/arch/powerpc/oea: cpu_subr.c

Log Message:
Make sure ABE/SYNCBE are enabled in HID1 for the 7450 CPUs
Enable XBSEN for the 7450.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/powerpc/oea/cpu_subr.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/powerpc/oea/cpu_subr.c
diff -u src/sys/arch/powerpc/oea/cpu_subr.c:1.76 src/sys/arch/powerpc/oea/cpu_subr.c:1.77
--- src/sys/arch/powerpc/oea/cpu_subr.c:1.76	Sat Oct 20 14:42:15 2012
+++ src/sys/arch/powerpc/oea/cpu_subr.c	Sun Sep 22 18:05:16 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_subr.c,v 1.76 2012/10/20 14:42:15 kiyohara Exp $	*/
+/*	$NetBSD: cpu_subr.c,v 1.77 2013/09/22 18:05:16 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 Matt Thomas.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu_subr.c,v 1.76 2012/10/20 14:42:15 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu_subr.c,v 1.77 2013/09/22 18:05:16 matt Exp $);
 
 #include opt_ppcparam.h
 #include opt_ppccache.h
@@ -278,15 +278,31 @@ cpu_model_init(void)
 	} else if (vers == MPC601) {
 		oeacpufeat |= OEACPU_601;
 
-	} else if (MPC745X_P(vers)  vers != MPC7450) {
-		oeacpufeat |= OEACPU_HIGHSPRG;
-		oeacpufeat |= OEACPU_XBSEN;
-		oeacpufeat |= OEACPU_HIGHBAT;
-		/* Enable more and larger BAT registers */
+	} else if (MPC745X_P(vers)) {
 		register_t hid0 = mfspr(SPR_HID0);
+		register_t hid1 = mfspr(SPR_HID1);
+
+		if (vers != MPC7450) {
+			/* Enable more SPRG registers */
+			oeacpufeat |= OEACPU_HIGHSPRG;
+
+			/* Enable more BAT registers */
+			oeacpufeat |= OEACPU_HIGHBAT;
+			hid0 |= HID0_HIGH_BAT_EN;
+		}
+
+		/* Enable larger BAT registers */
+		oeacpufeat |= OEACPU_XBSEN;
 		hid0 |= HID0_XBSEN;
-		hid0 |= HID0_HIGH_BAT_EN;
+
+		/* Enable address broadcasting for MP systems */
+		hid1 |= HID1_SYNCBE | HID1_ABE;
+
 		mtspr(SPR_HID0, hid0);
+		__asm volatile(sync;isync);
+
+		mtspr(SPR_HID0, hid1);
+		__asm volatile(sync;isync);
 
 	} else if (vers == IBM750FX || vers == IBM750GX) {
 		oeacpufeat |= OEACPU_HIGHBAT;



CVS commit: src/sys/arch/powerpc/oea

2013-09-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Sep 22 18:49:10 UTC 2013

Modified Files:
src/sys/arch/powerpc/oea: cpu_subr.c

Log Message:
Disable XBSEN for the 7450.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/powerpc/oea/cpu_subr.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/powerpc/oea/cpu_subr.c
diff -u src/sys/arch/powerpc/oea/cpu_subr.c:1.77 src/sys/arch/powerpc/oea/cpu_subr.c:1.78
--- src/sys/arch/powerpc/oea/cpu_subr.c:1.77	Sun Sep 22 18:05:16 2013
+++ src/sys/arch/powerpc/oea/cpu_subr.c	Sun Sep 22 18:49:10 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_subr.c,v 1.77 2013/09/22 18:05:16 matt Exp $	*/
+/*	$NetBSD: cpu_subr.c,v 1.78 2013/09/22 18:49:10 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 Matt Thomas.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu_subr.c,v 1.77 2013/09/22 18:05:16 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu_subr.c,v 1.78 2013/09/22 18:49:10 matt Exp $);
 
 #include opt_ppcparam.h
 #include opt_ppccache.h
@@ -279,28 +279,29 @@ cpu_model_init(void)
 		oeacpufeat |= OEACPU_601;
 
 	} else if (MPC745X_P(vers)) {
-		register_t hid0 = mfspr(SPR_HID0);
 		register_t hid1 = mfspr(SPR_HID1);
 
 		if (vers != MPC7450) {
+			register_t hid0 = mfspr(SPR_HID0);
+
 			/* Enable more SPRG registers */
 			oeacpufeat |= OEACPU_HIGHSPRG;
 
 			/* Enable more BAT registers */
 			oeacpufeat |= OEACPU_HIGHBAT;
 			hid0 |= HID0_HIGH_BAT_EN;
-		}
 
-		/* Enable larger BAT registers */
-		oeacpufeat |= OEACPU_XBSEN;
-		hid0 |= HID0_XBSEN;
+			/* Enable larger BAT registers */
+			oeacpufeat |= OEACPU_XBSEN;
+			hid0 |= HID0_XBSEN;
+
+			mtspr(SPR_HID0, hid0);
+			__asm volatile(sync;isync);
+		}
 
 		/* Enable address broadcasting for MP systems */
 		hid1 |= HID1_SYNCBE | HID1_ABE;
 
-		mtspr(SPR_HID0, hid0);
-		__asm volatile(sync;isync);
-
 		mtspr(SPR_HID0, hid1);
 		__asm volatile(sync;isync);
 



CVS commit: src/sys/arch/powerpc/oea

2013-09-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Sep 22 18:56:11 UTC 2013

Modified Files:
src/sys/arch/powerpc/oea: cpu_subr.c

Log Message:
Fix cp bug.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/powerpc/oea/cpu_subr.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/powerpc/oea/cpu_subr.c
diff -u src/sys/arch/powerpc/oea/cpu_subr.c:1.78 src/sys/arch/powerpc/oea/cpu_subr.c:1.79
--- src/sys/arch/powerpc/oea/cpu_subr.c:1.78	Sun Sep 22 18:49:10 2013
+++ src/sys/arch/powerpc/oea/cpu_subr.c	Sun Sep 22 18:56:11 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_subr.c,v 1.78 2013/09/22 18:49:10 matt Exp $	*/
+/*	$NetBSD: cpu_subr.c,v 1.79 2013/09/22 18:56:11 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 Matt Thomas.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu_subr.c,v 1.78 2013/09/22 18:49:10 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu_subr.c,v 1.79 2013/09/22 18:56:11 matt Exp $);
 
 #include opt_ppcparam.h
 #include opt_ppccache.h
@@ -302,7 +302,7 @@ cpu_model_init(void)
 		/* Enable address broadcasting for MP systems */
 		hid1 |= HID1_SYNCBE | HID1_ABE;
 
-		mtspr(SPR_HID0, hid1);
+		mtspr(SPR_HID1, hid1);
 		__asm volatile(sync;isync);
 
 	} else if (vers == IBM750FX || vers == IBM750GX) {



CVS commit: [netbsd-6] src/doc

2013-09-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Sep 22 20:30:55 UTC 2013

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
Add missing newline.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.49 -r1.1.2.50 src/doc/CHANGES-6.2

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

Modified files:

Index: src/doc/CHANGES-6.2
diff -u src/doc/CHANGES-6.2:1.1.2.49 src/doc/CHANGES-6.2:1.1.2.50
--- src/doc/CHANGES-6.2:1.1.2.49	Sun Sep 22 17:34:22 2013
+++ src/doc/CHANGES-6.2	Sun Sep 22 20:30:55 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.49 2013/09/22 17:34:22 riz Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.50 2013/09/22 20:30:55 msaitoh Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -497,6 +497,7 @@ sys/dev/pci/if_bgereg.h1.57
 	Add support for BCM57762 and BCM57765, found in Apple's Thunderbolt
 	to Gigabit Ethernet adapter.  PR kern/46961
 	[tsutsui, ticket #652]
+
 sys/fs/udf/udf_allocation.c			1.34
 
 	Fix 32 bit issue in main file read-in function. On both 32 bit and
@@ -694,6 +695,7 @@ sys/net/npf/npf_inet.c1.23
 	- npf_cache_all: clear NBUF_DATAREF_RESET since npf_cache_ip() handles
 	  it.
 	[riz, ticket #942]
+
 lib/libc/stdlib/_env.c1.8
 
 	Don't scrub the environment unless we are going to change it.
@@ -715,6 +717,7 @@ sys/netinet6/in6.c1.167 via patch
 	Include BRDADDR and NETMASK to the v4 ioctls we ban for v6; from
 	FreeBSD.
 	[spz, ticket #944]
+
 xsrc/external/mit/libX11/dist/src/xkb/XKBNames.c	patch
 xsrc/external/mit/libX11/dist/src/xkb/XKBGetMap.c	patch
 



CVS commit: src/sys/rump/include/sys

2013-09-22 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Sep 22 20:51:18 UTC 2013

Modified Files:
src/sys/rump/include/sys: bus.h

Log Message:
Make dma_tag_t a bit more useful.

XXX: this header should definitely not exist, but given that it does,
let's use it to make life easier.  The implication of its existence is
that x86 port rump kernel components are not ABI-compatible with kernel
modules which use bus_space/bus_dma.  I'm not sure if anyone is interested
in that...


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/include/sys/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/rump/include/sys/bus.h
diff -u src/sys/rump/include/sys/bus.h:1.1 src/sys/rump/include/sys/bus.h:1.2
--- src/sys/rump/include/sys/bus.h:1.1	Fri Jul 15 23:40:56 2011
+++ src/sys/rump/include/sys/bus.h	Sun Sep 22 20:51:18 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.1 2011/07/15 23:40:56 dyoung Exp $	*/
+/*	$NetBSD: bus.h,v 1.2 2013/09/22 20:51:18 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -29,20 +29,19 @@
 #define _SYS_RUMP_BUS_H_
 
 /*
- * This is a blanket header for archs which are inline/macro-happy
- * in their bus.h header.  Currently, this is anything but x86.
- * After an arch is cured from inline scurvy, the native bus.h
- * should be used.
+ * This is a blanket header since archs are inline/macro-happy.
+ *
+ * XXX: this file should NOT exist here
  */
 
 /* bus space defs */
-typedef int bus_addr_t;
-typedef int bus_size_t;
+typedef unsigned long bus_addr_t;
+typedef unsigned long bus_size_t;
 typedef int bus_space_tag_t;
 typedef int bus_space_handle_t;
 
 /* bus dma defs */
-typedef int *bus_dma_tag_t;
+typedef void *bus_dma_tag_t;
 
 typedef struct {
 	bus_addr_t ds_addr;
@@ -50,6 +49,14 @@ typedef struct {
 } bus_dma_segment_t;
 
 typedef struct {
+	bus_size_t _dm_size;
+	int _dm_segcnt;
+	bus_size_t _dm_maxmaxsegsz;
+	bus_size_t _dm_boundary;
+	bus_addr_t _dm_bounce_thresh;
+	int _dm_flags;
+	void *_dm_cookie;
+
 	bus_size_t dm_maxsegsz;
 	bus_size_t dm_mapsize;
 	int dm_nsegs;



CVS commit: [netbsd-5-1] src

2013-09-22 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Sep 22 22:12:05 UTC 2013

Modified Files:
src/distrib/notes/common [netbsd-5-1]: main
src/doc [netbsd-5-1]: CHANGES-5.1.3 LAST_MINUTE README.files
src/gnu/usr.bin/groff/tmac [netbsd-5-1]: mdoc.local
src/sys/sys [netbsd-5-1]: param.h

Log Message:
Welcome to 5.1.3!


To generate a diff of this commit:
cvs rdiff -u -r1.425.2.14.2.2 -r1.425.2.14.2.3 src/distrib/notes/common/main
cvs rdiff -u -r1.1.2.52 -r1.1.2.53 src/doc/CHANGES-5.1.3
cvs rdiff -u -r1.2.30.2.2.2 -r1.2.30.2.2.3 src/doc/LAST_MINUTE
cvs rdiff -u -r1.4.10.3.2.2 -r1.4.10.3.2.3 src/doc/README.files
cvs rdiff -u -r1.43.4.15.2.5 -r1.43.4.15.2.6 \
src/gnu/usr.bin/groff/tmac/mdoc.local
cvs rdiff -u -r1.330.4.15.2.5 -r1.330.4.15.2.6 src/sys/sys/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/distrib/notes/common/main
diff -u src/distrib/notes/common/main:1.425.2.14.2.2 src/distrib/notes/common/main:1.425.2.14.2.3
--- src/distrib/notes/common/main:1.425.2.14.2.2	Thu Feb  2 08:23:02 2012
+++ src/distrib/notes/common/main	Sun Sep 22 22:12:05 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: main,v 1.425.2.14.2.2 2012/02/02 08:23:02 snj Exp $
+.\	$NetBSD: main,v 1.425.2.14.2.3 2013/09/22 22:12:05 riz Exp $
 .\
 .\ Copyright (c) 1999-2008 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -451,152 +451,112 @@ possible, it's likely that
 .Nx
 wouldn't exist.
 .
-.Ss Dedication
-.Pp
-.
-.Nx
-5.1.2 is dedicated to the memory of Yoshihiro Masuda, who passed away
-in May 2011.
-.Pp
-He was a spiritual pillar of the BSD community in Japan.
-Through an impressive number of books and articles on BSD, he gave courage
-to BSD developers.
-We remember his passion and deep love for BSD.
-.
 .if \n[FOR_RELEASE] \{\
-.Ss Changes Between the NetBSD 5.1 and 5.1.2 Releases
-.Pp
-.Nx
-\*V
-is the second critical/security update of the NetBSD 5.1 release branch.
-It represents a selected subset of fixes deemed critical for security or
-stability reasons.
-.Pp
-Please note that all fixes in security/critical updates (i.e., NetBSD 5.0.1,
-5.0.2, etc.) are cumulative, so the latest update contains all such fixes
-since the corresponding minor release.
-These fixes also appear in minor releases (i.e., NetBSD 5.1, 5.2, etc.).
-.
 .Pp
 The complete list of changes can be found in the
-CHANGES-5.1.2:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/NetBSD-5.1.2/CHANGES-5.1.2
-file in the top level directory of the NetBSD 5.1.2 release tree.
-Note that since 5.1.1 was not announced, the changes below are relative to
-5.1, not 5.1.1.
-An abbreviated list is as follows:
+CHANGES-5.1.3:
+.Lk http://ftp.NetBSD.org/pub/NetBSD/NetBSD-5.1.3/CHANGES-5.1.3
+file in the top level directory of the NetBSD 5.1.3 release tree. An abbreviated list is as follows:
 .Ss2 Security Advisory Fixes
 .(bullet
-NetBSD-SA2010-012:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2010-012.txt.asc ,
-OpenSSL TLS extension parsing race condition.
-.It
-NetBSD-SA2011-001:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2011-001.txt.asc ,
-BIND DoS due to improper handling of RRSIG records.
-.It
-NetBSD-SA2011-002:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2011-002.txt.asc ,
-OpenSSL TLS extension parsing race condition.
-.It
-NetBSD-SA2011-003:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2011-003.txt.asc ,
-Exhausting kernel memory from user controlled value.
-.It
-NetBSD-SA2011-004:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2011-004.txt.asc ,
-Kernel stack overflow via nested IPCOMP packet.
-.It
-NetBSD-SA2011-005:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2011-005.txt.asc ,
-ISC dhclient does not strip shell meta-characters in environment variables passed to scripts.
-.It
-NetBSD-SA2011-006:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2011-006.txt.asc ,
-BIND DoS via packet with rrtype zero.
-.It
-NetBSD-SA2011-007:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2011-007.txt.asc ,
-LZW decoding loop on manipulated compressed files.
-.It
-NetBSD-SA2011-008:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2011-008.txt.asc ,
-OpenPAM privilege escalation.
-.It
-NetBSD-SA2011-009:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2011-009.txt.asc ,
-BIND resolver DoS.
+NetBSD-SA2012-001:
+.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2012-001.txt.asc
+OpenSSL buffer overflow in DER read function
+.It
+NetBSD-SA2012-002:
+.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2012-002.txt.asc
+OpenSSL Invalid TLS/DTLS record attack
+.It
+NetBSD-SA2012-003:
+.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2012-003.txt.asc
+Intel processors sysret to non-canonical address behaviour
+.It

CVS commit: [netbsd-5-2] src

2013-09-22 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Sep 22 22:43:10 UTC 2013

Modified Files:
src/distrib/notes/common [netbsd-5-2]: main
src/doc [netbsd-5-2]: CHANGES-5.2.1 LAST_MINUTE README.files
src/gnu/usr.bin/groff/tmac [netbsd-5-2]: mdoc.local
src/sys/sys [netbsd-5-2]: param.h

Log Message:
Welcome to 5.2.1!


To generate a diff of this commit:
cvs rdiff -u -r1.425.2.16 -r1.425.2.16.2.1 src/distrib/notes/common/main
cvs rdiff -u -r1.1.2.21 -r1.1.2.22 src/doc/CHANGES-5.2.1
cvs rdiff -u -r1.2.30.3 -r1.2.30.3.2.1 src/doc/LAST_MINUTE
cvs rdiff -u -r1.4.10.4 -r1.4.10.4.2.1 src/doc/README.files
cvs rdiff -u -r1.43.4.18.2.1 -r1.43.4.18.2.2 \
src/gnu/usr.bin/groff/tmac/mdoc.local
cvs rdiff -u -r1.330.4.18.2.1 -r1.330.4.18.2.2 src/sys/sys/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/distrib/notes/common/main
diff -u src/distrib/notes/common/main:1.425.2.16 src/distrib/notes/common/main:1.425.2.16.2.1
--- src/distrib/notes/common/main:1.425.2.16	Tue Nov 27 18:12:23 2012
+++ src/distrib/notes/common/main	Sun Sep 22 22:43:10 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: main,v 1.425.2.16 2012/11/27 18:12:23 riz Exp $
+.\	$NetBSD: main,v 1.425.2.16.2.1 2013/09/22 22:43:10 riz Exp $
 .\
 .\ Copyright (c) 1999-2008 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -454,325 +454,74 @@ wouldn't exist.
 .if \n[FOR_RELEASE] \{\
 .Pp
 The complete list of changes can be found in the
-CHANGES-5.2:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/NetBSD-5.2/CHANGES-5.2
-file in the top level directory of the NetBSD 5.2 release tree. An abbreviated list is as follows:
+CHANGES-5.2.1:
+.Lk http://ftp.NetBSD.org/pub/NetBSD/NetBSD-5.2.1/CHANGES-5.2.1
+file in the top level directory of the NetBSD 5.2.1 release tree. An abbreviated list is as follows:
 .Ss2 Security Advisory Fixes
 .(bullet
-NetBSD-SA2010-012:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2010-012.txt.asc ,
-OpenSSL TLS extension parsing race condition
-.It
-NetBSD-SA2011-001:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2011-001.txt.asc ,
-BIND DoS due to improper handling of RRSIG records
-.It
-NetBSD-SA2011-002:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2011-002.txt.asc ,
-OpenSSL TLS extension parsing race condition
-.It
-NetBSD-SA2011-003:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2011-003.txt.asc ,
-Exhausting kernel memory from user controlled value
-.It
-NetBSD-SA2011-004:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2011-004.txt.asc ,
-Kernel stack overflow via nested IPCOMP packet (CVE-2011-1547)
-.It
-NetBSD-SA2011-005:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2011-005.txt.asc ,
-ISC dhclient does not strip shell meta-characters (CVE-2011-0997)
-.It
-NetBSD-SA2011-006:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2011-006.txt.asc ,
-BIND DoS via packet with rrtype zero
-.It
-NetBSD-SA2011-007:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2011-007.txt.asc ,
-LZW decoding loop on manipulated compressed files
-.It
-NetBSD-SA2011-008:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2011-008.txt.asc ,
-OpenPAM privilege escalation (CVE-2010-1166)
-.It
-NetBSD-SA2011-009:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2011-009.txt.asc ,
-BIND resolver DoS
-.It
-NetBSD-SA2012-001:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2012-001.txt.asc ,
-OpenSSL buffer overflow in DER read function
-.It
-NetBSD-SA2012-002:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2012-002.txt.asc ,
-OpenSSL Invalid TLS/DTLS record attack
-.It
-NetBSD-SA2012-003:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2012-003.txt.asc ,
-Intel processors sysret to non-canonical address behaviour
-.It
-NetBSD-SA2012-004:
-.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2012-004.txt.asc ,
-BIND resolver DoS when using DNSSEC Validation
-.bullet)
-.
-.Pp
-Advisories prior to NetBSD-SA2010-012 do not affect
-NetBSD 5.2:
-.Lk http://www.NetBSD.org/support/security/patches-5.2.html .
-.Ss2 Other Security Fixes
-.(bullet
-openssl: Fix CVE-2010-3864, CVE-2010-4180, CVE-2011-0014, CVE-2011-4109, CVE-2011-4576, CVE-2012-0050, CVE-2012-2110, and CVE-2012-2333.
+NetBSD-SA2013-004:
+.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2013-004.txt.asc
+Vulnerabilities in grep
 .It
-postfix: Fix CVE-2011-0411 and CVE-2011-1720.
+NetBSD-SA2013-005:
+.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2013-005.txt.asc
+bind Denial of Service (CVE-2013-4854)
 .It
-xrdb: Fix CVE-2011-0465.
+NetBSD-SA2013-006:
+.Lk http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2013-006.txt.asc
+Arbitrary Kernel Read with netstat -P
 .It
-.Xr dhcpcd 8 

CVS commit: [rmind-smpnet] src/sys

2013-09-22 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Mon Sep 23 00:57:53 UTC 2013

Modified Files:
src/sys/dist/pf/net [rmind-smpnet]: pf.c
src/sys/kern [rmind-smpnet]: uipc_socket2.c
src/sys/netinet [rmind-smpnet]: in_pcb.c in_pcb.h portalgo.c raw_ip.c
tcp_input.c tcp_subr.c tcp_usrreq.c tcp_vtw.c udp_usrreq.c
udp_var.h
src/sys/netinet6 [rmind-smpnet]: in6_pcb.c

Log Message:
- Add some initial locking to the IPv4 PCB.
- Rename inpcb_lookup_*() routines to be more accurate and add comments.
- Add some comments about connection life-cycle WRT socket layer.


To generate a diff of this commit:
cvs rdiff -u -r1.69.4.1 -r1.69.4.2 src/sys/dist/pf/net/pf.c
cvs rdiff -u -r1.112.2.1 -r1.112.2.2 src/sys/kern/uipc_socket2.c
cvs rdiff -u -r1.145.2.2 -r1.145.2.3 src/sys/netinet/in_pcb.c
cvs rdiff -u -r1.51.2.1 -r1.51.2.2 src/sys/netinet/in_pcb.h
cvs rdiff -u -r1.5.2.1 -r1.5.2.2 src/sys/netinet/portalgo.c
cvs rdiff -u -r1.116.2.2 -r1.116.2.3 src/sys/netinet/raw_ip.c
cvs rdiff -u -r1.327.2.1 -r1.327.2.2 src/sys/netinet/tcp_input.c
cvs rdiff -u -r1.250.2.1 -r1.250.2.2 src/sys/netinet/tcp_subr.c
cvs rdiff -u -r1.166.4.2 -r1.166.4.3 src/sys/netinet/tcp_usrreq.c
cvs rdiff -u -r1.9.4.1 -r1.9.4.2 src/sys/netinet/tcp_vtw.c
cvs rdiff -u -r1.190.2.2 -r1.190.2.3 src/sys/netinet/udp_usrreq.c
cvs rdiff -u -r1.38.4.2 -r1.38.4.3 src/sys/netinet/udp_var.h
cvs rdiff -u -r1.123.2.1 -r1.123.2.2 src/sys/netinet6/in6_pcb.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/dist/pf/net/pf.c
diff -u src/sys/dist/pf/net/pf.c:1.69.4.1 src/sys/dist/pf/net/pf.c:1.69.4.2
--- src/sys/dist/pf/net/pf.c:1.69.4.1	Wed Jul 17 03:16:31 2013
+++ src/sys/dist/pf/net/pf.c	Mon Sep 23 00:57:53 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pf.c,v 1.69.4.1 2013/07/17 03:16:31 rmind Exp $	*/
+/*	$NetBSD: pf.c,v 1.69.4.2 2013/09/23 00:57:53 rmind Exp $	*/
 /*	$OpenBSD: pf.c,v 1.552.2.1 2007/11/27 16:37:57 henning Exp $ */
 
 /*
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pf.c,v 1.69.4.1 2013/07/17 03:16:31 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: pf.c,v 1.69.4.2 2013/09/23 00:57:53 rmind Exp $);
 
 #include pflog.h
 
@@ -2799,11 +2799,11 @@ pf_socket_lookup(int direction, struct p
 
 #ifdef __NetBSD__
 #define in_pcbhashlookup(tbl, saddr, sport, daddr, dport) \
-inpcb_lookup_connect(tbl, saddr, sport, daddr, dport, NULL)
+inpcb_lookup(tbl, saddr, sport, daddr, dport, NULL)
 #define in6_pcbhashlookup(tbl, saddr, sport, daddr, dport) \
 in6_pcblookup_connect(tbl, saddr, sport, daddr, dport, 0, NULL)
 #define inpcb_lookup_listen(tbl, addr, port, zero) \
-inpcb_lookup_bind(tbl, addr, port)
+inpcb_lookup_bound(tbl, addr, port)
 #define in6_pcblookup_listen(tbl, addr, port, zero) \
 in6_pcblookup_bind(tbl, addr, port, zero)
 #endif

Index: src/sys/kern/uipc_socket2.c
diff -u src/sys/kern/uipc_socket2.c:1.112.2.1 src/sys/kern/uipc_socket2.c:1.112.2.2
--- src/sys/kern/uipc_socket2.c:1.112.2.1	Wed Aug 28 15:21:48 2013
+++ src/sys/kern/uipc_socket2.c	Mon Sep 23 00:57:53 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_socket2.c,v 1.112.2.1 2013/08/28 15:21:48 rmind Exp $	*/
+/*	$NetBSD: uipc_socket2.c,v 1.112.2.2 2013/09/23 00:57:53 rmind 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.112.2.1 2013/08/28 15:21:48 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: uipc_socket2.c,v 1.112.2.2 2013/09/23 00:57:53 rmind Exp $);
 
 #include opt_mbuftrace.h
 #include opt_sb_max.h
@@ -82,6 +82,37 @@ __KERNEL_RCSID(0, $NetBSD: uipc_socket2
 /*
  * Primitive routines for operating on sockets and socket buffers.
  *
+ * Connection life-cycle:
+ *
+ *	Normal sequence from the active (originating) side:
+ *
+ *	- soisconnecting() is called during processing of connect() call,
+ *	- resulting in an eventual call to soisconnected() if/when the
+ *	  connection is established.
+ *
+ *	When the connection is torn down during processing of disconnect():
+ *
+ *	- soisdisconnecting() is called and,
+ *	- soisdisconnected() is called when the connection to the peer
+ *	  is totally severed.
+ *
+ *	The semantics of these routines are such that connectionless protocols
+ *	can call soisconnected() and soisdisconnected() only, bypassing the
+ *	in-progress calls when setting up a ``connection'' takes no time.
+ *
+ *	From the passive side, a socket is created with two queues of sockets:
+ *
+ *	- so_q0 (0) for partial connections (i.e. connections in progress)
+ *	- so_q (1) for connections already made and awaiting user acceptance.
+ *
+ *	As a protocol is preparing incoming connections, it creates a socket
+ *	structure queued on so_q0 by calling sonewconn().  When the connection
+ *	is established, soisconnected() is called, and transfers the
+ *	socket structure to so_q, making it available to 

CVS commit: src/sys/arch/mvme68k

2013-09-22 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Sep 23 01:39:27 UTC 2013

Modified Files:
src/sys/arch/mvme68k/include: prom.h
src/sys/arch/mvme68k/stand/libbug: outln.c outstr.c

Log Message:
Make MVMEPROM_ARG2() macro take two args in a single asm statement.

Fixes a problem that a wrong address is passed to the MVMEPROM outstr
function (then caused garbages on screen) after we switched to gcc-4.5.
Reported and confirmed by Andrew Gillham on port-mvme68k@:
http://mail-index.NetBSD.org/port-mvme68k/2013/09/17/msg84.html
http://mail-index.NetBSD.org/port-mvme68k/2013/09/19/msg85.html
http://mail-index.NetBSD.org/port-mvme68k/2013/09/22/msg95.html
http://mail-index.NetBSD.org/port-mvme68k/2013/09/22/msg97.html
No error on build.sh -m mvme68k build builds.

Should be pulled up to netbsd-6 branches.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/mvme68k/include/prom.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mvme68k/stand/libbug/outln.c \
src/sys/arch/mvme68k/stand/libbug/outstr.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/mvme68k/include/prom.h
diff -u src/sys/arch/mvme68k/include/prom.h:1.17 src/sys/arch/mvme68k/include/prom.h:1.18
--- src/sys/arch/mvme68k/include/prom.h:1.17	Sat Dec 24 23:24:01 2005
+++ src/sys/arch/mvme68k/include/prom.h	Mon Sep 23 01:39:27 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: prom.h,v 1.17 2005/12/24 23:24:01 perry Exp $	*/
+/*	$NetBSD: prom.h,v 1.18 2013/09/23 01:39:27 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1995 Theo de Raadt
@@ -155,8 +155,10 @@ struct mvmeprom_args {
 	__asm volatile (clrl %sp@-)
 #define MVMEPROM_ARG1(arg) \
 	__asm volatile (movel %0, %%sp@-::d (arg))
-#define MVMEPROM_ARG2(arg) \
-	__asm volatile (movel %0, %%sp@-::d (arg))
+#define MVMEPROM_ARG2(arg0, arg1)\
+	__asm volatile (movel %0, %%sp@-;			\
+			movel %1, %%sp@-;			\
+			:: d (arg0), d (arg1):)
 #define MVMEPROM_GETRES(ret) \
 	__asm volatile (movel %%sp@+,%0: =d (ret):)
 #define MVMEPROM_GETSR(ret) \

Index: src/sys/arch/mvme68k/stand/libbug/outln.c
diff -u src/sys/arch/mvme68k/stand/libbug/outln.c:1.3 src/sys/arch/mvme68k/stand/libbug/outln.c:1.4
--- src/sys/arch/mvme68k/stand/libbug/outln.c:1.3	Sat Jan 12 09:54:31 2008
+++ src/sys/arch/mvme68k/stand/libbug/outln.c	Mon Sep 23 01:39:27 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: outln.c,v 1.3 2008/01/12 09:54:31 tsutsui Exp $	*/
+/*	$NetBSD: outln.c,v 1.4 2013/09/23 01:39:27 tsutsui Exp $	*/
 
 /*
  * bug routines -- assumes that the necessary sections of memory
@@ -13,7 +13,6 @@ void
 mvmeprom_outln(char *start, char *end)
 {
 
-	MVMEPROM_ARG1(end);
-	MVMEPROM_ARG2(start);
+	MVMEPROM_ARG2(end, start);
 	MVMEPROM_CALL(MVMEPROM_OUTSTRCRLF);
 }
Index: src/sys/arch/mvme68k/stand/libbug/outstr.c
diff -u src/sys/arch/mvme68k/stand/libbug/outstr.c:1.3 src/sys/arch/mvme68k/stand/libbug/outstr.c:1.4
--- src/sys/arch/mvme68k/stand/libbug/outstr.c:1.3	Sat Jan 12 09:54:31 2008
+++ src/sys/arch/mvme68k/stand/libbug/outstr.c	Mon Sep 23 01:39:27 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: outstr.c,v 1.3 2008/01/12 09:54:31 tsutsui Exp $	*/
+/*	$NetBSD: outstr.c,v 1.4 2013/09/23 01:39:27 tsutsui Exp $	*/
 
 /*
  * bug routines -- assumes that the necessary sections of memory
@@ -13,7 +13,6 @@ void
 mvmeprom_outstr(char *start, char *end)
 {
 
-	MVMEPROM_ARG1(end);
-	MVMEPROM_ARG2(start);
+	MVMEPROM_ARG2(end, start);
 	MVMEPROM_CALL(MVMEPROM_OUTSTR);
 }