[email protected]
[Top] [All Lists]

PERFORCE change 114718 for review

Subject: PERFORCE change 114718 for review
From: Robert Watson
Date: Mon, 19 Feb 2007 14:10:11 GMT
http://perforce.freebsd.org/chv.cgi?CH=114718

Change 114718 by [email protected]_zoo on 2007/02/19 14:09:34

        Integrate TrustedBSD priv branch through @114717.

Affected files ...

.. //depot/projects/trustedbsd/priv/sys/amd64/amd64/msi.c#3 integrate
.. //depot/projects/trustedbsd/priv/sys/amd64/amd64/pmap.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/amd64/amd64/uma_machdep.c#2 integrate
.. //depot/projects/trustedbsd/priv/sys/amd64/conf/GENERIC#6 integrate
.. //depot/projects/trustedbsd/priv/sys/amd64/linux32/linux.h#6 integrate
.. //depot/projects/trustedbsd/priv/sys/amd64/linux32/linux32_machdep.c#7 
integrate
.. //depot/projects/trustedbsd/priv/sys/amd64/linux32/linux32_proto.h#6 
integrate
.. //depot/projects/trustedbsd/priv/sys/amd64/linux32/linux32_syscall.h#6 
integrate
.. //depot/projects/trustedbsd/priv/sys/amd64/linux32/linux32_sysent.c#6 
integrate
.. //depot/projects/trustedbsd/priv/sys/amd64/linux32/syscalls.master#6 
integrate
.. //depot/projects/trustedbsd/priv/sys/arm/arm/busdma_machdep.c#3 integrate
.. //depot/projects/trustedbsd/priv/sys/arm/arm/cpufunc.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/arm/arm/db_interface.c#2 integrate
.. //depot/projects/trustedbsd/priv/sys/arm/arm/elf_trampoline.c#5 integrate
.. //depot/projects/trustedbsd/priv/sys/arm/arm/locore.S#2 integrate
.. //depot/projects/trustedbsd/priv/sys/arm/arm/machdep.c#2 integrate
.. //depot/projects/trustedbsd/priv/sys/arm/arm/mem.c#2 integrate
.. //depot/projects/trustedbsd/priv/sys/arm/arm/sys_machdep.c#2 integrate
.. //depot/projects/trustedbsd/priv/sys/arm/at91/if_ate.c#6 integrate
.. //depot/projects/trustedbsd/priv/sys/arm/conf/EP80219#4 integrate
.. //depot/projects/trustedbsd/priv/sys/arm/conf/IQ31244#3 integrate
.. //depot/projects/trustedbsd/priv/sys/arm/conf/SIMICS#3 integrate
.. //depot/projects/trustedbsd/priv/sys/arm/xscale/ixp425/if_npe.c#3 integrate
.. //depot/projects/trustedbsd/priv/sys/arm/xscale/ixp425/ixp425_npe.c#2 
integrate
.. //depot/projects/trustedbsd/priv/sys/conf/NOTES#9 integrate
.. //depot/projects/trustedbsd/priv/sys/conf/files#11 integrate
.. //depot/projects/trustedbsd/priv/sys/conf/options#7 integrate
.. //depot/projects/trustedbsd/priv/sys/conf/options.arm#3 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/aac/aac.c#2 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/aic7xxx/aic79xx.seq#2 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/arcmsr/arcmsr.c#6 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/arcmsr/arcmsr.h#3 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/ata/ata-all.h#2 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/ata/ata-chipset.c#7 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/ata/ata-pci.c#3 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/bge/if_bge.c#9 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/bge/if_bgereg.h#7 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/exca/exca.c#3 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/ipw/if_ipw.c#2 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/ipw/if_ipwvar.h#2 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/isp/isp_freebsd.h#7 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/isp/isp_pci.c#6 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/iwi/if_iwi.c#6 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/iwi/if_iwivar.h#2 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/mii/brgphy.c#5 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/mii/brgphyreg.h#2 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/mpt/mpt_pci.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/msk/if_msk.c#3 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/mxge/if_mxge.c#6 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/pccard/pccarddevs#2 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/pccbb/pccbb.c#2 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/pccbb/pccbb_pci.c#2 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/pci/pci.c#8 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/sound/pci/envy24.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/sound/pci/envy24ht.c#3 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/sound/pci/hda/hdac.c#5 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/sound/pci/spicds.c#2 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/usb/ubsa.c#5 integrate
.. //depot/projects/trustedbsd/priv/sys/dev/usb/usbdevs#6 integrate
.. //depot/projects/trustedbsd/priv/sys/fs/cd9660/TODO#1 branch
.. //depot/projects/trustedbsd/priv/sys/fs/cd9660/TODO.hibler#1 branch
.. //depot/projects/trustedbsd/priv/sys/fs/cd9660/cd9660_bmap.c#1 branch
.. //depot/projects/trustedbsd/priv/sys/fs/cd9660/cd9660_iconv.c#1 branch
.. //depot/projects/trustedbsd/priv/sys/fs/cd9660/cd9660_lookup.c#1 branch
.. //depot/projects/trustedbsd/priv/sys/fs/cd9660/cd9660_mount.h#1 branch
.. //depot/projects/trustedbsd/priv/sys/fs/cd9660/cd9660_node.c#1 branch
.. //depot/projects/trustedbsd/priv/sys/fs/cd9660/cd9660_node.h#1 branch
.. //depot/projects/trustedbsd/priv/sys/fs/cd9660/cd9660_rrip.c#1 branch
.. //depot/projects/trustedbsd/priv/sys/fs/cd9660/cd9660_rrip.h#1 branch
.. //depot/projects/trustedbsd/priv/sys/fs/cd9660/cd9660_util.c#1 branch
.. //depot/projects/trustedbsd/priv/sys/fs/cd9660/cd9660_vfsops.c#1 branch
.. //depot/projects/trustedbsd/priv/sys/fs/cd9660/cd9660_vnops.c#1 branch
.. //depot/projects/trustedbsd/priv/sys/fs/cd9660/iso.h#1 branch
.. //depot/projects/trustedbsd/priv/sys/fs/cd9660/iso_rrip.h#1 branch
.. //depot/projects/trustedbsd/priv/sys/fs/hpfs/hpfs_vfsops.c#3 integrate
.. //depot/projects/trustedbsd/priv/sys/fs/hpfs/hpfs_vnops.c#5 integrate
.. //depot/projects/trustedbsd/priv/sys/fs/msdosfs/msdosfs_vfsops.c#7 integrate
.. //depot/projects/trustedbsd/priv/sys/fs/msdosfs/msdosfs_vnops.c#8 integrate
.. //depot/projects/trustedbsd/priv/sys/fs/ntfs/ntfs_vfsops.c#3 integrate
.. //depot/projects/trustedbsd/priv/sys/fs/ntfs/ntfs_vnops.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/fs/nullfs/null_vfsops.c#3 integrate
.. //depot/projects/trustedbsd/priv/sys/fs/nullfs/null_vnops.c#3 integrate
.. //depot/projects/trustedbsd/priv/sys/fs/procfs/procfs_ioctl.c#8 integrate
.. //depot/projects/trustedbsd/priv/sys/fs/udf/udf.h#2 integrate
.. //depot/projects/trustedbsd/priv/sys/fs/udf/udf_vfsops.c#6 integrate
.. //depot/projects/trustedbsd/priv/sys/fs/udf/udf_vnops.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/fs/umapfs/umap_vfsops.c#6 integrate
.. //depot/projects/trustedbsd/priv/sys/fs/umapfs/umap_vnops.c#2 integrate
.. //depot/projects/trustedbsd/priv/sys/fs/unionfs/union_vfsops.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/fs/unionfs/union_vnops.c#3 integrate
.. //depot/projects/trustedbsd/priv/sys/gnu/fs/ext2fs/ext2_vfsops.c#6 integrate
.. //depot/projects/trustedbsd/priv/sys/gnu/fs/ext2fs/ext2_vnops.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/gnu/fs/reiserfs/reiserfs_vfsops.c#5 
integrate
.. //depot/projects/trustedbsd/priv/sys/gnu/fs/reiserfs/reiserfs_vnops.c#2 
integrate
.. //depot/projects/trustedbsd/priv/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c#3 
integrate
.. //depot/projects/trustedbsd/priv/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c#2 
integrate
.. //depot/projects/trustedbsd/priv/sys/i386/conf/GENERIC#6 integrate
.. //depot/projects/trustedbsd/priv/sys/i386/i386/db_trace.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/i386/i386/msi.c#3 integrate
.. //depot/projects/trustedbsd/priv/sys/i386/i386/pmap.c#5 integrate
.. //depot/projects/trustedbsd/priv/sys/i386/linux/linux.h#6 integrate
.. //depot/projects/trustedbsd/priv/sys/i386/linux/linux_machdep.c#9 integrate
.. //depot/projects/trustedbsd/priv/sys/i386/linux/linux_proto.h#7 integrate
.. //depot/projects/trustedbsd/priv/sys/i386/linux/linux_syscall.h#7 integrate
.. //depot/projects/trustedbsd/priv/sys/i386/linux/linux_sysent.c#7 integrate
.. //depot/projects/trustedbsd/priv/sys/i386/linux/syscalls.master#7 integrate
.. //depot/projects/trustedbsd/priv/sys/ia64/conf/GENERIC#4 integrate
.. //depot/projects/trustedbsd/priv/sys/ia64/ia64/pmap.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/ia64/ia64/uma_machdep.c#2 integrate
.. //depot/projects/trustedbsd/priv/sys/isofs/cd9660/TODO#2 delete
.. //depot/projects/trustedbsd/priv/sys/isofs/cd9660/TODO.hibler#2 delete
.. //depot/projects/trustedbsd/priv/sys/isofs/cd9660/cd9660_bmap.c#2 delete
.. //depot/projects/trustedbsd/priv/sys/isofs/cd9660/cd9660_iconv.c#2 delete
.. //depot/projects/trustedbsd/priv/sys/isofs/cd9660/cd9660_lookup.c#2 delete
.. //depot/projects/trustedbsd/priv/sys/isofs/cd9660/cd9660_mount.h#2 delete
.. //depot/projects/trustedbsd/priv/sys/isofs/cd9660/cd9660_node.c#2 delete
.. //depot/projects/trustedbsd/priv/sys/isofs/cd9660/cd9660_node.h#3 delete
.. //depot/projects/trustedbsd/priv/sys/isofs/cd9660/cd9660_rrip.c#2 delete
.. //depot/projects/trustedbsd/priv/sys/isofs/cd9660/cd9660_rrip.h#2 delete
.. //depot/projects/trustedbsd/priv/sys/isofs/cd9660/cd9660_util.c#2 delete
.. //depot/projects/trustedbsd/priv/sys/isofs/cd9660/cd9660_vfsops.c#5 delete
.. //depot/projects/trustedbsd/priv/sys/isofs/cd9660/cd9660_vnops.c#2 delete
.. //depot/projects/trustedbsd/priv/sys/isofs/cd9660/iso.h#2 delete
.. //depot/projects/trustedbsd/priv/sys/isofs/cd9660/iso_rrip.h#2 delete
.. //depot/projects/trustedbsd/priv/sys/kern/Make.tags.inc#3 integrate
.. //depot/projects/trustedbsd/priv/sys/kern/kern_descrip.c#7 integrate
.. //depot/projects/trustedbsd/priv/sys/kern/kern_jail.c#16 integrate
.. //depot/projects/trustedbsd/priv/sys/kern/kern_ktrace.c#7 integrate
.. //depot/projects/trustedbsd/priv/sys/kern/kern_resource.c#9 integrate
.. //depot/projects/trustedbsd/priv/sys/kern/kern_sig.c#7 integrate
.. //depot/projects/trustedbsd/priv/sys/kern/subr_firmware.c#5 integrate
.. //depot/projects/trustedbsd/priv/sys/kern/sysv_msg.c#8 integrate
.. //depot/projects/trustedbsd/priv/sys/kern/uipc_debug.c#1 branch
.. //depot/projects/trustedbsd/priv/sys/kern/uipc_socket.c#8 integrate
.. //depot/projects/trustedbsd/priv/sys/kern/uipc_usrreq.c#5 integrate
.. //depot/projects/trustedbsd/priv/sys/kern/vfs_default.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/kern/vfs_export.c#5 integrate
.. //depot/projects/trustedbsd/priv/sys/kern/vfs_init.c#2 integrate
.. //depot/projects/trustedbsd/priv/sys/kern/vfs_lookup.c#5 integrate
.. //depot/projects/trustedbsd/priv/sys/kern/vfs_mount.c#9 integrate
.. //depot/projects/trustedbsd/priv/sys/kern/vfs_syscalls.c#10 integrate
.. //depot/projects/trustedbsd/priv/sys/kern/vfs_vnops.c#6 integrate
.. //depot/projects/trustedbsd/priv/sys/kern/vnode_if.src#3 integrate
.. //depot/projects/trustedbsd/priv/sys/modules/cd9660/Makefile#2 integrate
.. //depot/projects/trustedbsd/priv/sys/modules/cd9660_iconv/Makefile#2 
integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/in_pcb.c#7 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/in_pcb.h#2 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/in_proto.c#3 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/ip_mroute.c#7 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/sctp_asconf.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/sctp_auth.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/sctp_auth.h#2 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/sctp_constants.h#4 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/sctp_crc32.c#3 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/sctp_indata.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/sctp_input.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/sctp_os.h#4 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/sctp_os_bsd.h#4 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/sctp_output.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/sctp_pcb.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/sctp_peeloff.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/sctp_structs.h#4 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/sctp_timer.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/sctp_uio.h#4 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/sctp_usrreq.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/sctp_var.h#4 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/sctputil.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/sctputil.h#4 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet/tcp_usrreq.c#5 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet6/icmp6.c#5 integrate
.. //depot/projects/trustedbsd/priv/sys/netinet6/sctp6_usrreq.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/netsmb/smb_dev.c#3 integrate
.. //depot/projects/trustedbsd/priv/sys/nfsclient/nfs_socket.c#5 integrate
.. //depot/projects/trustedbsd/priv/sys/nfsserver/nfs_serv.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/pc98/conf/GENERIC#5 integrate
.. //depot/projects/trustedbsd/priv/sys/powerpc/conf/GENERIC#5 integrate
.. //depot/projects/trustedbsd/priv/sys/powerpc/powerpc/cpu.c#3 integrate
.. //depot/projects/trustedbsd/priv/sys/powerpc/powerpc/machdep.c#5 integrate
.. //depot/projects/trustedbsd/priv/sys/security/mac_biba/mac_biba.c#5 integrate
.. 
//depot/projects/trustedbsd/priv/sys/security/mac_seeotheruids/mac_seeotheruids.c#7
 integrate
