PERFORCE change 114812 for review

John Baldwin jhb at FreeBSD.org
Wed Feb 21 18:34:20 UTC 2007


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

Change 114812 by jhb at jhb_mutex on 2007/02/21 18:33:39

	IFC @114808.

Affected files ...

.. //depot/projects/smpng/sys/amd64/amd64/msi.c#4 integrate
.. //depot/projects/smpng/sys/amd64/amd64/pmap.c#71 integrate
.. //depot/projects/smpng/sys/amd64/amd64/uma_machdep.c#3 integrate
.. //depot/projects/smpng/sys/amd64/conf/GENERIC#56 integrate
.. //depot/projects/smpng/sys/amd64/linux32/linux.h#9 integrate
.. //depot/projects/smpng/sys/amd64/linux32/linux32_machdep.c#18 integrate
.. //depot/projects/smpng/sys/amd64/linux32/linux32_proto.h#20 integrate
.. //depot/projects/smpng/sys/amd64/linux32/linux32_syscall.h#20 integrate
.. //depot/projects/smpng/sys/amd64/linux32/linux32_sysent.c#20 integrate
.. //depot/projects/smpng/sys/amd64/linux32/syscalls.master#24 integrate
.. //depot/projects/smpng/sys/arm/arm/busdma_machdep.c#20 integrate
.. //depot/projects/smpng/sys/arm/arm/cpufunc.c#14 integrate
.. //depot/projects/smpng/sys/arm/arm/db_interface.c#6 integrate
.. //depot/projects/smpng/sys/arm/arm/elf_trampoline.c#13 integrate
.. //depot/projects/smpng/sys/arm/arm/locore.S#13 integrate
.. //depot/projects/smpng/sys/arm/arm/machdep.c#20 integrate
.. //depot/projects/smpng/sys/arm/arm/mem.c#5 integrate
.. //depot/projects/smpng/sys/arm/arm/sys_machdep.c#5 integrate
.. //depot/projects/smpng/sys/arm/at91/if_ate.c#12 integrate
.. //depot/projects/smpng/sys/arm/conf/EP80219#4 integrate
.. //depot/projects/smpng/sys/arm/conf/IQ31244#13 integrate
.. //depot/projects/smpng/sys/arm/conf/SIMICS#11 integrate
.. //depot/projects/smpng/sys/arm/xscale/ixp425/if_npe.c#4 integrate
.. //depot/projects/smpng/sys/arm/xscale/ixp425/ixp425_npe.c#2 integrate
.. //depot/projects/smpng/sys/cam/scsi/scsi_da.c#74 integrate
.. //depot/projects/smpng/sys/conf/NOTES#136 integrate
.. //depot/projects/smpng/sys/conf/files#197 integrate
.. //depot/projects/smpng/sys/conf/options#135 integrate
.. //depot/projects/smpng/sys/conf/options.arm#14 integrate
.. //depot/projects/smpng/sys/dev/aac/aac.c#56 integrate
.. //depot/projects/smpng/sys/dev/aic7xxx/aic79xx.seq#16 integrate
.. //depot/projects/smpng/sys/dev/arcmsr/arcmsr.c#11 integrate
.. //depot/projects/smpng/sys/dev/arcmsr/arcmsr.h#3 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-all.h#49 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-chipset.c#76 integrate
.. //depot/projects/smpng/sys/dev/ata/ata-pci.c#64 integrate
.. //depot/projects/smpng/sys/dev/ata/atapi-cd.c#65 integrate
.. //depot/projects/smpng/sys/dev/bge/if_bge.c#87 integrate
.. //depot/projects/smpng/sys/dev/bge/if_bgereg.h#52 integrate
.. //depot/projects/smpng/sys/dev/exca/exca.c#21 integrate
.. //depot/projects/smpng/sys/dev/ipw/if_ipw.c#12 integrate
.. //depot/projects/smpng/sys/dev/ipw/if_ipwvar.h#5 integrate
.. //depot/projects/smpng/sys/dev/isp/isp_freebsd.h#37 integrate
.. //depot/projects/smpng/sys/dev/isp/isp_pci.c#49 integrate
.. //depot/projects/smpng/sys/dev/iwi/if_iwi.c#24 integrate
.. //depot/projects/smpng/sys/dev/iwi/if_iwireg.h#10 integrate
.. //depot/projects/smpng/sys/dev/iwi/if_iwivar.h#8 integrate
.. //depot/projects/smpng/sys/dev/mii/brgphy.c#38 integrate
.. //depot/projects/smpng/sys/dev/mii/brgphyreg.h#6 integrate
.. //depot/projects/smpng/sys/dev/mpt/mpt_pci.c#29 integrate
.. //depot/projects/smpng/sys/dev/msk/if_msk.c#3 integrate
.. //depot/projects/smpng/sys/dev/mxge/if_mxge.c#10 integrate
.. //depot/projects/smpng/sys/dev/pccard/pccarddevs#56 integrate
.. //depot/projects/smpng/sys/dev/pccbb/pccbb.c#61 integrate
.. //depot/projects/smpng/sys/dev/pccbb/pccbb_pci.c#13 integrate
.. //depot/projects/smpng/sys/dev/pci/pci.c#86 integrate
.. //depot/projects/smpng/sys/dev/sound/pci/envy24.c#5 integrate
.. //depot/projects/smpng/sys/dev/sound/pci/envy24ht.c#3 integrate
.. //depot/projects/smpng/sys/dev/sound/pci/hda/hdac.c#9 integrate
.. //depot/projects/smpng/sys/dev/sound/pci/spicds.c#2 integrate
.. //depot/projects/smpng/sys/dev/syscons/fire/fire_saver.c#4 integrate
.. //depot/projects/smpng/sys/dev/syscons/logo/logo_saver.c#5 integrate
.. //depot/projects/smpng/sys/dev/syscons/rain/rain_saver.c#5 integrate
.. //depot/projects/smpng/sys/dev/syscons/warp/warp_saver.c#5 integrate
.. //depot/projects/smpng/sys/dev/usb/umass.c#60 integrate
.. //depot/projects/smpng/sys/dev/vge/if_vge.c#18 integrate
.. //depot/projects/smpng/sys/fs/cd9660/TODO#1 branch
.. //depot/projects/smpng/sys/fs/cd9660/TODO.hibler#1 branch
.. //depot/projects/smpng/sys/fs/cd9660/cd9660_bmap.c#1 branch
.. //depot/projects/smpng/sys/fs/cd9660/cd9660_iconv.c#1 branch
.. //depot/projects/smpng/sys/fs/cd9660/cd9660_lookup.c#1 branch
.. //depot/projects/smpng/sys/fs/cd9660/cd9660_mount.h#1 branch
.. //depot/projects/smpng/sys/fs/cd9660/cd9660_node.c#1 branch
.. //depot/projects/smpng/sys/fs/cd9660/cd9660_node.h#1 branch
.. //depot/projects/smpng/sys/fs/cd9660/cd9660_rrip.c#1 branch
.. //depot/projects/smpng/sys/fs/cd9660/cd9660_rrip.h#1 branch
.. //depot/projects/smpng/sys/fs/cd9660/cd9660_util.c#1 branch
.. //depot/projects/smpng/sys/fs/cd9660/cd9660_vfsops.c#1 branch
.. //depot/projects/smpng/sys/fs/cd9660/cd9660_vnops.c#1 branch
.. //depot/projects/smpng/sys/fs/cd9660/iso.h#1 branch
.. //depot/projects/smpng/sys/fs/cd9660/iso_rrip.h#1 branch
.. //depot/projects/smpng/sys/fs/hpfs/hpfs_vfsops.c#32 integrate
.. //depot/projects/smpng/sys/fs/hpfs/hpfs_vnops.c#33 integrate
.. //depot/projects/smpng/sys/fs/msdosfs/msdosfs_vfsops.c#53 integrate
.. //depot/projects/smpng/sys/fs/msdosfs/msdosfs_vnops.c#39 integrate
.. //depot/projects/smpng/sys/fs/ntfs/ntfs_vfsops.c#34 integrate
.. //depot/projects/smpng/sys/fs/ntfs/ntfs_vnops.c#28 integrate
.. //depot/projects/smpng/sys/fs/nullfs/null_vfsops.c#26 integrate
.. //depot/projects/smpng/sys/fs/nullfs/null_vnops.c#29 integrate
.. //depot/projects/smpng/sys/fs/procfs/procfs_ioctl.c#16 integrate
.. //depot/projects/smpng/sys/fs/udf/udf.h#9 integrate
.. //depot/projects/smpng/sys/fs/udf/udf_vfsops.c#33 integrate
.. //depot/projects/smpng/sys/fs/udf/udf_vnops.c#37 integrate
.. //depot/projects/smpng/sys/fs/umapfs/umap_vfsops.c#26 integrate
.. //depot/projects/smpng/sys/fs/umapfs/umap_vnops.c#13 integrate
.. //depot/projects/smpng/sys/fs/unionfs/union_vfsops.c#31 integrate
.. //depot/projects/smpng/sys/fs/unionfs/union_vnops.c#34 integrate
.. //depot/projects/smpng/sys/geom/geom_disk.c#49 integrate
.. //depot/projects/smpng/sys/gnu/fs/ext2fs/ext2_vfsops.c#10 integrate
.. //depot/projects/smpng/sys/gnu/fs/ext2fs/ext2_vnops.c#6 integrate
.. //depot/projects/smpng/sys/gnu/fs/reiserfs/reiserfs_vfsops.c#7 integrate
.. //depot/projects/smpng/sys/gnu/fs/reiserfs/reiserfs_vnops.c#2 integrate
.. //depot/projects/smpng/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c#4 integrate
.. //depot/projects/smpng/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c#3 integrate
.. //depot/projects/smpng/sys/i386/conf/GENERIC#86 integrate
.. //depot/projects/smpng/sys/i386/i386/db_trace.c#36 integrate
.. //depot/projects/smpng/sys/i386/i386/msi.c#4 integrate
.. //depot/projects/smpng/sys/i386/i386/pmap.c#113 integrate
.. //depot/projects/smpng/sys/i386/linux/linux.h#16 integrate
.. //depot/projects/smpng/sys/i386/linux/linux_machdep.c#42 integrate
.. //depot/projects/smpng/sys/i386/linux/linux_proto.h#40 integrate
.. //depot/projects/smpng/sys/i386/linux/linux_syscall.h#38 integrate
.. //depot/projects/smpng/sys/i386/linux/linux_sysent.c#39 integrate
.. //depot/projects/smpng/sys/i386/linux/syscalls.master#45 integrate
.. //depot/projects/smpng/sys/ia64/conf/GENERIC#55 integrate
.. //depot/projects/smpng/sys/ia64/ia64/pmap.c#83 integrate
.. //depot/projects/smpng/sys/ia64/ia64/uma_machdep.c#3 integrate
.. //depot/projects/smpng/sys/isofs/cd9660/TODO#2 delete
.. //depot/projects/smpng/sys/isofs/cd9660/TODO.hibler#2 delete
.. //depot/projects/smpng/sys/isofs/cd9660/cd9660_bmap.c#7 delete
.. //depot/projects/smpng/sys/isofs/cd9660/cd9660_iconv.c#2 delete
.. //depot/projects/smpng/sys/isofs/cd9660/cd9660_lookup.c#15 delete
.. //depot/projects/smpng/sys/isofs/cd9660/cd9660_mount.h#5 delete
.. //depot/projects/smpng/sys/isofs/cd9660/cd9660_node.c#18 delete
.. //depot/projects/smpng/sys/isofs/cd9660/cd9660_node.h#10 delete
.. //depot/projects/smpng/sys/isofs/cd9660/cd9660_rrip.c#11 delete
.. //depot/projects/smpng/sys/isofs/cd9660/cd9660_rrip.h#4 delete
.. //depot/projects/smpng/sys/isofs/cd9660/cd9660_util.c#6 delete
.. //depot/projects/smpng/sys/isofs/cd9660/cd9660_vfsops.c#44 delete
.. //depot/projects/smpng/sys/isofs/cd9660/cd9660_vnops.c#25 delete
.. //depot/projects/smpng/sys/isofs/cd9660/iso.h#12 delete
.. //depot/projects/smpng/sys/isofs/cd9660/iso_rrip.h#4 delete
.. //depot/projects/smpng/sys/kern/Make.tags.inc#6 integrate
.. //depot/projects/smpng/sys/kern/kern_descrip.c#101 integrate
.. //depot/projects/smpng/sys/kern/kern_jail.c#45 integrate
.. //depot/projects/smpng/sys/kern/kern_ktrace.c#58 integrate
.. //depot/projects/smpng/sys/kern/kern_resource.c#68 integrate
.. //depot/projects/smpng/sys/kern/kern_sig.c#131 integrate
.. //depot/projects/smpng/sys/kern/subr_firmware.c#16 integrate
.. //depot/projects/smpng/sys/kern/subr_witness.c#159 integrate
.. //depot/projects/smpng/sys/kern/sysv_ipc.c#17 integrate
.. //depot/projects/smpng/sys/kern/sysv_msg.c#35 integrate
.. //depot/projects/smpng/sys/kern/sysv_shm.c#37 integrate
.. //depot/projects/smpng/sys/kern/uipc_debug.c#1 branch
.. //depot/projects/smpng/sys/kern/uipc_socket.c#100 integrate
.. //depot/projects/smpng/sys/kern/uipc_usrreq.c#71 integrate
.. //depot/projects/smpng/sys/kern/vfs_default.c#49 integrate
.. //depot/projects/smpng/sys/kern/vfs_export.c#27 integrate
.. //depot/projects/smpng/sys/kern/vfs_init.c#26 integrate
.. //depot/projects/smpng/sys/kern/vfs_lookup.c#41 integrate
.. //depot/projects/smpng/sys/kern/vfs_mount.c#68 integrate
.. //depot/projects/smpng/sys/kern/vfs_syscalls.c#121 integrate
.. //depot/projects/smpng/sys/kern/vfs_vnops.c#78 integrate
.. //depot/projects/smpng/sys/kern/vnode_if.src#30 integrate
.. //depot/projects/smpng/sys/modules/cd9660/Makefile#4 integrate
.. //depot/projects/smpng/sys/modules/cd9660_iconv/Makefile#2 integrate
.. //depot/projects/smpng/sys/net/if_ppp.c#46 integrate
.. //depot/projects/smpng/sys/netatalk/at_control.c#15 integrate
.. //depot/projects/smpng/sys/netinet/in_pcb.c#72 integrate
.. //depot/projects/smpng/sys/netinet/in_pcb.h#43 integrate
.. //depot/projects/smpng/sys/netinet/in_proto.c#25 integrate
.. //depot/projects/smpng/sys/netinet/ip_mroute.c#51 integrate
.. //depot/projects/smpng/sys/netinet/sctp_asconf.c#5 integrate
.. //depot/projects/smpng/sys/netinet/sctp_auth.c#4 integrate
.. //depot/projects/smpng/sys/netinet/sctp_auth.h#2 integrate
.. //depot/projects/smpng/sys/netinet/sctp_constants.h#5 integrate
.. //depot/projects/smpng/sys/netinet/sctp_crc32.c#3 integrate
.. //depot/projects/smpng/sys/netinet/sctp_indata.c#6 integrate
.. //depot/projects/smpng/sys/netinet/sctp_input.c#6 integrate
.. //depot/projects/smpng/sys/netinet/sctp_os.h#4 integrate
.. //depot/projects/smpng/sys/netinet/sctp_os_bsd.h#5 integrate
.. //depot/projects/smpng/sys/netinet/sctp_output.c#6 integrate
.. //depot/projects/smpng/sys/netinet/sctp_pcb.c#5 integrate
.. //depot/projects/smpng/sys/netinet/sctp_peeloff.c#4 integrate
.. //depot/projects/smpng/sys/netinet/sctp_structs.h#5 integrate
.. //depot/projects/smpng/sys/netinet/sctp_timer.c#5 integrate
.. //depot/projects/smpng/sys/netinet/sctp_uio.h#5 integrate
.. //depot/projects/smpng/sys/netinet/sctp_usrreq.c#6 integrate
.. //depot/projects/smpng/sys/netinet/sctp_var.h#4 integrate
.. //depot/projects/smpng/sys/netinet/sctputil.c#7 integrate
.. //depot/projects/smpng/sys/netinet/sctputil.h#5 integrate
.. //depot/projects/smpng/sys/netinet/tcp_input.c#94 integrate
.. //depot/projects/smpng/sys/netinet/tcp_usrreq.c#56 integrate
.. //depot/projects/smpng/sys/netinet/udp.h#4 integrate
.. //depot/projects/smpng/sys/netinet/udp_usrreq.c#74 integrate
.. //depot/projects/smpng/sys/netinet/udp_var.h#8 integrate
.. //depot/projects/smpng/sys/netinet6/icmp6.c#38 integrate
.. //depot/projects/smpng/sys/netinet6/sctp6_usrreq.c#5 integrate
.. //depot/projects/smpng/sys/netinet6/udp6_usrreq.c#43 integrate
.. //depot/projects/smpng/sys/netsmb/smb_dev.c#22 integrate
.. //depot/projects/smpng/sys/nfsclient/nfs_socket.c#49 integrate
.. //depot/projects/smpng/sys/nfsserver/nfs_serv.c#50 integrate
.. //depot/projects/smpng/sys/pc98/conf/GENERIC#68 integrate
.. //depot/projects/smpng/sys/powerpc/conf/GENERIC#41 integrate
.. //depot/projects/smpng/sys/powerpc/powerpc/cpu.c#7 integrate
.. //depot/projects/smpng/sys/powerpc/powerpc/machdep.c#73 integrate
.. //depot/projects/smpng/sys/security/audit/audit_arg.c#8 integrate
.. //depot/projects/smpng/sys/security/mac_biba/mac_biba.c#46 integrate
.. //depot/projects/smpng/sys/security/mac_bsdextended/mac_bsdextended.c#23 integrate
.. //depot/projects/smpng/sys/security/mac_seeotheruids/mac_seeotheruids.c#11 integrate
.. //depot/projects/smpng/sys/sparc64/conf/GENERIC#76 integrate
.. //depot/projects/smpng/sys/sun4v/conf/GENERIC#5 integrate
.. //depot/projects/smpng/sys/sys/firmware.h#3 integrate
.. //depot/projects/smpng/sys/sys/mount.h#57 integrate
.. //depot/projects/smpng/sys/sys/priv.h#2 integrate
.. //depot/projects/smpng/sys/sys/systm.h#78 integrate
.. //depot/projects/smpng/sys/sys/vnode.h#77 integrate
.. //depot/projects/smpng/sys/tools/fw_stub.awk#3 integrate
.. //depot/projects/smpng/sys/ufs/ffs/README.softupdates#2 delete
.. //depot/projects/smpng/sys/ufs/ffs/ffs_alloc.c#45 integrate
.. //depot/projects/smpng/sys/ufs/ffs/ffs_extern.h#24 integrate
.. //depot/projects/smpng/sys/ufs/ffs/ffs_softdep.c#59 integrate
.. //depot/projects/smpng/sys/ufs/ffs/ffs_vfsops.c#92 integrate
.. //depot/projects/smpng/sys/ufs/ffs/ffs_vnops.c#49 integrate
.. //depot/projects/smpng/sys/ufs/ufs/ufs_quota.c#37 integrate
.. //depot/projects/smpng/sys/vm/uma.h#21 integrate
.. //depot/projects/smpng/sys/vm/uma_core.c#69 integrate
.. //depot/projects/smpng/sys/vm/vm_page.c#89 integrate
.. //depot/projects/smpng/sys/vm/vm_zeroidle.c#34 integrate

