PERFORCE change 95757 for review

Warner Losh imp at FreeBSD.org
Fri Apr 21 06:37:49 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=95757

Change 95757 by imp at imp_harmony on 2006/04/21 06:36:51

	IFC @95756

Affected files ...

.. //depot/projects/arm/src/sys/alpha/isa/isa.c#3 integrate
.. //depot/projects/arm/src/sys/alpha/pci/apecs_pci.c#2 integrate
.. //depot/projects/arm/src/sys/alpha/pci/lca_pci.c#2 integrate
.. //depot/projects/arm/src/sys/alpha/pci/pcibus.c#3 integrate
.. //depot/projects/arm/src/sys/amd64/amd64/dump_machdep.c#3 integrate
.. //depot/projects/arm/src/sys/amd64/amd64/minidump_machdep.c#1 branch
.. //depot/projects/arm/src/sys/amd64/amd64/nexus.c#3 integrate
.. //depot/projects/arm/src/sys/amd64/amd64/pmap.c#11 integrate
.. //depot/projects/arm/src/sys/amd64/amd64/uma_machdep.c#2 integrate
.. //depot/projects/arm/src/sys/amd64/include/md_var.h#3 integrate
.. //depot/projects/arm/src/sys/amd64/include/minidump.h#1 branch
.. //depot/projects/arm/src/sys/arm/arm/nexus.c#3 integrate
.. //depot/projects/arm/src/sys/arm/at91/at91.c#16 integrate
.. //depot/projects/arm/src/sys/arm/sa11x0/sa11x0.c#3 integrate
.. //depot/projects/arm/src/sys/arm/xscale/i80321/i80321_pci.c#5 integrate
.. //depot/projects/arm/src/sys/arm/xscale/i80321/iq80321.c#5 integrate
.. //depot/projects/arm/src/sys/arm/xscale/i80321/obio.c#3 integrate
.. //depot/projects/arm/src/sys/boot/arm/at91/bootiic/arm_init.s#6 branch
.. //depot/projects/arm/src/sys/conf/files.amd64#10 integrate
.. //depot/projects/arm/src/sys/conf/files.i386#12 integrate
.. //depot/projects/arm/src/sys/crypto/via/padlock.c#3 integrate
.. //depot/projects/arm/src/sys/dev/acpica/acpi.c#7 integrate
.. //depot/projects/arm/src/sys/dev/ciss/ciss.c#6 integrate
.. //depot/projects/arm/src/sys/dev/mpt/mpt.c#10 integrate
.. //depot/projects/arm/src/sys/geom/eli/g_eli.c#9 integrate
.. //depot/projects/arm/src/sys/geom/eli/g_eli_crypto.c#3 integrate
.. //depot/projects/arm/src/sys/i386/i386/dump_machdep.c#3 integrate
.. //depot/projects/arm/src/sys/i386/i386/minidump_machdep.c#1 branch
.. //depot/projects/arm/src/sys/i386/i386/nexus.c#3 integrate
.. //depot/projects/arm/src/sys/i386/include/md_var.h#3 integrate
.. //depot/projects/arm/src/sys/i386/include/minidump.h#1 branch
.. //depot/projects/arm/src/sys/ia64/ia64/nexus.c#3 integrate
.. //depot/projects/arm/src/sys/kern/kern_rwlock.c#4 integrate
.. //depot/projects/arm/src/sys/kern/subr_bus.c#6 integrate
.. //depot/projects/arm/src/sys/kern/subr_rman.c#6 integrate
.. //depot/projects/arm/src/sys/powerpc/powermac/grackle.c#2 integrate
.. //depot/projects/arm/src/sys/powerpc/powermac/hrowpic.c#2 integrate
.. //depot/projects/arm/src/sys/powerpc/powermac/macio.c#3 integrate
.. //depot/projects/arm/src/sys/powerpc/powermac/uninorth.c#3 integrate
.. //depot/projects/arm/src/sys/powerpc/powerpc/openpic.c#2 integrate
.. //depot/projects/arm/src/sys/powerpc/psim/iobus.c#2 integrate
.. //depot/projects/arm/src/sys/sparc64/ebus/ebus.c#5 integrate
.. //depot/projects/arm/src/sys/sparc64/pci/psycho.c#5 integrate
.. //depot/projects/arm/src/sys/sparc64/sbus/sbus.c#5 integrate
.. //depot/projects/arm/src/sys/sparc64/sparc64/nexus.c#3 integrate
.. //depot/projects/arm/src/sys/sys/bus.h#4 integrate
.. //depot/projects/arm/src/sys/sys/rwlock.h#2 integrate
.. //depot/projects/arm/src/sys/vm/vm_page.c#10 integrate

