[email protected]
[Top] [All Lists]

PERFORCE change 114733 for review

Subject: PERFORCE change 114733 for review
From: Jung-uk Kim
Date: Mon, 19 Feb 2007 23:00:26 GMT
http://perforce.freebsd.org/chv.cgi?CH=114733

Change 114733 by [email protected]_hammer on 2007/02/19 22:59:41

        IFC

Affected files ...

.. //depot/projects/linuxolator/src/sys/amd64/amd64/msi.c#4 integrate
.. //depot/projects/linuxolator/src/sys/amd64/amd64/pmap.c#6 integrate
.. //depot/projects/linuxolator/src/sys/amd64/amd64/uma_machdep.c#2 integrate
.. //depot/projects/linuxolator/src/sys/arm/arm/elf_trampoline.c#4 integrate
.. //depot/projects/linuxolator/src/sys/arm/arm/locore.S#2 integrate
.. //depot/projects/linuxolator/src/sys/arm/conf/EP80219#4 integrate
.. //depot/projects/linuxolator/src/sys/arm/conf/IQ31244#3 integrate
.. //depot/projects/linuxolator/src/sys/arm/conf/SIMICS#3 integrate
.. //depot/projects/linuxolator/src/sys/arm/xscale/ixp425/ixp425_npe.c#2 
integrate
.. //depot/projects/linuxolator/src/sys/conf/files#19 integrate
.. //depot/projects/linuxolator/src/sys/conf/options.arm#4 integrate
.. //depot/projects/linuxolator/src/sys/dev/aic7xxx/aic79xx.seq#2 integrate
.. //depot/projects/linuxolator/src/sys/dev/arcmsr/arcmsr.c#4 integrate
.. //depot/projects/linuxolator/src/sys/dev/arcmsr/arcmsr.h#3 integrate
.. //depot/projects/linuxolator/src/sys/dev/ata/ata-all.h#2 integrate
.. //depot/projects/linuxolator/src/sys/dev/ata/ata-chipset.c#8 integrate
.. //depot/projects/linuxolator/src/sys/dev/ata/ata-pci.c#3 integrate
.. //depot/projects/linuxolator/src/sys/dev/exca/exca.c#3 integrate
.. //depot/projects/linuxolator/src/sys/dev/ipw/if_ipw.c#2 integrate
.. //depot/projects/linuxolator/src/sys/dev/ipw/if_ipwvar.h#2 integrate
.. //depot/projects/linuxolator/src/sys/dev/isp/isp_freebsd.h#7 integrate
.. //depot/projects/linuxolator/src/sys/dev/iwi/if_iwi.c#7 integrate
.. //depot/projects/linuxolator/src/sys/dev/iwi/if_iwivar.h#2 integrate
.. //depot/projects/linuxolator/src/sys/dev/msk/if_msk.c#4 integrate
.. //depot/projects/linuxolator/src/sys/dev/mxge/if_mxge.c#7 integrate
.. //depot/projects/linuxolator/src/sys/dev/pccard/pccarddevs#2 integrate
.. //depot/projects/linuxolator/src/sys/dev/pccbb/pccbb.c#2 integrate
.. //depot/projects/linuxolator/src/sys/dev/pccbb/pccbb_pci.c#2 integrate
.. //depot/projects/linuxolator/src/sys/dev/pci/pci.c#18 integrate
.. //depot/projects/linuxolator/src/sys/dev/sound/pci/hda/hdac.c#13 integrate
.. //depot/projects/linuxolator/src/sys/fs/cd9660/cd9660_vfsops.c#2 integrate
.. //depot/projects/linuxolator/src/sys/fs/cd9660/cd9660_vnops.c#2 integrate
.. //depot/projects/linuxolator/src/sys/fs/cd9660/iso.h#2 integrate
.. //depot/projects/linuxolator/src/sys/fs/hpfs/hpfs_vfsops.c#3 integrate
.. //depot/projects/linuxolator/src/sys/fs/hpfs/hpfs_vnops.c#3 integrate
.. //depot/projects/linuxolator/src/sys/fs/msdosfs/msdosfs_vfsops.c#9 integrate
.. //depot/projects/linuxolator/src/sys/fs/msdosfs/msdosfs_vnops.c#6 integrate
.. //depot/projects/linuxolator/src/sys/fs/ntfs/ntfs_vfsops.c#3 integrate
.. //depot/projects/linuxolator/src/sys/fs/ntfs/ntfs_vnops.c#4 integrate
.. //depot/projects/linuxolator/src/sys/fs/nullfs/null_vfsops.c#3 integrate
.. //depot/projects/linuxolator/src/sys/fs/nullfs/null_vnops.c#3 integrate
.. //depot/projects/linuxolator/src/sys/fs/procfs/procfs_ioctl.c#5 integrate
.. //depot/projects/linuxolator/src/sys/fs/udf/udf.h#2 integrate
.. //depot/projects/linuxolator/src/sys/fs/udf/udf_vfsops.c#5 integrate
.. //depot/projects/linuxolator/src/sys/fs/udf/udf_vnops.c#4 integrate
.. //depot/projects/linuxolator/src/sys/fs/umapfs/umap_vfsops.c#4 integrate
.. //depot/projects/linuxolator/src/sys/fs/umapfs/umap_vnops.c#2 integrate
.. //depot/projects/linuxolator/src/sys/fs/unionfs/union_vfsops.c#5 integrate
.. //depot/projects/linuxolator/src/sys/fs/unionfs/union_vnops.c#5 integrate
.. //depot/projects/linuxolator/src/sys/gnu/fs/ext2fs/ext2_vfsops.c#5 integrate
.. //depot/projects/linuxolator/src/sys/gnu/fs/ext2fs/ext2_vnops.c#3 integrate
.. //depot/projects/linuxolator/src/sys/gnu/fs/reiserfs/reiserfs_vfsops.c#4 
integrate
.. //depot/projects/linuxolator/src/sys/gnu/fs/reiserfs/reiserfs_vnops.c#2 
integrate
.. //depot/projects/linuxolator/src/sys/gnu/fs/xfs/FreeBSD/xfs_mountops.c#3 
integrate
.. //depot/projects/linuxolator/src/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c#2 
integrate
.. //depot/projects/linuxolator/src/sys/i386/i386/db_trace.c#5 integrate
.. //depot/projects/linuxolator/src/sys/i386/i386/msi.c#4 integrate
.. //depot/projects/linuxolator/src/sys/i386/i386/pmap.c#7 integrate
.. //depot/projects/linuxolator/src/sys/ia64/ia64/uma_machdep.c#2 integrate
.. //depot/projects/linuxolator/src/sys/kern/kern_descrip.c#6 integrate
.. //depot/projects/linuxolator/src/sys/kern/kern_jail.c#5 integrate
.. //depot/projects/linuxolator/src/sys/kern/kern_resource.c#8 integrate
.. //depot/projects/linuxolator/src/sys/kern/subr_firmware.c#5 integrate
.. //depot/projects/linuxolator/src/sys/kern/sysv_msg.c#9 integrate
.. //depot/projects/linuxolator/src/sys/kern/uipc_debug.c#1 branch
.. //depot/projects/linuxolator/src/sys/kern/uipc_socket.c#12 integrate
.. //depot/projects/linuxolator/src/sys/kern/vfs_default.c#4 integrate
.. //depot/projects/linuxolator/src/sys/kern/vfs_export.c#6 integrate
.. //depot/projects/linuxolator/src/sys/kern/vfs_init.c#2 integrate
.. //depot/projects/linuxolator/src/sys/kern/vfs_lookup.c#6 integrate
.. //depot/projects/linuxolator/src/sys/kern/vfs_syscalls.c#8 integrate
.. //depot/projects/linuxolator/src/sys/kern/vnode_if.src#3 integrate
.. //depot/projects/linuxolator/src/sys/netatalk/at_control.c#3 integrate
.. //depot/projects/linuxolator/src/sys/netinet/in_pcb.c#6 integrate
.. //depot/projects/linuxolator/src/sys/netinet/in_pcb.h#2 integrate
.. //depot/projects/linuxolator/src/sys/netinet/tcp_usrreq.c#6 integrate
.. //depot/projects/linuxolator/src/sys/nfsclient/nfs_socket.c#6 integrate
.. //depot/projects/linuxolator/src/sys/nfsserver/nfs_serv.c#5 integrate
.. //depot/projects/linuxolator/src/sys/powerpc/powerpc/cpu.c#3 integrate
.. 
//depot/projects/linuxolator/src/sys/security/mac_seeotheruids/mac_seeotheruids.c#5
 integrate