Differences ...

==== //depot/projects/smpng/sys/amd64/amd64/msi.c#4 (text+ko) ====

@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/msi.c,v 1.3 2007/01/22 21:48:42 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/msi.c,v 1.4 2007/02/15 22:22:56 jhb Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -347,6 +347,9 @@
 		msi->msi_intsrc.is_pic = &msi_pic;
 		msi->msi_dev = dev;
 		msi->msi_vector = vector + i;
+		if (bootverbose)
+			printf("msi: routing MSI IRQ %d to vector %u\n",
+			    msi->msi_irq, msi->msi_vector);
 		msi->msi_index = i;
 		msi->msi_first = fsrc;
 
@@ -463,6 +466,9 @@
 
 	/* Allocate an IDT vector. */
 	vector = apic_alloc_vector(i);
+	if (bootverbose)
+		printf("msi: routing MSI-X IRQ %d to vector %u\n", msi->msi_irq,
+		    vector);
 
 	/* Setup source. */
 	msi->msi_intsrc.is_pic = &msix_pic;

==== //depot/projects/smpng/sys/amd64/amd64/pmap.c#71 (text+ko) ====

@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.577 2006/12/05 11:31:33 ru Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.579 2007/02/19 10:55:16 kib Exp $");
 
 /*
  *	Manages physical address maps.
@@ -1498,11 +1498,9 @@
 	pmap->pm_pml4[DMPML4I] = 0;	/* Direct Map */
 	pmap->pm_pml4[PML4PML4I] = 0;	/* Recursive Mapping */
 