Differences ...

==== //depot/projects/arm/src/sys/alpha/isa/isa.c#3 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/isa/isa.c,v 1.38 2005/10/25 19:48:45 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/isa/isa.c,v 1.39 2006/04/20 04:16:02 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -231,6 +231,7 @@
 	    res = rman_reserve_resource(&isa_drq_rman, start, start, 1,
 					0, child);
 	    
+	rman_set_rid(res, *rid);
 	if (res && !passthrough) {
 		rle = resource_list_find(rl, type, *rid);
 		rle->start = rman_get_start(res);

==== //depot/projects/arm/src/sys/alpha/pci/apecs_pci.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/pci/apecs_pci.c,v 1.15 2003/08/22 07:20:27 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/pci/apecs_pci.c,v 1.16 2006/04/20 04:16:02 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -79,12 +79,17 @@
 apecs_pcib_alloc_resource(device_t bus, device_t child, int type, int *rid,
 			  u_long start, u_long end, u_long count, u_int flags)
 {
+	struct resource *rv = NULL;
+
 	if ((hwrpb->rpb_type == ST_DEC_2100_A50) &&
 	    (type == SYS_RES_IRQ))
-		return isa_alloc_intr(bus, child, start);
+		rv = isa_alloc_intr(bus, child, start);
 	else
-		return alpha_pci_alloc_resource(bus, child, type, rid,
-					  start, end, count, flags);
+		rv = alpha_pci_alloc_resource(bus, child, type, rid,
+		    start, end, count, flags);
+	if (rv != NULL)
+		rman_set_rid(rv, *rid);
+	return (rv);
 }
 
 static int

==== //depot/projects/arm/src/sys/alpha/pci/lca_pci.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/pci/lca_pci.c,v 1.17 2003/08/22 07:20:27 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/pci/lca_pci.c,v 1.18 2006/04/20 04:16:02 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -78,11 +78,16 @@
 lca_pcib_alloc_resource(device_t bus, device_t child, int type, int *rid,
 			u_long start, u_long end, u_long count, u_int flags)
 {
+	struct resource *rv = NULL;
+
 	if (type == SYS_RES_IRQ)
-		return isa_alloc_intr(bus, child, start);
+		rv = isa_alloc_intr(bus, child, start);
 	else
-		return alpha_pci_alloc_resource(bus, child, type, rid,
-					  start, end, count, flags);
+		rv = alpha_pci_alloc_resource(bus, child, type, rid,
+		    start, end, count, flags);
+	if (rv != NULL)
+		rman_set_rid(rv, *rid);
+	return (rv);
 }
 
 static int

==== //depot/projects/arm/src/sys/alpha/pci/pcibus.c#3 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/alpha/pci/pcibus.c,v 1.37 2005/09/25 20:12:29 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/alpha/pci/pcibus.c,v 1.38 2006/04/20 04:16:02 imp Exp $");
 
 #include "opt_isa.h"
 
@@ -96,7 +96,12 @@
 alpha_platform_alloc_ide_intr(int chan)
 {
 	int irqs[2] = { 14, 15 };
-	return isa_alloc_intr(0, 0, irqs[chan]);
+	struct resource *rv;
+
+	rv = isa_alloc_intr(0, 0, irqs[chan]);
+	if (rv != NULL)
+		rman_set_rid(rv, *rid);
+	return (rv);
 }
 
 int
@@ -230,9 +235,11 @@
 #ifdef DEV_ISA
 		if((start >= ISA_IRQ_OFFSET) &&
 		   (end < ISA_IRQ_OFFSET + ISA_IRQ_LEN)) {
-		  	return isa_alloc_intrs(bus, child,
-					       start - ISA_IRQ_OFFSET,
-					       end - ISA_IRQ_OFFSET);
+		  	rv = isa_alloc_intrs(bus, child,
+			    start - ISA_IRQ_OFFSET, end - ISA_IRQ_OFFSET);
+			if (rv != NULL)
+				rman_set_rid(rv, *rid);
+			return (rv);
 		}
 		else
 #endif
@@ -252,6 +259,7 @@
 	if (rv == 0)
 		return 0;
 
+	rman_set_rid(rv, *rid);
 	rstart = rman_get_start(rv);
 	rman_set_bustag(rv, ALPHAPCI_GET_BUSTAG(bus, type));
 	rman_set_bushandle(rv, rstart);

==== //depot/projects/arm/src/sys/amd64/amd64/dump_machdep.c#3 (text+ko) ====

@@ -25,12 +25,13 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/dump_machdep.c,v 1.11 2005/07/02 19:57:30 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/dump_machdep.c,v 1.12 2006/04/21 04:24:50 peter Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/conf.h>
 #include <sys/cons.h>
+#include <sys/sysctl.h>
 #include <sys/kernel.h>
 #include <sys/kerneldump.h>
 #include <vm/vm.h>
@@ -40,6 +41,11 @@
 
 CTASSERT(sizeof(struct kerneldumpheader) == 512);
 
+int do_minidump = 1;
+TUNABLE_INT("debug.minidump", &do_minidump);
+SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RW, &do_minidump, 0,
+    "Enable mini crash dumps");
+
 /*
  * Don't touch the first SIZEOF_METADATA bytes on the dump device. This
  * is to protect us from metadata and to protect metadata from us.
@@ -272,6 +278,10 @@
 	size_t hdrsz;
 	int error;
 
+	if (do_minidump) {
+		minidumpsys(di);
+		return;
+	}
 	bzero(&ehdr, sizeof(ehdr));
 	ehdr.e_ident[EI_MAG0] = ELFMAG0;
 	ehdr.e_ident[EI_MAG1] = ELFMAG1;

==== //depot/projects/arm/src/sys/amd64/amd64/nexus.c#3 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/nexus.c,v 1.67 2005/09/25 20:03:41 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/nexus.c,v 1.68 2006/04/20 04:16:34 imp Exp $");
 
 /*
  * This code implements a `root nexus' for Intel Architecture
@@ -340,7 +340,7 @@
 	rv = rman_reserve_resource(rm, start, end, count, flags, child);
 	if (rv == 0)
 		return 0;
-
+	rman_set_rid(rv, *rid);
 	if (type == SYS_RES_MEMORY) {
 		rman_set_bustag(rv, AMD64_BUS_SPACE_MEM);
 	} else if (type == SYS_RES_IOPORT) {

==== //depot/projects/arm/src/sys/amd64/amd64/pmap.c#11 (text+ko) ====

@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.547 2006/04/18 20:17:32 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.549 2006/04/21 04:50:18 peter Exp $");
 
 /*
  *	Manages physical address maps.
@@ -181,7 +181,7 @@
 
 static u_int64_t	KPTphys;	/* phys addr of kernel level 1 */
 static u_int64_t	KPDphys;	/* phys addr of kernel level 2 */