.. //depot/projects/linuxolator/src/sys/sys/firmware.h#2 integrate
.. //depot/projects/linuxolator/src/sys/sys/mount.h#7 integrate
.. //depot/projects/linuxolator/src/sys/sys/priv.h#2 integrate
.. //depot/projects/linuxolator/src/sys/sys/vnode.h#5 integrate
.. //depot/projects/linuxolator/src/sys/tools/fw_stub.awk#2 integrate
.. //depot/projects/linuxolator/src/sys/ufs/ffs/README.softupdates#2 delete
.. //depot/projects/linuxolator/src/sys/ufs/ffs/ffs_alloc.c#5 integrate
.. //depot/projects/linuxolator/src/sys/ufs/ffs/ffs_extern.h#4 integrate
.. //depot/projects/linuxolator/src/sys/ufs/ffs/ffs_softdep.c#5 integrate
.. //depot/projects/linuxolator/src/sys/ufs/ffs/ffs_vfsops.c#7 integrate
.. //depot/projects/linuxolator/src/sys/ufs/ffs/ffs_vnops.c#5 integrate
.. //depot/projects/linuxolator/src/sys/ufs/ufs/ufs_quota.c#8 integrate
.. //depot/projects/linuxolator/src/sys/vm/vm_page.c#9 integrate