.. //depot/projects/trustedbsd/priv/sys/sparc64/conf/GENERIC#5 integrate
.. //depot/projects/trustedbsd/priv/sys/sun4v/conf/GENERIC#4 integrate
.. //depot/projects/trustedbsd/priv/sys/sys/firmware.h#2 integrate
.. //depot/projects/trustedbsd/priv/sys/sys/mount.h#6 integrate
.. //depot/projects/trustedbsd/priv/sys/sys/priv.h#11 integrate
.. //depot/projects/trustedbsd/priv/sys/sys/systm.h#9 integrate
.. //depot/projects/trustedbsd/priv/sys/sys/vnode.h#4 integrate
.. //depot/projects/trustedbsd/priv/sys/tools/fw_stub.awk#2 integrate
.. //depot/projects/trustedbsd/priv/sys/ufs/ffs/README.softupdates#2 delete
.. //depot/projects/trustedbsd/priv/sys/ufs/ffs/ffs_alloc.c#5 integrate
.. //depot/projects/trustedbsd/priv/sys/ufs/ffs/ffs_extern.h#4 integrate
.. //depot/projects/trustedbsd/priv/sys/ufs/ffs/ffs_softdep.c#4 integrate
.. //depot/projects/trustedbsd/priv/sys/ufs/ffs/ffs_vfsops.c#7 integrate
.. //depot/projects/trustedbsd/priv/sys/ufs/ffs/ffs_vnops.c#6 integrate
.. //depot/projects/trustedbsd/priv/sys/ufs/ufs/ufs_quota.c#8 integrate
.. //depot/projects/trustedbsd/priv/sys/vm/uma.h#4 integrate
.. //depot/projects/trustedbsd/priv/sys/vm/uma_core.c#5 integrate
.. //depot/projects/trustedbsd/priv/sys/vm/vm_page.c#7 integrate
.. //depot/projects/trustedbsd/priv/sys/vm/vm_zeroidle.c#5 integrate