-static u_int64_t	KPDPphys;	/* phys addr of kernel level 3 */
+u_int64_t		KPDPphys;	/* phys addr of kernel level 3 */
 u_int64_t		KPML4phys;	/* phys addr of kernel level 4 */
 
 static u_int64_t	DMPDphys;	/* phys addr of direct mapped level 2 */
@@ -1565,6 +1565,7 @@
 	/* entire chunk is free, return it */
 	TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list);
 	m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc));
+	dump_drop_page(m->phys_addr);
 	vm_page_lock_queues();
 	vm_page_free(m);
 	vm_page_unlock_queues();
@@ -1645,6 +1646,7 @@
 	PV_STAT(pc_chunk_count++);
 	PV_STAT(pc_chunk_allocs++);
 	colour++;
+	dump_add_page(m->phys_addr);
 	pc = (void *)PHYS_TO_DMAP(m->phys_addr);
 	pc->pc_pmap = pmap;
 	pc->pc_map[0] = PC_FREE0 & ~1ul;	/* preallocated bit 0 */
@@ -2794,6 +2796,7 @@
 			PV_STAT(pc_chunk_frees++);
 			TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list);
 			m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc));
+			dump_drop_page(m->phys_addr);
 			vm_page_lock_queues();
 			vm_page_free(m);
 			vm_page_unlock_queues();

==== //depot/projects/arm/src/sys/amd64/amd64/uma_machdep.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/uma_machdep.c,v 1.1 2003/10/14 05:51:31 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/uma_machdep.c,v 1.2 2006/04/21 04:24:50 peter Exp $");
 
 #include <sys/param.h>
 #include <sys/lock.h>
@@ -44,6 +44,7 @@
 {
 	static vm_pindex_t colour;
 	vm_page_t m;
+	vm_paddr_t pa;
 	void *va;
 	int pflags;
 
@@ -64,7 +65,9 @@
 		} else
 			break;
 	}
-	va = (void *)PHYS_TO_DMAP(m->phys_addr);
+	pa = m->phys_addr;
+	dump_add_page(pa);
+	va = (void *)PHYS_TO_DMAP(pa);
 	if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0)
 		pagezero(va);
 	return (va);
@@ -74,8 +77,11 @@
 uma_small_free(void *mem, int size, u_int8_t flags)
 {
 	vm_page_t m;
+	vm_paddr_t pa;
 
-	m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)mem));
+	pa = DMAP_TO_PHYS((vm_offset_t)mem);
+	dump_drop_page(pa);
+	m = PHYS_TO_VM_PAGE(pa);
 	vm_page_lock_queues();
 	vm_page_free(m);
 	vm_page_unlock_queues();