Differences ...

==== //depot/projects/linuxolator/src/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/linuxolator/src/sys/amd64/amd64/pmap.c#6 (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/linuxolator/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.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/linuxolator/src/sys/arm/arm/elf_trampoline.c#4 (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/linuxolator/src/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 */
+       ldr     r3, .L_arm_memcpy
+       ldr     r3, [r3]
+       mov     r5, #0
+       str     r5, [r3]
+       bl      memcpy
+       ldr     r0, Lram_offset
+       add     pc, r4, r0
+Lram_offset:   .word from_ram-_C_LABEL(_start)
+from_ram:
+       nop
 #endif
-       b       start_inram /*
-                            * XXX: this is even more wrong, but RedBoot
-                            * use 0x00000000-0x100000000 as virtual
-                            * addresses for the RAM.
-                            */
-
-       /* move me to RAM
-        * XXX: we can use memcpy if it is PIC
-        */
-       ldr r1, Lcopy_size
-       adr r0, _C_LABEL(_start)
-       add r1, r1, #3
-       mov r1, r1, LSR #2
-       mov r2, #PHYSADDR
-       add r2, r2, #0x00200000
-       mov r4, r2
-
-5:     ldr r3,[r0],#4
-       str r3,[r2],#4
-       subs r1,r1,#1
-       bhi 5b
-
-       /* Jump to RAM */
-       ldr r0, Lstart_off
-       add pc, r4, r0
-
-Lcopy_size:    .word _edata-_C_LABEL(_start)
-Lstart_off:    .word start_inram-_C_LABEL(_start)
-start_inram:
        adr     r7, Lunmapped
        bic     r7, r7, #0xff000000
        orr     r7, r7, #PHYSADDR
                        
 
+disable_mmu:
        /* Disable MMU for a while */
        mrc     p15, 0, r2, c1, c0, 0
        bic     r2, r2, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE |\
@@ -120,7 +126,6 @@
        nop
        mov     pc, r7
 Lunmapped:
-
 #ifdef STARTUP_PAGETABLE_ADDR
        /* build page table from scratch */
        ldr     r0, Lstartup_pagetable
@@ -191,6 +196,10 @@
        .word   KERNVIRTADDR
 Lphysaddr:
        .word   KERNPHYSADDR
+Lreal_start:
+       .word   _start
+Lend:  
+       .word   _edata
 Lstartup_pagetable:
        .word   STARTUP_PAGETABLE_ADDR
 mmu_init_table:
@@ -207,6 +216,11 @@
        .word   _end
        .word   svcstk + INIT_ARM_STACK_SIZE
 
+#if defined(FLASHADDR) && defined(LOADERRAMADDR)
+.L_arm_memcpy:
+        .word   _C_LABEL(_arm_memcpy)
+#endif
+
 .Lvirt_done:
        .word   virt_done
 .Lmainreturned:

==== //depot/projects/linuxolator/src/sys/arm/conf/EP80219#4 (text+ko) ====

@@ -1,4 +1,4 @@
-# -*- makefile-bsdmake -*- GENERIC -- Generic kernel configuration file for 
FreeBSD/arm
+# EP80219 -- Custom kernel configuration file for FreeBSD/arm on the EP80219
 #
 # For more information on this file, please read the handbook section on
 # Kernel Configuration Files:
@@ -15,7 +15,7 @@
 # If you are in doubt as to the purpose or necessity of a line, check first 
 # in NOTES.
 #
-# $FreeBSD: src/sys/arm/conf/EP80219,v 1.4 2007/02/07 18:55:29 marcel Exp $
+# $FreeBSD: src/sys/arm/conf/EP80219,v 1.5 2007/02/19 00:37:25 cognet Exp $
 
 machine        arm
 ident          EP80219

==== //depot/projects/linuxolator/src/sys/arm/conf/IQ31244#3 (text+ko) ====

@@ -1,4 +1,4 @@
-# GENERIC -- Generic kernel configuration file for FreeBSD/arm
+# IQ31244 -- Custom kernel configuration file for FreeBSD/arm on the IQ31244
 #
 # For more information on this file, please read the handbook section on
 # Kernel Configuration Files:
@@ -15,7 +15,7 @@
 # If you are in doubt as to the purpose or necessity of a line, check first 
 # in NOTES.
 #
-# $FreeBSD: src/sys/arm/conf/IQ31244,v 1.17 2006/10/26 22:11:35 jb Exp $
+# $FreeBSD: src/sys/arm/conf/IQ31244,v 1.19 2007/02/19 01:03:08 cognet Exp $
 
 machine                arm
 ident          IQ31244
@@ -23,6 +23,8 @@
 options        PHYSADDR=0xa0000000
 options                KERNPHYSADDR=0xa0200000 
 options                KERNVIRTADDR=0xc0200000         # Used in ldscript.arm
+options                FLASHADDR=0xf0000000
+options                LOADERRAMADDR=0x00000000
 
 options STARTUP_PAGETABLE_ADDR=0xa0000000
 include                "../xscale/i80321/std.iq31244"