Differences ...

==== //depot/projects/trustedbsd/priv/sys/amd64/amd64/msi.c#3 (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/trustedbsd/priv/sys/amd64/amd64/pmap.c#4 (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/trustedbsd/priv/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.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/trustedbsd/priv/sys/amd64/conf/GENERIC#6 (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/trustedbsd/priv/sys/amd64/linux32/linux.h#6 (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/trustedbsd/priv/sys/amd64/linux32/linux32_machdep.c#7 
(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/trustedbsd/priv/sys/amd64/linux32/linux32_proto.h#6 
(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/trustedbsd/priv/sys/amd64/linux32/linux32_syscall.h#6 
(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/trustedbsd/priv/sys/amd64/linux32/linux32_sysent.c#6 
(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/trustedbsd/priv/sys/amd64/linux32/syscalls.master#6 
(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/trustedbsd/priv/sys/arm/arm/busdma_machdep.c#3 (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/trustedbsd/priv/sys/arm/arm/cpufunc.c#4 (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/trustedbsd/priv/sys/arm/arm/db_interface.c#2 (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/trustedbsd/priv/sys/arm/arm/elf_trampoline.c#5 (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/trustedbsd/priv/sys/arm/arm/locore.S#2 (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
+       ldrne   r8, =LOADERRAMADDR
+       cmp     r7, r8
+       bls     flash_lower
+       cmp     r7, pc
+       bhi     from_ram
+       b       do_copy
+       
+flash_lower:
+       cmp     r8, pc
+       bls     from_ram
+do_copy:
+       ldr     r9, =KERNBASE
+       adr     r1, _start 
+       ldr     r0, Lreal_start
+       ldr     r2, Lend
+       sub     r2, r2, r0
+       sub     r0, r0, r9
+       add     r0, r0, r8
+       mov     r4, r0
+       /* Make sure _arm_memcpy is NULL */

>>> TRUNCATED FOR MAIL (1000 lines) <<<
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/p4-projects
To unsubscribe, send any mail to "[email protected]"

<Prev in Thread] Current Thread [Next in Thread>
  • PERFORCE change 114718 for review, Robert Watson <=