==== //depot/projects/arm/src/sys/amd64/include/md_var.h#3 (text+ko) ====

@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/include/md_var.h,v 1.76 2005/10/14 22:52:00 jkim Exp $
+ * $FreeBSD: src/sys/amd64/include/md_var.h,v 1.77 2006/04/21 04:24:50 peter Exp $
  */
 
 #ifndef _MACHINE_MD_VAR_H_
@@ -53,6 +53,8 @@
 extern	char	kstack[];
 extern	char	sigcode[];
 extern	int	szsigcode;
+extern	uint64_t *vm_page_dump;
+extern	int	vm_page_dump_size;
 
 extern	struct pcpu __pcpu[];
 
@@ -61,11 +63,14 @@
 struct	reg;
 struct	fpreg;
 struct  dbreg;
+struct	dumperinfo;
 
 void	busdma_swi(void);
 void	cpu_setregs(void);
 void	doreti_iret(void) __asm(__STRING(doreti_iret));
 void	doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault));
+void	dump_add_page(vm_paddr_t);
+void	dump_drop_page(vm_paddr_t);
 void	initializecpu(void);
 void	fillw(int /*u_short*/ pat, void *base, size_t cnt);
 void	fpstate_drop(struct thread *td);
@@ -75,5 +80,6 @@
 void	pagezero(void *addr);
 void	setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int ist);
 int	user_dbreg_trap(void);
+void	minidumpsys(struct dumperinfo *);
 
 #endif /* !_MACHINE_MD_VAR_H_ */

==== //depot/projects/arm/src/sys/arm/arm/nexus.c#3 (text+ko) ====

@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/nexus.c,v 1.6 2005/09/25 21:06:49 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/nexus.c,v 1.7 2006/04/20 04:12:02 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -214,6 +214,7 @@
 	if (rv == 0)
 		return 0;
 
+	rman_set_rid(rv, *rid);
 	rman_set_bustag(rv, (void*)ARM_BUS_SPACE_MEM);
 	rman_set_bushandle(rv, rman_get_start(rv));		
 	

==== //depot/projects/arm/src/sys/arm/at91/at91.c#16 (text+ko) ====

@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/at91/at91.c,v 1.4 2006/04/06 04:32:29 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/at91/at91.c,v 1.5 2006/04/20 04:12:02 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -497,6 +497,7 @@
 		rle->start = rman_get_start(rle->res);
 		rle->end = rman_get_end(rle->res);
 		rle->count = count;
+		rman_set_rid(rle->res, *rid);
 	}
 	return (rle->res);
 }

==== //depot/projects/arm/src/sys/arm/sa11x0/sa11x0.c#3 (text+ko) ====

@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/sa11x0/sa11x0.c,v 1.5 2005/09/25 21:06:50 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/sa11x0/sa11x0.c,v 1.6 2006/04/20 04:12:02 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -127,6 +127,8 @@
 	
 	res = rman_reserve_resource(&sa11x0_softc->sa11x0_rman, *rid, *rid,
 	    count, flags, child);
+	if (res != NULL)
+		rman_set_rid(res, *rid);
 
 	return (res);
 }

==== //depot/projects/arm/src/sys/arm/xscale/i80321/i80321_pci.c#5 (text+ko) ====

@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/i80321_pci.c,v 1.7 2006/04/13 15:07:59 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/i80321_pci.c,v 1.8 2006/04/20 04:12:02 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -380,6 +380,7 @@
 	rv = rman_reserve_resource(rm, start, end, count, flags, child);
 	if (rv == NULL)
 		return (NULL);
+	rman_set_rid(rv, *rid);
 	if (type != SYS_RES_IRQ) {
 		if (type == SYS_RES_MEMORY)
 			bh += (rman_get_start(rv));

==== //depot/projects/arm/src/sys/arm/xscale/i80321/iq80321.c#5 (text+ko) ====

@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq80321.c,v 1.10 2005/10/03 14:19:55 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq80321.c,v 1.11 2006/04/20 04:12:02 imp Exp $");
 
 #define _ARM32_BUS_DMA_PRIVATE
 #include <sys/param.h>
@@ -300,10 +300,14 @@
     u_long start, u_long end, u_long count, u_int flags)
 {
 	struct i80321_softc *sc = device_get_softc(dev);
-	
-	if (type == SYS_RES_IRQ) 
-		return (rman_reserve_resource(&sc->sc_irq_rman,
-		    start, end, count, flags, child));
+	struct resource *rv;
+
+	if (type == SYS_RES_IRQ) {
+		rv = rman_reserve_resource(&sc->sc_irq_rman,
+		    start, end, count, flags, child);
+		if (rv != NULL)
+			rman_set_rid(rv, *rid);
+	}
 	return (NULL);
 }
 