==== //depot/projects/linuxolator/src/sys/arm/conf/SIMICS#3 (text+ko) ====

@@ -1,4 +1,4 @@
-# GENERIC -- Generic kernel configuration file for FreeBSD/arm
+# SIMICS -- Custom kernel configuration file for FreeBSD/arm on Simics SA1110
 #
 # For more information on this file, please read the handbook section on
 # Kernel Configuration Files:
@@ -15,7 +15,7 @@
 # If you are in doubt as to the purpose or necessity of a line, check first 
 # in NOTES.
 #
-# $FreeBSD: src/sys/arm/conf/SIMICS,v 1.12 2006/10/26 22:11:35 jb Exp $
+# $FreeBSD: src/sys/arm/conf/SIMICS,v 1.13 2007/02/19 00:37:25 cognet Exp $
 
 machine                arm
 ident          SIMICS

==== //depot/projects/linuxolator/src/sys/arm/xscale/ixp425/ixp425_npe.c#2 
(text+ko) ====

@@ -57,7 +57,7 @@
  * SUCH DAMAGE.
 */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/ixp425_npe.c,v 1.1 2006/11/19 
23:55:23 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/ixp425_npe.c,v 1.2 2007/02/15 
17:21:30 luigi Exp $");
 
 /*
  * Intel XScale Network Processing Engine (NPE) support.
@@ -422,7 +422,7 @@
 {
     uint32_t imageSize;
     const uint32_t *imageCodePtr;
-    struct firmware *fw;
+    const struct firmware *fw;
     int error;
 
     DPRINTF(sc->sc_dev, "load %s, imageId 0x%08x\n", imageName, imageId);

==== //depot/projects/linuxolator/src/sys/conf/files#19 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.1176 2007/02/11 14:01:32 rodrigc Exp $
+# $FreeBSD: src/sys/conf/files,v 1.1177 2007/02/15 01:28:22 rwatson Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -1443,6 +1443,7 @@
 kern/tty_tty.c                 standard
 kern/uipc_accf.c               optional inet
 kern/uipc_cow.c                        optional zero_copy_sockets
+kern/uipc_debug.c              optional ddb
 kern/uipc_domain.c             standard
 kern/uipc_mbuf.c               standard
 kern/uipc_mbuf2.c              standard

==== //depot/projects/linuxolator/src/sys/conf/options.arm#4 (text+ko) ====

@@ -1,4 +1,4 @@
-#$FreeBSD: src/sys/conf/options.arm,v 1.15 2007/01/05 02:08:35 ticso Exp $
+#$FreeBSD: src/sys/conf/options.arm,v 1.16 2007/02/19 01:03:07 cognet Exp $
 ARM9_CACHE_WRITE_THROUGH       opt_global.h
 ARM_CACHE_LOCK_ENABLE  opt_global.h
 ARMFPE                 opt_global.h
@@ -11,8 +11,10 @@
 CPU_XSCALE_80321       opt_global.h
 CPU_XSCALE_80219       opt_global.h
 CPU_XSCALE_IXP425      opt_global.h
+FLASHADDR              opt_global.h
 KERNPHYSADDR           opt_global.h
 KERNVIRTADDR           opt_global.h
+LOADERRAMADDR          opt_global.h
 PHYSADDR               opt_global.h
 SKYEYE_WORKAROUNDS     opt_global.h
 STARTUP_PAGETABLE_ADDR opt_global.h

==== //depot/projects/linuxolator/src/sys/dev/aic7xxx/aic79xx.seq#2 (text+ko) 
====

@@ -37,7 +37,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $FreeBSD: src/sys/dev/aic7xxx/aic79xx.seq,v 1.18 2005/01/06 01:42:26 imp 
Exp $
+ * $FreeBSD: src/sys/dev/aic7xxx/aic79xx.seq,v 1.19 2007/02/18 19:48:59 ceri 
Exp $
  */
 
 VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.seq#119 $"
@@ -2139,7 +2139,7 @@
 END_CRITICAL;
 pkt_status_check_overrun:
        /*
-        * Status PKT overruns are uncerimoniously recovered with a
+        * Status PKT overruns are unceremoniously recovered with a
         * bus reset.  If we've overrun, let the host know so that
         * recovery can be performed.
         *

==== //depot/projects/linuxolator/src/sys/dev/arcmsr/arcmsr.c#4 (text+ko) ====

@@ -52,8 +52,11 @@
 **                                                       with scsi 
pass-through command
 **                                                       add new device id of 
sas raid adapters 
 **                                                       code fit for SPARC64 
& PPC 
+**     1.20.00.14   02/05/2007         Erich Chen        bug fix for incorrect 
ccb_h.status report
+**                                                       and cause 
g_vfs_done() read write error
+
 
******************************************************************************************
-* $FreeBSD: src/sys/dev/arcmsr/arcmsr.c,v 1.15 2006/12/13 08:46:03 scottl Exp $
+* $FreeBSD: src/sys/dev/arcmsr/arcmsr.c,v 1.16 2007/02/15 15:36:15 scottl Exp $
 */
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1299,7 +1302,8 @@
        }
        pccb->ccb_h.status |= CAM_SIM_QUEUED;
        if(acb->srboutstandingcount >= ARCMSR_MAX_OUTSTANDING_CMD) {
-               pccb->ccb_h.status |= CAM_SCSI_BUSY;
+               pccb->ccb_h.status &= ~CAM_STATUS_MASK;
+               pccb->ccb_h.status |= CAM_REQUEUE_REQ;
                arcmsr_srb_complete(srb, 0);
                return;
        }