-	vm_page_lock_queues();
 	m->wire_count--;
 	atomic_subtract_int(&cnt.v_wire_count, 1);
 	vm_page_free_zero(m);
-	vm_page_unlock_queues();
 	PMAP_LOCK_DESTROY(pmap);
 }
 
@@ -1544,9 +1542,15 @@
 		while ((*pmap_pde(kernel_pmap, kernel_vm_end) & PG_V) != 0) {
 			kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1);
 			nkpt++;
+			if (kernel_vm_end - 1 >= kernel_map->max_offset) {
+				kernel_vm_end = kernel_map->max_offset;
+				break;                       
+			}
 		}
 	}
 	addr = roundup2(addr, PAGE_SIZE * NPTEPG);
+	if (addr - 1 >= kernel_map->max_offset)
+		addr = kernel_map->max_offset;
 	while (kernel_vm_end < addr) {
 		pde = pmap_pde(kernel_pmap, kernel_vm_end);
 		if (pde == NULL) {
@@ -1564,6 +1568,10 @@
 		}
 		if ((*pde & PG_V) != 0) {
 			kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1);
+			if (kernel_vm_end - 1 >= kernel_map->max_offset) {
+				kernel_vm_end = kernel_map->max_offset;
+				break;                       
+			}
 			continue;
 		}
 