==== //depot/projects/arm/src/sys/arm/xscale/i80321/obio.c#3 (text+ko) ====

@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/obio.c,v 1.3 2005/09/25 21:06:50 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/obio.c,v 1.4 2006/04/20 04:12:02 imp Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -124,6 +124,7 @@
 		return (NULL);
 	if (type == SYS_RES_IRQ)
 		return (rv);
+	rman_set_rid(rv, *rid);
 	rman_set_bustag(rv, bt);
 	rman_set_bushandle(rv, bh);
 	

==== //depot/projects/arm/src/sys/conf/files.amd64#10 (text+ko) ====

@@ -1,7 +1,7 @@
 # This file tells config what files go into building a kernel,
 # files marked standard are always included.
 #
-# $FreeBSD: src/sys/conf/files.amd64,v 1.83 2006/03/05 22:52:16 yar Exp $
+# $FreeBSD: src/sys/conf/files.amd64,v 1.84 2006/04/21 04:24:49 peter Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -104,6 +104,7 @@
 amd64/amd64/locore.S		standard	no-obj
 amd64/amd64/machdep.c		standard
 amd64/amd64/mem.c		optional	mem
+amd64/amd64/minidump_machdep.c	standard
 amd64/amd64/mp_machdep.c	optional	smp
 amd64/amd64/mp_watchdog.c	optional	mp_watchdog smp
 amd64/amd64/mpboot.S		optional	smp

==== //depot/projects/arm/src/sys/conf/files.i386#12 (text+ko) ====

@@ -1,7 +1,7 @@
 # This file tells config what files go into building a kernel,
 # files marked standard are always included.
 #
-# $FreeBSD: src/sys/conf/files.i386,v 1.553 2006/03/05 22:52:16 yar Exp $
+# $FreeBSD: src/sys/conf/files.i386,v 1.554 2006/04/21 04:28:43 peter Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -272,6 +272,7 @@
 i386/i386/longrun.c		optional cpu_enable_longrun
 i386/i386/machdep.c		standard
 i386/i386/mem.c			optional mem
+i386/i386/minidump_machdep.c	standard
 i386/i386/mp_clock.c		optional smp
 i386/i386/mp_machdep.c		optional smp
 i386/i386/mp_watchdog.c		optional mp_watchdog smp

==== //depot/projects/arm/src/sys/crypto/via/padlock.c#3 (text+ko) ====

@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/crypto/via/padlock.c,v 1.2 2006/04/12 12:13:34 pjd Exp $");
+__FBSDID("$FreeBSD: src/sys/crypto/via/padlock.c,v 1.3 2006/04/20 06:31:44 pjd Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -366,6 +366,10 @@
 		err = EINVAL;
 		goto out;
 	}