==== //depot/projects/linuxolator/src/sys/dev/arcmsr/arcmsr.h#3 (text+ko) ====

@@ -35,9 +35,9 @@
 **(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/dev/arcmsr/arcmsr.h,v 1.2 2006/12/13 08:46:03 scottl Exp $
+* $FreeBSD: src/sys/dev/arcmsr/arcmsr.h,v 1.3 2007/02/15 15:36:15 scottl Exp $
 */
-#define ARCMSR_DRIVER_VERSION                        "Driver Version 
1.20.00.13 2006-8-18"
+#define ARCMSR_DRIVER_VERSION                        "Driver Version 
1.20.00.14 2007-2-05"
 #define ARCMSR_SCSI_INITIATOR_ID                                              
255
 #define ARCMSR_DEV_SECTOR_SIZE                                                
512
 #define ARCMSR_MAX_XFER_SECTORS                                              
4096

==== //depot/projects/linuxolator/src/sys/dev/ata/ata-all.h#2 (text+ko) ====

@@ -23,7 +23,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/dev/ata/ata-all.h,v 1.118 2006/06/28 09:59:09 sos Exp $
+ * $FreeBSD: src/sys/dev/ata/ata-all.h,v 1.119 2007/02/15 21:51:42 sos Exp $
  */
 
 /* ATA register defines */
@@ -228,6 +228,29 @@
 #define ATA_AHCI_CT_SG_OFFSET           128
 #define ATA_AHCI_CT_SIZE                256
 
+struct ata_ahci_dma_prd {
+    u_int64_t                   dba;
+    u_int32_t                   reserved;
+    u_int32_t                   dbc;            /* 0 based */
+#define ATA_AHCI_PRD_MASK       0x003fffff      /* max 4MB */
+#define ATA_AHCI_PRD_IPC        (1<<31)
+} __packed;
+
+struct ata_ahci_cmd_tab {
+    u_int8_t                    cfis[64];
+    u_int8_t                    acmd[32];
+    u_int8_t                    reserved[32];
+    struct ata_ahci_dma_prd     prd_tab[16];
+} __packed;
+
+struct ata_ahci_cmd_list {
+    u_int16_t                   cmd_flags;
+    u_int16_t                   prd_length;     /* PRD entries */
+    u_int32_t                   bytecount;
+    u_int64_t                   cmd_table_phys; /* 128byte aligned */
+} __packed;
+
+
 /* DMA register defines */
 #define ATA_DMA_ENTRIES                 256
 #define ATA_DMA_EOT                     0x80000000

==== //depot/projects/linuxolator/src/sys/dev/ata/ata-chipset.c#8 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.181 2007/02/12 17:17:31 
sos Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.182 2007/02/15 21:51:42 
sos Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -67,7 +67,7 @@
 static void ata_ahci_reset(device_t dev);
 static void ata_ahci_dmasetprd(void *xsc, bus_dma_segment_t *segs, int nsegs, 
int error);
 static void ata_ahci_dmainit(device_t dev);
-static int ata_ahci_setup_fis(u_int8_t *fis, struct ata_request *request);
+static int ata_ahci_setup_fis(struct ata_ahci_cmd_tab *ctp, struct ata_request 
*request);
 static int ata_acard_chipinit(device_t dev);
 static int ata_acard_allocate(device_t dev);
 static int ata_acard_status(device_t dev);
@@ -326,8 +326,22 @@
     if (bootverbose)
        device_printf(ch->dev, "SATA connect ready time=%dms\n", timeout * 10);
 
-    /* do a reset and find out what type device we've got */
-    ata_generic_reset(ch->dev);
+    /* if we have legacy resources an old fashioned reset might be needed */
+    if (ch->r_io[ATA_DATA].res)
+       ata_generic_reset(ch->dev);
+
+    /* register device type from signature */
+    ch->devices = 0;
+    if (timeout < 1000) {
+       if ((ATA_IDX_INB(ch, ATA_CYL_LSB) == ATAPI_MAGIC_LSB) &&
+           (ATA_IDX_INB(ch, ATA_CYL_MSB) == ATAPI_MAGIC_MSB))
+           ch->devices = ATA_ATAPI_MASTER;
+       else
+           ch->devices = ATA_ATA_MASTER;
+    }
+    if (bootverbose)
+       device_printf(ch->dev, "sata_connect devices=0x%b\n",
+                     ch->devices, "\20\3ATAPI_MASTER\1ATA_MASTER");
     return 1;
 }
 