@@ -1583,6 +1591,10 @@
 		*pmap_pde(kernel_pmap, kernel_vm_end) = newpdir;
 
 		kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1);
+		if (kernel_vm_end - 1 >= kernel_map->max_offset) {
+			kernel_vm_end = kernel_map->max_offset;
+			break;                       
+		}
 	}
 }
 

==== //depot/projects/smpng/sys/amd64/amd64/uma_machdep.c#3 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/uma_machdep.c,v 1.2 2006/04/21 04:24:50 peter Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/uma_machdep.c,v 1.3 2007/02/18 06:33:01 alc Exp $");
 
 #include <sys/param.h>
 #include <sys/lock.h>
@@ -82,7 +82,5 @@
 	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/smpng/sys/amd64/conf/GENERIC#56 (text+ko) ====

@@ -16,7 +16,7 @@
 # If you are in doubt as to the purpose or necessity of a line, check first
 # in NOTES.
 #
-# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.472 2007/02/07 18:55:29 marcel Exp $
+# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.473 2007/02/09 19:03:17 brooks Exp $
 
 cpu		HAMMER
 ident		GENERIC
@@ -44,6 +44,7 @@
 options 	PROCFS			# Process filesystem (requires PSEUDOFS)
 options 	PSEUDOFS		# Pseudo-filesystem framework
 options 	GEOM_PART_GPT		# GUID Partition Tables.