+	if ((crd->crd_flags & CRD_F_KEY_EXPLICIT) != 0) {
+		err = EINVAL;
+		goto out;
+	}
 
 	mtx_lock(&sc->sc_sessions_mtx);
 	TAILQ_FOREACH(ses, &sc->sc_sessions, ses_next) {

==== //depot/projects/arm/src/sys/dev/acpica/acpi.c#7 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.221 2006/04/15 12:31:32 iwasaki Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.222 2006/04/20 04:21:27 imp Exp $");
 
 #include "opt_acpi.h"
 #include <sys/param.h>
@@ -1015,6 +1015,7 @@
 	    goto out;
 
 	/* Copy the bus tag and handle from the pre-allocated resource. */
+	rman_set_rid(res, *rid);
 	rman_set_bustag(res, rman_get_bustag(rle->res));
 	rman_set_bushandle(res, rman_get_start(res));
 

==== //depot/projects/arm/src/sys/dev/ciss/ciss.c#6 (text+ko) ====

@@ -24,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	$FreeBSD: src/sys/dev/ciss/ciss.c,v 1.67 2005/12/16 06:50:55 ps Exp $
+ *	$FreeBSD: src/sys/dev/ciss/ciss.c,v 1.69 2006/04/20 03:05:02 ps Exp $
  */
 
 /*
@@ -1651,7 +1651,7 @@
 ciss_free(struct ciss_softc *sc)
 {
     struct ciss_request *cr;
-    int			i;
+    int			i, j;
 
     debug_called(1);
 
@@ -1725,8 +1725,15 @@
 	cam_simq_free(sc->ciss_cam_devq);
 
     if (sc->ciss_logical) {
-	for (i = 0; i < sc->ciss_max_logical_bus; i++)
+	for (i = 0; i <= sc->ciss_max_logical_bus; i++) {
+	    for (j = 0; j < CISS_MAX_LOGICAL; j++) {
+		if (sc->ciss_logical[i][j].cl_ldrive)
+		    free(sc->ciss_logical[i][j].cl_ldrive, CISS_MALLOC_CLASS);
+		if (sc->ciss_logical[i][j].cl_lstatus)
+		    free(sc->ciss_logical[i][j].cl_lstatus, CISS_MALLOC_CLASS);
+	    }
 	    free(sc->ciss_logical[i], CISS_MALLOC_CLASS);
+	}
 	free(sc->ciss_logical, CISS_MALLOC_CLASS);
     }
 
@@ -3588,7 +3595,7 @@
 static void
 ciss_notify_hotplug(struct ciss_softc *sc, struct ciss_notify *cn)
 {
-    struct ciss_lun_report *cll;
+    struct ciss_lun_report *cll = NULL;
     int bus, target;
     int s;
 
@@ -3626,6 +3633,9 @@
 	ciss_printf(sc, "Unknown hotplug event %d\n", cn->subclass);
 	return;
     }
+
+    if (cll != NULL)
+	free(cll, CISS_MALLOC_CLASS);
 }
 
 /************************************************************************

==== //depot/projects/arm/src/sys/dev/mpt/mpt.c#10 (text+ko) ====

@@ -92,7 +92,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt.c,v 1.26 2006/04/11 16:47:30 mjacob Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mpt/mpt.c,v 1.27 2006/04/19 21:17:33 mjacob Exp $");
 
 #include <dev/mpt/mpt.h>
 #include <dev/mpt/mpt_cam.h> /* XXX For static handler registration */
@@ -661,7 +661,6 @@
 {
 	struct mpt_softc *mpt;
 	uint32_t reply_desc;
-	uint32_t last_reply_desc = MPT_REPLY_EMPTY;
 	int ntrips = 0;
 
 	mpt = (struct mpt_softc *)arg;
@@ -675,15 +674,6 @@
 		u_int		   req_index;
 		int		   free_rf;
 
-		if (reply_desc == last_reply_desc) {
-			mpt_prt(mpt, "debounce reply_desc 0x%x\n", reply_desc);
-			if (ntrips++ == 1000) {
-				break;
-			}
-			continue;
-		}
-		last_reply_desc = reply_desc;
-
 		req = NULL;
 		reply_frame = NULL;
 		reply_baddr = 0;

==== //depot/projects/arm/src/sys/geom/eli/g_eli.c#9 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/eli/g_eli.c,v 1.23 2006/04/15 18:30:42 pjd Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/eli/g_eli.c,v 1.24 2006/04/20 06:33:46 pjd Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -532,8 +532,7 @@
 
 		crd->crd_skip = 0;
 		crd->crd_len = secsize;
-		crd->crd_flags =
-		    CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT | CRD_F_KEY_EXPLICIT;
+		crd->crd_flags = CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT;
 		if (bp->bio_cmd == BIO_WRITE)
 			crd->crd_flags |= CRD_F_ENCRYPT;
 		crd->crd_alg = sc->sc_algo;

==== //depot/projects/arm/src/sys/geom/eli/g_eli_crypto.c#3 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/eli/g_eli_crypto.c,v 1.2 2006/02/01 12:05:59 pjd Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/eli/g_eli_crypto.c,v 1.3 2006/04/20 06:33:46 pjd Exp $");
 
 #include <sys/param.h>
 #ifdef _KERNEL
@@ -97,7 +97,7 @@
 
 	crd->crd_skip = 0;
 	crd->crd_len = datasize;
-	crd->crd_flags = CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT | CRD_F_KEY_EXPLICIT;
+	crd->crd_flags = CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT;
 	if (enc)
 		crd->crd_flags |= CRD_F_ENCRYPT;
 	crd->crd_alg = algo;

==== //depot/projects/arm/src/sys/i386/i386/dump_machdep.c#3 (text+ko) ====

@@ -25,12 +25,13 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/dump_machdep.c,v 1.11 2005/07/02 19:57:31 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/dump_machdep.c,v 1.12 2006/04/21 04:28:43 peter Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/conf.h>
 #include <sys/cons.h>
+#include <sys/sysctl.h>
 #include <sys/kernel.h>
 #include <sys/kerneldump.h>
 #include <vm/vm.h>
@@ -40,6 +41,11 @@
 
 CTASSERT(sizeof(struct kerneldumpheader) == 512);
 
+int do_minidump = 1;
+TUNABLE_INT("debug.minidump", &do_minidump);
+SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RW, &do_minidump, 0,
+    "Enable mini crash dumps");
+
 /*
  * Don't touch the first SIZEOF_METADATA bytes on the dump device. This
  * is to protect us from metadata and to protect metadata from us.
@@ -272,6 +278,10 @@
 	size_t hdrsz;
 	int error;
 
+	if (do_minidump) {
+		minidumpsys(di);
+		return;
+	}
 	bzero(&ehdr, sizeof(ehdr));
 	ehdr.e_ident[EI_MAG0] = ELFMAG0;
 	ehdr.e_ident[EI_MAG1] = ELFMAG1;

==== //depot/projects/arm/src/sys/i386/i386/nexus.c#3 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/nexus.c,v 1.62 2005/05/10 12:02:15 nyan Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/nexus.c,v 1.63 2006/04/20 04:10:27 imp Exp $");
 
 /*
  * This code implements a `root nexus' for Intel Architecture
@@ -352,7 +352,7 @@
 	rv = rman_reserve_resource(rm, start, end, count, flags, child);
 	if (rv == 0)
 		return 0;
-
+	rman_set_rid(rv, *rid);
 	if (type == SYS_RES_MEMORY) {
 		rman_set_bustag(rv, I386_BUS_SPACE_MEM);
 	} else if (type == SYS_RES_IOPORT) {

==== //depot/projects/arm/src/sys/i386/include/md_var.h#3 (text+ko) ====

@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/i386/include/md_var.h,v 1.73 2005/10/14 22:52:01 jkim Exp $
+ * $FreeBSD: src/sys/i386/include/md_var.h,v 1.74 2006/04/21 04:28:43 peter Exp $
  */
 
 #ifndef _MACHINE_MD_VAR_H_
@@ -65,12 +65,15 @@
 #ifdef COMPAT_43
 extern	int	szosigcode;
 #endif
+extern	uint32_t *vm_page_dump;
+extern	int	vm_page_dump_size;
 
 typedef void alias_for_inthand_t(u_int cs, u_int ef, u_int esp, u_int ss);
 struct	thread;
 struct	reg;
 struct	fpreg;
 struct  dbreg;
+struct	dumperinfo;
 
 void	bcopyb(const void *from, void *to, size_t len);
 void	busdma_swi(void);
@@ -84,6 +87,8 @@
 void	doreti_popl_es_fault(void) __asm(__STRING(doreti_popl_es_fault));
 void	doreti_popl_fs(void) __asm(__STRING(doreti_popl_fs));
 void	doreti_popl_fs_fault(void) __asm(__STRING(doreti_popl_fs_fault));
+void	dump_add_page(vm_paddr_t);
+void	dump_drop_page(vm_paddr_t);
 void	enable_sse(void);
 void	fillw(int /*u_short*/ pat, void *base, size_t cnt);
 void	i486_bzero(void *buf, size_t len);
@@ -99,5 +104,6 @@
 vm_paddr_t kvtop(void *addr);
 void	setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec);
 int     user_dbreg_trap(void);