@@ -367,36 +381,15 @@
 
 
 /*
- * AHCI v1.0 compliant SATA chipset support functions
+ * AHCI v1.x compliant SATA chipset support functions
  */
-struct ata_ahci_dma_prd {
-    u_int64_t                   dba;
-    u_int32_t                   reserved;
-    u_int32_t                   dbc;            /* 0 based */
-#define ATA_AHCI_PRD_MASK       0x003fffff      /* max 4MB */
-#define ATA_AHCI_PRD_IPC        (1<<31)
-} __packed;
-
-struct ata_ahci_cmd_tab {
-    u_int8_t                    cfis[64];
-    u_int8_t                    acmd[32];
-    u_int8_t                    reserved[32];
-    struct ata_ahci_dma_prd     prd_tab[16];
-} __packed;
-
-struct ata_ahci_cmd_list {
-    u_int16_t                   cmd_flags;
-    u_int16_t                   prd_length;     /* PRD entries */
-    u_int32_t                   bytecount;
-    u_int64_t                   cmd_table_phys; /* 128byte aligned */
-} __packed;
-
-
 static int
 ata_ahci_chipinit(device_t dev)
 {
     struct ata_pci_controller *ctlr = device_get_softc(dev);
-    u_int32_t version;
+    u_int32_t version, ports_implemented;;
+    int i, j; 
+    static int mapping[32];
 
     /* reset AHCI controller */
     ATA_OUTL(ctlr->r_res2, ATA_AHCI_GHC,
@@ -415,6 +408,14 @@
     /* get the number of HW channels */
     ctlr->channels = (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_NPMASK)+1;
 
+    /* if port layout has holes setup the right mapping */
+    ports_implemented = ATA_INL(ctlr->r_res2, ATA_AHCI_PI);
+    for (i=0, j=0; i<32 && j<ctlr->channels; i++) {
+       if (ports_implemented & (1<<i))
+           mapping[j++] = i;
+    }
+    device_set_ivars(dev, mapping);
+
     /* clear interrupts */
     ATA_OUTL(ctlr->r_res2, ATA_AHCI_IS, ATA_INL(ctlr->r_res2, ATA_AHCI_IS));
 
@@ -445,11 +446,12 @@
 {
     struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
     struct ata_channel *ch = device_get_softc(dev);
-    int offset = (ch->unit << 7);
+    int offset = ((int*)(device_get_ivars(ctlr->dev)))[ch->unit] << 7;
 
     /* setup legacy cruft we need */
+    ch->r_io[ATA_DATA].res = NULL;
     ch->r_io[ATA_CYL_LSB].res = ctlr->r_res2;
-    ch->r_io[ATA_CYL_LSB].offset = ATA_AHCI_P_SIG + 1 + offset;
+    ch->r_io[ATA_CYL_LSB].offset = ATA_AHCI_P_SIG + 2 + offset;
     ch->r_io[ATA_CYL_MSB].res = ctlr->r_res2;
     ch->r_io[ATA_CYL_MSB].offset = ATA_AHCI_P_SIG + 3 + offset;
     ch->r_io[ATA_STATUS].res = ctlr->r_res2;
@@ -503,11 +505,11 @@
     struct ata_channel *ch = device_get_softc(dev);
     struct ata_connect_task *tp;
     u_int32_t action, istatus, sstatus, error, issued;
-    int offset = (ch->unit << 7);
+    int offset = ((int*)(device_get_ivars(ctlr->dev)))[ch->unit] << 7;
     int tag = 0;
 
     action = ATA_INL(ctlr->r_res2, ATA_AHCI_IS);
-    if (action & (1 << ch->unit)) {
+    if (action & (1 << ((int*)(device_get_ivars(ctlr->dev)))[ch->unit])) {
        istatus = ATA_INL(ctlr->r_res2, ATA_AHCI_P_IS + offset);
        issued = ATA_INL(ctlr->r_res2, ATA_AHCI_P_CI + offset);
        sstatus = ATA_INL(ctlr->r_res2, ATA_AHCI_P_SSTS + offset);
@@ -569,15 +571,16 @@
     struct ata_channel *ch = device_get_softc(device_get_parent(request->dev));
     struct ata_ahci_cmd_tab *ctp;
     struct ata_ahci_cmd_list *clp;
+    int offset = ((int*)(device_get_ivars(ctlr->dev)))[ch->unit] << 7;
     int tag = 0, entries = 0;
     int fis_size;
-
+       
     /* get a piece of the workspace for this request */
     ctp = (struct ata_ahci_cmd_tab *)
          (ch->dma->work + ATA_AHCI_CT_OFFSET + (ATA_AHCI_CT_SIZE * tag));
 
-    /* setup the FIS for this request */ /* XXX SOS ATAPI missing still */
-    if (!(fis_size = ata_ahci_setup_fis(&ctp->cfis[0], request))) {
+    /* setup the FIS for this request */
+    if (!(fis_size = ata_ahci_setup_fis(ctp, request))) {
        device_printf(request->dev, "setting up SATA FIS failed\n");
        request->result = EIO;
        return ATA_OP_FINISHED;
@@ -600,7 +603,7 @@
 
     clp->prd_length = entries;
     clp->cmd_flags = (request->flags & ATA_R_WRITE ? (1<<6) : 0) |
-                    (request->flags & ATA_R_ATAPI ? (1<<5) : 0) |
+                    (request->flags & ATA_R_ATAPI ? ((1<<5) | (1<<7)) : 0) |
                     (fis_size / sizeof(u_int32_t));
     clp->bytecount = 0;
     clp->cmd_table_phys = htole64(ch->dma->work_bus + ATA_AHCI_CT_OFFSET +
@@ -609,8 +612,18 @@
     /* clear eventual ACTIVE bit */
     ATA_IDX_OUTL(ch, ATA_SACTIVE, ATA_IDX_INL(ch, ATA_SACTIVE) & (1 << tag));
 
+    /* set command type bit */
+    if (request->flags & ATA_R_ATAPI)
+       ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset,
+                ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset) |
+                ATA_AHCI_P_CMD_ATAPI);
+    else
+       ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset,
+                ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset) &
+                ~ATA_AHCI_P_CMD_ATAPI);
+
     /* issue the command */
-    ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CI + (ch->unit << 7), (1 << tag));
+    ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CI + offset, (1 << tag));
 
     /* start the timeout */
     callout_reset(&request->callout, request->timeout * hz,
@@ -626,13 +639,14 @@
     struct ata_channel *ch = device_get_softc(device_get_parent(request->dev));
     struct ata_ahci_cmd_list *clp;
     u_int32_t tf_data;
+    int offset = ((int*)(device_get_ivars(ctlr->dev)))[ch->unit] << 7;
     int tag = 0;
 
     /* kill the timeout */
     callout_stop(&request->callout);
 
     /* get status */
-    tf_data = ATA_INL(ctlr->r_res2, ATA_AHCI_P_TFD + (ch->unit << 7));
+    tf_data = ATA_INL(ctlr->r_res2, ATA_AHCI_P_TFD + offset);
     request->status = tf_data;
 
     /* if error status get details */
@@ -656,7 +670,8 @@
     struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
     struct ata_channel *ch = device_get_softc(dev);
     u_int32_t cmd;
-    int timeout, offset = (ch->unit << 7);
+    int offset = ((int*)(device_get_ivars(ctlr->dev)))[ch->unit] << 7;
+    int timeout;
 
     /* kill off all activity on this channel */
     cmd = ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset);
@@ -691,8 +706,15 @@
     /* spin up device */
     ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, ATA_AHCI_P_CMD_SUD);
 
+    /* enable interface */
     ata_sata_phy_enable(ch);
 
+    /* no ATAPI yet */
+    if (ch->devices & ATA_ATAPI_MASTER) {
+       device_printf(ch->dev, "AHCI SATA ATAPI devices not supported yet\n");
+       ch->devices = 0;
+    }
+
     /* clear any interrupts pending on this channel */
     ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IS + offset,
             ATA_INL(ctlr->r_res2, ATA_AHCI_P_IS + offset));