+options 	GEOM_LABEL		# Provides labelization
 options 	COMPAT_43TTY		# BSD 4.3 TTY compat [KEEP THIS!]
 options 	COMPAT_IA32		# Compatible with i386 binaries
 options 	COMPAT_FREEBSD4		# Compatible with FreeBSD4

==== //depot/projects/smpng/sys/amd64/linux32/linux.h#9 (text+ko) ====

@@ -27,7 +27,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/amd64/linux32/linux.h,v 1.11 2007/02/01 13:36:19 kib Exp $
+ * $FreeBSD: src/sys/amd64/linux32/linux.h,v 1.12 2007/02/15 00:54:40 jkim Exp $
  */
 
 #ifndef _AMD64_LINUX_LINUX_H_
@@ -167,6 +167,15 @@
 #define	LINUX_MAP_ANON		0x0020
 #define	LINUX_MAP_GROWSDOWN	0x0100
 
+struct l_mmap_argv {
+	l_uintptr_t	addr;
+	l_size_t	len;
+	l_int		prot;
+	l_int		flags;
+	l_int		fd;
+	l_off_t		pgoff;
+} __packed;
+
 /*
  * stat family of syscalls
  */

==== //depot/projects/smpng/sys/amd64/linux32/linux32_machdep.c#18 (text+ko) ====

@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.30 2007/02/01 13:27:51 kib Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.33 2007/02/15 01:20:43 jkim Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -43,6 +43,7 @@
 #include <sys/malloc.h>
 #include <sys/mman.h>
 #include <sys/mutex.h>
+#include <sys/priv.h>
 #include <sys/proc.h>
 #include <sys/resource.h>
 #include <sys/resourcevar.h>
@@ -52,6 +53,7 @@
 #include <sys/unistd.h>
 
 #include <machine/frame.h>
+#include <machine/psl.h>
 
 #include <vm/vm.h>
 #include <vm/pmap.h>
@@ -690,16 +692,6 @@
 	return (0);
 }
 
-/* XXX move */
-struct l_mmap_argv {
-	l_ulong		addr;
-	l_ulong		len;
-	l_ulong		prot;
-	l_ulong		flags;
-	l_ulong		fd;
-	l_ulong		pgoff;
-};
-
 #define STACK_SIZE  (2 * 1024 * 1024)
 #define GUARD_SIZE  (4 * PAGE_SIZE)
 
@@ -789,9 +781,44 @@
 		bsd_args.flags |= MAP_ANON;
 	else
 		bsd_args.flags |= MAP_NOSYNC;