+void	minidumpsys(struct dumperinfo *);
 
 #endif /* !_MACHINE_MD_VAR_H_ */

==== //depot/projects/arm/src/sys/ia64/ia64/nexus.c#3 (text+ko) ====

@@ -26,7 +26,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/ia64/ia64/nexus.c,v 1.12 2005/10/06 17:39:18 phk Exp $
+ * $FreeBSD: src/sys/ia64/ia64/nexus.c,v 1.13 2006/04/20 04:18:30 imp Exp $
  */
 
 /*
@@ -401,6 +401,7 @@
 	if (rv == 0)
 		return 0;
 
+	rman_set_rid(rv, *rid);
 	if (type == SYS_RES_MEMORY) {
 		rman_set_bustag(rv, IA64_BUS_SPACE_MEM);
 	} else if (type == SYS_RES_IOPORT) {

==== //depot/projects/arm/src/sys/kern/kern_rwlock.c#4 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_rwlock.c,v 1.8 2006/04/18 20:32:42 wkoszek Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_rwlock.c,v 1.9 2006/04/19 21:06:52 jhb Exp $");
 
 #include "opt_ddb.h"
 
@@ -55,7 +55,7 @@
 
 struct lock_class lock_class_rw = {
 	"rw",
-	LC_SLEEPLOCK | LC_RECURSABLE /* | LC_UPGRADABLE */,
+	LC_SLEEPLOCK | LC_RECURSABLE | LC_UPGRADABLE,
 #ifdef DDB
 	db_show_rwlock
 #endif