@@ -733,43 +755,49 @@
 }
 
 static int
-ata_ahci_setup_fis(u_int8_t *fis, struct ata_request *request)
+ata_ahci_setup_fis(struct ata_ahci_cmd_tab *ctp, struct ata_request *request)
 {
     struct ata_device *atadev = device_get_softc(request->dev);
-    int idx = 0;
 
-    /* XXX SOS add ATAPI commands support later */
-    ata_modify_if_48bit(request);
-
-    fis[idx++] = 0x27;  /* host to device */
-    fis[idx++] = 0x80;  /* command FIS (note PM goes here) */
-    fis[idx++] = request->u.ata.command;
-    fis[idx++] = request->u.ata.feature;
-
-    fis[idx++] = request->u.ata.lba;
-    fis[idx++] = request->u.ata.lba >> 8;
-    fis[idx++] = request->u.ata.lba >> 16;
-    fis[idx] = ATA_D_LBA | atadev->unit;
-    if (atadev->flags & ATA_D_48BIT_ACTIVE)
-       idx++;
-    else
-       fis[idx++] |= (request->u.ata.lba >> 24 & 0x0f);
-
-    fis[idx++] = request->u.ata.lba >> 24;
-    fis[idx++] = request->u.ata.lba >> 32; 
-    fis[idx++] = request->u.ata.lba >> 40; 
-    fis[idx++] = request->u.ata.feature >> 8;
-
-    fis[idx++] = request->u.ata.count;
-    fis[idx++] = request->u.ata.count >> 8;
-    fis[idx++] = 0x00;
-    fis[idx++] = ATA_A_4BIT;
-
-    fis[idx++] = 0x00;
-    fis[idx++] = 0x00;
-    fis[idx++] = 0x00;
-    fis[idx++] = 0x00;
-    return idx;
+    bzero(ctp->cfis, 64);
+    if (request->flags & ATA_R_ATAPI) {
+       ctp->cfis[0] = 0x27;  /* host to device */
+       ctp->cfis[1] = 0x80;  /* command FIS (note PM goes here) */
+       ctp->cfis[2] = ATA_PACKET_CMD;
+       if (request->flags & ATA_R_DMA)
+           ctp->cfis[3] = ATA_F_DMA;
+       else {
+           ctp->cfis[5] = request->transfersize;
+           ctp->cfis[6] = request->transfersize >> 8;
+       }
+       ctp->cfis[7] = ATA_D_LBA | atadev->unit;
+       ctp->cfis[15] = ATA_A_4BIT;
+       bzero(ctp->acmd, 32);
+       bcopy(request->u.atapi.ccb, ctp->acmd, 12);
+       return 20;
+    }
+    else {
+       ata_modify_if_48bit(request);
+       ctp->cfis[0] = 0x27;  /* host to device */
+       ctp->cfis[1] = 0x80;  /* command FIS (note PM goes here) */
+       ctp->cfis[2] = request->u.ata.command;
+       ctp->cfis[3] = request->u.ata.feature;
+       ctp->cfis[4] = request->u.ata.lba;
+       ctp->cfis[5] = request->u.ata.lba >> 8;
+       ctp->cfis[6] = request->u.ata.lba >> 16;
+       ctp->cfis[7] = ATA_D_LBA | atadev->unit;
+       if (!(atadev->flags & ATA_D_48BIT_ACTIVE))
+           ctp->cfis[7] |= (request->u.ata.lba >> 24 & 0x0f);
+       ctp->cfis[8] = request->u.ata.lba >> 24;
+       ctp->cfis[9] = request->u.ata.lba >> 32; 
+       ctp->cfis[10] = request->u.ata.lba >> 40; 
+       ctp->cfis[11] = request->u.ata.feature >> 8;
+       ctp->cfis[12] = request->u.ata.count;
+       ctp->cfis[13] = request->u.ata.count >> 8;
+       ctp->cfis[15] = ATA_A_4BIT;
+       return 20;
+    }
+    return 0;
 }
 
 