-	if (linux_args->flags & LINUX_MAP_GROWSDOWN) {
+	if (linux_args->flags & LINUX_MAP_GROWSDOWN)
 		bsd_args.flags |= MAP_STACK;
 
+	/*
+	 * PROT_READ, PROT_WRITE, or PROT_EXEC implies PROT_READ and PROT_EXEC
+	 * on Linux/i386. We do this to ensure maximum compatibility.
+	 * Linux/ia64 does the same in i386 emulation mode.
+	 */
+	bsd_args.prot = linux_args->prot;
+	if (bsd_args.prot & (PROT_READ | PROT_WRITE | PROT_EXEC))
+		bsd_args.prot |= PROT_READ | PROT_EXEC;
+
+	if (linux_args->fd != -1) {
+		/*
+		 * Linux follows Solaris mmap(2) description:
+		 * The file descriptor fildes is opened with
+		 * read permission, regardless of the
+		 * protection options specified.
+		 */
+
+		if ((error = fget(td, linux_args->fd, &fp)) != 0)
+			return (error);
+		if (fp->f_type != DTYPE_VNODE) {
+			fdrop(fp, td);
+			return (EINVAL);
+		}
+
+		/* Linux mmap() just fails for O_WRONLY files */
+		if (!(fp->f_flag & FREAD)) {
+			fdrop(fp, td);
+			return (EACCES);
+		}
+
+		fdrop(fp, td);
+	}
+	bsd_args.fd = linux_args->fd;
+
+	if (linux_args->flags & LINUX_MAP_GROWSDOWN) {
 		/* 
 		 * The linux MAP_GROWSDOWN option does not limit auto
 		 * growth of the region.  Linux mmap with this option
@@ -814,11 +841,7 @@
 		 * fixed size of (STACK_SIZE - GUARD_SIZE).
 		 */
 
-		/* This gives us TOS */
-		bsd_args.addr = (caddr_t)PTRIN(linux_args->addr) +
-		    linux_args->len;
-
-		if ((caddr_t)PTRIN(bsd_args.addr) >
+		if ((caddr_t)PTRIN(linux_args->addr) + linux_args->len >
 		    p->p_vmspace->vm_maxsaddr) {
 			/* 
 			 * Some linux apps will attempt to mmap
@@ -837,8 +860,7 @@
 			 * mmap's return value.
 			 */
 			PROC_LOCK(p);
-			p->p_vmspace->vm_maxsaddr =
-			    (char *)LINUX32_USRSTACK -
+			p->p_vmspace->vm_maxsaddr = (char *)LINUX32_USRSTACK -
 			    lim_cur(p, RLIMIT_STACK);
 			PROC_UNLOCK(p);
 		}
@@ -856,49 +878,12 @@
 		 * not using VM_STACK we map the full stack, since we
 		 * don't have a way to autogrow it.
 		 */
-		bsd_args.addr -= bsd_args.len;
+		bsd_args.addr = (caddr_t)PTRIN(linux_args->addr) -
+		    bsd_args.len;
 	} else {
 		bsd_args.addr = (caddr_t)PTRIN(linux_args->addr);
 		bsd_args.len  = linux_args->len;
 	}
-
-	/*
-	 * We add PROT_EXEC to work around buggy applications (e.g. Java)
-	 * that take advantage of the fact that execute permissions are not
-	 * enforced by x86 CPUs.
-	 */
-	bsd_args.prot = linux_args->prot | PROT_EXEC;
-	if (linux_args->flags & LINUX_MAP_ANON)
-		bsd_args.fd = -1;
-	else {
-		/*
-		 * Linux follows Solaris mmap(2) description:
-		 * The file descriptor fildes is opened with
-		 * read permission, regardless of the
-		 * protection options specified.
-		 * If PROT_WRITE is specified, the application
-		 * must have opened the file descriptor
-		 * fildes with write permission unless
-		 * MAP_PRIVATE is specified in the flag
-		 * argument as described below.
-		 */
-
-		if ((error = fget(td, linux_args->fd, &fp)) != 0)
-			return (error);
-		if (fp->f_type != DTYPE_VNODE) {
-			fdrop(fp, td);
-			return (EINVAL);
-		}
-
-		/* Linux mmap() just fails for O_WRONLY files */
-		if (! (fp->f_flag & FREAD)) {
-			fdrop(fp, td);
-			return (EACCES);
-		}
-
-		bsd_args.fd = linux_args->fd;
-		fdrop(fp, td);
-	}
 	bsd_args.pos = (off_t)linux_args->pgoff * PAGE_SIZE;
 	bsd_args.pad = 0;
 
@@ -919,6 +904,23 @@
 }
 
 int
+linux_iopl(struct thread *td, struct linux_iopl_args *args)
+{
+	int error;
+
+	if (args->level < 0 || args->level > 3)
+		return (EINVAL);
+	if ((error = priv_check(td, PRIV_IO)) != 0)
+		return (error);
+	if ((error = securelevel_gt(td->td_ucred, 0)) != 0)
+		return (error);
+	td->td_frame->tf_rflags = (td->td_frame->tf_rflags & ~PSL_IOPL) |
+	    (args->level * (PSL_IOPL / 3));
+
+	return (0);
+}
+
+int
 linux_pipe(struct thread *td, struct linux_pipe_args *args)
 {
 	int pip[2];
@@ -1181,8 +1183,7 @@
 	bsd_args.addr = uap->addr;
 	bsd_args.len = uap->len;
 	bsd_args.prot = uap->prot;
-	/* XXX PROT_READ implies PROT_EXEC; see linux_mmap_common(). */
-	if ((bsd_args.prot & PROT_READ) != 0)
-		bsd_args.prot |= PROT_EXEC;
+	if (bsd_args.prot & (PROT_READ | PROT_WRITE | PROT_EXEC))
+		bsd_args.prot |= PROT_READ | PROT_EXEC;
 	return (mprotect(td, &bsd_args));
 }

==== //depot/projects/smpng/sys/amd64/linux32/linux32_proto.h#20 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call prototypes.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/amd64/linux32/linux32_proto.h,v 1.28 2006/12/31 13:20:30 netchild Exp $
- * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.25 2006/12/31 13:16:00 netchild Exp 
+ * $FreeBSD: src/sys/amd64/linux32/linux32_proto.h,v 1.29 2007/02/15 01:15:31 jkim Exp $
+ * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.26 2007/02/15 01:13:36 jkim Exp 
  */
 
 #ifndef _LINUX_SYSPROTO_H_
@@ -341,6 +341,9 @@
 struct linux_uname_args {
 	register_t dummy;
 };
+struct linux_iopl_args {
+	char level_l_[PADL_(l_ulong)]; l_ulong level; char level_r_[PADR_(l_ulong)];
+};
 struct linux_vhangup_args {
 	register_t dummy;
 };
@@ -995,6 +998,7 @@
 int	linux_newlstat(struct thread *, struct linux_newlstat_args *);
 int	linux_newfstat(struct thread *, struct linux_newfstat_args *);
 int	linux_uname(struct thread *, struct linux_uname_args *);
+int	linux_iopl(struct thread *, struct linux_iopl_args *);
 int	linux_vhangup(struct thread *, struct linux_vhangup_args *);
 int	linux_wait4(struct thread *, struct linux_wait4_args *);
 int	linux_swapoff(struct thread *, struct linux_swapoff_args *);
@@ -1240,6 +1244,7 @@
 #define	LINUX_SYS_AUE_linux_newlstat	AUE_LSTAT
 #define	LINUX_SYS_AUE_linux_newfstat	AUE_FSTAT
 #define	LINUX_SYS_AUE_linux_uname	AUE_NULL
+#define	LINUX_SYS_AUE_linux_iopl	AUE_NULL
 #define	LINUX_SYS_AUE_linux_vhangup	AUE_NULL
 #define	LINUX_SYS_AUE_linux_wait4	AUE_WAIT4
 #define	LINUX_SYS_AUE_linux_swapoff	AUE_SWAPOFF

==== //depot/projects/smpng/sys/amd64/linux32/linux32_syscall.h#20 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/amd64/linux32/linux32_syscall.h,v 1.28 2006/12/31 13:20:30 netchild Exp $
- * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.25 2006/12/31 13:16:00 netchild Exp 
+ * $FreeBSD: src/sys/amd64/linux32/linux32_syscall.h,v 1.29 2007/02/15 01:15:31 jkim Exp $
+ * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.26 2007/02/15 01:13:36 jkim Exp 
  */
 
 #define	LINUX_SYS_exit	1
@@ -103,6 +103,7 @@
 #define	LINUX_SYS_linux_newlstat	107
 #define	LINUX_SYS_linux_newfstat	108
 #define	LINUX_SYS_linux_uname	109
+#define	LINUX_SYS_linux_iopl	110
 #define	LINUX_SYS_linux_vhangup	111
 #define	LINUX_SYS_linux_wait4	114
 #define	LINUX_SYS_linux_swapoff	115

==== //depot/projects/smpng/sys/amd64/linux32/linux32_sysent.c#20 (text+ko) ====

@@ -2,8 +2,8 @@
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * $FreeBSD: src/sys/amd64/linux32/linux32_sysent.c,v 1.28 2006/12/31 13:20:30 netchild Exp $
- * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.25 2006/12/31 13:16:00 netchild Exp 
+ * $FreeBSD: src/sys/amd64/linux32/linux32_sysent.c,v 1.29 2007/02/15 01:15:31 jkim Exp $
+ * created from FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.26 2007/02/15 01:13:36 jkim Exp 
  */
 
 #include <bsm/audit_kevents.h>
@@ -130,7 +130,7 @@
 	{ AS(linux_newlstat_args), (sy_call_t *)linux_newlstat, AUE_LSTAT, NULL, 0, 0 },	/* 107 = linux_newlstat */
 	{ AS(linux_newfstat_args), (sy_call_t *)linux_newfstat, AUE_FSTAT, NULL, 0, 0 },	/* 108 = linux_newfstat */
 	{ 0, (sy_call_t *)linux_uname, AUE_NULL, NULL, 0, 0 },	/* 109 = linux_uname */
-	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 110 = iopl */
+	{ AS(linux_iopl_args), (sy_call_t *)linux_iopl, AUE_NULL, NULL, 0, 0 },	/* 110 = linux_iopl */
 	{ 0, (sy_call_t *)linux_vhangup, AUE_NULL, NULL, 0, 0 },	/* 111 = linux_vhangup */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 112 = idle */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 },			/* 113 = vm86old */