@@ -87,7 +87,7 @@
 	rw->rw_lock = RW_UNLOCKED;
 
 	lock_init(&rw->rw_object, &lock_class_rw, name, NULL, LO_WITNESS |
-	    LO_RECURSABLE /* | LO_UPGRADABLE */);
+	    LO_RECURSABLE | LO_UPGRADABLE);
 }
 
 void
@@ -585,6 +585,137 @@
 	turnstile_unpend(ts, TS_EXCLUSIVE_LOCK);
 }
 
+/*
+ * Attempt to do a non-blocking upgrade from a read lock to a write
+ * lock.  This will only succeed if this thread holds a single read
+ * lock.  Returns true if the upgrade succeeded and false otherwise.
+ */
+int
+_rw_try_upgrade(struct rwlock *rw, const char *file, int line)
+{
+	uintptr_t v, tid;
+	int success;
+
+	_rw_assert(rw, RA_RLOCKED, file, line);
+
+	/*
+	 * Attempt to switch from one reader to a writer.  If there
+	 * are any write waiters, then we will have to lock the
+	 * turnstile first to prevent races with another writer
+	 * calling turnstile_wait() before we have claimed this
+	 * turnstile.  So, do the simple case of no waiters first.
+	 */
+	tid = (uintptr_t)curthread;
+	if (!(rw->rw_lock & RW_LOCK_WRITE_WAITERS)) {
+		success = atomic_cmpset_acq_ptr(&rw->rw_lock,
+		    RW_READERS_LOCK(1), tid);
+		goto out;
+	}
+
+	/*
+	 * Ok, we think we have write waiters, so lock the
+	 * turnstile.
+	 */
+	turnstile_lock(&rw->rw_object);
+
+	/*
+	 * Try to switch from one reader to a writer again.  This time
+	 * we honor the current state of the RW_LOCK_WRITE_WAITERS
+	 * flag.  If we obtain the lock with the flag set, then claim
+	 * ownership of the turnstile.  In the SMP case it is possible
+	 * for there to not be an associated turnstile even though there
+	 * are waiters if all of the waiters are spinning.
+	 */
+	v = rw->rw_lock & RW_LOCK_WRITE_WAITERS;
+	success = atomic_cmpset_acq_ptr(&rw->rw_lock, RW_READERS_LOCK(1) | v,
+	    tid | v);
+#ifdef SMP
+	if (success && v && turnstile_lookup(&rw->rw_object) != NULL)
+#else
+	if (success && v)
+#endif
+		turnstile_claim(&rw->rw_object);
+	else
+		turnstile_release(&rw->rw_object);
+out:
+	LOCK_LOG_TRY("WUPGRADE", &rw->rw_object, 0, success, file, line);
+	if (success)
+		WITNESS_UPGRADE(&rw->rw_object, LOP_EXCLUSIVE | LOP_TRYLOCK,
+		    file, line);
+	return (success);
+}
+
+/*
+ * Downgrade a write lock into a single read lock.
+ */
+void
+_rw_downgrade(struct rwlock *rw, const char *file, int line)
+{
+	struct turnstile *ts;
+	uintptr_t tid, v;
+
+	_rw_assert(rw, RA_WLOCKED, file, line);
+
+	WITNESS_DOWNGRADE(&rw->rw_object, 0, file, line);
+
+	/*
+	 * Convert from a writer to a single reader.  First we handle
+	 * the easy case with no waiters.  If there are any waiters, we
+	 * lock the turnstile, "disown" the lock, and awaken any read
+	 * waiters.
+	 */
+	tid = (uintptr_t)curthread;
+	if (atomic_cmpset_rel_ptr(&rw->rw_lock, tid, RW_READERS_LOCK(1)))
+		goto out;
+
+	/*
+	 * Ok, we think we have waiters, so lock the turnstile so we can
+	 * read the waiter flags without any races.
+	 */
+	turnstile_lock(&rw->rw_object);
+	v = rw->rw_lock;
+	MPASS(v & (RW_LOCK_READ_WAITERS | RW_LOCK_WRITE_WAITERS));
+
+	/*
+	 * Downgrade from a write lock while preserving
+	 * RW_LOCK_WRITE_WAITERS and give up ownership of the
+	 * turnstile.  If there are any read waiters, wake them up.
+	 *
+	 * For SMP, we have to allow for the fact that all of the
+	 * read waiters might be spinning.  In that case, act as if
+	 * RW_LOCK_READ_WAITERS is not set.  Also, only preserve
+	 * the RW_LOCK_WRITE_WAITERS flag if at least one writer is
+	 * blocked on the turnstile.
+	 */
+	ts = turnstile_lookup(&rw->rw_object);
+#ifdef SMP
+	if (ts == NULL)

>>> TRUNCATED FOR MAIL (1000 lines) <<<


More information about the p4-projects mailing list