@@ -1740,7 +1768,7 @@
     /* SATA parts can be either compat or AHCI */
     else {
        /* force all ports active "the legacy way" */
-       pci_write_config(dev, 0x92, pci_read_config(dev, 0x92, 2) | 0x0f,2);
+       pci_write_config(dev, 0x92, pci_read_config(dev, 0x92, 2) | 0x0f, 2);
 
        ctlr->allocate = ata_intel_allocate;
        ctlr->reset = ata_intel_reset;
@@ -2886,8 +2914,7 @@
     if (ata_pci_allocate(dev))
        return ENXIO;
  
-    /* don't use 32 bit PIO transfers; these cause the NetCell to return
-     * garbage */
+    /* the NetCell only supports 16 bit PIO transfers */
     ch->flags |= ATA_USE_16BIT;
 
     return 0;

==== //depot/projects/linuxolator/src/sys/dev/ata/ata-pci.c#3 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ata/ata-pci.c,v 1.118 2007/02/03 20:12:00 rink 
Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ata/ata-pci.c,v 1.119 2007/02/17 16:56:39 sos 
Exp $");
 
 #include "opt_ata.h"
 #include <sys/param.h>
@@ -59,10 +59,14 @@
 int
 ata_legacy(device_t dev)
 {
-    return ((pci_read_config(dev, PCIR_PROGIF, 1)&PCIP_STORAGE_IDE_MASTERDEV) 
&&
-           ((pci_read_config(dev, PCIR_PROGIF, 1) &
-             (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC)) !=
-            (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC)));
+    return (((pci_read_config(dev, PCIR_PROGIF, 
1)&PCIP_STORAGE_IDE_MASTERDEV)&&
+            ((pci_read_config(dev, PCIR_PROGIF, 1) &
+              (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC)) !=
+             (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC))) ||
+           (!pci_read_config(dev, PCIR_BAR(0), 4) &&
+            !pci_read_config(dev, PCIR_BAR(1), 4) &&
+            !pci_read_config(dev, PCIR_BAR(2), 4) &&
+            !pci_read_config(dev, PCIR_BAR(3), 4)));
 }
 
 int
@@ -211,11 +215,7 @@
 
     /* attach all channels on this controller */
     for (unit = 0; unit < ctlr->channels; unit++) {
-       if (unit == 0 && (pci_get_progif(dev) & 0x81) == 0x80) {
-           device_add_child(dev, "ata", unit);
-           continue;
-       }
-       if (unit == 1 && (pci_get_progif(dev) & 0x84) == 0x80) {
+       if ((unit == 0 || unit == 1) && ata_legacy(dev)) {
            device_add_child(dev, "ata", unit);
            continue;
        }

>>> 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 114733 for review, Jung-uk Kim <=