==== //depot/projects/smpng/sys/amd64/linux32/syscalls.master#24 (text+ko) ====

@@ -1,4 +1,4 @@
- $FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.25 2006/12/31 13:16:00 netchild Exp $
+ $FreeBSD: src/sys/amd64/linux32/syscalls.master,v 1.26 2007/02/15 01:13:36 jkim Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 ; System call name/number master file (or rather, slave, from LINUX).
@@ -198,7 +198,7 @@
 108	AUE_FSTAT	STD	{ int linux_newfstat(l_uint fd, \
 				    struct l_newstat *buf); }
 109	AUE_NULL	STD	{ int linux_uname(void); }
-110	AUE_NULL	UNIMPL	iopl
+110	AUE_NULL	STD	{ int linux_iopl(l_ulong level); }
 111	AUE_NULL	STD	{ int linux_vhangup(void); }
 112	AUE_NULL	UNIMPL	idle
 113	AUE_NULL	UNIMPL	vm86old

==== //depot/projects/smpng/sys/arm/arm/busdma_machdep.c#20 (text+ko) ====

@@ -29,10 +29,10 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/busdma_machdep.c,v 1.28 2007/01/17 00:53:05 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/busdma_machdep.c,v 1.29 2007/02/13 07:19:26 kevlo Exp $");
 
 /*
- * MacPPC bus dma support routines
+ * ARM bus dma support routines
  */
 
 #define _ARM32_BUS_DMA_PRIVATE

==== //depot/projects/smpng/sys/arm/arm/cpufunc.c#14 (text+ko) ====

@@ -45,7 +45,7 @@
  * Created      : 30/01/97
  */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/cpufunc.c,v 1.15 2006/11/30 23:34:07 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/cpufunc.c,v 1.16 2007/02/11 22:24:54 cognet Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -58,6 +58,7 @@
 
 #include <vm/vm.h>
 #include <vm/pmap.h>
+#include <vm/uma.h>
 
 #include <machine/cpuconf.h>
 #include <machine/cpufunc.h>
@@ -799,7 +800,7 @@
 		cpu_reset_needs_v4_MMU_disable = 0;
 		get_cachetype_cp15();
 		pmap_pte_init_generic();
-		return 0;
+		goto out;
 	}
 #endif	
 #ifdef CPU_ARM8
@@ -809,7 +810,7 @@
 		cpu_reset_needs_v4_MMU_disable = 0;	/* XXX correct? */
 		get_cachetype_cp15();
 		pmap_pte_init_arm8();
-		return 0;
+		goto out;
 	}
 #endif	/* CPU_ARM8 */
 #ifdef CPU_ARM9
@@ -829,7 +830,7 @@
 #else
 		pmap_pte_init_generic();
 #endif
-		return 0;
+		goto out;
 	}
 #endif /* CPU_ARM9 */
 #ifdef CPU_ARM10
@@ -849,7 +850,7 @@
 		arm10_dcache_index_inc = 1U << (32 - arm_dcache_l2_assoc);
 		arm10_dcache_index_max = 0U - arm10_dcache_index_inc;
 		pmap_pte_init_generic();
-		return 0;
+		goto out;
 	}
 #endif /* CPU_ARM10 */
 #ifdef CPU_SA110
@@ -858,7 +859,7 @@
 		cpu_reset_needs_v4_MMU_disable = 1;	/* SA needs it */
 		get_cachetype_table();
 		pmap_pte_init_sa1();
-		return 0;
+		goto out;
 	}
 #endif	/* CPU_SA110 */
 #ifdef CPU_SA1100
@@ -870,7 +871,7 @@
 		/* Use powersave on this CPU. */
 		cpu_do_powersave = 1;
 
-		return 0;
+		goto out;
 	}
 #endif	/* CPU_SA1100 */
 #ifdef CPU_SA1110
@@ -882,7 +883,7 @@
 		/* Use powersave on this CPU. */
 		cpu_do_powersave = 1;
 
-		return 0;
+		goto out;
 	}
 #endif	/* CPU_SA1110 */
 #ifdef CPU_IXP12X0
@@ -891,7 +892,7 @@
                 cpu_reset_needs_v4_MMU_disable = 1;
                 get_cachetype_table();
                 pmap_pte_init_sa1();
-                return 0;
+		goto out;
         }
 #endif  /* CPU_IXP12X0 */
 #ifdef CPU_XSCALE_80200
@@ -948,7 +949,7 @@
 		cpu_reset_needs_v4_MMU_disable = 1;	/* XScale needs it */
 		get_cachetype_cp15();
 		pmap_pte_init_xscale();
-		return 0;
+		goto out;
 	}
 #endif /* CPU_XSCALE_80200 */
 #if defined(CPU_XSCALE_80321) || defined(CPU_XSCALE_80219)
@@ -975,7 +976,7 @@
 		cpu_reset_needs_v4_MMU_disable = 1;	/* XScale needs it */
 		get_cachetype_cp15();
 		pmap_pte_init_xscale();
-		return 0;
+		goto out;
 	}
 #endif /* CPU_XSCALE_80321 */
 
