From owner-svn-src-projects@FreeBSD.ORG Sun Aug 28 18:25:32 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 041881065673; Sun, 28 Aug 2011 18:25:32 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8AAF8FC18; Sun, 28 Aug 2011 18:25:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7SIPVpe062513; Sun, 28 Aug 2011 18:25:31 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7SIPV1c062511; Sun, 28 Aug 2011 18:25:31 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201108281825.p7SIPV1c062511@svn.freebsd.org> From: Olivier Houchard Date: Sun, 28 Aug 2011 18:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225235 - projects/armv6/sys/dev/uart X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2011 18:25:32 -0000 Author: cognet Date: Sun Aug 28 18:25:31 2011 New Revision: 225235 URL: http://svn.freebsd.org/changeset/base/225235 Log: Only set the class to quicc if the fdt says so. Submitted by: Damjan Marion Modified: projects/armv6/sys/dev/uart/uart_bus_fdt.c Modified: projects/armv6/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- projects/armv6/sys/dev/uart/uart_bus_fdt.c Sun Aug 28 18:09:17 2011 (r225234) +++ projects/armv6/sys/dev/uart/uart_bus_fdt.c Sun Aug 28 18:25:31 2011 (r225235) @@ -180,7 +180,8 @@ uart_cpu_getdev(int devtype, struct uart /* * Finalize configuration. */ - class = &uart_quicc_class; + if (fdt_is_compatible(node, "quicc")) + class = &uart_quicc_class; if (fdt_is_compatible(node, "ns16550")) class = &uart_ns8250_class; From owner-svn-src-projects@FreeBSD.ORG Sun Aug 28 19:02:45 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E82A1065676; Sun, 28 Aug 2011 19:02:45 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F0EB8FC08; Sun, 28 Aug 2011 19:02:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7SJ2jiU063581; Sun, 28 Aug 2011 19:02:45 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7SJ2j2v063579; Sun, 28 Aug 2011 19:02:45 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201108281902.p7SJ2j2v063579@svn.freebsd.org> From: Olivier Houchard Date: Sun, 28 Aug 2011 19:02:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225236 - projects/armv6/sys/dev/uart X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2011 19:02:45 -0000 Author: cognet Date: Sun Aug 28 19:02:45 2011 New Revision: 225236 URL: http://svn.freebsd.org/changeset/base/225236 Log: We want to pass the physical address to bus_space_map(), not the virtual one. Maybe as the device is already mapped, there's no need to call bus_space_map at all ? Submitted by: Damjan Marion Modified: projects/armv6/sys/dev/uart/uart_bus_fdt.c Modified: projects/armv6/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- projects/armv6/sys/dev/uart/uart_bus_fdt.c Sun Aug 28 18:25:31 2011 (r225235) +++ projects/armv6/sys/dev/uart/uart_bus_fdt.c Sun Aug 28 19:02:45 2011 (r225236) @@ -198,7 +198,7 @@ uart_cpu_getdev(int devtype, struct uart err = fdt_regsize(node, &start, &size); if (err) return (ENXIO); - start += fdt_immr_va; + start += fdt_immr_pa; return (bus_space_map(di->bas.bst, start, size, 0, &di->bas.bsh)); } From owner-svn-src-projects@FreeBSD.ORG Sun Aug 28 23:43:59 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C8F4106566B; Sun, 28 Aug 2011 23:43:59 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D1128FC16; Sun, 28 Aug 2011 23:43:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7SNhxLh071786; Sun, 28 Aug 2011 23:43:59 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7SNhxd0071783; Sun, 28 Aug 2011 23:43:59 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201108282343.p7SNhxd0071783@svn.freebsd.org> From: Olivier Houchard Date: Sun, 28 Aug 2011 23:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225238 - projects/armv6/sys/arm/arm X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2011 23:43:59 -0000 Author: cognet Date: Sun Aug 28 23:43:58 2011 New Revision: 225238 URL: http://svn.freebsd.org/changeset/base/225238 Log: Only mark the page as dirty if it was mapped writable. While I'm there, remove some dead code, the page can't be NULL. Modified: projects/armv6/sys/arm/arm/pmap-v6.c projects/armv6/sys/arm/arm/pmap.c Modified: projects/armv6/sys/arm/arm/pmap-v6.c ============================================================================== --- projects/armv6/sys/arm/arm/pmap-v6.c Sun Aug 28 19:38:04 2011 (r225237) +++ projects/armv6/sys/arm/arm/pmap-v6.c Sun Aug 28 23:43:58 2011 (r225238) @@ -2444,12 +2444,10 @@ pmap_protect(pmap_t pm, vm_offset_t sva, pmap_set_prot(ptep, prot, !(pm == pmap_kernel())); PTE_SYNC(ptep); - if (pg != NULL) { - f = pmap_modify_pv(pg, pm, sva, - PVF_WRITE, 0); + f = pmap_modify_pv(pg, pm, sva, + PVF_WRITE, 0); + if (f & PVF_WRITE) vm_page_dirty(pg); - } else - f = PVF_REF | PVF_EXEC; if (flush >= 0) { flush++; Modified: projects/armv6/sys/arm/arm/pmap.c ============================================================================== --- projects/armv6/sys/arm/arm/pmap.c Sun Aug 28 19:38:04 2011 (r225237) +++ projects/armv6/sys/arm/arm/pmap.c Sun Aug 28 23:43:58 2011 (r225238) @@ -3241,15 +3241,13 @@ pmap_protect(pmap_t pm, vm_offset_t sva, *ptep = pte; PTE_SYNC(ptep); - if (pg != NULL) { - if (!(pg->oflags & VPO_UNMANAGED)) { - f = pmap_modify_pv(pg, pm, sva, - PVF_WRITE, 0); + if (!(pg->oflags & VPO_UNMANAGED)) { + f = pmap_modify_pv(pg, pm, sva, + PVF_WRITE, 0); + if (f & PVF_WRITE) vm_page_dirty(pg); - } else - f = 0; } else - f = PVF_REF | PVF_EXEC; + f = 0; if (flush >= 0) { flush++; From owner-svn-src-projects@FreeBSD.ORG Sun Aug 28 23:56:53 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1CF91065670; Sun, 28 Aug 2011 23:56:53 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 791C88FC18; Sun, 28 Aug 2011 23:56:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7SNuruh072196; Sun, 28 Aug 2011 23:56:53 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7SNurnX072194; Sun, 28 Aug 2011 23:56:53 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201108282356.p7SNurnX072194@svn.freebsd.org> From: Olivier Houchard Date: Sun, 28 Aug 2011 23:56:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225239 - projects/armv6/sys/arm/arm X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2011 23:56:53 -0000 Author: cognet Date: Sun Aug 28 23:56:53 2011 New Revision: 225239 URL: http://svn.freebsd.org/changeset/base/225239 Log: Completely remove the #ifdef based on the minimum arch, we don't support < armv4 anyway Modified: projects/armv6/sys/arm/arm/bus_space_asm_generic.S Modified: projects/armv6/sys/arm/arm/bus_space_asm_generic.S ============================================================================== --- projects/armv6/sys/arm/arm/bus_space_asm_generic.S Sun Aug 28 23:43:58 2011 (r225238) +++ projects/armv6/sys/arm/arm/bus_space_asm_generic.S Sun Aug 28 23:56:53 2011 (r225239) @@ -51,11 +51,9 @@ ENTRY(generic_bs_r_1) ldrb r0, [r1, r2] RET -#if (ARM_ARCH_4 + ARM_ARCH_5 + ARM_ARCH_6) > 0 ENTRY(generic_armv4_bs_r_2) ldrh r0, [r1, r2] RET -#endif ENTRY(generic_bs_r_4) ldr r0, [r1, r2] @@ -69,11 +67,9 @@ ENTRY(generic_bs_w_1) strb r3, [r1, r2] RET -#if (ARM_ARCH_4 + ARM_ARCH_5 + ARM_ARCH_6) > 0 ENTRY(generic_armv4_bs_w_2) strh r3, [r1, r2] RET -#endif ENTRY(generic_bs_w_4) str r3, [r1, r2] @@ -97,7 +93,6 @@ ENTRY(generic_bs_rm_1) RET -#if (ARM_ARCH_4 + ARM_ARCH_5 + ARM_ARCH_6) > 0 ENTRY(generic_armv4_bs_rm_2) add r0, r1, r2 mov r1, r3 @@ -111,7 +106,6 @@ ENTRY(generic_armv4_bs_rm_2) bne 1b RET -#endif ENTRY(generic_bs_rm_4) add r0, r1, r2 @@ -145,7 +139,6 @@ ENTRY(generic_bs_wm_1) RET -#if (ARM_ARCH_4 + ARM_ARCH_5 + ARM_ARCH_6) > 0 ENTRY(generic_armv4_bs_wm_2) add r0, r1, r2 mov r1, r3 @@ -159,7 +152,6 @@ ENTRY(generic_armv4_bs_wm_2) bne 1b RET -#endif ENTRY(generic_bs_wm_4) add r0, r1, r2 @@ -193,7 +185,6 @@ ENTRY(generic_bs_rr_1) RET -#if (ARM_ARCH_4 + ARM_ARCH_5 + ARM_ARCH_6) > 0 ENTRY(generic_armv4_bs_rr_2) add r0, r1, r2 mov r1, r3 @@ -207,7 +198,6 @@ ENTRY(generic_armv4_bs_rr_2) bne 1b RET -#endif ENTRY(generic_bs_rr_4) add r0, r1, r2 @@ -241,7 +231,6 @@ ENTRY(generic_bs_wr_1) RET -#if (ARM_ARCH_4 + ARM_ARCH_5 + ARM_ARCH_6) > 0 ENTRY(generic_armv4_bs_wr_2) add r0, r1, r2 mov r1, r3 @@ -255,7 +244,6 @@ ENTRY(generic_armv4_bs_wr_2) bne 1b RET -#endif ENTRY(generic_bs_wr_4) add r0, r1, r2 @@ -288,7 +276,6 @@ ENTRY(generic_bs_sr_1) RET -#if (ARM_ARCH_4 + ARM_ARCH_5 + ARM_ARCH_6) > 0 ENTRY(generic_armv4_bs_sr_2) add r0, r1, r2 mov r1, r3 @@ -301,7 +288,6 @@ ENTRY(generic_armv4_bs_sr_2) bne 1b RET -#endif ENTRY(generic_bs_sr_4) add r0, r1, r2 @@ -320,7 +306,6 @@ ENTRY(generic_bs_sr_4) * copy region */ -#if (ARM_ARCH_4 + ARM_ARCH_5 + ARM_ARCH_6) > 0 ENTRY(generic_armv4_bs_c_2) add r0, r1, r2 ldr r2, [sp, #0] @@ -350,4 +335,3 @@ ENTRY(generic_armv4_bs_c_2) bne 3b RET -#endif From owner-svn-src-projects@FreeBSD.ORG Mon Aug 29 16:24:59 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B22E1065670; Mon, 29 Aug 2011 16:24:59 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 483268FC08; Mon, 29 Aug 2011 16:24:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7TGOxHb004059; Mon, 29 Aug 2011 16:24:59 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7TGOw5j004040; Mon, 29 Aug 2011 16:24:58 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201108291624.p7TGOw5j004040@svn.freebsd.org> From: Matthew D Fleming Date: Mon, 29 Aug 2011 16:24:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225247 - in projects/ino64/sys: compat/svr4 fs/cd9660 fs/ext2fs fs/hpfs fs/ntfs fs/tmpfs kern security/mac_lomac ufs/ffs ufs/ufs X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2011 16:24:59 -0000 Author: mdf Date: Mon Aug 29 16:24:58 2011 New Revision: 225247 URL: http://svn.freebsd.org/changeset/base/225247 Log: sys: Change ino_t printf format flag to %ju. GSoC r222840. Code by Gleb Kurtsou. Modified: projects/ino64/sys/compat/svr4/svr4_socket.c projects/ino64/sys/fs/cd9660/cd9660_vnops.c projects/ino64/sys/fs/ext2fs/ext2_alloc.c projects/ino64/sys/fs/ext2fs/ext2_inode_cnv.c projects/ino64/sys/fs/hpfs/hpfs_vfsops.c projects/ino64/sys/fs/ntfs/ntfs.h projects/ino64/sys/fs/ntfs/ntfs_subr.c projects/ino64/sys/fs/ntfs/ntfs_vfsops.c projects/ino64/sys/fs/ntfs/ntfs_vnops.c projects/ino64/sys/fs/tmpfs/tmpfs_vfsops.c projects/ino64/sys/kern/uipc_usrreq.c projects/ino64/sys/security/mac_lomac/mac_lomac.c projects/ino64/sys/ufs/ffs/ffs_alloc.c projects/ino64/sys/ufs/ffs/ffs_snapshot.c projects/ino64/sys/ufs/ffs/ffs_softdep.c projects/ino64/sys/ufs/ufs/ufs_acl.c projects/ino64/sys/ufs/ufs/ufs_lookup.c projects/ino64/sys/ufs/ufs/ufs_vnops.c Modified: projects/ino64/sys/compat/svr4/svr4_socket.c ============================================================================== --- projects/ino64/sys/compat/svr4/svr4_socket.c Mon Aug 29 15:51:12 2011 (r225246) +++ projects/ino64/sys/compat/svr4/svr4_socket.c Mon Aug 29 16:24:58 2011 (r225247) @@ -93,7 +93,7 @@ svr4_find_socket(td, fp, dev, ino, saun) struct svr4_sockcache_entry *e; void *cookie = ((struct socket *)fp->f_data)->so_emuldata; - DPRINTF(("svr4_find_socket: [%p,%d,%d]: ", td, dev, ino)); + DPRINTF(("svr4_find_socket: [%p,%d,%ju]: ", td, dev, (uintmax_t)ino)); mtx_lock(&svr4_sockcache_lock); TAILQ_FOREACH(e, &svr4_head, entries) if (e->p == td->td_proc && e->dev == dev && e->ino == ino) { @@ -142,8 +142,8 @@ svr4_add_socket(td, path, st) mtx_lock(&svr4_sockcache_lock); TAILQ_INSERT_HEAD(&svr4_head, e, entries); mtx_unlock(&svr4_sockcache_lock); - DPRINTF(("svr4_add_socket: %s [%p,%d,%d]\n", e->sock.sun_path, - td->td_proc, e->dev, e->ino)); + DPRINTF(("svr4_add_socket: %s [%p,%d,%ju]\n", e->sock.sun_path, + td->td_proc, e->dev, (uintmax_t)e->ino)); return 0; } @@ -160,8 +160,8 @@ svr4_delete_socket(p, fp) if (e->p == p && e->cookie == cookie) { TAILQ_REMOVE(&svr4_head, e, entries); mtx_unlock(&svr4_sockcache_lock); - DPRINTF(("svr4_delete_socket: %s [%p,%d,%d]\n", - e->sock.sun_path, p, (int)e->dev, e->ino)); + DPRINTF(("svr4_delete_socket: %s [%p,%d,%ju]\n", + e->sock.sun_path, p, e->dev, (uintmax_t)e->ino)); free(e, M_TEMP); return; } @@ -179,8 +179,8 @@ svr4_purge_sockcache(arg, p) TAILQ_FOREACH_SAFE(e, &svr4_head, entries, ne) { if (e->p == p) { TAILQ_REMOVE(&svr4_head, e, entries); - DPRINTF(("svr4_purge_sockcache: %s [%p,%d,%d]\n", - e->sock.sun_path, p, (int)e->dev, e->ino)); + DPRINTF(("svr4_purge_sockcache: %s [%p,%d,%ju]\n", + e->sock.sun_path, p, e->dev, (uintmax_t)e->ino)); free(e, M_TEMP); } } Modified: projects/ino64/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- projects/ino64/sys/fs/cd9660/cd9660_vnops.c Mon Aug 29 15:51:12 2011 (r225246) +++ projects/ino64/sys/fs/cd9660/cd9660_vnops.c Mon Aug 29 16:24:58 2011 (r225247) @@ -475,6 +475,7 @@ cd9660_readdir(ap) struct iso_mnt *imp; struct buf *bp = NULL; struct iso_directory_record *ep; + ino_t rripino; int entryoffsetinblock; doff_t endsearch; u_long bmask; @@ -579,7 +580,8 @@ cd9660_readdir(ap) switch (imp->iso_ftype) { case ISO_FTYPE_RRIP: cd9660_rrip_getname(ep,idp->current.d_name, &namelen, - &idp->current.d_fileno,imp); + &rripino, imp); + idp->current.d_fileno = rripino; idp->current.d_namlen = (u_char)namelen; if (idp->current.d_namlen) error = iso_uiodir(idp,&idp->current,idp->curroff); Modified: projects/ino64/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- projects/ino64/sys/fs/ext2fs/ext2_alloc.c Mon Aug 29 15:51:12 2011 (r225246) +++ projects/ino64/sys/fs/ext2fs/ext2_alloc.c Mon Aug 29 16:24:58 2011 (r225247) @@ -906,8 +906,8 @@ ext2_vfree(pvp, ino, mode) fs = pip->i_e2fs; ump = pip->i_ump; if ((u_int)ino > fs->e2fs_ipg * fs->e2fs_gcount) - panic("ext2_vfree: range: devvp = %p, ino = %d, fs = %s", - pip->i_devvp, ino, fs->e2fs_fsmnt); + panic("ext2_vfree: range: devvp = %p, ino = %ju, fs = %s", + pip->i_devvp, (uintmax_t)ino, fs->e2fs_fsmnt); cg = ino_to_cg(fs, ino); error = bread(pip->i_devvp, Modified: projects/ino64/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- projects/ino64/sys/fs/ext2fs/ext2_inode_cnv.c Mon Aug 29 15:51:12 2011 (r225246) +++ projects/ino64/sys/fs/ext2fs/ext2_inode_cnv.c Mon Aug 29 16:24:58 2011 (r225247) @@ -42,7 +42,7 @@ ext2_print_inode( in ) { int i; - printf( "Inode: %5d", in->i_number); + printf( "Inode: %5ju", (uintmax_t)in->i_number); printf( /* "Inode: %5d" */ " Type: %10s Mode: 0x%o Flags: 0x%x Version: %d\n", "n/a", in->i_mode, in->i_flags, in->i_gen); Modified: projects/ino64/sys/fs/hpfs/hpfs_vfsops.c ============================================================================== --- projects/ino64/sys/fs/hpfs/hpfs_vfsops.c Mon Aug 29 15:51:12 2011 (r225246) +++ projects/ino64/sys/fs/hpfs/hpfs_vfsops.c Mon Aug 29 16:24:58 2011 (r225247) @@ -512,7 +512,7 @@ hpfs_vget( error = bread(hpmp->hpm_devvp, ino, FNODESIZE, NOCRED, &bp); if (error) { - printf("hpfs_vget: can't read ino %d\n",ino); + printf("hpfs_vget: can't read ino %ju\n", (uintmax_t)ino); vput(vp); return (error); } Modified: projects/ino64/sys/fs/ntfs/ntfs.h ============================================================================== --- projects/ino64/sys/fs/ntfs/ntfs.h Mon Aug 29 15:51:12 2011 (r225246) +++ projects/ino64/sys/fs/ntfs/ntfs.h Mon Aug 29 16:24:58 2011 (r225247) @@ -28,7 +28,7 @@ * $FreeBSD$ */ -/*#define NTFS_DEBUG 1*/ +#define NTFS_DEBUG 2/*XXX don't commit me*/ typedef u_int64_t cn_t; typedef u_int16_t wchar; Modified: projects/ino64/sys/fs/ntfs/ntfs_subr.c ============================================================================== --- projects/ino64/sys/fs/ntfs/ntfs_subr.c Mon Aug 29 15:51:12 2011 (r225246) +++ projects/ino64/sys/fs/ntfs/ntfs_subr.c Mon Aug 29 16:24:58 2011 (r225247) @@ -82,8 +82,8 @@ int ntfs_ntvattrrele(vap) struct ntvattr * vap; { - dprintf(("ntfs_ntvattrrele: ino: %d, type: 0x%x\n", - vap->va_ip->i_number, vap->va_type)); + dprintf(("ntfs_ntvattrrele: ino: %ju, type: 0x%x\n", + (uintmax_t)vap->va_ip->i_number, vap->va_type)); ntfs_ntrele(vap->va_ip); @@ -107,12 +107,12 @@ ntfs_findvattr(ntmp, ip, lvapp, vapp, ty struct ntvattr *vap; if((ip->i_flag & IN_LOADED) == 0) { - dprintf(("ntfs_findvattr: node not loaded, ino: %d\n", - ip->i_number)); + dprintf(("ntfs_findvattr: node not loaded, ino: %ju\n", + (uintmax_t)ip->i_number)); error = ntfs_loadntnode(ntmp,ip); if (error) { - printf("ntfs_findvattr: FAILED TO LOAD INO: %d\n", - ip->i_number); + printf("ntfs_findvattr: FAILED TO LOAD INO: %ju\n", + (uintmax_t)ip->i_number); return (error); } } @@ -167,13 +167,13 @@ ntfs_ntvattrget( if (name) { dprintf(("ntfs_ntvattrget: " \ - "ino: %d, type: 0x%x, name: %s, vcn: %d\n", \ - ip->i_number, type, name, (u_int32_t) vcn)); + "ino: %ju, type: 0x%x, name: %s, vcn: %d\n", \ + (uintmax_t)ip->i_number, type, name, (u_int32_t) vcn)); namelen = strlen(name); } else { dprintf(("ntfs_ntvattrget: " \ - "ino: %d, type: 0x%x, vcn: %d\n", \ - ip->i_number, type, (u_int32_t) vcn)); + "ino: %ju, type: 0x%x, vcn: %d\n", \ + (uintmax_t)ip->i_number, type, (u_int32_t) vcn)); name = ""; namelen = 0; } @@ -184,8 +184,8 @@ ntfs_ntvattrget( if (!lvap) { dprintf(("ntfs_ntvattrget: UNEXISTED ATTRIBUTE: " \ - "ino: %d, type: 0x%x, name: %s, vcn: %d\n", \ - ip->i_number, type, name, (u_int32_t) vcn)); + "ino: %ju, type: 0x%x, name: %s, vcn: %d\n", \ + (uintmax_t)ip->i_number, type, name, (u_int32_t) vcn)); return (ENOENT); } /* Scan $ATTRIBUTE_LIST for requested attribute */ @@ -243,8 +243,9 @@ ntfs_ntvattrget( error = ENOENT; dprintf(("ntfs_ntvattrget: UNEXISTED ATTRIBUTE: " \ - "ino: %d, type: 0x%x, name: %.*s, vcn: %d\n", \ - ip->i_number, type, (int) namelen, name, (u_int32_t) vcn)); + "ino: %ju, type: 0x%x, name: %.*s, vcn: %d\n", \ + (uintmax_t)ip->i_number, type, (int)namelen, name, + (uint32_t)vcn)); out: free(alpool, M_TEMP); return (error); @@ -266,7 +267,8 @@ ntfs_loadntnode( struct attr *ap; struct ntvattr *nvap; - dprintf(("ntfs_loadntnode: loading ino: %d\n",ip->i_number)); + dprintf(("ntfs_loadntnode: loading ino: %ju\n", + (uintmax_t)ip->i_number)); mfrp = malloc(ntfs_bntob(ntmp->ntm_bpmftrec), M_TEMP, M_WAITOK); @@ -307,12 +309,13 @@ ntfs_loadntnode( error = ntfs_procfixups(ntmp, NTFS_FILEMAGIC, (caddr_t)mfrp, ntfs_bntob(ntmp->ntm_bpmftrec)); if (error) { - printf("ntfs_loadntnode: BAD MFT RECORD %d\n", - (u_int32_t) ip->i_number); + printf("ntfs_loadntnode: BAD MFT RECORD %ju\n", + (uintmax_t)ip->i_number); goto out; } - dprintf(("ntfs_loadntnode: load attrs for ino: %d\n",ip->i_number)); + dprintf(("ntfs_loadntnode: load attrs for ino: %ju\n", + (uintmax_t)ip->i_number)); off = mfrp->fr_attroff; ap = (struct attr *) ((caddr_t)mfrp + off); @@ -330,8 +333,8 @@ ntfs_loadntnode( ap = (struct attr *) ((caddr_t)mfrp + off); } if (error) { - printf("ntfs_loadntnode: failed to load attr ino: %d\n", - ip->i_number); + printf("ntfs_loadntnode: failed to load attr ino: %ju\n", + (uintmax_t)ip->i_number); goto out; } @@ -354,8 +357,8 @@ int ntfs_ntget(ip) struct ntnode *ip; { - dprintf(("ntfs_ntget: get ntnode %d: %p, usecount: %d\n", - ip->i_number, ip, ip->i_usecount)); + dprintf(("ntfs_ntget: get ntnode %ju: %p, usecount: %d\n", + (uintmax_t)ip->i_number, ip, ip->i_usecount)); mtx_lock(&ip->i_interlock); ip->i_usecount++; @@ -379,14 +382,14 @@ ntfs_ntlookup( { struct ntnode *ip; - dprintf(("ntfs_ntlookup: looking for ntnode %d\n", ino)); + dprintf(("ntfs_ntlookup: looking for ntnode %ju\n", (uintmax_t)ino)); do { ip = ntfs_nthashlookup(ntmp->ntm_devvp->v_rdev, ino); if (ip != NULL) { ntfs_ntget(ip); - dprintf(("ntfs_ntlookup: ntnode %d: %p, usecount: %d\n", - ino, ip, ip->i_usecount)); + dprintf(("ntfs_ntlookup: ntnode %ju: %p, usecount: %d\n", + (uintmax_t)ino, ip, ip->i_usecount)); *ipp = ip; return (0); } @@ -394,7 +397,8 @@ ntfs_ntlookup( ip = malloc(sizeof(struct ntnode), M_NTFSNTNODE, M_WAITOK | M_ZERO); - ddprintf(("ntfs_ntlookup: allocating ntnode: %d: %p\n", ino, ip)); + ddprintf(("ntfs_ntlookup: allocating ntnode: %ju: %p\n", + (uintmax_t)ino, ip)); /* Generic initialization */ ip->i_devvp = ntmp->ntm_devvp; @@ -416,8 +420,8 @@ ntfs_ntlookup( *ipp = ip; - dprintf(("ntfs_ntlookup: ntnode %d: %p, usecount: %d\n", - ino, ip, ip->i_usecount)); + dprintf(("ntfs_ntlookup: ntnode %ju: %p, usecount: %d\n", + (uintmax_t)ino, ip, ip->i_usecount)); return (0); } @@ -434,16 +438,16 @@ ntfs_ntput(ip) { struct ntvattr *vap; - dprintf(("ntfs_ntput: rele ntnode %d: %p, usecount: %d\n", - ip->i_number, ip, ip->i_usecount)); + dprintf(("ntfs_ntput: rele ntnode %ju: %p, usecount: %d\n", + (uintmax_t)ip->i_number, ip, ip->i_usecount)); mtx_lock(&ip->i_interlock); ip->i_usecount--; #ifdef DIAGNOSTIC if (ip->i_usecount < 0) { - panic("ntfs_ntput: ino: %d usecount: %d \n", - ip->i_number,ip->i_usecount); + panic("ntfs_ntput: ino: %ju usecount: %d", + (uintmax_t)ip->i_number, ip->i_usecount); } #endif @@ -452,7 +456,8 @@ ntfs_ntput(ip) return; } - dprintf(("ntfs_ntput: deallocating ntnode: %d\n", ip->i_number)); + dprintf(("ntfs_ntput: deallocating ntnode: %ju\n", + (uintmax_t)ip->i_number)); if (LIST_FIRST(&ip->i_fnlist)) panic("ntfs_ntput: ntnode has fnodes\n"); @@ -481,8 +486,8 @@ ntfs_ntref(ip) ip->i_usecount++; mtx_unlock(&ip->i_interlock); - dprintf(("ntfs_ntref: ino %d, usecount: %d\n", - ip->i_number, ip->i_usecount)); + dprintf(("ntfs_ntref: ino %ju, usecount: %d\n", + (uintmax_t)ip->i_number, ip->i_usecount)); } @@ -493,15 +498,15 @@ void ntfs_ntrele(ip) struct ntnode *ip; { - dprintf(("ntfs_ntrele: rele ntnode %d: %p, usecount: %d\n", - ip->i_number, ip, ip->i_usecount)); + dprintf(("ntfs_ntrele: rele ntnode %ju: %p, usecount: %d\n", + (uintmax_t)ip->i_number, ip, ip->i_usecount)); mtx_lock(&ip->i_interlock); ip->i_usecount--; if (ip->i_usecount < 0) - panic("ntfs_ntrele: ino: %d usecount: %d \n", - ip->i_number,ip->i_usecount); + panic("ntfs_ntrele: ino: %ju usecount: %d \n", + (uintmax_t)ip->i_number, ip->i_usecount); mtx_unlock(&ip->i_interlock); } @@ -582,7 +587,7 @@ ntfs_attrtontvattr( memcpy(vap->va_datap, (caddr_t) rap + rap->a_r.a_dataoff, rap->a_r.a_datalen); } - ddprintf((", len: %lld", vap->va_datalen)); + ddprintf((", len: %ju", (uintmax_t)vap->va_datalen)); if (error) free(vap, M_NTFSNTVATTR); @@ -751,8 +756,8 @@ ntfs_fget( { struct fnode *fp; - dprintf(("ntfs_fget: ino: %d, attrtype: 0x%x, attrname: %s\n", - ip->i_number,attrtype, attrname?attrname:"")); + dprintf(("ntfs_fget: ino: %ju, attrtype: 0x%x, attrname: %s\n", + (uintmax_t)ip->i_number, attrtype, attrname?attrname:"")); *fpp = NULL; LIST_FOREACH(fp, &ip->i_fnlist, f_fnlist){ dprintf(("ntfs_fget: fnode: attrtype: %d, attrname: %s\n", @@ -803,7 +808,8 @@ ntfs_frele( { struct ntnode *ip = FTONT(fp); - dprintf(("ntfs_frele: fnode: %p for %d: %p\n", fp, ip->i_number, ip)); + dprintf(("ntfs_frele: fnode: %p for %ju: %p\n", fp, + (uintmax_t)ip->i_number, ip)); dprintf(("ntfs_frele: deallocating fnode\n")); LIST_REMOVE(fp,f_fnlist); @@ -1133,7 +1139,8 @@ ntfs_ntreaddir( int error = ENOENT; u_int32_t aoff, cnum; - dprintf(("ntfs_ntreaddir: read ino: %d, num: %d\n", ip->i_number, num)); + dprintf(("ntfs_ntreaddir: read ino: %ju, num: %d\n", + (uintmax_t)ip->i_number, num)); error = ntfs_ntget(ip); if (error) return (error); @@ -1301,7 +1308,7 @@ ntfs_times( struct ntvattr *vap; int error; - dprintf(("ntfs_times: ino: %d...\n", ip->i_number)); + dprintf(("ntfs_times: ino: %ju...\n", (uintmax_t)ip->i_number)); error = ntfs_ntget(ip); if (error) @@ -1336,7 +1343,7 @@ ntfs_filesize( u_int64_t sz, bn; int error; - dprintf(("ntfs_filesize: ino: %d\n", ip->i_number)); + dprintf(("ntfs_filesize: ino: %ju\n", (uintmax_t)ip->i_number)); error = ntfs_ntvattrget(ntmp, ip, fp->f_attrtype, fp->f_attrname, 0, &vap); @@ -1737,8 +1744,8 @@ ntfs_readattr( struct ntvattr *vap; size_t init; - ddprintf(("ntfs_readattr: reading %d: 0x%x, from %d size %d bytes\n", - ip->i_number, attrnum, (u_int32_t) roff, (u_int32_t) rsize)); + ddprintf(("ntfs_readattr: reading %ju: 0x%x, from %jd size %zd bytes\n", + (uintmax_t)ip->i_number, attrnum, (intmax_t)roff, rsize)); error = ntfs_ntvattrget(ntmp, ip, attrnum, attrname, 0, &vap); if (error) Modified: projects/ino64/sys/fs/ntfs/ntfs_vfsops.c ============================================================================== --- projects/ino64/sys/fs/ntfs/ntfs_vfsops.c Mon Aug 29 15:51:12 2011 (r225246) +++ projects/ino64/sys/fs/ntfs/ntfs_vfsops.c Mon Aug 29 16:24:58 2011 (r225247) @@ -623,7 +623,7 @@ ntfs_fhtovp( struct ntfid *ntfhp = (struct ntfid *)fhp; int error; - ddprintf(("ntfs_fhtovp(): %d\n", ntfhp->ntfid_ino)); + ddprintf(("ntfs_fhtovp(): %ju\n", (uintmax_t)ntfhp->ntfid_ino)); if ((error = VFS_VGET(mp, ntfhp->ntfid_ino, LK_EXCLUSIVE, &nvp)) != 0) { *vpp = NULLVP; @@ -654,8 +654,8 @@ ntfs_vgetex( struct vnode *vp; enum vtype f_type; - dprintf(("ntfs_vgetex: ino: %d, attr: 0x%x:%s, lkf: 0x%lx, f: 0x%lx\n", - ino, attrtype, attrname?attrname:"", (u_long)lkflags, + dprintf(("ntfs_vgetex: ino: %ju, attr: 0x%x:%s, lkf: 0x%lx, f: 0x%lx\n", + (uintmax_t)ino, attrtype, attrname?attrname:"", (u_long)lkflags, (u_long)flags)); ntmp = VFSTONTFS(mp); @@ -672,8 +672,8 @@ ntfs_vgetex( if (!(flags & VG_DONTLOADIN) && !(ip->i_flag & IN_LOADED)) { error = ntfs_loadntnode(ntmp, ip); if(error) { - printf("ntfs_vget: CAN'T LOAD ATTRIBUTES FOR INO: %d\n", - ip->i_number); + printf("ntfs_vget: CAN'T LOAD ATTRIBUTES FOR INO: %ju\n", + (uintmax_t)ip->i_number); ntfs_ntput(ip); return (error); } @@ -728,7 +728,7 @@ ntfs_vgetex( ntfs_ntput(ip); return (error); } - dprintf(("ntfs_vget: vnode: %p for ntnode: %d\n", vp,ino)); + dprintf(("ntfs_vget: vnode: %p for ntnode: %ju\n", vp, (uintmax_t)ino)); fp->f_vp = vp; vp->v_data = fp; Modified: projects/ino64/sys/fs/ntfs/ntfs_vnops.c ============================================================================== --- projects/ino64/sys/fs/ntfs/ntfs_vnops.c Mon Aug 29 15:51:12 2011 (r225246) +++ projects/ino64/sys/fs/ntfs/ntfs_vnops.c Mon Aug 29 16:24:58 2011 (r225247) @@ -129,7 +129,9 @@ ntfs_read(ap) int resid, off, toread; int error; - dprintf(("ntfs_read: ino: %d, off: %d resid: %d, segflg: %d\n",ip->i_number,(u_int32_t)uio->uio_offset,uio->uio_resid,uio->uio_segflg)); + dprintf(("ntfs_read: ino: %ju, off: %jd resid: %zd, segflg: %d\n", + (uintmax_t)ip->i_number, (intmax_t)uio->uio_offset, + uio->uio_resid,uio->uio_segflg)); dprintf(("ntfs_read: filesize: %d",(u_int32_t)fp->f_size)); @@ -181,7 +183,8 @@ ntfs_getattr(ap) register struct ntnode *ip = FTONT(fp); register struct vattr *vap = ap->a_vap; - dprintf(("ntfs_getattr: %d, flags: %d\n",ip->i_number,ip->i_flag)); + dprintf(("ntfs_getattr: %ju, flags: %d\n", + (uintmax_t)ip->i_number, ip->i_flag)); vap->va_fsid = dev2udev(ip->i_dev); vap->va_fileid = ip->i_number; @@ -216,8 +219,8 @@ ntfs_inactive(ap) register struct ntnode *ip = VTONT(ap->a_vp); #endif - dprintf(("ntfs_inactive: vnode: %p, ntnode: %d\n", ap->a_vp, - ip->i_number)); + dprintf(("ntfs_inactive: vnode: %p, ntnode: %ju\n", ap->a_vp, + (uintmax_t)ip->i_number)); /* XXX since we don't support any filesystem changes * right now, nothing more needs to be done @@ -239,7 +242,8 @@ ntfs_reclaim(ap) register struct ntnode *ip = FTONT(fp); int error; - dprintf(("ntfs_reclaim: vnode: %p, ntnode: %d\n", vp, ip->i_number)); + dprintf(("ntfs_reclaim: vnode: %p, ntnode: %ju\n", vp, + (uintmax_t)ip->i_number)); /* * Destroy the vm object and flush associated pages. @@ -352,7 +356,9 @@ ntfs_write(ap) size_t written; int error; - dprintf(("ntfs_write: ino: %d, off: %d resid: %d, segflg: %d\n",ip->i_number,(u_int32_t)uio->uio_offset,uio->uio_resid,uio->uio_segflg)); + dprintf(("ntfs_write: ino: %ju, off: %jd resid: %zd, segflg: %d\n", + (uintmax_t)ip->i_number, (intmax_t)uio->uio_offset, + uio->uio_resid,uio->uio_segflg)); dprintf(("ntfs_write: filesize: %d",(u_int32_t)fp->f_size)); if (uio->uio_resid + uio->uio_offset > fp->f_size) { @@ -387,7 +393,7 @@ ntfs_access(ap) struct ntnode *ip = VTONT(vp); accmode_t accmode = ap->a_accmode; - dprintf(("ntfs_access: %d\n",ip->i_number)); + dprintf(("ntfs_access: %ju\n", (uintmax_t)ip->i_number)); /* * Disallow write attempts on read-only filesystems; @@ -428,7 +434,7 @@ ntfs_open(ap) register struct vnode *vp = ap->a_vp; register struct ntnode *ip = VTONT(vp); - printf("ntfs_open: %d\n",ip->i_number); + printf("ntfs_open: %ju\n", (uintmax_t)ip->i_number); #endif vnode_create_vobject(ap->a_vp, VTOF(ap->a_vp)->f_size, ap->a_td); @@ -459,7 +465,7 @@ ntfs_close(ap) register struct vnode *vp = ap->a_vp; register struct ntnode *ip = VTONT(vp); - printf("ntfs_close: %d\n",ip->i_number); + printf("ntfs_close: %ju\n", (uintmax_t)ip->i_number); #endif return (0); @@ -487,7 +493,9 @@ ntfs_readdir(ap) struct dirent cde; off_t off; - dprintf(("ntfs_readdir %d off: %d resid: %d\n",ip->i_number,(u_int32_t)uio->uio_offset,uio->uio_resid)); + dprintf(("ntfs_readdir %ju off: %jd resid: %zd\n", + (uintmax_t)ip->i_number, (intmax_t)uio->uio_offset, + uio->uio_resid)); off = uio->uio_offset; @@ -573,10 +581,10 @@ ntfs_readdir(ap) } } - dprintf(("ntfs_readdir: %d entries (%d bytes) read\n", - ncookies,(u_int)(uio->uio_offset - off))); - dprintf(("ntfs_readdir: off: %d resid: %d\n", - (u_int32_t)uio->uio_offset,uio->uio_resid)); + dprintf(("ntfs_readdir: %d entries (%jd bytes) read\n", + ncookies, (intmax_t)(uio->uio_offset - off))); + dprintf(("ntfs_readdir: off: %jd resid: %zd\n", + (intmax_t)uio->uio_offset, uio->uio_resid)); if (!error && ap->a_ncookies != NULL) { struct dirent* dpStart; @@ -622,9 +630,9 @@ ntfs_lookup(ap) struct componentname *cnp = ap->a_cnp; struct ucred *cred = cnp->cn_cred; int error; - dprintf(("ntfs_lookup: \"%.*s\" (%ld bytes) in %d\n", + dprintf(("ntfs_lookup: \"%.*s\" (%ld bytes) in %ju\n", (int)cnp->cn_namelen, cnp->cn_nameptr, cnp->cn_namelen, - dip->i_number)); + (uintmax_t)dip->i_number)); error = VOP_ACCESS(dvp, VEXEC, cred, cnp->cn_thread); if(error) @@ -636,8 +644,8 @@ ntfs_lookup(ap) return (EROFS); if(cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') { - dprintf(("ntfs_lookup: faking . directory in %d\n", - dip->i_number)); + dprintf(("ntfs_lookup: faking . directory in %ju\n", + (uintmax_t)dip->i_number)); VREF(dvp); *ap->a_vpp = dvp; @@ -645,8 +653,8 @@ ntfs_lookup(ap) } else if (cnp->cn_flags & ISDOTDOT) { struct ntvattr *vap; - dprintf(("ntfs_lookup: faking .. directory in %d\n", - dip->i_number)); + dprintf(("ntfs_lookup: faking .. directory in %ju\n", + (uintmax_t)dip->i_number)); error = ntfs_ntvattrget(ntmp, dip, NTFS_A_NAME, NULL, 0, &vap); if(error) @@ -669,8 +677,8 @@ ntfs_lookup(ap) return (error); } - dprintf(("ntfs_lookup: found ino: %d\n", - VTONT(*ap->a_vpp)->i_number)); + dprintf(("ntfs_lookup: found ino: %ju\n", + (uintmax_t)VTONT(*ap->a_vpp)->i_number)); } if (cnp->cn_flags & MAKEENTRY) Modified: projects/ino64/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- projects/ino64/sys/fs/tmpfs/tmpfs_vfsops.c Mon Aug 29 15:51:12 2011 (r225246) +++ projects/ino64/sys/fs/tmpfs/tmpfs_vfsops.c Mon Aug 29 16:24:58 2011 (r225247) @@ -241,7 +241,8 @@ tmpfs_mount(struct mount *mp) free(tmp, M_TMPFSMNT); return error; } - KASSERT(root->tn_id == 2, ("tmpfs root with invalid ino: %d", root->tn_id)); + KASSERT(root->tn_id == 2, + ("tmpfs root with invalid ino: %ju", (uintmax_t)root->tn_id)); tmp->tm_root = root; MNT_ILOCK(mp); Modified: projects/ino64/sys/kern/uipc_usrreq.c ============================================================================== --- projects/ino64/sys/kern/uipc_usrreq.c Mon Aug 29 15:51:12 2011 (r225246) +++ projects/ino64/sys/kern/uipc_usrreq.c Mon Aug 29 16:24:58 2011 (r225247) @@ -2387,7 +2387,7 @@ DB_SHOW_COMMAND(unpcb, db_show_unpcb) db_printf("unp_socket: %p unp_vnode: %p\n", unp->unp_socket, unp->unp_vnode); - db_printf("unp_ino: %d unp_conn: %p\n", unp->unp_ino, + db_printf("unp_ino: %ju unp_conn: %p\n", (uintmax_t)unp->unp_ino, unp->unp_conn); db_printf("unp_refs:\n"); Modified: projects/ino64/sys/security/mac_lomac/mac_lomac.c ============================================================================== --- projects/ino64/sys/security/mac_lomac/mac_lomac.c Mon Aug 29 15:51:12 2011 (r225246) +++ projects/ino64/sys/security/mac_lomac/mac_lomac.c Mon Aug 29 16:24:58 2011 (r225247) @@ -565,11 +565,11 @@ maybe_demote(struct mac_lomac *subjlabel pgid = p->p_pgrp->pg_id; /* XXX could be stale? */ if (vp != NULL && VOP_GETATTR(vp, &va, curthread->td_ucred) == 0) { log(LOG_INFO, "LOMAC: level-%s subject p%dg%du%d:%s demoted to" - " level %s after %s a level-%s %s (inode=%ld, " + " level %s after %s a level-%s %s (inode=%jd, " "mountpount=%s)\n", subjlabeltext, p->p_pid, pgid, curthread->td_ucred->cr_uid, p->p_comm, subjtext, actionname, objlabeltext, objname, - va.va_fileid, vp->v_mount->mnt_stat.f_mntonname); + (uintmax_t)va.va_fileid, vp->v_mount->mnt_stat.f_mntonname); } else { log(LOG_INFO, "LOMAC: level-%s subject p%dg%du%d:%s demoted to" " level %s after %s a level-%s %s\n", Modified: projects/ino64/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- projects/ino64/sys/ufs/ffs/ffs_alloc.c Mon Aug 29 15:51:12 2011 (r225246) +++ projects/ino64/sys/ufs/ffs/ffs_alloc.c Mon Aug 29 16:24:58 2011 (r225247) @@ -598,7 +598,8 @@ ffs_reallocblks_ufs1(ap) */ #ifdef DEBUG if (prtrealloc) - printf("realloc: ino %d, lbns %jd-%jd\n\told:", ip->i_number, + printf("realloc: ino %ju, lbns %jd-%jd\n\told:", + (uintmax_t)ip->i_number, (intmax_t)start_lbn, (intmax_t)end_lbn); #endif blkno = newblk; @@ -806,7 +807,8 @@ ffs_reallocblks_ufs2(ap) */ #ifdef DEBUG if (prtrealloc) - printf("realloc: ino %d, lbns %jd-%jd\n\told:", ip->i_number, + printf("realloc: ino %ju, lbns %jd-%jd\n\told:", + (uintmax_t)ip->i_number, (intmax_t)start_lbn, (intmax_t)end_lbn); #endif blkno = newblk; @@ -2182,8 +2184,8 @@ ffs_freefile(ump, fs, devvp, ino, mode, cgbno = fsbtodb(fs, cgtod(fs, cg)); } if (ino >= fs->fs_ipg * fs->fs_ncg) - panic("ffs_freefile: range: dev = %s, ino = %lu, fs = %s", - devtoname(dev), (u_long)ino, fs->fs_fsmnt); + panic("ffs_freefile: range: dev = %s, ino = %ju, fs = %s", + devtoname(dev), (uintmax_t)ino, fs->fs_fsmnt); if ((error = bread(devvp, cgbno, (int)fs->fs_cgsize, NOCRED, &bp))) { brelse(bp); return (error); @@ -2198,8 +2200,8 @@ ffs_freefile(ump, fs, devvp, ino, mode, inosused = cg_inosused(cgp); ino %= fs->fs_ipg; if (isclr(inosused, ino)) { - printf("dev = %s, ino = %u, fs = %s\n", devtoname(dev), - ino + cg * fs->fs_ipg, fs->fs_fsmnt); + printf("dev = %s, ino = %ju, fs = %s\n", devtoname(dev), + (uintmax_t)ino + cg * fs->fs_ipg, fs->fs_fsmnt); if (fs->fs_ronly == 0) panic("ffs_freefile: freeing free inode"); } @@ -2349,8 +2351,9 @@ ffs_fserr(fs, inum, cp) struct thread *td = curthread; /* XXX */ struct proc *p = td->td_proc; - log(LOG_ERR, "pid %d (%s), uid %d inumber %d on %s: %s\n", - p->p_pid, p->p_comm, td->td_ucred->cr_uid, inum, fs->fs_fsmnt, cp); + log(LOG_ERR, "pid %d (%s), uid %d inumber %ju on %s: %s\n", + p->p_pid, p->p_comm, td->td_ucred->cr_uid, (uintmax_t)inum, + fs->fs_fsmnt, cp); } /* @@ -2562,16 +2565,16 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) #ifdef DEBUG if (fsckcmds) { if (cmd.size == 1) - printf("%s: free %s inode %d\n", + printf("%s: free %s inode %ju\n", mp->mnt_stat.f_mntonname, filetype == IFDIR ? "directory" : "file", - (ino_t)cmd.value); + (uintmax_t)cmd.value); else - printf("%s: free %s inodes %d-%d\n", + printf("%s: free %s inodes %ju-%ju\n", mp->mnt_stat.f_mntonname, filetype == IFDIR ? "directory" : "file", - (ino_t)cmd.value, - (ino_t)(cmd.value + cmd.size - 1)); + (uintmax_t)cmd.value, + (uintmax_t)(cmd.value + cmd.size - 1)); } #endif /* DEBUG */ while (cmd.size > 0) { Modified: projects/ino64/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- projects/ino64/sys/ufs/ffs/ffs_snapshot.c Mon Aug 29 15:51:12 2011 (r225246) +++ projects/ino64/sys/ufs/ffs/ffs_snapshot.c Mon Aug 29 16:24:58 2011 (r225247) @@ -682,7 +682,8 @@ loop: VI_LOCK(devvp); fs->fs_snapinum[snaploc] = ip->i_number; if (ip->i_nextsnap.tqe_prev != 0) - panic("ffs_snapshot: %d already on list", ip->i_number); + panic("ffs_snapshot: %ju already on list", + (uintmax_t)ip->i_number); TAILQ_INSERT_TAIL(&sn->sn_head, ip, i_nextsnap); devvp->v_vflag |= VV_COPYONWRITE; VI_UNLOCK(devvp); @@ -1564,8 +1565,8 @@ ffs_snapgone(ip) if (xp != NULL) vrele(ITOV(ip)); else if (snapdebug) - printf("ffs_snapgone: lost snapshot vnode %d\n", - ip->i_number); + printf("ffs_snapgone: lost snapshot vnode %ju\n", + (uintmax_t)ip->i_number); /* * Delete snapshot inode from superblock. Keep list dense. */ @@ -1827,9 +1828,10 @@ retry: if (size == fs->fs_bsize) { #ifdef DEBUG if (snapdebug) - printf("%s %d lbn %jd from inum %d\n", - "Grabonremove: snapino", ip->i_number, - (intmax_t)lbn, inum); + printf("%s %ju lbn %jd from inum %ju\n", + "Grabonremove: snapino", + (uintmax_t)ip->i_number, + (intmax_t)lbn, (uintmax_t)inum); #endif /* * If journaling is tracking this write we must add @@ -1871,9 +1873,9 @@ retry: break; #ifdef DEBUG if (snapdebug) - printf("%s%d lbn %jd %s %d size %ld to blkno %jd\n", - "Copyonremove: snapino ", ip->i_number, - (intmax_t)lbn, "for inum", inum, size, + printf("%s%ju lbn %jd %s %ju size %ld to blkno %jd\n", + "Copyonremove: snapino ", (uintmax_t)ip->i_number, + (intmax_t)lbn, "for inum", (uintmax_t)inum, size, (intmax_t)cbp->b_blkno); #endif /* @@ -2014,8 +2016,8 @@ ffs_snapshot_mount(mp) */ VI_LOCK(devvp); if (ip->i_nextsnap.tqe_prev != 0) - panic("ffs_snapshot_mount: %d already on list", - ip->i_number); + panic("ffs_snapshot_mount: %ju already on list", + (uintmax_t)ip->i_number); else TAILQ_INSERT_TAIL(&sn->sn_head, ip, i_nextsnap); vp->v_vflag |= VV_SYSTEM; @@ -2359,12 +2361,13 @@ ffs_copyonwrite(devvp, bp) break; #ifdef DEBUG if (snapdebug) { - printf("Copyonwrite: snapino %d lbn %jd for ", - ip->i_number, (intmax_t)lbn); + printf("Copyonwrite: snapino %ju lbn %jd for ", + (uintmax_t)ip->i_number, (intmax_t)lbn); if (bp->b_vp == devvp) printf("fs metadata"); else - printf("inum %d", VTOI(bp->b_vp)->i_number); + printf("inum %ju", + (uintmax_t)VTOI(bp->b_vp)->i_number); printf(" lblkno %jd to blkno %jd\n", (intmax_t)bp->b_lblkno, (intmax_t)cbp->b_blkno); } Modified: projects/ino64/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- projects/ino64/sys/ufs/ffs/ffs_softdep.c Mon Aug 29 15:51:12 2011 (r225246) +++ projects/ino64/sys/ufs/ffs/ffs_softdep.c Mon Aug 29 16:24:58 2011 (r225247) @@ -4441,8 +4441,8 @@ softdep_setup_mkdir(dp, ip) KASSERT(jaddref != NULL, ("softdep_setup_mkdir: No addref structure present.")); KASSERT(jaddref->ja_parent == dp->i_number, - ("softdep_setup_mkdir: bad parent %d", - jaddref->ja_parent)); + ("softdep_setup_mkdir: bad parent %ju", + (uintmax_t)jaddref->ja_parent)); TAILQ_INSERT_BEFORE(&jaddref->ja_ref, &dotaddref->ja_ref, if_deps); } @@ -8706,8 +8706,8 @@ newdirrem(bp, dp, ip, isrmdir, prevdirre if ((dap->da_state & ATTACHED) == 0) panic("newdirrem: not ATTACHED"); if (dap->da_newinum != ip->i_number) - panic("newdirrem: inum %d should be %d", - ip->i_number, dap->da_newinum); + panic("newdirrem: inum %ju should be %ju", + (uintmax_t)ip->i_number, (uintmax_t)dap->da_newinum); /* * If we are deleting a changed name that never made it to disk, * then return the dirrem describing the previous inode (which @@ -9585,9 +9585,10 @@ initiate_write_filepage(pagedep, bp) ep = (struct direct *) ((char *)bp->b_data + dap->da_offset); if (ep->d_ino != dap->da_newinum) - panic("%s: dir inum %d != new %d", + panic("%s: dir inum %ju != new %ju", "initiate_write_filepage", - ep->d_ino, dap->da_newinum); + (uintmax_t)ep->d_ino, + (uintmax_t)dap->da_newinum); if (dap->da_state & DIRCHG) ep->d_ino = dap->da_previous->dm_oldinum; else @@ -9816,9 +9817,10 @@ initiate_write_inodeblock_ufs2(inodedep, inon = TAILQ_NEXT(inodedep, id_unlinked); freelink = inon ? inon->id_ino : 0; if (freelink != dp->di_freelink) - panic("ino %p(0x%X) %d, %d != %d", - inodedep, inodedep->id_state, inodedep->id_ino, - freelink, dp->di_freelink); + panic("ino %p(0x%X) %ju, %ju != %ju", + inodedep, inodedep->id_state, + (uintmax_t)inodedep->id_ino, + (uintmax_t)freelink, (uintmax_t)dp->di_freelink); } /* * If the bitmap is not yet written, then the allocated @@ -10156,10 +10158,11 @@ softdep_setup_inofree(mp, bp, ino, wkhd) cgp = (struct cg *)bp->b_data; inosused = cg_inosused(cgp); if (isset(inosused, ino % fs->fs_ipg)) - panic("softdep_setup_inofree: inode %d not freed.", ino); + panic("softdep_setup_inofree: inode %ju not freed", + (uintmax_t)ino); if (inodedep_lookup(mp, ino, 0, &inodedep)) - panic("softdep_setup_inofree: ino %d has existing inodedep %p", - ino, inodedep); + panic("softdep_setup_inofree: ino %ju has existing inodedep %p", + (uintmax_t)ino, inodedep); if (wkhd) { LIST_FOREACH_SAFE(wk, wkhd, wk_list, wkn) { if (wk->wk_type != D_JADDREF) @@ -10385,8 +10388,8 @@ initiate_write_bmsafemap(bmsafemap, bp) jaddref->ja_state |= UNDONE; stat_jaddref++; } else if ((bp->b_xflags & BX_BKGRDMARKER) == 0) - panic("initiate_write_bmsafemap: inode %d " - "marked free", jaddref->ja_ino); + panic("%s: inode %ju marked free", + __func__, (uintmax_t)jaddref->ja_ino); } } /* @@ -12462,7 +12465,8 @@ retry: if (dap == LIST_FIRST(diraddhdp)) { inodedep_lookup(UFSTOVFS(ump), inum, 0, &inodedep); panic("flush_pagedep_deps: failed to flush " - "inodedep %p ino %d dap %p", inodedep, inum, dap); + "inodedep %p ino %ju dap %p", inodedep, + (uintmax_t)inum, dap); } } if (error) Modified: projects/ino64/sys/ufs/ufs/ufs_acl.c ============================================================================== --- projects/ino64/sys/ufs/ufs/ufs_acl.c Mon Aug 29 15:51:12 2011 (r225246) +++ projects/ino64/sys/ufs/ufs/ufs_acl.c Mon Aug 29 16:24:58 2011 (r225247) @@ -182,8 +182,8 @@ ufs_getacl_nfs4_internal(struct vnode *v * are unsafe. */ printf("ufs_getacl_nfs4(): Loaded invalid ACL (" - "%d bytes), inumber %d on %s\n", len, - ip->i_number, ip->i_fs->fs_fsmnt); + "%d bytes), inumber %ju on %s\n", len, + (uintmax_t)ip->i_number, ip->i_fs->fs_fsmnt); return (EPERM); } @@ -191,8 +191,8 @@ ufs_getacl_nfs4_internal(struct vnode *v error = acl_nfs4_check(aclp, vp->v_type == VDIR); if (error) { printf("ufs_getacl_nfs4(): Loaded invalid ACL " - "(failed acl_nfs4_check), inumber %d on %s\n", - ip->i_number, ip->i_fs->fs_fsmnt); + "(failed acl_nfs4_check), inumber %ju on %s\n", + (uintmax_t)ip->i_number, ip->i_fs->fs_fsmnt); return (EPERM); } @@ -259,8 +259,8 @@ ufs_get_oldacl(acl_type_t type, struct o * DAC protections are unsafe. */ printf("ufs_get_oldacl(): Loaded invalid ACL " - "(len = %d), inumber %d on %s\n", len, - ip->i_number, ip->i_fs->fs_fsmnt); + "(len = %d), inumber %ju on %s\n", len, + (uintmax_t)ip->i_number, ip->i_fs->fs_fsmnt); return (EPERM); } Modified: projects/ino64/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- projects/ino64/sys/ufs/ufs/ufs_lookup.c Mon Aug 29 15:51:12 2011 (r225246) +++ projects/ino64/sys/ufs/ufs/ufs_lookup.c Mon Aug 29 16:24:58 2011 (r225247) @@ -1209,8 +1209,8 @@ ufs_dirremove(dvp, ip, flags, isrmdir) ufsdirhash_remove(dp, rep, dp->i_offset); #endif if (ip && rep->d_ino != ip->i_number) - panic("ufs_dirremove: ip %d does not match dirent ino %d\n", - ip->i_number, rep->d_ino); + panic("ufs_dirremove: ip %ju does not match dirent ino %ju", + (uintmax_t)ip->i_number, (uintmax_t)rep->d_ino); if (dp->i_count == 0) { /* * First entry in block: set d_ino to zero. Modified: projects/ino64/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- projects/ino64/sys/ufs/ufs/ufs_vnops.c Mon Aug 29 15:51:12 2011 (r225246) +++ projects/ino64/sys/ufs/ufs/ufs_vnops.c Mon Aug 29 16:24:58 2011 (r225247) @@ -1485,8 +1485,8 @@ relock: if (error) panic("ufs_rename: from entry went away!"); if (ino != fip->i_number) - panic("ufs_rename: ino mismatch %d != %d\n", ino, - fip->i_number); + panic("ufs_rename: ino mismatch %ju != %ju", + (uintmax_t)ino, (uintmax_t)fip->i_number); } /* * If the source is a directory with a From owner-svn-src-projects@FreeBSD.ORG Tue Aug 30 11:59:23 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD5B11065672; Tue, 30 Aug 2011 11:59:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A54288FC1B; Tue, 30 Aug 2011 11:59:23 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 59C2C46B1A; Tue, 30 Aug 2011 07:59:23 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E0C368A02E; Tue, 30 Aug 2011 07:59:22 -0400 (EDT) From: John Baldwin To: Ed Schouten Date: Mon, 29 Aug 2011 15:06:31 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110617; KDE/4.5.5; amd64; ; ) References: <201108242214.p7OMEuMP072758@svn.freebsd.org> <201108251142.58276.jhb@freebsd.org> <20110827185539.GB1929@hoeg.nl> In-Reply-To: <20110827185539.GB1929@hoeg.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201108291506.31961.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 30 Aug 2011 07:59:23 -0400 (EDT) Cc: svn-src-projects@freebsd.org, mdf@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225154 - in projects/ino64/sys/ufs: ffs ufs X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2011 11:59:23 -0000 On Saturday, August 27, 2011 2:55:39 pm Ed Schouten wrote: > I think if we're ever going to consider extending dev_t, we should just > nuke the entire major/minor number thing. If we're only going to fill > them with 64 bits of random garbage, we'd better just display them > hexadecimal or something. > > This patch removes all the use of major()/minor()/makedev() as far as > possible from all non-contributed software: > > http://80386.nl/pub/major-minor.txt > > Keep in mind that this doesn't conflict with POSIX, because POSIX only > describes dev_t, not the division in major/minor numbers. For example, > the output of ls -l on device nodes is implementation defined. > > I suspect this message will cause bikesheds. ;-) I care not how they are displayed. Go for it. -- John Baldwin From owner-svn-src-projects@FreeBSD.ORG Tue Aug 30 16:52:26 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC10B106566B; Tue, 30 Aug 2011 16:52:26 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7C4C8FC13; Tue, 30 Aug 2011 16:52:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7UGqQht059429; Tue, 30 Aug 2011 16:52:26 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7UGqQhB059413; Tue, 30 Aug 2011 16:52:26 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201108301652.p7UGqQhB059413@svn.freebsd.org> From: Matthew D Fleming Date: Tue, 30 Aug 2011 16:52:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225267 - in projects/ino64: . bin/ed contrib/top etc etc/rc.d gnu/usr.bin/gdb/arch/arm lib/libarchive lib/libarchive/test lib/libbsnmp/libbsnmp lib/libc/sys lib/libcam lib/libdwarf lib... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2011 16:52:26 -0000 Author: mdf Date: Tue Aug 30 16:52:25 2011 New Revision: 225267 URL: http://svn.freebsd.org/changeset/base/225267 Log: IFC @ r225266. Added: projects/ino64/lib/libarchive/test/test_read_format_iso_2.iso.Z.uu - copied unchanged from r225266, head/lib/libarchive/test/test_read_format_iso_2.iso.Z.uu projects/ino64/libexec/rtld-elf/rtld_printf.c - copied unchanged from r225266, head/libexec/rtld-elf/rtld_printf.c projects/ino64/libexec/rtld-elf/rtld_printf.h - copied unchanged from r225266, head/libexec/rtld-elf/rtld_printf.h Modified: projects/ino64/ObsoleteFiles.inc projects/ino64/UPDATING projects/ino64/bin/ed/buf.c projects/ino64/etc/motd projects/ino64/etc/rc.d/Makefile projects/ino64/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c projects/ino64/lib/libarchive/archive_read_support_format_iso9660.c projects/ino64/lib/libarchive/test/test_read_format_iso_gz.c projects/ino64/lib/libarchive/test/test_read_format_isojoliet_bz2.c projects/ino64/lib/libarchive/test/test_read_format_isojoliet_long.c projects/ino64/lib/libarchive/test/test_read_format_isojoliet_rr.c projects/ino64/lib/libarchive/test/test_read_format_isorr_bz2.c projects/ino64/lib/libarchive/test/test_read_format_isorr_new_bz2.c projects/ino64/lib/libarchive/test/test_read_format_isozisofs_bz2.c projects/ino64/lib/libbsnmp/libbsnmp/Makefile projects/ino64/lib/libc/sys/sigwait.2 projects/ino64/lib/libc/sys/sigwaitinfo.2 projects/ino64/lib/libcam/Makefile projects/ino64/lib/libdwarf/Makefile projects/ino64/lib/libopie/Makefile projects/ino64/lib/libpcap/Makefile projects/ino64/lib/librtld_db/Makefile projects/ino64/lib/libtacplus/Makefile projects/ino64/lib/libufs/Makefile projects/ino64/lib/libusb/libusb.3 projects/ino64/libexec/rtld-elf/Makefile projects/ino64/libexec/rtld-elf/debug.c projects/ino64/libexec/rtld-elf/malloc.c projects/ino64/libexec/rtld-elf/rtld.c projects/ino64/libexec/rtld-elf/rtld.h projects/ino64/libexec/rtld-elf/rtld_lock.c projects/ino64/libexec/rtld-elf/xmalloc.c projects/ino64/release/doc/en_US.ISO8859-1/hardware/article.sgml projects/ino64/release/doc/share/misc/dev.archlist.txt projects/ino64/share/man/man4/Makefile projects/ino64/share/man/man4/ath.4 projects/ino64/share/man/man4/ath_hal.4 projects/ino64/share/man/man4/puc.4 projects/ino64/share/man/man4/vxge.4 projects/ino64/share/man/man9/DRIVER_MODULE.9 projects/ino64/share/man/man9/Makefile projects/ino64/share/man/man9/selrecord.9 projects/ino64/sys/amd64/amd64/minidump_machdep.c projects/ino64/sys/amd64/conf/GENERIC projects/ino64/sys/amd64/conf/NOTES projects/ino64/sys/arm/at91/uart_dev_at91usart.c projects/ino64/sys/boot/forth/loader.conf projects/ino64/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c projects/ino64/sys/conf/newvers.sh projects/ino64/sys/conf/options projects/ino64/sys/conf/options.amd64 projects/ino64/sys/contrib/pf/net/pf.c projects/ino64/sys/ddb/db_break.c projects/ino64/sys/dev/ahci/ahci.c projects/ino64/sys/dev/alc/if_alc.c projects/ino64/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c projects/ino64/sys/dev/ath/ath_hal/ar5416/ar5416reg.h projects/ino64/sys/dev/ath/if_ath.c projects/ino64/sys/dev/cfe/cfe_console.c projects/ino64/sys/dev/dcons/dcons_os.c projects/ino64/sys/dev/ofw/ofw_console.c projects/ino64/sys/dev/sio/sio.c projects/ino64/sys/dev/syscons/syscons.c projects/ino64/sys/dev/syscons/syscons.h projects/ino64/sys/dev/uart/uart_core.c projects/ino64/sys/i386/conf/GENERIC projects/ino64/sys/kern/kern_event.c projects/ino64/sys/kern/kern_jail.c projects/ino64/sys/kern/sched_4bsd.c projects/ino64/sys/kern/sched_ule.c projects/ino64/sys/kern/subr_kdb.c projects/ino64/sys/kern/sys_generic.c projects/ino64/sys/kern/sys_pipe.c projects/ino64/sys/kern/tty.c projects/ino64/sys/kern/tty_pts.c projects/ino64/sys/kern/uipc_mqueue.c projects/ino64/sys/kern/uipc_sockbuf.c projects/ino64/sys/kern/uipc_socket.c projects/ino64/sys/kern/vfs_subr.c projects/ino64/sys/kern/vfs_vnops.c projects/ino64/sys/modules/dcons/Makefile projects/ino64/sys/modules/sio/Makefile projects/ino64/sys/net/bpf.c projects/ino64/sys/net/if_bridge.c projects/ino64/sys/net/if_ethersubr.c projects/ino64/sys/net/if_tap.c projects/ino64/sys/net/if_tun.c projects/ino64/sys/net/radix_mpath.c projects/ino64/sys/net80211/ieee80211_output.c projects/ino64/sys/netinet/in.c projects/ino64/sys/netinet/tcp_input.c projects/ino64/sys/netinet/tcp_output.c projects/ino64/sys/netinet6/mld6.c projects/ino64/sys/pc98/cbus/sio.c projects/ino64/sys/powerpc/mambo/mambo_console.c projects/ino64/sys/rpc/clnt_dg.c projects/ino64/sys/security/audit/audit_pipe.c projects/ino64/sys/sparc64/sbus/sbus.c projects/ino64/sys/sys/kdb.h projects/ino64/sys/sys/param.h projects/ino64/sys/sys/selinfo.h projects/ino64/sys/sys/sockbuf.h projects/ino64/sys/sys/vnode.h projects/ino64/sys/ufs/ffs/ffs_extern.h projects/ino64/sys/ufs/ffs/ffs_inode.c projects/ino64/sys/ufs/ffs/ffs_softdep.c projects/ino64/sys/ufs/ufs/ufs_extattr.c projects/ino64/sys/vm/swap_pager.c projects/ino64/sys/x86/acpica/acpi_apm.c projects/ino64/usr.bin/nfsstat/nfsstat.c projects/ino64/usr.sbin/makefs/cd9660.c projects/ino64/usr.sbin/mfiutil/mfi_show.c Directory Properties: projects/ino64/ (props changed) projects/ino64/cddl/contrib/opensolaris/ (props changed) projects/ino64/contrib/bind9/ (props changed) projects/ino64/contrib/binutils/ (props changed) projects/ino64/contrib/bzip2/ (props changed) projects/ino64/contrib/compiler-rt/ (props changed) projects/ino64/contrib/dialog/ (props changed) projects/ino64/contrib/ee/ (props changed) projects/ino64/contrib/expat/ (props changed) projects/ino64/contrib/file/ (props changed) projects/ino64/contrib/gcc/ (props changed) projects/ino64/contrib/gdb/ (props changed) projects/ino64/contrib/gdtoa/ (props changed) projects/ino64/contrib/gnu-sort/ (props changed) projects/ino64/contrib/groff/ (props changed) projects/ino64/contrib/less/ (props changed) projects/ino64/contrib/libpcap/ (props changed) projects/ino64/contrib/libstdc++/ (props changed) projects/ino64/contrib/llvm/ (props changed) projects/ino64/contrib/llvm/tools/clang/ (props changed) projects/ino64/contrib/ncurses/ (props changed) projects/ino64/contrib/netcat/ (props changed) projects/ino64/contrib/ntp/ (props changed) projects/ino64/contrib/one-true-awk/ (props changed) projects/ino64/contrib/openbsm/ (props changed) projects/ino64/contrib/openpam/ (props changed) projects/ino64/contrib/pf/ (props changed) projects/ino64/contrib/sendmail/ (props changed) projects/ino64/contrib/tcpdump/ (props changed) projects/ino64/contrib/tcsh/ (props changed) projects/ino64/contrib/tnftp/ (props changed) projects/ino64/contrib/top/ (props changed) projects/ino64/contrib/top/install-sh (props changed) projects/ino64/contrib/tzcode/stdtime/ (props changed) projects/ino64/contrib/tzcode/zic/ (props changed) projects/ino64/contrib/tzdata/ (props changed) projects/ino64/contrib/wpa/ (props changed) projects/ino64/contrib/xz/ (props changed) projects/ino64/crypto/openssh/ (props changed) projects/ino64/crypto/openssl/ (props changed) projects/ino64/gnu/lib/ (props changed) projects/ino64/gnu/usr.bin/binutils/ (props changed) projects/ino64/gnu/usr.bin/cc/cc_tools/ (props changed) projects/ino64/gnu/usr.bin/gdb/ (props changed) projects/ino64/lib/libc/ (props changed) projects/ino64/lib/libc/stdtime/ (props changed) projects/ino64/lib/libutil/ (props changed) projects/ino64/lib/libz/ (props changed) projects/ino64/sbin/ (props changed) projects/ino64/sbin/ipfw/ (props changed) projects/ino64/share/mk/bsd.arch.inc.mk (props changed) projects/ino64/share/zoneinfo/ (props changed) projects/ino64/sys/ (props changed) projects/ino64/sys/amd64/include/xen/ (props changed) projects/ino64/sys/boot/ (props changed) projects/ino64/sys/boot/i386/efi/ (props changed) projects/ino64/sys/boot/ia64/efi/ (props changed) projects/ino64/sys/boot/ia64/ski/ (props changed) projects/ino64/sys/boot/powerpc/boot1.chrp/ (props changed) projects/ino64/sys/boot/powerpc/ofw/ (props changed) projects/ino64/sys/cddl/contrib/opensolaris/ (props changed) projects/ino64/sys/conf/ (props changed) projects/ino64/sys/contrib/dev/acpica/ (props changed) projects/ino64/sys/contrib/octeon-sdk/ (props changed) projects/ino64/sys/contrib/pf/ (props changed) projects/ino64/sys/contrib/x86emu/ (props changed) projects/ino64/usr.bin/calendar/ (props changed) projects/ino64/usr.bin/csup/ (props changed) projects/ino64/usr.bin/procstat/ (props changed) projects/ino64/usr.sbin/ndiscvt/ (props changed) projects/ino64/usr.sbin/rtadvctl/ (props changed) projects/ino64/usr.sbin/rtadvd/ (props changed) projects/ino64/usr.sbin/zic/ (props changed) Modified: projects/ino64/ObsoleteFiles.inc ============================================================================== --- projects/ino64/ObsoleteFiles.inc Tue Aug 30 16:40:17 2011 (r225266) +++ projects/ino64/ObsoleteFiles.inc Tue Aug 30 16:52:25 2011 (r225267) @@ -38,6 +38,23 @@ # xargs -n1 | sort | uniq -d; # done +# 20110828: library version bump for 9.0 +OLD_LIBS+=lib/libufs.so.5 +OLD_LIBS+=usr/lib/libbsnmp.so.5 +OLD_LIBS+=usr/lib/libdwarf.so.2 +OLD_LIBS+=usr/lib/libopie.so.6 +OLD_LIBS+=usr/lib/libpcap.so.7 +OLD_LIBS+=usr/lib/librtld_db.so.1 +OLD_LIBS+=usr/lib/libtacplus.so.4 +.if ${TARGET_ARCH} == "amd64" +OLD_LIBS+=usr/lib32/libufs.so.5 +OLD_LIBS+=usr/lib32/libbsnmp.so.5 +OLD_LIBS+=usr/lib32/libdwarf.so.2 +OLD_LIBS+=usr/lib32/libopie.so.6 +OLD_LIBS+=usr/lib32/libpcap.so.7 +OLD_LIBS+=usr/lib32/librtld_db.so.1 +OLD_LIBS+=usr/lib32/libtacplus.so.4 +.endif # 20110709: vm_map_clean.9 -> vm_map_sync.9 OLD_FILES+=usr/share/man/man9/vm_map_clean.9.gz # 20110709: Catch up with removal of these functions. @@ -2043,9 +2060,9 @@ OLD_FILES+=usr/share/man/man5/ipsend.5.g OLD_FILES+=usr/bin/gtar OLD_FILES+=usr/share/man/man1/gtar.1.gz # 200503XX -OLD_FILES+=share/man/man3/exp10.3.gz -OLD_FILES+=share/man/man3/exp10f.3.gz -OLD_FILES+=share/man/man3/fpsetsticky.3.gz +OLD_FILES+=usr/share/man/man3/exp10.3.gz +OLD_FILES+=usr/share/man/man3/exp10f.3.gz +OLD_FILES+=usr/share/man/man3/fpsetsticky.3.gz # 20050324: updated release infrastructure OLD_FILES+=usr/share/man/man5/drivers.conf.5.gz # 20050317: removed from BIND 9 distribution @@ -2293,6 +2310,8 @@ OLD_FILES+=lib/libz.so OLD_FILES+=bin/cxconfig OLD_FILES+=sbin/cxconfig OLD_FILES+=usr/share/man/man8/cxconfig.8.gz +# 20031016: MULTI_DRIVER_MODULE macro removed +OLD_FILES+=usr/share/man/man9/MULTI_DRIVER_MODULE.9.gz # 200309XX OLD_FILES+=usr/bin/symorder OLD_FILES+=usr/share/man/man1/symorder.1.gz Modified: projects/ino64/UPDATING ============================================================================== --- projects/ino64/UPDATING Tue Aug 30 16:40:17 2011 (r225266) +++ projects/ino64/UPDATING Tue Aug 30 16:52:25 2011 (r225267) @@ -22,6 +22,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20110828: + Bump the shared library version numbers for libraries that + do not use symbol versioning, have changed the ABI compared + to stable/8 and which shared library version was not bumped. + Done as part of 9.0-RELEASE cycle. + 20110815: During the merge of Capsicum features, the fget(9) KPI was modified. This may require the rebuilding of out-of-tree device drivers -- @@ -1456,9 +1462,10 @@ COMMON ITEMS: FORMAT: This file contains a list, in reverse chronological order, of major -breakages in tracking -current. Not all things will be listed here, -and it only starts on October 16, 2004. Updating files can found in -previous releases if your system is older than this. +breakages in tracking -current. It is not guaranteed to be a complete +list of such breakages, and only contains entries since October 10, 2007. +If you need to see UPDATING entries from before that date, you will need +to fetch an UPDATING file from an older FreeBSD release. Copyright information: Modified: projects/ino64/bin/ed/buf.c ============================================================================== --- projects/ino64/bin/ed/buf.c Tue Aug 30 16:40:17 2011 (r225266) +++ projects/ino64/bin/ed/buf.c Tue Aug 30 16:52:25 2011 (r225267) @@ -94,6 +94,7 @@ put_sbuf_line(const char *cs) ; if (s - cs >= LINECHARS) { errmsg = "line too long"; + free(lp); return NULL; } len = s - cs; @@ -102,6 +103,7 @@ put_sbuf_line(const char *cs) if (fseeko(sfp, (off_t)0, SEEK_END) < 0) { fprintf(stderr, "%s\n", strerror(errno)); errmsg = "cannot seek temp file"; + free(lp); return NULL; } sfseek = ftello(sfp); @@ -112,6 +114,7 @@ put_sbuf_line(const char *cs) sfseek = -1; fprintf(stderr, "%s\n", strerror(errno)); errmsg = "cannot write temp file"; + free(lp); return NULL; } lp->len = len; Modified: projects/ino64/etc/motd ============================================================================== --- projects/ino64/etc/motd Tue Aug 30 16:40:17 2011 (r225266) +++ projects/ino64/etc/motd Tue Aug 30 16:52:25 2011 (r225267) @@ -10,8 +10,10 @@ o Security advisories and updated errat o The Handbook and FAQ documents are at http://www.FreeBSD.org/ and, along with the mailing lists, can be searched by going to - http://www.FreeBSD.org/search/. If the doc distribution has - been installed, they're also available formatted in /usr/share/doc. + http://www.FreeBSD.org/search/. If the doc package has been installed + (or fetched via pkg_add -r lang-freebsd-doc, where lang is the + 2-letter language code, e.g. en), they are also available formatted + in /usr/local/share/doc/freebsd. If you still have a question or problem, please take the output of `uname -a', along with any relevant error messages, and email it Modified: projects/ino64/etc/rc.d/Makefile ============================================================================== --- projects/ino64/etc/rc.d/Makefile Tue Aug 30 16:40:17 2011 (r225266) +++ projects/ino64/etc/rc.d/Makefile Tue Aug 30 16:52:25 2011 (r225267) @@ -16,7 +16,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI hostapd hostid hostid_save hostname \ inetd initrandom \ ip6addrctl ipfilter ipfs ipfw ipmon \ - ipnat ipsec ipxrouted \ + ipnat ipsec \ jail \ kadmind kerberos keyserv kld kldxref kpasswdd \ ldconfig local localpkg lockd lpd \ @@ -42,6 +42,10 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI ypset ypupdated ypxfrd \ zfs zvol +.if ${MK_IPX} != "no" +FILES+= ipxrouted +.endif + .if ${MK_OFED} != "no" FILES+= opensm .endif Modified: projects/ino64/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c ============================================================================== --- projects/ino64/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c Tue Aug 30 16:40:17 2011 (r225266) +++ projects/ino64/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c Tue Aug 30 16:52:25 2011 (r225267) @@ -32,8 +32,8 @@ #include "arm-tdep.h" #include -#include #ifndef CROSS_DEBUGGER +#include #include #include #endif Modified: projects/ino64/lib/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- projects/ino64/lib/libarchive/archive_read_support_format_iso9660.c Tue Aug 30 16:40:17 2011 (r225266) +++ projects/ino64/lib/libarchive/archive_read_support_format_iso9660.c Tue Aug 30 16:52:25 2011 (r225267) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2003-2007 Tim Kientzle * Copyright (c) 2009 Andreas Henriksson - * Copyright (c) 2009 Michihiro NAKAJIMA + * Copyright (c) 2009-2011 Michihiro NAKAJIMA * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -261,13 +261,17 @@ struct file_info { struct file_info *use_next; struct file_info *parent; struct file_info *next; + struct file_info *re_next; int subdirs; uint64_t key; /* Heap Key. */ uint64_t offset; /* Offset on disk. */ uint64_t size; /* File size in bytes. */ uint32_t ce_offset; /* Offset of CE. */ uint32_t ce_size; /* Size of CE. */ + char rr_moved; /* Flag to rr_moved. */ + char rr_moved_has_re_only; char re; /* Having RRIP "RE" extension. */ + char re_descendant; uint64_t cl_offset; /* Having RRIP "CL" extension. */ int birthtime_is_set; time_t birthtime; /* File created time. */ @@ -294,7 +298,10 @@ struct file_info { struct content *first; struct content **last; } contents; - char exposed; + struct { + struct file_info *first; + struct file_info **last; + } rede_files; }; struct heap_queue { @@ -317,8 +324,6 @@ struct iso9660 { unsigned char suspOffset; struct file_info *rr_moved; - struct heap_queue re_dirs; - struct heap_queue cl_files; struct read_ce_queue { struct read_ce_req { uint64_t offset;/* Offset of CE on disk. */ @@ -337,6 +342,10 @@ struct iso9660 { struct file_info *first; struct file_info **last; } cache_files; + struct { + struct file_info *first; + struct file_info **last; + } re_files; uint64_t current_position; ssize_t logical_block_size; @@ -377,7 +386,8 @@ static int isJolietSVD(struct iso9660 *, static int isSVD(struct iso9660 *, const unsigned char *); static int isEVD(struct iso9660 *, const unsigned char *); static int isPVD(struct iso9660 *, const unsigned char *); -static struct file_info *next_cache_entry(struct iso9660 *iso9660); +static int next_cache_entry(struct archive_read *, struct iso9660 *, + struct file_info **); static int next_entry_seek(struct archive_read *a, struct iso9660 *iso9660, struct file_info **pfile); static struct file_info * @@ -400,10 +410,12 @@ static void parse_rockridge_ZF1(struct f static void register_file(struct iso9660 *, struct file_info *); static void release_files(struct iso9660 *); static unsigned toi(const void *p, int n); +static inline void re_add_entry(struct iso9660 *, struct file_info *); +static inline struct file_info * re_get_entry(struct iso9660 *); +static inline int rede_add_entry(struct file_info *); +static inline struct file_info * rede_get_entry(struct file_info *); static inline void cache_add_entry(struct iso9660 *iso9660, struct file_info *file); -static inline void cache_add_to_next_of_parent(struct iso9660 *iso9660, - struct file_info *file); static inline struct file_info *cache_get_entry(struct iso9660 *iso9660); static void heap_add_entry(struct heap_queue *heap, struct file_info *file, uint64_t key); @@ -430,6 +442,8 @@ archive_read_support_format_iso9660(stru iso9660->magic = ISO9660_MAGIC; iso9660->cache_files.first = NULL; iso9660->cache_files.last = &(iso9660->cache_files.first); + iso9660->re_files.first = NULL; + iso9660->re_files.last = &(iso9660->re_files.first); /* Enable to support Joliet extensions by default. */ iso9660->opt_support_joliet = 1; /* Enable to support Rock Ridge extensions by default. */ @@ -975,42 +989,38 @@ read_children(struct archive_read *a, st child = parse_file_info(a, parent, p); if (child == NULL) return (ARCHIVE_FATAL); - if (child->cl_offset) - heap_add_entry(&(iso9660->cl_files), - child, child->cl_offset); - else { - if (child->multi_extent || multi != NULL) { - struct content *con; - - if (multi == NULL) { - multi = child; - multi->contents.first = NULL; - multi->contents.last = - &(multi->contents.first); - } - con = malloc(sizeof(struct content)); - if (con == NULL) { - archive_set_error( - &a->archive, ENOMEM, - "No memory for " - "multi extent"); - return (ARCHIVE_FATAL); - } - con->offset = child->offset; - con->size = child->size; - con->next = NULL; - *multi->contents.last = con; - multi->contents.last = &(con->next); - if (multi == child) - add_entry(iso9660, child); - else { - multi->size += child->size; - if (!child->multi_extent) - multi = NULL; - } - } else + if (child->cl_offset == 0 && + (child->multi_extent || multi != NULL)) { + struct content *con; + + if (multi == NULL) { + multi = child; + multi->contents.first = NULL; + multi->contents.last = + &(multi->contents.first); + } + con = malloc(sizeof(struct content)); + if (con == NULL) { + archive_set_error( + &a->archive, ENOMEM, + "No memory for " + "multi extent"); + return (ARCHIVE_FATAL); + } + con->offset = child->offset; + con->size = child->size; + con->next = NULL; + *multi->contents.last = con; + multi->contents.last = &(con->next); + if (multi == child) add_entry(iso9660, child); - } + else { + multi->size += child->size; + if (!child->multi_extent) + multi = NULL; + } + } else + add_entry(iso9660, child); } } @@ -1022,102 +1032,12 @@ read_children(struct archive_read *a, st } static int -relocate_dir(struct iso9660 *iso9660, struct file_info *file) -{ - struct file_info *re; - - re = heap_get_entry(&(iso9660->re_dirs)); - while (re != NULL && re->offset < file->cl_offset) { - /* This case is wrong pattern. - * But dont't reject this directory entry to be robust. */ - cache_add_entry(iso9660, re); - re = heap_get_entry(&(iso9660->re_dirs)); - } - if (re == NULL) - /* This case is wrong pattern. */ - return (0); - if (re->offset == file->cl_offset) { - re->parent->subdirs--; - re->parent = file->parent; - re->parent->subdirs++; - cache_add_to_next_of_parent(iso9660, re); - return (1); - } else - /* This case is wrong pattern. */ - heap_add_entry(&(iso9660->re_dirs), re, re->offset); - return (0); -} - -static int -read_entries(struct archive_read *a) -{ - struct iso9660 *iso9660; - struct file_info *file; - int r; - - iso9660 = (struct iso9660 *)(a->format->data); - - while ((file = next_entry(iso9660)) != NULL && - (file->mode & AE_IFMT) == AE_IFDIR) { - r = read_children(a, file); - if (r != ARCHIVE_OK) - return (r); - - if (iso9660->seenRockridge && - file->parent != NULL && - file->parent->parent == NULL && - iso9660->rr_moved == NULL && - (strcmp(file->name.s, "rr_moved") == 0 || - strcmp(file->name.s, ".rr_moved") == 0)) { - iso9660->rr_moved = file; - } else if (file->re) - heap_add_entry(&(iso9660->re_dirs), file, - file->offset); - else - cache_add_entry(iso9660, file); - } - if (file != NULL) - add_entry(iso9660, file); - - if (iso9660->rr_moved != NULL) { - /* - * Relocate directory which rr_moved has. - */ - while ((file = heap_get_entry(&(iso9660->cl_files))) != NULL) - relocate_dir(iso9660, file); - - /* If rr_moved directory still has children, - * Add rr_moved into pending_files to show - */ - if (iso9660->rr_moved->subdirs) { - cache_add_entry(iso9660, iso9660->rr_moved); - /* If entries which have "RE" extension are still - * remaining(this case is unlikely except ISO image - * is broken), the entries won't be exposed. */ - while ((file = heap_get_entry(&(iso9660->re_dirs))) != NULL) - cache_add_entry(iso9660, file); - } else - iso9660->rr_moved->parent->subdirs--; - } else { - /* - * In case ISO image is broken. If the name of rr_moved - * directory has been changed by damage, subdirectories - * of rr_moved entry won't be exposed. - */ - while ((file = heap_get_entry(&(iso9660->re_dirs))) != NULL) - cache_add_entry(iso9660, file); - } - - return (ARCHIVE_OK); -} - -static int archive_read_format_iso9660_read_header(struct archive_read *a, struct archive_entry *entry) { struct iso9660 *iso9660; struct file_info *file; - int r, rd_r; + int r, rd_r = ARCHIVE_OK; iso9660 = (struct iso9660 *)(a->format->data); @@ -1207,11 +1127,7 @@ archive_read_format_iso9660_read_header( a->archive.archive_format_name = "ISO9660 with Rockridge extensions"; } - rd_r = read_entries(a); - if (rd_r == ARCHIVE_FATAL) - return (ARCHIVE_FATAL); - } else - rd_r = ARCHIVE_OK; + } /* Get the next entry that appears after the current offset. */ r = next_entry_seek(a, iso9660, &file); @@ -1324,7 +1240,6 @@ archive_read_format_iso9660_read_header( /* Directory data has been read completely. */ iso9660->entry_bytes_remaining = 0; iso9660->entry_sparse_offset = 0; - file->exposed = 1; } if (rd_r != ARCHIVE_OK) @@ -1651,10 +1566,6 @@ archive_read_format_iso9660_cleanup(stru archive_string_free(&iso9660->previous_pathname); if (iso9660->pending_files.files) free(iso9660->pending_files.files); - if (iso9660->re_dirs.files) - free(iso9660->re_dirs.files); - if (iso9660->cl_files.files) - free(iso9660->cl_files.files); #ifdef HAVE_ZLIB_H free(iso9660->entry_zisofs.uncompressed_buffer); free(iso9660->entry_zisofs.block_pointers); @@ -1735,6 +1646,8 @@ parse_file_info(struct archive_read *a, file->size = fsize; file->mtime = isodate7(isodirrec + DR_date_offset); file->ctime = file->atime = file->mtime; + file->rede_files.first = NULL; + file->rede_files.last = &(file->rede_files.first); p = isodirrec + DR_name_offset; /* Rockridge extensions (if any) follow name. Compute this @@ -1873,9 +1786,40 @@ parse_file_info(struct archive_read *a, file->nlinks = 1;/* Reset nlink. we'll calculate it later. */ /* Tell file's parent how many children that parent has. */ - if (parent != NULL && (flags & 0x02) && file->cl_offset == 0) + if (parent != NULL && (flags & 0x02)) parent->subdirs++; + if (iso9660->seenRockridge) { + if (parent != NULL && parent->parent == NULL && + (flags & 0x02) && iso9660->rr_moved == NULL && + (strcmp(file->name.s, "rr_moved") == 0 || + strcmp(file->name.s, ".rr_moved") == 0)) { + iso9660->rr_moved = file; + file->rr_moved = 1; + file->rr_moved_has_re_only = 1; + file->re = 0; + parent->subdirs--; + } else if (file->re) { + /* This file's parent is not rr_moved, clear invalid + * "RE" mark. */ + if (parent == NULL || parent->rr_moved == 0) + file->re = 0; + else if ((flags & 0x02) == 0) { + file->rr_moved_has_re_only = 0; + file->re = 0; + } + } else if (parent != NULL && parent->rr_moved) + file->rr_moved_has_re_only = 0; + else if (parent != NULL && (flags & 0x02) && + (parent->re || parent->re_descendant)) + file->re_descendant = 1; + if (file->cl_offset != 0) { + parent->subdirs++; + /* To be appeared before other dirs. */ + file->offset = file->number = file->cl_offset; + } + } + #if DEBUG /* DEBUGGING: Warn about attributes I don't yet fully support. */ if ((flags & ~0x02) != 0) { @@ -2489,10 +2433,12 @@ next_entry_seek(struct archive_read *a, struct file_info **pfile) { struct file_info *file; + int r; - *pfile = file = next_cache_entry(iso9660); - if (file == NULL) - return (ARCHIVE_EOF); + r = next_cache_entry(a, iso9660, pfile); + if (r != ARCHIVE_OK) + return (r); + file = *pfile; /* Don't waste time seeking for zero-length bodies. */ if (file->size == 0) @@ -2513,8 +2459,9 @@ next_entry_seek(struct archive_read *a, return (ARCHIVE_OK); } -static struct file_info * -next_cache_entry(struct iso9660 *iso9660) +static int +next_cache_entry(struct archive_read *a, struct iso9660 *iso9660, + struct file_info **pfile) { struct file_info *file; struct { @@ -2526,21 +2473,128 @@ next_cache_entry(struct iso9660 *iso9660 file = cache_get_entry(iso9660); if (file != NULL) { - while (file->parent != NULL && !file->parent->exposed) { - /* If file's parent is not exposed, it's moved - * to next entry of its parent. */ - cache_add_to_next_of_parent(iso9660, file); - file = cache_get_entry(iso9660); - } - return (file); + *pfile = file; + return (ARCHIVE_OK); } - file = next_entry(iso9660); - if (file == NULL) - return (NULL); + for (;;) { + struct file_info *re, *d; + + *pfile = file = next_entry(iso9660); + if (file == NULL) { + /* + * If directory entries all which are descendant of + * rr_moved are stil remaning, expose their. + */ + if (iso9660->re_files.first != NULL && + iso9660->rr_moved != NULL && + iso9660->rr_moved->rr_moved_has_re_only) + /* Expose "rr_moved" entry. */ + cache_add_entry(iso9660, iso9660->rr_moved); + while ((re = re_get_entry(iso9660)) != NULL) { + /* Expose its descendant dirs. */ + while ((d = rede_get_entry(re)) != NULL) + cache_add_entry(iso9660, d); + } + if (iso9660->cache_files.first != NULL) + return (next_cache_entry(a, iso9660, pfile)); + return (ARCHIVE_EOF); + } + + if (file->cl_offset) { + struct file_info *first_re = NULL; + int nexted_re = 0; + + /* + * Find "RE" dir for the current file, which + * has "CL" flag. + */ + while ((re = re_get_entry(iso9660)) + != first_re) { + if (first_re == NULL) + first_re = re; + if (re->offset == file->cl_offset) { + re->parent->subdirs--; + re->parent = file->parent; + re->re = 0; + if (re->parent->re_descendant) { + nexted_re = 1; + re->re_descendant = 1; + if (rede_add_entry(re) < 0) + goto fatal_rr; + /* Move a list of descendants + * to a new ancestor. */ + while ((d = rede_get_entry( + re)) != NULL) + if (rede_add_entry(d) + < 0) + goto fatal_rr; + break; + } + /* Replace the current file + * with "RE" dir */ + *pfile = file = re; + /* Expose its descendant */ + while ((d = rede_get_entry( + file)) != NULL) + cache_add_entry( + iso9660, d); + break; + } else + re_add_entry(iso9660, re); + } + if (nexted_re) { + /* + * Do not expose this at this time + * because we have not gotten its full-path + * name yet. + */ + continue; + } + } else if ((file->mode & AE_IFMT) == AE_IFDIR) { + int r; + + /* Read file entries in this dir. */ + r = read_children(a, file); + if (r != ARCHIVE_OK) + return (r); + + /* + * Handle a special dir of Rockridge extensions, + * "rr_moved". + */ + if (file->rr_moved) { + /* + * If this has only the subdirectories which + * have "RE" flags, do not expose at this time. + */ + if (file->rr_moved_has_re_only) + continue; + /* Otherwise expose "rr_moved" entry. */ + } else if (file->re) { + /* + * Do not expose this at this time + * because we have not gotten its full-path + * name yet. + */ + re_add_entry(iso9660, file); + continue; + } else if (file->re_descendant) { + /* + * Do not expose this at this time + * because we have not gotten its full-path + * name yet. + */ + if (rede_add_entry(file) < 0) + goto fatal_rr; + continue; + } + } + break; + } if ((file->mode & AE_IFMT) != AE_IFREG || file->number == -1) - return (file); + return (ARCHIVE_OK); count = 0; number = file->number; @@ -2573,8 +2627,10 @@ next_cache_entry(struct iso9660 *iso9660 file = next_entry(iso9660); } - if (count == 0) - return (file); + if (count == 0) { + *pfile = file; + return ((file == NULL)?ARCHIVE_EOF:ARCHIVE_OK); + } if (file->number == -1) { file->next = NULL; *empty_files.last = file; @@ -2599,24 +2655,75 @@ next_cache_entry(struct iso9660 *iso9660 *iso9660->cache_files.last = empty_files.first; iso9660->cache_files.last = empty_files.last; } - return (cache_get_entry(iso9660)); + *pfile = cache_get_entry(iso9660); + return ((*pfile == NULL)?ARCHIVE_EOF:ARCHIVE_OK); + +fatal_rr: + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Failed to connect 'CL' pointer to 'RE' rr_moved pointer of" + "Rockridge extensions"); + return (ARCHIVE_FATAL); } static inline void -cache_add_entry(struct iso9660 *iso9660, struct file_info *file) +re_add_entry(struct iso9660 *iso9660, struct file_info *file) { - file->next = NULL; - *iso9660->cache_files.last = file; - iso9660->cache_files.last = &(file->next); + file->re_next = NULL; + *iso9660->re_files.last = file; + iso9660->re_files.last = &(file->re_next); +} + +static inline struct file_info * +re_get_entry(struct iso9660 *iso9660) +{ + struct file_info *file; + + if ((file = iso9660->re_files.first) != NULL) { + iso9660->re_files.first = file->re_next; + if (iso9660->re_files.first == NULL) + iso9660->re_files.last = + &(iso9660->re_files.first); + } + return (file); +} + +static inline int +rede_add_entry(struct file_info *file) +{ + struct file_info *re; + + re = file->parent; + while (re != NULL && !re->re) + re = re->parent; + if (re == NULL) + return (-1); + + file->re_next = NULL; + *re->rede_files.last = file; + re->rede_files.last = &(file->re_next); + return (0); +} + +static inline struct file_info * +rede_get_entry(struct file_info *re) +{ + struct file_info *file; + + if ((file = re->rede_files.first) != NULL) { + re->rede_files.first = file->re_next; + if (re->rede_files.first == NULL) + re->rede_files.last = + &(re->rede_files.first); + } + return (file); } static inline void -cache_add_to_next_of_parent(struct iso9660 *iso9660, struct file_info *file) +cache_add_entry(struct iso9660 *iso9660, struct file_info *file) { - file->next = file->parent->next; - file->parent->next = file; - if (iso9660->cache_files.last == &(file->parent->next)) - iso9660->cache_files.last = &(file->next); + file->next = NULL; + *iso9660->cache_files.last = file; + iso9660->cache_files.last = &(file->next); } static inline struct file_info * Copied: projects/ino64/lib/libarchive/test/test_read_format_iso_2.iso.Z.uu (from r225266, head/lib/libarchive/test/test_read_format_iso_2.iso.Z.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ino64/lib/libarchive/test/test_read_format_iso_2.iso.Z.uu Tue Aug 30 16:52:25 2011 (r225267, copy of r225266, head/lib/libarchive/test/test_read_format_iso_2.iso.Z.uu) @@ -0,0 +1,37 @@ +$FreeBSD$ + +begin 644 test_read_format_iso_2.iso.Z +M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR +MI,F3*%.J7,FRIO8,.*'4NVK-FS:-.J7//JW/'D"-+GDRYLN7+F#-KWLRY +ML^?/H$.+'DVZM.G3J%.K7LVZM>O7L&/+GDV[MNW;N'/KWLV[M^_?P(,+'TZ\ +MN/'CR),K7\Z\N?/GT*-+GTZ]NO7KV+-KW\Z]N_?OX,.+'T^^O/GSZ-.K7\^^ +MO?OW\./+GT^_OOW[^//KW\^_O_^_`0Q!!`PPQ!```$Z408<04Q`!PH,01BCA +MA!16:.&%$!Z404$;>G0@``%\>"`""`#@04$>2)#0!`.)```%!<%8HD`EEF+C +MC:4($)"(!V+HXX]`!BGDD$06:>212":IY)),-NGDDU!&*>645%9II8\R%!@# +M##C$0(,,,6Q)PPP$DI-EF%QZ"::89,)`#H%PQBDGG&=NV>67:(Y9YH?_]>GG +MGX7](R"!!@)JZ*&()JKHHL<="...`AU80:0`!`$B`!=0.@2CG';JZ:>@A@H8 +MGR]>:FI`DP9@*:F9!BCJJ[#&*NNLM#[EXJ,#R3A0C3C:J*.I(0)P:XP`S!@0 +MK[W^RF,`+DY*T*3&%@O`&P@X4($"!I"C[(ZJNI@I09E&6R*UUBJP@+:0@NAJ +MK>RVZ^Z[\$;7;$'0[CIMM==FNZVZPI9*D*XT`M"KK^F&&(`)`%A0D`4&%&0` +MN?F20RF(!`CAP@XQQ*OQQAQW['%S:)3!!AMO*/#QR2BGK/+*G7I;4+CV0FPN +MNL`>..R_T@8\<(X%AX@P!@5AT#!!#^,[\\0!$$#$Q1FS[/334$M]MILM^WVVW#'+??<=-=M]]UXYZWW +MWGSW[???@`N^>:<=^[Y +MYZ"'+OKHI)=N^NFHIZ[ZZJRW[OKKL,O_/+,-^_\\]!'+_WTU%=O_?789Z_]]MQW[_WWX(BGK_[Z[+?O_OOPQR___/37;__]^.>O__[\]^___P`,H``'2,`"&O"`"$R@ +M`A?(P`8Z\($0C*`$)TC!"EKP@AC,H`8WR,$.>O"#(`RA"$=(PA*:\(0H3*$* +M5\C"%KKPA3",H0QG2,,:VO"&.,RA#G?(PQ[Z\(=`#*(0ATC$(AKQB$A,HA*7 +MR,0F.O&)4(RB%*=(Q2I:\8I8S*(6M\C%+GKQBV`,HQC'2,8RFO&,:$RC&M?( +MQC:Z\8UPC*,O.;X`RG.,=)SG*:\YSH3*^,RG/O?)SW[Z\Y\`#:A`!TK0@AKTH`A-J$(7RM"&.O2A +M$(VH1"=*T8I:]*(8S:A&-\K1CGKTHR`-J4A'2M*2FO2D*$VI2E?*TI:Z]*4P +MC:E,9TK3FMKTICC-J4YWRM.>^O2G0`VJ4(=*U*(:]:A(3:I2E\K4ICKUJ5"- +MJE2G2M6J6O6J6,VJ5K?*U:YZ]:M@#:M8QTK6LIKUK&A-JUK7RM:VNO6M<`TG +` +end Modified: projects/ino64/lib/libarchive/test/test_read_format_iso_gz.c ============================================================================== --- projects/ino64/lib/libarchive/test/test_read_format_iso_gz.c Tue Aug 30 16:40:17 2011 (r225266) +++ projects/ino64/lib/libarchive/test/test_read_format_iso_gz.c Tue Aug 30 16:52:25 2011 (r225267) @@ -25,7 +25,8 @@ #include "test.h" __FBSDID("$FreeBSD$"); -DEFINE_TEST(test_read_format_iso_gz) +static void +test1(void) { struct archive_entry *ae; struct archive *a; @@ -49,4 +50,50 @@ DEFINE_TEST(test_read_format_iso_gz) assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); } +static +void test2(void) +{ + struct archive_entry *ae; + struct archive *a; + const char *name = "test_read_format_iso_2.iso.Z"; + + extract_reference_file(name); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_support_compression_all(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_filename(a, name, 512)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + assertEqualString(".", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + assertEqualString("A", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + assertEqualString("A/B", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + assertEqualString("C", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + assertEqualString("C/D", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_EOF, + archive_read_next_header(a, &ae)); + assertEqualInt(archive_compression(a), + ARCHIVE_COMPRESSION_COMPRESS); + assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); +} + +DEFINE_TEST(test_read_format_iso_gz) +{ + test1(); + test2(); +} + Modified: projects/ino64/lib/libarchive/test/test_read_format_isojoliet_bz2.c ============================================================================== --- projects/ino64/lib/libarchive/test/test_read_format_isojoliet_bz2.c Tue Aug 30 16:40:17 2011 (r225266) +++ projects/ino64/lib/libarchive/test/test_read_format_isojoliet_bz2.c Tue Aug 30 16:52:25 2011 (r225267) @@ -95,7 +95,7 @@ DEFINE_TEST(test_read_format_isojoliet_b /* A regular file with two names ("hardlink" gets returned * first, so it's not marked as a hardlink). */ assertEqualInt(0, archive_read_next_header(a, &ae)); - assertEqualString("long-joliet-file-name.textfile", + assertEqualString("hardlink", archive_entry_pathname(ae)); assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); assert(archive_entry_hardlink(ae) == NULL); @@ -108,9 +108,10 @@ DEFINE_TEST(test_read_format_isojoliet_b /* Second name for the same regular file (this happens to be * returned second, so does get marked as a hardlink). */ assertEqualInt(0, archive_read_next_header(a, &ae)); - assertEqualString("hardlink", archive_entry_pathname(ae)); - assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); assertEqualString("long-joliet-file-name.textfile", + archive_entry_pathname(ae)); + assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); + assertEqualString("hardlink", archive_entry_hardlink(ae)); assert(!archive_entry_size_is_set(ae)); Modified: projects/ino64/lib/libarchive/test/test_read_format_isojoliet_long.c ============================================================================== --- projects/ino64/lib/libarchive/test/test_read_format_isojoliet_long.c Tue Aug 30 16:40:17 2011 (r225266) +++ projects/ino64/lib/libarchive/test/test_read_format_isojoliet_long.c Tue Aug 30 16:52:25 2011 (r225267) @@ -111,7 +111,7 @@ DEFINE_TEST(test_read_format_isojoliet_l pathname[102] = '3'; pathname[103] = '\0'; assertEqualInt(0, archive_read_next_header(a, &ae)); - assertEqualString(pathname, archive_entry_pathname(ae)); + assertEqualString("hardlink", archive_entry_pathname(ae)); assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); assert(archive_entry_hardlink(ae) == NULL); assertEqualInt(6, archive_entry_size(ae)); @@ -123,9 +123,9 @@ DEFINE_TEST(test_read_format_isojoliet_l /* Second name for the same regular file (this happens to be * returned second, so does get marked as a hardlink). */ assertEqualInt(0, archive_read_next_header(a, &ae)); - assertEqualString("hardlink", archive_entry_pathname(ae)); + assertEqualString(pathname, archive_entry_pathname(ae)); assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); - assertEqualString(pathname, archive_entry_hardlink(ae)); + assertEqualString("hardlink", archive_entry_hardlink(ae)); assert(!archive_entry_size_is_set(ae)); /* End of archive. */ Modified: projects/ino64/lib/libarchive/test/test_read_format_isojoliet_rr.c ============================================================================== --- projects/ino64/lib/libarchive/test/test_read_format_isojoliet_rr.c Tue Aug 30 16:40:17 2011 (r225266) +++ projects/ino64/lib/libarchive/test/test_read_format_isojoliet_rr.c Tue Aug 30 16:52:25 2011 (r225267) @@ -98,7 +98,7 @@ DEFINE_TEST(test_read_format_isojoliet_r /* A regular file with two names ("hardlink" gets returned * first, so it's not marked as a hardlink). */ assertEqualInt(0, archive_read_next_header(a, &ae)); - assertEqualString("long-joliet-file-name.textfile", + assertEqualString("hardlink", archive_entry_pathname(ae)); assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); assert(archive_entry_hardlink(ae) == NULL); @@ -120,9 +120,10 @@ DEFINE_TEST(test_read_format_isojoliet_r /* Second name for the same regular file (this happens to be * returned second, so does get marked as a hardlink). */ assertEqualInt(0, archive_read_next_header(a, &ae)); - assertEqualString("hardlink", archive_entry_pathname(ae)); - assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); assertEqualString("long-joliet-file-name.textfile", + archive_entry_pathname(ae)); + assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); + assertEqualString("hardlink", archive_entry_hardlink(ae)); assert(!archive_entry_size_is_set(ae)); assertEqualInt(86401, archive_entry_mtime(ae)); Modified: projects/ino64/lib/libarchive/test/test_read_format_isorr_bz2.c ============================================================================== --- projects/ino64/lib/libarchive/test/test_read_format_isorr_bz2.c Tue Aug 30 16:40:17 2011 (r225266) +++ projects/ino64/lib/libarchive/test/test_read_format_isorr_bz2.c Tue Aug 30 16:52:25 2011 (r225267) @@ -97,9 +97,9 @@ DEFINE_TEST(test_read_format_isorr_bz2) assertEqualInt(2, archive_entry_stat(ae)->st_nlink); assertEqualInt(1, archive_entry_uid(ae)); assertEqualInt(2, archive_entry_gid(ae)); - } else if (strcmp("hardlink", archive_entry_pathname(ae)) == 0) { + } else if (strcmp("file", archive_entry_pathname(ae)) == 0) { /* A regular file. */ - assertEqualString("hardlink", archive_entry_pathname(ae)); + assertEqualString("file", archive_entry_pathname(ae)); assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); assertEqualInt(12345684, archive_entry_size(ae)); assertEqualInt(0, @@ -111,16 +111,16 @@ DEFINE_TEST(test_read_format_isorr_bz2) assertEqualInt(2, archive_entry_stat(ae)->st_nlink); assertEqualInt(1, archive_entry_uid(ae)); assertEqualInt(2, archive_entry_gid(ae)); - } else if (strcmp("file", archive_entry_pathname(ae)) == 0) { + } else if (strcmp("hardlink", archive_entry_pathname(ae)) == 0) { /* A hardlink to the regular file. */ /* Note: If "hardlink" gets returned before "file", * then "hardlink" will get returned as a regular file * and "file" will get returned as the hardlink. * This test should tolerate that, since it's a * perfectly permissible thing for libarchive to do. */ - assertEqualString("file", archive_entry_pathname(ae)); + assertEqualString("hardlink", archive_entry_pathname(ae)); assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); - assertEqualString("hardlink", archive_entry_hardlink(ae)); + assertEqualString("file", archive_entry_hardlink(ae)); assertEqualInt(0, archive_entry_size_is_set(ae)); assertEqualInt(0, archive_entry_size(ae)); assertEqualInt(86401, archive_entry_mtime(ae)); Modified: projects/ino64/lib/libarchive/test/test_read_format_isorr_new_bz2.c ============================================================================== --- projects/ino64/lib/libarchive/test/test_read_format_isorr_new_bz2.c Tue Aug 30 16:40:17 2011 (r225266) +++ projects/ino64/lib/libarchive/test/test_read_format_isorr_new_bz2.c Tue Aug 30 16:52:25 2011 (r225267) @@ -98,9 +98,9 @@ DEFINE_TEST(test_read_format_isorr_new_b assertEqualInt(2, archive_entry_stat(ae)->st_nlink); assertEqualInt(1, archive_entry_uid(ae)); assertEqualInt(2, archive_entry_gid(ae)); - } else if (strcmp("hardlink", archive_entry_pathname(ae)) == 0) { + } else if (strcmp("file", archive_entry_pathname(ae)) == 0) { /* A regular file. */ - assertEqualString("hardlink", archive_entry_pathname(ae)); + assertEqualString("file", archive_entry_pathname(ae)); assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); assertEqualInt(12345684, archive_entry_size(ae)); assertEqualInt(0, @@ -112,16 +112,16 @@ DEFINE_TEST(test_read_format_isorr_new_b assertEqualInt(2, archive_entry_stat(ae)->st_nlink); assertEqualInt(1, archive_entry_uid(ae)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Tue Aug 30 20:45:15 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C0C31065687; Tue, 30 Aug 2011 20:45:15 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C4F98FC12; Tue, 30 Aug 2011 20:45:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7UKjFal066475; Tue, 30 Aug 2011 20:45:15 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7UKjFCF066473; Tue, 30 Aug 2011 20:45:15 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201108302045.p7UKjFCF066473@svn.freebsd.org> From: Olivier Houchard Date: Tue, 30 Aug 2011 20:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225271 - projects/armv6/sys/arm/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2011 20:45:15 -0000 Author: cognet Date: Tue Aug 30 20:45:14 2011 New Revision: 225271 URL: http://svn.freebsd.org/changeset/base/225271 Log: Define _ARM_ARCH_7 when appropriate Submitted by: Damjan Marion Modified: projects/armv6/sys/arm/include/asm.h Modified: projects/armv6/sys/arm/include/asm.h ============================================================================== --- projects/armv6/sys/arm/include/asm.h Tue Aug 30 18:23:36 2011 (r225270) +++ projects/armv6/sys/arm/include/asm.h Tue Aug 30 20:45:14 2011 (r225271) @@ -130,6 +130,9 @@ .stabs __STRING(_/**/sym),1,0,0,0 #endif /* __STDC__ */ +#if defined (__ARM_ARCH_7__) || defined (__ARM_ARCH_7A__) +#define _ARM_ARCH_7 +#endif #if defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6J__) #define _ARM_ARCH_6 From owner-svn-src-projects@FreeBSD.ORG Tue Aug 30 20:54:55 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC7FE106564A; Tue, 30 Aug 2011 20:54:55 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB39E8FC12; Tue, 30 Aug 2011 20:54:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7UKstNf066768; Tue, 30 Aug 2011 20:54:55 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7UKst1A066762; Tue, 30 Aug 2011 20:54:55 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201108302054.p7UKst1A066762@svn.freebsd.org> From: Olivier Houchard Date: Tue, 30 Aug 2011 20:54:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225272 - in projects/armv6/sys/arm: arm include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2011 20:54:55 -0000 Author: cognet Date: Tue Aug 30 20:54:55 2011 New Revision: 225272 URL: http://svn.freebsd.org/changeset/base/225272 Log: Initial cortex-a[8|9] support. Some of those bits were submitted by Damjan Marion, and others by Ben Gray. Modified: projects/armv6/sys/arm/arm/cpufunc.c projects/armv6/sys/arm/arm/cpufunc_asm_armv7.S projects/armv6/sys/arm/arm/elf_trampoline.c projects/armv6/sys/arm/include/cpufunc.h projects/armv6/sys/arm/include/intr.h Modified: projects/armv6/sys/arm/arm/cpufunc.c ============================================================================== --- projects/armv6/sys/arm/arm/cpufunc.c Tue Aug 30 20:45:14 2011 (r225271) +++ projects/armv6/sys/arm/arm/cpufunc.c Tue Aug 30 20:54:55 2011 (r225272) @@ -968,6 +968,70 @@ struct cpu_functions fa526_cpufuncs = { }; #endif /* CPU_FA526 || CPU_FA626TE */ +#if defined(CPU_CORTEXA) +struct cpu_functions cortexa_cpufuncs = { + /* CPU functions */ + + cpufunc_id, /* id */ + cpufunc_nullop, /* cpwait */ + + /* MMU functions */ + + cpufunc_control, /* control */ + cpufunc_domains, /* Domain */ + armv7_setttb, /* Setttb */ + cpufunc_faultstatus, /* Faultstatus */ + cpufunc_faultaddress, /* Faultaddress */ + + /* TLB functions */ + + arm11_tlb_flushID, /* tlb_flushID */ + armv7_tlb_flushID_SE, /* tlb_flushID_SE */ + arm11_tlb_flushI, /* tlb_flushI */ + arm11_tlb_flushI_SE, /* tlb_flushI_SE */ + arm11_tlb_flushD, /* tlb_flushD */ + arm11_tlb_flushD_SE, /* tlb_flushD_SE */ + + /* Cache operations */ + + armv7_idcache_wbinv_all, /* icache_sync_all */ + armv7_icache_sync_range, /* icache_sync_range */ + + armv7_dcache_wbinv_all, /* dcache_wbinv_all */ + armv7_dcache_wbinv_range, /* dcache_wbinv_range */ + armv7_dcache_inv_range, /* dcache_inv_range */ + armv7_dcache_wb_range, /* dcache_wb_range */ + + armv7_idcache_wbinv_all, /* idcache_wbinv_all */ + armv7_idcache_wbinv_range, /* idcache_wbinv_range */ + + /* Note: From OMAP4 the L2 ops are filled in when the + * L2 cache controller is actually enabled. + */ + cpufunc_nullop, /* l2cache_wbinv_all */ + (void *)cpufunc_nullop, /* l2cache_wbinv_range */ + (void *)cpufunc_nullop, /* l2cache_inv_range */ + (void *)cpufunc_nullop, /* l2cache_wb_range */ + + /* Other functions */ + + cpufunc_nullop, /* flush_prefetchbuf */ + arm11_drain_writebuf, /* drain_writebuf */ + cpufunc_nullop, /* flush_brnchtgt_C */ + (void *)cpufunc_nullop, /* flush_brnchtgt_E */ + + arm11_sleep, /* sleep */ + + /* Soft functions */ + + cpufunc_null_fixup, /* dataabt_fixup */ + cpufunc_null_fixup, /* prefetchabt_fixup */ + + arm11_context_switch, /* context_switch */ + + cortexa_setup /* cpu setup */ +}; +#endif /* CPU_CORTEXA */ /* * Global constants also used by locore.s @@ -982,7 +1046,8 @@ u_int cpu_reset_needs_v4_MMU_disable; /* defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ defined(CPU_FA526) || defined(CPU_FA626TE) || defined(CPU_MV_PJ4B) || \ - defined(CPU_XSCALE_80219) || defined(CPU_XSCALE_81342) + defined(CPU_XSCALE_80219) || defined(CPU_XSCALE_81342) || \ + defined(CPU_CORTEXA) static void get_cachetype_cp15(void); @@ -1264,6 +1329,23 @@ set_cpufuncs() goto out; } #endif /* CPU_ARM10 */ +#ifdef CPU_CORTEXA + if (cputype == CPU_ID_CORTEXA8R1 || + cputype == CPU_ID_CORTEXA8R2 || + cputype == CPU_ID_CORTEXA8R3 || + cputype == CPU_ID_CORTEXA9R1 || + cputype == CPU_ID_CORTEXA9R2) { + cpufuncs = cortexa_cpufuncs; + cpu_reset_needs_v4_MMU_disable = 1; /* V4 or higher */ + get_cachetype_cp15(); + + pmap_pte_init_mmu_v6(); + /* Use powersave on this CPU. */ + cpu_do_powersave = 1; + goto out; + } +#endif /* CPU_CORTEXA */ + #if defined(CPU_MV_PJ4B) if (cputype == CPU_ID_MV88SV581X_V6 || cputype == CPU_ID_MV88SV581X_V7 || @@ -2226,6 +2308,52 @@ pj4bv7_setup(args) } #endif /* CPU_MV_PJ4B */ +#ifdef CPU_CORTEXA + +void +cortexa_setup(char *args) +{ + int cpuctrl, cpuctrlmask; + + cpuctrlmask = CPU_CONTROL_MMU_ENABLE | /* MMU enable [0] */ + CPU_CONTROL_AFLT_ENABLE | /* Alignment fault [1] */ + CPU_CONTROL_DC_ENABLE | /* DCache enable [2] */ + CPU_CONTROL_BPRD_ENABLE | /* Branch prediction [11] */ + CPU_CONTROL_IC_ENABLE | /* ICache enable [12] */ + CPU_CONTROL_VECRELOC; /* Vector relocation [13] */ + + cpuctrl = CPU_CONTROL_MMU_ENABLE | + CPU_CONTROL_IC_ENABLE | + CPU_CONTROL_DC_ENABLE | + CPU_CONTROL_V6_EXTPAGE | + CPU_CONTROL_BPRD_ENABLE; + +#ifndef ARM32_DISABLE_ALIGNMENT_FAULTS + cpuctrl |= CPU_CONTROL_AFLT_ENABLE; +#endif + + /* Switch to big endian */ +#ifdef __ARMEB__ + cpuctrl |= CPU_CONTROL_BEND_ENABLE; +#endif + + /* Check if the vector page is at the high address (0xffff0000) */ + if (vector_page == ARM_VECTORS_HIGH) + cpuctrl |= CPU_CONTROL_VECRELOC; + + /* Clear out the cache */ + cpu_idcache_wbinv_all(); + + /* Set the control register */ + ctrl = cpuctrl; + cpu_control(cpuctrlmask, cpuctrl); + + /* And again. */ + cpu_idcache_wbinv_all(); +} +#endif /* CPU_CORTEXA */ + + #ifdef CPU_SA110 struct cpu_option sa110_options[] = { #ifdef COMPAT_12 Modified: projects/armv6/sys/arm/arm/cpufunc_asm_armv7.S ============================================================================== --- projects/armv6/sys/arm/arm/cpufunc_asm_armv7.S Tue Aug 30 20:45:14 2011 (r225271) +++ projects/armv6/sys/arm/arm/cpufunc_asm_armv7.S Tue Aug 30 20:54:55 2011 (r225272) @@ -32,8 +32,6 @@ #include __FBSDID("$FreeBSD$"); -#define isb mcr p15, 0, r0, c7, c5, 4 -#define dsb mcr p15, 0, r0, c7, c10, 4 #define TTB (0x59) .Lcoherency_level: @@ -48,16 +46,22 @@ __FBSDID("$FreeBSD$"); .word 0xfff ENTRY(armv7_setttb) - bic r0, r0, #0x18 - mcr p15, 0, r0, c2, c0, 0 /* load new TTB */ - mcr p15, 0, r0, c7, c5, 4 /* ISB */ + stmdb sp!, {r0, lr} + bl _C_LABEL(armv7_idcache_wbinv_all) /* clean the D cache */ + ldmia sp!, {r0, lr} + dsb + mcr p15, 0, r0, c2, c0, 0 /* Translation Table Base Register 0 (TTBR0) */ + mcr p15, 0, r0, c8, c7, 0 /* invalidate I+D TLBs */ + dsb + isb RET ENTRY(armv7_tlb_flushID) - mcr p15, 0, r0, c7, c10, 4 /* DSB */ + dsb mcr p15, 0, r0, c8, c7, 0 /* flush I+D tlb */ mcr p15, 0, r0, c7, c5, 6 /* flush BTB */ - mcr p15, 0, r0, c7, c10, 4 /* DSB */ + dsb + isb mov pc, lr ENTRY(armv7_tlb_flushID_SE) @@ -65,7 +69,7 @@ ENTRY(armv7_tlb_flushID_SE) bic r0, r0, r1 mcr p15, 0, r0, c8, c7, 1 /* flush D tlb single entry */ mcr p15, 0, r0, c7, c5, 6 /* flush BTB */ - mcr p15, 0, r0, c7, c10, 4 /* DSB */ + dsb mov pc, lr /* Based on algorithm from ARM Architecture Reference Manual */ @@ -115,19 +119,19 @@ Skip: cmp r3, r8 bne Loop1 Finished: - mcr p15, 0, r0, c7, c5, 4 + isb mcr p15, 0, r0, c7, c5, 5 ldmia sp!, {r4, r5, r6, r7, r8, r9} -RET + RET ENTRY(armv7_idcache_wbinv_all) stmdb sp!, {lr} bl armv7_dcache_wbinv_all - mcr p15, 0, r0, c7, c5, 0 /* Invalidate I cache SE with VA */ - mcr p15, 0, r0, c7, c10, 4 - mcr p15, 0, r0, c7, c5, 4 + mcr p15, 0, r0, c7, c5, 0 /* Invalidate all I caches to PoU (ICIALLU) */ + dsb + isb ldmia sp!, {lr} -RET + RET /* XXX Temporary set it to 32 for MV cores, however this value should be * get from Cache Type register @@ -142,8 +146,8 @@ ENTRY(armv7_dcache_wb_range) add r0, r0, ip subs r1, r1, ip bhi .Larmv7_wb_next - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - bx lr + dsb /* data synchronization barrier */ + RET ENTRY(armv7_dcache_wbinv_range) ldr ip, .Larmv7_line_size @@ -152,8 +156,8 @@ ENTRY(armv7_dcache_wbinv_range) add r0, r0, ip subs r1, r1, ip bhi .Larmv7_wbinv_next - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - bx lr + dsb /* data synchronization barrier */ + RET /* * Note, we must not invalidate everything. If the range is too big we @@ -166,8 +170,8 @@ ENTRY(armv7_dcache_inv_range) add r0, r0, ip subs r1, r1, ip bhi .Larmv7_inv_next - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - bx lr + dsb /* data synchronization barrier */ + RET ENTRY(armv7_idcache_wbinv_range) ldr ip, .Larmv7_line_size @@ -177,8 +181,8 @@ ENTRY(armv7_idcache_wbinv_range) add r0, r0, ip subs r1, r1, ip bhi .Larmv7_id_wbinv_next - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - bx lr + dsb /* data synchronization barrier */ + RET ENTRY_NP(armv7_icache_sync_range) ldr ip, .Larmv7_line_size @@ -188,11 +192,22 @@ ENTRY_NP(armv7_icache_sync_range) add r0, r0, ip subs r1, r1, ip bhi .Larmv7_sync_next - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - bx lr + dsb /* data synchronization barrier */ + RET ENTRY(armv7_cpu_sleep) - mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ - /* FIXME: replace with WFI instruction when AS will support it */ - .word 0xe320f003 /* wait for interrupt */ - bx lr + dsb /* data synchronization barrier */ + wfi /* wait for interrupt */ + RET + +ENTRY(armv7_context_switch) + dsb + mcr p15, 0, r0, c2, c0, 0 /* set the new TTB */ + mcr p15, 0, r0, c8, c7, 0 /* and flush the I+D tlbs */ + dsb + isb + RET + +ENTRY(armv7_drain_writebuf) + dsb + RET Modified: projects/armv6/sys/arm/arm/elf_trampoline.c ============================================================================== --- projects/armv6/sys/arm/arm/elf_trampoline.c Tue Aug 30 20:45:14 2011 (r225271) +++ projects/armv6/sys/arm/arm/elf_trampoline.c Tue Aug 30 20:54:55 2011 (r225272) @@ -83,6 +83,9 @@ void __startC(void); #define cpu_l2cache_wbinv_all xscalec3_l2cache_purge #elif defined(SOC_MV_KIRKWOOD) || defined(SOC_MV_DISCOVERY) #define cpu_l2cache_wbinv_all sheeva_l2cache_wbinv_all +#elif defined(CPU_CORTEXA) +#define cpu_idcache_wbinv_all armv7_idcache_wbinv_all +#define cpu_l2cache_wbinv_all() #else #define cpu_l2cache_wbinv_all() #endif @@ -103,6 +106,10 @@ int arm_pcache_unified; int arm_dcache_align; int arm_dcache_align_mask; +u_int arm_cache_level; +u_int arm_cache_type[14]; +u_int arm_cache_loc; + /* Additional cache information local to this file. Log2 of some of the above numbers. */ static int arm_dcache_l2_nsets; @@ -237,68 +244,102 @@ _startC(void) static void get_cachetype_cp15() { - u_int ctype, isize, dsize; + u_int ctype, isize, dsize, cpuid; + u_int clevel, csize, i, sel; u_int multiplier; + u_char type; __asm __volatile("mrc p15, 0, %0, c0, c0, 1" - : "=r" (ctype)); - + : "=r" (ctype)); + + cpuid = cpufunc_id(); /* * ...and thus spake the ARM ARM: * - * If an value corresponding to an unimplemented or + * If an value corresponding to an unimplemented or * reserved ID register is encountered, the System Control * processor returns the value of the main ID register. */ - if (ctype == cpufunc_id()) + if (ctype == cpuid) goto out; - - if ((ctype & CPU_CT_S) == 0) - arm_pcache_unified = 1; - /* - * If you want to know how this code works, go read the ARM ARM. - */ - - arm_pcache_type = CPU_CT_CTYPE(ctype); - if (arm_pcache_unified == 0) { - isize = CPU_CT_ISIZE(ctype); - multiplier = (isize & CPU_CT_xSIZE_M) ? 3 : 2; - arm_picache_line_size = 1U << (CPU_CT_xSIZE_LEN(isize) + 3); - if (CPU_CT_xSIZE_ASSOC(isize) == 0) { - if (isize & CPU_CT_xSIZE_M) - arm_picache_line_size = 0; /* not present */ + if (CPU_CT_FORMAT(ctype) == CPU_CT_ARMV7) { + __asm __volatile("mrc p15, 1, %0, c0, c0, 1" + : "=r" (clevel)); + arm_cache_level = clevel; + arm_cache_loc = CPU_CLIDR_LOC(arm_cache_level) + 1; + i = 0; + while ((type = (clevel & 0x7)) && i < 7) { + if (type == CACHE_DCACHE || type == CACHE_UNI_CACHE || + type == CACHE_SEP_CACHE) { + sel = i << 1; + __asm __volatile("mcr p15, 2, %0, c0, c0, 0" + : : "r" (sel)); + __asm __volatile("mrc p15, 1, %0, c0, c0, 0" + : "=r" (csize)); + arm_cache_type[sel] = csize; + } + if (type == CACHE_ICACHE || type == CACHE_SEP_CACHE) { + sel = (i << 1) | 1; + __asm __volatile("mcr p15, 2, %0, c0, c0, 0" + : : "r" (sel)); + __asm __volatile("mrc p15, 1, %0, c0, c0, 0" + : "=r" (csize)); + arm_cache_type[sel] = csize; + } + i++; + clevel >>= 3; + } + } else { + if ((ctype & CPU_CT_S) == 0) + arm_pcache_unified = 1; + + /* + * If you want to know how this code works, go read the ARM ARM. + */ + + arm_pcache_type = CPU_CT_CTYPE(ctype); + + if (arm_pcache_unified == 0) { + isize = CPU_CT_ISIZE(ctype); + multiplier = (isize & CPU_CT_xSIZE_M) ? 3 : 2; + arm_picache_line_size = 1U << (CPU_CT_xSIZE_LEN(isize) + 3); + if (CPU_CT_xSIZE_ASSOC(isize) == 0) { + if (isize & CPU_CT_xSIZE_M) + arm_picache_line_size = 0; /* not present */ + else + arm_picache_ways = 1; + } else { + arm_picache_ways = multiplier << + (CPU_CT_xSIZE_ASSOC(isize) - 1); + } + arm_picache_size = multiplier << (CPU_CT_xSIZE_SIZE(isize) + 8); + } + + dsize = CPU_CT_DSIZE(ctype); + multiplier = (dsize & CPU_CT_xSIZE_M) ? 3 : 2; + arm_pdcache_line_size = 1U << (CPU_CT_xSIZE_LEN(dsize) + 3); + if (CPU_CT_xSIZE_ASSOC(dsize) == 0) { + if (dsize & CPU_CT_xSIZE_M) + arm_pdcache_line_size = 0; /* not present */ else - arm_picache_ways = 1; + arm_pdcache_ways = 1; } else { - arm_picache_ways = multiplier << - (CPU_CT_xSIZE_ASSOC(isize) - 1); + arm_pdcache_ways = multiplier << + (CPU_CT_xSIZE_ASSOC(dsize) - 1); } - arm_picache_size = multiplier << (CPU_CT_xSIZE_SIZE(isize) + 8); - } - - dsize = CPU_CT_DSIZE(ctype); - multiplier = (dsize & CPU_CT_xSIZE_M) ? 3 : 2; - arm_pdcache_line_size = 1U << (CPU_CT_xSIZE_LEN(dsize) + 3); - if (CPU_CT_xSIZE_ASSOC(dsize) == 0) { - if (dsize & CPU_CT_xSIZE_M) - arm_pdcache_line_size = 0; /* not present */ - else - arm_pdcache_ways = 1; - } else { - arm_pdcache_ways = multiplier << - (CPU_CT_xSIZE_ASSOC(dsize) - 1); + arm_pdcache_size = multiplier << (CPU_CT_xSIZE_SIZE(dsize) + 8); + + arm_dcache_align = arm_pdcache_line_size; + + arm_dcache_l2_assoc = CPU_CT_xSIZE_ASSOC(dsize) + multiplier - 2; + arm_dcache_l2_linesize = CPU_CT_xSIZE_LEN(dsize) + 3; + arm_dcache_l2_nsets = 6 + CPU_CT_xSIZE_SIZE(dsize) - + CPU_CT_xSIZE_ASSOC(dsize) - CPU_CT_xSIZE_LEN(dsize); + + out: + arm_dcache_align_mask = arm_dcache_align - 1; } - arm_pdcache_size = multiplier << (CPU_CT_xSIZE_SIZE(dsize) + 8); - - arm_dcache_align = arm_pdcache_line_size; - - arm_dcache_l2_assoc = CPU_CT_xSIZE_ASSOC(dsize) + multiplier - 2; - arm_dcache_l2_linesize = CPU_CT_xSIZE_LEN(dsize) + 3; - arm_dcache_l2_nsets = 6 + CPU_CT_xSIZE_SIZE(dsize) - - CPU_CT_xSIZE_ASSOC(dsize) - CPU_CT_xSIZE_LEN(dsize); - out: - arm_dcache_align_mask = arm_dcache_align - 1; } static void Modified: projects/armv6/sys/arm/include/cpufunc.h ============================================================================== --- projects/armv6/sys/arm/include/cpufunc.h Tue Aug 30 20:45:14 2011 (r225271) +++ projects/armv6/sys/arm/include/cpufunc.h Tue Aug 30 20:54:55 2011 (r225272) @@ -415,8 +415,9 @@ void sheeva_l2cache_wb_range (vm_offset void sheeva_l2cache_wbinv_all (void); #endif -#if defined(CPU_ARM11) || defined(CPU_MV_PJ4B) +#if defined(CPU_ARM11) || defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) void arm11_setttb (u_int); +void arm11_sleep (int); void arm11_tlb_flushID_SE (u_int); void arm11_tlb_flushI_SE (u_int); @@ -455,6 +456,7 @@ void armv6_icache_sync_all (void); void armv6_dcache_wbinv_all (void); void armv6_idcache_wbinv_all (void); +void armv7_setttb (u_int); void armv7_tlb_flushID (void); void armv7_tlb_flushID_SE (u_int); void armv7_icache_sync_range (vm_offset_t, vm_size_t); @@ -464,11 +466,17 @@ void armv7_idcache_wbinv_all (void); void armv7_dcache_wbinv_range (vm_offset_t, vm_size_t); void armv7_dcache_inv_range (vm_offset_t, vm_size_t); void armv7_dcache_wb_range (vm_offset_t, vm_size_t); +void armv7_cpu_sleep (int); +void armv7_setup (char *string); +void armv7_context_switch (void); +void armv7_drain_writebuf (void); void pj4bv7_setup (char *string); void pj4bv6_setup (char *string); void pj4b_config (void); void armadaxp_idcache_wbinv_all (void); + +void cortexa_setup (char *); #endif #if defined(CPU_ARM9E) || defined (CPU_ARM10) Modified: projects/armv6/sys/arm/include/intr.h ============================================================================== --- projects/armv6/sys/arm/include/intr.h Tue Aug 30 20:45:14 2011 (r225271) +++ projects/armv6/sys/arm/include/intr.h Tue Aug 30 20:54:55 2011 (r225272) @@ -50,6 +50,8 @@ #elif defined(CPU_ARM9) || defined(SOC_MV_KIRKWOOD) || \ defined(CPU_XSCALE_IXP435) #define NIRQ 64 +#elif defined(CPU_CORTEXA) +#define NIRQ 128 #else #define NIRQ 32 #endif From owner-svn-src-projects@FreeBSD.ORG Wed Aug 31 07:46:37 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23ADA106566C; Wed, 31 Aug 2011 07:46:37 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0907C8FC13; Wed, 31 Aug 2011 07:46:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7V7kaNE088805; Wed, 31 Aug 2011 07:46:36 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7V7karn088792; Wed, 31 Aug 2011 07:46:36 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201108310746.p7V7karn088792@svn.freebsd.org> From: Grzegorz Bernacki Date: Wed, 31 Aug 2011 07:46:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225285 - in projects/armv6/sys/arm: arm at91 econa include mv s3c2xx0 sa11x0 xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2011 07:46:37 -0000 Author: gber Date: Wed Aug 31 07:46:36 2011 New Revision: 225285 URL: http://svn.freebsd.org/changeset/base/225285 Log: Make __pcpu variable an array. Obtained from: Marvell, Semihalf Modified: projects/armv6/sys/arm/arm/machdep.c projects/armv6/sys/arm/at91/at91_machdep.c projects/armv6/sys/arm/econa/econa_machdep.c projects/armv6/sys/arm/include/pcpu.h projects/armv6/sys/arm/mv/mv_machdep.c projects/armv6/sys/arm/s3c2xx0/s3c24x0_machdep.c projects/armv6/sys/arm/sa11x0/assabet_machdep.c projects/armv6/sys/arm/xscale/i80321/ep80219_machdep.c projects/armv6/sys/arm/xscale/i80321/iq31244_machdep.c projects/armv6/sys/arm/xscale/i8134x/crb_machdep.c projects/armv6/sys/arm/xscale/ixp425/avila_machdep.c projects/armv6/sys/arm/xscale/pxa/pxa_machdep.c Modified: projects/armv6/sys/arm/arm/machdep.c ============================================================================== --- projects/armv6/sys/arm/arm/machdep.c Wed Aug 31 07:20:43 2011 (r225284) +++ projects/armv6/sys/arm/arm/machdep.c Wed Aug 31 07:46:36 2011 (r225285) @@ -92,6 +92,9 @@ __FBSDID("$FreeBSD$"); #include #include +struct pcpu __pcpu[MAXCPU]; +struct pcpu *pcpup = &__pcpu[0]; + uint32_t cpu_reset_address = 0; int cold = 1; vm_offset_t vector_page; @@ -707,3 +710,11 @@ fake_preload_metadata(void) return (lastaddr); } + +void +pcpu0_init(void) +{ + + pcpu_init(pcpup, 0, sizeof(struct pcpu)); + PCPU_SET(curthread, &thread0); +} Modified: projects/armv6/sys/arm/at91/at91_machdep.c ============================================================================== --- projects/armv6/sys/arm/at91/at91_machdep.c Wed Aug 31 07:20:43 2011 (r225284) +++ projects/armv6/sys/arm/at91/at91_machdep.c Wed Aug 31 07:46:36 2011 (r225285) @@ -116,9 +116,6 @@ extern void *_end; extern int *end; -struct pcpu __pcpu; -struct pcpu *pcpup = &__pcpu; - /* Physical and virtual addresses for some global pages */ vm_paddr_t phys_avail[10]; @@ -252,8 +249,7 @@ initarm(void *arg, void *arg2) boot_arg2 = arg2; set_cpufuncs(); lastaddr = fake_preload_metadata(); - pcpu_init(pcpup, 0, sizeof(struct pcpu)); - PCPU_SET(curthread, &thread0); + pcpu0_init(); /* Do basic tuning, hz etc */ init_param1(); Modified: projects/armv6/sys/arm/econa/econa_machdep.c ============================================================================== --- projects/armv6/sys/arm/econa/econa_machdep.c Wed Aug 31 07:20:43 2011 (r225284) +++ projects/armv6/sys/arm/econa/econa_machdep.c Wed Aug 31 07:46:36 2011 (r225285) @@ -107,9 +107,6 @@ extern void *_end; extern int *end; -struct pcpu __pcpu; -struct pcpu *pcpup = &__pcpu; - /* Physical and virtual addresses for some global pages */ vm_paddr_t phys_avail[10]; @@ -205,8 +202,7 @@ initarm(void *arg, void *arg2) set_cpufuncs(); lastaddr = fake_preload_metadata(); - pcpu_init(pcpup, 0, sizeof(struct pcpu)); - PCPU_SET(curthread, &thread0); + pcpu0_init(); /* Do basic tuning, hz etc */ init_param1(); Modified: projects/armv6/sys/arm/include/pcpu.h ============================================================================== --- projects/armv6/sys/arm/include/pcpu.h Wed Aug 31 07:20:43 2011 (r225284) +++ projects/armv6/sys/arm/include/pcpu.h Wed Aug 31 07:46:36 2011 (r225285) @@ -48,19 +48,19 @@ struct pcb; struct pcpu; extern struct pcpu *pcpup; -extern struct pcpu __pcpu; -#define PCPU_GET(member) (__pcpu.pc_ ## member) +#define PCPU_GET(member) (pcpup->pc_ ## member) /* * XXX The implementation of this operation should be made atomic * with respect to preemption. */ -#define PCPU_ADD(member, value) (__pcpu.pc_ ## member += (value)) +#define PCPU_ADD(member, value) (pcpup->pc_ ## member += (value)) #define PCPU_INC(member) PCPU_ADD(member, 1) -#define PCPU_PTR(member) (&__pcpu.pc_ ## member) -#define PCPU_SET(member,value) (__pcpu.pc_ ## member = (value)) +#define PCPU_PTR(member) (&pcpup->pc_ ## member) +#define PCPU_SET(member,value) (pcpup->pc_ ## member = (value)) +void pcpu0_init(void); #endif /* _KERNEL */ #endif /* !_MACHINE_PCPU_H_ */ Modified: projects/armv6/sys/arm/mv/mv_machdep.c ============================================================================== --- projects/armv6/sys/arm/mv/mv_machdep.c Wed Aug 31 07:20:43 2011 (r225284) +++ projects/armv6/sys/arm/mv/mv_machdep.c Wed Aug 31 07:46:36 2011 (r225285) @@ -130,11 +130,8 @@ extern vm_offset_t pmap_bootstrap_lastad extern int *end; struct pv_addr kernel_pt_table[KERNEL_PT_MAX]; -struct pcpu __pcpu; -struct pcpu *pcpup = &__pcpu; /* Physical and virtual addresses for some global pages */ - vm_paddr_t phys_avail[10]; vm_paddr_t dump_avail[4]; vm_offset_t physical_pages; @@ -372,8 +369,7 @@ initarm(void *mdp, void *unused __unused /* Platform-specific initialisation */ pmap_bootstrap_lastaddr = fdt_immr_va - ARM_NOCACHE_KVA_SIZE; - pcpu_init(pcpup, 0, sizeof(struct pcpu)); - PCPU_SET(curthread, &thread0); + pcpu0_init(); /* Calculate number of L2 tables needed for mapping vm_page_array */ l2size = (memsize / PAGE_SIZE) * sizeof(struct vm_page); Modified: projects/armv6/sys/arm/s3c2xx0/s3c24x0_machdep.c ============================================================================== --- projects/armv6/sys/arm/s3c2xx0/s3c24x0_machdep.c Wed Aug 31 07:20:43 2011 (r225284) +++ projects/armv6/sys/arm/s3c2xx0/s3c24x0_machdep.c Wed Aug 31 07:46:36 2011 (r225285) @@ -122,9 +122,6 @@ extern void *_end; extern int *end; -struct pcpu __pcpu; -struct pcpu *pcpup = &__pcpu; - /* Physical and virtual addresses for some global pages */ vm_paddr_t phys_avail[10]; @@ -254,8 +251,7 @@ initarm(void *arg, void *arg2) cpufuncs.cf_sleep = s3c24x0_sleep; lastaddr = fake_preload_metadata(); - pcpu_init(pcpup, 0, sizeof(struct pcpu)); - PCPU_SET(curthread, &thread0); + pcpu0_init(); /* Do basic tuning, hz etc */ init_param1(); Modified: projects/armv6/sys/arm/sa11x0/assabet_machdep.c ============================================================================== --- projects/armv6/sys/arm/sa11x0/assabet_machdep.c Wed Aug 31 07:20:43 2011 (r225284) +++ projects/armv6/sys/arm/sa11x0/assabet_machdep.c Wed Aug 31 07:46:36 2011 (r225285) @@ -127,9 +127,6 @@ extern vm_offset_t sa1_cache_clean_addr; extern int *end; -struct pcpu __pcpu; -struct pcpu *pcpup = &__pcpu; - #ifndef MD_ROOT_SIZE #define MD_ROOT_SIZE 65535 #endif @@ -203,7 +200,6 @@ cpu_reset() void * initarm(void *arg, void *arg2) { - struct pcpu *pc; struct pv_addr kernel_l1pt; struct pv_addr md_addr; struct pv_addr md_bla; @@ -221,9 +217,7 @@ initarm(void *arg, void *arg2) set_cpufuncs(); lastaddr = fake_preload_metadata(); physmem = memsize / PAGE_SIZE; - pc = &__pcpu; - pcpu_init(pc, 0, sizeof(struct pcpu)); - PCPU_SET(curthread, &thread0); + pcpu0_init(); /* Do basic tuning, hz etc */ init_param1(); Modified: projects/armv6/sys/arm/xscale/i80321/ep80219_machdep.c ============================================================================== --- projects/armv6/sys/arm/xscale/i80321/ep80219_machdep.c Wed Aug 31 07:20:43 2011 (r225284) +++ projects/armv6/sys/arm/xscale/i80321/ep80219_machdep.c Wed Aug 31 07:46:36 2011 (r225285) @@ -119,9 +119,6 @@ extern void *_end; extern int *end; -struct pcpu __pcpu; -struct pcpu *pcpup = &__pcpu; - /* Physical and virtual addresses for some global pages */ vm_paddr_t phys_avail[10]; @@ -196,8 +193,7 @@ initarm(void *arg, void *arg2) set_cpufuncs(); lastaddr = fake_preload_metadata(); - pcpu_init(pcpup, 0, sizeof(struct pcpu)); - PCPU_SET(curthread, &thread0); + pcpu0_init(); freemempos = 0xa0200000; /* Define a macro to simplify memory allocation */ Modified: projects/armv6/sys/arm/xscale/i80321/iq31244_machdep.c ============================================================================== --- projects/armv6/sys/arm/xscale/i80321/iq31244_machdep.c Wed Aug 31 07:20:43 2011 (r225284) +++ projects/armv6/sys/arm/xscale/i80321/iq31244_machdep.c Wed Aug 31 07:46:36 2011 (r225285) @@ -119,9 +119,6 @@ extern void *_end; extern int *end; -struct pcpu __pcpu; -struct pcpu *pcpup = &__pcpu; - /* Physical and virtual addresses for some global pages */ vm_paddr_t phys_avail[10]; @@ -197,8 +194,7 @@ initarm(void *arg, void *arg2) set_cpufuncs(); lastaddr = fake_preload_metadata(); - pcpu_init(pcpup, 0, sizeof(struct pcpu)); - PCPU_SET(curthread, &thread0); + pcpu0_init(); /* Do basic tuning, hz etc */ init_param1(); Modified: projects/armv6/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- projects/armv6/sys/arm/xscale/i8134x/crb_machdep.c Wed Aug 31 07:20:43 2011 (r225284) +++ projects/armv6/sys/arm/xscale/i8134x/crb_machdep.c Wed Aug 31 07:46:36 2011 (r225285) @@ -119,9 +119,6 @@ extern u_int undefined_handler_address; struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; extern int *end; -struct pcpu __pcpu; -struct pcpu *pcpup = &__pcpu; - /* Physical and virtual addresses for some global pages */ vm_paddr_t phys_avail[10]; @@ -193,8 +190,7 @@ initarm(void *arg, void *arg2) set_cpufuncs(); lastaddr = fake_preload_metadata(); - pcpu_init(pcpup, 0, sizeof(struct pcpu)); - PCPU_SET(curthread, &thread0); + pcpu0_init(); /* Do basic tuning, hz etc */ init_param1(); Modified: projects/armv6/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- projects/armv6/sys/arm/xscale/ixp425/avila_machdep.c Wed Aug 31 07:20:43 2011 (r225284) +++ projects/armv6/sys/arm/xscale/ixp425/avila_machdep.c Wed Aug 31 07:46:36 2011 (r225285) @@ -123,9 +123,6 @@ extern void *_end; extern int *end; -struct pcpu __pcpu; -struct pcpu *pcpup = &__pcpu; - /* Physical and virtual addresses for some global pages */ vm_paddr_t phys_avail[10]; @@ -242,8 +239,7 @@ initarm(void *arg, void *arg2) set_cpufuncs(); /* NB: sets cputype */ lastaddr = fake_preload_metadata(); - pcpu_init(pcpup, 0, sizeof(struct pcpu)); - PCPU_SET(curthread, &thread0); + pcpu0_init(); /* Do basic tuning, hz etc */ init_param1(); Modified: projects/armv6/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- projects/armv6/sys/arm/xscale/pxa/pxa_machdep.c Wed Aug 31 07:20:43 2011 (r225284) +++ projects/armv6/sys/arm/xscale/pxa/pxa_machdep.c Wed Aug 31 07:46:36 2011 (r225285) @@ -119,9 +119,6 @@ extern void *_end; extern int *end; -struct pcpu __pcpu; -struct pcpu *pcpup = &__pcpu; - /* Physical and virtual addresses for some global pages */ vm_paddr_t phys_avail[PXA2X0_SDRAM_BANKS * 2 + 4]; @@ -179,8 +176,7 @@ initarm(void *arg, void *arg2) set_cpufuncs(); lastaddr = fake_preload_metadata(); - pcpu_init(pcpup, 0, sizeof(struct pcpu)); - PCPU_SET(curthread, &thread0); + pcpu0_init(); /* Do basic tuning, hz etc */ init_param1(); From owner-svn-src-projects@FreeBSD.ORG Wed Aug 31 08:27:42 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22235106564A; Wed, 31 Aug 2011 08:27:42 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2AF68FC0C; Wed, 31 Aug 2011 08:27:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7V8RfBD090089; Wed, 31 Aug 2011 08:27:41 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7V8RfcF090087; Wed, 31 Aug 2011 08:27:41 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201108310827.p7V8RfcF090087@svn.freebsd.org> From: Grzegorz Bernacki Date: Wed, 31 Aug 2011 08:27:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225286 - projects/armv6/sys/arm/arm X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2011 08:27:42 -0000 Author: gber Date: Wed Aug 31 08:27:41 2011 New Revision: 225286 URL: http://svn.freebsd.org/changeset/base/225286 Log: Refactor ARM9E/ARM10 cpufunc initialization. Obtained from: Marvell, Semihalf Modified: projects/armv6/sys/arm/arm/cpufunc.c Modified: projects/armv6/sys/arm/arm/cpufunc.c ============================================================================== --- projects/armv6/sys/arm/arm/cpufunc.c Wed Aug 31 07:46:36 2011 (r225285) +++ projects/armv6/sys/arm/arm/cpufunc.c Wed Aug 31 08:27:41 2011 (r225286) @@ -1270,40 +1270,33 @@ set_cpufuncs() } #endif /* CPU_ARM9 */ #if defined(CPU_ARM9E) || defined(CPU_ARM10) - if (cputype == CPU_ID_ARM926EJS || cputype == CPU_ID_ARM1026EJS || - cputype == CPU_ID_MV88FR131 || cputype == CPU_ID_MV88FR571_VD || + if (cputype == CPU_ID_MV88FR131 || cputype == CPU_ID_MV88FR571_VD || cputype == CPU_ID_MV88FR571_41) { - if (cputype == CPU_ID_MV88FR131 || - cputype == CPU_ID_MV88FR571_VD || - cputype == CPU_ID_MV88FR571_41) { - - cpufuncs = sheeva_cpufuncs; - /* - * Workaround for Marvell MV78100 CPU: Cache prefetch - * mechanism may affect the cache coherency validity, - * so it needs to be disabled. - * - * Refer to errata document MV-S501058-00C.pdf (p. 3.1 - * L2 Prefetching Mechanism) for details. - */ - if (cputype == CPU_ID_MV88FR571_VD || - cputype == CPU_ID_MV88FR571_41) { - sheeva_control_ext(0xffffffff, - FC_DCACHE_STREAM_EN | FC_WR_ALLOC_EN | - FC_BRANCH_TARG_BUF_DIS | FC_L2CACHE_EN | - FC_L2_PREF_DIS); - } else { - sheeva_control_ext(0xffffffff, - FC_DCACHE_STREAM_EN | FC_WR_ALLOC_EN | - FC_BRANCH_TARG_BUF_DIS | FC_L2CACHE_EN); - } + uint32_t sheeva_ctrl; + + sheeva_ctrl = (MV_DC_STREAM_ENABLE | MV_BTB_DISABLE | + MV_L2_ENABLE); + /* + * Workaround for Marvell MV78100 CPU: Cache prefetch + * mechanism may affect the cache coherency validity, + * so it needs to be disabled. + * + * Refer to errata document MV-S501058-00C.pdf (p. 3.1 + * L2 Prefetching Mechanism) for details. + */ + if (cputype == CPU_ID_MV88FR571_VD || + cputype == CPU_ID_MV88FR571_41) + sheeva_ctrl |= MV_L2_PREFETCH_DISABLE; - /* Use powersave on this CPU. */ - cpu_do_powersave = 1; - } else - cpufuncs = armv5_ec_cpufuncs; + sheeva_control_ext(0xffffffff & ~MV_WA_ENABLE, sheeva_ctrl); - cpu_reset_needs_v4_MMU_disable = 1; /* V4 or higher */ + cpufuncs = sheeva_cpufuncs; + get_cachetype_cp15(); + pmap_pte_init_generic(); + goto out; + } else if (cputype == CPU_ID_ARM926EJS || cputype == CPU_ID_ARM926ES || + cputype == CPU_ID_ARM1026EJS) + cpufuncs = armv5_ec_cpufuncs; get_cachetype_cp15(); pmap_pte_init_generic(); goto out; From owner-svn-src-projects@FreeBSD.ORG Wed Aug 31 08:44:45 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C9151065670; Wed, 31 Aug 2011 08:44:45 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CBD78FC13; Wed, 31 Aug 2011 08:44:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7V8ij6u090608; Wed, 31 Aug 2011 08:44:45 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7V8ijCR090606; Wed, 31 Aug 2011 08:44:45 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201108310844.p7V8ijCR090606@svn.freebsd.org> From: Grzegorz Bernacki Date: Wed, 31 Aug 2011 08:44:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225287 - projects/armv6/sys/arm/arm X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2011 08:44:45 -0000 Author: gber Date: Wed Aug 31 08:44:45 2011 New Revision: 225287 URL: http://svn.freebsd.org/changeset/base/225287 Log: Allow pmap_map_section and pmap_map_entry to use cache parameter as an index to array with setting for memory type. Obtained from: Marvell, Semihalf Modified: projects/armv6/sys/arm/arm/pmap-v6.c Modified: projects/armv6/sys/arm/arm/pmap-v6.c ============================================================================== --- projects/armv6/sys/arm/arm/pmap-v6.c Wed Aug 31 08:27:41 2011 (r225286) +++ projects/armv6/sys/arm/arm/pmap-v6.c Wed Aug 31 08:44:45 2011 (r225287) @@ -3501,20 +3501,7 @@ pmap_map_section(vm_offset_t l1pt, vm_of KASSERT(((va | pa) & L1_S_OFFSET) == 0, ("ouin2")); - switch (cache) { - case PTE_NOCACHE: - default: - fl = 0; - break; - - case PTE_CACHE: - fl = pte_l1_s_cache_mode; - break; - - case PTE_PAGETABLE: - fl = pte_l1_s_cache_mode_pt; - break; - } + fl = l1_mem_types[cache]; pde[va >> L1_S_SHIFT] = L1_S_PROTO | pa | L1_S_PROT(PTE_KERNEL, prot) | fl | L1_S_DOM(PMAP_DOMAIN_KERNEL); @@ -3561,20 +3548,7 @@ pmap_map_entry(vm_offset_t l1pt, vm_offs KASSERT(((va | pa) & PAGE_MASK) == 0, ("ouin")); - switch (cache) { - case PTE_NOCACHE: - default: - fl = 0; - break; - - case PTE_CACHE: - fl = pte_l2_s_cache_mode; - break; - - case PTE_PAGETABLE: - fl = pte_l2_s_cache_mode_pt; - break; - } + fl = l2s_mem_types[cache]; if ((pde[va >> L1_S_SHIFT] & L1_TYPE_MASK) != L1_TYPE_C) panic("pmap_map_entry: no L2 table for VA 0x%08x", va); @@ -3612,7 +3586,7 @@ pmap_map_chunk(vm_offset_t l1pt, vm_offs #ifdef VERBOSE_INIT_ARM printf("pmap_map_chunk: pa=0x%x va=0x%x size=0x%x resid=0x%x " - "prot=0x%x type=%d\n", pa, va, size, resid, prot, type); + "prot=0x%x cache=%d\n", pa, va, size, resid, prot, cache); #endif f1 = l1_mem_types[type]; From owner-svn-src-projects@FreeBSD.ORG Wed Aug 31 09:29:46 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C664106564A; Wed, 31 Aug 2011 09:29:46 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 622AA8FC17; Wed, 31 Aug 2011 09:29:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7V9TkSU092047; Wed, 31 Aug 2011 09:29:46 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7V9Tk5W092044; Wed, 31 Aug 2011 09:29:46 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201108310929.p7V9Tk5W092044@svn.freebsd.org> From: Grzegorz Bernacki Date: Wed, 31 Aug 2011 09:29:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225290 - in projects/armv6/sys/arm: arm include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2011 09:29:46 -0000 Author: gber Date: Wed Aug 31 09:29:46 2011 New Revision: 225290 URL: http://svn.freebsd.org/changeset/base/225290 Log: Update SMP framework on ARM based on MIPS implementation. Obtained from: Marvell, Semihalf Modified: projects/armv6/sys/arm/arm/mp_machdep.c projects/armv6/sys/arm/include/smp.h Modified: projects/armv6/sys/arm/arm/mp_machdep.c ============================================================================== --- projects/armv6/sys/arm/arm/mp_machdep.c Wed Aug 31 09:15:52 2011 (r225289) +++ projects/armv6/sys/arm/arm/mp_machdep.c Wed Aug 31 09:29:46 2011 (r225290) @@ -23,7 +23,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ - #include __FBSDID("$FreeBSD$"); #include @@ -31,29 +30,81 @@ __FBSDID("$FreeBSD$"); #include #include #include - +#include +#include +#include #include +#include +#include +#include + #include +extern struct pcpu __pcpu[]; + /* used to hold the AP's until we are ready to release them */ static struct mtx ap_boot_mtx; +/* # of Applications processors */ +int mp_naps; + +/* Set to 1 once we're ready to let the APs out of the pen. */ +static volatile int aps_ready = 0; + +/* Temporary variables for init_secondary() */ +void *dpcpu; + + /* Determine if we running MP machine */ int cpu_mp_probe(void) { CPU_SETOF(0, &all_cpus); - return (mp_ncpus > 1); + return (platform_mp_probe()); } +/* Start Application Processor via platform specific function */ +static int +start_ap(int cpu) +{ + int cpus, ms; + + cpus = mp_naps; + + if (platform_mp_start_ap(cpu) != 0) + return (-1); /* could not start AP */ + + for (ms = 0; ms < 5000; ++ms) { + if (mp_naps > cpus) + return (0); /* success */ + else + DELAY(1000); + } + + return (-2); +} + + /* Initialize and fire up non-boot processors */ void cpu_mp_start(void) { + int error, i; + mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN); + for (i = 1; i < mp_maxid; i++) { + error = start_ap(i); + if (error) { + printf("AP #%d failed to start\n", i); + continue; + } + CPU_SET(i, &all_cpus); + } + + return; } @@ -64,6 +115,61 @@ cpu_mp_announce(void) return; } +void +init_secondary(int cpu) +{ + struct pcpu *pc; + void *dpcpu; + + /* Per-cpu initialization */ + pc = &__pcpu[cpu]; + pcpu_init(pc, cpu, sizeof(struct pcpu)); + + dpcpu = (void *)kmem_alloc(kernel_map, DPCPU_SIZE); + dpcpu_init(dpcpu, cpu); + + /* Signal our startup to BSP */ + mp_naps++; + + /* Spin until the BSP releases the APs */ + while (!aps_ready) + ; + + /* Initialize curthread */ + KASSERT(PCPU_GET(idlethread) != NULL, ("no idle thread")); + PCPU_SET(curthread, PCPU_GET(idlethread)); + + + mtx_lock_spin(&ap_boot_mtx); + + printf("SMP: AP CPU #%d Launched!\n", cpu); + + smp_cpus++; + + if (smp_cpus == mp_ncpus) { + /* enable IPI's, tlb shootdown, freezes etc */ + atomic_store_rel_int(&smp_started, 1); + /* + * XXX do we really need it + * smp_active = 1; + */ + } + + mtx_unlock_spin(&ap_boot_mtx); + + while (smp_started == 0) + ; + + /* Start per-CPU event timers. */ + cpu_initclocks_ap(); + + /* Enter the scheduler */ + sched_throw(NULL); + + panic("scheduler returned us to %s", __func__); + /* NOTREACHED */ +} + struct cpu_group * cpu_topo(void) { @@ -73,26 +179,29 @@ cpu_topo(void) void cpu_mp_setmaxid(void) { - mp_ncpus = 4; - mp_maxid = 3; + + platform_mp_setmaxid(); } /* Sending IPI */ void ipi_all_but_self(u_int ipi) { + return; } void ipi_cpu(int cpu, u_int ipi) { + return; } void ipi_selected(cpuset_t cpus, u_int ipi) { + return; } Modified: projects/armv6/sys/arm/include/smp.h ============================================================================== --- projects/armv6/sys/arm/include/smp.h Wed Aug 31 09:15:52 2011 (r225289) +++ projects/armv6/sys/arm/include/smp.h Wed Aug 31 09:29:46 2011 (r225290) @@ -12,8 +12,16 @@ #define IPI_STOP_HARD 5 #define IPI_HARDCLOCK 6 +void init_secondary(int cpu); + void ipi_all_but_self(u_int ipi); void ipi_cpu(int cpu, u_int ipi); void ipi_selected(cpuset_t cpus, u_int ipi); +/* Platform interface */ +void platform_mp_setmaxid(void); +int platform_mp_probe(void); +int platform_mp_start_ap(int cpuid); + + #endif /* !_MACHINE_SMP_H_ */ From owner-svn-src-projects@FreeBSD.ORG Wed Aug 31 09:35:23 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A2D6106566C; Wed, 31 Aug 2011 09:35:23 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AE8A8FC15; Wed, 31 Aug 2011 09:35:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7V9ZMu4092303; Wed, 31 Aug 2011 09:35:22 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7V9ZMVA092301; Wed, 31 Aug 2011 09:35:22 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201108310935.p7V9ZMVA092301@svn.freebsd.org> From: Grzegorz Bernacki Date: Wed, 31 Aug 2011 09:35:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225292 - projects/armv6/sys/arm/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2011 09:35:23 -0000 Author: gber Date: Wed Aug 31 09:35:22 2011 New Revision: 225292 URL: http://svn.freebsd.org/changeset/base/225292 Log: Increase default number of cpus. Obtained from: Marvell, Semihalf Modified: projects/armv6/sys/arm/include/param.h Modified: projects/armv6/sys/arm/include/param.h ============================================================================== --- projects/armv6/sys/arm/include/param.h Wed Aug 31 09:31:50 2011 (r225291) +++ projects/armv6/sys/arm/include/param.h Wed Aug 31 09:35:22 2011 (r225292) @@ -62,7 +62,7 @@ #if defined(SMP) || defined(KLD_MODULE) #ifndef MAXCPU -#define MAXCPU 2 +#define MAXCPU 4 #endif #else #define MAXCPU 1 From owner-svn-src-projects@FreeBSD.ORG Wed Aug 31 10:42:42 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4F6E1065672; Wed, 31 Aug 2011 10:42:42 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A24448FC0A; Wed, 31 Aug 2011 10:42:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7VAggQJ097224; Wed, 31 Aug 2011 10:42:42 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7VAggwe097213; Wed, 31 Aug 2011 10:42:42 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201108311042.p7VAggwe097213@svn.freebsd.org> From: Grzegorz Bernacki Date: Wed, 31 Aug 2011 10:42:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225293 - in projects/armv6/sys: arm/include arm/mv arm/mv/armadaxp boot/fdt/dts conf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2011 10:42:42 -0000 Author: gber Date: Wed Aug 31 10:42:42 2011 New Revision: 225293 URL: http://svn.freebsd.org/changeset/base/225293 Log: Support for Marvell's Armada XP (MV-78160). It is initial import of Armada port. More patches with fixes, cleanup and missing functionality will be submitted soon. Obtained from: Marvell, Semihalf Added: projects/armv6/sys/arm/mv/armadaxp/ projects/armv6/sys/arm/mv/armadaxp/armadaxp.c projects/armv6/sys/arm/mv/armadaxp/armadaxp_mp.c projects/armv6/sys/arm/mv/armadaxp/files.armadaxp projects/armv6/sys/arm/mv/armadaxp/std.armadaxp projects/armv6/sys/arm/mv/armadaxp/std.mv78x60 projects/armv6/sys/arm/mv/mpic.c projects/armv6/sys/arm/mv/std-pj4b.mv projects/armv6/sys/boot/fdt/dts/db88f78160.dts Modified: projects/armv6/sys/arm/include/vmparam.h projects/armv6/sys/arm/mv/common.c projects/armv6/sys/arm/mv/files.mv projects/armv6/sys/arm/mv/mv_machdep.c projects/armv6/sys/arm/mv/mvreg.h projects/armv6/sys/arm/mv/mvvar.h projects/armv6/sys/arm/mv/mvwin.h projects/armv6/sys/arm/mv/timer.c projects/armv6/sys/conf/options.arm Modified: projects/armv6/sys/arm/include/vmparam.h ============================================================================== --- projects/armv6/sys/arm/include/vmparam.h Wed Aug 31 09:35:22 2011 (r225292) +++ projects/armv6/sys/arm/include/vmparam.h Wed Aug 31 10:42:42 2011 (r225293) @@ -116,7 +116,9 @@ #endif #define VM_MAXUSER_ADDRESS KERNBASE - ARM_KERN_DIRECTMAP #else /* ARM_USE_SMALL_ALLOC */ +#ifndef VM_MAXUSER_ADDRESS #define VM_MAXUSER_ADDRESS KERNBASE +#endif /* VM_MAXUSER_ADDRESS */ #endif /* ARM_USE_SMALL_ALLOC */ #define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS Added: projects/armv6/sys/arm/mv/armadaxp/armadaxp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/armv6/sys/arm/mv/armadaxp/armadaxp.c Wed Aug 31 10:42:42 2011 (r225293) @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2011 Semihalf. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * From: FreeBSD: src/sys/arm/mv/kirkwood/sheevaplug.c,v 1.2 2010/06/13 13:28:53 + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +#include +#include + +#include +#include + +#include + +struct resource_spec mv_gpio_res[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +uint32_t +get_tclk(void) +{ + + return (TCLK_200MHZ); +} + +uint32_t +get_l2clk(void) +{ + + return (TCLK_667MHZ); +} + +int +fdt_pci_devmap(phandle_t node, struct pmap_devmap *devmap, vm_offset_t io_va, + vm_offset_t mem_va) +{ + + return (0); +} + Added: projects/armv6/sys/arm/mv/armadaxp/armadaxp_mp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/armv6/sys/arm/mv/armadaxp/armadaxp_mp.c Wed Aug 31 10:42:42 2011 (r225293) @@ -0,0 +1,170 @@ +/*- + * Copyright (c) 2011 Semihalf. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +/* XXX move to separate header files*/ +#define IPI_SELF 0 +#define IPI_ALL 1 +#define IPI_ALL_BUT_SELF 2 +void mpic_ipi_send(int cpus, u_int ipi); +static int platform_get_ncpus(void); + +#define MV_AXP_CPU_DIVCLK_BASE (MV_BASE + 0x18700) +#define MV_AXP_CPU_DIVCLK_CTRL0 0x00 +#define MV_AXP_CPU_DIVCLK_CTRL2_RATIO_FULL0 0x08 +#define MV_AXP_CPU_DIVCLK_CTRL2_RATIO_FULL1 0x0c + +#define MV_COHERENCY_FABRIC_BASE (MV_MBUS_BRIDGE_BASE + 0x200) +#define MV_COHER_FABRIC_CTRL 0x00 +#define MV_COHER_FABRIC_CONF 0x04 + +/* Coherency Fabric registers */ +static uint32_t +read_coher_fabric(uint32_t reg) +{ + + return (bus_space_read_4(fdtbus_bs_tag, MV_COHERENCY_FABRIC_BASE, reg)); +} + +#ifdef not_yet +static void +write_coher_fabric(uint32_t reg, uint32_t val) +{ + + bus_space_write_4(fdtbus_bs_tag, MV_COHERENCY_FABRIC_BASE, reg, val); +} +#endif + +/* Coherency Fabric registers */ +static uint32_t +read_cpu_clkdiv(uint32_t reg) +{ + + return (bus_space_read_4(fdtbus_bs_tag, MV_AXP_CPU_DIVCLK_BASE, reg)); +} + +static void +write_cpu_clkdiv(uint32_t reg, uint32_t val) +{ + + bus_space_write_4(fdtbus_bs_tag, MV_AXP_CPU_DIVCLK_BASE, reg, val); +} + +#if 0 +static void +hello_message(void) +{ + uint32_t cpuid; + + __asm __volatile("mrc p15, 0, %0, c0, c0, 5" : "=r" (cpuid)); + printf("CPU AP #%d is ready to serve you my sire.\n", cpuid); +} +#endif + +void +platform_mp_setmaxid(void) +{ + + mp_maxid = 3; +} + +int +platform_mp_probe(void) +{ + + mp_ncpus = platform_get_ncpus(); + + return (mp_ncpus > 1); +} + +int +platform_mp_start_ap(int cpuid) +{ + uint32_t reg; + + if (cpuid == 1) { + if (mp_ncpus > 1) { + reg = read_cpu_clkdiv(MV_AXP_CPU_DIVCLK_CTRL2_RATIO_FULL0); + reg &= 0x00ffffff; + reg |= 0x01000000; + write_cpu_clkdiv(MV_AXP_CPU_DIVCLK_CTRL2_RATIO_FULL0, reg); + } + if (mp_ncpus > 2) { + reg = read_cpu_clkdiv(MV_AXP_CPU_DIVCLK_CTRL2_RATIO_FULL1); + reg &= 0xff00ffff; + reg |= 0x00010000; + write_cpu_clkdiv(MV_AXP_CPU_DIVCLK_CTRL2_RATIO_FULL1, reg); + } + if (mp_ncpus > 3) { + reg = read_cpu_clkdiv(MV_AXP_CPU_DIVCLK_CTRL2_RATIO_FULL1); + reg &= 0x00ffffff; + reg |= 0x01000000; + write_cpu_clkdiv(MV_AXP_CPU_DIVCLK_CTRL2_RATIO_FULL1, reg); + } + + reg = read_cpu_clkdiv(MV_AXP_CPU_DIVCLK_CTRL0); + reg |= ((0x1 << (mp_ncpus - 1)) - 1) << 21; + write_cpu_clkdiv(MV_AXP_CPU_DIVCLK_CTRL0, reg); + reg = read_cpu_clkdiv(MV_AXP_CPU_DIVCLK_CTRL0); + reg |= 0x01000000; + write_cpu_clkdiv(MV_AXP_CPU_DIVCLK_CTRL0, reg); + + DELAY(100); + reg &= ~(0xf << 21); + write_cpu_clkdiv(MV_AXP_CPU_DIVCLK_CTRL0, reg); + DELAY(100); + + } + + return (0); +} + +static int +platform_get_ncpus(void) +{ + + return ((read_coher_fabric(MV_COHER_FABRIC_CONF) & 0xf) + 1); +} + +#ifdef not_yet +static void +platform_ipi_send(int cpu, u_int ipi) +{ + + mpic_ipi_send(cpu, ipi); +} +#endif Added: projects/armv6/sys/arm/mv/armadaxp/files.armadaxp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/armv6/sys/arm/mv/armadaxp/files.armadaxp Wed Aug 31 10:42:42 2011 (r225293) @@ -0,0 +1,6 @@ +# $FreeBSD: src/sys/arm/mv/kirkwood/files.db88f6xxx,v 1.1 2008/10/13 20:07:13 raj Exp $ + +arm/mv/armadaxp/armadaxp.c standard +arm/mv/mpic.c standard +arm/mv/rtc.c standard +arm/mv/armadaxp/armadaxp_mp.c optional smp Added: projects/armv6/sys/arm/mv/armadaxp/std.armadaxp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/armv6/sys/arm/mv/armadaxp/std.armadaxp Wed Aug 31 10:42:42 2011 (r225293) @@ -0,0 +1,15 @@ +# $FreeBSD: src/sys/arm/mv/kirkwood/std.db88f6xxx,v 1.1 2008/10/13 20:07:13 raj Exp $ + +# kernel gets loaded at 0x00f00000 by the loader, but runs at virtual address +# 0xc0f00000. RAM starts at 0. We put the pagetable at a reasonable place +# in memory, but may need to bounce it higher if there's a problem with this. +# We could paper over this by loading the kernel at 0xc0000000 virtual, but +# that leads to other complications, so we'll just reclaim the lower region of +# ram after we're loaded. Put the page tables for startup at 1MB. +makeoptions KERNPHYSADDR=0x00f00000 +makeoptions KERNVIRTADDR=0xc0f00000 + +options KERNPHYSADDR=0x00f00000 +options KERNVIRTADDR=0xc0f00000 +options PHYSADDR=0x00000000 +options STARTUP_PAGETABLE_ADDR=0x00100000 Added: projects/armv6/sys/arm/mv/armadaxp/std.mv78x60 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/armv6/sys/arm/mv/armadaxp/std.mv78x60 Wed Aug 31 10:42:42 2011 (r225293) @@ -0,0 +1,5 @@ +# $FreeBSD: src/sys/arm/mv/kirkwood/std.db88f6xxx,v 1.1 2008/10/13 20:07:13 raj Exp $ + +include "../mv/std-pj4b.mv" +include "../mv/armadaxp/std.armadaxp" +files "../mv/armadaxp/files.armadaxp" Modified: projects/armv6/sys/arm/mv/common.c ============================================================================== --- projects/armv6/sys/arm/mv/common.c Wed Aug 31 09:35:22 2011 (r225292) +++ projects/armv6/sys/arm/mv/common.c Wed Aug 31 10:42:42 2011 (r225293) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. + * Copyright (C) 2008-2011 MARVELL INTERNATIONAL LTD. * All rights reserved. * * Developed by Semihalf. @@ -29,6 +29,8 @@ * SUCH DAMAGE. */ +#include "opt_global.h" + #include __FBSDID("$FreeBSD$"); @@ -36,17 +38,27 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include #include #include #include +#include #include #include #include + +MALLOC_DEFINE(M_IDMA, "idma", "idma dma test memory"); + +#define IDMA_DEBUG +#undef IDMA_DEBUG + #define MAX_CPU_WIN 5 #define DEBUG @@ -67,7 +79,9 @@ __FBSDID("$FreeBSD$"); static int win_eth_can_remap(int i); +#ifndef SOC_MV_FREY static int decode_win_cpu_valid(void); +#endif static int decode_win_usb_valid(void); static int decode_win_eth_valid(void); static int decode_win_pcie_valid(void); @@ -76,10 +90,11 @@ static int decode_win_cesa_valid(void); static int decode_win_idma_valid(void); static int decode_win_xor_valid(void); +#ifndef SOC_MV_FREY static void decode_win_cpu_setup(void); +#endif static void decode_win_usb_setup(u_long); static void decode_win_eth_setup(u_long); -static void decode_win_pcie_setup(u_long); static void decode_win_sata_setup(u_long); static void decode_win_cesa_setup(u_long); static void decode_win_idma_setup(u_long); @@ -96,7 +111,6 @@ static int fdt_get_ranges(const char *, static int win_cpu_from_dt(void); static int fdt_win_setup(void); -static uint32_t used_cpu_wins; static uint32_t dev_mask = 0; static int cpu_wins_no = 0; static int eth_port = 0; @@ -104,7 +118,7 @@ static int usb_port = 0; static struct decode_win cpu_win_tbl[MAX_CPU_WIN]; -static const struct decode_win *cpu_wins = cpu_win_tbl; +const struct decode_win *cpu_wins = cpu_win_tbl; typedef void (*decode_win_setup_t)(u_long); typedef void (*dump_win_t)(u_long); @@ -254,13 +268,22 @@ cpu_extra_feat(void) uint32_t ef = 0; soc_id(&dev, &rev); - if (dev == MV_DEV_88F6281 || dev == MV_DEV_MV78100_Z0 || - dev == MV_DEV_MV78100) + + switch (dev) { + case MV_DEV_88F6281: + case MV_DEV_88RC8180: + case MV_DEV_MV78100_Z0: + case MV_DEV_MV78100: __asm __volatile("mrc p15, 1, %0, c15, c1, 0" : "=r" (ef)); - else if (dev == MV_DEV_88F5182 || dev == MV_DEV_88F5281) + break; + case MV_DEV_88F5182: + case MV_DEV_88F5281: __asm __volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (ef)); - else if (bootverbose) - printf("This ARM Core does not support any extra features\n"); + break; + default: + if (bootverbose) + printf("This ARM Core does not support any extra features\n"); + } return (ef); } @@ -273,7 +296,7 @@ uint32_t soc_power_ctrl_get(uint32_t mask) { -#ifndef SOC_MV_ORION +#if !defined(SOC_MV_ORION) && !defined(SOC_MV_LOKIPLUS) && !defined(SOC_MV_FREY) if (mask != CPU_PM_CTRL_NONE) mask &= read_cpu_ctrl(CPU_PM_CTRL); @@ -291,7 +314,7 @@ void soc_power_ctrl_set(uint32_t mask) { -#ifndef SOC_MV_ORION +#if !defined(SOC_MV_ORION) && !defined(SOC_MV_LOKIPLUS) if (mask != CPU_PM_CTRL_NONE) write_cpu_ctrl(CPU_PM_CTRL, mask); #endif @@ -314,7 +337,7 @@ soc_id(uint32_t *dev, uint32_t *rev) static void soc_identify(void) { - uint32_t d, r; + uint32_t d, r, size, mode; const char *dev; const char *rev; @@ -354,12 +377,35 @@ soc_identify(void) else if (r == 3) rev = "A1"; break; + case MV_DEV_88RC8180: + dev = "Marvell 88RC8180"; + break; + case MV_DEV_88RC9480: + dev = "Marvell 88RC9480"; + break; + case MV_DEV_88RC9580: + dev = "Marvell 88RC9580"; + break; + case MV_DEV_88F6781: + dev = "Marvell 88F6781"; + if (r == 2) + rev = "Y0"; + break; case MV_DEV_MV78100_Z0: dev = "Marvell MV78100 Z0"; break; case MV_DEV_MV78100: dev = "Marvell MV78100"; break; + case MV_DEV_MV78160: + dev = "Marvell MV78160"; + break; + case MV_DEV_MV78260: + dev = "Marvell MV78260"; + break; + case MV_DEV_MV78460: + dev = "Marvell MV78460"; + break; default: dev = "UNKNOWN"; break; @@ -370,7 +416,28 @@ soc_identify(void) printf(" rev %s", rev); printf(", TClock %dMHz\n", get_tclk() / 1000 / 1000); - /* TODO add info on currently set endianess */ + mode = read_cpu_ctrl(CPU_CONFIG); + printf(" Instruction cache prefetch %s, data cache prefetch %s\n", + (mode & CPU_CONFIG_IC_PREF) ? "enabled" : "disabled", + (mode & CPU_CONFIG_DC_PREF) ? "enabled" : "disabled"); + + switch (d) { + case MV_DEV_88F6281: + mode = read_cpu_ctrl(CPU_L2_CONFIG) & CPU_L2_CONFIG_MODE; + printf(" 256KB 4-way set-associative %s unified L2 cache\n", + mode ? "write-through" : "write-back"); + break; + case MV_DEV_MV78100: + mode = read_cpu_ctrl(CPU_CONTROL); + size = mode & CPU_CONTROL_L2_SIZE; + mode = mode & CPU_CONTROL_L2_MODE; + printf(" %s set-associative %s unified L2 cache\n", + size ? "256KB 4-way" : "512KB 8-way", + mode ? "write-through" : "write-back"); + break; + default: + break; + } } static void @@ -387,6 +454,17 @@ platform_identify(void *dummy) SYSINIT(platform_identify, SI_SUB_CPU, SI_ORDER_SECOND, platform_identify, NULL); +#ifdef KDB +static void +mv_enter_debugger(void *dummy) +{ + + if (boothowto & RB_KDB) + kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger"); +} +SYSINIT(mv_enter_debugger, SI_SUB_CPU, SI_ORDER_ANY, mv_enter_debugger, NULL); +#endif + int soc_decode_win(void) { @@ -406,6 +484,7 @@ soc_decode_win(void) /* Retrieve our ID: some windows facilities vary between SoC models */ soc_id(&dev, &rev); +#ifndef SOC_MV_FREY if (!decode_win_cpu_valid() || !decode_win_usb_valid() || !decode_win_eth_valid() || !decode_win_idma_valid() || !decode_win_pcie_valid() || !decode_win_sata_valid() || @@ -413,6 +492,13 @@ soc_decode_win(void) return (EINVAL); decode_win_cpu_setup(); +#else + if (!decode_win_usb_valid() || + !decode_win_eth_valid() || !decode_win_idma_valid() || + !decode_win_pcie_valid() || !decode_win_sata_valid() || + !decode_win_cesa_valid() || !decode_win_xor_valid()) + return (EINVAL); +#endif if (MV_DUMP_WIN) soc_dump_decode_win(); @@ -427,6 +513,7 @@ soc_decode_win(void) /************************************************************************** * Decode windows registers accessors **************************************************************************/ +#if !defined(SOC_MV_FREY) WIN_REG_IDX_RD(win_cpu, cr, MV_WIN_CPU_CTRL, MV_MBUS_BRIDGE_BASE) WIN_REG_IDX_RD(win_cpu, br, MV_WIN_CPU_BASE, MV_MBUS_BRIDGE_BASE) WIN_REG_IDX_RD(win_cpu, remap_l, MV_WIN_CPU_REMAP_LO, MV_MBUS_BRIDGE_BASE) @@ -435,9 +522,7 @@ WIN_REG_IDX_WR(win_cpu, cr, MV_WIN_CPU_C WIN_REG_IDX_WR(win_cpu, br, MV_WIN_CPU_BASE, MV_MBUS_BRIDGE_BASE) WIN_REG_IDX_WR(win_cpu, remap_l, MV_WIN_CPU_REMAP_LO, MV_MBUS_BRIDGE_BASE) WIN_REG_IDX_WR(win_cpu, remap_h, MV_WIN_CPU_REMAP_HI, MV_MBUS_BRIDGE_BASE) - -WIN_REG_IDX_RD(ddr, br, MV_WIN_DDR_BASE, MV_DDR_CADR_BASE) -WIN_REG_IDX_RD(ddr, sz, MV_WIN_DDR_SIZE, MV_DDR_CADR_BASE) +#endif WIN_REG_BASE_IDX_RD(win_usb, cr, MV_WIN_USB_CTRL) WIN_REG_BASE_IDX_RD(win_usb, br, MV_WIN_USB_BASE) @@ -476,7 +561,10 @@ WIN_REG_BASE_IDX_RD(win_pcie, remap, MV_ WIN_REG_BASE_IDX_WR(win_pcie, cr, MV_WIN_PCIE_CTRL); WIN_REG_BASE_IDX_WR(win_pcie, br, MV_WIN_PCIE_BASE); WIN_REG_BASE_IDX_WR(win_pcie, remap, MV_WIN_PCIE_REMAP); -WIN_REG_BASE_IDX_WR(pcie, bar, MV_PCIE_BAR); +WIN_REG_BASE_IDX_RD(pcie_bar, br, MV_PCIE_BAR_BASE); +WIN_REG_BASE_IDX_WR(pcie_bar, br, MV_PCIE_BAR_BASE); +WIN_REG_BASE_IDX_WR(pcie_bar, brh, MV_PCIE_BAR_BASE_H); +WIN_REG_BASE_IDX_WR(pcie_bar, cr, MV_PCIE_BAR_CTRL); WIN_REG_BASE_IDX_RD(win_idma, br, MV_WIN_IDMA_BASE) WIN_REG_BASE_IDX_RD(win_idma, sz, MV_WIN_IDMA_SIZE) @@ -493,7 +581,44 @@ WIN_REG_BASE_IDX_RD(win_sata, cr, MV_WIN WIN_REG_BASE_IDX_RD(win_sata, br, MV_WIN_SATA_BASE); WIN_REG_BASE_IDX_WR(win_sata, cr, MV_WIN_SATA_CTRL); WIN_REG_BASE_IDX_WR(win_sata, br, MV_WIN_SATA_BASE); +#ifndef SOC_MV_DOVE +WIN_REG_IDX_RD(ddr, br, MV_WIN_DDR_BASE, MV_DDR_CADR_BASE) +WIN_REG_IDX_RD(ddr, sz, MV_WIN_DDR_SIZE, MV_DDR_CADR_BASE) +#else +/* + * On 88F6781 (Dove) SoC DDR Controller is accessed through + * single MBUS <-> AXI bridge. In this case we provide emulated + * ddr_br_read() and ddr_sz_read() functions to keep compatibility + * with common decoding windows setup code. + */ + +static inline uint32_t ddr_br_read(int i) +{ + uint32_t mmap; + /* Read Memory Address Map Register for CS i */ + mmap = bus_space_read_4(fdtbus_bs_tag, MV_DDR_CADR_BASE + (i * 0x10), 0); + + /* Return CS i base address */ + return (mmap & 0xFF000000); +} + +static inline uint32_t ddr_sz_read(int i) +{ + uint32_t mmap, size; + + /* Read Memory Address Map Register for CS i */ + mmap = bus_space_read_4(fdtbus_bs_tag, MV_DDR_CADR_BASE + (i * 0x10), 0); + + /* Extract size of CS space in 64kB units */ + size = (1 << ((mmap >> 16) & 0x0F)); + + /* Return CS size and enable/disable status */ + return (((size - 1) << 16) | (mmap & 0x01)); +} +#endif + +#if !defined(SOC_MV_FREY) /************************************************************************** * Decode windows helper routines **************************************************************************/ @@ -539,8 +664,10 @@ win_cpu_can_remap(int i) if ((dev == MV_DEV_88F5182 && i < 2) || (dev == MV_DEV_88F5281 && i < 4) || (dev == MV_DEV_88F6281 && i < 4) || - (dev == MV_DEV_MV78100 && i < 8) || - (dev == MV_DEV_MV78100_Z0 && i < 8)) + (dev == MV_DEV_88RC8180 && i < 2) || + (dev == MV_DEV_88F6781 && i < 4) || + (dev == MV_DEV_MV78100_Z0 && i < 8) || + ((dev & MV_DEV_FAMILY_MASK) == MV_DEV_DISCOVERY && i < 8)) return (1); return (0); @@ -593,7 +720,7 @@ decode_win_cpu_valid(void) rv = 0; } - if (cpu_wins[i].remap >= 0 && win_cpu_can_remap(i) != 1) { + if (cpu_wins[i].remap != ~0 && win_cpu_can_remap(i) != 1) { printf("CPU window#%d: not capable of remapping, but " "val 0x%08x defined\n", i, cpu_wins[i].remap); rv = 0; @@ -613,6 +740,13 @@ decode_win_cpu_valid(void) continue; } + if (b != (b & ~(s - 1))) { + printf("CPU window#%d: address 0x%08x is not aligned " + "to 0x%08x\n", i, b, s); + rv = 0; + continue; + } + j = decode_win_overlap(i, cpu_wins_no, &cpu_wins[0]); if (j >= 0) { printf("CPU window#%d: (0x%08x - 0x%08x) overlaps " @@ -628,21 +762,39 @@ decode_win_cpu_valid(void) int decode_win_cpu_set(int target, int attr, vm_paddr_t base, uint32_t size, - int remap) + vm_paddr_t remap) { uint32_t br, cr; - int win; + int win, i; - if (used_cpu_wins >= MV_WIN_CPU_MAX) - return (0); + if (remap == ~0) { + win = MV_WIN_CPU_MAX - 1; + i = -1; + } else { + win = 0; + i = 1; + } - win = used_cpu_wins++; + while ((win >= 0) && (win < MV_WIN_CPU_MAX)) { + cr = win_cpu_cr_read(win); + if ((cr & MV_WIN_CPU_ENABLE_BIT) == 0) + break; + if ((cr & ((0xff << MV_WIN_CPU_ATTR_SHIFT) | + (0x1f << MV_WIN_CPU_TARGET_SHIFT))) == + ((attr << MV_WIN_CPU_ATTR_SHIFT) | + (target << MV_WIN_CPU_TARGET_SHIFT))) + break; + win += i; + } + if ((win < 0) || (win >= MV_WIN_CPU_MAX) || + ((remap != ~0) && (win_cpu_can_remap(win) == 0))) + return (-1); br = base & 0xffff0000; win_cpu_br_write(win, br); if (win_cpu_can_remap(win)) { - if (remap >= 0) { + if (remap != ~0) { win_cpu_remap_l_write(win, remap & 0xffff0000); win_cpu_remap_h_write(win, 0); } else { @@ -656,7 +808,8 @@ decode_win_cpu_set(int target, int attr, } } - cr = ((size - 1) & 0xffff0000) | (attr << 8) | (target << 4) | 1; + cr = ((size - 1) & 0xffff0000) | (attr << MV_WIN_CPU_ATTR_SHIFT) | + (target << MV_WIN_CPU_TARGET_SHIFT) | MV_WIN_CPU_ENABLE_BIT; win_cpu_cr_write(win, cr); return (0); @@ -667,8 +820,6 @@ decode_win_cpu_setup(void) { int i; - used_cpu_wins = 0; - /* Disable all CPU windows */ for (i = 0; i < MV_WIN_CPU_MAX; i++) { win_cpu_cr_write(i, 0); @@ -686,7 +837,7 @@ decode_win_cpu_setup(void) cpu_wins[i].size, cpu_wins[i].remap); } - +#endif /* * Check if we're able to cover all active DDR banks. */ @@ -739,6 +890,13 @@ ddr_size(int i) uint32_t ddr_attr(int i) { + uint32_t dev, rev; + + soc_id(&dev, &rev); + if (dev == MV_DEV_88RC8180) + return ((ddr_sz_read(i) & 0xf0) >> 4); + if (dev == MV_DEV_88F6781) + return (0); return (i == 0 ? 0xe : (i == 1 ? 0xd : @@ -749,8 +907,21 @@ ddr_attr(int i) uint32_t ddr_target(int i) { + uint32_t dev, rev; - /* Mbus unit ID is 0x0 for DDR SDRAM controller */ + soc_id(&dev, &rev); + if (dev == MV_DEV_88RC8180) { + i = (ddr_sz_read(i) & 0xf0) >> 4; + return (i == 0xe ? 0xc : + (i == 0xd ? 0xd : + (i == 0xb ? 0xe : + (i == 0x7 ? 0xf : 0xc)))); + } + + /* + * On SOCs other than 88RC8180 Mbus unit ID for + * DDR SDRAM controller is always 0x0. + */ return (0); } @@ -833,7 +1004,7 @@ win_eth_can_remap(int i) /* ETH encode windows 0-3 have remap capability */ if (i < 4) return (1); - + return (0); } @@ -894,6 +1065,12 @@ decode_win_eth_dump(u_long base) win_eth_epap_read(base)); } +#if defined(SOC_MV_LOKIPLUS) +#define MV_WIN_ETH_DDR_TRGT(n) 0 +#else +#define MV_WIN_ETH_DDR_TRGT(n) ddr_target(n) +#endif + static void decode_win_eth_setup(u_long base) { @@ -920,7 +1097,7 @@ decode_win_eth_setup(u_long base) for (i = 0; i < MV_WIN_DDR_MAX; i++) if (ddr_is_active(i)) { - br = ddr_base(i) | (ddr_attr(i) << 8) | ddr_target(i); + br = ddr_base(i) | (ddr_attr(i) << 8) | MV_WIN_ETH_DDR_TRGT(i); sz = ((ddr_size(i) - 1) & 0xffff0000); /* Set the first free ETH window */ @@ -954,15 +1131,21 @@ decode_win_eth_valid(void) * PCIE windows routines **************************************************************************/ -static void +void decode_win_pcie_setup(u_long base) { - uint32_t size = 0; + uint32_t size = 0, ddrbase = ~0; uint32_t cr, br; int i, j; - for (i = 0; i < MV_PCIE_BAR_MAX; i++) - pcie_bar_write(base, i, 0); + for (i = 0; i < MV_PCIE_BAR_MAX; i++) { + pcie_bar_br_write(base, i, + MV_PCIE_BAR_64BIT | MV_PCIE_BAR_PREFETCH_EN); + if (i < 3) + pcie_bar_brh_write(base, i, 0); + if (i > 0) + pcie_bar_cr_write(base, i, 0); + } for (i = 0; i < MV_WIN_PCIE_MAX; i++) { win_pcie_cr_write(base, i, 0); @@ -970,6 +1153,13 @@ decode_win_pcie_setup(u_long base) win_pcie_remap_write(base, i, 0); } + /* On End-Point only set BAR size to 1MB regardless of DDR size */ + if ((bus_space_read_4(fdtbus_bs_tag, base, MV_PCIE_CONTROL) + & MV_PCIE_ROOT_CMPLX) == 0) { + pcie_bar_cr_write(base, 1, 0xf0000 | 1); + return; + } + for (i = 0; i < MV_WIN_DDR_MAX; i++) { if (ddr_is_active(i)) { /* Map DDR to BAR 1 */ @@ -977,6 +1167,8 @@ decode_win_pcie_setup(u_long base) size += ddr_size(i) & 0xffff0000; cr |= (ddr_attr(i) << 8) | (ddr_target(i) << 4) | 1; br = ddr_base(i); + if (br < ddrbase) + ddrbase = br; /* Use the first available PCIE window */ for (j = 0; j < MV_WIN_PCIE_MAX; j++) { @@ -996,7 +1188,11 @@ decode_win_pcie_setup(u_long base) * form value passed to register to get correct value. */ size -= 0x10000; - pcie_bar_write(base, 0, size | 1); + pcie_bar_cr_write(base, 1, size | 1); + pcie_bar_br_write(base, 1, ddrbase | + MV_PCIE_BAR_64BIT | MV_PCIE_BAR_PREFETCH_EN); + pcie_bar_br_write(base, 0, fdt_immr_pa | + MV_PCIE_BAR_64BIT | MV_PCIE_BAR_PREFETCH_EN); } static int @@ -1282,7 +1478,6 @@ xor_ctrl_write(u_long base, int i, int c /* * Set channel protection 'val' for window 'w' on channel 'c' */ - static void xor_chan_write(u_long base, int c, int e, int w, int val) { @@ -1740,7 +1935,7 @@ win_cpu_from_dt(void) /* Retrieve 'ranges' property of '/localbus' node. */ if ((err = fdt_get_ranges("/localbus", ranges, sizeof(ranges), &tuples, &tuple_size)) != 0) - return (err); + return (0); /* * Fill CPU decode windows table. @@ -1755,9 +1950,9 @@ win_cpu_from_dt(void) cpu_win_tbl[t].attr = fdt32_to_cpu(ranges[i + 1]); cpu_win_tbl[t].base = fdt32_to_cpu(ranges[i + 2]); cpu_win_tbl[t].size = fdt32_to_cpu(ranges[i + 3]); - cpu_win_tbl[t].remap = -1; + cpu_win_tbl[t].remap = ~0; debugf("target = 0x%0x attr = 0x%0x base = 0x%0x " - "size = 0x%0x remap = %d\n", cpu_win_tbl[t].target, + "size = 0x%0x remap = 0x%0x\n", cpu_win_tbl[t].target, cpu_win_tbl[t].attr, cpu_win_tbl[t].base, cpu_win_tbl[t].size, cpu_win_tbl[t].remap); } @@ -1784,7 +1979,7 @@ moveon: cpu_win_tbl[t].attr = MV_WIN_CESA_ATTR; cpu_win_tbl[t].base = sram_base; cpu_win_tbl[t].size = sram_size; - cpu_win_tbl[t].remap = -1; + cpu_win_tbl[t].remap = ~0; debugf("sram: base = 0x%0lx size = 0x%0lx\n", sram_base, sram_size); return (0); @@ -1802,15 +1997,12 @@ fdt_win_setup(void) if (node == 0) panic("fdt_win_setup: no root node"); - node = fdt_find_compatible(node, "simple-bus", 1); - if (node == 0) - return (ENXIO); - /* - * Traverse through all children of simple-bus node, and retrieve - * decode windows data for devices (if applicable). + * Traverse through all children of root and simple-bus nodes. + * For each found device retrieve decode windows data (if applicable). */ - for (child = OF_child(node); child != 0; child = OF_peer(child)) + child = OF_child(node); + while (child != 0) { for (i = 0; soc_nodes[i].compat != NULL; i++) { soc_node = &soc_nodes[i]; @@ -1822,7 +2014,7 @@ fdt_win_setup(void) if (err != 0) return (err); - base += fdt_immr_va; + base = (base & 0x000fffff) | fdt_immr_va; if (soc_node->decode_handler != NULL) soc_node->decode_handler(base); else @@ -1832,6 +2024,19 @@ fdt_win_setup(void) soc_node->dump_handler(base); } + /* + * Once done with root-level children let's move down to + * simple-bus and its children. + */ + child = OF_peer(child); + if ((child == 0) && (node == OF_finddevice("/"))) { + node = fdt_find_compatible(node, "simple-bus", 1); + if (node == 0) + return (ENXIO); + child = OF_child(node); + } + } + return (0); } @@ -1862,7 +2067,8 @@ fdt_pic_decode_ic(phandle_t node, pcell_ int *pol) { - if (!fdt_is_compatible(node, "mrvl,pic")) + if (!fdt_is_compatible(node, "mrvl,pic") && + !fdt_is_compatible(node, "mrvl,mpic")) return (ENXIO); *interrupt = fdt32_to_cpu(intr[0]); Modified: projects/armv6/sys/arm/mv/files.mv ============================================================================== --- projects/armv6/sys/arm/mv/files.mv Wed Aug 31 09:35:22 2011 (r225292) +++ projects/armv6/sys/arm/mv/files.mv Wed Aug 31 10:42:42 2011 (r225293) @@ -14,14 +14,17 @@ # arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_arm10.S standard +arm/arm/cpufunc_asm_arm11.S standard +arm/arm/cpufunc_asm_armv5.S standard arm/arm/cpufunc_asm_armv5_ec.S standard +arm/arm/cpufunc_asm_armv7.S standard arm/arm/cpufunc_asm_sheeva.S standard +arm/arm/cpufunc_asm_pj4b.S standard arm/arm/irq_dispatch.S standard arm/mv/bus_space.c standard arm/mv/common.c standard arm/mv/gpio.c standard -arm/mv/ic.c standard arm/mv/mv_machdep.c standard arm/mv/mv_pci.c optional pci arm/mv/mv_sata.c optional ata | atamvsata Added: projects/armv6/sys/arm/mv/mpic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/armv6/sys/arm/mv/mpic.c Wed Aug 31 10:42:42 2011 (r225293) @@ -0,0 +1,266 @@ +/*- + * Copyright (c) 2006 Benno Rice. + * Copyright (C) 2007-2011 MARVELL INTERNATIONAL LTD. + * All rights reserved. + * + * Developed by Semihalf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Thu Sep 1 15:59:35 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93C7E106564A; Thu, 1 Sep 2011 15:59:35 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2E4A98FC18; Thu, 1 Sep 2011 15:59:34 +0000 (UTC) Received: by yxn22 with SMTP id 22so603867yxn.13 for ; Thu, 01 Sep 2011 08:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=EMVgJs36hNOaqwB4xD/bWyCOLht6ESJJs2g4jRO934c=; b=vqGXDaGuH5xsT3OpnwwjDavAQdHOV3s1JEfPWplXlsjKET7/F8oYN5W05Gog9Bweqg ucyH7mi6TGGbSZcw4MTCvN3G2vf2Y7oTzaLJ3vR1kNlYA/6KRk+zMe43tnJmusLvlrRM ysohA8AtKgnBPz5jXgNULNLmrYtG+T15S2yGo= MIME-Version: 1.0 Received: by 10.150.114.16 with SMTP id m16mr170789ybc.399.1314891126407; Thu, 01 Sep 2011 08:32:06 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.150.53.2 with HTTP; Thu, 1 Sep 2011 08:32:06 -0700 (PDT) In-Reply-To: <20110824211427.GB96070@stack.nl> References: <201108222354.p7MNsC9B074753@svn.freebsd.org> <20110824211427.GB96070@stack.nl> Date: Thu, 1 Sep 2011 19:32:06 +0400 X-Google-Sender-Auth: d3ZyY84lHDYpWY9OLxlu_K7mCjc Message-ID: From: Sergey Kandaurov To: Jilles Tjoelker Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-projects@freebsd.org, gk@freebsd.org, src-committers@freebsd.org, Matthew D Fleming Subject: Re: svn commit: r225097 - in projects/ino64: include lib/libc/gen usr.sbin/cpucontrol usr.sbin/lpr/common_source usr.sbin/newsyslog X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2011 15:59:35 -0000 On 25 August 2011 01:14, Jilles Tjoelker wrote: > On Mon, Aug 22, 2011 at 11:54:12PM +0000, Matthew D Fleming wrote: >> Author: mdf >> Date: Mon Aug 22 23:54:12 2011 >> New Revision: 225097 >> URL: http://svn.freebsd.org/changeset/base/225097 > >> Log: >> =A0 Avoid using dirfd name there is dirfd() macro already. >> =A0 Use dirfd() instead of dirp->dd_fd. >> =A0 Replace dirfd() macro with exported libc symbol. >> =A0 Use _dirfd() macro internally. > >> =A0 GSoC r222835, r222836, r222837. >> =A0 Code by Gleb Kurtsou. > >> Added: projects/ino64/lib/libc/gen/dirfd.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- /dev/null 00:00:00 1970 =A0 (empty, because file is newly added) >> +++ projects/ino64/lib/libc/gen/dirfd.c =A0 =A0 =A0 Mon Aug 22 23:54:12 = 2011 =A0 =A0 =A0 =A0(r225097) > [snip] >> +int >> +dirfd(DIR *dirp) >> +{ >> + =A0 =A0 if (dirp =3D=3D NULL) >> + =A0 =A0 =A0 =A0 =A0 =A0 return (-1); >> + >> + =A0 =A0 return (_dirfd(dirp)); >> +} > > Why have this check here? I think the original behaviour (a segfault) is > more useful here since the return value of this interface is often not > checked. > Why not to convert it to EINVAL? As per IEEE Std 1003.1-2008: The dirfd() function may fail if: [EINVAL] The dirp argument does not refer to a valid directory stream. P.S. It seems autoconf expects dirfd() to be a function and fails if that's a macro (found when trying to build openssh-portable) --=20 wbr, pluknet From owner-svn-src-projects@FreeBSD.ORG Thu Sep 1 16:43:23 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA9611065674; Thu, 1 Sep 2011 16:43:23 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D6EC28FC1C; Thu, 1 Sep 2011 16:43:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p81GhNtY059331; Thu, 1 Sep 2011 16:43:23 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p81GhNgC059308; Thu, 1 Sep 2011 16:43:23 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201109011643.p81GhNgC059308@svn.freebsd.org> From: Matthew D Fleming Date: Thu, 1 Sep 2011 16:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225314 - in projects/ino64: bin/ls bin/rm sbin/dump sbin/fsck_ffs sbin/fsdb sbin/fsirand sbin/growfs sbin/newfs sbin/quotacheck sbin/restore sbin/tunefs usr.bin/find usr.sbin/lpr/lpr u... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2011 16:43:24 -0000 Author: mdf Date: Thu Sep 1 16:43:23 2011 New Revision: 225314 URL: http://svn.freebsd.org/changeset/base/225314 Log: usr: Change ino_t printf format flag to %ju. usr.sbin/quot: Change inode type to uintmax_t to keep scanf() happy. GSoC r222841, r223085. Code by: Gleb Kurtsou. Modified: projects/ino64/bin/ls/ls.c projects/ino64/bin/ls/print.c projects/ino64/bin/rm/rm.c projects/ino64/sbin/dump/traverse.c projects/ino64/sbin/fsck_ffs/fsutil.c projects/ino64/sbin/fsck_ffs/gjournal.c projects/ino64/sbin/fsck_ffs/inode.c projects/ino64/sbin/fsck_ffs/main.c projects/ino64/sbin/fsck_ffs/pass1.c projects/ino64/sbin/fsck_ffs/pass2.c projects/ino64/sbin/fsck_ffs/pass4.c projects/ino64/sbin/fsck_ffs/suj.c projects/ino64/sbin/fsdb/fsdb.c projects/ino64/sbin/fsdb/fsdbutil.c projects/ino64/sbin/fsirand/fsirand.c projects/ino64/sbin/growfs/growfs.c projects/ino64/sbin/newfs/mkfs.c projects/ino64/sbin/quotacheck/quotacheck.c projects/ino64/sbin/restore/dirs.c projects/ino64/sbin/restore/interactive.c projects/ino64/sbin/restore/restore.c projects/ino64/sbin/restore/symtab.c projects/ino64/sbin/restore/tape.c projects/ino64/sbin/tunefs/tunefs.c projects/ino64/usr.bin/find/ls.c projects/ino64/usr.sbin/lpr/lpr/lpr.c projects/ino64/usr.sbin/makefs/ffs/ffs_alloc.c projects/ino64/usr.sbin/quot/quot.c projects/ino64/usr.sbin/snapinfo/snapinfo.c Modified: projects/ino64/bin/ls/ls.c ============================================================================== --- projects/ino64/bin/ls/ls.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/bin/ls/ls.c Thu Sep 1 16:43:23 2011 (r225314) @@ -559,9 +559,10 @@ display(const FTSENT *p, FTSENT *list, i DISPLAY d; FTSENT *cur; NAMES *np; + uintmax_t maxinode; off_t maxsize; long maxblock; - u_long btotal, labelstrlen, maxinode, maxlen, maxnlink; + u_long btotal, labelstrlen, maxlen, maxnlink; u_long maxlabelstr; u_int devstrlen; int maxflags; @@ -581,8 +582,9 @@ display(const FTSENT *p, FTSENT *list, i btotal = 0; initmax = getenv("LS_COLWIDTHS"); /* Fields match -lios order. New ones should be added at the end. */ - maxlabelstr = maxblock = maxinode = maxlen = maxnlink = + maxlabelstr = maxblock = maxlen = maxnlink = maxuser = maxgroup = maxflags = maxsize = 0; + maxinode = 0; if (initmax != NULL && *initmax != '\0') { char *initmax2, *jinitmax; int ninitmax; @@ -610,7 +612,7 @@ display(const FTSENT *p, FTSENT *list, i strcpy(initmax2, "0"); ninitmax = sscanf(jinitmax, - " %lu : %ld : %lu : %u : %u : %i : %jd : %lu : %lu ", + " %ju : %ld : %lu : %u : %u : %i : %jd : %lu : %lu ", &maxinode, &maxblock, &maxnlink, &maxuser, &maxgroup, &maxflags, &maxsize, &maxlen, &maxlabelstr); f_notabs = 1; @@ -842,7 +844,7 @@ label_out: d.s_flags = maxflags; d.s_label = maxlabelstr; d.s_group = maxgroup; - (void)snprintf(buf, sizeof(buf), "%lu", maxinode); + (void)snprintf(buf, sizeof(buf), "%ju", maxinode); d.s_inode = strlen(buf); (void)snprintf(buf, sizeof(buf), "%lu", maxnlink); d.s_nlink = strlen(buf); Modified: projects/ino64/bin/ls/print.c ============================================================================== --- projects/ino64/bin/ls/print.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/bin/ls/print.c Thu Sep 1 16:43:23 2011 (r225314) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -151,7 +152,8 @@ printlong(const DISPLAY *dp) continue; sp = p->fts_statp; if (f_inode) - (void)printf("%*lu ", dp->s_inode, (u_long)sp->st_ino); + (void)printf("%*ju ", + dp->s_inode, (uintmax_t)sp->st_ino); if (f_size) (void)printf("%*jd ", dp->s_block, howmany(sp->st_blocks, blocksize)); @@ -327,7 +329,8 @@ printaname(const FTSENT *p, u_long inode sp = p->fts_statp; chcnt = 0; if (f_inode) - chcnt += printf("%*lu ", (int)inodefield, (u_long)sp->st_ino); + chcnt += printf("%*ju ", + (int)inodefield, (uintmax_t)sp->st_ino); if (f_size) chcnt += printf("%*jd ", (int)sizefield, howmany(sp->st_blocks, blocksize)); Modified: projects/ino64/bin/rm/rm.c ============================================================================== --- projects/ino64/bin/rm/rm.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/bin/rm/rm.c Thu Sep 1 16:43:23 2011 (r225314) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -423,8 +424,8 @@ rm_overwrite(char *file, struct stat *sb if (!S_ISREG(sbp->st_mode)) return (1); if (sbp->st_nlink > 1 && !fflag) { - warnx("%s (inode %u): not overwritten due to multiple links", - file, sbp->st_ino); + warnx("%s (inode %ju): not overwritten due to multiple links", + file, (uintmax_t)sbp->st_ino); return (0); } if ((fd = open(file, O_WRONLY, 0)) == -1) Modified: projects/ino64/sbin/dump/traverse.c ============================================================================== --- projects/ino64/sbin/dump/traverse.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/dump/traverse.c Thu Sep 1 16:43:23 2011 (r225314) @@ -197,8 +197,8 @@ mapfiles(ino_t maxino, long *tapesize) (mode & IFMT) == 0) continue; if (ino >= maxino) { - msg("Skipping inode %d >= maxino %d\n", - ino, maxino); + msg("Skipping inode %ju >= maxino %ju\n", + (uintmax_t)ino, (uintmax_t)maxino); continue; } /* @@ -400,15 +400,16 @@ searchdir( for (loc = 0; loc < size; ) { dp = (struct direct *)(dblk + loc); if (dp->d_reclen == 0) { - msg("corrupted directory, inumber %d\n", ino); + msg("corrupted directory, inumber %ju\n", + (uintmax_t)ino); break; } loc += dp->d_reclen; if (dp->d_ino == 0) continue; if (dp->d_ino >= maxino) { - msg("corrupted directory entry, d_ino %d >= %d\n", - dp->d_ino, maxino); + msg("corrupted directory entry, d_ino %ju >= %ju\n", + (uintmax_t)dp->d_ino, (uintmax_t)maxino); break; } if (dp->d_name[0] == '.') { Modified: projects/ino64/sbin/fsck_ffs/fsutil.c ============================================================================== --- projects/ino64/sbin/fsck_ffs/fsutil.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsck_ffs/fsutil.c Thu Sep 1 16:43:23 2011 (r225314) @@ -137,7 +137,8 @@ inoinfo(ino_t inum) int iloff; if (inum > maxino) - errx(EEXIT, "inoinfo: inumber %d out of range", inum); + errx(EEXIT, "inoinfo: inumber %ju out of range", + (uintmax_t)inum); ilp = &inostathead[inum / sblock.fs_ipg]; iloff = inum % sblock.fs_ipg; if (iloff >= ilp->il_numalloced) Modified: projects/ino64/sbin/fsck_ffs/gjournal.c ============================================================================== --- projects/ino64/sbin/fsck_ffs/gjournal.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsck_ffs/gjournal.c Thu Sep 1 16:43:23 2011 (r225314) @@ -449,7 +449,8 @@ gjournal_check(const char *filesys) if (isclr(inosused, cino)) continue; if (getino(disk, &p, ino, &mode) == -1) - err(1, "getino(cg=%d ino=%d)", cg, ino); + err(1, "getino(cg=%d ino=%ju)", + cg, (uintmax_t)ino); dino = p; /* Not a regular file nor directory? Skip it. */ if (!S_ISREG(dino->di_mode) && !S_ISDIR(dino->di_mode)) @@ -481,7 +482,8 @@ gjournal_check(const char *filesys) *dino = ufs2_zino; /* Write the inode back. */ if (putino(disk) == -1) - err(1, "putino(cg=%d ino=%d)", cg, ino); + err(1, "putino(cg=%d ino=%ju)", + cg, (uintmax_t)ino); if (cgp->cg_unrefs == 0) { //printf("No more unreferenced inodes in cg=%d.\n", cg); break; Modified: projects/ino64/sbin/fsck_ffs/inode.c ============================================================================== --- projects/ino64/sbin/fsck_ffs/inode.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsck_ffs/inode.c Thu Sep 1 16:43:23 2011 (r225314) @@ -285,7 +285,8 @@ ginode(ino_t inumber) ufs2_daddr_t iblk; if (inumber < ROOTINO || inumber > maxino) - errx(EEXIT, "bad inode number %d to ginode", inumber); + errx(EEXIT, "bad inode number %ju to ginode", + (uintmax_t)inumber); if (startinum == 0 || inumber < startinum || inumber >= startinum + INOPB(&sblock)) { iblk = ino_to_fsba(&sblock, inumber); @@ -319,7 +320,8 @@ getnextinode(ino_t inumber, int rebuildc static caddr_t nextinop; if (inumber != nextino++ || inumber > lastvalidinum) - errx(EEXIT, "bad inode number %d to nextinode", inumber); + errx(EEXIT, "bad inode number %ju to nextinode", + (uintmax_t)inumber); if (inumber >= lastinum) { readcnt++; dblk = fsbtodb(&sblock, ino_to_fsba(&sblock, lastinum)); @@ -398,7 +400,8 @@ setinodebuf(ino_t inum) { if (inum % sblock.fs_ipg != 0) - errx(EEXIT, "bad inode number %d to setinodebuf", inum); + errx(EEXIT, "bad inode number %ju to setinodebuf", + (uintmax_t)inum); lastvalidinum = inum + sblock.fs_ipg - 1; startinum = 0; nextino = inum; @@ -489,7 +492,7 @@ getinoinfo(ino_t inumber) continue; return (inp); } - errx(EEXIT, "cannot find inode %d", inumber); + errx(EEXIT, "cannot find inode %ju", (uintmax_t)inumber); return ((struct inoinfo *)0); } Modified: projects/ino64/sbin/fsck_ffs/main.c ============================================================================== --- projects/ino64/sbin/fsck_ffs/main.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsck_ffs/main.c Thu Sep 1 16:43:23 2011 (r225314) @@ -493,7 +493,7 @@ checkfilesys(char *filesys) n_ffree * 100.0 / sblock.fs_dsize); if (debug) { if (files < 0) - printf("%d inodes missing\n", -files); + printf("%jd inodes missing\n", (intmax_t)-files); if (blks < 0) printf("%lld blocks missing\n", -(long long)blks); if (duplist != NULL) { Modified: projects/ino64/sbin/fsck_ffs/pass1.c ============================================================================== --- projects/ino64/sbin/fsck_ffs/pass1.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsck_ffs/pass1.c Thu Sep 1 16:43:23 2011 (r225314) @@ -99,8 +99,9 @@ pass1(void) if (!rebuildcg && sblock.fs_magic == FS_UFS2_MAGIC) { inosused = cgrp.cg_initediblk; if (inosused > sblock.fs_ipg) { - pfatal("%s (%d > %d) %s %d\nReset to %d\n", - "Too many initialized inodes", inosused, + pfatal("%s (%ju > %d) %s %d\nReset to %d\n", + "Too many initialized inodes", + (uintmax_t)inosused, sblock.fs_ipg, "in cylinder group", c, sblock.fs_ipg); inosused = sblock.fs_ipg; Modified: projects/ino64/sbin/fsck_ffs/pass2.c ============================================================================== --- projects/ino64/sbin/fsck_ffs/pass2.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsck_ffs/pass2.c Thu Sep 1 16:43:23 2011 (r225314) @@ -223,13 +223,14 @@ pass2(void) * inp->i_parent is directory to which ".." should point. */ getpathname(pathbuf, inp->i_parent, inp->i_number); - printf("BAD INODE NUMBER FOR '..' in DIR I=%d (%s)\n", - inp->i_number, pathbuf); + printf("BAD INODE NUMBER FOR '..' in DIR I=%ju (%s)\n", + (uintmax_t)inp->i_number, pathbuf); getpathname(pathbuf, inp->i_dotdot, inp->i_dotdot); - printf("CURRENTLY POINTS TO I=%d (%s), ", inp->i_dotdot, - pathbuf); + printf("CURRENTLY POINTS TO I=%ju (%s), ", + (uintmax_t)inp->i_dotdot, pathbuf); getpathname(pathbuf, inp->i_parent, inp->i_parent); - printf("SHOULD POINT TO I=%d (%s)", inp->i_parent, pathbuf); + printf("SHOULD POINT TO I=%ju (%s)", + (uintmax_t)inp->i_parent, pathbuf); if (cursnapshot != 0) { /* * We need to: @@ -443,8 +444,8 @@ again: } else { getpathname(dirname, idesc->id_number, dirp->d_ino); - pwarn("ZERO LENGTH DIRECTORY %s I=%d", - dirname, dirp->d_ino); + pwarn("ZERO LENGTH DIRECTORY %s I=%ju", + dirname, (uintmax_t)dirp->d_ino); /* * We need to: * setcwd(idesc->id_parent); @@ -507,8 +508,9 @@ again: break; default: - errx(EEXIT, "BAD STATE %d FOR INODE I=%d", - inoinfo(dirp->d_ino)->ino_state, dirp->d_ino); + errx(EEXIT, "BAD STATE %d FOR INODE I=%ju", + inoinfo(dirp->d_ino)->ino_state, + (uintmax_t)dirp->d_ino); } } if (n == 0) Modified: projects/ino64/sbin/fsck_ffs/pass4.c ============================================================================== --- projects/ino64/sbin/fsck_ffs/pass4.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsck_ffs/pass4.c Thu Sep 1 16:43:23 2011 (r225314) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "fsck.h" @@ -114,8 +115,9 @@ pass4(void) break; default: - errx(EEXIT, "BAD STATE %d FOR INODE I=%d", - inoinfo(inumber)->ino_state, inumber); + errx(EEXIT, "BAD STATE %d FOR INODE I=%ju", + inoinfo(inumber)->ino_state, + (uintmax_t)inumber); } } } Modified: projects/ino64/sbin/fsck_ffs/suj.c ============================================================================== --- projects/ino64/sbin/fsck_ffs/suj.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsck_ffs/suj.c Thu Sep 1 16:43:23 2011 (r225314) @@ -831,8 +831,8 @@ ino_clrat(ino_t parent, off_t diroff, in int doff; if (debug) - printf("Clearing inode %d from parent %d at offset %jd\n", - child, parent, diroff); + printf("Clearing inode %ju from parent %ju at offset %jd\n", + (uintmax_t)child, (uintmax_t)parent, diroff); lbn = lblkno(fs, diroff); doff = blkoff(fs, diroff); @@ -842,8 +842,8 @@ ino_clrat(ino_t parent, off_t diroff, in block = dblk_read(blk, blksize); dp = (struct direct *)&block[doff]; if (dp->d_ino != child) - errx(1, "Inode %d does not exist in %d at %jd", - child, parent, diroff); + errx(1, "Inode %ju does not exist in %ju at %jd", + (uintmax_t)child, (uintmax_t)parent, diroff); dp->d_ino = 0; dblk_dirty(blk); /* @@ -879,10 +879,11 @@ ino_isat(ino_t parent, off_t diroff, ino * was reallocated. */ if (*mode != 0) - printf("Directory %d has bad mode %o\n", - parent, *mode); + printf("Directory %ju has bad mode %o\n", + (uintmax_t)parent, *mode); else - printf("Directory %d zero inode\n", parent); + printf("Directory %ju zero inode\n", + (uintmax_t)parent); } return (0); } @@ -891,15 +892,16 @@ ino_isat(ino_t parent, off_t diroff, ino blksize = sblksize(fs, DIP(dip, di_size), lbn); if (diroff + DIRECTSIZ(1) > DIP(dip, di_size) || doff >= blksize) { if (debug) - printf("ino %d absent from %d due to offset %jd" + printf("ino %ju absent from %ju due to offset %jd" " exceeding size %jd\n", - child, parent, diroff, DIP(dip, di_size)); + (uintmax_t)child, (uintmax_t)parent, diroff, + DIP(dip, di_size)); return (0); } blk = ino_blkatoff(dip, parent, lbn, &frags); if (blk <= 0) { if (debug) - printf("Sparse directory %d", parent); + printf("Sparse directory %ju", (uintmax_t)parent); return (0); } block = dblk_read(blk, blksize); @@ -918,12 +920,13 @@ ino_isat(ino_t parent, off_t diroff, ino dpoff += dp->d_reclen; } while (dpoff <= doff); if (dpoff > fs->fs_bsize) - err_suj("Corrupt directory block in dir ino %d\n", parent); + err_suj("Corrupt directory block in dir ino %ju\n", + (uintmax_t)parent); /* Not found. */ if (dpoff != doff) { if (debug) - printf("ino %d not found in %d, lbn %jd, dpoff %d\n", - child, parent, lbn, dpoff); + printf("ino %ju not found in %ju, lbn %jd, dpoff %d\n", + (uintmax_t)child, (uintmax_t)parent, lbn, dpoff); return (0); } /* @@ -940,8 +943,8 @@ ino_isat(ino_t parent, off_t diroff, ino return (1); } if (debug) - printf("ino %d doesn't match dirent ino %d in parent %d\n", - child, dp->d_ino, parent); + printf("ino %ju doesn't match dirent ino %ju in parent %ju\n", + (uintmax_t)child, (uintmax_t)dp->d_ino, (uintmax_t)parent); return (0); } @@ -977,8 +980,8 @@ indir_visit(ino_t ino, ufs_lbn_t lbn, uf err_suj("Invalid level for lbn %jd\n", lbn); if ((flags & VISIT_ROOT) == 0 && blk_isindir(blk, ino, lbn) == 0) { if (debug) - printf("blk %jd ino %d lbn %jd(%d) is not indir.\n", - blk, ino, lbn, level); + printf("blk %jd ino %ju lbn %jd(%d) is not indir.\n", + blk, (uintmax_t)ino, lbn, level); goto out; } lbnadd = 1; @@ -1131,8 +1134,8 @@ ino_adjblks(struct suj_ino *sino) if (blocks == DIP(ip, di_blocks)) return; if (debug) - printf("ino %d adjusting block count from %jd to %jd\n", - ino, DIP(ip, di_blocks), blocks); + printf("ino %ju adjusting block count from %jd to %jd\n", + (uintmax_t)ino, DIP(ip, di_blocks), blocks); DIP_SET(ip, di_blocks, blocks); ino_dirty(ino); } @@ -1264,8 +1267,8 @@ ino_free_children(ino_t ino, ufs_lbn_t l if (isdotdot && skipparent == 1) continue; if (debug) - printf("Directory %d removing ino %d name %s\n", - ino, dp->d_ino, dp->d_name); + printf("Directory %ju removing ino %ju name %s\n", + (uintmax_t)ino, (uintmax_t)dp->d_ino, dp->d_name); diroff = lblktosize(fs, lbn) + dpoff; ino_remref(ino, dp->d_ino, diroff, isdotdot); } @@ -1283,8 +1286,8 @@ ino_reclaim(union dinode *ip, ino_t ino, if (ino == ROOTINO) err_suj("Attempting to free ROOTINO\n"); if (debug) - printf("Truncating and freeing ino %d, nlink %d, mode %o\n", - ino, DIP(ip, di_nlink), DIP(ip, di_mode)); + printf("Truncating and freeing ino %ju, nlink %d, mode %o\n", + (uintmax_t)ino, DIP(ip, di_nlink), DIP(ip, di_mode)); /* We are freeing an inode or directory. */ if ((DIP(ip, di_mode) & IFMT) == IFDIR) @@ -1318,9 +1321,11 @@ ino_decr(ino_t ino) nlink = DIP(ip, di_nlink); mode = DIP(ip, di_mode); if (nlink < 1) - err_suj("Inode %d link count %d invalid\n", ino, nlink); + err_suj("Inode %ju link count %d invalid\n", (uintmax_t)ino, + nlink); if (mode == 0) - err_suj("Inode %d has a link of %d with 0 mode\n", ino, nlink); + err_suj("Inode %ju has a link of %d with 0 mode\n", + (uintmax_t)ino, nlink); nlink--; if ((mode & IFMT) == IFDIR) reqlink = 2; @@ -1328,8 +1333,8 @@ ino_decr(ino_t ino) reqlink = 1; if (nlink < reqlink) { if (debug) - printf("ino %d not enough links to live %d < %d\n", - ino, nlink, reqlink); + printf("ino %ju not enough links to live %d < %d\n", + (uintmax_t)ino, nlink, reqlink); ino_reclaim(ip, ino, mode); return; } @@ -1374,7 +1379,7 @@ ino_adjust(struct suj_ino *sino) break; } if (srec == NULL) - errx(1, "Directory %d name not found", ino); + errx(1, "Directory %ju name not found", (uintmax_t)ino); } /* * If it's a directory with no real names pointing to it go ahead @@ -1399,20 +1404,22 @@ ino_adjust(struct suj_ino *sino) mode = DIP(ip, di_mode) & IFMT; if (nlink > LINK_MAX) err_suj( - "ino %d nlink manipulation error, new link %d, old link %d\n", - ino, nlink, DIP(ip, di_nlink)); + "ino %ju nlink manipulation error, new link %d, old link %d\n", + (uintmax_t)ino, nlink, DIP(ip, di_nlink)); if (debug) - printf("Adjusting ino %d, nlink %d, old link %d lastmode %o\n", - ino, nlink, DIP(ip, di_nlink), sino->si_mode); + printf("Adjusting ino %ju, nlink %d, old link %d lastmode %o\n", + (uintmax_t)ino, nlink, DIP(ip, di_nlink), sino->si_mode); if (mode == 0) { if (debug) - printf("ino %d, zero inode freeing bitmap\n", ino); + printf("ino %ju, zero inode freeing bitmap\n", + (uintmax_t)ino); ino_free(ino, sino->si_mode); return; } /* XXX Should be an assert? */ if (mode != sino->si_mode && debug) - printf("ino %d, mode %o != %o\n", ino, mode, sino->si_mode); + printf("ino %ju, mode %o != %o\n", (uintmax_t)ino, mode, + sino->si_mode); if ((mode & IFMT) == IFDIR) reqlink = 2; else @@ -1420,15 +1427,16 @@ ino_adjust(struct suj_ino *sino) /* If the inode doesn't have enough links to live, free it. */ if (nlink < reqlink) { if (debug) - printf("ino %d not enough links to live %d < %d\n", - ino, nlink, reqlink); + printf("ino %ju not enough links to live %d < %d\n", + (uintmax_t)ino, nlink, reqlink); ino_reclaim(ip, ino, mode); return; } /* If required write the updated link count. */ if (DIP(ip, di_nlink) == nlink) { if (debug) - printf("ino %d, link matches, skipping.\n", ino); + printf("ino %ju, link matches, skipping.\n", + (uintmax_t)ino); return; } DIP_SET(ip, di_nlink, nlink); @@ -1527,8 +1535,8 @@ ino_trunc(ino_t ino, off_t size) mode = DIP(ip, di_mode) & IFMT; cursize = DIP(ip, di_size); if (debug) - printf("Truncating ino %d, mode %o to size %jd from size %jd\n", - ino, mode, size, cursize); + printf("Truncating ino %ju, mode %o to size %jd from size %jd\n", + (uintmax_t)ino, mode, size, cursize); /* Skip datablocks for short links and devices. */ if (mode == 0 || mode == IFBLK || mode == IFCHR || @@ -1586,7 +1594,8 @@ ino_trunc(ino_t ino, off_t size) bn = DIP(ip, di_db[visitlbn]); if (bn == 0) - err_suj("Bad blk at ino %d lbn %jd\n", ino, visitlbn); + err_suj("Bad blk at ino %ju lbn %jd\n", + (uintmax_t)ino, visitlbn); oldspace = sblksize(fs, cursize, visitlbn); newspace = sblksize(fs, size, visitlbn); if (oldspace != newspace) { @@ -1610,8 +1619,8 @@ ino_trunc(ino_t ino, off_t size) bn = ino_blkatoff(ip, ino, visitlbn, &frags); if (bn == 0) - err_suj("Block missing from ino %d at lbn %jd\n", - ino, visitlbn); + err_suj("Block missing from ino %ju at lbn %jd\n", + (uintmax_t)ino, visitlbn); clrsize = frags * fs->fs_fsize; buf = dblk_read(bn, clrsize); clrsize -= off; @@ -1676,8 +1685,8 @@ ino_check(struct suj_ino *sino) * by one. */ if (debug) - printf("ino %d nlink %d newlinks %d removes %d dotlinks %d\n", - ino, nlink, newlinks, removes, dotlinks); + printf("ino %ju nlink %d newlinks %d removes %d dotlinks %d\n", + (uintmax_t)ino, nlink, newlinks, removes, dotlinks); nlink += newlinks; nlink -= removes; sino->si_linkadj = 1; @@ -1923,12 +1932,12 @@ ino_unlinked(void) */ if (DIP(ip, di_nlink) == 0) { if (debug) - printf("Freeing unlinked ino %d mode %o\n", - ino, mode); + printf("Freeing unlinked ino %ju mode %o\n", + (uintmax_t)ino, mode); ino_reclaim(ip, ino, mode); } else if (debug) - printf("Skipping ino %d mode %o with link %d\n", - ino, mode, DIP(ip, di_nlink)); + printf("Skipping ino %ju mode %o with link %d\n", + (uintmax_t)ino, mode, DIP(ip, di_nlink)); ino = inon; } } @@ -2351,27 +2360,27 @@ suj_verifyino(union dinode *ip) { if (DIP(ip, di_nlink) != 1) { - printf("Invalid link count %d for journal inode %d\n", - DIP(ip, di_nlink), sujino); + printf("Invalid link count %d for journal inode %ju\n", + DIP(ip, di_nlink), (uintmax_t)sujino); return (-1); } if ((DIP(ip, di_flags) & (SF_IMMUTABLE | SF_NOUNLINK)) != (SF_IMMUTABLE | SF_NOUNLINK)) { - printf("Invalid flags 0x%X for journal inode %d\n", - DIP(ip, di_flags), sujino); + printf("Invalid flags 0x%X for journal inode %ju\n", + DIP(ip, di_flags), (uintmax_t)sujino); return (-1); } if (DIP(ip, di_mode) != (IFREG | IREAD)) { - printf("Invalid mode %o for journal inode %d\n", - DIP(ip, di_mode), sujino); + printf("Invalid mode %o for journal inode %ju\n", + DIP(ip, di_mode), (uintmax_t)sujino); return (-1); } if (DIP(ip, di_size) < SUJ_MIN || DIP(ip, di_size) > SUJ_MAX) { - printf("Invalid size %jd for journal inode %d\n", - DIP(ip, di_size), sujino); + printf("Invalid size %jd for journal inode %ju\n", + DIP(ip, di_size), (uintmax_t)sujino); return (-1); } @@ -2699,12 +2708,12 @@ suj_check(const char *filesys) * Build a list of journal blocks in jblocks before parsing the * available journal blocks in with suj_read(). */ - printf("** Reading %jd byte journal from inode %d.\n", - DIP(jip, di_size), sujino); + printf("** Reading %jd byte journal from inode %ju.\n", + DIP(jip, di_size), (uintmax_t)sujino); suj_jblocks = jblocks_create(); blocks = ino_visit(jip, sujino, suj_add_block, 0); if (blocks != numfrags(fs, DIP(jip, di_size))) { - printf("Sparse journal inode %d.\n", sujino); + printf("Sparse journal inode %ju.\n", (uintmax_t)sujino); return (-1); } suj_read(); Modified: projects/ino64/sbin/fsdb/fsdb.c ============================================================================== --- projects/ino64/sbin/fsdb/fsdb.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsdb/fsdb.c Thu Sep 1 16:43:23 2011 (r225314) @@ -39,6 +39,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -211,7 +212,8 @@ char * prompt(EditLine *el) { static char pstring[64]; - snprintf(pstring, sizeof(pstring), "fsdb (inum: %d)> ", curinum); + snprintf(pstring, sizeof(pstring), "fsdb (inum: %ju)> ", + (uintmax_t)curinum); return pstring; } @@ -298,8 +300,8 @@ ino_t curinum, ocurrent; #define GETINUM(ac,inum) inum = strtoul(argv[ac], &cp, 0); \ if (inum < ROOTINO || inum > maxino || cp == argv[ac] || *cp != '\0' ) { \ - printf("inode %d out of range; range is [%d,%d]\n", \ - inum, ROOTINO, maxino); \ + printf("inode %ju out of range; range is [%ju,%ju]\n", \ + (uintmax_t)inum, (uintmax_t)ROOTINO, (uintmax_t)maxino); \ return 1; \ } @@ -364,7 +366,8 @@ CMDFUNCSTART(uplink) if (!checkactive()) return 1; DIP_SET(curinode, di_nlink, DIP(curinode, di_nlink) + 1); - printf("inode %d link count now %d\n", curinum, DIP(curinode, di_nlink)); + printf("inode %ju link count now %d\n", + (uintmax_t)curinum, DIP(curinode, di_nlink)); inodirty(); return 0; } @@ -374,7 +377,8 @@ CMDFUNCSTART(downlink) if (!checkactive()) return 1; DIP_SET(curinode, di_nlink, DIP(curinode, di_nlink) - 1); - printf("inode %d link count now %d\n", curinum, DIP(curinode, di_nlink)); + printf("inode %ju link count now %d\n", + (uintmax_t)curinum, DIP(curinode, di_nlink)); inodirty(); return 0; } @@ -493,11 +497,11 @@ CMDFUNCSTART(findblk) if (is_ufs2 ? compare_blk64(wantedblk64, ino_to_fsba(&sblock, inum)) : compare_blk32(wantedblk32, ino_to_fsba(&sblock, inum))) { - printf("block %llu: inode block (%d-%d)\n", + printf("block %llu: inode block (%ju-%ju)\n", (unsigned long long)fsbtodb(&sblock, ino_to_fsba(&sblock, inum)), - (inum / INOPB(&sblock)) * INOPB(&sblock), - (inum / INOPB(&sblock) + 1) * INOPB(&sblock)); + (uintmax_t)(inum / INOPB(&sblock)) * INOPB(&sblock), + (uintmax_t)(inum / INOPB(&sblock) + 1) * INOPB(&sblock)); findblk_numtofind--; if (findblk_numtofind == 0) goto end; @@ -593,8 +597,8 @@ static int founddatablk(uint64_t blk) { - printf("%llu: data block of inode %d\n", - (unsigned long long)fsbtodb(&sblock, blk), curinum); + printf("%llu: data block of inode %ju\n", + (unsigned long long)fsbtodb(&sblock, blk), (uintmax_t)curinum); findblk_numtofind--; if (findblk_numtofind == 0) return 1; @@ -753,7 +757,7 @@ CMDFUNCSTART(ln) return 1; rval = makeentry(curinum, inum, argv[2]); if (rval) - printf("Ino %d entered as `%s'\n", inum, argv[2]); + printf("Ino %ju entered as `%s'\n", (uintmax_t)inum, argv[2]); else printf("could not enter name? weird.\n"); curinode = ginode(curinum); Modified: projects/ino64/sbin/fsdb/fsdbutil.c ============================================================================== --- projects/ino64/sbin/fsdb/fsdbutil.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsdb/fsdbutil.c Thu Sep 1 16:43:23 2011 (r225314) @@ -154,7 +154,7 @@ printstat(const char *cp, ino_t inum, un puts("fifo"); break; } - printf("I=%lu MODE=%o SIZE=%ju", (u_long)inum, DIP(dp, di_mode), + printf("I=%ju MODE=%o SIZE=%ju", (uintmax_t)inum, DIP(dp, di_mode), (uintmax_t)DIP(dp, di_size)); if (sblock.fs_magic != FS_UFS1_MAGIC) { t = _time64_to_time(dp->dp2.di_birthtime); @@ -292,7 +292,7 @@ printblocks(ino_t inum, union dinode *dp long ndb, offset; ufs2_daddr_t blkno; - printf("Blocks for inode %d:\n", inum); + printf("Blocks for inode %ju:\n", (uintmax_t)inum); printf("Direct blocks:\n"); ndb = howmany(DIP(dp, di_size), sblock.fs_bsize); for (i = 0; i < NDADDR; i++) { @@ -341,7 +341,7 @@ checkactivedir(void) return 0; } if ((DIP(curinode, di_mode) & IFMT) != IFDIR) { - warnx("inode %d not a directory", curinum); + warnx("inode %ju not a directory", (uintmax_t)curinum); return 0; } return 1; @@ -366,11 +366,12 @@ printactive(int doblocks) printstat("current inode", curinum, curinode); break; case 0: - printf("current inode %d: unallocated inode\n", curinum); + printf("current inode %ju: unallocated inode\n", (uintmax_t)curinum); break; default: - printf("current inode %d: screwy itype 0%o (mode 0%o)?\n", - curinum, DIP(curinode, di_mode) & IFMT, DIP(curinode, di_mode)); + printf("current inode %ju: screwy itype 0%o (mode 0%o)?\n", + (uintmax_t)curinum, DIP(curinode, di_mode) & IFMT, + DIP(curinode, di_mode)); break; } return 0; Modified: projects/ino64/sbin/fsirand/fsirand.c ============================================================================== --- projects/ino64/sbin/fsirand/fsirand.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/fsirand/fsirand.c Thu Sep 1 16:43:23 2011 (r225314) @@ -275,8 +275,8 @@ fsirand(char *device) dp2 = &((struct ufs2_dinode *)inodebuf)[n]; if (inumber >= ROOTINO) { if (printonly) - (void)printf("ino %d gen %08x\n", - inumber, + (void)printf("ino %ju gen %08x\n", + (uintmax_t)inumber, sblock->fs_magic == FS_UFS1_MAGIC ? dp1->di_gen : dp2->di_gen); else if (sblock->fs_magic == FS_UFS1_MAGIC) Modified: projects/ino64/sbin/growfs/growfs.c ============================================================================== --- projects/ino64/sbin/growfs/growfs.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/growfs/growfs.c Thu Sep 1 16:43:23 2011 (r225314) @@ -372,6 +372,7 @@ initcg(int cylno, time_t modtime, int fs { DBG_FUNC("initcg") static caddr_t iobuf; + ino_t ino; long blkno, start; ufs2_daddr_t i, cbase, dmax; struct ufs1_dinode *dp1; @@ -441,8 +442,8 @@ initcg(int cylno, time_t modtime, int fs } acg.cg_cs.cs_nifree += sblock.fs_ipg; if (cylno == 0) - for (i = 0; i < ROOTINO; i++) { - setbit(cg_inosused(&acg), i); + for (ino = 0; ino < ROOTINO; ino++) { + setbit(cg_inosused(&acg), ino); acg.cg_cs.cs_nifree--; } /* @@ -1847,6 +1848,7 @@ ginode(ino_t inumber, int fsi, int cg) { DBG_FUNC("ginode") static ino_t startinum = 0; /* first inode in cached block */ + uintptr_t ioff; DBG_ENTER; @@ -1868,19 +1870,20 @@ ginode(ino_t inumber, int fsi, int cg) return NULL; } if (inumber > maxino) - errx(8, "bad inode number %d to ginode", inumber); + errx(8, "bad inode number %ju to ginode", (uintmax_t)inumber); if (startinum == 0 || inumber < startinum || inumber >= startinum + INOPB(&sblock)) { inoblk = fsbtodb(&sblock, ino_to_fsba(&sblock, inumber)); rdfs(inoblk, (size_t)sblock.fs_bsize, inobuf, fsi); startinum = (inumber / INOPB(&sblock)) * INOPB(&sblock); } + ioff = inumber % INOPB(&sblock); DBG_LEAVE; if (sblock.fs_magic == FS_UFS1_MAGIC) return (union dinode *)((uintptr_t)inobuf + - (inumber % INOPB(&sblock)) * sizeof(struct ufs1_dinode)); + ioff * sizeof(struct ufs1_dinode)); return (union dinode *)((uintptr_t)inobuf + - (inumber % INOPB(&sblock)) * sizeof(struct ufs2_dinode)); + ioff * sizeof(struct ufs2_dinode)); } /* ****************************************************** charsperline ***** */ Modified: projects/ino64/sbin/newfs/mkfs.c ============================================================================== --- projects/ino64/sbin/newfs/mkfs.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/newfs/mkfs.c Thu Sep 1 16:43:23 2011 (r225314) @@ -1005,7 +1005,8 @@ iput(union dinode *ip, ino_t ino) sblock.fs_cstotal.cs_nifree--; fscs[0].cs_nifree--; if (ino >= (unsigned long)sblock.fs_ipg * sblock.fs_ncg) { - printf("fsinit: inode value out of range (%d).\n", ino); + printf("fsinit: inode value out of range (%ju).\n", + (uintmax_t)ino); exit(32); } d = fsbtodb(&sblock, ino_to_fsba(&sblock, ino)); Modified: projects/ino64/sbin/quotacheck/quotacheck.c ============================================================================== --- projects/ino64/sbin/quotacheck/quotacheck.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/quotacheck/quotacheck.c Thu Sep 1 16:43:23 2011 (r225314) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -383,9 +384,9 @@ chkquota(char *specname, struct quotafil if (vflag) { if (aflag) (void)printf("%s: ", mntpt); - (void)printf("out of range UID/GID (%u/%u) ino=%u\n", + (void)printf("out of range UID/GID (%u/%u) ino=%ju\n", DIP(dp, di_uid), DIP(dp,di_gid), - ino); + (uintmax_t)ino); } continue; } @@ -601,7 +602,8 @@ getnextinode(ino_t inumber) static caddr_t nextinop; if (inumber != nextino++ || inumber > lastvalidinum) - errx(1, "bad inode number %d to nextinode", inumber); + errx(1, "bad inode number %ju to nextinode", + (uintmax_t)inumber); if (inumber >= lastinum) { readcnt++; dblk = fsbtodb(&sblock, ino_to_fsba(&sblock, lastinum)); @@ -635,7 +637,7 @@ setinodebuf(ino_t inum) { if (inum % sblock.fs_ipg != 0) - errx(1, "bad inode number %d to setinodebuf", inum); + errx(1, "bad inode number %ju to setinodebuf", (uintmax_t)inum); lastvalidinum = inum + sblock.fs_ipg - 1; nextino = inum; lastinum = inum; Modified: projects/ino64/sbin/restore/dirs.c ============================================================================== --- projects/ino64/sbin/restore/dirs.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/restore/dirs.c Thu Sep 1 16:43:23 2011 (r225314) @@ -637,7 +637,8 @@ setdirmodes(int flags) continue; } if (ep == NULL) { - panic("cannot find directory inode %d\n", node.ino); + panic("cannot find directory inode %ju\n", + (uintmax_t)node.ino); continue; } cp = myname(ep); @@ -678,7 +679,8 @@ genliteraldir(char *name, ino_t ino) itp = inotablookup(ino); if (itp == NULL) - panic("Cannot find directory inode %d named %s\n", ino, name); + panic("Cannot find directory inode %ju named %s\n", + (uintmax_t)ino, name); if ((ofile = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) { fprintf(stderr, "%s: ", name); (void) fflush(stderr); @@ -691,15 +693,15 @@ genliteraldir(char *name, ino_t ino) size = i < BUFSIZ ? i : BUFSIZ; if (read(dp, buf, (int) size) == -1) { fprintf(stderr, - "write error extracting inode %d, name %s\n", - curfile.ino, curfile.name); + "write error extracting inode %ju, name %s\n", + (uintmax_t)curfile.ino, curfile.name); fprintf(stderr, "read: %s\n", strerror(errno)); done(1); } if (!Nflag && write(ofile, buf, (int) size) == -1) { fprintf(stderr, - "write error extracting inode %d, name %s\n", - curfile.ino, curfile.name); + "write error extracting inode %ju, name %s\n", + (uintmax_t)curfile.ino, curfile.name); fprintf(stderr, "write: %s\n", strerror(errno)); done(1); } Modified: projects/ino64/sbin/restore/interactive.c ============================================================================== --- projects/ino64/sbin/restore/interactive.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/restore/interactive.c Thu Sep 1 16:43:23 2011 (r225314) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -675,7 +676,8 @@ formatf(struct afile *list, int nentry) for (j = 0; j < columns; j++) { fp = &list[j * lines + i]; if (vflag) { - fprintf(stderr, "%*d ", precision, fp->fnum); + fprintf(stderr, "%*ju ", + precision, (uintmax_t)fp->fnum); fp->len += precision + 1; } if (haveprefix) { Modified: projects/ino64/sbin/restore/restore.c ============================================================================== --- projects/ino64/sbin/restore/restore.c Thu Sep 1 16:41:06 2011 (r225313) +++ projects/ino64/sbin/restore/restore.c Thu Sep 1 16:43:23 2011 (r225314) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -61,7 +62,7 @@ listfile(char *name, ino_t ino, int type if (TSTINO(ino, dumpmap) == 0) return (descend); vprintf(stdout, "%s", type == LEAF ? "leaf" : "dir "); - fprintf(stdout, "%10d\t%s\n", ino, name); + fprintf(stdout, "%10ju\t%s\n", (uintmax_t)ino, name); return (descend); } @@ -83,7 +84,7 @@ addfile(char *name, ino_t ino, int type) if (ino == WINO && command == 'i' && !vflag) return (descend); if (!mflag) { - (void) sprintf(buf, "./%u", ino); + (void) sprintf(buf, "./%ju", (uintmax_t)ino); name = buf; if (type == NODE) { (void) genliteraldir(name, ino); @@ -457,8 +458,8 @@ nodeupdates(char *name, ino_t ino, int t * next incremental tape. */ case 0: - fprintf(stderr, "%s: (inode %d) not found on tape\n", - name, ino); + fprintf(stderr, "%s: (inode %ju) not found on tape\n", + name, (uintmax_t)ino); break; /* @@ -612,7 +613,7 @@ createleaves(char *symtabfile) while (first < curfile.ino) { ep = lookupino(first); if (ep == NULL) - panic("%d: bad first\n", first); + panic("%ju: bad first\n", (uintmax_t)first); fprintf(stderr, "%s: not found on tape\n", myname(ep)); ep->e_flags &= ~(NEW|EXTRACT); first = lowerbnd(first); @@ -625,8 +626,8 @@ createleaves(char *symtabfile) * on the next incremental tape. */ if (first != curfile.ino) { - fprintf(stderr, "expected next file %d, got %d\n", - first, curfile.ino); + fprintf(stderr, "expected next file %ju, got %ju\n", + (uintmax_t)first, (uintmax_t)curfile.ino); skipfile(); goto next; } @@ -852,7 +853,7 @@ verifyfile(char *name, ino_t ino, int ty if (np == ep) break; if (np == NULL) - panic("missing inumber %d\n", ino); + panic("missing inumber %ju\n", (uintmax_t)ino); if (ep->e_type == LEAF && type != LEAF) badentry(ep, "type should be LEAF"); return (descend); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Thu Sep 1 20:37:34 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FFAB1065675; Thu, 1 Sep 2011 20:37:34 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 359478FC15; Thu, 1 Sep 2011 20:37:34 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id C16783593E1; Thu, 1 Sep 2011 22:37:32 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id B881C17416; Thu, 1 Sep 2011 22:37:32 +0200 (CEST) Date: Thu, 1 Sep 2011 22:37:32 +0200 From: Jilles Tjoelker To: Sergey Kandaurov Message-ID: <20110901203732.GA98596@stack.nl> References: <201108222354.p7MNsC9B074753@svn.freebsd.org> <20110824211427.GB96070@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-projects@freebsd.org, gk@freebsd.org, src-committers@freebsd.org, Matthew D Fleming Subject: Re: svn commit: r225097 - in projects/ino64: include lib/libc/gen usr.sbin/cpucontrol usr.sbin/lpr/common_source usr.sbin/newsyslog X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2011 20:37:34 -0000 On Thu, Sep 01, 2011 at 07:32:06PM +0400, Sergey Kandaurov wrote: > On 25 August 2011 01:14, Jilles Tjoelker wrote: > > On Mon, Aug 22, 2011 at 11:54:12PM +0000, Matthew D Fleming wrote: > >> Author: mdf > >> Date: Mon Aug 22 23:54:12 2011 > >> New Revision: 225097 > >> URL: http://svn.freebsd.org/changeset/base/225097 > >> Log: > >>   Avoid using dirfd name there is dirfd() macro already. > >>   Use dirfd() instead of dirp->dd_fd. > >>   Replace dirfd() macro with exported libc symbol. > >>   Use _dirfd() macro internally. > >>   GSoC r222835, r222836, r222837. > >>   Code by Gleb Kurtsou. > >> Added: projects/ino64/lib/libc/gen/dirfd.c > >> ============================================================================== > >> --- /dev/null 00:00:00 1970   (empty, because file is newly added) > >> +++ projects/ino64/lib/libc/gen/dirfd.c       Mon Aug 22 23:54:12 2011        (r225097) > > [snip] > >> +int > >> +dirfd(DIR *dirp) > >> +{ > >> +     if (dirp == NULL) > >> +             return (-1); > >> + > >> +     return (_dirfd(dirp)); > >> +} > > Why have this check here? I think the original behaviour (a segfault) is > > more useful here since the return value of this interface is often not > > checked. > Why not to convert it to EINVAL? > As per IEEE Std 1003.1-2008: > The dirfd() function may fail if: > [EINVAL] > The dirp argument does not refer to a valid directory stream. Given that this error is optional and that there is no other mention of this condition, I think the undefined behaviour for a function argument outside the permitted domain still applies. Also, glibc and OpenSolaris dirfd() likewise segfault if passed a null pointer. A Google code search suggested that the interface is often used without checking (for example, passing the result directly to fchdir() or a *at function) and in that case returning -1 for a NULL pointer makes the problem harder to diagnose (fortunately, AT_FDCWD is not -1 so a *at function will at least fail with EBADF, like fchdir()). -- Jilles Tjoelker From owner-svn-src-projects@FreeBSD.ORG Thu Sep 1 21:42:55 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4B28106564A; Thu, 1 Sep 2011 21:42:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C046C8FC17; Thu, 1 Sep 2011 21:42:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p81Lgtp1068943; Thu, 1 Sep 2011 21:42:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p81Lgt4G068930; Thu, 1 Sep 2011 21:42:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201109012142.p81Lgt4G068930@svn.freebsd.org> From: Alexander Motin Date: Thu, 1 Sep 2011 21:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225317 - in projects/zfsd/head: . bin/ed contrib/top etc etc/rc.d gnu/usr.bin/gdb/arch/arm gnu/usr.bin/gdb/kgdb lib/libarchive lib/libarchive/test lib/libbsnmp/libbsnmp lib/libc/sys li... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2011 21:42:55 -0000 Author: mav Date: Thu Sep 1 21:42:54 2011 New Revision: 225317 URL: http://svn.freebsd.org/changeset/base/225317 Log: Integrate from head at r225316. Added: projects/zfsd/head/lib/libarchive/test/test_read_format_iso_2.iso.Z.uu - copied unchanged from r225316, head/lib/libarchive/test/test_read_format_iso_2.iso.Z.uu projects/zfsd/head/lib/libc/sys/pdfork.2 - copied unchanged from r225316, head/lib/libc/sys/pdfork.2 projects/zfsd/head/libexec/rtld-elf/rtld_printf.c - copied unchanged from r225316, head/libexec/rtld-elf/rtld_printf.c projects/zfsd/head/libexec/rtld-elf/rtld_printf.h - copied unchanged from r225316, head/libexec/rtld-elf/rtld_printf.h projects/zfsd/head/sys/kern/sys_procdesc.c - copied unchanged from r225316, head/sys/kern/sys_procdesc.c projects/zfsd/head/sys/sys/procdesc.h - copied unchanged from r225316, head/sys/sys/procdesc.h projects/zfsd/head/tools/regression/ipfw/ - copied from r225316, head/tools/regression/ipfw/ projects/zfsd/head/tools/regression/security/cap_test/cap_test_pdfork.c - copied unchanged from r225316, head/tools/regression/security/cap_test/cap_test_pdfork.c projects/zfsd/head/tools/regression/security/cap_test/cap_test_pdkill.c - copied unchanged from r225316, head/tools/regression/security/cap_test/cap_test_pdkill.c Modified: projects/zfsd/head/ObsoleteFiles.inc projects/zfsd/head/UPDATING projects/zfsd/head/bin/ed/buf.c projects/zfsd/head/etc/motd projects/zfsd/head/etc/rc.d/Makefile projects/zfsd/head/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c projects/zfsd/head/gnu/usr.bin/gdb/kgdb/kthr.c projects/zfsd/head/lib/libarchive/archive_read_support_format_iso9660.c projects/zfsd/head/lib/libarchive/test/test_read_format_iso_gz.c projects/zfsd/head/lib/libarchive/test/test_read_format_isojoliet_bz2.c projects/zfsd/head/lib/libarchive/test/test_read_format_isojoliet_long.c projects/zfsd/head/lib/libarchive/test/test_read_format_isojoliet_rr.c projects/zfsd/head/lib/libarchive/test/test_read_format_isorr_bz2.c projects/zfsd/head/lib/libarchive/test/test_read_format_isorr_new_bz2.c projects/zfsd/head/lib/libarchive/test/test_read_format_isozisofs_bz2.c projects/zfsd/head/lib/libbsnmp/libbsnmp/Makefile projects/zfsd/head/lib/libc/sys/Makefile.inc projects/zfsd/head/lib/libc/sys/Symbol.map projects/zfsd/head/lib/libc/sys/cap_new.2 projects/zfsd/head/lib/libc/sys/sigwait.2 projects/zfsd/head/lib/libc/sys/sigwaitinfo.2 projects/zfsd/head/lib/libcam/Makefile projects/zfsd/head/lib/libdwarf/Makefile projects/zfsd/head/lib/libopie/Makefile projects/zfsd/head/lib/libpcap/Makefile projects/zfsd/head/lib/librtld_db/Makefile projects/zfsd/head/lib/libtacplus/Makefile projects/zfsd/head/lib/libufs/Makefile projects/zfsd/head/lib/libusb/Makefile projects/zfsd/head/lib/libusb/libusb.3 projects/zfsd/head/lib/libusb/libusb.h projects/zfsd/head/lib/libusb/libusb10.c projects/zfsd/head/libexec/rtld-elf/Makefile projects/zfsd/head/libexec/rtld-elf/debug.c projects/zfsd/head/libexec/rtld-elf/malloc.c projects/zfsd/head/libexec/rtld-elf/rtld.c projects/zfsd/head/libexec/rtld-elf/rtld.h projects/zfsd/head/libexec/rtld-elf/rtld_lock.c projects/zfsd/head/libexec/rtld-elf/xmalloc.c projects/zfsd/head/release/Makefile projects/zfsd/head/release/doc/en_US.ISO8859-1/hardware/article.sgml projects/zfsd/head/release/doc/share/misc/dev.archlist.txt projects/zfsd/head/sbin/fdisk/fdisk.c projects/zfsd/head/sbin/geom/class/part/gpart.8 projects/zfsd/head/sbin/ipfw/ipfw.8 projects/zfsd/head/sbin/ipfw/ipfw2.c projects/zfsd/head/share/man/man4/Makefile projects/zfsd/head/share/man/man4/ata.4 projects/zfsd/head/share/man/man4/ath.4 projects/zfsd/head/share/man/man4/ath_hal.4 projects/zfsd/head/share/man/man4/carp.4 projects/zfsd/head/share/man/man4/puc.4 projects/zfsd/head/share/man/man4/uhso.4 projects/zfsd/head/share/man/man4/vxge.4 projects/zfsd/head/share/man/man9/DRIVER_MODULE.9 projects/zfsd/head/share/man/man9/Makefile projects/zfsd/head/share/man/man9/selrecord.9 projects/zfsd/head/sys/amd64/amd64/machdep.c projects/zfsd/head/sys/amd64/amd64/minidump_machdep.c projects/zfsd/head/sys/amd64/conf/GENERIC projects/zfsd/head/sys/amd64/conf/NOTES projects/zfsd/head/sys/arm/at91/uart_dev_at91usart.c projects/zfsd/head/sys/boot/forth/loader.conf projects/zfsd/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c projects/zfsd/head/sys/compat/linux/linux_fork.c projects/zfsd/head/sys/conf/NOTES projects/zfsd/head/sys/conf/files projects/zfsd/head/sys/conf/kern.pre.mk projects/zfsd/head/sys/conf/newvers.sh projects/zfsd/head/sys/conf/options projects/zfsd/head/sys/conf/options.amd64 projects/zfsd/head/sys/contrib/pf/net/if_pfsync.c projects/zfsd/head/sys/contrib/pf/net/pf.c projects/zfsd/head/sys/ddb/db_break.c projects/zfsd/head/sys/dev/acpica/acpi_hpet.c projects/zfsd/head/sys/dev/acpica/acpi_hpet.h projects/zfsd/head/sys/dev/ahci/ahci.c projects/zfsd/head/sys/dev/alc/if_alc.c projects/zfsd/head/sys/dev/arcmsr/arcmsr.c projects/zfsd/head/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c projects/zfsd/head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h projects/zfsd/head/sys/dev/ath/if_ath.c projects/zfsd/head/sys/dev/cfe/cfe_console.c projects/zfsd/head/sys/dev/coretemp/coretemp.c projects/zfsd/head/sys/dev/dcons/dcons_os.c projects/zfsd/head/sys/dev/gem/if_gem.c projects/zfsd/head/sys/dev/mii/brgphy.c projects/zfsd/head/sys/dev/mii/mii_physubr.c projects/zfsd/head/sys/dev/mps/mps_sas.c projects/zfsd/head/sys/dev/ofw/ofw_console.c projects/zfsd/head/sys/dev/puc/pucdata.c projects/zfsd/head/sys/dev/sio/sio.c projects/zfsd/head/sys/dev/sound/pci/hda/hdac.c projects/zfsd/head/sys/dev/streams/streams.c projects/zfsd/head/sys/dev/syscons/syscons.c projects/zfsd/head/sys/dev/syscons/syscons.h projects/zfsd/head/sys/dev/uart/uart_core.c projects/zfsd/head/sys/dev/usb/net/uhso.c projects/zfsd/head/sys/dev/usb/serial/u3g.c projects/zfsd/head/sys/dev/usb/usb_dev.c projects/zfsd/head/sys/dev/usb/usb_request.c projects/zfsd/head/sys/dev/usb/usbdevs projects/zfsd/head/sys/fs/devfs/devfs_vnops.c projects/zfsd/head/sys/fs/fifofs/fifo_vnops.c projects/zfsd/head/sys/fs/nfsserver/nfs_nfsdport.c projects/zfsd/head/sys/fs/nfsserver/nfs_nfsdserv.c projects/zfsd/head/sys/fs/procfs/procfs.c projects/zfsd/head/sys/i386/conf/GENERIC projects/zfsd/head/sys/i386/i386/machdep.c projects/zfsd/head/sys/kern/capabilities.conf projects/zfsd/head/sys/kern/init_main.c projects/zfsd/head/sys/kern/init_sysent.c projects/zfsd/head/sys/kern/kern_descrip.c projects/zfsd/head/sys/kern/kern_event.c projects/zfsd/head/sys/kern/kern_exit.c projects/zfsd/head/sys/kern/kern_fork.c projects/zfsd/head/sys/kern/kern_jail.c projects/zfsd/head/sys/kern/kern_kthread.c projects/zfsd/head/sys/kern/kern_proc.c projects/zfsd/head/sys/kern/kern_sig.c projects/zfsd/head/sys/kern/kern_timeout.c projects/zfsd/head/sys/kern/sched_4bsd.c projects/zfsd/head/sys/kern/sched_ule.c projects/zfsd/head/sys/kern/subr_kdb.c projects/zfsd/head/sys/kern/subr_sbuf.c projects/zfsd/head/sys/kern/sys_capability.c projects/zfsd/head/sys/kern/sys_generic.c projects/zfsd/head/sys/kern/sys_pipe.c projects/zfsd/head/sys/kern/sys_socket.c projects/zfsd/head/sys/kern/syscalls.c projects/zfsd/head/sys/kern/syscalls.master projects/zfsd/head/sys/kern/systrace_args.c projects/zfsd/head/sys/kern/tty.c projects/zfsd/head/sys/kern/tty_pts.c projects/zfsd/head/sys/kern/uipc_mqueue.c projects/zfsd/head/sys/kern/uipc_sem.c projects/zfsd/head/sys/kern/uipc_shm.c projects/zfsd/head/sys/kern/uipc_sockbuf.c projects/zfsd/head/sys/kern/uipc_socket.c projects/zfsd/head/sys/kern/uipc_usrreq.c projects/zfsd/head/sys/kern/vfs_subr.c projects/zfsd/head/sys/kern/vfs_syscalls.c projects/zfsd/head/sys/kern/vfs_vnops.c projects/zfsd/head/sys/modules/dcons/Makefile projects/zfsd/head/sys/modules/portalfs/Makefile projects/zfsd/head/sys/modules/sio/Makefile projects/zfsd/head/sys/net/bpf.c projects/zfsd/head/sys/net/if_bridge.c projects/zfsd/head/sys/net/if_ethersubr.c projects/zfsd/head/sys/net/if_tap.c projects/zfsd/head/sys/net/if_tun.c projects/zfsd/head/sys/net/radix_mpath.c projects/zfsd/head/sys/net80211/ieee80211_ht.c projects/zfsd/head/sys/net80211/ieee80211_output.c projects/zfsd/head/sys/netinet/in.c projects/zfsd/head/sys/netinet/ip_fw.h projects/zfsd/head/sys/netinet/ipfw/ip_fw2.c projects/zfsd/head/sys/netinet/ipfw/ip_fw_log.c projects/zfsd/head/sys/netinet/ipfw/ip_fw_pfil.c projects/zfsd/head/sys/netinet/ipfw/ip_fw_private.h projects/zfsd/head/sys/netinet/ipfw/ip_fw_sockopt.c projects/zfsd/head/sys/netinet/sctp_usrreq.c projects/zfsd/head/sys/netinet/tcp_input.c projects/zfsd/head/sys/netinet/tcp_output.c projects/zfsd/head/sys/netinet/udp_usrreq.c projects/zfsd/head/sys/netinet6/in6.c projects/zfsd/head/sys/netinet6/in6.h projects/zfsd/head/sys/netinet6/ip6_forward.c projects/zfsd/head/sys/netinet6/ip6_input.c projects/zfsd/head/sys/netinet6/ip6_output.c projects/zfsd/head/sys/netinet6/mld6.c projects/zfsd/head/sys/netinet6/udp6_usrreq.c projects/zfsd/head/sys/ofed/include/linux/linux_compat.c projects/zfsd/head/sys/opencrypto/cryptodev.c projects/zfsd/head/sys/pc98/cbus/sio.c projects/zfsd/head/sys/pc98/pc98/machdep.c projects/zfsd/head/sys/powerpc/mambo/mambo_console.c projects/zfsd/head/sys/rpc/clnt_dg.c projects/zfsd/head/sys/security/audit/audit_pipe.c projects/zfsd/head/sys/security/mac/mac_framework.h projects/zfsd/head/sys/security/mac/mac_policy.h projects/zfsd/head/sys/security/mac/mac_posix_sem.c projects/zfsd/head/sys/security/mac/mac_posix_shm.c projects/zfsd/head/sys/security/mac_stub/mac_stub.c projects/zfsd/head/sys/security/mac_test/mac_test.c projects/zfsd/head/sys/sparc64/sbus/sbus.c projects/zfsd/head/sys/sys/bus.h projects/zfsd/head/sys/sys/capability.h projects/zfsd/head/sys/sys/file.h projects/zfsd/head/sys/sys/kdb.h projects/zfsd/head/sys/sys/param.h projects/zfsd/head/sys/sys/proc.h projects/zfsd/head/sys/sys/selinfo.h projects/zfsd/head/sys/sys/sockbuf.h projects/zfsd/head/sys/sys/syscall.h projects/zfsd/head/sys/sys/syscall.mk projects/zfsd/head/sys/sys/sysproto.h projects/zfsd/head/sys/sys/unistd.h projects/zfsd/head/sys/sys/user.h projects/zfsd/head/sys/sys/vnode.h projects/zfsd/head/sys/ufs/ffs/ffs_alloc.c projects/zfsd/head/sys/ufs/ffs/ffs_extern.h projects/zfsd/head/sys/ufs/ffs/ffs_inode.c projects/zfsd/head/sys/ufs/ffs/ffs_softdep.c projects/zfsd/head/sys/ufs/ufs/ufs_extattr.c projects/zfsd/head/sys/vm/swap_pager.c projects/zfsd/head/sys/x86/acpica/acpi_apm.c projects/zfsd/head/sys/x86/x86/tsc.c projects/zfsd/head/tools/regression/security/cap_test/Makefile projects/zfsd/head/tools/regression/security/cap_test/cap_test.c projects/zfsd/head/tools/regression/security/cap_test/cap_test.h projects/zfsd/head/tools/regression/security/cap_test/cap_test_capabilities.c projects/zfsd/head/usr.bin/grep/grep.c projects/zfsd/head/usr.bin/grep/util.c projects/zfsd/head/usr.bin/nfsstat/nfsstat.c projects/zfsd/head/usr.sbin/bsdinstall/partedit/diskeditor.c projects/zfsd/head/usr.sbin/bsdinstall/partedit/gpart_ops.c projects/zfsd/head/usr.sbin/bsdinstall/partedit/part_wizard.c projects/zfsd/head/usr.sbin/bsdinstall/partedit/partedit.c projects/zfsd/head/usr.sbin/bsdinstall/scripts/adduser projects/zfsd/head/usr.sbin/bsdinstall/scripts/docsinstall projects/zfsd/head/usr.sbin/bsdinstall/scripts/mirrorselect projects/zfsd/head/usr.sbin/bsdinstall/scripts/rootpass projects/zfsd/head/usr.sbin/makefs/cd9660.c projects/zfsd/head/usr.sbin/mfiutil/mfi_show.c Directory Properties: projects/zfsd/head/ (props changed) projects/zfsd/head/cddl/contrib/opensolaris/ (props changed) projects/zfsd/head/contrib/bind9/ (props changed) projects/zfsd/head/contrib/binutils/ (props changed) projects/zfsd/head/contrib/bzip2/ (props changed) projects/zfsd/head/contrib/compiler-rt/ (props changed) projects/zfsd/head/contrib/dialog/ (props changed) projects/zfsd/head/contrib/ee/ (props changed) projects/zfsd/head/contrib/expat/ (props changed) projects/zfsd/head/contrib/file/ (props changed) projects/zfsd/head/contrib/gcc/ (props changed) projects/zfsd/head/contrib/gdb/ (props changed) projects/zfsd/head/contrib/gdtoa/ (props changed) projects/zfsd/head/contrib/gnu-sort/ (props changed) projects/zfsd/head/contrib/groff/ (props changed) projects/zfsd/head/contrib/less/ (props changed) projects/zfsd/head/contrib/libpcap/ (props changed) projects/zfsd/head/contrib/libstdc++/ (props changed) projects/zfsd/head/contrib/llvm/ (props changed) projects/zfsd/head/contrib/llvm/tools/clang/ (props changed) projects/zfsd/head/contrib/ncurses/ (props changed) projects/zfsd/head/contrib/netcat/ (props changed) projects/zfsd/head/contrib/ntp/ (props changed) projects/zfsd/head/contrib/one-true-awk/ (props changed) projects/zfsd/head/contrib/openbsm/ (props changed) projects/zfsd/head/contrib/openpam/ (props changed) projects/zfsd/head/contrib/pf/ (props changed) projects/zfsd/head/contrib/sendmail/ (props changed) projects/zfsd/head/contrib/tcpdump/ (props changed) projects/zfsd/head/contrib/tcsh/ (props changed) projects/zfsd/head/contrib/tnftp/ (props changed) projects/zfsd/head/contrib/top/ (props changed) projects/zfsd/head/contrib/top/install-sh (props changed) projects/zfsd/head/contrib/tzcode/stdtime/ (props changed) projects/zfsd/head/contrib/tzcode/zic/ (props changed) projects/zfsd/head/contrib/tzdata/ (props changed) projects/zfsd/head/contrib/wpa/ (props changed) projects/zfsd/head/contrib/xz/ (props changed) projects/zfsd/head/crypto/openssh/ (props changed) projects/zfsd/head/crypto/openssl/ (props changed) projects/zfsd/head/gnu/lib/ (props changed) projects/zfsd/head/gnu/usr.bin/binutils/ (props changed) projects/zfsd/head/gnu/usr.bin/cc/cc_tools/ (props changed) projects/zfsd/head/gnu/usr.bin/gdb/ (props changed) projects/zfsd/head/lib/libc/ (props changed) projects/zfsd/head/lib/libc/stdtime/ (props changed) projects/zfsd/head/lib/libutil/ (props changed) projects/zfsd/head/lib/libz/ (props changed) projects/zfsd/head/sbin/ (props changed) projects/zfsd/head/sbin/ipfw/ (props changed) projects/zfsd/head/share/mk/bsd.arch.inc.mk (props changed) projects/zfsd/head/share/zoneinfo/ (props changed) projects/zfsd/head/sys/ (props changed) projects/zfsd/head/sys/amd64/include/xen/ (props changed) projects/zfsd/head/sys/boot/ (props changed) projects/zfsd/head/sys/boot/i386/efi/ (props changed) projects/zfsd/head/sys/boot/ia64/efi/ (props changed) projects/zfsd/head/sys/boot/ia64/ski/ (props changed) projects/zfsd/head/sys/boot/powerpc/boot1.chrp/ (props changed) projects/zfsd/head/sys/boot/powerpc/ofw/ (props changed) projects/zfsd/head/sys/cddl/contrib/opensolaris/ (props changed) projects/zfsd/head/sys/conf/ (props changed) projects/zfsd/head/sys/contrib/dev/acpica/ (props changed) projects/zfsd/head/sys/contrib/octeon-sdk/ (props changed) projects/zfsd/head/sys/contrib/pf/ (props changed) projects/zfsd/head/sys/contrib/x86emu/ (props changed) projects/zfsd/head/usr.bin/calendar/ (props changed) projects/zfsd/head/usr.bin/csup/ (props changed) projects/zfsd/head/usr.bin/procstat/ (props changed) projects/zfsd/head/usr.sbin/ndiscvt/ (props changed) projects/zfsd/head/usr.sbin/rtadvctl/ (props changed) projects/zfsd/head/usr.sbin/rtadvd/ (props changed) projects/zfsd/head/usr.sbin/zic/ (props changed) Modified: projects/zfsd/head/ObsoleteFiles.inc ============================================================================== --- projects/zfsd/head/ObsoleteFiles.inc Thu Sep 1 19:39:10 2011 (r225316) +++ projects/zfsd/head/ObsoleteFiles.inc Thu Sep 1 21:42:54 2011 (r225317) @@ -38,6 +38,23 @@ # xargs -n1 | sort | uniq -d; # done +# 20110828: library version bump for 9.0 +OLD_LIBS+=lib/libufs.so.5 +OLD_LIBS+=usr/lib/libbsnmp.so.5 +OLD_LIBS+=usr/lib/libdwarf.so.2 +OLD_LIBS+=usr/lib/libopie.so.6 +OLD_LIBS+=usr/lib/libpcap.so.7 +OLD_LIBS+=usr/lib/librtld_db.so.1 +OLD_LIBS+=usr/lib/libtacplus.so.4 +.if ${TARGET_ARCH} == "amd64" +OLD_LIBS+=usr/lib32/libufs.so.5 +OLD_LIBS+=usr/lib32/libbsnmp.so.5 +OLD_LIBS+=usr/lib32/libdwarf.so.2 +OLD_LIBS+=usr/lib32/libopie.so.6 +OLD_LIBS+=usr/lib32/libpcap.so.7 +OLD_LIBS+=usr/lib32/librtld_db.so.1 +OLD_LIBS+=usr/lib32/libtacplus.so.4 +.endif # 20110709: vm_map_clean.9 -> vm_map_sync.9 OLD_FILES+=usr/share/man/man9/vm_map_clean.9.gz # 20110709: Catch up with removal of these functions. @@ -2043,9 +2060,9 @@ OLD_FILES+=usr/share/man/man5/ipsend.5.g OLD_FILES+=usr/bin/gtar OLD_FILES+=usr/share/man/man1/gtar.1.gz # 200503XX -OLD_FILES+=share/man/man3/exp10.3.gz -OLD_FILES+=share/man/man3/exp10f.3.gz -OLD_FILES+=share/man/man3/fpsetsticky.3.gz +OLD_FILES+=usr/share/man/man3/exp10.3.gz +OLD_FILES+=usr/share/man/man3/exp10f.3.gz +OLD_FILES+=usr/share/man/man3/fpsetsticky.3.gz # 20050324: updated release infrastructure OLD_FILES+=usr/share/man/man5/drivers.conf.5.gz # 20050317: removed from BIND 9 distribution @@ -2293,6 +2310,8 @@ OLD_FILES+=lib/libz.so OLD_FILES+=bin/cxconfig OLD_FILES+=sbin/cxconfig OLD_FILES+=usr/share/man/man8/cxconfig.8.gz +# 20031016: MULTI_DRIVER_MODULE macro removed +OLD_FILES+=usr/share/man/man9/MULTI_DRIVER_MODULE.9.gz # 200309XX OLD_FILES+=usr/bin/symorder OLD_FILES+=usr/share/man/man1/symorder.1.gz Modified: projects/zfsd/head/UPDATING ============================================================================== --- projects/zfsd/head/UPDATING Thu Sep 1 19:39:10 2011 (r225316) +++ projects/zfsd/head/UPDATING Thu Sep 1 21:42:54 2011 (r225317) @@ -22,6 +22,22 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20110828: + Bump the shared library version numbers for libraries that + do not use symbol versioning, have changed the ABI compared + to stable/8 and which shared library version was not bumped. + Done as part of 9.0-RELEASE cycle. + +20110815: + During the merge of Capsicum features, the fget(9) KPI was modified. + This may require the rebuilding of out-of-tree device drivers -- + issues have been reported specifically with the nVidia device driver. + __FreeBSD_version is bumped to 900041. + + Also, there is a period between 20110811 and 20110814 where the + special devices /dev/{stdin,stdout,stderr} did not work correctly. + Building world from a kernel during that window may not work. + 20110628: The packet filter (pf) code has been updated to OpenBSD 4.5. You need to update userland tools to be in sync with kernel. @@ -1446,9 +1462,10 @@ COMMON ITEMS: FORMAT: This file contains a list, in reverse chronological order, of major -breakages in tracking -current. Not all things will be listed here, -and it only starts on October 16, 2004. Updating files can found in -previous releases if your system is older than this. +breakages in tracking -current. It is not guaranteed to be a complete +list of such breakages, and only contains entries since October 10, 2007. +If you need to see UPDATING entries from before that date, you will need +to fetch an UPDATING file from an older FreeBSD release. Copyright information: Modified: projects/zfsd/head/bin/ed/buf.c ============================================================================== --- projects/zfsd/head/bin/ed/buf.c Thu Sep 1 19:39:10 2011 (r225316) +++ projects/zfsd/head/bin/ed/buf.c Thu Sep 1 21:42:54 2011 (r225317) @@ -94,6 +94,7 @@ put_sbuf_line(const char *cs) ; if (s - cs >= LINECHARS) { errmsg = "line too long"; + free(lp); return NULL; } len = s - cs; @@ -102,6 +103,7 @@ put_sbuf_line(const char *cs) if (fseeko(sfp, (off_t)0, SEEK_END) < 0) { fprintf(stderr, "%s\n", strerror(errno)); errmsg = "cannot seek temp file"; + free(lp); return NULL; } sfseek = ftello(sfp); @@ -112,6 +114,7 @@ put_sbuf_line(const char *cs) sfseek = -1; fprintf(stderr, "%s\n", strerror(errno)); errmsg = "cannot write temp file"; + free(lp); return NULL; } lp->len = len; Modified: projects/zfsd/head/etc/motd ============================================================================== --- projects/zfsd/head/etc/motd Thu Sep 1 19:39:10 2011 (r225316) +++ projects/zfsd/head/etc/motd Thu Sep 1 21:42:54 2011 (r225317) @@ -10,8 +10,10 @@ o Security advisories and updated errat o The Handbook and FAQ documents are at http://www.FreeBSD.org/ and, along with the mailing lists, can be searched by going to - http://www.FreeBSD.org/search/. If the doc distribution has - been installed, they're also available formatted in /usr/share/doc. + http://www.FreeBSD.org/search/. If the doc package has been installed + (or fetched via pkg_add -r lang-freebsd-doc, where lang is the + 2-letter language code, e.g. en), they are also available formatted + in /usr/local/share/doc/freebsd. If you still have a question or problem, please take the output of `uname -a', along with any relevant error messages, and email it Modified: projects/zfsd/head/etc/rc.d/Makefile ============================================================================== --- projects/zfsd/head/etc/rc.d/Makefile Thu Sep 1 19:39:10 2011 (r225316) +++ projects/zfsd/head/etc/rc.d/Makefile Thu Sep 1 21:42:54 2011 (r225317) @@ -16,7 +16,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI hostapd hostid hostid_save hostname \ inetd initrandom \ ip6addrctl ipfilter ipfs ipfw ipmon \ - ipnat ipsec ipxrouted \ + ipnat ipsec \ jail \ kadmind kerberos keyserv kld kldxref kpasswdd \ ldconfig local localpkg lockd lpd \ @@ -42,6 +42,10 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI ypset ypupdated ypxfrd \ zfs zvol +.if ${MK_IPX} != "no" +FILES+= ipxrouted +.endif + .if ${MK_OFED} != "no" FILES+= opensm .endif Modified: projects/zfsd/head/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c ============================================================================== --- projects/zfsd/head/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c Thu Sep 1 19:39:10 2011 (r225316) +++ projects/zfsd/head/gnu/usr.bin/gdb/arch/arm/armfbsd-nat.c Thu Sep 1 21:42:54 2011 (r225317) @@ -32,8 +32,8 @@ #include "arm-tdep.h" #include -#include #ifndef CROSS_DEBUGGER +#include #include #include #endif Modified: projects/zfsd/head/gnu/usr.bin/gdb/kgdb/kthr.c ============================================================================== --- projects/zfsd/head/gnu/usr.bin/gdb/kgdb/kthr.c Thu Sep 1 19:39:10 2011 (r225316) +++ projects/zfsd/head/gnu/usr.bin/gdb/kgdb/kthr.c Thu Sep 1 21:42:54 2011 (r225317) @@ -73,11 +73,52 @@ kgdb_thr_first(void) return (first); } -struct kthr * -kgdb_thr_init(void) +static void +kgdb_thr_add_procs(uintptr_t paddr) { struct proc p; struct thread td; + struct kthr *kt; + CORE_ADDR addr; + + while (paddr != 0) { + if (kvm_read(kvm, paddr, &p, sizeof(p)) != sizeof(p)) { + warnx("kvm_read: %s", kvm_geterr(kvm)); + break; + } + addr = (uintptr_t)TAILQ_FIRST(&p.p_threads); + while (addr != 0) { + if (kvm_read(kvm, addr, &td, sizeof(td)) != + sizeof(td)) { + warnx("kvm_read: %s", kvm_geterr(kvm)); + break; + } + kt = malloc(sizeof(*kt)); + kt->next = first; + kt->kaddr = addr; + if (td.td_tid == dumptid) + kt->pcb = dumppcb; + else if (td.td_state == TDS_RUNNING && stoppcbs != 0 && + CPU_ISSET(td.td_oncpu, &stopped_cpus)) + kt->pcb = (uintptr_t)stoppcbs + + sizeof(struct pcb) * td.td_oncpu; + else + kt->pcb = (uintptr_t)td.td_pcb; + kt->kstack = td.td_kstack; + kt->tid = td.td_tid; + kt->pid = p.p_pid; + kt->paddr = paddr; + kt->cpu = td.td_oncpu; + first = kt; + addr = (uintptr_t)TAILQ_NEXT(&td, td_plist); + } + paddr = (uintptr_t)LIST_NEXT(&p, p_list); + } +} + +struct kthr * +kgdb_thr_init(void) +{ long cpusetsize; struct kthr *kt; CORE_ADDR addr; @@ -113,37 +154,11 @@ kgdb_thr_init(void) stoppcbs = kgdb_lookup("stoppcbs"); - while (paddr != 0) { - if (kvm_read(kvm, paddr, &p, sizeof(p)) != sizeof(p)) { - warnx("kvm_read: %s", kvm_geterr(kvm)); - break; - } - addr = (uintptr_t)TAILQ_FIRST(&p.p_threads); - while (addr != 0) { - if (kvm_read(kvm, addr, &td, sizeof(td)) != - sizeof(td)) { - warnx("kvm_read: %s", kvm_geterr(kvm)); - break; - } - kt = malloc(sizeof(*kt)); - kt->next = first; - kt->kaddr = addr; - if (td.td_tid == dumptid) - kt->pcb = dumppcb; - else if (td.td_state == TDS_RUNNING && stoppcbs != 0 && - CPU_ISSET(td.td_oncpu, &stopped_cpus)) - kt->pcb = (uintptr_t) stoppcbs + sizeof(struct pcb) * td.td_oncpu; - else - kt->pcb = (uintptr_t)td.td_pcb; - kt->kstack = td.td_kstack; - kt->tid = td.td_tid; - kt->pid = p.p_pid; - kt->paddr = paddr; - kt->cpu = td.td_oncpu; - first = kt; - addr = (uintptr_t)TAILQ_NEXT(&td, td_plist); - } - paddr = (uintptr_t)LIST_NEXT(&p, p_list); + kgdb_thr_add_procs(paddr); + addr = kgdb_lookup("zombproc"); + if (addr != 0) { + kvm_read(kvm, addr, &paddr, sizeof(paddr)); + kgdb_thr_add_procs(paddr); } curkthr = kgdb_thr_lookup_tid(dumptid); if (curkthr == NULL) Modified: projects/zfsd/head/lib/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- projects/zfsd/head/lib/libarchive/archive_read_support_format_iso9660.c Thu Sep 1 19:39:10 2011 (r225316) +++ projects/zfsd/head/lib/libarchive/archive_read_support_format_iso9660.c Thu Sep 1 21:42:54 2011 (r225317) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2003-2007 Tim Kientzle * Copyright (c) 2009 Andreas Henriksson - * Copyright (c) 2009 Michihiro NAKAJIMA + * Copyright (c) 2009-2011 Michihiro NAKAJIMA * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -261,13 +261,17 @@ struct file_info { struct file_info *use_next; struct file_info *parent; struct file_info *next; + struct file_info *re_next; int subdirs; uint64_t key; /* Heap Key. */ uint64_t offset; /* Offset on disk. */ uint64_t size; /* File size in bytes. */ uint32_t ce_offset; /* Offset of CE. */ uint32_t ce_size; /* Size of CE. */ + char rr_moved; /* Flag to rr_moved. */ + char rr_moved_has_re_only; char re; /* Having RRIP "RE" extension. */ + char re_descendant; uint64_t cl_offset; /* Having RRIP "CL" extension. */ int birthtime_is_set; time_t birthtime; /* File created time. */ @@ -294,7 +298,10 @@ struct file_info { struct content *first; struct content **last; } contents; - char exposed; + struct { + struct file_info *first; + struct file_info **last; + } rede_files; }; struct heap_queue { @@ -317,8 +324,6 @@ struct iso9660 { unsigned char suspOffset; struct file_info *rr_moved; - struct heap_queue re_dirs; - struct heap_queue cl_files; struct read_ce_queue { struct read_ce_req { uint64_t offset;/* Offset of CE on disk. */ @@ -337,6 +342,10 @@ struct iso9660 { struct file_info *first; struct file_info **last; } cache_files; + struct { + struct file_info *first; + struct file_info **last; + } re_files; uint64_t current_position; ssize_t logical_block_size; @@ -377,7 +386,8 @@ static int isJolietSVD(struct iso9660 *, static int isSVD(struct iso9660 *, const unsigned char *); static int isEVD(struct iso9660 *, const unsigned char *); static int isPVD(struct iso9660 *, const unsigned char *); -static struct file_info *next_cache_entry(struct iso9660 *iso9660); +static int next_cache_entry(struct archive_read *, struct iso9660 *, + struct file_info **); static int next_entry_seek(struct archive_read *a, struct iso9660 *iso9660, struct file_info **pfile); static struct file_info * @@ -400,10 +410,12 @@ static void parse_rockridge_ZF1(struct f static void register_file(struct iso9660 *, struct file_info *); static void release_files(struct iso9660 *); static unsigned toi(const void *p, int n); +static inline void re_add_entry(struct iso9660 *, struct file_info *); +static inline struct file_info * re_get_entry(struct iso9660 *); +static inline int rede_add_entry(struct file_info *); +static inline struct file_info * rede_get_entry(struct file_info *); static inline void cache_add_entry(struct iso9660 *iso9660, struct file_info *file); -static inline void cache_add_to_next_of_parent(struct iso9660 *iso9660, - struct file_info *file); static inline struct file_info *cache_get_entry(struct iso9660 *iso9660); static void heap_add_entry(struct heap_queue *heap, struct file_info *file, uint64_t key); @@ -430,6 +442,8 @@ archive_read_support_format_iso9660(stru iso9660->magic = ISO9660_MAGIC; iso9660->cache_files.first = NULL; iso9660->cache_files.last = &(iso9660->cache_files.first); + iso9660->re_files.first = NULL; + iso9660->re_files.last = &(iso9660->re_files.first); /* Enable to support Joliet extensions by default. */ iso9660->opt_support_joliet = 1; /* Enable to support Rock Ridge extensions by default. */ @@ -975,42 +989,38 @@ read_children(struct archive_read *a, st child = parse_file_info(a, parent, p); if (child == NULL) return (ARCHIVE_FATAL); - if (child->cl_offset) - heap_add_entry(&(iso9660->cl_files), - child, child->cl_offset); - else { - if (child->multi_extent || multi != NULL) { - struct content *con; - - if (multi == NULL) { - multi = child; - multi->contents.first = NULL; - multi->contents.last = - &(multi->contents.first); - } - con = malloc(sizeof(struct content)); - if (con == NULL) { - archive_set_error( - &a->archive, ENOMEM, - "No memory for " - "multi extent"); - return (ARCHIVE_FATAL); - } - con->offset = child->offset; - con->size = child->size; - con->next = NULL; - *multi->contents.last = con; - multi->contents.last = &(con->next); - if (multi == child) - add_entry(iso9660, child); - else { - multi->size += child->size; - if (!child->multi_extent) - multi = NULL; - } - } else + if (child->cl_offset == 0 && + (child->multi_extent || multi != NULL)) { + struct content *con; + + if (multi == NULL) { + multi = child; + multi->contents.first = NULL; + multi->contents.last = + &(multi->contents.first); + } + con = malloc(sizeof(struct content)); + if (con == NULL) { + archive_set_error( + &a->archive, ENOMEM, + "No memory for " + "multi extent"); + return (ARCHIVE_FATAL); + } + con->offset = child->offset; + con->size = child->size; + con->next = NULL; + *multi->contents.last = con; + multi->contents.last = &(con->next); + if (multi == child) add_entry(iso9660, child); - } + else { + multi->size += child->size; + if (!child->multi_extent) + multi = NULL; + } + } else + add_entry(iso9660, child); } } @@ -1022,102 +1032,12 @@ read_children(struct archive_read *a, st } static int -relocate_dir(struct iso9660 *iso9660, struct file_info *file) -{ - struct file_info *re; - - re = heap_get_entry(&(iso9660->re_dirs)); - while (re != NULL && re->offset < file->cl_offset) { - /* This case is wrong pattern. - * But dont't reject this directory entry to be robust. */ - cache_add_entry(iso9660, re); - re = heap_get_entry(&(iso9660->re_dirs)); - } - if (re == NULL) - /* This case is wrong pattern. */ - return (0); - if (re->offset == file->cl_offset) { - re->parent->subdirs--; - re->parent = file->parent; - re->parent->subdirs++; - cache_add_to_next_of_parent(iso9660, re); - return (1); - } else - /* This case is wrong pattern. */ - heap_add_entry(&(iso9660->re_dirs), re, re->offset); - return (0); -} - -static int -read_entries(struct archive_read *a) -{ - struct iso9660 *iso9660; - struct file_info *file; - int r; - - iso9660 = (struct iso9660 *)(a->format->data); - - while ((file = next_entry(iso9660)) != NULL && - (file->mode & AE_IFMT) == AE_IFDIR) { - r = read_children(a, file); - if (r != ARCHIVE_OK) - return (r); - - if (iso9660->seenRockridge && - file->parent != NULL && - file->parent->parent == NULL && - iso9660->rr_moved == NULL && - (strcmp(file->name.s, "rr_moved") == 0 || - strcmp(file->name.s, ".rr_moved") == 0)) { - iso9660->rr_moved = file; - } else if (file->re) - heap_add_entry(&(iso9660->re_dirs), file, - file->offset); - else - cache_add_entry(iso9660, file); - } - if (file != NULL) - add_entry(iso9660, file); - - if (iso9660->rr_moved != NULL) { - /* - * Relocate directory which rr_moved has. - */ - while ((file = heap_get_entry(&(iso9660->cl_files))) != NULL) - relocate_dir(iso9660, file); - - /* If rr_moved directory still has children, - * Add rr_moved into pending_files to show - */ - if (iso9660->rr_moved->subdirs) { - cache_add_entry(iso9660, iso9660->rr_moved); - /* If entries which have "RE" extension are still - * remaining(this case is unlikely except ISO image - * is broken), the entries won't be exposed. */ - while ((file = heap_get_entry(&(iso9660->re_dirs))) != NULL) - cache_add_entry(iso9660, file); - } else - iso9660->rr_moved->parent->subdirs--; - } else { - /* - * In case ISO image is broken. If the name of rr_moved - * directory has been changed by damage, subdirectories - * of rr_moved entry won't be exposed. - */ - while ((file = heap_get_entry(&(iso9660->re_dirs))) != NULL) - cache_add_entry(iso9660, file); - } - - return (ARCHIVE_OK); -} - -static int archive_read_format_iso9660_read_header(struct archive_read *a, struct archive_entry *entry) { struct iso9660 *iso9660; struct file_info *file; - int r, rd_r; + int r, rd_r = ARCHIVE_OK; iso9660 = (struct iso9660 *)(a->format->data); @@ -1207,11 +1127,7 @@ archive_read_format_iso9660_read_header( a->archive.archive_format_name = "ISO9660 with Rockridge extensions"; } - rd_r = read_entries(a); - if (rd_r == ARCHIVE_FATAL) - return (ARCHIVE_FATAL); - } else - rd_r = ARCHIVE_OK; + } /* Get the next entry that appears after the current offset. */ r = next_entry_seek(a, iso9660, &file); @@ -1324,7 +1240,6 @@ archive_read_format_iso9660_read_header( /* Directory data has been read completely. */ iso9660->entry_bytes_remaining = 0; iso9660->entry_sparse_offset = 0; - file->exposed = 1; } if (rd_r != ARCHIVE_OK) @@ -1651,10 +1566,6 @@ archive_read_format_iso9660_cleanup(stru archive_string_free(&iso9660->previous_pathname); if (iso9660->pending_files.files) free(iso9660->pending_files.files); - if (iso9660->re_dirs.files) - free(iso9660->re_dirs.files); - if (iso9660->cl_files.files) - free(iso9660->cl_files.files); #ifdef HAVE_ZLIB_H free(iso9660->entry_zisofs.uncompressed_buffer); free(iso9660->entry_zisofs.block_pointers); @@ -1735,6 +1646,8 @@ parse_file_info(struct archive_read *a, file->size = fsize; file->mtime = isodate7(isodirrec + DR_date_offset); file->ctime = file->atime = file->mtime; + file->rede_files.first = NULL; + file->rede_files.last = &(file->rede_files.first); p = isodirrec + DR_name_offset; /* Rockridge extensions (if any) follow name. Compute this @@ -1873,9 +1786,40 @@ parse_file_info(struct archive_read *a, file->nlinks = 1;/* Reset nlink. we'll calculate it later. */ /* Tell file's parent how many children that parent has. */ - if (parent != NULL && (flags & 0x02) && file->cl_offset == 0) + if (parent != NULL && (flags & 0x02)) parent->subdirs++; + if (iso9660->seenRockridge) { + if (parent != NULL && parent->parent == NULL && + (flags & 0x02) && iso9660->rr_moved == NULL && + (strcmp(file->name.s, "rr_moved") == 0 || + strcmp(file->name.s, ".rr_moved") == 0)) { + iso9660->rr_moved = file; + file->rr_moved = 1; + file->rr_moved_has_re_only = 1; + file->re = 0; + parent->subdirs--; + } else if (file->re) { + /* This file's parent is not rr_moved, clear invalid + * "RE" mark. */ + if (parent == NULL || parent->rr_moved == 0) + file->re = 0; + else if ((flags & 0x02) == 0) { + file->rr_moved_has_re_only = 0; + file->re = 0; + } + } else if (parent != NULL && parent->rr_moved) + file->rr_moved_has_re_only = 0; + else if (parent != NULL && (flags & 0x02) && + (parent->re || parent->re_descendant)) + file->re_descendant = 1; + if (file->cl_offset != 0) { + parent->subdirs++; + /* To be appeared before other dirs. */ + file->offset = file->number = file->cl_offset; + } + } + #if DEBUG /* DEBUGGING: Warn about attributes I don't yet fully support. */ if ((flags & ~0x02) != 0) { @@ -2489,10 +2433,12 @@ next_entry_seek(struct archive_read *a, struct file_info **pfile) { struct file_info *file; + int r; - *pfile = file = next_cache_entry(iso9660); - if (file == NULL) - return (ARCHIVE_EOF); + r = next_cache_entry(a, iso9660, pfile); + if (r != ARCHIVE_OK) + return (r); + file = *pfile; /* Don't waste time seeking for zero-length bodies. */ if (file->size == 0) @@ -2513,8 +2459,9 @@ next_entry_seek(struct archive_read *a, return (ARCHIVE_OK); } -static struct file_info * -next_cache_entry(struct iso9660 *iso9660) +static int +next_cache_entry(struct archive_read *a, struct iso9660 *iso9660, + struct file_info **pfile) { struct file_info *file; struct { @@ -2526,21 +2473,128 @@ next_cache_entry(struct iso9660 *iso9660 file = cache_get_entry(iso9660); if (file != NULL) { - while (file->parent != NULL && !file->parent->exposed) { - /* If file's parent is not exposed, it's moved - * to next entry of its parent. */ - cache_add_to_next_of_parent(iso9660, file); - file = cache_get_entry(iso9660); - } - return (file); + *pfile = file; + return (ARCHIVE_OK); } - file = next_entry(iso9660); - if (file == NULL) - return (NULL); + for (;;) { + struct file_info *re, *d; + + *pfile = file = next_entry(iso9660); + if (file == NULL) { + /* + * If directory entries all which are descendant of + * rr_moved are stil remaning, expose their. + */ + if (iso9660->re_files.first != NULL && + iso9660->rr_moved != NULL && + iso9660->rr_moved->rr_moved_has_re_only) + /* Expose "rr_moved" entry. */ + cache_add_entry(iso9660, iso9660->rr_moved); + while ((re = re_get_entry(iso9660)) != NULL) { + /* Expose its descendant dirs. */ + while ((d = rede_get_entry(re)) != NULL) + cache_add_entry(iso9660, d); + } + if (iso9660->cache_files.first != NULL) + return (next_cache_entry(a, iso9660, pfile)); + return (ARCHIVE_EOF); + } + + if (file->cl_offset) { + struct file_info *first_re = NULL; + int nexted_re = 0; + + /* + * Find "RE" dir for the current file, which + * has "CL" flag. + */ + while ((re = re_get_entry(iso9660)) + != first_re) { + if (first_re == NULL) + first_re = re; + if (re->offset == file->cl_offset) { + re->parent->subdirs--; + re->parent = file->parent; + re->re = 0; + if (re->parent->re_descendant) { + nexted_re = 1; + re->re_descendant = 1; + if (rede_add_entry(re) < 0) + goto fatal_rr; + /* Move a list of descendants + * to a new ancestor. */ + while ((d = rede_get_entry( + re)) != NULL) + if (rede_add_entry(d) + < 0) + goto fatal_rr; + break; + } + /* Replace the current file + * with "RE" dir */ + *pfile = file = re; + /* Expose its descendant */ + while ((d = rede_get_entry( + file)) != NULL) + cache_add_entry( + iso9660, d); + break; + } else + re_add_entry(iso9660, re); + } + if (nexted_re) { + /* + * Do not expose this at this time + * because we have not gotten its full-path + * name yet. + */ + continue; + } + } else if ((file->mode & AE_IFMT) == AE_IFDIR) { + int r; + + /* Read file entries in this dir. */ + r = read_children(a, file); + if (r != ARCHIVE_OK) + return (r); + + /* + * Handle a special dir of Rockridge extensions, + * "rr_moved". + */ + if (file->rr_moved) { + /* + * If this has only the subdirectories which + * have "RE" flags, do not expose at this time. + */ + if (file->rr_moved_has_re_only) + continue; + /* Otherwise expose "rr_moved" entry. */ + } else if (file->re) { + /* + * Do not expose this at this time + * because we have not gotten its full-path + * name yet. + */ + re_add_entry(iso9660, file); + continue; + } else if (file->re_descendant) { + /* + * Do not expose this at this time + * because we have not gotten its full-path + * name yet. + */ + if (rede_add_entry(file) < 0) + goto fatal_rr; + continue; + } + } + break; + } if ((file->mode & AE_IFMT) != AE_IFREG || file->number == -1) - return (file); + return (ARCHIVE_OK); count = 0; number = file->number; @@ -2573,8 +2627,10 @@ next_cache_entry(struct iso9660 *iso9660 file = next_entry(iso9660); } - if (count == 0) - return (file); + if (count == 0) { + *pfile = file; + return ((file == NULL)?ARCHIVE_EOF:ARCHIVE_OK); + } if (file->number == -1) { file->next = NULL; *empty_files.last = file; @@ -2599,24 +2655,75 @@ next_cache_entry(struct iso9660 *iso9660 *iso9660->cache_files.last = empty_files.first; iso9660->cache_files.last = empty_files.last; } - return (cache_get_entry(iso9660)); + *pfile = cache_get_entry(iso9660); + return ((*pfile == NULL)?ARCHIVE_EOF:ARCHIVE_OK); + +fatal_rr: + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Failed to connect 'CL' pointer to 'RE' rr_moved pointer of" + "Rockridge extensions"); + return (ARCHIVE_FATAL); } static inline void -cache_add_entry(struct iso9660 *iso9660, struct file_info *file) +re_add_entry(struct iso9660 *iso9660, struct file_info *file) { - file->next = NULL; - *iso9660->cache_files.last = file; - iso9660->cache_files.last = &(file->next); + file->re_next = NULL; + *iso9660->re_files.last = file; + iso9660->re_files.last = &(file->re_next); +} + +static inline struct file_info * +re_get_entry(struct iso9660 *iso9660) +{ + struct file_info *file; + + if ((file = iso9660->re_files.first) != NULL) { + iso9660->re_files.first = file->re_next; + if (iso9660->re_files.first == NULL) + iso9660->re_files.last = + &(iso9660->re_files.first); + } + return (file); +} + +static inline int +rede_add_entry(struct file_info *file) +{ + struct file_info *re; + + re = file->parent; + while (re != NULL && !re->re) + re = re->parent; + if (re == NULL) + return (-1); + + file->re_next = NULL; + *re->rede_files.last = file; + re->rede_files.last = &(file->re_next); + return (0); +} + +static inline struct file_info * +rede_get_entry(struct file_info *re) +{ + struct file_info *file; + + if ((file = re->rede_files.first) != NULL) { + re->rede_files.first = file->re_next; + if (re->rede_files.first == NULL) + re->rede_files.last = + &(re->rede_files.first); + } + return (file); } static inline void -cache_add_to_next_of_parent(struct iso9660 *iso9660, struct file_info *file) +cache_add_entry(struct iso9660 *iso9660, struct file_info *file) { - file->next = file->parent->next; - file->parent->next = file; - if (iso9660->cache_files.last == &(file->parent->next)) - iso9660->cache_files.last = &(file->next); + file->next = NULL; + *iso9660->cache_files.last = file; + iso9660->cache_files.last = &(file->next); } static inline struct file_info * Copied: projects/zfsd/head/lib/libarchive/test/test_read_format_iso_2.iso.Z.uu (from r225316, head/lib/libarchive/test/test_read_format_iso_2.iso.Z.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/zfsd/head/lib/libarchive/test/test_read_format_iso_2.iso.Z.uu Thu Sep 1 21:42:54 2011 (r225317, copy of r225316, head/lib/libarchive/test/test_read_format_iso_2.iso.Z.uu) @@ -0,0 +1,37 @@ +$FreeBSD$ + +begin 644 test_read_format_iso_2.iso.Z +M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR +MI,F3*%.J7,FRIO8,.*'4NVK-FS:-.J7//JW/'D"-+GDRYLN7+F#-KWLRY +ML^?/H$.+'DVZM.G3J%.K7LVZM>O7L&/+GDV[MNW;N'/KWLV[M^_?P(,+'TZ\ +MN/'CR),K7\Z\N?/GT*-+GTZ]NO7KV+-KW\Z]N_?OX,.+'T^^O/GSZ-.K7\^^ +MO?OW\./+GT^_OOW[^//KW\^_O_^_`0Q!!`PPQ!```$Z408<04Q`!PH,01BCA +MA!16:.&%$!Z404$;>G0@``%\>"`""`#@04$>2)#0!`.)```%!<%8HD`EEF+C +MC:4($)"(!V+HXX]`!BGDD$06:>212":IY)),-NGDDU!&*>645%9II8\R%!@# +M##C$0(,,,6Q)PPP$DI-EF%QZ"::89,)`#H%PQBDGG&=NV>67:(Y9YH?_]>GG +MGX7](R"!!@)JZ*&()JKHHL<="...`AU80:0`!`$B`!=0.@2CG';JZ:>@A@H8 +MGR]>:FI`DP9@*:F9!BCJJ[#&*NNLM#[EXJ,#R3A0C3C:J*.I(0)P:XP`S!@0 +MK[W^RF,`+DY*T*3&%@O`&P@X4($"!I"C[(ZJNI@I09E&6R*UUBJP@+:0@NAJ +MK>RVZ^Z[\$;7;$'0[CIMM==FNZVZPI9*D*XT`M"KK^F&&(`)`%A0D`4&%&0` +MN?F20RF(!`CAP@XQQ*OQQAQW['%S:)3!!AMO*/#QR2BGK/+*G7I;4+CV0FPN +MNL`>..R_T@8\<(X%AX@P!@5AT#!!#^,[\\0!$$#$Q1FS[/334$M]MILM^WVVW#'+??<=-=M]]UXYZWW +MWGSW[???@`N^>:<=^[Y +MYZ"'+OKHI)=N^NFHIZ[ZZJRW[OKKL,O_/+,-^_\\]!'+_WTU%=O_?789Z_]]MQW[_WWX(BGK_[Z[+?O_OOPQR___/37;__]^.>O__[\]^___P`,H``'2,`"&O"`"$R@ +M`A?(P`8Z\($0C*`$)TC!"EKP@AC,H`8WR,$.>O"#(`RA"$=(PA*:\(0H3*$* +M5\C"%KKPA3",H0QG2,,:VO"&.,RA#G?(PQ[Z\(=`#*(0ATC$(AKQB$A,HA*7 +MR,0F.O&)4(RB%*=(Q2I:\8I8S*(6M\C%+GKQBV`,HQC'2,8RFO&,:$RC&M?( +MQC:Z\8UPC*,O.;X`RG.,=)SG*:\YSH3*^,RG/O?)SW[Z\Y\`#:A`!TK0@AKTH`A-J$(7RM"&.O2A +M$(VH1"=*T8I:]*(8S:A&-\K1CGKTHR`-J4A'2M*2FO2D*$VI2E?*TI:Z]*4P +MC:E,9TK3FMKTICC-J4YWRM.>^O2G0`VJ4(=*U*(:]:A(3:I2E\K4ICKUJ5"- +MJE2G2M6J6O6J6,VJ5K?*U:YZ]:M@#:M8QTK6LIKUK&A-JUK7RM:VNO6M<`TG +` +end Modified: projects/zfsd/head/lib/libarchive/test/test_read_format_iso_gz.c ============================================================================== --- projects/zfsd/head/lib/libarchive/test/test_read_format_iso_gz.c Thu Sep 1 19:39:10 2011 (r225316) +++ projects/zfsd/head/lib/libarchive/test/test_read_format_iso_gz.c Thu Sep 1 21:42:54 2011 (r225317) @@ -25,7 +25,8 @@ #include "test.h" __FBSDID("$FreeBSD$"); -DEFINE_TEST(test_read_format_iso_gz) +static void +test1(void) { struct archive_entry *ae; struct archive *a; @@ -49,4 +50,50 @@ DEFINE_TEST(test_read_format_iso_gz) assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); } +static +void test2(void) +{ + struct archive_entry *ae; + struct archive *a; + const char *name = "test_read_format_iso_2.iso.Z"; + + extract_reference_file(name); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_support_compression_all(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_filename(a, name, 512)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + assertEqualString(".", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + assertEqualString("A", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + assertEqualString("A/B", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + assertEqualString("C", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + assertEqualString("C/D", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_EOF, + archive_read_next_header(a, &ae)); + assertEqualInt(archive_compression(a), + ARCHIVE_COMPRESSION_COMPRESS); + assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); +} + +DEFINE_TEST(test_read_format_iso_gz) +{ + test1(); + test2(); +} + Modified: projects/zfsd/head/lib/libarchive/test/test_read_format_isojoliet_bz2.c ============================================================================== --- projects/zfsd/head/lib/libarchive/test/test_read_format_isojoliet_bz2.c Thu Sep 1 19:39:10 2011 (r225316) +++ projects/zfsd/head/lib/libarchive/test/test_read_format_isojoliet_bz2.c Thu Sep 1 21:42:54 2011 (r225317) @@ -95,7 +95,7 @@ DEFINE_TEST(test_read_format_isojoliet_b /* A regular file with two names ("hardlink" gets returned * first, so it's not marked as a hardlink). */ assertEqualInt(0, archive_read_next_header(a, &ae)); - assertEqualString("long-joliet-file-name.textfile", + assertEqualString("hardlink", archive_entry_pathname(ae)); assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); assert(archive_entry_hardlink(ae) == NULL); @@ -108,9 +108,10 @@ DEFINE_TEST(test_read_format_isojoliet_b *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Fri Sep 2 17:05:11 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A9281065675; Fri, 2 Sep 2011 17:05:11 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6084D8FC13; Fri, 2 Sep 2011 17:05:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p82H5Bjc008139; Fri, 2 Sep 2011 17:05:11 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p82H5BOh008135; Fri, 2 Sep 2011 17:05:11 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201109021705.p82H5BOh008135@svn.freebsd.org> From: Matthew D Fleming Date: Fri, 2 Sep 2011 17:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225337 - in projects/ino64: lib/libprocstat usr.bin/fstat X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2011 17:05:11 -0000 Author: mdf Date: Fri Sep 2 17:05:11 2011 New Revision: 225337 URL: http://svn.freebsd.org/changeset/base/225337 Log: Don't cast uint64_t inode number or size down to long or unsigned. GSoC r223084. Code by: Gleb Kurtsou. Modified: projects/ino64/lib/libprocstat/cd9660.c projects/ino64/lib/libprocstat/common_kvm.c projects/ino64/usr.bin/fstat/fstat.c Modified: projects/ino64/lib/libprocstat/cd9660.c ============================================================================== --- projects/ino64/lib/libprocstat/cd9660.c Fri Sep 2 16:50:24 2011 (r225336) +++ projects/ino64/lib/libprocstat/cd9660.c Fri Sep 2 17:05:11 2011 (r225337) @@ -84,7 +84,7 @@ isofs_filestat(kvm_t *kd, struct vnode * } vn->vn_fsid = dev2udev(kd, mnt.im_dev); vn->vn_mode = (mode_t)isonode.inode.iso_mode; - vn->vn_fileid = (long)isonode.i_number; - vn->vn_size = (u_long)isonode.i_size; + vn->vn_fileid = isonode.i_number; + vn->vn_size = isonode.i_size; return (0); } Modified: projects/ino64/lib/libprocstat/common_kvm.c ============================================================================== --- projects/ino64/lib/libprocstat/common_kvm.c Fri Sep 2 16:50:24 2011 (r225336) +++ projects/ino64/lib/libprocstat/common_kvm.c Fri Sep 2 17:05:11 2011 (r225337) @@ -99,9 +99,9 @@ ufs_filestat(kvm_t *kd, struct vnode *vp * comparisons */ vn->vn_fsid = dev2udev(kd, inode.i_dev); - vn->vn_fileid = (long)inode.i_number; + vn->vn_fileid = inode.i_number; vn->vn_mode = (mode_t)inode.i_mode; - vn->vn_size = (u_long)inode.i_size; + vn->vn_size = inode.i_size; return (0); } Modified: projects/ino64/usr.bin/fstat/fstat.c ============================================================================== --- projects/ino64/usr.bin/fstat/fstat.c Fri Sep 2 16:50:24 2011 (r225336) +++ projects/ino64/usr.bin/fstat/fstat.c Fri Sep 2 17:05:11 2011 (r225337) @@ -242,7 +242,7 @@ print_file_info(struct procstat *procsta for (d = devs; d != NULL; d = d->next) if (d->fsid == vn.vn_fsid) { fsmatch = 1; - if ((unsigned)d->ino == vn.vn_fileid) { + if (d->ino == vn.vn_fileid) { filename = d->name; break; } From owner-svn-src-projects@FreeBSD.ORG Fri Sep 2 17:30:51 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F30681065670; Fri, 2 Sep 2011 17:30:50 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8A3D8FC23; Fri, 2 Sep 2011 17:30:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p82HUods009112; Fri, 2 Sep 2011 17:30:50 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p82HUo2w009099; Fri, 2 Sep 2011 17:30:50 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201109021730.p82HUo2w009099@svn.freebsd.org> From: Matthew D Fleming Date: Fri, 2 Sep 2011 17:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225342 - in projects/ino64/sys: amd64/conf conf i386/conf ia64/conf kern pc98/conf powerpc/conf sparc64/conf X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2011 17:30:51 -0000 Author: mdf Date: Fri Sep 2 17:30:50 2011 New Revision: 225342 URL: http://svn.freebsd.org/changeset/base/225342 Log: Add a new COMPAT9 flag for FreeBSD 9.x compatibility system calls. Add COMPAT_FREEBSD9 option to kernel configs GSoC r223086, r223087. Modified: projects/ino64/sys/amd64/conf/GENERIC projects/ino64/sys/conf/NOTES projects/ino64/sys/conf/options projects/ino64/sys/i386/conf/GENERIC projects/ino64/sys/i386/conf/XEN projects/ino64/sys/ia64/conf/GENERIC projects/ino64/sys/kern/makesyscalls.sh projects/ino64/sys/kern/syscalls.master projects/ino64/sys/pc98/conf/GENERIC projects/ino64/sys/powerpc/conf/GENERIC projects/ino64/sys/powerpc/conf/GENERIC64 projects/ino64/sys/sparc64/conf/GENERIC Modified: projects/ino64/sys/amd64/conf/GENERIC ============================================================================== --- projects/ino64/sys/amd64/conf/GENERIC Fri Sep 2 17:11:59 2011 (r225341) +++ projects/ino64/sys/amd64/conf/GENERIC Fri Sep 2 17:30:50 2011 (r225342) @@ -49,6 +49,7 @@ options COMPAT_FREEBSD4 # Compatible w options COMPAT_FREEBSD5 # Compatible with FreeBSD5 options COMPAT_FREEBSD6 # Compatible with FreeBSD6 options COMPAT_FREEBSD7 # Compatible with FreeBSD7 +options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support Modified: projects/ino64/sys/conf/NOTES ============================================================================== --- projects/ino64/sys/conf/NOTES Fri Sep 2 17:11:59 2011 (r225341) +++ projects/ino64/sys/conf/NOTES Fri Sep 2 17:30:50 2011 (r225342) @@ -330,6 +330,9 @@ options COMPAT_FREEBSD6 # Enable FreeBSD7 compatibility syscalls options COMPAT_FREEBSD7 +# Enable FreeBSD9 compatibility syscalls +options COMPAT_FREEBSD9 + # # These three options provide support for System V Interface # Definition-style interprocess communication, in the form of shared Modified: projects/ino64/sys/conf/options ============================================================================== --- projects/ino64/sys/conf/options Fri Sep 2 17:11:59 2011 (r225341) +++ projects/ino64/sys/conf/options Fri Sep 2 17:30:50 2011 (r225342) @@ -74,6 +74,7 @@ COMPAT_FREEBSD4 opt_compat.h COMPAT_FREEBSD5 opt_compat.h COMPAT_FREEBSD6 opt_compat.h COMPAT_FREEBSD7 opt_compat.h +COMPAT_FREEBSD9 opt_compat.h COMPILING_LINT opt_global.h COMPRESS_USER_CORES opt_core.h CY_PCI_FASTINTR Modified: projects/ino64/sys/i386/conf/GENERIC ============================================================================== --- projects/ino64/sys/i386/conf/GENERIC Fri Sep 2 17:11:59 2011 (r225341) +++ projects/ino64/sys/i386/conf/GENERIC Fri Sep 2 17:30:50 2011 (r225342) @@ -50,6 +50,7 @@ options COMPAT_FREEBSD4 # Compatible w options COMPAT_FREEBSD5 # Compatible with FreeBSD5 options COMPAT_FREEBSD6 # Compatible with FreeBSD6 options COMPAT_FREEBSD7 # Compatible with FreeBSD7 +options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support Modified: projects/ino64/sys/i386/conf/XEN ============================================================================== --- projects/ino64/sys/i386/conf/XEN Fri Sep 2 17:11:59 2011 (r225341) +++ projects/ino64/sys/i386/conf/XEN Fri Sep 2 17:30:50 2011 (r225342) @@ -35,6 +35,7 @@ options COMPAT_FREEBSD4 # Compatible w options COMPAT_FREEBSD5 # Compatible with FreeBSD5 options COMPAT_FREEBSD6 # Compatible with FreeBSD6 options COMPAT_FREEBSD7 # Compatible with FreeBSD7 +options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options KTRACE # ktrace(1) support options STACK # stack(9) support options SYSVSHM # SYSV-style shared memory Modified: projects/ino64/sys/ia64/conf/GENERIC ============================================================================== --- projects/ino64/sys/ia64/conf/GENERIC Fri Sep 2 17:11:59 2011 (r225341) +++ projects/ino64/sys/ia64/conf/GENERIC Fri Sep 2 17:30:50 2011 (r225342) @@ -28,6 +28,7 @@ makeoptions DEBUG=-g # Build kernel with options AUDIT # Security event auditing options CD9660 # ISO 9660 Filesystem options COMPAT_FREEBSD7 # Compatible with FreeBSD7 +options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options DDB # Support DDB options DEADLKRES # Enable the deadlock resolver options FFS # Berkeley Fast Filesystem Modified: projects/ino64/sys/kern/makesyscalls.sh ============================================================================== --- projects/ino64/sys/kern/makesyscalls.sh Fri Sep 2 17:11:59 2011 (r225341) +++ projects/ino64/sys/kern/makesyscalls.sh Fri Sep 2 17:30:50 2011 (r225342) @@ -9,6 +9,7 @@ compat=COMPAT_43 compat4=COMPAT_FREEBSD4 compat6=COMPAT_FREEBSD6 compat7=COMPAT_FREEBSD7 +compat9=COMPAT_FREEBSD9 # output files: sysnames="syscalls.c" @@ -33,6 +34,8 @@ syscompat6="sysent.compat6.$$" syscompat6dcl="sysent.compat6dcl.$$" syscompat7="sysent.compat7.$$" syscompat7dcl="sysent.compat7dcl.$$" +syscompat9="sysent.compat9.$$" +syscompat9dcl="sysent.compat9dcl.$$" sysent="sysent.switch.$$" sysinc="sysinc.switch.$$" sysarg="sysarg.switch.$$" @@ -46,9 +49,9 @@ else capenabled="" fi -trap "rm $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp" 0 +trap "rm $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $syscompat9 $syscompat9dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp" 0 -touch $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp +touch $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat9 $syscompat9dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp case $# in 0) echo "usage: $0 input-file " 1>&2 @@ -87,6 +90,8 @@ s/\$//g syscompat6dcl = \"$syscompat6dcl\" syscompat7 = \"$syscompat7\" syscompat7dcl = \"$syscompat7dcl\" + syscompat9 = \"$syscompat9\" + syscompat9dcl = \"$syscompat9dcl\" sysent = \"$sysent\" syssw = \"$syssw\" sysinc = \"$sysinc\" @@ -100,6 +105,7 @@ s/\$//g compat4 = \"$compat4\" compat6 = \"$compat6\" compat7 = \"$compat7\" + compat9 = \"$compat9\" syscallprefix = \"$syscallprefix\" switchname = \"$switchname\" namesname = \"$namesname\" @@ -121,6 +127,7 @@ s/\$//g printf "\n#ifdef %s\n\n", compat4 > syscompat4 printf "\n#ifdef %s\n\n", compat6 > syscompat6 printf "\n#ifdef %s\n\n", compat7 > syscompat7 + printf "\n#ifdef %s\n\n", compat9 > syscompat9 printf "/*\n * System call names.\n *\n" > sysnames printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysnames @@ -199,6 +206,7 @@ s/\$//g print > syscompat4 print > syscompat6 print > syscompat7 + print > syscompat9 print > sysnames print > systrace print > systracetmp @@ -213,6 +221,7 @@ s/\$//g print > syscompat4 print > syscompat6 print > syscompat7 + print > syscompat9 print > sysnames print > systrace print > systracetmp @@ -227,6 +236,7 @@ s/\$//g print > syscompat4 print > syscompat6 print > syscompat7 + print > syscompat9 print > sysnames print > systrace print > systracetmp @@ -330,6 +340,8 @@ s/\$//g argalias = "freebsd6_" argalias if (flag("COMPAT7")) argalias = "freebsd7_" argalias + if (flag("COMPAT9")) + argalias = "freebsd9_" argalias } f++ @@ -452,7 +464,7 @@ s/\$//g next } type("COMPAT") || type("COMPAT4") || type("COMPAT6") || \ - type("COMPAT7") { + type("COMPAT7") || type("COMPAT9") { if (flag("COMPAT")) { ncompat++ out = syscompat @@ -481,6 +493,13 @@ s/\$//g wrap = "compat7" prefix = "freebsd7_" descr = "freebsd7" + } else if (flag("COMPAT9")) { + ncompat9++ + out = syscompat9 + outdcl = syscompat9dcl + wrap = "compat9" + prefix = "freebsd9_" + descr = "freebsd9" } parseline() if (argc != 0 && !flag("NOARGS") && !flag("NOPROTO") && \ @@ -555,7 +574,7 @@ s/\$//g END { printf "\n#define AS(name) (sizeof(struct name) / sizeof(register_t))\n" > sysinc - if (ncompat != 0 || ncompat4 != 0 || ncompat6 != 0 || ncompat7 != 0) + if (ncompat != 0 || ncompat4 != 0 || ncompat6 != 0 || ncompat7 != 0 || ncompat9 != 0) printf "#include \"opt_compat.h\"\n\n" > syssw if (ncompat != 0) { @@ -590,10 +609,19 @@ s/\$//g printf "#endif\n" > sysinc } + if (ncompat9 != 0) { + printf "\n#ifdef %s\n", compat9 > sysinc + printf "#define compat9(n, name) n, (sy_call_t *)__CONCAT(freebsd7_,name)\n" > sysinc + printf "#else\n" > sysinc + printf "#define compat9(n, name) 0, (sy_call_t *)nosys\n" > sysinc + printf "#endif\n" > sysinc + } + printf("\n#endif /* %s */\n\n", compat) > syscompatdcl printf("\n#endif /* %s */\n\n", compat4) > syscompat4dcl printf("\n#endif /* %s */\n\n", compat6) > syscompat6dcl printf("\n#endif /* %s */\n\n", compat7) > syscompat7dcl + printf("\n#endif /* %s */\n\n", compat9) > syscompat9dcl printf("\n#undef PAD_\n") > sysprotoend printf("#undef PADL_\n") > sysprotoend @@ -615,6 +643,7 @@ cat $sysarg $sysdcl \ $syscompat4 $syscompat4dcl \ $syscompat6 $syscompat6dcl \ $syscompat7 $syscompat7dcl \ + $syscompat9 $syscompat9dcl \ $sysaue $sysprotoend > $sysproto cat $systracetmp >> $systrace Modified: projects/ino64/sys/kern/syscalls.master ============================================================================== --- projects/ino64/sys/kern/syscalls.master Fri Sep 2 17:11:59 2011 (r225341) +++ projects/ino64/sys/kern/syscalls.master Fri Sep 2 17:30:50 2011 (r225342) @@ -12,7 +12,7 @@ ; case where the event exists, but we don't want auditing, the ; event should be #defined to AUE_NULL in audit_kevents.h. ; type one of STD, OBSOL, UNIMPL, COMPAT, COMPAT4, COMPAT6, -; COMPAT7, NODEF, NOARGS, NOPROTO, NOSTD +; COMPAT7, COMPAT9, NODEF, NOARGS, NOPROTO, NOSTD ; The COMPAT* options may be combined with one or more NO* ; options separated by '|' with no spaces (e.g. COMPAT|NOARGS) ; name psuedo-prototype of syscall routine @@ -28,6 +28,7 @@ ; COMPAT4 included on COMPAT4 #ifdef (FreeBSD 4 compat) ; COMPAT6 included on COMPAT6 #ifdef (FreeBSD 6 compat) ; COMPAT7 included on COMPAT7 #ifdef (FreeBSD 7 compat) +; COMPAT9 included on COMPAT9 #ifdef (FreeBSD 9 compat) ; OBSOL obsolete, not included in system, only specifies name ; UNIMPL not implemented, placeholder only ; NOSTD implemented but as a lkm that can be statically Modified: projects/ino64/sys/pc98/conf/GENERIC ============================================================================== --- projects/ino64/sys/pc98/conf/GENERIC Fri Sep 2 17:11:59 2011 (r225341) +++ projects/ino64/sys/pc98/conf/GENERIC Fri Sep 2 17:30:50 2011 (r225342) @@ -50,6 +50,7 @@ options COMPAT_FREEBSD4 # Compatible w options COMPAT_FREEBSD5 # Compatible with FreeBSD5 options COMPAT_FREEBSD6 # Compatible with FreeBSD6 options COMPAT_FREEBSD7 # Compatible with FreeBSD7 +options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options EPSON_BOUNCEDMA # use bounce buffer for 15-16M #options EPSON_MEMWIN # EPSON memory window support Modified: projects/ino64/sys/powerpc/conf/GENERIC ============================================================================== --- projects/ino64/sys/powerpc/conf/GENERIC Fri Sep 2 17:11:59 2011 (r225341) +++ projects/ino64/sys/powerpc/conf/GENERIC Fri Sep 2 17:30:50 2011 (r225342) @@ -55,6 +55,7 @@ options COMPAT_FREEBSD4 #Keep this for options COMPAT_FREEBSD5 #Compatible with FreeBSD5 options COMPAT_FREEBSD6 #Compatible with FreeBSD6 options COMPAT_FREEBSD7 #Compatible with FreeBSD7 +options COMPAT_FREEBSD9 #Compatible with FreeBSD9 options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI options KTRACE #ktrace(1) syscall trace support options STACK #stack(9) support Modified: projects/ino64/sys/powerpc/conf/GENERIC64 ============================================================================== --- projects/ino64/sys/powerpc/conf/GENERIC64 Fri Sep 2 17:11:59 2011 (r225341) +++ projects/ino64/sys/powerpc/conf/GENERIC64 Fri Sep 2 17:30:50 2011 (r225342) @@ -55,6 +55,7 @@ options COMPAT_FREEBSD32 #Compatible wi options COMPAT_FREEBSD5 #Compatible with FreeBSD5 options COMPAT_FREEBSD6 #Compatible with FreeBSD6 options COMPAT_FREEBSD7 #Compatible with FreeBSD7 +options COMPAT_FREEBSD9 #Compatible with FreeBSD9 options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI options KTRACE #ktrace(1) syscall trace support options STACK #stack(9) support Modified: projects/ino64/sys/sparc64/conf/GENERIC ============================================================================== --- projects/ino64/sys/sparc64/conf/GENERIC Fri Sep 2 17:11:59 2011 (r225341) +++ projects/ino64/sys/sparc64/conf/GENERIC Fri Sep 2 17:30:50 2011 (r225342) @@ -50,6 +50,7 @@ options GEOM_LABEL # Provides labeliza options COMPAT_FREEBSD5 # Compatible with FreeBSD5 options COMPAT_FREEBSD6 # Compatible with FreeBSD6 options COMPAT_FREEBSD7 # Compatible with FreeBSD7 +options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support From owner-svn-src-projects@FreeBSD.ORG Fri Sep 2 18:04:26 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1F821065675; Fri, 2 Sep 2011 18:04:26 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1F1F8FC14; Fri, 2 Sep 2011 18:04:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p82I4QUt010246; Fri, 2 Sep 2011 18:04:26 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p82I4QMY010244; Fri, 2 Sep 2011 18:04:26 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201109021804.p82I4QMY010244@svn.freebsd.org> From: Matthew D Fleming Date: Fri, 2 Sep 2011 18:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225345 - projects/ino64/sys/kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2011 18:04:26 -0000 Author: mdf Date: Fri Sep 2 18:04:26 2011 New Revision: 225345 URL: http://svn.freebsd.org/changeset/base/225345 Log: Fix typo. Pointed out by: flo@ Modified: projects/ino64/sys/kern/makesyscalls.sh Modified: projects/ino64/sys/kern/makesyscalls.sh ============================================================================== --- projects/ino64/sys/kern/makesyscalls.sh Fri Sep 2 17:40:39 2011 (r225344) +++ projects/ino64/sys/kern/makesyscalls.sh Fri Sep 2 18:04:26 2011 (r225345) @@ -611,7 +611,7 @@ s/\$//g if (ncompat9 != 0) { printf "\n#ifdef %s\n", compat9 > sysinc - printf "#define compat9(n, name) n, (sy_call_t *)__CONCAT(freebsd7_,name)\n" > sysinc + printf "#define compat9(n, name) n, (sy_call_t *)__CONCAT(freebsd9_,name)\n" > sysinc printf "#else\n" > sysinc printf "#define compat9(n, name) 0, (sy_call_t *)nosys\n" > sysinc printf "#endif\n" > sysinc From owner-svn-src-projects@FreeBSD.ORG Fri Sep 2 18:44:58 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5965F1065672; Fri, 2 Sep 2011 18:44:58 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 488E88FC15; Fri, 2 Sep 2011 18:44:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p82IiwaF011555; Fri, 2 Sep 2011 18:44:58 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p82Iiwbo011553; Fri, 2 Sep 2011 18:44:58 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201109021844.p82Iiwbo011553@svn.freebsd.org> From: Matthew D Fleming Date: Fri, 2 Sep 2011 18:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225349 - projects/ino64/sys/ufs/ufs X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2011 18:44:58 -0000 Author: mdf Date: Fri Sep 2 18:44:57 2011 New Revision: 225349 URL: http://svn.freebsd.org/changeset/base/225349 Log: ufs: Don't assume struct dirent == struct direct Remove offset alignment requirement, forthcoming changes in struct dirent will make alignment requirements extremely hard to follow. Work around clients supplying too small buffer. Don't allocate large buffer for dirent conversion, it can be used for DoS attack. Obtained from: ext2_readdir and DragonflyBSD commit e088dc32f085e0201c97af25afcf361190292de3 GSoC r223158. Code by: Gleb Kurtsou. Also eliminate the BYTE_ORDER checking as the struct dirent is filled in directly. Modified: projects/ino64/sys/ufs/ufs/ufs_vnops.c Modified: projects/ino64/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- projects/ino64/sys/ufs/ufs/ufs_vnops.c Fri Sep 2 18:37:48 2011 (r225348) +++ projects/ino64/sys/ufs/ufs/ufs_vnops.c Fri Sep 2 18:44:57 2011 (r225349) @@ -2124,12 +2124,6 @@ ufs_symlink(ap) /* * Vnode op for reading directories. - * - * The routine below assumes that the on-disk format of a directory - * is the same as that defined by . If the on-disk - * format changes, then it will be necessary to do a conversion - * from the on-disk format that read returns to the format defined - * by . */ int ufs_readdir(ap) @@ -2143,102 +2137,101 @@ ufs_readdir(ap) } */ *ap; { struct uio *uio = ap->a_uio; + off_t startoffset = uio->uio_offset; struct inode *ip; - int error; - size_t count, lost; - off_t off; + struct direct *dp, *edp; + struct dirent dstdp; + struct uio auio; + struct iovec aiov; + caddr_t dirbuf; + int error, ncookies; + size_t count, readcnt; - if (ap->a_ncookies != NULL) - /* - * Ensure that the block is aligned. The caller can use - * the cookies to determine where in the block to start. - */ - uio->uio_offset &= ~(DIRBLKSIZ - 1); ip = VTOI(ap->a_vp); if (ip->i_effnlink == 0) return (0); - off = uio->uio_offset; count = uio->uio_resid; - /* Make sure we don't return partial entries. */ - if (count <= ((uio->uio_offset + count) & (DIRBLKSIZ -1))) - return (EINVAL); - count -= (uio->uio_offset + count) & (DIRBLKSIZ -1); - lost = uio->uio_resid - count; - uio->uio_resid = count; - uio->uio_iov->iov_len = count; -# if (BYTE_ORDER == LITTLE_ENDIAN) - if (ap->a_vp->v_mount->mnt_maxsymlinklen > 0) { - error = VOP_READ(ap->a_vp, uio, 0, ap->a_cred); - } else { - struct dirent *dp, *edp; - struct uio auio; - struct iovec aiov; - caddr_t dirbuf; - int readcnt; - u_char tmp; - - auio = *uio; - auio.uio_iov = &aiov; - auio.uio_iovcnt = 1; - auio.uio_segflg = UIO_SYSSPACE; - aiov.iov_len = count; - dirbuf = malloc(count, M_TEMP, M_WAITOK); - aiov.iov_base = dirbuf; - error = VOP_READ(ap->a_vp, &auio, 0, ap->a_cred); - if (error == 0) { - readcnt = count - auio.uio_resid; - edp = (struct dirent *)&dirbuf[readcnt]; - for (dp = (struct dirent *)dirbuf; dp < edp; ) { - tmp = dp->d_namlen; - dp->d_namlen = dp->d_type; - dp->d_type = tmp; - if (dp->d_reclen > 0) { - dp = (struct dirent *) - ((char *)dp + dp->d_reclen); - } else { - error = EIO; - break; - } - } - if (dp >= edp) - error = uiomove(dirbuf, readcnt, uio); + /* + * Avoid complications for partial directory entries by adjusting + * the i/o to end at a block boundary. Don't give up (like the old ufs + * does) if the initial adjustment gives a negative count, since + * many callers don't supply a large enough buffer. The correct + * size is a little larger than DIRBLKSIZ to allow for expansion + * of directory entries, but some callers just use 512. + */ + count -= (uio->uio_offset + count) & (DIRBLKSIZ - 1); + if (count <= 0) + count += DIRBLKSIZ; + else if (count > MAXBSIZE) + count = MAXBSIZE; + + auio = *uio; + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_resid = count; + auio.uio_segflg = UIO_SYSSPACE; + aiov.iov_len = count; + dirbuf = malloc(count, M_TEMP, M_WAITOK); + aiov.iov_base = dirbuf; + error = VOP_READ(ap->a_vp, &auio, 0, ap->a_cred); + if (error == 0) { + readcnt = count - auio.uio_resid; + edp = (struct direct *)&dirbuf[readcnt]; + ncookies = 0; + bzero(&dstdp, offsetof(struct dirent, d_name)); + for (dp = (struct direct *)dirbuf; + !error && uio->uio_resid > 0 && dp < edp; ) { + dstdp.d_fileno = dp->d_ino; + dstdp.d_namlen = dp->d_namlen; + dstdp.d_type = dp->d_type; + dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); + bcopy(dp->d_name, dstdp.d_name, dstdp.d_namlen); + bzero(dstdp.d_name + dstdp.d_namlen, + dstdp.d_reclen - offsetof(struct dirent, d_name) - + dstdp.d_namlen); + + if (dp->d_reclen > 0) { + if (dstdp.d_reclen <= uio->uio_resid) { + /* advance dp */ + dp = (struct direct *) + ((char *)dp + dp->d_reclen); + error = uiomove((caddr_t)&dstdp, + dstdp.d_reclen, uio); + if (!error) + ncookies++; + } else + break; + } else { + error = EIO; + break; } - free(dirbuf, M_TEMP); } -# else - error = VOP_READ(ap->a_vp, uio, 0, ap->a_cred); -# endif - if (!error && ap->a_ncookies != NULL) { - struct dirent* dpStart; - struct dirent* dpEnd; - struct dirent* dp; - int ncookies; - u_long *cookies; - u_long *cookiep; + /* we need to correct uio_offset */ + uio->uio_offset = startoffset + (caddr_t)dp - dirbuf; + } + + if (error == 0 && ap->a_ncookies != NULL) { + u_long *cookiep, *cookies, *ecookies; + off_t off; if (uio->uio_segflg != UIO_SYSSPACE || uio->uio_iovcnt != 1) panic("ufs_readdir: unexpected uio from NFS server"); - dpStart = (struct dirent *) - ((char *)uio->uio_iov->iov_base - (uio->uio_offset - off)); - dpEnd = (struct dirent *) uio->uio_iov->iov_base; - for (dp = dpStart, ncookies = 0; - dp < dpEnd; - dp = (struct dirent *)((caddr_t) dp + dp->d_reclen)) - ncookies++; cookies = malloc(ncookies * sizeof(u_long), M_TEMP, M_WAITOK); - for (dp = dpStart, cookiep = cookies; - dp < dpEnd; - dp = (struct dirent *)((caddr_t) dp + dp->d_reclen)) { + off = startoffset; + for (dp = (struct direct *)dirbuf, + cookiep = cookies, ecookies = cookies + ncookies; + cookiep < ecookies; + dp = (struct direct *)((caddr_t) dp + dp->d_reclen)) { off += dp->d_reclen; *cookiep++ = (u_long) off; } *ap->a_ncookies = ncookies; *ap->a_cookies = cookies; } - uio->uio_resid += lost; + free(dirbuf, M_TEMP); if (ap->a_eofflag) - *ap->a_eofflag = VTOI(ap->a_vp)->i_size <= uio->uio_offset; + *ap->a_eofflag = VTOI(ap->a_vp)->i_size <= uio->uio_offset; return (error); } From owner-svn-src-projects@FreeBSD.ORG Fri Sep 2 18:52:17 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E66C106566C; Fri, 2 Sep 2011 18:52:17 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E3D58FC08; Fri, 2 Sep 2011 18:52:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p82IqHiB011853; Fri, 2 Sep 2011 18:52:17 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p82IqH1M011851; Fri, 2 Sep 2011 18:52:17 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201109021852.p82IqH1M011851@svn.freebsd.org> From: Matthew D Fleming Date: Fri, 2 Sep 2011 18:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225351 - projects/ino64/sys/ufs/ufs X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2011 18:52:17 -0000 Author: mdf Date: Fri Sep 2 18:52:17 2011 New Revision: 225351 URL: http://svn.freebsd.org/changeset/base/225351 Log: ufs: Stop mangling dirent in ufs_extattr_iterate_directory. It's meaningless after switching to new dirent format. GSoC r223159. Code by: Gleb Kurtsou. Modified: projects/ino64/sys/ufs/ufs/ufs_extattr.c Modified: projects/ino64/sys/ufs/ufs/ufs_extattr.c ============================================================================== --- projects/ino64/sys/ufs/ufs/ufs_extattr.c Fri Sep 2 18:50:44 2011 (r225350) +++ projects/ino64/sys/ufs/ufs/ufs_extattr.c Fri Sep 2 18:52:17 2011 (r225351) @@ -397,20 +397,8 @@ ufs_extattr_iterate_directory(struct ufs return (error); } - /* - * XXXRW: While in UFS, we always get DIRBLKSIZ returns from - * the directory code on success, on other file systems this - * may not be the case. For portability, we should check the - * read length on return from ufs_readdir(). - */ - edp = (struct dirent *)&dirbuf[DIRBLKSIZ]; + edp = (struct dirent *)&dirbuf[DIRBLKSIZ - auio.uio_resid]; for (dp = (struct dirent *)dirbuf; dp < edp; ) { -#if (BYTE_ORDER == LITTLE_ENDIAN) - dp->d_type = dp->d_namlen; - dp->d_namlen = 0; -#else - dp->d_type = 0; -#endif if (dp->d_reclen == 0) break; error = ufs_extattr_lookup(dvp, UE_GETDIR_LOCKPARENT, From owner-svn-src-projects@FreeBSD.ORG Fri Sep 2 18:54:22 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B24CC1065672; Fri, 2 Sep 2011 18:54:22 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5F1C08FC14; Fri, 2 Sep 2011 18:54:22 +0000 (UTC) Received: by qyk9 with SMTP id 9so2164485qyk.13 for ; Fri, 02 Sep 2011 11:54:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ILwKGXequqi244No8i/Kex2fXhiAluh/EysTPQ8F7Vg=; b=NpOOjz9ECf7NJ3CAg4ZVB8Orp97rjqIib9aPLP0AASMOajS0g/qAB/R5DQvVWcTiYi H8F0VvP5BYmjNIiHKZTJhpM9VWJ4hgA0mnWdrnSTTFYk8ohqnB+9nnhEYXiffu3Nldor BkWRot+CJYORPJQYzb9/mAl/5CKkqYPUggV+8= MIME-Version: 1.0 Received: by 10.229.66.41 with SMTP id l41mr1050667qci.170.1314989660157; Fri, 02 Sep 2011 11:54:20 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.229.98.8 with HTTP; Fri, 2 Sep 2011 11:54:20 -0700 (PDT) In-Reply-To: <201109021852.p82IqH1M011851@svn.freebsd.org> References: <201109021852.p82IqH1M011851@svn.freebsd.org> Date: Fri, 2 Sep 2011 11:54:20 -0700 X-Google-Sender-Auth: H1BDN-d9U6xwsBSRwt0dCv7RJdk Message-ID: From: mdf@FreeBSD.org To: src-committers@freebsd.org, svn-src-projects@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: svn commit: r225351 - projects/ino64/sys/ufs/ufs X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Sep 2011 18:54:22 -0000 Is anyone using UFS_EXTATTR_AUTOSTART? I think the code is now correct for the endpoint of the returned dirent's, but it would be nice to have a review and/or someone test the code. Thanks, matthew On Fri, Sep 2, 2011 at 11:52 AM, Matthew D Fleming wrote: > Author: mdf > Date: Fri Sep =A02 18:52:17 2011 > New Revision: 225351 > URL: http://svn.freebsd.org/changeset/base/225351 > > Log: > =A0ufs: Stop mangling dirent in ufs_extattr_iterate_directory. > =A0It's meaningless after switching to new dirent format. > > =A0GSoC r223159. > =A0Code by: Gleb Kurtsou. > > Modified: > =A0projects/ino64/sys/ufs/ufs/ufs_extattr.c > > Modified: projects/ino64/sys/ufs/ufs/ufs_extattr.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- projects/ino64/sys/ufs/ufs/ufs_extattr.c =A0 =A0Fri Sep =A02 18:50:44= 2011 =A0 =A0 =A0 =A0(r225350) > +++ projects/ino64/sys/ufs/ufs/ufs_extattr.c =A0 =A0Fri Sep =A02 18:52:17= 2011 =A0 =A0 =A0 =A0(r225351) > @@ -397,20 +397,8 @@ ufs_extattr_iterate_directory(struct ufs > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (error); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* XXXRW: While in UFS, we always get DIR= BLKSIZ returns from > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* the directory code on success, on othe= r file systems this > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* may not be the case. =A0For portabilit= y, we should check the > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* read length on return from ufs_readdir= (). > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 edp =3D (struct dirent *)&dirbuf[DIRBLKSIZ]= ; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 edp =3D (struct dirent *)&dirbuf[DIRBLKSIZ = - auio.uio_resid]; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0for (dp =3D (struct dirent *)dirbuf; dp < = edp; ) { > -#if (BYTE_ORDER =3D=3D LITTLE_ENDIAN) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dp->d_type =3D dp->d_namlen= ; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dp->d_namlen =3D 0; > -#else > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 dp->d_type =3D 0; > -#endif > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (dp->d_reclen =3D=3D 0) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0error =3D ufs_extattr_look= up(dvp, UE_GETDIR_LOCKPARENT, > From owner-svn-src-projects@FreeBSD.ORG Sat Sep 3 10:10:21 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3028106564A; Sat, 3 Sep 2011 10:10:20 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id CF5E78FC12; Sat, 3 Sep 2011 10:10:20 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 7436B46B23; Sat, 3 Sep 2011 06:10:19 -0400 (EDT) Date: Sat, 3 Sep 2011 11:10:19 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: mdf@FreeBSD.org In-Reply-To: Message-ID: References: <201109021852.p82IqH1M011851@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r225351 - projects/ino64/sys/ufs/ufs X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Sep 2011 10:10:21 -0000 On Fri, 2 Sep 2011, mdf@FreeBSD.org wrote: > Is anyone using UFS_EXTATTR_AUTOSTART? I think the code is now correct for > the endpoint of the returned dirent's, but it would be nice to have a review > and/or someone test the code. Good question. UFS_EXTATTR_AUTOSTART was the precursor to UFS2 extended attributes (which integrated EAs more tightly into the file sytem design), so is relevant only on UFS1. Anyone using ACLs, MAC, etc, on UFS1 will be using at least options UFS_EXTATTR. This code is pretty easy to test -- create a UFS1 file system, and use extattrctl to configure storage: mkdir -p /.attribute/system cd /.attribute/system extattrctl initattr -p / 388 posix1e.acl_access extattrctl initattr -p / 388 posix1e.acl_default Then unmount, set the "acls" flag with tunefs, and remount. If ACLs work, then the attributes were properly configured when the file system was mounted. I imagine it's not seeing a lot of use with widespread deployment of UFS2, but when we have broken it in the past, we have received bug reports. Robert