@@ -989,7 +990,7 @@
 		cpu_reset_needs_v4_MMU_disable = 1;	/* XScale needs it */
 		get_cachetype_cp15();
 		pmap_pte_init_xscale();
-		return 0;
+		goto out;
 	}
 #endif /* CPU_XSCALE_81342 */
 #ifdef CPU_XSCALE_PXA2X0
@@ -1009,7 +1010,7 @@
 		/* Use powersave on this CPU. */
 		cpu_do_powersave = 1;
 
-		return 0;
+		goto out;
 	}
 #endif /* CPU_XSCALE_PXA2X0 */
 #ifdef CPU_XSCALE_IXP425
@@ -1025,7 +1026,7 @@
 		get_cachetype_cp15();
 		pmap_pte_init_xscale();
 
-		return 0;
+		goto out;
 	}
 #endif /* CPU_XSCALE_IXP425 */
 	/*
@@ -1033,6 +1034,9 @@
 	 */
 	panic("No support for this CPU type (%08x) in kernel", cputype);
 	return(ARCHITECTURE_NOT_PRESENT);
+out:
+	uma_set_align(arm_dcache_align_mask);
+	return (0);
 }
 
 /*

==== //depot/projects/smpng/sys/arm/arm/db_interface.c#6 (text+ko) ====

@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/db_interface.c,v 1.5 2005/06/23 11:38:47 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/db_interface.c,v 1.6 2007/02/14 01:25:41 kevlo Exp $");
 #include "opt_ddb.h"
 
 #include <sys/param.h>
@@ -109,7 +109,7 @@
 		*valp = get_stackptr(PSR_UND32_MODE);
 		return (1);
 	}
-	return(0);
+	return (0);
 }
 
 int
@@ -120,7 +120,7 @@
 		*valp = get_stackptr(PSR_ABT32_MODE);
 		return (1);
 	}
-	return(0);
+	return (0);
 }
 
 int
@@ -131,7 +131,7 @@
 		*valp = get_stackptr(PSR_IRQ32_MODE);
 		return (1);
 	}
-	return(0);
+	return (0);
 }
 
 int db_frame(struct db_variable *vp, db_expr_t *valp, int rw)
@@ -146,7 +146,7 @@
 		*valp = *reg;
 	else
 		*reg = *valp;
-	return(1);
+	return (1);
 }
 
 void
@@ -339,4 +339,3 @@
 		panic("branch_taken: botch");
 	}
 }
-

==== //depot/projects/smpng/sys/arm/arm/elf_trampoline.c#13 (text+ko) ====

@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/elf_trampoline.c,v 1.16 2006/11/01 12:41:43 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/elf_trampoline.c,v 1.17 2007/02/19 00:57:27 cognet Exp $");
 #include <machine/asm.h>
 #include <sys/param.h>
 #include <sys/elf32.h>
@@ -103,7 +103,7 @@
     	char *d = dst;
 
 	while (len) {
-		if (len >= 4 && !((vm_offset_t)d & 3) &&
+		if (0 && len >= 4 && !((vm_offset_t)d & 3) &&
 		    !((vm_offset_t)s & 3)) {
 			*(uint32_t *)d = *(uint32_t *)s;
 			s += 4;
@@ -143,6 +143,37 @@
 	int physaddr = KERNPHYSADDR;
 	int tmp1;
 	unsigned int sp = ((unsigned int)&_end & ~3) + 4;
+#if defined(FLASHADDR) && defined(LOADERRAMADDR)
+	unsigned int pc;
+
+	__asm __volatile("adr %0, _start\n"
+	    : "=r" (pc));
+	if ((FLASHADDR > LOADERRAMADDR && pc >= FLASHADDR) ||
+	    (FLASHADDR < LOADERRAMADDR && pc < LOADERRAMADDR)) {
+		/*
+		 * We're running from flash, so just copy the whole thing
+		 * from flash to memory.
+		 * This is far from optimal, we could do the relocation or
+		 * the unzipping directly from flash to memory to avoid this
+		 * needless copy, but it would require to know the flash
+		 * physical address.
+		 */
+		unsigned int target_addr;
+		unsigned int tmp_sp;
+
+		target_addr = (unsigned int)&_start - PHYSADDR + LOADERRAMADDR;
+		tmp_sp = target_addr + 0x100000 +
+		    (unsigned int)&_end - (unsigned int)&_start;
+		memcpy((char *)target_addr, (char *)pc,
+		    (unsigned int)&_end - (unsigned int)&_start);
+		/* Temporary set the sp and jump to the new location. */
+		__asm __volatile(
+		    "mov sp, %1\n"
+		    "mov pc, %0\n"
+		    : : "r" (target_addr), "r" (tmp_sp));
+		
+	}
+#endif
 #ifdef KZIP
 	sp += KERNSIZE + 0x100;
 	sp &= ~(L1_TABLE_SIZE - 1);

==== //depot/projects/smpng/sys/arm/arm/locore.S#13 (text+ko) ====

@@ -37,7 +37,7 @@
 #include <machine/asm.h>
 #include <machine/armreg.h>
 #include <machine/pte.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/locore.S,v 1.14 2006/06/21 23:47:25 imp Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/locore.S,v 1.15 2007/02/19 00:57:27 cognet Exp $");
 
 /* What size should this really be ? It is only used by initarm() */
 #define INIT_ARM_STACK_SIZE	2048
@@ -66,47 +66,53 @@
 ENTRY_NP(btext)
 
 ASENTRY_NP(_start)
-
-
-	/* Check if we are running on RAM, if not move ourself to RAM */
-#if 0
-	cmp	pc, #PHYSADDR
-	bhi	start_inram /* XXX: This is wrong */
+#if defined (FLASHADDR) && defined(LOADERRAMADDR)
+	/* Check if we're running from flash. */
+	ldr	r7, =FLASHADDR
+	/* 
+	 * If we're running with MMU disabled, test against the
+	 * physical address instead.
+	 */
+	mrc     p15, 0, r2, c1, c0, 0
+	ands	r2, r2, #CPU_CONTROL_MMU_ENABLE
+	ldreq	r8, =PHYSADDR

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


More information about the p4-projects mailing list