From owner-svn-src-all@FreeBSD.ORG Sun Jul 22 00:44:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88D48106566B; Sun, 22 Jul 2012 00:44:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 722308FC1E; Sun, 22 Jul 2012 00:44: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 q6M0iNhJ007132; Sun, 22 Jul 2012 00:44:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6M0iNx0007130; Sun, 22 Jul 2012 00:44:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207220044.q6M0iNx0007130@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 22 Jul 2012 00:44:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238679 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2012 00:44:23 -0000 Author: kib Date: Sun Jul 22 00:44:22 2012 New Revision: 238679 URL: http://svn.freebsd.org/changeset/base/238679 Log: MFC r238617: Fix several reads beyond the mapped first page of the binary in the ELF parser. Specifically, do not allow note reader and interpreter path comparision in the brandelf code to read past end of the page. This may happen if specially crafter ELF image is activated. Approved by: re (hrs) Modified: stable/9/sys/kern/imgact_elf.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/imgact_elf.c ============================================================================== --- stable/9/sys/kern/imgact_elf.c Sat Jul 21 21:52:48 2012 (r238678) +++ stable/9/sys/kern/imgact_elf.c Sun Jul 22 00:44:22 2012 (r238679) @@ -83,7 +83,7 @@ __FBSDID("$FreeBSD$"); static int __elfN(check_header)(const Elf_Ehdr *hdr); static Elf_Brandinfo *__elfN(get_brandinfo)(struct image_params *imgp, - const char *interp, int32_t *osrel); + const char *interp, int interp_name_len, int32_t *osrel); static int __elfN(load_file)(struct proc *p, const char *file, u_long *addr, u_long *entry, size_t pagesize); static int __elfN(load_section)(struct vmspace *vmspace, vm_object_t object, @@ -254,7 +254,7 @@ __elfN(brand_inuse)(Elf_Brandinfo *entry static Elf_Brandinfo * __elfN(get_brandinfo)(struct image_params *imgp, const char *interp, - int32_t *osrel) + int interp_name_len, int32_t *osrel) { const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header; Elf_Brandinfo *bi; @@ -300,7 +300,10 @@ __elfN(get_brandinfo)(struct image_param if (bi == NULL || bi->flags & BI_BRAND_NOTE_MANDATORY) continue; if (hdr->e_machine == bi->machine && - strcmp(interp, bi->interp_path) == 0) + /* ELF image p_filesz includes terminating zero */ + strlen(bi->interp_path) + 1 == interp_name_len && + strncmp(interp, bi->interp_path, interp_name_len) + == 0) return (bi); } } @@ -722,7 +725,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i u_long seg_size, seg_addr; u_long addr, baddr, et_dyn_addr, entry = 0, proghdr = 0; int32_t osrel = 0; - int error = 0, i, n; + int error = 0, i, n, interp_name_len = 0; const char *interp = NULL, *newinterp = NULL; Elf_Brandinfo *brand_info; char *path; @@ -763,9 +766,11 @@ __CONCAT(exec_, __elfN(imgact))(struct i case PT_INTERP: /* Path to interpreter */ if (phdr[i].p_filesz > MAXPATHLEN || - phdr[i].p_offset + phdr[i].p_filesz > PAGE_SIZE) + phdr[i].p_offset >= PAGE_SIZE || + phdr[i].p_offset + phdr[i].p_filesz >= PAGE_SIZE) return (ENOEXEC); interp = imgp->image_header + phdr[i].p_offset; + interp_name_len = phdr[i].p_filesz; break; case PT_GNU_STACK: if (__elfN(nxstack)) @@ -775,7 +780,8 @@ __CONCAT(exec_, __elfN(imgact))(struct i } } - brand_info = __elfN(get_brandinfo)(imgp, interp, &osrel); + brand_info = __elfN(get_brandinfo)(imgp, interp, interp_name_len, + &osrel); if (brand_info == NULL) { uprintf("ELF binary type \"%u\" not known.\n", hdr->e_ident[EI_OSABI]); @@ -1556,6 +1562,7 @@ __elfN(parse_notes)(struct image_params int i; if (pnote == NULL || pnote->p_offset >= PAGE_SIZE || + pnote->p_filesz > PAGE_SIZE || pnote->p_offset + pnote->p_filesz >= PAGE_SIZE) return (FALSE); @@ -1563,15 +1570,17 @@ __elfN(parse_notes)(struct image_params note_end = (const Elf_Note *)(imgp->image_header + pnote->p_offset + pnote->p_filesz); for (i = 0; i < 100 && note >= note0 && note < note_end; i++) { - if (!aligned(note, Elf32_Addr)) + if (!aligned(note, Elf32_Addr) || (const char *)note_end - + (const char *)note < sizeof(Elf_Note)) return (FALSE); if (note->n_namesz != checknote->hdr.n_namesz || note->n_descsz != checknote->hdr.n_descsz || note->n_type != checknote->hdr.n_type) goto nextnote; note_name = (const char *)(note + 1); - if (strncmp(checknote->vendor, note_name, - checknote->hdr.n_namesz) != 0) + if (note_name + checknote->hdr.n_namesz >= + (const char *)note_end || strncmp(checknote->vendor, + note_name, checknote->hdr.n_namesz) != 0) goto nextnote; /* From owner-svn-src-all@FreeBSD.ORG Sun Jul 22 10:21:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9BFE7106566C; Sun, 22 Jul 2012 10:21:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 858B18FC14; Sun, 22 Jul 2012 10:21:43 +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 q6MALhO1069117; Sun, 22 Jul 2012 10:21:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6MALhRr069114; Sun, 22 Jul 2012 10:21:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207221021.q6MALhRr069114@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 22 Jul 2012 10:21:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238682 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2012 10:21:43 -0000 Author: kib Date: Sun Jul 22 10:21:42 2012 New Revision: 238682 URL: http://svn.freebsd.org/changeset/base/238682 Log: MFC r238617: Fix several reads beyond the mapped first page of the binary in the ELF parser. Specifically, do not allow note reader and interpreter path comparision in the brandelf code to read past end of the page. This may happen if specially crafter ELF image is activated. Modified: stable/8/sys/kern/imgact_elf.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/imgact_elf.c ============================================================================== --- stable/8/sys/kern/imgact_elf.c Sun Jul 22 09:04:26 2012 (r238681) +++ stable/8/sys/kern/imgact_elf.c Sun Jul 22 10:21:42 2012 (r238682) @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); static int __elfN(check_header)(const Elf_Ehdr *hdr); static Elf_Brandinfo *__elfN(get_brandinfo)(struct image_params *imgp, - const char *interp, int32_t *osrel); + const char *interp, int interp_name_len, int32_t *osrel); static int __elfN(load_file)(struct proc *p, const char *file, u_long *addr, u_long *entry, size_t pagesize); static int __elfN(load_section)(struct vmspace *vmspace, vm_object_t object, @@ -221,7 +221,7 @@ __elfN(brand_inuse)(Elf_Brandinfo *entry static Elf_Brandinfo * __elfN(get_brandinfo)(struct image_params *imgp, const char *interp, - int32_t *osrel) + int interp_name_len, int32_t *osrel) { const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header; Elf_Brandinfo *bi; @@ -267,7 +267,10 @@ __elfN(get_brandinfo)(struct image_param if (bi == NULL || bi->flags & BI_BRAND_NOTE_MANDATORY) continue; if (hdr->e_machine == bi->machine && - strcmp(interp, bi->interp_path) == 0) + /* ELF image p_filesz includes terminating zero */ + strlen(bi->interp_path) + 1 == interp_name_len && + strncmp(interp, bi->interp_path, interp_name_len) + == 0) return (bi); } } @@ -680,7 +683,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i u_long seg_size, seg_addr; u_long addr, baddr, et_dyn_addr, entry = 0, proghdr = 0; int32_t osrel = 0; - int error = 0, i, n; + int error = 0, i, n, interp_name_len = 0; const char *interp = NULL, *newinterp = NULL; Elf_Brandinfo *brand_info; char *path; @@ -721,14 +724,17 @@ __CONCAT(exec_, __elfN(imgact))(struct i if (phdr[i].p_type == PT_INTERP) { /* Path to interpreter */ if (phdr[i].p_filesz > MAXPATHLEN || - phdr[i].p_offset + phdr[i].p_filesz > PAGE_SIZE) + phdr[i].p_offset >= PAGE_SIZE || + phdr[i].p_offset + phdr[i].p_filesz >= PAGE_SIZE) return (ENOEXEC); interp = imgp->image_header + phdr[i].p_offset; + interp_name_len = phdr[i].p_filesz; continue; } } - brand_info = __elfN(get_brandinfo)(imgp, interp, &osrel); + brand_info = __elfN(get_brandinfo)(imgp, interp, interp_name_len, + &osrel); if (brand_info == NULL) { uprintf("ELF binary type \"%u\" not known.\n", hdr->e_ident[EI_OSABI]); @@ -1404,6 +1410,7 @@ __elfN(parse_notes)(struct image_params int i; if (pnote == NULL || pnote->p_offset >= PAGE_SIZE || + pnote->p_filesz > PAGE_SIZE || pnote->p_offset + pnote->p_filesz >= PAGE_SIZE) return (FALSE); @@ -1411,15 +1418,17 @@ __elfN(parse_notes)(struct image_params note_end = (const Elf_Note *)(imgp->image_header + pnote->p_offset + pnote->p_filesz); for (i = 0; i < 100 && note >= note0 && note < note_end; i++) { - if (!aligned(note, Elf32_Addr)) + if (!aligned(note, Elf32_Addr) || (const char *)note_end - + (const char *)note < sizeof(Elf_Note)) return (FALSE); if (note->n_namesz != checknote->hdr.n_namesz || note->n_descsz != checknote->hdr.n_descsz || note->n_type != checknote->hdr.n_type) goto nextnote; note_name = (const char *)(note + 1); - if (strncmp(checknote->vendor, note_name, - checknote->hdr.n_namesz) != 0) + if (note_name + checknote->hdr.n_namesz >= + (const char *)note_end || strncmp(checknote->vendor, + note_name, checknote->hdr.n_namesz) != 0) goto nextnote; /* From owner-svn-src-all@FreeBSD.ORG Sun Jul 22 11:00:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 12B4A1065670; Sun, 22 Jul 2012 11:00:03 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA49F8FC1E; Sun, 22 Jul 2012 11:00:02 +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 q6MB02GY075437; Sun, 22 Jul 2012 11:00:02 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6MB02Ri075435; Sun, 22 Jul 2012 11:00:02 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201207221100.q6MB02Ri075435@svn.freebsd.org> From: Isabell Long Date: Sun, 22 Jul 2012 11:00:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238683 - in stable/9: sbin/ipfw sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2012 11:00:03 -0000 Author: issyl0 (doc committer) Date: Sun Jul 22 11:00:02 2012 New Revision: 238683 URL: http://svn.freebsd.org/changeset/base/238683 Log: MFC r238063: - Make ipfw's sched rules case insensitive, for user-friendliness. - Add a note to the ipfw(8) man page about the rules no longer being case sensitive. - Fix some typos in the man page. PR: docs/164772 Reviewed by: bz Approved by: gavin Approved by: re (kib) Modified: stable/9/sbin/ipfw/ipfw.8 stable/9/sys/netinet/ipfw/ip_dummynet.c Modified: stable/9/sbin/ipfw/ipfw.8 ============================================================================== --- stable/9/sbin/ipfw/ipfw.8 Sun Jul 22 10:21:42 2012 (r238682) +++ stable/9/sbin/ipfw/ipfw.8 Sun Jul 22 11:00:02 2012 (r238683) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 9, 2012 +.Dd July 3, 2012 .Dt IPFW 8 .Os .Sh NAME @@ -2225,19 +2225,20 @@ Specifies the weight to be used for flow The weight must be in the range 1..100, and defaults to 1. .El .Pp -The following parameters can be configured for a scheduler: +The following case-insensitive parameters can be configured for a +scheduler: .Pp .Bl -tag -width indent -compact -.It Cm type Ar {fifo | wf2qp | rr | qfq} +.It Cm type Ar {fifo | wf2q+ | rr | qfq} specifies the scheduling algorithm to use. .Bl -tag -width indent -compact -.It cm fifo +.It Cm fifo is just a FIFO scheduler (which means that all packets are stored in the same queue as they arrive to the scheduler). FIFO has O(1) per-packet time complexity, with very low constants (estimate 60-80ns on a 2GHz desktop machine) but gives no service guarantees. -.It Cm wf2qp +.It Cm wf2q+ implements the WF2Q+ algorithm, which is a Weighted Fair Queueing algorithm which permits flows to share bandwidth according to their weights. Note that weights are not priorities; even a flow Modified: stable/9/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_dummynet.c Sun Jul 22 10:21:42 2012 (r238682) +++ stable/9/sys/netinet/ipfw/ip_dummynet.c Sun Jul 22 11:00:02 2012 (r238683) @@ -97,7 +97,7 @@ find_sched_type(int type, char *name) struct dn_alg *d; SLIST_FOREACH(d, &dn_cfg.schedlist, next) { - if (d->type == type || (name && !strcmp(d->name, name))) + if (d->type == type || (name && !strcasecmp(d->name, name))) return d; } return NULL; /* not found */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 22 11:08:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87EB11065732; Sun, 22 Jul 2012 11:08:00 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1ADA8FC0C; Sun, 22 Jul 2012 11:07: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 q6MB7x0Y076307; Sun, 22 Jul 2012 11:07:59 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6MB7xR9076306; Sun, 22 Jul 2012 11:07:59 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201207221107.q6MB7xR9076306@svn.freebsd.org> From: Isabell Long Date: Sun, 22 Jul 2012 11:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238684 - in stable/9: sbin/ipfw sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2012 11:08:00 -0000 Author: issyl0 (doc committer) Date: Sun Jul 22 11:07:59 2012 New Revision: 238684 URL: http://svn.freebsd.org/changeset/base/238684 Log: Fix mergeinfo that should have been committed as part of r238683. Approved by: gavin Approved by: re (kib), implicit, approved in original merge request Modified: Directory Properties: stable/9/sbin/ipfw/ (props changed) stable/9/sys/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sun Jul 22 11:22:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 84D0C106566C; Sun, 22 Jul 2012 11:22:05 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 549038FC0C; Sun, 22 Jul 2012 11:22:05 +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 q6MBM5Gl077780; Sun, 22 Jul 2012 11:22:05 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6MBM5eI077777; Sun, 22 Jul 2012 11:22:05 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201207221122.q6MBM5eI077777@svn.freebsd.org> From: Isabell Long Date: Sun, 22 Jul 2012 11:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238685 - in stable/8: sbin/ipfw sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2012 11:22:05 -0000 Author: issyl0 (doc committer) Date: Sun Jul 22 11:22:04 2012 New Revision: 238685 URL: http://svn.freebsd.org/changeset/base/238685 Log: MFC r238063: - Make ipfw's sched rules case insensitive, for user-friendliness. - Add a note to the ipfw(8) man page about the rules no longer being case sensitive. - Fix some typos in the man page. PR: docs/164772 Reviewed by: bz Approved by: gavin Modified: stable/8/sbin/ipfw/ipfw.8 stable/8/sys/netinet/ipfw/ip_dummynet.c Directory Properties: stable/8/sbin/ipfw/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/sbin/ipfw/ipfw.8 ============================================================================== --- stable/8/sbin/ipfw/ipfw.8 Sun Jul 22 11:07:59 2012 (r238684) +++ stable/8/sbin/ipfw/ipfw.8 Sun Jul 22 11:22:04 2012 (r238685) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 9, 2012 +.Dd July 3, 2012 .Dt IPFW 8 .Os .Sh NAME @@ -2209,19 +2209,20 @@ Specifies the weight to be used for flow The weight must be in the range 1..100, and defaults to 1. .El .Pp -The following parameters can be configured for a scheduler: +The following case-insensitive parameters can be configured for a +scheduler: .Pp .Bl -tag -width indent -compact -.It Cm type Ar {fifo | wf2qp | rr | qfq} +.It Cm type Ar {fifo | wf2q+ | rr | qfq} specifies the scheduling algorithm to use. .Bl -tag -width indent -compact -.It cm fifo +.It Cm fifo is just a FIFO scheduler (which means that all packets are stored in the same queue as they arrive to the scheduler). FIFO has O(1) per-packet time complexity, with very low constants (estimate 60-80ns on a 2GHz desktop machine) but gives no service guarantees. -.It Cm wf2qp +.It Cm wf2q+ implements the WF2Q+ algorithm, which is a Weighted Fair Queueing algorithm which permits flows to share bandwidth according to their weights. Note that weights are not priorities; even a flow Modified: stable/8/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_dummynet.c Sun Jul 22 11:07:59 2012 (r238684) +++ stable/8/sys/netinet/ipfw/ip_dummynet.c Sun Jul 22 11:22:04 2012 (r238685) @@ -97,7 +97,7 @@ find_sched_type(int type, char *name) struct dn_alg *d; SLIST_FOREACH(d, &dn_cfg.schedlist, next) { - if (d->type == type || (name && !strcmp(d->name, name))) + if (d->type == type || (name && !strcasecmp(d->name, name))) return d; } return NULL; /* not found */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 22 12:09:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 98CBF106564A; Sun, 22 Jul 2012 12:09:43 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 822BA8FC14; Sun, 22 Jul 2012 12:09:43 +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 q6MC9hPf082115; Sun, 22 Jul 2012 12:09:43 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6MC9hvI082113; Sun, 22 Jul 2012 12:09:43 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201207221209.q6MC9hvI082113@svn.freebsd.org> From: Robert Watson Date: Sun, 22 Jul 2012 12:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238686 - stable/8/contrib/openbsm/libauditd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2012 12:09:43 -0000 Author: rwatson Date: Sun Jul 22 12:09:42 2012 New Revision: 238686 URL: http://svn.freebsd.org/changeset/base/238686 Log: Merge r234034 from head to stable/8: Merge a local fix to OpenBSM's libauditd to avoid a directory descriptor leak when iterating over possible audit trail directories. This fix will be merged upstream in an identical form, but hasn't yet appeared in an OpenBSM release. Submitted by: guido Obtained from: TrustedBSD Project Modified: stable/8/contrib/openbsm/libauditd/auditd_lib.c Modified: stable/8/contrib/openbsm/libauditd/auditd_lib.c ============================================================================== --- stable/8/contrib/openbsm/libauditd/auditd_lib.c Sun Jul 22 11:22:04 2012 (r238685) +++ stable/8/contrib/openbsm/libauditd/auditd_lib.c Sun Jul 22 12:09:42 2012 (r238686) @@ -520,6 +520,7 @@ auditd_expire_trails(int (*warn_expired) } } + closedir(dirp); } oldest_time = current_time - expire_age; From owner-svn-src-all@FreeBSD.ORG Sun Jul 22 13:41:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0FCB5106564A; Sun, 22 Jul 2012 13:41:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E51D08FC18; Sun, 22 Jul 2012 13:41: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 q6MDfkQD089509; Sun, 22 Jul 2012 13:41:46 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6MDfkbn089505; Sun, 22 Jul 2012 13:41:46 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207221341.q6MDfkbn089505@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 22 Jul 2012 13:41:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238687 - in head/sys: compat/ia32 kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2012 13:41:47 -0000 Author: kib Date: Sun Jul 22 13:41:45 2012 New Revision: 238687 URL: http://svn.freebsd.org/changeset/base/238687 Log: Cosmetics: define FREEBSD32_MINUSER and AOUT32_MINUSER for struct sysentvec .sv_minuser. Also improve style. Submitted by: Oliver Pinter MFC after: 1 week Modified: head/sys/compat/ia32/ia32_sysvec.c head/sys/compat/ia32/ia32_util.h head/sys/kern/imgact_aout.c Modified: head/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- head/sys/compat/ia32/ia32_sysvec.c Sun Jul 22 12:09:42 2012 (r238686) +++ head/sys/compat/ia32/ia32_sysvec.c Sun Jul 22 13:41:45 2012 (r238687) @@ -117,7 +117,7 @@ struct sysentvec ia32_freebsd_sysvec = { .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, .sv_pagesize = IA32_PAGE_SIZE, - .sv_minuser = 0, + .sv_minuser = FREEBSD32_MINUSER, .sv_maxuser = FREEBSD32_MAXUSER, .sv_usrstack = FREEBSD32_USRSTACK, .sv_psstrings = FREEBSD32_PS_STRINGS, Modified: head/sys/compat/ia32/ia32_util.h ============================================================================== --- head/sys/compat/ia32/ia32_util.h Sun Jul 22 12:09:42 2012 (r238686) +++ head/sys/compat/ia32/ia32_util.h Sun Jul 22 13:41:45 2012 (r238687) @@ -35,29 +35,30 @@ #include #include - #include #include #include #ifdef __ia64__ -#define FREEBSD32_MAXUSER ((1ul << 32) - IA32_PAGE_SIZE * 2) +#define FREEBSD32_MAXUSER ((1ul << 32) - IA32_PAGE_SIZE * 2) +#define FREEBSD32_MINUSER 0 #define FREEBSD32_SHAREDPAGE 0 -#define FREEBSD32_USRSTACK FREEBSD32_MAXUSER -#else +#define FREEBSD32_USRSTACK FREEBSD32_MAXUSER +#else /* __ia64__ */ #define FREEBSD32_MAXUSER ((1ul << 32) - IA32_PAGE_SIZE) +#define FREEBSD32_MINUSER 0 #define FREEBSD32_SHAREDPAGE (FREEBSD32_MAXUSER - IA32_PAGE_SIZE) -#define FREEBSD32_USRSTACK FREEBSD32_SHAREDPAGE -#endif +#define FREEBSD32_USRSTACK FREEBSD32_SHAREDPAGE +#endif /* __ia64 */ #define IA32_PAGE_SIZE 4096 #define IA32_MAXDSIZ (512*1024*1024) /* 512MB */ #define IA32_MAXSSIZ (64*1024*1024) /* 64MB */ -#define IA32_MAXVMEM 0 /* Unlimited */ +#define IA32_MAXVMEM 0 /* Unlimited */ struct syscall_args; int ia32_fetch_syscall_args(struct thread *td, struct syscall_args *sa); void ia32_set_syscall_retval(struct thread *, int); void ia32_fixlimit(struct rlimit *rl, int which); -#endif +#endif /* _COMPAT_IA32_IA32_UTIL_H */ Modified: head/sys/kern/imgact_aout.c ============================================================================== --- head/sys/kern/imgact_aout.c Sun Jul 22 12:09:42 2012 (r238686) +++ head/sys/kern/imgact_aout.c Sun Jul 22 13:41:45 2012 (r238687) @@ -106,6 +106,7 @@ struct sysentvec aout_sysvec = { #define AOUT32_USRSTACK 0xbfc00000 #define AOUT32_PS_STRINGS \ (AOUT32_USRSTACK - sizeof(struct freebsd32_ps_strings)) +#define AOUT32_MINUSER FREEBSD32_MINUSER extern const char *freebsd32_syscallnames[]; extern u_long ia32_maxssiz; @@ -129,7 +130,7 @@ struct sysentvec aout_sysvec = { .sv_imgact_try = NULL, .sv_minsigstksz = MINSIGSTKSZ, .sv_pagesize = IA32_PAGE_SIZE, - .sv_minuser = 0, + .sv_minuser = AOUT32_MINUSER, .sv_maxuser = AOUT32_USRSTACK, .sv_usrstack = AOUT32_USRSTACK, .sv_psstrings = AOUT32_PS_STRINGS, From owner-svn-src-all@FreeBSD.ORG Sun Jul 22 14:32:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39DF2106566B; Sun, 22 Jul 2012 14:32:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09EB58FC0C; Sun, 22 Jul 2012 14:32: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 q6MEWnFd094383; Sun, 22 Jul 2012 14:32:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6MEWnKV094381; Sun, 22 Jul 2012 14:32:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201207221432.q6MEWnKV094381@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Jul 2012 14:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238689 - stable/9/sys/dev/sym X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2012 14:32:50 -0000 Author: marius Date: Sun Jul 22 14:32:49 2012 New Revision: 238689 URL: http://svn.freebsd.org/changeset/base/238689 Log: MFC: r238621 Revert the use of BUS_DMA_ALLOCNOW when creating the DMA tag for user data introduced in r236061 (MFC'ed to stable/9 in r237186). Using that flag doesn't make that much sense on this case as the DMA maps using it are also created during sym_pci_attach(). Moreover, due to the maxsegsz parameter used, doing so may exhaust the bounce pages pool on architectures requiring bounce pages. [1] While at it, use a slightly more appropriate maxsegsz parameter. PR: 169526 Submitted by: Mike Watters [1] Approved by: re (kib) Modified: stable/9/sys/dev/sym/sym_hipd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/9/sys/dev/sym/sym_hipd.c Sun Jul 22 14:31:42 2012 (r238688) +++ stable/9/sys/dev/sym/sym_hipd.c Sun Jul 22 14:32:49 2012 (r238689) @@ -8537,8 +8537,8 @@ sym_pci_attach(device_t dev) */ if (bus_dma_tag_create(np->bus_dmat, 1, SYM_CONF_DMA_BOUNDARY, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - BUS_SPACE_MAXSIZE, SYM_CONF_MAX_SG, SYM_CONF_DMA_BOUNDARY, - BUS_DMA_ALLOCNOW, busdma_lock_mutex, &np->mtx, &np->data_dmat)) { + BUS_SPACE_MAXSIZE_32BIT, SYM_CONF_MAX_SG, SYM_CONF_DMA_BOUNDARY, + 0, busdma_lock_mutex, &np->mtx, &np->data_dmat)) { device_printf(dev, "failed to create DMA tag.\n"); goto attach_failed; } From owner-svn-src-all@FreeBSD.ORG Sun Jul 22 14:33:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F03A310656F4; Sun, 22 Jul 2012 14:33:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C20318FC1C; Sun, 22 Jul 2012 14:33:04 +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 q6MEX4sK094450; Sun, 22 Jul 2012 14:33:04 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6MEX4ov094448; Sun, 22 Jul 2012 14:33:04 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201207221433.q6MEX4ov094448@svn.freebsd.org> From: Marius Strobl Date: Sun, 22 Jul 2012 14:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238690 - stable/8/sys/dev/sym X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2012 14:33:05 -0000 Author: marius Date: Sun Jul 22 14:33:04 2012 New Revision: 238690 URL: http://svn.freebsd.org/changeset/base/238690 Log: MFC: r238621 Revert the use of BUS_DMA_ALLOCNOW when creating the DMA tag for user data introduced in r236061 (MFC'ed to stable/8 in r237187). Using that flag doesn't make that much sense on this case as the DMA maps using it are also created during sym_pci_attach(). Moreover, due to the maxsegsz parameter used, doing so may exhaust the bounce pages pool on architectures requiring bounce pages. [1] While at it, use a slightly more appropriate maxsegsz parameter. PR: 169526 Submitted by: Mike Watters [1] Modified: stable/8/sys/dev/sym/sym_hipd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/boot/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) Modified: stable/8/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/8/sys/dev/sym/sym_hipd.c Sun Jul 22 14:32:49 2012 (r238689) +++ stable/8/sys/dev/sym/sym_hipd.c Sun Jul 22 14:33:04 2012 (r238690) @@ -8537,8 +8537,8 @@ sym_pci_attach(device_t dev) */ if (bus_dma_tag_create(np->bus_dmat, 1, SYM_CONF_DMA_BOUNDARY, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - BUS_SPACE_MAXSIZE, SYM_CONF_MAX_SG, SYM_CONF_DMA_BOUNDARY, - BUS_DMA_ALLOCNOW, busdma_lock_mutex, &np->mtx, &np->data_dmat)) { + BUS_SPACE_MAXSIZE_32BIT, SYM_CONF_MAX_SG, SYM_CONF_DMA_BOUNDARY, + 0, busdma_lock_mutex, &np->mtx, &np->data_dmat)) { device_printf(dev, "failed to create DMA tag.\n"); goto attach_failed; } From owner-svn-src-all@FreeBSD.ORG Sun Jul 22 15:40:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3662D106566C; Sun, 22 Jul 2012 15:40:32 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 183F78FC12; Sun, 22 Jul 2012 15:40:32 +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 q6MFeVxE000293; Sun, 22 Jul 2012 15:40:31 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6MFeVcR000285; Sun, 22 Jul 2012 15:40:31 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201207221540.q6MFeVcR000285@svn.freebsd.org> From: Kevin Lo Date: Sun, 22 Jul 2012 15:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238697 - in head/sys: fs/cd9660 fs/ext2fs fs/msdosfs fs/portalfs fs/udf ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2012 15:40:32 -0000 Author: kevlo Date: Sun Jul 22 15:40:31 2012 New Revision: 238697 URL: http://svn.freebsd.org/changeset/base/238697 Log: Use NULL instead of 0 for pointers Modified: head/sys/fs/cd9660/cd9660_vfsops.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/msdosfs/msdosfs_lookup.c head/sys/fs/portalfs/portal_vnops.c head/sys/fs/udf/udf_vfsops.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vfsops.c Sun Jul 22 15:08:34 2012 (r238696) +++ head/sys/fs/cd9660/cd9660_vfsops.c Sun Jul 22 15:40:31 2012 (r238697) @@ -133,7 +133,7 @@ cd9660_mount(struct mount *mp) int error; accmode_t accmode; struct nameidata ndp; - struct iso_mnt *imp = 0; + struct iso_mnt *imp = NULL; td = curthread; @@ -214,7 +214,7 @@ iso_mountfs(devvp, mp) int iso_bsize; int iso_blknum; int joliet_level; - struct iso_volume_descriptor *vdp = 0; + struct iso_volume_descriptor *vdp = NULL; struct iso_primary_descriptor *pri = NULL; struct iso_sierra_primary_descriptor *pri_sierra = NULL; struct iso_supplementary_descriptor *sup = NULL; Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Sun Jul 22 15:08:34 2012 (r238696) +++ head/sys/fs/ext2fs/ext2_vfsops.c Sun Jul 22 15:40:31 2012 (r238697) @@ -112,7 +112,7 @@ ext2_mount(struct mount *mp) struct vfsoptlist *opts; struct vnode *devvp; struct thread *td; - struct ext2mount *ump = 0; + struct ext2mount *ump = NULL; struct m_ext2fs *fs; struct nameidata nd, *ndp = &nd; accmode_t accmode; Modified: head/sys/fs/msdosfs/msdosfs_lookup.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_lookup.c Sun Jul 22 15:08:34 2012 (r238696) +++ head/sys/fs/msdosfs/msdosfs_lookup.c Sun Jul 22 15:40:31 2012 (r238697) @@ -108,7 +108,7 @@ msdosfs_lookup_(struct vnode *vdp, struc struct denode *dp; struct denode *tdp; struct msdosfsmount *pmp; - struct buf *bp = 0; + struct buf *bp = NULL; struct direntry *dep = NULL; u_char dosfilename[12]; int flags = cnp->cn_flags; Modified: head/sys/fs/portalfs/portal_vnops.c ============================================================================== --- head/sys/fs/portalfs/portal_vnops.c Sun Jul 22 15:08:34 2012 (r238696) +++ head/sys/fs/portalfs/portal_vnops.c Sun Jul 22 15:40:31 2012 (r238697) @@ -110,7 +110,7 @@ portal_lookup(ap) char *pname = cnp->cn_nameptr; struct portalnode *pt; int error; - struct vnode *fvp = 0; + struct vnode *fvp = NULL; char *path; int size; @@ -217,14 +217,14 @@ portal_open(ap) struct thread *a_td; } */ *ap; { - struct socket *so = 0; + struct socket *so = NULL; struct portalnode *pt; struct thread *td = ap->a_td; struct vnode *vp = ap->a_vp; struct uio auio; struct iovec aiov[2]; int res; - struct mbuf *cm = 0; + struct mbuf *cm = NULL; struct cmsghdr *cmsg; int newfds; int *ip; @@ -356,7 +356,7 @@ portal_open(ap) len = auio.uio_resid = sizeof(int); do { - struct mbuf *m = 0; + struct mbuf *m = NULL; int flags = MSG_WAITALL; error = soreceive(so, (struct sockaddr **) 0, &auio, &m, &cm, &flags); Modified: head/sys/fs/udf/udf_vfsops.c ============================================================================== --- head/sys/fs/udf/udf_vfsops.c Sun Jul 22 15:08:34 2012 (r238696) +++ head/sys/fs/udf/udf_vfsops.c Sun Jul 22 15:40:31 2012 (r238697) @@ -190,7 +190,7 @@ udf_mount(struct mount *mp) { struct vnode *devvp; /* vnode of the mount device */ struct thread *td; - struct udf_mnt *imp = 0; + struct udf_mnt *imp = NULL; struct vfsoptlist *opts; char *fspec, *cs_disk, *cs_local; int error, len, *udf_flags; Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Sun Jul 22 15:08:34 2012 (r238696) +++ head/sys/ufs/ffs/ffs_snapshot.c Sun Jul 22 15:40:31 2012 (r238697) @@ -1742,7 +1742,7 @@ ffs_snapblkfree(fs, devvp, bno, size, in enum vtype vtype; struct workhead *wkhd; { - struct buf *ibp, *cbp, *savedcbp = 0; + struct buf *ibp, *cbp, *savedcbp = NULL; struct thread *td = curthread; struct inode *ip; struct vnode *vp = NULL; @@ -2236,11 +2236,11 @@ ffs_copyonwrite(devvp, bp) struct buf *bp; { struct snapdata *sn; - struct buf *ibp, *cbp, *savedcbp = 0; + struct buf *ibp, *cbp, *savedcbp = NULL; struct thread *td = curthread; struct fs *fs; struct inode *ip; - struct vnode *vp = 0; + struct vnode *vp = NULL; ufs2_daddr_t lbn, blkno, *snapblklist; int lower, upper, mid, indiroff, error = 0; int launched_async_io, prev_norunningbuf; Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sun Jul 22 15:08:34 2012 (r238696) +++ head/sys/ufs/ffs/ffs_vfsops.c Sun Jul 22 15:40:31 2012 (r238697) @@ -142,7 +142,7 @@ ffs_mount(struct mount *mp) { struct vnode *devvp; struct thread *td; - struct ufsmount *ump = 0; + struct ufsmount *ump = NULL; struct fs *fs; pid_t fsckpid = 0; int error, flags; From owner-svn-src-all@FreeBSD.ORG Sun Jul 22 16:56:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B9B38106564A; Sun, 22 Jul 2012 16:56:59 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A39F88FC19; Sun, 22 Jul 2012 16:56: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 q6MGuxOt006265; Sun, 22 Jul 2012 16:56:59 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6MGuxw0006263; Sun, 22 Jul 2012 16:56:59 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201207221656.q6MGuxw0006263@svn.freebsd.org> From: Robert Watson Date: Sun, 22 Jul 2012 16:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238698 - stable/8/sys/security/mac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2012 16:56:59 -0000 Author: rwatson Date: Sun Jul 22 16:56:59 2012 New Revision: 238698 URL: http://svn.freebsd.org/changeset/base/238698 Log: Merge r234032 from head to stable/8: When allocation of labels on files is implicitly disabled due to MAC policy configuration, avoid leaking resources following failed calls to get and set MAC labels by file descriptor. Reported by: Mateusz Guzik + clang scan-build Modified: stable/8/sys/security/mac/mac_syscalls.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/security/mac/mac_syscalls.c ============================================================================== --- stable/8/sys/security/mac/mac_syscalls.c Sun Jul 22 15:40:31 2012 (r238697) +++ stable/8/sys/security/mac/mac_syscalls.c Sun Jul 22 16:56:59 2012 (r238698) @@ -252,8 +252,10 @@ __mac_get_fd(struct thread *td, struct _ switch (fp->f_type) { case DTYPE_FIFO: case DTYPE_VNODE: - if (!(mac_labeled & MPC_OBJECT_VNODE)) - return (EINVAL); + if (!(mac_labeled & MPC_OBJECT_VNODE)) { + error = EINVAL; + goto out_fdrop; + } vp = fp->f_vnode; intlabel = mac_vnode_label_alloc(); vfslocked = VFS_LOCK_GIANT(vp->v_mount); @@ -267,8 +269,10 @@ __mac_get_fd(struct thread *td, struct _ break; case DTYPE_PIPE: - if (!(mac_labeled & MPC_OBJECT_PIPE)) - return (EINVAL); + if (!(mac_labeled & MPC_OBJECT_PIPE)) { + error = EINVAL; + goto out_fdrop; + } pipe = fp->f_data; intlabel = mac_pipe_label_alloc(); PIPE_LOCK(pipe); @@ -280,8 +284,10 @@ __mac_get_fd(struct thread *td, struct _ break; case DTYPE_SOCKET: - if (!(mac_labeled & MPC_OBJECT_SOCKET)) - return (EINVAL); + if (!(mac_labeled & MPC_OBJECT_SOCKET)) { + error = EINVAL; + goto out_fdrop; + } so = fp->f_data; intlabel = mac_socket_label_alloc(M_WAITOK); SOCK_LOCK(so); @@ -295,10 +301,10 @@ __mac_get_fd(struct thread *td, struct _ default: error = EINVAL; } - fdrop(fp, td); if (error == 0) error = copyout(buffer, mac.m_string, strlen(buffer)+1); - +out_fdrop: + fdrop(fp, td); out: free(buffer, M_MACTEMP); free(elements, M_MACTEMP); @@ -446,8 +452,10 @@ __mac_set_fd(struct thread *td, struct _ switch (fp->f_type) { case DTYPE_FIFO: case DTYPE_VNODE: - if (!(mac_labeled & MPC_OBJECT_VNODE)) - return (EINVAL); + if (!(mac_labeled & MPC_OBJECT_VNODE)) { + error = EINVAL; + goto out_fdrop; + } intlabel = mac_vnode_label_alloc(); error = mac_vnode_internalize_label(intlabel, buffer); if (error) { @@ -471,8 +479,10 @@ __mac_set_fd(struct thread *td, struct _ break; case DTYPE_PIPE: - if (!(mac_labeled & MPC_OBJECT_PIPE)) - return (EINVAL); + if (!(mac_labeled & MPC_OBJECT_PIPE)) { + error = EINVAL; + goto out_fdrop; + } intlabel = mac_pipe_label_alloc(); error = mac_pipe_internalize_label(intlabel, buffer); if (error == 0) { @@ -486,8 +496,10 @@ __mac_set_fd(struct thread *td, struct _ break; case DTYPE_SOCKET: - if (!(mac_labeled & MPC_OBJECT_SOCKET)) - return (EINVAL); + if (!(mac_labeled & MPC_OBJECT_SOCKET)) { + error = EINVAL; + goto out_fdrop; + } intlabel = mac_socket_label_alloc(M_WAITOK); error = mac_socket_internalize_label(intlabel, buffer); if (error == 0) { @@ -501,6 +513,7 @@ __mac_set_fd(struct thread *td, struct _ default: error = EINVAL; } +out_fdrop: fdrop(fp, td); out: free(buffer, M_MACTEMP); From owner-svn-src-all@FreeBSD.ORG Sun Jul 22 17:31:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9ED32106564A; Sun, 22 Jul 2012 17:31:37 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A21B8FC08; Sun, 22 Jul 2012 17:31: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 q6MHVbWx009026; Sun, 22 Jul 2012 17:31:37 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6MHVbxN009024; Sun, 22 Jul 2012 17:31:37 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201207221731.q6MHVbxN009024@svn.freebsd.org> From: Robert Watson Date: Sun, 22 Jul 2012 17:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238699 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2012 17:31:37 -0000 Author: rwatson Date: Sun Jul 22 17:31:36 2012 New Revision: 238699 URL: http://svn.freebsd.org/changeset/base/238699 Log: Update some stale comments regarding tcbinfo locking in the TCP input path: read locks on tcbinfo are no longer used, so won't happen. No functional change. MFC after: 3 days Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sun Jul 22 16:56:59 2012 (r238698) +++ head/sys/netinet/tcp_input.c Sun Jul 22 17:31:36 2012 (r238699) @@ -909,7 +909,7 @@ findpcb: /* * A previous connection in TIMEWAIT state is supposed to catch stray * or duplicate segments arriving late. If this segment was a - * legitimate new connection attempt the old INPCB gets removed and + * legitimate new connection attempt, the old INPCB gets removed and * we can try again to find a listening socket. * * At this point, due to earlier optimism, we may hold only an inpcb @@ -1438,15 +1438,8 @@ tcp_do_segment(struct mbuf *m, struct tc /* * If this is either a state-changing packet or current state isn't * established, we require a write lock on tcbinfo. Otherwise, we - * allow either a read lock or a write lock, as we may have acquired - * a write lock due to a race. - * - * Require a global write lock for SYN/FIN/RST segments or - * non-established connections; otherwise accept either a read or - * write lock, as we may have conservatively acquired a write lock in - * certain cases in tcp_input() (is this still true?). Currently we - * will never enter with no lock, so we try to drop it quickly in the - * common pure ack/pure data cases. + * allow the tcbinfo to be in either alocked or unlocked, as the + * caller may have unnecessarily acquired a write lock due to a race. */ if ((thflags & (TH_SYN | TH_FIN | TH_RST)) != 0 || tp->t_state != TCPS_ESTABLISHED) { From owner-svn-src-all@FreeBSD.ORG Sun Jul 22 17:46:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3DA2106566C; Sun, 22 Jul 2012 17:46:05 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E8F98FC16; Sun, 22 Jul 2012 17:46:05 +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 q6MHk5qm010149; Sun, 22 Jul 2012 17:46:05 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6MHk57s010147; Sun, 22 Jul 2012 17:46:05 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207221746.q6MHk57s010147@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 22 Jul 2012 17:46:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238700 - head/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2012 17:46:05 -0000 Author: bz Date: Sun Jul 22 17:46:05 2012 New Revision: 238700 URL: http://svn.freebsd.org/changeset/base/238700 Log: Fix a bug introduced in r221129 that leads to a panic wen using bundled SAs. For now allow same address family bundles. While discovered with ESP and AH, which does not make a lot of sense, IPcomp could be a possible problematic candidate. PR: kern/164400 MFC after: 3 days Modified: head/sys/netipsec/ipsec_output.c Modified: head/sys/netipsec/ipsec_output.c ============================================================================== --- head/sys/netipsec/ipsec_output.c Sun Jul 22 17:31:36 2012 (r238699) +++ head/sys/netipsec/ipsec_output.c Sun Jul 22 17:46:05 2012 (r238700) @@ -165,8 +165,7 @@ ipsec_process_done(struct mbuf *m, struc */ if (isr->next) { V_ipsec4stat.ips_out_bundlesa++; - sav = isr->next->sav; - saidx = &sav->sah->saidx; + /* XXX-BZ currently only support same AF bundles. */ switch (saidx->dst.sa.sa_family) { #ifdef INET case AF_INET: From owner-svn-src-all@FreeBSD.ORG Sun Jul 22 18:59:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 305B7106564A; Sun, 22 Jul 2012 18:59:32 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C3D18FC12; Sun, 22 Jul 2012 18:59:32 +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 q6MIxV5i015888; Sun, 22 Jul 2012 18:59:31 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6MIxVh3015886; Sun, 22 Jul 2012 18:59:31 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201207221859.q6MIxVh3015886@svn.freebsd.org> From: Hiroki Sato Date: Sun, 22 Jul 2012 18:59:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238701 - head/usr.bin/nfsstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2012 18:59:32 -0000 Author: hrs Date: Sun Jul 22 18:59:31 2012 New Revision: 238701 URL: http://svn.freebsd.org/changeset/base/238701 Log: Fix a bug which prevents "nfsstat -W" for server statistics from working. Modified: head/usr.bin/nfsstat/nfsstat.c Modified: head/usr.bin/nfsstat/nfsstat.c ============================================================================== --- head/usr.bin/nfsstat/nfsstat.c Sun Jul 22 17:46:05 2012 (r238700) +++ head/usr.bin/nfsstat/nfsstat.c Sun Jul 22 18:59:31 2012 (r238701) @@ -995,7 +995,6 @@ exp_sidewaysintpr(u_int interval, int cl ); } printf("\n"); - lastst = nfsstats; } if (serverOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", @@ -1019,8 +1018,8 @@ exp_sidewaysintpr(u_int interval, int cl (nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS] - lastst.srvrpccnt[NFSV4OP_READDIRPLUS])); printf("\n"); - lastst = nfsstats; } + lastst = nfsstats; fflush(stdout); sleep(interval); } From owner-svn-src-all@FreeBSD.ORG Sun Jul 22 19:32:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFFC4106564A; Sun, 22 Jul 2012 19:32:27 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AB608FC12; Sun, 22 Jul 2012 19:32:27 +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 q6MJWR8t018746; Sun, 22 Jul 2012 19:32:27 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6MJWRGL018743; Sun, 22 Jul 2012 19:32:27 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201207221932.q6MJWRGL018743@svn.freebsd.org> From: Poul-Henning Kamp Date: Sun, 22 Jul 2012 19:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238702 - head/tools/tools/sysbuild X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2012 19:32:27 -0000 Author: phk Date: Sun Jul 22 19:32:27 2012 New Revision: 238702 URL: http://svn.freebsd.org/changeset/base/238702 Log: Replace hardcoded /mnt with ${SBMNT} which defaults to /mnt.sysbuild Submitted by: Flemming "F3" Jacobsen Modified: head/tools/tools/sysbuild/sysbuild.sh Modified: head/tools/tools/sysbuild/sysbuild.sh ============================================================================== --- head/tools/tools/sysbuild/sysbuild.sh Sun Jul 22 18:59:31 2012 (r238701) +++ head/tools/tools/sysbuild/sysbuild.sh Sun Jul 22 19:32:27 2012 (r238702) @@ -97,6 +97,8 @@ PORTS_OPTS="BATCH=YES MAKE_IDEA=YES A4=y CONFIGFILES=' ' +SBMNT="/mnt.sysbuild" + cleanup() ( ) @@ -387,6 +389,8 @@ fi T0=`date +%s` echo $T0 $T0 > /tmp/_sb_log +[ ! -d ${SBMNT} ] && mkdir -p ${SBMNT} + if $do_prefetch ; then rm -rf /tmp/sysbuild/ports mkdir -p /tmp/sysbuild/ports @@ -400,11 +404,11 @@ log_it Unmount everything ( ( cleanup ) umount /freebsd/distfiles || true - umount /mnt/freebsd/distfiles || true + umount ${SBMNT}/freebsd/distfiles || true umount /dev/${FREEBSD_PART} || true - umount /mnt/freebsd || true - umount /mnt/dev || true - umount /mnt || true + umount ${SBMNT}/freebsd || true + umount ${SBMNT}/dev || true + umount ${SBMNT} || true umount /dev/${TARGET_PART} || true ) # > /dev/null 2>&1 @@ -461,9 +465,9 @@ export PORTS_OPTS log_it Prepare destination partition newfs -O2 -U /dev/${TARGET_PART} > /dev/null -mount /dev/${TARGET_PART} /mnt -mkdir -p /mnt/dev -mount -t devfs devfs /mnt/dev +mount /dev/${TARGET_PART} ${SBMNT} +mkdir -p ${SBMNT}/dev +mount -t devfs devfs ${SBMNT}/dev if [ "x${REMOTEDISTFILES}" != "x" ] ; then rm -rf /freebsd/${PORTS_PATH}/distfiles @@ -473,16 +477,16 @@ if [ "x${REMOTEDISTFILES}" != "x" ] ; th fi log_it copy ports config files -(cd / ; find var/db/ports -print | cpio -dumpv /mnt > /dev/null 2>&1) +(cd / ; find var/db/ports -print | cpio -dumpv ${SBMNT} > /dev/null 2>&1) log_it "Start prefetch of ports distfiles" -ports_prefetch /mnt & +ports_prefetch ${SBMNT} & if $do_world ; then ( cd /usr/src log_it "Buildworld" - make ${JARG} -s buildworld ${SRCCONF} > /mnt/_.bw 2>&1 + make ${JARG} -s buildworld ${SRCCONF} > ${SBMNT}/_.bw 2>&1 ) fi @@ -490,30 +494,30 @@ if $do_kernel ; then ( cd /usr/src log_it "Buildkernel" - make ${JARG} -s buildkernel KERNCONF=$KERNCONF > /mnt/_.bk 2>&1 + make ${JARG} -s buildkernel KERNCONF=$KERNCONF > ${SBMNT}/_.bk 2>&1 ) fi log_it Installworld -(cd /usr/src && make ${JARG} installworld DESTDIR=/mnt ${SRCCONF} ) \ - > /mnt/_.iw 2>&1 +(cd /usr/src && make ${JARG} installworld DESTDIR=${SBMNT} ${SRCCONF} ) \ + > ${SBMNT}/_.iw 2>&1 log_it distribution -(cd /usr/src/etc && make -m /usr/src/share/mk distribution DESTDIR=/mnt ${SRCCONF} ) \ - > /mnt/_.dist 2>&1 +(cd /usr/src/etc && make -m /usr/src/share/mk distribution DESTDIR=${SBMNT} ${SRCCONF} ) \ + > ${SBMNT}/_.dist 2>&1 log_it Installkernel -(cd /usr/src && make ${JARG} installkernel DESTDIR=/mnt KERNCONF=$KERNCONF ) \ - > /mnt/_.ik 2>&1 +(cd /usr/src && make ${JARG} installkernel DESTDIR=${SBMNT} KERNCONF=$KERNCONF ) \ + > ${SBMNT}/_.ik 2>&1 if [ "x${OBJ_PATH}" != "x" ] ; then - rmdir /mnt/usr/obj - ln -s /freebsd/${OBJ_PATH} /mnt/usr/obj + rmdir ${SBMNT}/usr/obj + ln -s /freebsd/${OBJ_PATH} ${SBMNT}/usr/obj fi log_it Wait for ports prefetch -log_it "(Tail /mnt/_.prefetch for progress)" +log_it "(Tail ${SBMNT}/_.prefetch for progress)" wait log_it Move filesystems @@ -522,34 +526,34 @@ if [ "x${REMOTEDISTFILES}" != "x" ] ; th umount /freebsd/distfiles fi umount /dev/${FREEBSD_PART} || true -mkdir -p /mnt/freebsd -mount /dev/${FREEBSD_PART} /mnt/freebsd +mkdir -p ${SBMNT}/freebsd +mount /dev/${FREEBSD_PART} ${SBMNT}/freebsd if [ "x${REMOTEDISTFILES}" != "x" ] ; then - mount ${REMOTEDISTFILES} /mnt/freebsd/distfiles + mount ${REMOTEDISTFILES} ${SBMNT}/freebsd/distfiles fi -rm -rf /mnt/usr/ports || true -ln -s /freebsd/${PORTS_PATH} /mnt/usr/ports +rm -rf ${SBMNT}/usr/ports || true +ln -s /freebsd/${PORTS_PATH} ${SBMNT}/usr/ports -rm -rf /mnt/usr/src || true -ln -s /freebsd/${SRC_PATH} /mnt/usr/src +rm -rf ${SBMNT}/usr/src || true +ln -s /freebsd/${SRC_PATH} ${SBMNT}/usr/src log_it Build and install ports # Make sure fetching will work in the chroot if [ -f /etc/resolv.conf ] ; then log_it copy resolv.conf - cp /etc/resolv.conf /mnt/etc - chflags schg /mnt/etc/resolv.conf + cp /etc/resolv.conf ${SBMNT}/etc + chflags schg ${SBMNT}/etc/resolv.conf fi if [ -f /etc/localtime ] ; then log_it copy localtime - cp /etc/localtime /mnt/etc + cp /etc/localtime ${SBMNT}/etc fi log_it ldconfig in chroot -chroot /mnt sh /etc/rc.d/ldconfig start +chroot ${SBMNT} sh /etc/rc.d/ldconfig start log_it before_ports ( @@ -558,56 +562,56 @@ log_it before_ports log_it build ports pwd -cp $0 /mnt/root -cp /tmp/_sb_log /mnt/tmp +cp $0 ${SBMNT}/root +cp /tmp/_sb_log ${SBMNT}/tmp b=`basename $0` if [ "x$c_arg" != "x" ] ; then - cp $c_arg /mnt/root - chroot /mnt sh /root/$0 -c /root/`basename $c_arg` $use_pkg chroot_script + cp $c_arg ${SBMNT}/root + chroot ${SBMNT} sh /root/$0 -c /root/`basename $c_arg` $use_pkg chroot_script else - chroot /mnt sh /root/$0 $use_pkg chroot_script + chroot ${SBMNT} sh /root/$0 $use_pkg chroot_script fi -cp /mnt/tmp/_sb_log /tmp +cp ${SBMNT}/tmp/_sb_log /tmp log_it fixing fstab sed "/[ ]\/[ ]/s;^[^ ]*[ ];/dev/${TARGET_PART} ;" \ - /etc/fstab > /mnt/etc/fstab + /etc/fstab > ${SBMNT}/etc/fstab log_it create all mountpoints -grep -v '^[ ]*#' /mnt/etc/fstab | +grep -v '^[ ]*#' ${SBMNT}/etc/fstab | while read a b c do - mkdir -p /mnt/$b + mkdir -p ${SBMNT}/$b done if [ "x$SERCONS" != "xfalse" ] ; then log_it serial console - echo " -h" > /mnt/boot.config - sed -i "" -e /ttyd0/s/off/on/ /mnt/etc/ttys - sed -i "" -e /ttyu0/s/off/on/ /mnt/etc/ttys - sed -i "" -e '/^ttyv[0-8]/s/ on/ off/' /mnt/etc/ttys + echo " -h" > ${SBMNT}/boot.config + sed -i "" -e /ttyd0/s/off/on/ ${SBMNT}/etc/ttys + sed -i "" -e /ttyu0/s/off/on/ ${SBMNT}/etc/ttys + sed -i "" -e '/^ttyv[0-8]/s/ on/ off/' ${SBMNT}/etc/ttys fi log_it move dist config files "(expect warnings)" ( - cd /mnt + cd ${SBMNT} mkdir root/configfiles_dist find ${CONFIGFILES} -print | cpio -dumpv root/configfiles_dist ) log_it copy live config files -(cd / && find ${CONFIGFILES} -print | cpio -dumpv /mnt) +(cd / && find ${CONFIGFILES} -print | cpio -dumpv ${SBMNT}) log_it final_root ( final_root ) log_it final_chroot -cp /tmp/_sb_log /mnt/tmp +cp /tmp/_sb_log ${SBMNT}/tmp if [ "x$c_arg" != "x" ] ; then - chroot /mnt sh /root/$0 -c /root/`basename $c_arg` final_chroot + chroot ${SBMNT} sh /root/$0 -c /root/`basename $c_arg` final_chroot else - chroot /mnt sh /root/$0 final_chroot + chroot ${SBMNT} sh /root/$0 final_chroot fi -cp /mnt/tmp/_sb_log /tmp +cp ${SBMNT}/tmp/_sb_log /tmp log_it "Check these messages (if any):" -grep '^Stop' /mnt/_* || true +grep '^Stop' ${SBMNT}/_* || true log_it DONE From owner-svn-src-all@FreeBSD.ORG Sun Jul 22 20:08:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 76A351065673; Sun, 22 Jul 2012 20:08:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61EEF8FC1A; Sun, 22 Jul 2012 20:08:39 +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 q6MK8dTD021581; Sun, 22 Jul 2012 20:08:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6MK8dc3021579; Sun, 22 Jul 2012 20:08:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207222008.q6MK8dc3021579@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 22 Jul 2012 20:08:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238703 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2012 20:08:39 -0000 Author: kib Date: Sun Jul 22 20:08:38 2012 New Revision: 238703 URL: http://svn.freebsd.org/changeset/base/238703 Log: Put struct ostat and struct nstat under #ifdef _KERNEL. The compatibility definitions are only needed for implementation of the syscalls, they cause namespace pollution and are not useful for applications. Noted by: bde MFC after: 1 week Modified: head/sys/sys/stat.h Modified: head/sys/sys/stat.h ============================================================================== --- head/sys/sys/stat.h Sun Jul 22 19:32:27 2012 (r238702) +++ head/sys/sys/stat.h Sun Jul 22 20:08:38 2012 (r238703) @@ -99,7 +99,7 @@ typedef __uid_t uid_t; #include #endif -#if __BSD_VISIBLE +#ifdef _KERNEL struct ostat { __uint16_t st_dev; /* inode's device */ ino_t st_ino; /* inode's number */ @@ -117,7 +117,7 @@ struct ostat { fflags_t st_flags; /* user defined flags for file */ __uint32_t st_gen; /* file generation number */ }; -#endif /* __BSD_VISIBLE */ +#endif struct stat { __dev_t st_dev; /* inode's device */ @@ -149,7 +149,7 @@ struct stat { unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec)); }; -#if __BSD_VISIBLE +#ifdef _KERNEL struct nstat { __dev_t st_dev; /* inode's device */ ino_t st_ino; /* inode's number */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 22 20:55:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B70CA106566B; Sun, 22 Jul 2012 20:55:42 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A16E68FC0C; Sun, 22 Jul 2012 20:55: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 q6MKtgJD025590; Sun, 22 Jul 2012 20:55:42 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6MKtg46025588; Sun, 22 Jul 2012 20:55:42 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201207222055.q6MKtg46025588@svn.freebsd.org> From: Poul-Henning Kamp Date: Sun, 22 Jul 2012 20:55:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238704 - head/tools/tools/sysbuild X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2012 20:55:42 -0000 Author: phk Date: Sun Jul 22 20:55:42 2012 New Revision: 238704 URL: http://svn.freebsd.org/changeset/base/238704 Log: Derive FREEBSD_PART from /etc/fstab, and make it full device name. Give suggestion for next steps when done. Inspired by patches from: Flemming "F3" Jacobsen Modified: head/tools/tools/sysbuild/sysbuild.sh Modified: head/tools/tools/sysbuild/sysbuild.sh ============================================================================== --- head/tools/tools/sysbuild/sysbuild.sh Sun Jul 22 20:08:38 2012 (r238703) +++ head/tools/tools/sysbuild/sysbuild.sh Sun Jul 22 20:55:42 2012 (r238704) @@ -31,7 +31,7 @@ set -e exec < /dev/null -if [ `uname -m` = "i386" ] ; then +if [ `uname -m` = "i386" -o `uname -m` = "amd64" ] ; then TARGET_PART=`df / | sed ' 1d s/[ ].*// @@ -41,25 +41,24 @@ if [ `uname -m` = "i386" ] ; then s,s3a,s2a, '` - # Where our build-bits are to be found - FREEBSD_PART=`echo $TARGET_PART | sed 's/s[12]a/s3/'` -elif [ `uname -m` = "amd64" ] ; then - TARGET_PART=`df / | sed ' - 1d - s/[ ].*// - s,/dev/,, - s,s1a,s3a, - s,s2a,s1a, - s,s3a,s2a, - '` - - # Where our build-bits are to be found - FREEBSD_PART=`echo $TARGET_PART | sed 's/s[12]a/s3/'` + FREEBSD_PART=`sed -n \ + -e 's/#.*//' \ + -e '/[ ]\/freebsd[ ]/!d' \ + -e 's/[ ].*//p' \ + /etc/fstab` + + # Calculate a suggested gpart command + TARGET_DISK=`expr ${TARGET_PART} : '\(.*\)s[12]a$' || true` + TARGET_SLICE=`expr ${TARGET_PART} : '.*s\([12]\)a$' || true` + GPART_SUGGESTION="gpart set -a active -i $TARGET_SLICE /dev/$TARGET_DISK" + unset TARGET_DISK TARGET_SLICE else TARGET_PART=unknown FREEBSD_PART=unknown + GPART_SUGGESTION=unknown fi + # Relative to /freebsd PORTS_PATH=ports SRC_PATH=src @@ -405,7 +404,7 @@ log_it Unmount everything ( cleanup ) umount /freebsd/distfiles || true umount ${SBMNT}/freebsd/distfiles || true - umount /dev/${FREEBSD_PART} || true + umount ${FREEBSD_PART} || true umount ${SBMNT}/freebsd || true umount ${SBMNT}/dev || true umount ${SBMNT} || true @@ -414,7 +413,7 @@ log_it Unmount everything log_it Prepare running image mkdir -p /freebsd -mount /dev/${FREEBSD_PART} /freebsd +mount ${FREEBSD_PART} /freebsd ####################################################################### @@ -525,9 +524,9 @@ log_it Move filesystems if [ "x${REMOTEDISTFILES}" != "x" ] ; then umount /freebsd/distfiles fi -umount /dev/${FREEBSD_PART} || true +umount ${FREEBSD_PART} || true mkdir -p ${SBMNT}/freebsd -mount /dev/${FREEBSD_PART} ${SBMNT}/freebsd +mount ${FREEBSD_PART} ${SBMNT}/freebsd if [ "x${REMOTEDISTFILES}" != "x" ] ; then mount ${REMOTEDISTFILES} ${SBMNT}/freebsd/distfiles fi @@ -560,6 +559,10 @@ log_it before_ports before_ports ) +log_it fixing fstab +sed "/[ ]\/[ ]/s;^[^ ]*[ ];/dev/${TARGET_PART} ;" \ + /etc/fstab > ${SBMNT}/etc/fstab + log_it build ports pwd cp $0 ${SBMNT}/root @@ -573,10 +576,6 @@ else fi cp ${SBMNT}/tmp/_sb_log /tmp -log_it fixing fstab -sed "/[ ]\/[ ]/s;^[^ ]*[ ];/dev/${TARGET_PART} ;" \ - /etc/fstab > ${SBMNT}/etc/fstab - log_it create all mountpoints grep -v '^[ ]*#' ${SBMNT}/etc/fstab | while read a b c @@ -615,3 +614,6 @@ cp ${SBMNT}/tmp/_sb_log /tmp log_it "Check these messages (if any):" grep '^Stop' ${SBMNT}/_* || true log_it DONE +echo "Now you probably want to:" +echo " $GPART_SUGGESTION" +echo " shutdown -r now" From owner-svn-src-all@FreeBSD.ORG Sun Jul 22 21:43:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5416106566C; Sun, 22 Jul 2012 21:43:46 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B53448FC08; Sun, 22 Jul 2012 21:43: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 q6MLhkHM029118; Sun, 22 Jul 2012 21:43:46 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6MLhkh4029116; Sun, 22 Jul 2012 21:43:46 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201207222143.q6MLhkh4029116@svn.freebsd.org> From: Warren Block Date: Sun, 22 Jul 2012 21:43:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238705 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2012 21:43:46 -0000 Author: wblock (doc committer) Date: Sun Jul 22 21:43:46 2012 New Revision: 238705 URL: http://svn.freebsd.org/changeset/base/238705 Log: Correct ugen.4 to show that it has been integrated into usb(4). Also fix some punctuation errors. Approved by: hps MFC after: 3 days Modified: head/share/man/man4/ugen.4 Modified: head/share/man/man4/ugen.4 ============================================================================== --- head/share/man/man4/ugen.4 Sun Jul 22 20:55:42 2012 (r238704) +++ head/share/man/man4/ugen.4 Sun Jul 22 21:43:46 2012 (r238705) @@ -29,26 +29,17 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2006 +.Dd July 22, 2012 .Dt UGEN 4 .Os .Sh NAME .Nm ugen .Nd USB generic device support .Sh SYNOPSIS -To compile this driver into the kernel, -place the following line in your -kernel configuration file: -.Bd -ragged -offset indent -.Cd "device ugen" -.Ed -.Pp -Alternatively, to load the driver as a -module at boot time, place the following line in -.Xr loader.conf 5 : -.Bd -literal -offset indent -ugen_load="YES" -.Ed +.Nm +is integrated into the +.Xr usb 4 +kernel module. .Sh DESCRIPTION The .Nm @@ -65,22 +56,22 @@ bulk, or interrupt. Each of the endpoints will have a different device node. The four least significant bits in the minor device -number determines which endpoint the device accesses and the rest -of the bits determines which USB device. +number determine which endpoint the device accesses, and the rest +of the bits determine which USB device. .Pp -If an endpoint address is used both for input and output the device +If an endpoint address is used both for input and output, the device can be opened for both read or write. .Pp -To find out what endpoints that exist there are a series of +To find out which endpoints exist, there are a series of .Xr ioctl 2 -operation on the control endpoint that returns the USB descriptors +operations on the control endpoint that return the USB descriptors of the device, configurations, interfaces, and endpoints. .Pp The control transfer mode can only happen on the control endpoint which is always endpoint 0. -The control endpoint accepts request -and may respond with an answer to such request. -Control request +The control endpoint accepts a request +and may respond with an answer to such a request. +Control requests are issued by .Xr ioctl 2 calls. @@ -129,8 +120,8 @@ Normally a transfer from the device which is shorter than the request specified is reported as an error. .It Dv USB_SET_TIMEOUT Pq Vt int -Set the timeout on the device operations, the time is specified -in milliseconds. +Set the timeout on the device operations +The time is specified in milliseconds. The value 0 is used to indicate that there is no timeout. .El @@ -176,7 +167,7 @@ field. Return the device descriptor. .It Dv USB_GET_CONFIG_DESC Pq Vt "struct usb_config_desc" Return the descriptor for the configuration with the given index. -For convenience the current configuration can be specified by +For convenience, the current configuration can be specified by .Dv USB_CURRENT_CONFIG_INDEX . .Bd -literal struct usb_config_desc { @@ -187,7 +178,7 @@ struct usb_config_desc { .It Dv USB_GET_INTERFACE_DESC Pq Vt "struct usb_interface_desc" Return the interface descriptor for an interface specified by its configuration index, interface index, and alternative index. -For convenience the current alternative can be specified by +For convenience, the current alternative can be specified by .Dv USB_CURRENT_ALT_INDEX . .Bd -literal struct usb_interface_desc { @@ -251,7 +242,7 @@ field is ignored in this call. The .Va ucr_flags field can be used to flag that the request is allowed to -be shorter than the requested size, and the +be shorter than the requested size, and .Va ucr_actlen will contain the actual size on completion. .Bd -literal @@ -270,18 +261,17 @@ Some of the most dangerous (e.g., changi address) are not allowed. .It Dv USB_GET_DEVICEINFO Pq Vt "struct usb_device_info" Get an information summary for the device. -This call will not -issue any USB transactions. +This call will not issue any USB transactions. .El .Pp -Note that there are two different ways of addressing configurations, interfaces, -alternatives, and endpoints: by index or by number. +Note that there are two different ways of addressing configurations, +interfaces, alternatives, and endpoints: by index or by number. The index is the ordinal number (starting from 0) of the descriptor as presented by the device. The number is the respective number of the entity as found in its descriptor. Enumeration of descriptors -use the index, getting and setting typically uses numbers. +uses the index, getting and setting typically uses numbers. .Pp Example: all endpoints (except the control endpoint) for the current configuration @@ -289,13 +279,13 @@ can be found by iterating the .Va interface_index from 0 to .Va config_desc->bNumInterface Ns \-1 -and for each of these iterating the +and for each of these, iterating the .Va endpoint_index from 0 to .Va interface_desc->bNumEndpoints . The .Va config_index -should set to +should be set to .Dv USB_CURRENT_CONFIG_INDEX and .Va alt_index From owner-svn-src-all@FreeBSD.ORG Sun Jul 22 22:52:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3F0A2106566B; Sun, 22 Jul 2012 22:52:34 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id CA1468FC0A; Sun, 22 Jul 2012 22:52:33 +0000 (UTC) Received: by obbun3 with SMTP id un3so11082572obb.13 for ; Sun, 22 Jul 2012 15:52:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=NyVJ6ic08GTsONkWzZa55Ue+NMTDLP11tj7740P9Yww=; b=tbmRvBkbr/SW4gvQMIsti2nOomKmJi/bGTSYBCo6Hhx0U1Ptzf+9PKZFwHKX0uf3Xu 9bcde6MgbiiC2s38lI8tMKxXkbn7pf5LkcsnmpnFadmZ0SZsHaR+h97BrJYAhuWQD4rY YryAwc+MyjqhL6Qba4I4P26gKva16y3zPyn/W+1t5hfa6qQkoxD+QUYVNbRU3VrIliXV sVSv/S29ay73sDD8aoKEZwbwxR+oIel5SYRlgatmhTcnEvKpwB4x9VZHiR/UWzsGonSx zWJtzXh51UpD4vpnT4jWGXCs2vgO/BMfsI3DAwvmx3beEWXqdYjB1FgDXMm0u37Bk8dg ispg== MIME-Version: 1.0 Received: by 10.182.44.68 with SMTP id c4mr6328788obm.27.1342997553256; Sun, 22 Jul 2012 15:52:33 -0700 (PDT) Received: by 10.76.84.7 with HTTP; Sun, 22 Jul 2012 15:52:32 -0700 (PDT) In-Reply-To: <201205232148.q4NLmoXp097382@svn.freebsd.org> References: <201205232148.q4NLmoXp097382@svn.freebsd.org> Date: Sun, 22 Jul 2012 15:52:32 -0700 Message-ID: From: Garrett Cooper To: Dimitry Andric Content-Type: multipart/mixed; boundary=f46d04479fa118989004c572fc97 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235864 - in head: contrib/llvm/lib/CodeGen/SelectionDAG contrib/llvm/tools/clang/include/clang/AST contrib/llvm/tools/clang/include/clang/Basic contrib/llvm/tools/clang/include/clang/P... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2012 22:52:34 -0000 --f46d04479fa118989004c572fc97 Content-Type: text/plain; charset=ISO-8859-1 On Wed, May 23, 2012 at 2:48 PM, Dimitry Andric wrote: > Author: dim > Date: Wed May 23 21:48:49 2012 > New Revision: 235864 > URL: http://svn.freebsd.org/changeset/base/235864 > > Log: > Upgrade our copy of llvm/clang to 3.1 release. Release notes can be > found at: http://llvm.org/releases/3.1/docs/ReleaseNotes.html > > MFC after: 3 days Hi Dimitry, This commit was missing necessary changes to OptionalObsoleteFiles.inc to remove the clang 3.1 headers. This patch should fix it. If I don't hear back in a few days, I'll file a PR and attach my patch. Thanks! -Garrett --- //depot/user/gcooper/atf-head/src/tools/build/mk/OptionalObsoleteFiles.inc 2012-07-22 22:26:48.000000000 0000 +++ /scratch/p4/user/gcooper/atf-head/src/tools/build/mk/OptionalObsoleteFiles.inc 2012-07-22 22:26:48.000000000 0000 @@ -700,6 +700,30 @@ OLD_FILES+=usr/include/clang/3.0/x86intrin.h OLD_FILES+=usr/include/clang/3.0/xmmintrin.h OLD_DIRS+=usr/include/clang/3.0 +OLD_FILES+=usr/include/clang/3.1/altivec.h +OLD_FILES+=usr/include/clang/3.1/avx2intrin.h +OLD_FILES+=usr/include/clang/3.1/avxintrin.h +OLD_FILES+=usr/include/clang/3.1/bmi2intrin.h +OLD_FILES+=usr/include/clang/3.1/bmiintrin.h +OLD_FILES+=usr/include/clang/3.1/cpuid.h +OLD_FILES+=usr/include/clang/3.1/emmintrin.h +OLD_FILES+=usr/include/clang/3.1/fma4intrin.h +OLD_FILES+=usr/include/clang/3.1/immintrin.h +OLD_FILES+=usr/include/clang/3.1/lzcntintrin.h +OLD_FILES+=usr/include/clang/3.1/mm3dnow.h +OLD_FILES+=usr/include/clang/3.1/mm_malloc.h +OLD_FILES+=usr/include/clang/3.1/mmintrin.h +OLD_FILES+=usr/include/clang/3.1/module.map +OLD_FILES+=usr/include/clang/3.1/nmmintrin.h +OLD_FILES+=usr/include/clang/3.1/pmmintrin.h +OLD_FILES+=usr/include/clang/3.1/popcntintrin.h +OLD_FILES+=usr/include/clang/3.1/smmintrin.h +OLD_FILES+=usr/include/clang/3.1/tmmintrin.h +OLD_FILES+=usr/include/clang/3.1/unwind.h +OLD_FILES+=usr/include/clang/3.1/wmmintrin.h +OLD_FILES+=usr/include/clang/3.1/x86intrin.h +OLD_FILES+=usr/include/clang/3.1/xmmintrin.h +OLD_DIRS+=usr/include/clang/3.1 OLD_DIRS+=usr/include/clang OLD_FILES+=usr/share/doc/llvm/clang/LICENSE.TXT OLD_DIRS+=usr/share/doc/llvm/clang --f46d04479fa118989004c572fc97 Content-Type: application/octet-stream; name="remove-installed-clang-3.1-headers.patch" Content-Disposition: attachment; filename="remove-installed-clang-3.1-headers.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h4ypwqr90 LS0tIC8vZGVwb3QvdXNlci9nY29vcGVyL2F0Zi1oZWFkL3NyYy90b29scy9idWlsZC9tay9PcHRp b25hbE9ic29sZXRlRmlsZXMuaW5jCTIwMTItMDctMjIgMjI6MjY6NDguMDAwMDAwMDAwIDAwMDAK KysrIC9zY3JhdGNoL3A0L3VzZXIvZ2Nvb3Blci9hdGYtaGVhZC9zcmMvdG9vbHMvYnVpbGQvbWsv T3B0aW9uYWxPYnNvbGV0ZUZpbGVzLmluYwkyMDEyLTA3LTIyIDIyOjI2OjQ4LjAwMDAwMDAwMCAw MDAwCkBAIC03MDAsNiArNzAwLDMwIEBACiBPTERfRklMRVMrPXVzci9pbmNsdWRlL2NsYW5nLzMu MC94ODZpbnRyaW4uaAogT0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9jbGFuZy8zLjAveG1taW50cmlu LmgKIE9MRF9ESVJTKz11c3IvaW5jbHVkZS9jbGFuZy8zLjAKK09MRF9GSUxFUys9dXNyL2luY2x1 ZGUvY2xhbmcvMy4xL2FsdGl2ZWMuaAorT0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9jbGFuZy8zLjEv YXZ4MmludHJpbi5oCitPTERfRklMRVMrPXVzci9pbmNsdWRlL2NsYW5nLzMuMS9hdnhpbnRyaW4u aAorT0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9jbGFuZy8zLjEvYm1pMmludHJpbi5oCitPTERfRklM RVMrPXVzci9pbmNsdWRlL2NsYW5nLzMuMS9ibWlpbnRyaW4uaAorT0xEX0ZJTEVTKz11c3IvaW5j bHVkZS9jbGFuZy8zLjEvY3B1aWQuaAorT0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9jbGFuZy8zLjEv ZW1taW50cmluLmgKK09MRF9GSUxFUys9dXNyL2luY2x1ZGUvY2xhbmcvMy4xL2ZtYTRpbnRyaW4u aAorT0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9jbGFuZy8zLjEvaW1taW50cmluLmgKK09MRF9GSUxF Uys9dXNyL2luY2x1ZGUvY2xhbmcvMy4xL2x6Y250aW50cmluLmgKK09MRF9GSUxFUys9dXNyL2lu Y2x1ZGUvY2xhbmcvMy4xL21tM2Rub3cuaAorT0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9jbGFuZy8z LjEvbW1fbWFsbG9jLmgKK09MRF9GSUxFUys9dXNyL2luY2x1ZGUvY2xhbmcvMy4xL21taW50cmlu LmgKK09MRF9GSUxFUys9dXNyL2luY2x1ZGUvY2xhbmcvMy4xL21vZHVsZS5tYXAKK09MRF9GSUxF Uys9dXNyL2luY2x1ZGUvY2xhbmcvMy4xL25tbWludHJpbi5oCitPTERfRklMRVMrPXVzci9pbmNs dWRlL2NsYW5nLzMuMS9wbW1pbnRyaW4uaAorT0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9jbGFuZy8z LjEvcG9wY250aW50cmluLmgKK09MRF9GSUxFUys9dXNyL2luY2x1ZGUvY2xhbmcvMy4xL3NtbWlu dHJpbi5oCitPTERfRklMRVMrPXVzci9pbmNsdWRlL2NsYW5nLzMuMS90bW1pbnRyaW4uaAorT0xE X0ZJTEVTKz11c3IvaW5jbHVkZS9jbGFuZy8zLjEvdW53aW5kLmgKK09MRF9GSUxFUys9dXNyL2lu Y2x1ZGUvY2xhbmcvMy4xL3dtbWludHJpbi5oCitPTERfRklMRVMrPXVzci9pbmNsdWRlL2NsYW5n LzMuMS94ODZpbnRyaW4uaAorT0xEX0ZJTEVTKz11c3IvaW5jbHVkZS9jbGFuZy8zLjEveG1taW50 cmluLmgKK09MRF9ESVJTKz11c3IvaW5jbHVkZS9jbGFuZy8zLjEKIE9MRF9ESVJTKz11c3IvaW5j bHVkZS9jbGFuZwogT0xEX0ZJTEVTKz11c3Ivc2hhcmUvZG9jL2xsdm0vY2xhbmcvTElDRU5TRS5U WFQKIE9MRF9ESVJTKz11c3Ivc2hhcmUvZG9jL2xsdm0vY2xhbmcK --f46d04479fa118989004c572fc97-- From owner-svn-src-all@FreeBSD.ORG Sun Jul 22 23:21:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8A7E2106566B; Sun, 22 Jul 2012 23:21:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 759D68FC17; Sun, 22 Jul 2012 23:21:22 +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 q6MNLMsj037131; Sun, 22 Jul 2012 23:21:22 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6MNLMPF037129; Sun, 22 Jul 2012 23:21:22 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201207222321.q6MNLMPF037129@svn.freebsd.org> From: Glen Barber Date: Sun, 22 Jul 2012 23:21:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238707 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jul 2012 23:21:22 -0000 Author: gjb (doc,ports committer) Date: Sun Jul 22 23:21:21 2012 New Revision: 238707 URL: http://svn.freebsd.org/changeset/base/238707 Log: Document the following in rc.conf.5: - rtsold_enable - rtsold_flags - rtsol_flags MFC after: 1 week Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sun Jul 22 22:37:20 2012 (r238706) +++ head/share/man/man5/rc.conf.5 Sun Jul 22 23:21:21 2012 (r238707) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2012 +.Dd July 22, 2012 .Dt RC.CONF 5 .Os .Sh NAME @@ -2934,6 +2934,34 @@ If set to .Dq Li YES this enables IPv4 mapped IPv6 address communication (like .Li ::ffff:a.b.c.d ) . +.It Va rtsold_enable +.Pq Vt bool +Set to +.Dq Li YES +to enable the +.Xr rtsold 8 +daemon to send ICMPv6 Router Solicitation messages. +.It Va rtsold_flags +.Pq Vt str +If +.Va rtsold_enable +is set to +.Dq Li YES , +these are the flags to pass to +.Xr rtsold 8 . +.It Va rtsol_flags +.Pq Vt str +For interfaces configured with the +.Dq Li inet6 accept_rtadv +keyword, these are the flags to pass to +.Xr rtsol 8 . +.Pp +Note that +.Va rtsold_enable +is mutually exclusive to +.Va rtsol_flags ; +.Va rtsold_enable +takes precedence. .It Va atm_enable .Pq Vt bool Set to From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 02:26:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17D2B1065672; Mon, 23 Jul 2012 02:26:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED1828FC08; Mon, 23 Jul 2012 02:26:33 +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 q6N2QXmD054325; Mon, 23 Jul 2012 02:26:33 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6N2QXap054321; Mon, 23 Jul 2012 02:26:33 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207230226.q6N2QXap054321@svn.freebsd.org> From: Adrian Chadd Date: Mon, 23 Jul 2012 02:26:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238708 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 02:26:34 -0000 Author: adrian Date: Mon Jul 23 02:26:33 2012 New Revision: 238708 URL: http://svn.freebsd.org/changeset/base/238708 Log: Begin modifying the descriptor allocation functions to support a variable sized TX descriptor. This is required for the AR93xx EDMA support which requires 128 byte TX descriptors (which is significantly larger than the earlier hardware.) Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Jul 22 23:21:21 2012 (r238707) +++ head/sys/dev/ath/if_ath.c Mon Jul 23 02:26:33 2012 (r238708) @@ -2762,15 +2762,15 @@ ath_descdma_setup(struct ath_softc *sc, uint8_t *ds; struct ath_buf *bf; int i, bsize, error; - int desc_len; - desc_len = sizeof(struct ath_desc); + dd->dd_descsize = sizeof(struct ath_desc); - DPRINTF(sc, ATH_DEBUG_RESET, "%s: %s DMA: %u buffers %u desc/buf\n", - __func__, name, nbuf, ndesc); + DPRINTF(sc, ATH_DEBUG_RESET, + "%s: %s DMA: %u buffers %u desc/buf, %d bytes per descriptor\n", + __func__, name, nbuf, ndesc, dd->dd_descsize); dd->dd_name = name; - dd->dd_desc_len = desc_len * nbuf * ndesc; + dd->dd_desc_len = dd->dd_descsize * nbuf * ndesc; /* * Merlin work-around: @@ -2778,7 +2778,7 @@ ath_descdma_setup(struct ath_softc *sc, * Assume one skipped descriptor per 4KB page. */ if (! ath_hal_split4ktrans(sc->sc_ah)) { - int numdescpage = 4096 / (desc_len * ndesc); + int numdescpage = 4096 / (dd->dd_descsize * ndesc); dd->dd_desc_len = (nbuf / numdescpage + 1) * 4096; } @@ -2845,7 +2845,7 @@ ath_descdma_setup(struct ath_softc *sc, dd->dd_bufptr = bf; TAILQ_INIT(head); - for (i = 0; i < nbuf; i++, bf++, ds += (ndesc * desc_len)) { + for (i = 0; i < nbuf; i++, bf++, ds += (ndesc * dd->dd_descsize)) { bf->bf_desc = (struct ath_desc *) ds; bf->bf_daddr = DS2PHYS(dd, ds); if (! ath_hal_split4ktrans(sc->sc_ah)) { @@ -2855,7 +2855,7 @@ ath_descdma_setup(struct ath_softc *sc, * in the descriptor. */ if (ATH_DESC_4KB_BOUND_CHECK(bf->bf_daddr, - desc_len * ndesc)) { + dd->dd_descsize * ndesc)) { /* Start at the next page */ ds += 0x1000 - (bf->bf_daddr & 0xFFF); bf->bf_desc = (struct ath_desc *) ds; @@ -2915,7 +2915,8 @@ ath_descdma_setup_rx_edma(struct ath_sof * However, dd_desc_len is used by ath_descdma_free() to determine * whether we have already freed this DMA mapping. */ - dd->dd_desc_len = rx_status_len; + dd->dd_desc_len = rx_status_len * nbuf; + dd->dd_descsize = rx_status_len; /* allocate rx buffers */ bsize = sizeof(struct ath_buf) * nbuf; Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sun Jul 22 23:21:21 2012 (r238707) +++ head/sys/dev/ath/if_ath_tx.c Mon Jul 23 02:26:33 2012 (r238708) @@ -302,6 +302,11 @@ ath_tx_chaindesclist(struct ath_softc *s struct ath_hal *ah = sc->sc_ah; struct ath_desc *ds, *ds0; int i; + /* + * XXX There's txdma and txdma_mgmt; the descriptor + * sizes must match. + */ + struct ath_descdma *dd = &sc->sc_txdma; /* * Fillin the remainder of the descriptor info. @@ -313,7 +318,7 @@ ath_tx_chaindesclist(struct ath_softc *s ath_hal_settxdesclink(ah, ds, 0); else ath_hal_settxdesclink(ah, ds, - bf->bf_daddr + sizeof(*ds) * (i + 1)); + bf->bf_daddr + dd->dd_descsize * (i + 1)); ath_hal_filltxdesc(ah, ds , bf->bf_segs[i].ds_len /* segment length */ , i == 0 /* first segment */ @@ -341,6 +346,11 @@ ath_tx_chaindesclist_subframe(struct ath struct ath_hal *ah = sc->sc_ah; struct ath_desc *ds, *ds0; int i; + /* + * XXX There's txdma and txdma_mgmt; the descriptor + * sizes must match. + */ + struct ath_descdma *dd = &sc->sc_txdma; ds0 = ds = bf->bf_desc; @@ -354,7 +364,7 @@ ath_tx_chaindesclist_subframe(struct ath ath_hal_settxdesclink(ah, ds, 0); else ath_hal_settxdesclink(ah, ds, - bf->bf_daddr + sizeof(*ds) * (i + 1)); + bf->bf_daddr + dd->dd_descsize * (i + 1)); /* * This performs the setup for an aggregate frame. Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sun Jul 22 23:21:21 2012 (r238707) +++ head/sys/dev/ath/if_athvar.h Mon Jul 23 02:26:33 2012 (r238708) @@ -277,6 +277,7 @@ typedef TAILQ_HEAD(ath_bufhead_s, ath_bu struct ath_descdma { const char* dd_name; struct ath_desc *dd_desc; /* descriptors */ + int dd_descsize; /* size of single descriptor */ bus_addr_t dd_desc_paddr; /* physical addr of dd_desc */ bus_size_t dd_desc_len; /* size of dd_desc */ bus_dma_segment_t dd_dseg; From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 02:49:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C5EDE1065676; Mon, 23 Jul 2012 02:49:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0B378FC12; Mon, 23 Jul 2012 02:49:25 +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 q6N2nPR6056224; Mon, 23 Jul 2012 02:49:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6N2nPwK056220; Mon, 23 Jul 2012 02:49:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207230249.q6N2nPwK056220@svn.freebsd.org> From: Adrian Chadd Date: Mon, 23 Jul 2012 02:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238709 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 02:49:26 -0000 Author: adrian Date: Mon Jul 23 02:49:25 2012 New Revision: 238709 URL: http://svn.freebsd.org/changeset/base/238709 Log: Flesh out a new DMA map for the EDMA TX completion status, as well as a lock to go with that whole code path. Modified: head/sys/dev/ath/if_ath_ahb.c head/sys/dev/ath/if_ath_pci.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath_ahb.c ============================================================================== --- head/sys/dev/ath/if_ath_ahb.c Mon Jul 23 02:26:33 2012 (r238708) +++ head/sys/dev/ath/if_ath_ahb.c Mon Jul 23 02:49:25 2012 (r238709) @@ -194,11 +194,13 @@ ath_ahb_attach(device_t dev) ATH_LOCK_INIT(sc); ATH_PCU_LOCK_INIT(sc); ATH_RX_LOCK_INIT(sc); + ATH_TXSTATUS_LOCK_INIT(sc); error = ath_attach(AR9130_DEVID, sc); if (error == 0) /* success */ return 0; + ATH_TXSTATUS_LOCK_DESTROY(sc); ATH_RX_LOCK_DESTROY(sc); ATH_PCU_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); @@ -240,6 +242,7 @@ ath_ahb_detach(device_t dev) if (sc->sc_eepromdata) free(sc->sc_eepromdata, M_TEMP); + ATH_TXSTATUS_LOCK_DESTROY(sc); ATH_RX_LOCK_DESTROY(sc); ATH_PCU_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); Modified: head/sys/dev/ath/if_ath_pci.c ============================================================================== --- head/sys/dev/ath/if_ath_pci.c Mon Jul 23 02:26:33 2012 (r238708) +++ head/sys/dev/ath/if_ath_pci.c Mon Jul 23 02:49:25 2012 (r238709) @@ -250,11 +250,13 @@ ath_pci_attach(device_t dev) ATH_LOCK_INIT(sc); ATH_PCU_LOCK_INIT(sc); ATH_RX_LOCK_INIT(sc); + ATH_TXSTATUS_LOCK_INIT(sc); error = ath_attach(pci_get_device(dev), sc); if (error == 0) /* success */ return 0; + ATH_TXSTATUS_LOCK_DESTROY(sc); ATH_PCU_LOCK_DESTROY(sc); ATH_RX_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); @@ -295,6 +297,7 @@ ath_pci_detach(device_t dev) if (sc->sc_eepromdata) free(sc->sc_eepromdata, M_TEMP); + ATH_TXSTATUS_LOCK_DESTROY(sc); ATH_PCU_LOCK_DESTROY(sc); ATH_RX_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Jul 23 02:26:33 2012 (r238708) +++ head/sys/dev/ath/if_athvar.h Mon Jul 23 02:49:25 2012 (r238709) @@ -558,6 +558,11 @@ struct ath_softc { struct ath_txq *sc_ac2q[5]; /* WME AC -> h/w q map */ struct task sc_txtask; /* tx int processing */ struct task sc_txqtask; /* tx proc processing */ + + struct ath_descdma sc_txcompdma; /* TX EDMA completion */ + struct mtx sc_txcomplock; /* TX EDMA completion lock */ + char sc_txcompname[12]; /* eg ath0_txcomp */ + int sc_wd_timer; /* count down for wd timer */ struct callout sc_wd_ch; /* tx watchdog timer */ struct ath_tx_radiotap_header sc_tx_th; @@ -735,6 +740,19 @@ struct ath_softc { #define ATH_TXBUF_LOCK_ASSERT(_sc) \ mtx_assert(&(_sc)->sc_txbuflock, MA_OWNED) +#define ATH_TXSTATUS_LOCK_INIT(_sc) do { \ + snprintf((_sc)->sc_txcompname, sizeof((_sc)->sc_txcompname), \ + "%s_buf", \ + device_get_nameunit((_sc)->sc_dev)); \ + mtx_init(&(_sc)->sc_txcomplock, (_sc)->sc_txcompname, NULL, \ + MTX_DEF); \ +} while (0) +#define ATH_TXSTATUS_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_txcomplock) +#define ATH_TXSTATUS_LOCK(_sc) mtx_lock(&(_sc)->sc_txcomplock) +#define ATH_TXSTATUS_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_txcomplock) +#define ATH_TXSTATUS_LOCK_ASSERT(_sc) \ + mtx_assert(&(_sc)->sc_txcomplock, MA_OWNED) + int ath_attach(u_int16_t, struct ath_softc *); int ath_detach(struct ath_softc *); void ath_resume(struct ath_softc *); From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 03:52:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 255C31065672; Mon, 23 Jul 2012 03:52:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E6958FC14; Mon, 23 Jul 2012 03:52:19 +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 q6N3qJ8V061329; Mon, 23 Jul 2012 03:52:19 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6N3qIwq061318; Mon, 23 Jul 2012 03:52:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207230352.q6N3qIwq061318@svn.freebsd.org> From: Adrian Chadd Date: Mon, 23 Jul 2012 03:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238710 - in head/sys: conf dev/ath modules/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 03:52:19 -0000 Author: adrian Date: Mon Jul 23 03:52:18 2012 New Revision: 238710 URL: http://svn.freebsd.org/changeset/base/238710 Log: Begin separating out the TX DMA setup in preparation for TX EDMA support. * Introduce TX DMA setup/teardown methods, mirroring what's done in the RX path. Although the TX DMA descriptor is setup via ath_desc_alloc() / ath_desc_free(), there TX status descriptor ring will be allocated in this path. * Remove some of the TX EDMA capability probing from the RX path and push it into the new TX EDMA path. Added: head/sys/dev/ath/if_ath_tx_edma.c (contents, props changed) head/sys/dev/ath/if_ath_tx_edma.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_rx_edma.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_ath_tx.h head/sys/dev/ath/if_ath_tx_ht.c head/sys/dev/ath/if_athvar.h head/sys/modules/ath/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jul 23 02:49:25 2012 (r238709) +++ head/sys/conf/files Mon Jul 23 03:52:18 2012 (r238710) @@ -729,6 +729,8 @@ dev/ath/if_ath_led.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_tx.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" +dev/ath/if_ath_tx_edma.c optional ath \ + compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_tx_ht.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_tdma.c optional ath \ Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Jul 23 02:49:25 2012 (r238709) +++ head/sys/dev/ath/if_ath.c Mon Jul 23 03:52:18 2012 (r238710) @@ -109,6 +109,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -306,8 +307,11 @@ ath_attach(u_int16_t devid, struct ath_s if (ath_hal_hasedma(sc->sc_ah)) { sc->sc_isedma = 1; ath_recv_setup_edma(sc); - } else + ath_xmit_setup_edma(sc); + } else { ath_recv_setup_legacy(sc); + ath_xmit_setup_legacy(sc); + } /* * Check if the MAC has multi-rate retry support. @@ -367,14 +371,24 @@ ath_attach(u_int16_t devid, struct ath_s ath_setcurmode(sc, IEEE80211_MODE_11A); /* - * Allocate tx+rx descriptors and populate the lists. + * Allocate TX descriptors and populate the lists. */ error = ath_desc_alloc(sc); if (error != 0) { - if_printf(ifp, "failed to allocate descriptors: %d\n", error); + if_printf(ifp, "failed to allocate TX descriptors: %d\n", + error); + goto bad; + } + error = ath_txdma_setup(sc); + if (error != 0) { + if_printf(ifp, "failed to allocate TX descriptors: %d\n", + error); goto bad; } + /* + * Allocate RX descriptors and populate the lists. + */ error = ath_rxdma_setup(sc); if (error != 0) { if_printf(ifp, "failed to allocate RX descriptors: %d\n", @@ -858,6 +872,7 @@ ath_attach(u_int16_t devid, struct ath_s bad2: ath_tx_cleanup(sc); ath_desc_free(sc); + ath_txdma_teardown(sc); ath_rxdma_teardown(sc); bad: if (ah) Modified: head/sys/dev/ath/if_ath_rx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_rx_edma.c Mon Jul 23 02:49:25 2012 (r238709) +++ head/sys/dev/ath/if_ath_rx_edma.c Mon Jul 23 03:52:18 2012 (r238710) @@ -828,9 +828,6 @@ ath_recv_setup_edma(struct ath_softc *sc /* Fetch EDMA field and buffer sizes */ (void) ath_hal_getrxstatuslen(sc->sc_ah, &sc->sc_rx_statuslen); - (void) ath_hal_gettxdesclen(sc->sc_ah, &sc->sc_tx_desclen); - (void) ath_hal_gettxstatuslen(sc->sc_ah, &sc->sc_tx_statuslen); - (void) ath_hal_getntxmaps(sc->sc_ah, &sc->sc_tx_nmaps); /* Configure the hardware with the RX buffer size */ (void) ath_hal_setrxbufsize(sc->sc_ah, sc->sc_edma_bufsize - @@ -838,14 +835,8 @@ ath_recv_setup_edma(struct ath_softc *sc device_printf(sc->sc_dev, "RX status length: %d\n", sc->sc_rx_statuslen); - device_printf(sc->sc_dev, "TX descriptor length: %d\n", - sc->sc_tx_desclen); - device_printf(sc->sc_dev, "TX status length: %d\n", - sc->sc_tx_statuslen); - device_printf(sc->sc_dev, "TX/RX buffer size: %d\n", + device_printf(sc->sc_dev, "RX buffer size: %d\n", sc->sc_edma_bufsize); - device_printf(sc->sc_dev, "TX buffers per descriptor: %d\n", - sc->sc_tx_nmaps); sc->sc_rx.recv_stop = ath_edma_stoprecv; sc->sc_rx.recv_start = ath_edma_startrecv; Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon Jul 23 02:49:25 2012 (r238709) +++ head/sys/dev/ath/if_ath_tx.c Mon Jul 23 03:52:18 2012 (r238710) @@ -4463,3 +4463,27 @@ ath_addba_response_timeout(struct ieee80 ath_tx_tid_resume(sc, atid); ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); } + +static int +ath_legacy_dma_txsetup(struct ath_softc *sc) +{ + + /* nothing new needed */ + return (0); +} + +static int +ath_legacy_dma_txteardown(struct ath_softc *sc) +{ + + /* nothing new needed */ + return (0); +} + +void +ath_xmit_setup_legacy(struct ath_softc *sc) +{ + + sc->sc_tx.xmit_setup = ath_legacy_dma_txsetup; + sc->sc_tx.xmit_teardown = ath_legacy_dma_txteardown; +} Modified: head/sys/dev/ath/if_ath_tx.h ============================================================================== --- head/sys/dev/ath/if_ath_tx.h Mon Jul 23 02:49:25 2012 (r238709) +++ head/sys/dev/ath/if_ath_tx.h Mon Jul 23 03:52:18 2012 (r238710) @@ -124,4 +124,13 @@ extern void ath_bar_response(struct ieee extern void ath_addba_response_timeout(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap); +/* + * Setup path + */ +#define ath_txdma_setup(_sc) \ + (_sc)->sc_tx.xmit_setup(_sc) +#define ath_txdma_teardown(_sc) \ + (_sc)->sc_tx.xmit_teardown(_sc) +extern void ath_xmit_setup_legacy(struct ath_softc *sc); + #endif Added: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_tx_edma.c Mon Jul 23 03:52:18 2012 (r238710) @@ -0,0 +1,162 @@ +/*- + * Copyright (c) 2012 Adrian Chadd + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Driver for the Atheros Wireless LAN controller. + * + * This software is derived from work of Atsushi Onoe; his contribution + * is greatly appreciated. + */ + +#include "opt_inet.h" +#include "opt_ath.h" +/* + * This is needed for register operations which are performed + * by the driver - eg, calls to ath_hal_gettsf32(). + * + * It's also required for any AH_DEBUG checks in here, eg the + * module dependencies. + */ +#include "opt_ah.h" +#include "opt_wlan.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* for mp_ncpus */ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#ifdef IEEE80211_SUPPORT_SUPERG +#include +#endif +#ifdef IEEE80211_SUPPORT_TDMA +#include +#endif + +#include + +#ifdef INET +#include +#include +#endif + +#include +#include /* XXX for softled */ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef ATH_TX99_DIAG +#include +#endif + +#include + +/* + * some general macros + */ +#define INCR(_l, _sz) (_l) ++; (_l) &= ((_sz) - 1) +#define DECR(_l, _sz) (_l) --; (_l) &= ((_sz) - 1) + +MALLOC_DECLARE(M_ATHDEV); + +static int +ath_edma_dma_txsetup(struct ath_softc *sc) +{ + + /* XXX placeholder */ + return (0); +} + +static int +ath_edma_dma_txteardown(struct ath_softc *sc) +{ + + /* XXX placeholder */ + return (0); +} + +void +ath_xmit_setup_edma(struct ath_softc *sc) +{ + + /* Fetch EDMA field and buffer sizes */ + (void) ath_hal_gettxdesclen(sc->sc_ah, &sc->sc_tx_desclen); + (void) ath_hal_gettxstatuslen(sc->sc_ah, &sc->sc_tx_statuslen); + (void) ath_hal_getntxmaps(sc->sc_ah, &sc->sc_tx_nmaps); + + device_printf(sc->sc_dev, "TX descriptor length: %d\n", + sc->sc_tx_desclen); + device_printf(sc->sc_dev, "TX status length: %d\n", + sc->sc_tx_statuslen); + device_printf(sc->sc_dev, "TX buffers per descriptor: %d\n", + sc->sc_tx_nmaps); + + sc->sc_tx.xmit_setup = ath_edma_dma_txsetup; + sc->sc_tx.xmit_teardown = ath_edma_dma_txteardown; +} Added: head/sys/dev/ath/if_ath_tx_edma.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_tx_edma.h Mon Jul 23 03:52:18 2012 (r238710) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2012 Adrian Chadd + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * $FreeBSD$ + */ +#ifndef __IF_ATH_TX_EDMA_H__ +#define __IF_ATH_TX_EDMA_H__ + +extern void ath_xmit_setup_edma(struct ath_softc *sc); + +#endif Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Mon Jul 23 02:49:25 2012 (r238709) +++ head/sys/dev/ath/if_ath_tx_ht.c Mon Jul 23 03:52:18 2012 (r238710) @@ -511,6 +511,8 @@ ath_rateseries_setup(struct ath_softc *s series[i].RateFlags |= HAL_RATESERIES_HALFGI; series[i].Rate = rt->info[rc[i].rix].rateCode; + series[i].RateIndex = rc[i].rix; + series[i].tx_power_cap = 0x3f; /* XXX? */ /* * PktDuration doesn't include slot, ACK, RTS, etc timing - Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Jul 23 02:49:25 2012 (r238709) +++ head/sys/dev/ath/if_athvar.h Mon Jul 23 03:52:18 2012 (r238710) @@ -397,6 +397,11 @@ struct ath_rx_edma { struct mbuf *m_rxpending; }; +struct ath_tx_methods { + int (*xmit_setup)(struct ath_softc *sc); + int (*xmit_teardown)(struct ath_softc *sc); +}; + struct ath_softc { struct ifnet *sc_ifp; /* interface common */ struct ath_stats sc_stats; /* interface statistics */ @@ -412,6 +417,8 @@ struct ath_softc { struct ath_rx_methods sc_rx; struct ath_rx_edma sc_rxedma[HAL_NUM_RX_QUEUES]; /* HP/LP queues */ + struct ath_tx_methods sc_tx; + int sc_rx_statuslen; int sc_tx_desclen; int sc_tx_statuslen; Modified: head/sys/modules/ath/Makefile ============================================================================== --- head/sys/modules/ath/Makefile Mon Jul 23 02:49:25 2012 (r238709) +++ head/sys/modules/ath/Makefile Mon Jul 23 03:52:18 2012 (r238710) @@ -37,7 +37,7 @@ ATH_RATE?= sample # tx rate control alg KMOD= if_ath SRCS= if_ath.c if_ath_debug.c if_ath_keycache.c if_ath_sysctl.c SRCS+= if_ath_tx.c if_ath_tx_ht.c if_ath_led.c if_ath_rx.c if_ath_tdma.c -SRCS+= if_ath_beacon.c if_ath_rx_edma.c +SRCS+= if_ath_beacon.c if_ath_rx_edma.c if_ath_tx_edma.c # NB: v3 eeprom support used by both AR5211 and AR5212; just include it SRCS+= ah_osdep.c ah.c ah_regdomain.c ah_eeprom_v3.c SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h opt_wlan.h From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 03:55:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05FB11065670; Mon, 23 Jul 2012 03:55:20 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5E7B8FC08; Mon, 23 Jul 2012 03:55:19 +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 q6N3tJNa061636; Mon, 23 Jul 2012 03:55:19 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6N3tJNK061634; Mon, 23 Jul 2012 03:55:19 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207230355.q6N3tJNK061634@svn.freebsd.org> From: Adrian Chadd Date: Mon, 23 Jul 2012 03:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238711 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 03:55:20 -0000 Author: adrian Date: Mon Jul 23 03:55:19 2012 New Revision: 238711 URL: http://svn.freebsd.org/changeset/base/238711 Log: Revert this; it wasn't supposed to be part of this commit. Modified: head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Mon Jul 23 03:52:18 2012 (r238710) +++ head/sys/dev/ath/if_ath_tx_ht.c Mon Jul 23 03:55:19 2012 (r238711) @@ -511,8 +511,6 @@ ath_rateseries_setup(struct ath_softc *s series[i].RateFlags |= HAL_RATESERIES_HALFGI; series[i].Rate = rt->info[rc[i].rix].rateCode; - series[i].RateIndex = rc[i].rix; - series[i].tx_power_cap = 0x3f; /* XXX? */ /* * PktDuration doesn't include slot, ACK, RTS, etc timing - From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 07:12:29 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 50CF2106566B; Mon, 23 Jul 2012 07:12:29 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id BFF718FC0A; Mon, 23 Jul 2012 07:12:28 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q6N7CR7A009297; Mon, 23 Jul 2012 11:12:27 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q6N7CRxo009296; Mon, 23 Jul 2012 11:12:27 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 23 Jul 2012 11:12:27 +0400 From: Gleb Smirnoff To: Alexey Dokuchaev Message-ID: <20120723071227.GE85230@FreeBSD.org> References: <201207211407.q6LE7h9P042318@svn.freebsd.org> <20120721153026.GA8640@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20120721153026.GA8640@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238672 - head/sys/dev/sdhci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 07:12:29 -0000 On Sat, Jul 21, 2012 at 03:30:26PM +0000, Alexey Dokuchaev wrote: A> On Sat, Jul 21, 2012 at 02:07:43PM +0000, Gleb Smirnoff wrote: A> > Author: glebius A> > Date: Sat Jul 21 14:07:43 2012 A> > New Revision: 238672 A> > URL: http://svn.freebsd.org/changeset/base/238672 A> > A> > Log: A> > Fix typo in comment, should be MHz here. A> A> That's nice, but... A> A> > @@ -364,7 +364,7 @@ sdhci_lower_frequency(device_t dev) A> > A> > /* A> > * Some SD/MMC cards don't work with the default base A> > - * clock frequency of 200MHz. Lower it to 50Hz. A> > + * clock frequency of 200MHz. Lower it to 50MHz. A> A> ... Why losing 2-space break after a sentence (per what we are generally A> adhering and AFAIR is suggested by Chicago Style Guide)? Never heard about this rule. Sorry. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 07:28:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D2C3106564A; Mon, 23 Jul 2012 07:28:17 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id AF2AC8FC0A; Mon, 23 Jul 2012 07:28:16 +0000 (UTC) Received: by obbun3 with SMTP id un3so11793038obb.13 for ; Mon, 23 Jul 2012 00:28:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=4gtskpBVlggs54PVHM+F+BTGtcSTlWd8ak6KRaEAY4k=; b=S5zXFmKIrJiHZ+GDGfC8YUU+bPHGTKHSH2BaCJv6bcMv2yXVEpnKFgwk9KlK/od6W7 CkPYNQ2RXQxI+kcSBNXMIBGkFyAR6oW636u/vc8U+rK2NPMRMK5VqYvxLjhCN/bEq/68 qOoDTdKZSjDU6+X5Do9DbTLcL8FvtHOPRvv/6SpgY5VWhN2xDnxTTQR0bX7WbrbMZVuV 04NeY6clYA6a96fZzXR2aHNGLFbg0Ky3akgHOs9o5aT3OyR+VgL3jYKIw4YmuapKyny2 Cs3+91UqxlXJk0IO3ChLtcrjJM6V/pv9BB1GIRc8Pii0MuqQBKeTtHQAcRY50VZQlqO2 eTLw== MIME-Version: 1.0 Received: by 10.60.24.7 with SMTP id q7mr19284749oef.54.1343028493591; Mon, 23 Jul 2012 00:28:13 -0700 (PDT) Received: by 10.76.84.7 with HTTP; Mon, 23 Jul 2012 00:28:13 -0700 (PDT) In-Reply-To: <20120723071227.GE85230@FreeBSD.org> References: <201207211407.q6LE7h9P042318@svn.freebsd.org> <20120721153026.GA8640@FreeBSD.org> <20120723071227.GE85230@FreeBSD.org> Date: Mon, 23 Jul 2012 00:28:13 -0700 Message-ID: From: Garrett Cooper To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r238672 - head/sys/dev/sdhci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 07:28:17 -0000 On Mon, Jul 23, 2012 at 12:12 AM, Gleb Smirnoff wrote: > On Sat, Jul 21, 2012 at 03:30:26PM +0000, Alexey Dokuchaev wrote: > A> On Sat, Jul 21, 2012 at 02:07:43PM +0000, Gleb Smirnoff wrote: > A> > Author: glebius > A> > Date: Sat Jul 21 14:07:43 2012 > A> > New Revision: 238672 > A> > URL: http://svn.freebsd.org/changeset/base/238672 > A> > > A> > Log: > A> > Fix typo in comment, should be MHz here. > A> > A> That's nice, but... > A> > A> > @@ -364,7 +364,7 @@ sdhci_lower_frequency(device_t dev) > A> > > A> > /* > A> > * Some SD/MMC cards don't work with the default base > A> > - * clock frequency of 200MHz. Lower it to 50Hz. > A> > + * clock frequency of 200MHz. Lower it to 50MHz. > A> > A> ... Why losing 2-space break after a sentence (per what we are generally > A> adhering and AFAIR is suggested by Chicago Style Guide)? > > Never heard about this rule. Sorry. Actually, English spacing is discouraged in more recent texts; it was encouraged during the late 19th century up until the late 20th century according to ye great wikipedia [1], but I've read several other articles in the past decade that suggest that the English spacing convention be completely abolished. FWIW, I'd just follow surrounding style like style(9) suggests. No reason for fighting over an extra byte per sentence in a source file (unless you consider how much added bandwidth / disk space those precious bytes can consume :)...). Thanks, -Garrett 1. http://en.wikipedia.org/wiki/History_of_sentence_spacing#French_and_English_spacing From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 08:06:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id C51BD1065672; Mon, 23 Jul 2012 08:06:38 +0000 (UTC) Date: Mon, 23 Jul 2012 08:06:38 +0000 From: Alexey Dokuchaev To: Garrett Cooper Message-ID: <20120723080638.GA95835@FreeBSD.org> References: <201207211407.q6LE7h9P042318@svn.freebsd.org> <20120721153026.GA8640@FreeBSD.org> <20120723071227.GE85230@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org Subject: Re: svn commit: r238672 - head/sys/dev/sdhci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 08:06:38 -0000 On Mon, Jul 23, 2012 at 12:28:13AM -0700, Garrett Cooper wrote: > On Mon, Jul 23, 2012 at 12:12 AM, Gleb Smirnoff wrote: > > On Sat, Jul 21, 2012 at 03:30:26PM +0000, Alexey Dokuchaev wrote: > > A> On Sat, Jul 21, 2012 at 02:07:43PM +0000, Gleb Smirnoff wrote: > > A> > /* > > A> > * Some SD/MMC cards don't work with the default base > > A> > - * clock frequency of 200MHz. Lower it to 50Hz. > > A> > + * clock frequency of 200MHz. Lower it to 50MHz. > > A> > > A> ... Why losing 2-space break after a sentence (per what we are > > A> generally adhering and AFAIR is suggested by Chicago Style Guide)? > > > > Never heard about this rule. Sorry. > > Actually, English spacing is discouraged in more recent texts; it > was encouraged during the late 19th century up until the late 20th > century according to ye great wikipedia [1], but I've read several > other articles in the past decade that suggest that the English > spacing convention be completely abolished. I was under impression that 2-space rule still makes sense for monospaced text as it improves readability (which is less of an issue for proportional fonts). ./danfe From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 08:45:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF6B71065673; Mon, 23 Jul 2012 08:45:50 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay001.isp.belgacom.be (mailrelay001.isp.belgacom.be [195.238.6.51]) by mx1.freebsd.org (Postfix) with ESMTP id DFDD38FC14; Mon, 23 Jul 2012 08:45:49 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkAFAGsODVBbsVa9/2dsb2JhbABEhSu0CYEIgiABAQVWIgEQCw4GBAkWBAsJAwIBAgEnHgYNAQUCAQEFiAgHvU6CQYkMhlMDjleBIYZljnmCYQ Received: from 189.86-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.86.189]) by relay.skynet.be with ESMTP; 23 Jul 2012 10:44:39 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.5/8.14.5) with ESMTP id q6N8idUT014778; Mon, 23 Jul 2012 10:44:39 +0200 (CEST) (envelope-from tijl@coosemans.org) Message-ID: <500D0EF0.8000201@coosemans.org> Date: Mon, 23 Jul 2012 10:44:32 +0200 From: Tijl Coosemans User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:13.0) Gecko/20120707 Thunderbird/13.0.1 MIME-Version: 1.0 To: Garrett Cooper References: <201205232148.q4NLmoXp097382@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.4.2 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig28C20D9A03C3CC9365FDC81F" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric Subject: Re: svn commit: r235864 - in head: contrib/llvm/lib/CodeGen/SelectionDAG contrib/llvm/tools/clang/include/clang/AST contrib/llvm/tools/clang/include/clang/Basic contrib/llvm/tools/clang/include/clang/P... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 08:45:51 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig28C20D9A03C3CC9365FDC81F Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 23-07-2012 00:52, Garrett Cooper wrote: > On Wed, May 23, 2012 at 2:48 PM, Dimitry Andric wrote= : >> Author: dim >> Date: Wed May 23 21:48:49 2012 >> New Revision: 235864 >> URL: http://svn.freebsd.org/changeset/base/235864 >> >> Log: >> Upgrade our copy of llvm/clang to 3.1 release. Release notes can be= >> found at: http://llvm.org/releases/3.1/docs/ReleaseNotes.html >> >> MFC after: 3 days >=20 > Hi Dimitry, > This commit was missing necessary changes to > OptionalObsoleteFiles.inc to remove the clang 3.1 headers. This patch > should fix it. > If I don't hear back in a few days, I'll file a PR and attach my pa= tch. There's a PR already: http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dmisc/1= 69902 --------------enig28C20D9A03C3CC9365FDC81F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iF4EAREIAAYFAlANDvYACgkQfoCS2CCgtiv7agD/TpVY4mbfTB4CCKTKyb9hJWV5 CoAHqjTgcI5wwXJNWc4A/RmjRBgfKcQCu/tQ8NBNjmI+YAh6Yzjf75ZdCPXQAXGp =LWtF -----END PGP SIGNATURE----- --------------enig28C20D9A03C3CC9365FDC81F-- From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 08:50:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D5E51065741; Mon, 23 Jul 2012 08:50:22 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 04F3C8FC17; Mon, 23 Jul 2012 08:50:21 +0000 (UTC) Received: by pbbro2 with SMTP id ro2so11180042pbb.13 for ; Mon, 23 Jul 2012 01:50:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=+TzDhlXXotAZMEpO1g9YpJ2avFhEKk40v1ok6KGrfvQ=; b=sIG2uOuqyzsr0MlNIXH2HyFFgKjBVA5oOl8cwlL+yVwaV8XV+aWIqGiOiw3V30pLz6 DGhrfPa60b7GcIOwtPj6R+CVsnRw2m4rQLZ9X9O+dCvtEm1p34gKimwsVinaFCsK4xpf X1BxyXTuFg6EL5rN+uhbNSUhujDvccUQrhYjeeGs+DATAdZvaDk/6tWJuEcALYnQEmfF LE2tYQAU/kGBkdmaHwzm5JC4nG3Mwpvpp14E/IBEC2t5SO4J1RpppQCI/O1h9F+xNzNK UecgdS55LWPlOnYA29z/nKM2kbxrpBQnC2omMhwLssByaxNE5HJcoWGYh6hxXzkWiyYN 1Mvw== Received: by 10.68.220.104 with SMTP id pv8mr33314629pbc.119.1343033421522; Mon, 23 Jul 2012 01:50:21 -0700 (PDT) Received: from fuji-wireless.local (c-24-19-191-56.hsd1.wa.comcast.net. [24.19.191.56]) by mx.google.com with ESMTPS id qr3sm9554564pbc.69.2012.07.23.01.50.15 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 Jul 2012 01:50:21 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-1 From: Garrett Cooper In-Reply-To: <500D0EF0.8000201@coosemans.org> Date: Mon, 23 Jul 2012 01:50:44 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <9E312617-0F2D-49B6-ABC9-E4FAE9B68F9A@gmail.com> References: <201205232148.q4NLmoXp097382@svn.freebsd.org> <500D0EF0.8000201@coosemans.org> To: Tijl Coosemans X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric Subject: Re: svn commit: r235864 - in head: contrib/llvm/lib/CodeGen/SelectionDAG contrib/llvm/tools/clang/include/clang/AST contrib/llvm/tools/clang/include/clang/Basic contrib/llvm/tools/clang/include/clang/P... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 08:50:22 -0000 On Jul 23, 2012, at 1:44 AM, Tijl Coosemans wrote: > On 23-07-2012 00:52, Garrett Cooper wrote: >> On Wed, May 23, 2012 at 2:48 PM, Dimitry Andric = wrote: >>> Author: dim >>> Date: Wed May 23 21:48:49 2012 >>> New Revision: 235864 >>> URL: http://svn.freebsd.org/changeset/base/235864 >>>=20 >>> Log: >>> Upgrade our copy of llvm/clang to 3.1 release. Release notes can = be >>> found at: http://llvm.org/releases/3.1/docs/ReleaseNotes.html >>>=20 >>> MFC after: 3 days >>=20 >> Hi Dimitry, >> This commit was missing necessary changes to >> OptionalObsoleteFiles.inc to remove the clang 3.1 headers. This patch >> should fix it. >> If I don't hear back in a few days, I'll file a PR and attach my = patch. >=20 > There's a PR already: = http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dmisc/169902 Good to know -- hopefully it will be fixed soon. Thanks! -Garrett From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 09:19:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37AE5106566C; Mon, 23 Jul 2012 09:19:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08C828FC14; Mon, 23 Jul 2012 09:19: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 q6N9JEmw087761; Mon, 23 Jul 2012 09:19:14 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6N9JEj6087758; Mon, 23 Jul 2012 09:19:14 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201207230919.q6N9JEj6087758@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 23 Jul 2012 09:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238713 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 09:19:15 -0000 Author: glebius Date: Mon Jul 23 09:19:14 2012 New Revision: 238713 URL: http://svn.freebsd.org/changeset/base/238713 Log: Merge from head r238572, r238573: ------------------------------------------------------------------------ r238572 | glebius | 2012-07-18 12:41:00 +0400 (ÑÑ€, 18 июл 2012) | 3 lines When traversing global in_ifaddr list in the IFP_TO_IA() macro, we need to obtain IN_IFADDR_RLOCK(). ------------------------------------------------------------------------ r238573 | glebius | 2012-07-18 12:58:30 +0400 (ÑÑ€, 18 июл 2012) | 5 lines Plug a reference leak: before doing 'goto again' we need to unref ia->ia_ifa if there is any. Submitted by: Andrey Zonov Approved by: re (kib) Modified: stable/9/sys/netinet/in_var.h stable/9/sys/netinet/ip_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/in_var.h ============================================================================== --- stable/9/sys/netinet/in_var.h Mon Jul 23 04:48:58 2012 (r238712) +++ stable/9/sys/netinet/in_var.h Mon Jul 23 09:19:14 2012 (r238713) @@ -159,14 +159,16 @@ do { \ #define IFP_TO_IA(ifp, ia) \ /* struct ifnet *ifp; */ \ /* struct in_ifaddr *ia; */ \ -{ \ +do { \ + IN_IFADDR_RLOCK(); \ for ((ia) = TAILQ_FIRST(&V_in_ifaddrhead); \ (ia) != NULL && (ia)->ia_ifp != (ifp); \ (ia) = TAILQ_NEXT((ia), ia_link)) \ continue; \ if ((ia) != NULL) \ ifa_ref(&(ia)->ia_ifa); \ -} + IN_IFADDR_RUNLOCK(); \ +} while (0) #endif /* Modified: stable/9/sys/netinet/ip_output.c ============================================================================== --- stable/9/sys/netinet/ip_output.c Mon Jul 23 04:48:58 2012 (r238712) +++ stable/9/sys/netinet/ip_output.c Mon Jul 23 09:19:14 2012 (r238713) @@ -121,7 +121,7 @@ ip_output(struct mbuf *m, struct mbuf *o int error = 0; int nortfree = 0; struct sockaddr_in *dst; - struct in_ifaddr *ia = NULL; + struct in_ifaddr *ia; int isbroadcast, sw_csum; struct route iproute; struct rtentry *rte; /* cache for ro->ro_rt */ @@ -196,6 +196,7 @@ ip_output(struct mbuf *m, struct mbuf *o dst = (struct sockaddr_in *)&ro->ro_dst; again: + ia = NULL; /* * If there is a cached route, * check that it is to the same destination @@ -532,8 +533,11 @@ sendit: #endif error = netisr_queue(NETISR_IP, m); goto done; - } else + } else { + if (ia != NULL) + ifa_free(&ia->ia_ifa); goto again; /* Redo the routing table lookup. */ + } } #ifdef IPFIREWALL_FORWARD @@ -563,6 +567,8 @@ sendit: bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in)); m->m_flags |= M_SKIP_FIREWALL; m_tag_delete(m, fwd_tag); + if (ia != NULL) + ifa_free(&ia->ia_ifa); goto again; } #endif /* IPFIREWALL_FORWARD */ From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 09:33:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A3233106566C; Mon, 23 Jul 2012 09:33:31 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82BCE8FC12; Mon, 23 Jul 2012 09:33: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 q6N9XVw7088904; Mon, 23 Jul 2012 09:33:31 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6N9XVbY088901; Mon, 23 Jul 2012 09:33:31 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201207230933.q6N9XVbY088901@svn.freebsd.org> From: David Xu Date: Mon, 23 Jul 2012 09:33:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238714 - stable/9/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 09:33:31 -0000 Author: davidxu Date: Mon Jul 23 09:33:31 2012 New Revision: 238714 URL: http://svn.freebsd.org/changeset/base/238714 Log: Merge r238637,r238640,r238641,r238642: ------------------------------------------------------------------------ r238637 | davidxu | 2012-07-20 09:56:14 +0800 (Fri, 20 Jul 2012) | 6 lines Don't forget to release a thread reference count, replace _thr_ref_add() with _thr_find_thread(), so reference count is no longer needed. ------------------------------------------------------------------------ r238640 | davidxu | 2012-07-20 11:00:41 +0800 (Fri, 20 Jul 2012) | 2 lines Eliminate duplicated code. ------------------------------------------------------------------------ r238641 | davidxu | 2012-07-20 11:16:52 +0800 (Fri, 20 Jul 2012) | 2 lines Eliminate duplicated code. ------------------------------------------------------------------------ r238642 | davidxu | 2012-07-20 11:22:17 +0800 (Fri, 20 Jul 2012) | 2 lines Don't assign same value. Approved by: re (kib) Modified: stable/9/lib/libthr/thread/thr_setprio.c (contents, props changed) stable/9/lib/libthr/thread/thr_setschedparam.c (contents, props changed) Modified: stable/9/lib/libthr/thread/thr_setprio.c ============================================================================== --- stable/9/lib/libthr/thread/thr_setprio.c Mon Jul 23 09:19:14 2012 (r238713) +++ stable/9/lib/libthr/thread/thr_setprio.c Mon Jul 23 09:33:31 2012 (r238714) @@ -45,38 +45,22 @@ _pthread_setprio(pthread_t pthread, int int ret; param.sched_priority = prio; - if (pthread == curthread) { + if (pthread == curthread) THR_LOCK(curthread); - if (curthread->attr.sched_policy == SCHED_OTHER || - curthread->attr.prio == prio) { - curthread->attr.prio = prio; - ret = 0; - } else { - ret = _thr_setscheduler(curthread->tid, - curthread->attr.sched_policy, ¶m); - if (ret == -1) - ret = errno; - else - curthread->attr.prio = prio; - } - THR_UNLOCK(curthread); - } else if ((ret = _thr_ref_add(curthread, pthread, /*include dead*/0)) - == 0) { - THR_THREAD_LOCK(curthread, pthread); - if (pthread->attr.sched_policy == SCHED_OTHER || - pthread->attr.prio == prio) { + else if ((ret = _thr_find_thread(curthread, pthread, /*include dead*/0))) + return (ret); + if (pthread->attr.sched_policy == SCHED_OTHER || + pthread->attr.prio == prio) { + pthread->attr.prio = prio; + ret = 0; + } else { + ret = _thr_setscheduler(pthread->tid, + pthread->attr.sched_policy, ¶m); + if (ret == -1) + ret = errno; + else pthread->attr.prio = prio; - ret = 0; - } else { - ret = _thr_setscheduler(pthread->tid, - curthread->attr.sched_policy, ¶m); - if (ret == -1) - ret = errno; - else - pthread->attr.prio = prio; - } - THR_THREAD_UNLOCK(curthread, pthread); - _thr_ref_delete(curthread, pthread); } + THR_THREAD_UNLOCK(curthread, pthread); return (ret); } Modified: stable/9/lib/libthr/thread/thr_setschedparam.c ============================================================================== --- stable/9/lib/libthr/thread/thr_setschedparam.c Mon Jul 23 09:19:14 2012 (r238713) +++ stable/9/lib/libthr/thread/thr_setschedparam.c Mon Jul 23 09:33:31 2012 (r238714) @@ -53,42 +53,25 @@ _pthread_setschedparam(pthread_t pthread struct pthread *curthread = _get_curthread(); int ret; - if (pthread == curthread) { + if (pthread == curthread) THR_LOCK(curthread); - if (curthread->attr.sched_policy == policy && - (policy == SCHED_OTHER || - curthread->attr.prio == param->sched_priority)) { - pthread->attr.prio = param->sched_priority; - THR_UNLOCK(curthread); - return (0); - } - ret = _thr_setscheduler(curthread->tid, policy, param); - if (ret == -1) - ret = errno; - else { - curthread->attr.sched_policy = policy; - curthread->attr.prio = param->sched_priority; - } - THR_UNLOCK(curthread); - } else if ((ret = _thr_ref_add(curthread, pthread, /*include dead*/0)) - == 0) { - THR_THREAD_LOCK(curthread, pthread); - if (pthread->attr.sched_policy == policy && - (policy == SCHED_OTHER || - pthread->attr.prio == param->sched_priority)) { - pthread->attr.prio = param->sched_priority; - THR_THREAD_UNLOCK(curthread, pthread); - return (0); - } - ret = _thr_setscheduler(pthread->tid, policy, param); - if (ret == -1) - ret = errno; - else { - pthread->attr.sched_policy = policy; - pthread->attr.prio = param->sched_priority; - } + else if ((ret = _thr_find_thread(curthread, pthread, + /*include dead*/0)) != 0) + return (ret); + if (pthread->attr.sched_policy == policy && + (policy == SCHED_OTHER || + pthread->attr.prio == param->sched_priority)) { + pthread->attr.prio = param->sched_priority; THR_THREAD_UNLOCK(curthread, pthread); - _thr_ref_delete(curthread, pthread); + return (0); } + ret = _thr_setscheduler(pthread->tid, policy, param); + if (ret == -1) + ret = errno; + else { + pthread->attr.sched_policy = policy; + pthread->attr.prio = param->sched_priority; + } + THR_THREAD_UNLOCK(curthread, pthread); return (ret); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 09:34:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4CAC01065672; Mon, 23 Jul 2012 09:34:20 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D2F48FC1D; Mon, 23 Jul 2012 09:34:20 +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 q6N9YKiP089015; Mon, 23 Jul 2012 09:34:20 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6N9YJPv089012; Mon, 23 Jul 2012 09:34:19 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201207230934.q6N9YJPv089012@svn.freebsd.org> From: David Xu Date: Mon, 23 Jul 2012 09:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238715 - stable/8/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 09:34:20 -0000 Author: davidxu Date: Mon Jul 23 09:34:19 2012 New Revision: 238715 URL: http://svn.freebsd.org/changeset/base/238715 Log: Merge r238637,r238640,r238641,r238642: ------------------------------------------------------------------------ r238637 | davidxu | 2012-07-20 09:56:14 +0800 (Fri, 20 Jul 2012) | 6 lines Don't forget to release a thread reference count, replace _thr_ref_add() with _thr_find_thread(), so reference count is no longer needed. ------------------------------------------------------------------------ r238640 | davidxu | 2012-07-20 11:00:41 +0800 (Fri, 20 Jul 2012) | 2 lines Eliminate duplicated code. ------------------------------------------------------------------------ r238641 | davidxu | 2012-07-20 11:16:52 +0800 (Fri, 20 Jul 2012) | 2 lines Eliminate duplicated code. ------------------------------------------------------------------------ r238642 | davidxu | 2012-07-20 11:22:17 +0800 (Fri, 20 Jul 2012) | 2 lines Don't assign same value. Modified: stable/8/lib/libthr/thread/thr_setprio.c (contents, props changed) stable/8/lib/libthr/thread/thr_setschedparam.c (contents, props changed) Modified: stable/8/lib/libthr/thread/thr_setprio.c ============================================================================== --- stable/8/lib/libthr/thread/thr_setprio.c Mon Jul 23 09:33:31 2012 (r238714) +++ stable/8/lib/libthr/thread/thr_setprio.c Mon Jul 23 09:34:19 2012 (r238715) @@ -45,38 +45,22 @@ _pthread_setprio(pthread_t pthread, int int ret; param.sched_priority = prio; - if (pthread == curthread) { + if (pthread == curthread) THR_LOCK(curthread); - if (curthread->attr.sched_policy == SCHED_OTHER || - curthread->attr.prio == prio) { - curthread->attr.prio = prio; - ret = 0; - } else { - ret = _thr_setscheduler(curthread->tid, - curthread->attr.sched_policy, ¶m); - if (ret == -1) - ret = errno; - else - curthread->attr.prio = prio; - } - THR_UNLOCK(curthread); - } else if ((ret = _thr_ref_add(curthread, pthread, /*include dead*/0)) - == 0) { - THR_THREAD_LOCK(curthread, pthread); - if (pthread->attr.sched_policy == SCHED_OTHER || - pthread->attr.prio == prio) { + else if ((ret = _thr_find_thread(curthread, pthread, /*include dead*/0))) + return (ret); + if (pthread->attr.sched_policy == SCHED_OTHER || + pthread->attr.prio == prio) { + pthread->attr.prio = prio; + ret = 0; + } else { + ret = _thr_setscheduler(pthread->tid, + pthread->attr.sched_policy, ¶m); + if (ret == -1) + ret = errno; + else pthread->attr.prio = prio; - ret = 0; - } else { - ret = _thr_setscheduler(pthread->tid, - curthread->attr.sched_policy, ¶m); - if (ret == -1) - ret = errno; - else - pthread->attr.prio = prio; - } - THR_THREAD_UNLOCK(curthread, pthread); - _thr_ref_delete(curthread, pthread); } + THR_THREAD_UNLOCK(curthread, pthread); return (ret); } Modified: stable/8/lib/libthr/thread/thr_setschedparam.c ============================================================================== --- stable/8/lib/libthr/thread/thr_setschedparam.c Mon Jul 23 09:33:31 2012 (r238714) +++ stable/8/lib/libthr/thread/thr_setschedparam.c Mon Jul 23 09:34:19 2012 (r238715) @@ -53,42 +53,25 @@ _pthread_setschedparam(pthread_t pthread struct pthread *curthread = _get_curthread(); int ret; - if (pthread == curthread) { + if (pthread == curthread) THR_LOCK(curthread); - if (curthread->attr.sched_policy == policy && - (policy == SCHED_OTHER || - curthread->attr.prio == param->sched_priority)) { - pthread->attr.prio = param->sched_priority; - THR_UNLOCK(curthread); - return (0); - } - ret = _thr_setscheduler(curthread->tid, policy, param); - if (ret == -1) - ret = errno; - else { - curthread->attr.sched_policy = policy; - curthread->attr.prio = param->sched_priority; - } - THR_UNLOCK(curthread); - } else if ((ret = _thr_ref_add(curthread, pthread, /*include dead*/0)) - == 0) { - THR_THREAD_LOCK(curthread, pthread); - if (pthread->attr.sched_policy == policy && - (policy == SCHED_OTHER || - pthread->attr.prio == param->sched_priority)) { - pthread->attr.prio = param->sched_priority; - THR_THREAD_UNLOCK(curthread, pthread); - return (0); - } - ret = _thr_setscheduler(pthread->tid, policy, param); - if (ret == -1) - ret = errno; - else { - pthread->attr.sched_policy = policy; - pthread->attr.prio = param->sched_priority; - } + else if ((ret = _thr_find_thread(curthread, pthread, + /*include dead*/0)) != 0) + return (ret); + if (pthread->attr.sched_policy == policy && + (policy == SCHED_OTHER || + pthread->attr.prio == param->sched_priority)) { + pthread->attr.prio = param->sched_priority; THR_THREAD_UNLOCK(curthread, pthread); - _thr_ref_delete(curthread, pthread); + return (0); } + ret = _thr_setscheduler(pthread->tid, policy, param); + if (ret == -1) + ret = errno; + else { + pthread->attr.sched_policy = policy; + pthread->attr.prio = param->sched_priority; + } + THR_THREAD_UNLOCK(curthread, pthread); return (ret); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 09:38:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C098106566C; Mon, 23 Jul 2012 09:38:11 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DCF88FC17; Mon, 23 Jul 2012 09:38: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 q6N9cBUK089345; Mon, 23 Jul 2012 09:38:11 GMT (envelope-from pgj@svn.freebsd.org) Received: (from pgj@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6N9cBTB089343; Mon, 23 Jul 2012 09:38:11 GMT (envelope-from pgj@svn.freebsd.org) Message-Id: <201207230938.q6N9cBTB089343@svn.freebsd.org> From: Gabor Pali Date: Mon, 23 Jul 2012 09:38:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238716 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 09:38:11 -0000 Author: pgj (ports committer) Date: Mon Jul 23 09:38:10 2012 New Revision: 238716 URL: http://svn.freebsd.org/changeset/base/238716 Log: Take rafan's commit bit into safekeeping per his request. Thanks for all the work on FreeBSD in the past! Approved by: core (implicit) Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Mon Jul 23 09:34:19 2012 (r238715) +++ svnadmin/conf/access Mon Jul 23 09:38:10 2012 (r238716) @@ -200,7 +200,6 @@ pjd pluknet ps qingli -rafan raj ray rdivacky From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 14:22:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 87A5A106566B; Mon, 23 Jul 2012 14:22:46 +0000 (UTC) (envelope-from rea@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 730088FC0A; Mon, 23 Jul 2012 14:22: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 q6NEMk7D017241; Mon, 23 Jul 2012 14:22:46 GMT (envelope-from rea@svn.freebsd.org) Received: (from rea@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6NEMkCJ017238; Mon, 23 Jul 2012 14:22:46 GMT (envelope-from rea@svn.freebsd.org) Message-Id: <201207231422.q6NEMkCJ017238@svn.freebsd.org> From: Eygene Ryabinkin Date: Mon, 23 Jul 2012 14:22:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238717 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 14:22:46 -0000 Author: rea (ports committer) Date: Mon Jul 23 14:22:45 2012 New Revision: 238717 URL: http://svn.freebsd.org/changeset/base/238717 Log: u3g: add support for Huawei E392 LTE modem I am using it rebranded and it carries the label "Megafon" (it is Russian mobile operator); works fine with my 3G network. Approved by: hselasky Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Mon Jul 23 09:38:10 2012 (r238716) +++ head/sys/dev/usb/serial/u3g.c Mon Jul 23 14:22:45 2012 (r238717) @@ -287,6 +287,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(HUAWEI, E180V, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E220, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E220BIS, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E392, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, MOBILE, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E1752, U3GINIT_HUAWEISCSI), U3G_DEV(HUAWEI, E1820, U3GINIT_HUAWEISCSI), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Mon Jul 23 09:38:10 2012 (r238716) +++ head/sys/dev/usb/usbdevs Mon Jul 23 14:22:45 2012 (r238717) @@ -1895,6 +1895,7 @@ product HUAWEI E1752 0x1446 3G modem product HUAWEI K3765 0x1465 3G modem product HUAWEI E1820 0x14ac E1820 HSPA+ USB Slider product HUAWEI E3131_INIT 0x14fe 3G modem initial +product HUAWEI E392 0x1505 LTE modem product HUAWEI E3131 0x1506 3G modem product HUAWEI K3765_INIT 0x1520 K3765 Initial product HUAWEI ETS2055 0x1803 CDMA modem From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 15:14:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 894E5106566B; Mon, 23 Jul 2012 15:14:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 744D58FC0A; Mon, 23 Jul 2012 15:14:29 +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 q6NFETlI021316; Mon, 23 Jul 2012 15:14:29 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6NFETgC021314; Mon, 23 Jul 2012 15:14:29 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201207231514.q6NFETgC021314@svn.freebsd.org> From: Ed Maste Date: Mon, 23 Jul 2012 15:14:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238718 - head/sys/dev/usb/quirk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 15:14:29 -0000 Author: emaste Date: Mon Jul 23 15:14:28 2012 New Revision: 238718 URL: http://svn.freebsd.org/changeset/base/238718 Log: Quirk MS keyboard so that function keys work The function keys on a Microsoft Natural Egronomic Keyboard 4000 have been repurposed as "Help", "Undo", "Redo" etc., and a special "F Lock" key is required to return them to their normal purpose. This change enables the UQ_KBD_BOOTPROTO quirk for the MS Natural 4000 keyboard to get the keys working again. More extensive changes to the USB keyboard infrastructure would be needed to fully support the "F Lock" mode and the extended keys on this keyboard. PR: usb/116947 Approved by: hselasky@ Modified: head/sys/dev/usb/quirk/usb_quirk.c Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Mon Jul 23 14:22:45 2012 (r238717) +++ head/sys/dev/usb/quirk/usb_quirk.c Mon Jul 23 15:14:28 2012 (r238718) @@ -123,6 +123,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(METAGEEK2, WISPYDBX, 0x0000, 0xffff, UQ_KBD_IGNORE, UQ_HID_IGNORE), USB_QUIRK(TENX, UAUDIO0, 0x0101, 0x0101, UQ_AUDIO_SWAP_LR), /* MS keyboards do weird things */ + USB_QUIRK(MICROSOFT, NATURAL4000, 0x0000, 0xFFFF, UQ_KBD_BOOTPROTO), USB_QUIRK(MICROSOFT, WLINTELLIMOUSE, 0x0000, 0xffff, UQ_MS_LEADING_BYTE), /* umodem(4) device quirks */ USB_QUIRK(METRICOM, RICOCHET_GS, 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA), From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 15:19:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B08C1106564A; Mon, 23 Jul 2012 15:19:22 +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 9B89B8FC08; Mon, 23 Jul 2012 15:19:22 +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 q6NFJMnV021721; Mon, 23 Jul 2012 15:19:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6NFJMQ7021717; Mon, 23 Jul 2012 15:19:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201207231519.q6NFJMQ7021717@svn.freebsd.org> From: Alexander Motin Date: Mon, 23 Jul 2012 15:19:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238719 - stable/9/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 15:19:22 -0000 Author: mav Date: Mon Jul 23 15:19:21 2012 New Revision: 238719 URL: http://svn.freebsd.org/changeset/base/238719 Log: MFC r238666: Fix typo in bzero() length argument during sense fetching. For me it at least fixed CD burning in PIO mode. Approved by: re (kib) Modified: stable/9/sys/dev/ata/ata-all.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ata/ata-all.c ============================================================================== --- stable/9/sys/dev/ata/ata-all.c Mon Jul 23 15:14:28 2012 (r238718) +++ stable/9/sys/dev/ata/ata-all.c Mon Jul 23 15:19:21 2012 (r238719) @@ -1532,7 +1532,7 @@ ata_cam_request_sense(device_t dev, stru ch->requestsense = 1; - bzero(request, sizeof(&request)); + bzero(request, sizeof(*request)); request->dev = NULL; request->parent = dev; request->unit = ccb->ccb_h.target_id; From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 15:20:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0C861065677; Mon, 23 Jul 2012 15:20:52 +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 AB6798FC1C; Mon, 23 Jul 2012 15:20:52 +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 q6NFKqaW021875; Mon, 23 Jul 2012 15:20:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6NFKq9F021873; Mon, 23 Jul 2012 15:20:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201207231520.q6NFKq9F021873@svn.freebsd.org> From: Alexander Motin Date: Mon, 23 Jul 2012 15:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238720 - stable/8/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 15:20:52 -0000 Author: mav Date: Mon Jul 23 15:20:52 2012 New Revision: 238720 URL: http://svn.freebsd.org/changeset/base/238720 Log: MFC r238666: Fix typo in bzero() length argument during sense fetching. For me it at least fixed CD burning in PIO mode. Modified: stable/8/sys/dev/ata/ata-all.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/ata/ata-all.c ============================================================================== --- stable/8/sys/dev/ata/ata-all.c Mon Jul 23 15:19:21 2012 (r238719) +++ stable/8/sys/dev/ata/ata-all.c Mon Jul 23 15:20:52 2012 (r238720) @@ -1531,7 +1531,7 @@ ata_cam_request_sense(device_t dev, stru ch->requestsense = 1; - bzero(request, sizeof(&request)); + bzero(request, sizeof(*request)); request->dev = NULL; request->parent = dev; request->unit = ccb->ccb_h.target_id; From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 16:36:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 261D1106566B; Mon, 23 Jul 2012 16:36:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB5048FC16; Mon, 23 Jul 2012 16:36:13 +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 q6NGaDXV027761; Mon, 23 Jul 2012 16:36:13 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6NGaDCu027759; Mon, 23 Jul 2012 16:36:13 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201207231636.q6NGaDCu027759@svn.freebsd.org> From: Dimitry Andric Date: Mon, 23 Jul 2012 16:36:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238721 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 16:36:14 -0000 Author: dim Date: Mon Jul 23 16:36:13 2012 New Revision: 238721 URL: http://svn.freebsd.org/changeset/base/238721 Log: When WITHOUT_CLANG is being used, also clean out the clang 3.1 headers in OptionalObsoleteFiles.inc. PR: misc/169902 Submitted by: Thomas Eberhardt MFC after: 3 days Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jul 23 15:20:52 2012 (r238720) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Jul 23 16:36:13 2012 (r238721) @@ -659,6 +659,30 @@ OLD_FILES+=usr/include/clang/3.0/wmmintr OLD_FILES+=usr/include/clang/3.0/x86intrin.h OLD_FILES+=usr/include/clang/3.0/xmmintrin.h OLD_DIRS+=usr/include/clang/3.0 +OLD_FILES+=usr/include/clang/3.1/altivec.h +OLD_FILES+=usr/include/clang/3.1/avx2intrin.h +OLD_FILES+=usr/include/clang/3.1/avxintrin.h +OLD_FILES+=usr/include/clang/3.1/bmi2intrin.h +OLD_FILES+=usr/include/clang/3.1/bmiintrin.h +OLD_FILES+=usr/include/clang/3.1/cpuid.h +OLD_FILES+=usr/include/clang/3.1/emmintrin.h +OLD_FILES+=usr/include/clang/3.1/fma4intrin.h +OLD_FILES+=usr/include/clang/3.1/immintrin.h +OLD_FILES+=usr/include/clang/3.1/lzcntintrin.h +OLD_FILES+=usr/include/clang/3.1/mm3dnow.h +OLD_FILES+=usr/include/clang/3.1/mm_malloc.h +OLD_FILES+=usr/include/clang/3.1/mmintrin.h +OLD_FILES+=usr/include/clang/3.1/module.map +OLD_FILES+=usr/include/clang/3.1/nmmintrin.h +OLD_FILES+=usr/include/clang/3.1/pmmintrin.h +OLD_FILES+=usr/include/clang/3.1/popcntintrin.h +OLD_FILES+=usr/include/clang/3.1/smmintrin.h +OLD_FILES+=usr/include/clang/3.1/tmmintrin.h +OLD_FILES+=usr/include/clang/3.1/unwind.h +OLD_FILES+=usr/include/clang/3.1/wmmintrin.h +OLD_FILES+=usr/include/clang/3.1/x86intrin.h +OLD_FILES+=usr/include/clang/3.1/xmmintrin.h +OLD_DIRS+=usr/include/clang/3.1 OLD_DIRS+=usr/include/clang OLD_FILES+=usr/share/doc/llvm/clang/LICENSE.TXT OLD_DIRS+=usr/share/doc/llvm/clang From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 19:13:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A0D4106566C; Mon, 23 Jul 2012 19:13:56 +0000 (UTC) (envelope-from kargl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 406B38FC0A; Mon, 23 Jul 2012 19:13:56 +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 q6NJDuQM040341; Mon, 23 Jul 2012 19:13:56 GMT (envelope-from kargl@svn.freebsd.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6NJDucB040333; Mon, 23 Jul 2012 19:13:56 GMT (envelope-from kargl@svn.freebsd.org) Message-Id: <201207231913.q6NJDucB040333@svn.freebsd.org> From: Steve Kargl Date: Mon, 23 Jul 2012 19:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238722 - in head/lib/msun: . ld128 ld80 man src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 19:13:56 -0000 Author: kargl Date: Mon Jul 23 19:13:55 2012 New Revision: 238722 URL: http://svn.freebsd.org/changeset/base/238722 Log: Compute the exponential of x for Intel 80-bit format and IEEE 128-bit format. These implementations are based on PTP Tang, "Table-driven implementation of the exponential function in IEEE floating-point arithmetic," ACM Trans. Math. Soft., 15, 144-157 (1989). PR: standards/152415 Submitted by: kargl Reviewed by: bde, das Approved by: das (mentor) Added: head/lib/msun/ld128/s_expl.c (contents, props changed) head/lib/msun/ld80/s_expl.c (contents, props changed) Modified: head/lib/msun/Symbol.map head/lib/msun/man/exp.3 head/lib/msun/src/e_exp.c head/lib/msun/src/math.h head/lib/msun/src/math_private.h Modified: head/lib/msun/Symbol.map ============================================================================== --- head/lib/msun/Symbol.map Mon Jul 23 16:36:13 2012 (r238721) +++ head/lib/msun/Symbol.map Mon Jul 23 19:13:55 2012 (r238722) @@ -249,4 +249,5 @@ FBSD_1.3 { ctanf; ctanh; ctanhf; + expl; }; Added: head/lib/msun/ld128/s_expl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/ld128/s_expl.c Mon Jul 23 19:13:55 2012 (r238722) @@ -0,0 +1,260 @@ +/*- + * Copyright (c) 2012 Steven G. Kargl + * 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 unmodified, 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, + * 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 +__FBSDID("$FreeBSD$"); + +#include + +#include "math.h" +#include "math_private.h" +#include "fpmath.h" + +#define BIAS (LDBL_MAX_EXP - 1) +#define EXPMASK (BIAS + LDBL_MAX_EXP) + +static volatile const long double twom10000 = 0x1p-10000L, tiny = 0x1p-10000L; + +static const long double +huge = 0x1p10000L, +o_threshold = 11356.523406294143949491931077970763428L, +u_threshold = -11433.462743336297878837243843452621503L, +L1 = 5.41521234812457272982212595914567508e-03L, +L2 = -1.02536706388947310094527932552595546e-29L, +INV_L = 1.84664965233787316142070359168242182e+02L; + +static const long double +P2 = 5.00000000000000000000000000000000000e-1L, +P3 = 1.66666666666666666666666666666666972e-1L, +P4 = 4.16666666666666666666666666653708268e-2L, +P5 = 8.33333333333333333333333315069867254e-3L, +P6 = 1.38888888888888888888996596213795377e-3L, +P7 = 1.98412698412698412718821436278644414e-4L, +P8 = 2.48015873015869681884882576649543128e-5L, +P9 = 2.75573192240103867817876199544468806e-6L, +P10 = 2.75573236172670046201884000197885520e-7L, +P11 = 2.50517544183909126492878226167697856e-8L; + +#define NUM 128 + +static const struct { + long double hi; + long double lo; +} s[NUM] = { + 0x1p0L, 0x0p0L, + 0x1.0163da9fb33356d84a66aep0L, 0x3.36dcdfa4003ec04c360be2404078p-92L, + 0x1.02c9a3e778060ee6f7cacap0L, 0x4.f7a29bde93d70a2cabc5cb89ba10p-92L, + 0x1.04315e86e7f84bd738f9a2p0L, 0xd.a47e6ed040bb4bfc05af6455e9b8p-96L, + 0x1.059b0d31585743ae7c548ep0L, 0xb.68ca417fe53e3495f7df4baf84a0p-92L, + 0x1.0706b29ddf6ddc6dc403a8p0L, 0x1.d87b27ed07cb8b092ac75e311753p-88L, + 0x1.0874518759bc808c35f25cp0L, 0x1.9427fa2b041b2d6829d8993a0d01p-88L, + 0x1.09e3ecac6f3834521e060cp0L, 0x5.84d6b74ba2e023da730e7fccb758p-92L, + 0x1.0b5586cf9890f6298b92b6p0L, 0x1.1842a98364291408b3ceb0a2a2bbp-88L, + 0x1.0cc922b7247f7407b705b8p0L, 0x9.3dc5e8aac564e6fe2ef1d431fd98p-92L, + 0x1.0e3ec32d3d1a2020742e4ep0L, 0x1.8af6a552ac4b358b1129e9f966a4p-88L, + 0x1.0fb66affed31af232091dcp0L, 0x1.8a1426514e0b627bda694a400a27p-88L, + 0x1.11301d0125b50a4ebbf1aep0L, 0xd.9318ceac5cc47ab166ee57427178p-92L, + 0x1.12abdc06c31cbfb92bad32p0L, 0x4.d68e2f7270bdf7cedf94eb1cb818p-92L, + 0x1.1429aaea92ddfb34101942p0L, 0x1.b2586d01844b389bea7aedd221d4p-88L, + 0x1.15a98c8a58e512480d573cp0L, 0x1.d5613bf92a2b618ee31b376c2689p-88L, + 0x1.172b83c7d517adcdf7c8c4p0L, 0x1.0eb14a792035509ff7d758693f24p-88L, + 0x1.18af9388c8de9bbbf70b9ap0L, 0x3.c2505c97c0102e5f1211941d2840p-92L, + 0x1.1a35beb6fcb753cb698f68p0L, 0x1.2d1c835a6c30724d5cfae31b84e5p-88L, + 0x1.1bbe084045cd39ab1e72b4p0L, 0x4.27e35f9acb57e473915519a1b448p-92L, + 0x1.1d4873168b9aa7805b8028p0L, 0x9.90f07a98b42206e46166cf051d70p-92L, + 0x1.1ed5022fcd91cb8819ff60p0L, 0x1.121d1e504d36c47474c9b7de6067p-88L, + 0x1.2063b88628cd63b8eeb028p0L, 0x1.50929d0fc487d21c2b84004264dep-88L, + 0x1.21f49917ddc962552fd292p0L, 0x9.4bdb4b61ea62477caa1dce823ba0p-92L, + 0x1.2387a6e75623866c1fadb0p0L, 0x1.c15cb593b0328566902df69e4de2p-88L, + 0x1.251ce4fb2a63f3582ab7dep0L, 0x9.e94811a9c8afdcf796934bc652d0p-92L, + 0x1.26b4565e27cdd257a67328p0L, 0x1.d3b249dce4e9186ddd5ff44e6b08p-92L, + 0x1.284dfe1f5638096cf15cf0p0L, 0x3.ca0967fdaa2e52d7c8106f2e262cp-92L, + 0x1.29e9df51fdee12c25d15f4p0L, 0x1.a24aa3bca890ac08d203fed80a07p-88L, + 0x1.2b87fd0dad98ffddea4652p0L, 0x1.8fcab88442fdc3cb6de4519165edp-88L, + 0x1.2d285a6e4030b40091d536p0L, 0xd.075384589c1cd1b3e4018a6b1348p-92L, + 0x1.2ecafa93e2f5611ca0f45cp0L, 0x1.523833af611bdcda253c554cf278p-88L, + 0x1.306fe0a31b7152de8d5a46p0L, 0x3.05c85edecbc27343629f502f1af2p-92L, + 0x1.32170fc4cd8313539cf1c2p0L, 0x1.008f86dde3220ae17a005b6412bep-88L, + 0x1.33c08b26416ff4c9c8610cp0L, 0x1.96696bf95d1593039539d94d662bp-88L, + 0x1.356c55f929ff0c94623476p0L, 0x3.73af38d6d8d6f9506c9bbc93cbc0p-92L, + 0x1.371a7373aa9caa7145502ep0L, 0x1.4547987e3e12516bf9c699be432fp-88L, + 0x1.38cae6d05d86585a9cb0d8p0L, 0x1.bed0c853bd30a02790931eb2e8f0p-88L, + 0x1.3a7db34e59ff6ea1bc9298p0L, 0x1.e0a1d336163fe2f852ceeb134067p-88L, + 0x1.3c32dc313a8e484001f228p0L, 0xb.58f3775e06ab66353001fae9fca0p-92L, + 0x1.3dea64c12342235b41223ep0L, 0x1.3d773fba2cb82b8244267c54443fp-92L, + 0x1.3fa4504ac801ba0bf701aap0L, 0x4.1832fb8c1c8dbdff2c49909e6c60p-92L, + 0x1.4160a21f72e29f84325b8ep0L, 0x1.3db61fb352f0540e6ba05634413ep-88L, + 0x1.431f5d950a896dc7044394p0L, 0x1.0ccec81e24b0caff7581ef4127f7p-92L, + 0x1.44e086061892d03136f408p0L, 0x1.df019fbd4f3b48709b78591d5cb5p-88L, + 0x1.46a41ed1d005772512f458p0L, 0x1.229d97df404ff21f39c1b594d3a8p-88L, + 0x1.486a2b5c13cd013c1a3b68p0L, 0x1.062f03c3dd75ce8757f780e6ec99p-88L, + 0x1.4a32af0d7d3de672d8bcf4p0L, 0x6.f9586461db1d878b1d148bd3ccb8p-92L, + 0x1.4bfdad5362a271d4397afep0L, 0xc.42e20e0363ba2e159c579f82e4b0p-92L, + 0x1.4dcb299fddd0d63b36ef1ap0L, 0x9.e0cc484b25a5566d0bd5f58ad238p-92L, + 0x1.4f9b2769d2ca6ad33d8b68p0L, 0x1.aa073ee55e028497a329a7333dbap-88L, + 0x1.516daa2cf6641c112f52c8p0L, 0x4.d822190e718226177d7608d20038p-92L, + 0x1.5342b569d4f81df0a83c48p0L, 0x1.d86a63f4e672a3e429805b049465p-88L, + 0x1.551a4ca5d920ec52ec6202p0L, 0x4.34ca672645dc6c124d6619a87574p-92L, + 0x1.56f4736b527da66ecb0046p0L, 0x1.64eb3c00f2f5ab3d801d7cc7272dp-88L, + 0x1.58d12d497c7fd252bc2b72p0L, 0x1.43bcf2ec936a970d9cc266f0072fp-88L, + 0x1.5ab07dd48542958c930150p0L, 0x1.91eb345d88d7c81280e069fbdb63p-88L, + 0x1.5c9268a5946b701c4b1b80p0L, 0x1.6986a203d84e6a4a92f179e71889p-88L, + 0x1.5e76f15ad21486e9be4c20p0L, 0x3.99766a06548a05829e853bdb2b52p-92L, + 0x1.605e1b976dc08b076f592ap0L, 0x4.86e3b34ead1b4769df867b9c89ccp-92L, + 0x1.6247eb03a5584b1f0fa06ep0L, 0x1.d2da42bb1ceaf9f732275b8aef30p-88L, + 0x1.6434634ccc31fc76f8714cp0L, 0x4.ed9a4e41000307103a18cf7a6e08p-92L, + 0x1.66238825522249127d9e28p0L, 0x1.b8f314a337f4dc0a3adf1787ff74p-88L, + 0x1.68155d44ca973081c57226p0L, 0x1.b9f32706bfe4e627d809a85dcc66p-88L, + 0x1.6a09e667f3bcc908b2fb12p0L, 0x1.66ea957d3e3adec17512775099dap-88L, + 0x1.6c012750bdabeed76a9980p0L, 0xf.4f33fdeb8b0ecd831106f57b3d00p-96L, + 0x1.6dfb23c651a2ef220e2cbep0L, 0x1.bbaa834b3f11577ceefbe6c1c411p-92L, + 0x1.6ff7df9519483cf87e1b4ep0L, 0x1.3e213bff9b702d5aa477c12523cep-88L, + 0x1.71f75e8ec5f73dd2370f2ep0L, 0xf.0acd6cb434b562d9e8a20adda648p-92L, + 0x1.73f9a48a58173bd5c9a4e6p0L, 0x8.ab1182ae217f3a7681759553e840p-92L, + 0x1.75feb564267c8bf6e9aa32p0L, 0x1.a48b27071805e61a17b954a2dad8p-88L, + 0x1.780694fde5d3f619ae0280p0L, 0x8.58b2bb2bdcf86cd08e35fb04c0f0p-92L, + 0x1.7a11473eb0186d7d51023ep0L, 0x1.6cda1f5ef42b66977960531e821bp-88L, + 0x1.7c1ed0130c1327c4933444p0L, 0x1.937562b2dc933d44fc828efd4c9cp-88L, + 0x1.7e2f336cf4e62105d02ba0p0L, 0x1.5797e170a1427f8fcdf5f3906108p-88L, + 0x1.80427543e1a11b60de6764p0L, 0x9.a354ea706b8e4d8b718a672bf7c8p-92L, + 0x1.82589994cce128acf88afap0L, 0xb.34a010f6ad65cbbac0f532d39be0p-92L, + 0x1.8471a4623c7acce52f6b96p0L, 0x1.c64095370f51f48817914dd78665p-88L, + 0x1.868d99b4492ec80e41d90ap0L, 0xc.251707484d73f136fb5779656b70p-92L, + 0x1.88ac7d98a669966530bcdep0L, 0x1.2d4e9d61283ef385de170ab20f96p-88L, + 0x1.8ace5422aa0db5ba7c55a0p0L, 0x1.92c9bb3e6ed61f2733304a346d8fp-88L, + 0x1.8cf3216b5448bef2aa1cd0p0L, 0x1.61c55d84a9848f8c453b3ca8c946p-88L, + 0x1.8f1ae991577362b982745cp0L, 0x7.2ed804efc9b4ae1458ae946099d4p-92L, + 0x1.9145b0b91ffc588a61b468p0L, 0x1.f6b70e01c2a90229a4c4309ea719p-88L, + 0x1.93737b0cdc5e4f4501c3f2p0L, 0x5.40a22d2fc4af581b63e8326efe9cp-92L, + 0x1.95a44cbc8520ee9b483694p0L, 0x1.a0fc6f7c7d61b2b3a22a0eab2cadp-88L, + 0x1.97d829fde4e4f8b9e920f8p0L, 0x1.1e8bd7edb9d7144b6f6818084cc7p-88L, + 0x1.9a0f170ca07b9ba3109b8cp0L, 0x4.6737beb19e1eada6825d3c557428p-92L, + 0x1.9c49182a3f0901c7c46b06p0L, 0x1.1f2be58ddade50c217186c90b457p-88L, + 0x1.9e86319e323231824ca78ep0L, 0x6.4c6e010f92c082bbadfaf605cfd4p-92L, + 0x1.a0c667b5de564b29ada8b8p0L, 0xc.ab349aa0422a8da7d4512edac548p-92L, + 0x1.a309bec4a2d3358c171f76p0L, 0x1.0daad547fa22c26d168ea762d854p-88L, + 0x1.a5503b23e255c8b424491cp0L, 0xa.f87bc8050a405381703ef7caff50p-92L, + 0x1.a799e1330b3586f2dfb2b0p0L, 0x1.58f1a98796ce8908ae852236ca94p-88L, + 0x1.a9e6b5579fdbf43eb243bcp0L, 0x1.ff4c4c58b571cf465caf07b4b9f5p-88L, + 0x1.ac36bbfd3f379c0db966a2p0L, 0x1.1265fc73e480712d20f8597a8e7bp-88L, + 0x1.ae89f995ad3ad5e8734d16p0L, 0x1.73205a7fbc3ae675ea440b162d6cp-88L, + 0x1.b0e07298db66590842acdep0L, 0x1.c6f6ca0e5dcae2aafffa7a0554cbp-88L, + 0x1.b33a2b84f15faf6bfd0e7ap0L, 0x1.d947c2575781dbb49b1237c87b6ep-88L, + 0x1.b59728de559398e3881110p0L, 0x1.64873c7171fefc410416be0a6525p-88L, + 0x1.b7f76f2fb5e46eaa7b081ap0L, 0xb.53c5354c8903c356e4b625aacc28p-92L, + 0x1.ba5b030a10649840cb3c6ap0L, 0xf.5b47f297203757e1cc6eadc8bad0p-92L, + 0x1.bcc1e904bc1d2247ba0f44p0L, 0x1.b3d08cd0b20287092bd59be4ad98p-88L, + 0x1.bf2c25bd71e088408d7024p0L, 0x1.18e3449fa073b356766dfb568ff4p-88L, + 0x1.c199bdd85529c2220cb12ap0L, 0x9.1ba6679444964a36661240043970p-96L, + 0x1.c40ab5fffd07a6d14df820p0L, 0xf.1828a5366fd387a7bdd54cdf7300p-92L, + 0x1.c67f12e57d14b4a2137fd2p0L, 0xf.2b301dd9e6b151a6d1f9d5d5f520p-96L, + 0x1.c8f6d9406e7b511acbc488p0L, 0x5.c442ddb55820171f319d9e5076a8p-96L, + 0x1.cb720dcef90691503cbd1ep0L, 0x9.49db761d9559ac0cb6dd3ed599e0p-92L, + 0x1.cdf0b555dc3f9c44f8958ep0L, 0x1.ac51be515f8c58bdfb6f5740a3a4p-88L, + 0x1.d072d4a07897b8d0f22f20p0L, 0x1.a158e18fbbfc625f09f4cca40874p-88L, + 0x1.d2f87080d89f18ade12398p0L, 0x9.ea2025b4c56553f5cdee4c924728p-92L, + 0x1.d5818dcfba48725da05aeap0L, 0x1.66e0dca9f589f559c0876ff23830p-88L, + 0x1.d80e316c98397bb84f9d04p0L, 0x8.805f84bec614de269900ddf98d28p-92L, + 0x1.da9e603db3285708c01a5ap0L, 0x1.6d4c97f6246f0ec614ec95c99392p-88L, + 0x1.dd321f301b4604b695de3cp0L, 0x6.30a393215299e30d4fb73503c348p-96L, + 0x1.dfc97337b9b5eb968cac38p0L, 0x1.ed291b7225a944efd5bb5524b927p-88L, + 0x1.e264614f5a128a12761fa0p0L, 0x1.7ada6467e77f73bf65e04c95e29dp-88L, + 0x1.e502ee78b3ff6273d13014p0L, 0x1.3991e8f49659e1693be17ae1d2f9p-88L, + 0x1.e7a51fbc74c834b548b282p0L, 0x1.23786758a84f4956354634a416cep-88L, + 0x1.ea4afa2a490d9858f73a18p0L, 0xf.5db301f86dea20610ceee13eb7b8p-92L, + 0x1.ecf482d8e67f08db0312fap0L, 0x1.949cef462010bb4bc4ce72a900dfp-88L, + 0x1.efa1bee615a27771fd21a8p0L, 0x1.2dac1f6dd5d229ff68e46f27e3dfp-88L, + 0x1.f252b376bba974e8696fc2p0L, 0x1.6390d4c6ad5476b5162f40e1d9a9p-88L, + 0x1.f50765b6e4540674f84b76p0L, 0x2.862baff99000dfc4352ba29b8908p-92L, + 0x1.f7bfdad9cbe138913b4bfep0L, 0x7.2bd95c5ce7280fa4d2344a3f5618p-92L, + 0x1.fa7c1819e90d82e90a7e74p0L, 0xb.263c1dc060c36f7650b4c0f233a8p-92L, + 0x1.fd3c22b8f71f10975ba4b2p0L, 0x1.2bcf3a5e12d269d8ad7c1a4a8875p-88L +}; + +long double +expl(long double x) +{ + union IEEEl2bits u, v; + long double fn, r, r1, r2, q, t, twopk, twopkp10000; + int k, n, n2; + uint32_t hx, ix; + + /* Filter out exceptional cases. */ + u.e = x; + hx = u.xbits.expsign; + ix = hx & EXPMASK; + if (ix >= BIAS + 13) { /* |x| >= 8192 or x is NaN */ + if (ix == BIAS + LDBL_MAX_EXP) { + if (u.xbits.manh != 0 + || u.xbits.manl != 0 + || (hx & 0x8000) == 0) + return (x + x); /* x is NaN or +Inf */ + else + return (0.0); /* x is -Inf */ + } + if (x > o_threshold) + return (huge * huge); + if (x < u_threshold) + return (tiny * tiny); + } else if (ix <= BIAS - 115) { /* |x| < 0x1p-33 */ + /* includes pseudo-denormals */ + if (huge + x > 1.0L) /* trigger inexact iff x != 0 */ + return (1.0L + x); + } + + fn = x * INV_L + 0x1.8p112 - 0x1.8p112; + n = (int)fn; + n2 = (unsigned)n % NUM; /* Tang's j. */ + k = (n - n2) / NUM; + r1 = x - fn * L1; + r2 = -fn * L2; + + /* Prepare scale factors. */ + v.xbits.manh = 0; + v.xbits.manl = 0; + if (k >= LDBL_MIN_EXP) { + v.xbits.expsign = BIAS + k; + twopk = v.e; + } else { + v.xbits.expsign = BIAS + k + 10000; + twopkp10000 = v.e; + } + + r = r1 + r2; + q = r * r * (P2 + r * (P3 + r * (P4 + r * (P5 + r * (P6 + r * (P7 + + r * (P8 + r * (P9 + r * (P10 + r * P11))))))))); + t = s[n2].lo + s[n2].hi; + t = s[n2].hi + (s[n2].lo + t * (r2 + q + r1)); + + /* Scale by 2**k. */ + if (k >= LDBL_MIN_EXP) { + if (k == LDBL_MAX_EXP) + return (t * 2.0L * 0x1p16383L); + return (t * twopk); + } else { + return (t * twopkp10000 * twom10000); + } +} Added: head/lib/msun/ld80/s_expl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/ld80/s_expl.c Mon Jul 23 19:13:55 2012 (r238722) @@ -0,0 +1,304 @@ +/*- + * Copyright (c) 2009-2012 Steven G. Kargl + * 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 unmodified, 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, + * 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. + * + * Optimized by Bruce D. Evans. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Compute the exponential of x for Intel 80-bit format. This is based on: + * + * PTP Tang, "Table-driven implementation of the exponential function + * in IEEE floating-point arithmetic," ACM Trans. Math. Soft., 15, + * 144-157 (1989). + * + * where the 32 table entries have been expanded to NUM (see below). + */ + +#include + +#ifdef __i386__ +#include +#endif + +#include "math.h" +#define FPSETPREC +#ifdef NO_FPSETPREC +#undef FPSETPREC +#endif +#include "math_private.h" +#include "fpmath.h" + +#define BIAS (LDBL_MAX_EXP - 1) + +static const long double +huge = 0x1p10000L, +twom10000 = 0x1p-10000L; +/* XXX Prevent gcc from erroneously constant folding this: */ +static volatile const long double tiny = 0x1p-10000L; + +static const union IEEEl2bits +/* log(2**16384 - 0.5) rounded towards zero: */ +o_threshold = LD80C(0xb17217f7d1cf79ab, 13, 0, 11356.5234062941439488L), +/* log(2**(-16381-64-1)) rounded towards zero: */ +u_threshold = LD80C(0xb21dfe7f09e2baa9, 13, 1, -11399.4985314888605581L); + +static const double __aligned(64) +/* + * ln2/NUM = L1+L2 (hi+lo decomposition for multiplication). L1 must have + * at least 22 (= log2(|LDBL_MIN_EXP-extras|) + log2(NUM)) lowest bits zero + * so that multiplication of it by n is exact. + */ +L1 = 5.4152123484527692e-3, /* 0x162e42ff000000.0p-60 */ +L2 = -3.2819649005320973e-13, /* -0x1718432a1b0e26.0p-94 */ +INV_L = 1.8466496523378731e+2, /* 0x171547652b82fe.0p-45 */ +/* + * Domain [-0.002708, 0.002708], range ~[-5.7136e-24, 5.7110e-24]: + * |exp(x) - p(x)| < 2**-77.2 + * (0.002708 is ln2/(2*NUM) rounded up a little). + */ +P2 = 0.5, +P3 = 1.6666666666666119e-1, /* 0x15555555555490.0p-55 */ +P4 = 4.1666666666665887e-2, /* 0x155555555554e5.0p-57 */ +P5 = 8.3333354987869413e-3, /* 0x1111115b789919.0p-59 */ +P6 = 1.3888891738560272e-3; /* 0x16c16c651633ae.0p-62 */ + +/* + * 2^(i/NUM) for i in [0,NUM] is represented by two values where the + * first 47 (?!) bits of the significand is stored in hi and the next 53 + * bits are in lo. + */ +#define NUM 128 + +static const struct { + double hi; + double lo; +} s[NUM] __aligned(16) = { + 0x1p+0, 0x0p+0, + 0x1.0163da9fb330p+0, 0x1.ab6c25335719bp-47, + 0x1.02c9a3e77804p+0, 0x1.07737be56527cp-47, + 0x1.04315e86e7f8p+0, 0x1.2f5ce3e688369p-50, + 0x1.059b0d315854p+0, 0x1.a1d73e2a475b4p-47, + 0x1.0706b29ddf6cp+0, 0x1.dc6dc403a9d88p-48, + 0x1.0874518759bcp+0, 0x1.01186be4bb285p-49, + 0x1.09e3ecac6f38p+0, 0x1.a290f03062c27p-51, + 0x1.0b5586cf9890p+0, 0x1.ec5317256e308p-49, + 0x1.0cc922b7247cp+0, 0x1.ba03db82dc49fp-47, + 0x1.0e3ec32d3d18p+0, 0x1.10103a1727c58p-47, + 0x1.0fb66affed30p+0, 0x1.af232091dd8a1p-48, + 0x1.11301d0125b4p+0, 0x1.0a4ebbf1aed93p-48, + 0x1.12abdc06c31cp+0, 0x1.7f72575a649adp-49, + 0x1.1429aaea92dcp+0, 0x1.fb34101943b26p-48, + 0x1.15a98c8a58e4p+0, 0x1.12480d573dd56p-48, + 0x1.172b83c7d514p+0, 0x1.d6e6fbe462876p-47, + 0x1.18af9388c8dcp+0, 0x1.4dddfb85cd1e1p-47, + 0x1.1a35beb6fcb4p+0, 0x1.a9e5b4c7b4969p-47, + 0x1.1bbe084045ccp+0, 0x1.39ab1e72b4428p-48, + 0x1.1d4873168b98p+0, 0x1.53c02dc0144c8p-47, + 0x1.1ed5022fcd90p+0, 0x1.cb8819ff61122p-48, + 0x1.2063b88628ccp+0, 0x1.63b8eeb029509p-48, + 0x1.21f49917ddc8p+0, 0x1.62552fd29294cp-48, + 0x1.2387a6e75620p+0, 0x1.c3360fd6d8e0bp-47, + 0x1.251ce4fb2a60p+0, 0x1.f9ac155bef4f5p-47, + 0x1.26b4565e27ccp+0, 0x1.d257a673281d4p-48, + 0x1.284dfe1f5638p+0, 0x1.2d9e2b9e07941p-53, + 0x1.29e9df51fdecp+0, 0x1.09612e8afad12p-47, + 0x1.2b87fd0dad98p+0, 0x1.ffbbd48ca71f9p-49, + 0x1.2d285a6e4030p+0, 0x1.680123aa6da0fp-49, + 0x1.2ecafa93e2f4p+0, 0x1.611ca0f45d524p-48, + 0x1.306fe0a31b70p+0, 0x1.52de8d5a46306p-48, + 0x1.32170fc4cd80p+0, 0x1.89a9ce78e1804p-47, + 0x1.33c08b26416cp+0, 0x1.fa64e43086cb3p-47, + 0x1.356c55f929fcp+0, 0x1.864a311a3b1bap-47, + 0x1.371a7373aa9cp+0, 0x1.54e28aa05e8a9p-49, + 0x1.38cae6d05d84p+0, 0x1.2c2d4e586cdf7p-47, + 0x1.3a7db34e59fcp+0, 0x1.b750de494cf05p-47, + 0x1.3c32dc313a8cp+0, 0x1.242000f9145acp-47, + 0x1.3dea64c12340p+0, 0x1.11ada0911f09fp-47, + 0x1.3fa4504ac800p+0, 0x1.ba0bf701aa418p-48, + 0x1.4160a21f72e0p+0, 0x1.4fc2192dc79eep-47, + 0x1.431f5d950a88p+0, 0x1.6dc704439410dp-48, + 0x1.44e086061890p+0, 0x1.68189b7a04ef8p-47, + 0x1.46a41ed1d004p+0, 0x1.772512f45922ap-48, + 0x1.486a2b5c13ccp+0, 0x1.013c1a3b69063p-48, + 0x1.4a32af0d7d3cp+0, 0x1.e672d8bcf46f9p-48, + 0x1.4bfdad5362a0p+0, 0x1.38ea1cbd7f621p-47, + 0x1.4dcb299fddd0p+0, 0x1.ac766dde353c2p-49, + 0x1.4f9b2769d2c8p+0, 0x1.35699ec5b4d50p-47, + 0x1.516daa2cf664p+0, 0x1.c112f52c84d82p-52, + 0x1.5342b569d4f8p+0, 0x1.df0a83c49d86ap-52, + 0x1.551a4ca5d920p+0, 0x1.d8a5d8c40486ap-49, + 0x1.56f4736b527cp+0, 0x1.a66ecb004764fp-48, + 0x1.58d12d497c7cp+0, 0x1.e9295e15b9a1ep-47, + 0x1.5ab07dd48540p+0, 0x1.4ac64980a8c8fp-47, + 0x1.5c9268a59468p+0, 0x1.b80e258dc0b4cp-47, + 0x1.5e76f15ad214p+0, 0x1.0dd37c9840733p-49, + 0x1.605e1b976dc0p+0, 0x1.160edeb25490ep-49, + 0x1.6247eb03a558p+0, 0x1.2c7c3e81bf4b7p-50, + 0x1.6434634ccc30p+0, 0x1.fc76f8714c4eep-48, + 0x1.662388255220p+0, 0x1.24893ecf14dc8p-47, + 0x1.68155d44ca94p+0, 0x1.9840e2b913dd0p-47, + 0x1.6a09e667f3bcp+0, 0x1.921165f626cddp-49, + 0x1.6c012750bda8p+0, 0x1.f76bb54cc007ap-47, + 0x1.6dfb23c651a0p+0, 0x1.779107165f0dep-47, + 0x1.6ff7df951948p+0, 0x1.e7c3f0da79f11p-51, + 0x1.71f75e8ec5f4p+0, 0x1.9ee91b8797785p-47, + 0x1.73f9a48a5814p+0, 0x1.9deae4d273456p-47, + 0x1.75feb564267cp+0, 0x1.17edd35467491p-49, + 0x1.780694fde5d0p+0, 0x1.fb0cd7014042cp-47, + 0x1.7a11473eb018p+0, 0x1.b5f54408fdb37p-50, + 0x1.7c1ed0130c10p+0, 0x1.93e2499a22c9cp-47, + 0x1.7e2f336cf4e4p+0, 0x1.1082e815d0abdp-47, + 0x1.80427543e1a0p+0, 0x1.1b60de67649a3p-48, + 0x1.82589994cce0p+0, 0x1.28acf88afab35p-48, + 0x1.8471a4623c78p+0, 0x1.667297b5cbe32p-47, + 0x1.868d99b4492cp+0, 0x1.640720ec85613p-47, + 0x1.88ac7d98a668p+0, 0x1.966530bcdf2d5p-48, + 0x1.8ace5422aa0cp+0, 0x1.b5ba7c55a192dp-48, + 0x1.8cf3216b5448p+0, 0x1.7de55439a2c39p-49, + 0x1.8f1ae9915770p+0, 0x1.b15cc13a2e397p-47, + 0x1.9145b0b91ffcp+0, 0x1.622986d1a7daep-50, + 0x1.93737b0cdc5cp+0, 0x1.27a280e1f92a0p-47, + 0x1.95a44cbc8520p+0, 0x1.dd36906d2b420p-49, + 0x1.97d829fde4e4p+0, 0x1.f173d241f23d1p-49, + 0x1.9a0f170ca078p+0, 0x1.cdd1884dc6234p-47, + 0x1.9c49182a3f08p+0, 0x1.01c7c46b071f3p-48, + 0x1.9e86319e3230p+0, 0x1.18c12653c7326p-47, + 0x1.a0c667b5de54p+0, 0x1.2594d6d45c656p-47, + 0x1.a309bec4a2d0p+0, 0x1.9ac60b8fbb86dp-47, + 0x1.a5503b23e254p+0, 0x1.c8b424491caf8p-48, + 0x1.a799e1330b34p+0, 0x1.86f2dfb2b158fp-48, + 0x1.a9e6b5579fd8p+0, 0x1.fa1f5921deffap-47, + 0x1.ac36bbfd3f34p+0, 0x1.ce06dcb351893p-47, + 0x1.ae89f995ad38p+0, 0x1.6af439a68bb99p-47, + 0x1.b0e07298db64p+0, 0x1.2c8421566fe38p-47, + 0x1.b33a2b84f15cp+0, 0x1.d7b5fe873decap-47, + 0x1.b59728de5590p+0, 0x1.cc71c40888b24p-47, + 0x1.b7f76f2fb5e4p+0, 0x1.baa9ec206ad4fp-50, + 0x1.ba5b030a1064p+0, 0x1.30819678d5eb7p-49, + 0x1.bcc1e904bc1cp+0, 0x1.2247ba0f45b3dp-48, + 0x1.bf2c25bd71e0p+0, 0x1.10811ae04a31cp-49, + 0x1.c199bdd85528p+0, 0x1.c2220cb12a092p-48, + 0x1.c40ab5fffd04p+0, 0x1.d368a6fc1078cp-47, + 0x1.c67f12e57d14p+0, 0x1.694426ffa41e5p-49, + 0x1.c8f6d9406e78p+0, 0x1.a88d65e24402ep-47, + 0x1.cb720dcef904p+0, 0x1.48a81e5e8f4a5p-47, + 0x1.cdf0b555dc3cp+0, 0x1.ce227c4ac7d63p-47, + 0x1.d072d4a07894p+0, 0x1.dc68791790d0bp-47, + 0x1.d2f87080d89cp+0, 0x1.8c56f091cc4f5p-47, + 0x1.d5818dcfba48p+0, 0x1.c976816bad9b8p-50, + 0x1.d80e316c9838p+0, 0x1.7bb84f9d04880p-48, + 0x1.da9e603db328p+0, 0x1.5c2300696db53p-50, + 0x1.dd321f301b44p+0, 0x1.025b4aef1e032p-47, + 0x1.dfc97337b9b4p+0, 0x1.eb968cac39ed3p-48, + 0x1.e264614f5a10p+0, 0x1.45093b0fd0bd7p-47, + 0x1.e502ee78b3fcp+0, 0x1.b139e8980a9cdp-47, + 0x1.e7a51fbc74c8p+0, 0x1.a5aa4594191bcp-51, + 0x1.ea4afa2a490cp+0, 0x1.9858f73a18f5ep-48, + 0x1.ecf482d8e67cp+0, 0x1.846d81897dca5p-47, + 0x1.efa1bee615a0p+0, 0x1.3bb8fe90d496dp-47, + 0x1.f252b376bba8p+0, 0x1.74e8696fc3639p-48, + 0x1.f50765b6e454p+0, 0x1.9d3e12dd8a18bp-54, + 0x1.f7bfdad9cbe0p+0, 0x1.38913b4bfe72cp-48, + 0x1.fa7c1819e90cp+0, 0x1.82e90a7e74b26p-48, + 0x1.fd3c22b8f71cp+0, 0x1.884badd25995ep-47 +}; + +long double +expl(long double x) +{ + union IEEEl2bits u, v; + long double fn, r, r1, r2, q, t, t23, t45, twopk, twopkp10000, z; + int k, n, n2; + uint16_t hx, ix; + + /* Filter out exceptional cases. */ + u.e = x; + hx = u.xbits.expsign; + ix = hx & 0x7fff; + if (ix >= BIAS + 13) { /* |x| >= 8192 or x is NaN */ + if (ix == BIAS + LDBL_MAX_EXP) { + if (hx & 0x8000 && u.xbits.man == 1ULL << 63) + return (0.0L); /* x is -Inf */ + return (x + x); /* x is +Inf, NaN or unsupported */ + } + if (x > o_threshold.e) + return (huge * huge); + if (x < u_threshold.e) + return (tiny * tiny); + } else if (ix <= BIAS - 34) { /* |x| < 0x1p-33 */ + /* includes pseudo-denormals */ + if (huge + x > 1.0L) /* trigger inexact iff x != 0 */ + return (1.0L + x); + } + + ENTERI(); + + /* Reduce x to (k*ln2 + midpoint[n2] + r1 + r2). */ + /* Use a specialized rint() to get fn. Assume round-to-nearest. */ + fn = x * INV_L + 0x1.8p63 - 0x1.8p63; + r = x - fn * L1 - fn * L2; /* r = r1 + r2 done independently. */ +#if defined(HAVE_EFFICIENT_IRINTL) + n = irintl(fn); +#elif defined(HAVE_EFFICIENT_IRINT) + n = irint(fn); +#else + n = (int)fn; +#endif + n2 = (unsigned)n % NUM; /* Tang's j. */ + k = (n - n2) / NUM; + r1 = x - fn * L1; + r2 = -fn * L2; + + /* Prepare scale factors. */ + v.xbits.man = 1ULL << 63; + if (k >= LDBL_MIN_EXP) { + v.xbits.expsign = BIAS + k; + twopk = v.e; + } else { + v.xbits.expsign = BIAS + k + 10000; + twopkp10000 = v.e; + } + + /* Evaluate expl(midpoint[n2] + r1 + r2) = s[n2] * expl(r1 + r2). */ + /* Here q = q(r), not q(r1), since r1 is lopped like L1. */ + t45 = r * P5 + P4; + z = r * r; + t23 = r * P3 + P2; + q = r2 + z * t23 + z * z * t45 + z * z * z * P6; + t = (long double)s[n2].lo + s[n2].hi; + t = s[n2].lo + t * (q + r1) + s[n2].hi; + + /* Scale by 2**k. */ + if (k >= LDBL_MIN_EXP) { + if (k == LDBL_MAX_EXP) + RETURNI(t * 2.0L * 0x1p16383L); + RETURNI(t * twopk); + } else { + RETURNI(t * twopkp10000 * twom10000); + } +} Modified: head/lib/msun/man/exp.3 ============================================================================== --- head/lib/msun/man/exp.3 Mon Jul 23 16:36:13 2012 (r238721) +++ head/lib/msun/man/exp.3 Mon Jul 23 19:13:55 2012 (r238722) @@ -28,13 +28,14 @@ .\" from: @(#)exp.3 6.12 (Berkeley) 7/31/91 .\" $FreeBSD$ .\" -.Dd January 17, 2008 +.Dd July 10, 2012 .Dt EXP 3 .Os .Sh NAME .Nm exp , .Nm expf , -.\" The sorting error is intentional. exp and expf should be adjacent. +.Nm expl , +.\" The sorting error is intentional. exp, expf, and expl should be adjacent. .Nm exp2 , .Nm exp2f , .Nm exp2l , @@ -51,6 +52,8 @@ .Fn exp "double x" .Ft float .Fn expf "float x" +.Ft long double +.Fn expl "long double x" .Ft double .Fn exp2 "double x" .Ft float @@ -67,9 +70,10 @@ .Fn powf "float x" "float y" .Sh DESCRIPTION The -.Fn exp -and the -.Fn expf +.Fn exp , +.Fn expf , +and +.Fn expl functions compute the base .Ms e exponential value of the given argument Modified: head/lib/msun/src/e_exp.c ============================================================================== --- head/lib/msun/src/e_exp.c Mon Jul 23 16:36:13 2012 (r238721) +++ head/lib/msun/src/e_exp.c Mon Jul 23 19:13:55 2012 (r238722) @@ -158,3 +158,7 @@ __ieee754_exp(double x) /* default IEEE return y*twopk*twom1000; } } + +#if (LDBL_MANT_DIG == 53) +__weak_reference(exp, expl); +#endif Modified: head/lib/msun/src/math.h ============================================================================== --- head/lib/msun/src/math.h Mon Jul 23 16:36:13 2012 (r238721) +++ head/lib/msun/src/math.h Mon Jul 23 19:13:55 2012 (r238722) @@ -404,6 +404,7 @@ long double ceill(long double); long double copysignl(long double, long double) __pure2; long double cosl(long double); long double exp2l(long double); +long double expl(long double); long double fabsl(long double) __pure2; long double fdiml(long double, long double); long double floorl(long double); @@ -461,7 +462,6 @@ long double atanhl(long double); long double coshl(long double); long double erfcl(long double); long double erfl(long double); -long double expl(long double); long double expm1l(long double); long double lgammal(long double); long double log10l(long double); Modified: head/lib/msun/src/math_private.h ============================================================================== --- head/lib/msun/src/math_private.h Mon Jul 23 16:36:13 2012 (r238721) +++ head/lib/msun/src/math_private.h Mon Jul 23 19:13:55 2012 (r238722) @@ -207,6 +207,13 @@ do { \ (d) = se_u.e; \ } while (0) +/* Long double constants are broken on i386. This workaround is OK always. */ +#define LD80C(m, ex, s, v) { \ + /* .e = v, */ /* overwritten */ \ + .xbits.man = __CONCAT(m, ULL), \ + .xbits.expsign = (0x3fff + (ex)) | ((s) ? 0x8000 : 0), \ +} + #ifdef FLT_EVAL_METHOD /* * Attempt to get strict C99 semantics for assignment with non-C99 compilers. @@ -225,8 +232,30 @@ do { \ } \ } while (0) #endif +#endif /* FLT_EVAL_METHOD */ + +/* Support switching the mode to FP_PE if necessary. */ +#if defined(__i386__) && !defined(NO_FPSETPREC) +#define ENTERI() \ + long double __retval; \ + fp_prec_t __oprec; \ + \ + if ((__oprec = fpgetprec()) != FP_PE) \ + fpsetprec(FP_PE); +#define RETURNI(x) do { \ + __retval = (x); \ + if (__oprec != FP_PE) \ + fpsetprec(__oprec); \ + RETURNF(__retval); \ +} while (0) +#else +#define ENTERI(x) +#define RETURNI(x) RETURNF(x) #endif +/* Default return statement if hack*_t() is not used. */ +#define RETURNF(v) return (v) + /* * Common routine to process the arguments to nan(), nanf(), and nanl(). */ @@ -323,6 +352,18 @@ irint(double x) #define HAVE_EFFICIENT_IRINT #endif +#if defined(__amd64__) || defined(__i386__) +static __inline int +irintl(long double x) +{ + int n; + + asm("fistl %0" : "=m" (n) : "t" (x)); + return (n); +} +#define HAVE_EFFICIENT_IRINTL +#endif + #endif /* __GNUCLIKE_ASM */ /* From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 19:16:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F8C4106566C; Mon, 23 Jul 2012 19:16:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A4E88FC16; Mon, 23 Jul 2012 19:16:32 +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 q6NJGVQM040582; Mon, 23 Jul 2012 19:16:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6NJGVap040580; Mon, 23 Jul 2012 19:16:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207231916.q6NJGVap040580@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 23 Jul 2012 19:16:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238723 - head/sys/amd64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 19:16:32 -0000 Author: kib Date: Mon Jul 23 19:16:31 2012 New Revision: 238723 URL: http://svn.freebsd.org/changeset/base/238723 Log: Forcibly shut up clang warning about NULL pointer dereference. MFC after: 3 weeks Modified: head/sys/amd64/include/pcpu.h Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Mon Jul 23 19:13:55 2012 (r238722) +++ head/sys/amd64/include/pcpu.h Mon Jul 23 19:16:31 2012 (r238723) @@ -217,6 +217,10 @@ extern struct pcpu *pcpup; #define PCPU_SET(member, val) __PCPU_SET(pc_ ## member, val) #define OFFSETOF_CURTHREAD 0 +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnull-dereference" +#endif static __inline __pure2 struct thread * __curthread(void) { @@ -226,6 +230,9 @@ __curthread(void) : "m" (*(char *)OFFSETOF_CURTHREAD)); return (td); } +#ifdef __clang__ +#pragma clang diagnostic pop +#endif #define curthread (__curthread()) #define OFFSETOF_CURPCB 32 From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 19:23:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 98533106566B; Mon, 23 Jul 2012 19:23:50 +0000 (UTC) (envelope-from kargl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 836708FC14; Mon, 23 Jul 2012 19:23: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 q6NJNoeW041189; Mon, 23 Jul 2012 19:23:50 GMT (envelope-from kargl@svn.freebsd.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6NJNo0O041187; Mon, 23 Jul 2012 19:23:50 GMT (envelope-from kargl@svn.freebsd.org) Message-Id: <201207231923.q6NJNo0O041187@svn.freebsd.org> From: Steve Kargl Date: Mon, 23 Jul 2012 19:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238724 - head/lib/msun X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 19:23:50 -0000 Author: kargl Date: Mon Jul 23 19:23:49 2012 New Revision: 238724 URL: http://svn.freebsd.org/changeset/base/238724 Log: Hook ld80/s_expl.c or ld128/s_expl.c into the building of libm. PR: standards/152415 Approved by: das (mentor) Modified: head/lib/msun/Makefile Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Mon Jul 23 19:16:31 2012 (r238723) +++ head/lib/msun/Makefile Mon Jul 23 19:23:49 2012 (r238724) @@ -94,7 +94,7 @@ COMMON_SRCS+= e_acosl.c e_asinl.c e_atan e_hypotl.c e_remainderl.c e_sqrtl.c \ invtrig.c k_cosl.c k_sinl.c k_tanl.c \ s_atanl.c s_cbrtl.c s_ceill.c s_cosl.c s_cprojl.c \ - s_csqrtl.c s_exp2l.c s_floorl.c s_fmal.c \ + s_csqrtl.c s_exp2l.c s_expl.c s_floorl.c s_fmal.c \ s_frexpl.c s_logbl.c s_nanl.c s_nextafterl.c s_nexttoward.c \ s_remquol.c s_rintl.c s_scalbnl.c \ s_sinl.c s_tanl.c s_truncl.c w_cabsl.c From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 20:20:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C49F7106564A; Mon, 23 Jul 2012 20:20:01 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A81088FC08; Mon, 23 Jul 2012 20:20:01 +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 q6NKK1g5045908; Mon, 23 Jul 2012 20:20:01 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6NKK1oM045903; Mon, 23 Jul 2012 20:20:01 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207232020.q6NKK1oM045903@svn.freebsd.org> From: Martin Matuska Date: Mon, 23 Jul 2012 20:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238725 - in vendor/illumos/dist: cmd/zhack cmd/zpool lib/libzfs/common man/man1m X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 20:20:01 -0000 Author: mm Date: Mon Jul 23 20:20:00 2012 New Revision: 238725 URL: http://svn.freebsd.org/changeset/base/238725 Log: Update vendor/illumos to illumos-gate 13753:2aba784c276b Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Modified: vendor/illumos/dist/cmd/zhack/zhack.c vendor/illumos/dist/cmd/zpool/zpool_main.c vendor/illumos/dist/lib/libzfs/common/libzfs.h vendor/illumos/dist/lib/libzfs/common/libzfs_status.c vendor/illumos/dist/man/man1m/zpool.1m Modified: vendor/illumos/dist/cmd/zhack/zhack.c ============================================================================== --- vendor/illumos/dist/cmd/zhack/zhack.c Mon Jul 23 19:23:49 2012 (r238724) +++ vendor/illumos/dist/cmd/zhack/zhack.c Mon Jul 23 20:20:00 2012 (r238725) @@ -280,7 +280,7 @@ feature_enable_sync(void *arg1, void *ar spa_feature_enable(spa, feature, tx); spa_history_log_internal(spa, "zhack enable feature", tx, - "name=%s can_readonly=%u", + "guid=%s can_readonly=%u", feature->fi_guid, feature->fi_can_readonly); } @@ -360,7 +360,7 @@ feature_incr_sync(void *arg1, void *arg2 spa_feature_incr(spa, feature, tx); spa_history_log_internal(spa, "zhack feature incr", tx, - "name=%s", feature->fi_guid); + "guid=%s", feature->fi_guid); } static void @@ -371,7 +371,7 @@ feature_decr_sync(void *arg1, void *arg2 spa_feature_decr(spa, feature, tx); spa_history_log_internal(spa, "zhack feature decr", tx, - "name=%s", feature->fi_guid); + "guid=%s", feature->fi_guid); } static void Modified: vendor/illumos/dist/cmd/zpool/zpool_main.c ============================================================================== --- vendor/illumos/dist/cmd/zpool/zpool_main.c Mon Jul 23 19:23:49 2012 (r238724) +++ vendor/illumos/dist/cmd/zpool/zpool_main.c Mon Jul 23 20:20:00 2012 (r238725) @@ -381,6 +381,18 @@ print_vdev_tree(zpool_handle_t *zhp, con } } +static boolean_t +prop_list_contains_feature(nvlist_t *proplist) +{ + nvpair_t *nvp; + for (nvp = nvlist_next_nvpair(proplist, NULL); NULL != nvp; + nvp = nvlist_next_nvpair(proplist, nvp)) { + if (zpool_prop_feature(nvpair_name(nvp))) + return (B_TRUE); + } + return (B_FALSE); +} + /* * Add a property pair (name, string-value) into a property nvlist. */ @@ -404,12 +416,30 @@ add_prop_list(const char *propname, char proplist = *props; if (poolprop) { + const char *vname = zpool_prop_to_name(ZPOOL_PROP_VERSION); + if ((prop = zpool_name_to_prop(propname)) == ZPROP_INVAL && !zpool_prop_feature(propname)) { (void) fprintf(stderr, gettext("property '%s' is " "not a valid pool property\n"), propname); return (2); } + + /* + * feature@ properties and version should not be specified + * at the same time. + */ + if ((prop == ZPROP_INVAL && zpool_prop_feature(propname) && + nvlist_exists(proplist, vname)) || + (prop == ZPOOL_PROP_VERSION && + prop_list_contains_feature(proplist))) { + (void) fprintf(stderr, gettext("'feature@' and " + "'version' properties cannot be specified " + "together\n")); + return (2); + } + + if (zpool_prop_feature(propname)) normnm = propname; else @@ -1461,8 +1491,8 @@ show_import(nvlist_t *config) break; case ZPOOL_STATUS_VERSION_OLDER: - (void) printf(gettext(" status: The pool is formatted using an " - "older on-disk version.\n")); + (void) printf(gettext(" status: The pool is formatted using a " + "legacy on-disk version.\n")); break; case ZPOOL_STATUS_VERSION_NEWER: @@ -1470,6 +1500,11 @@ show_import(nvlist_t *config) "incompatible version.\n")); break; + case ZPOOL_STATUS_FEAT_DISABLED: + (void) printf(gettext(" status: Some supported features are " + "not enabled on the pool.\n")); + break; + case ZPOOL_STATUS_UNSUP_FEAT_READ: (void) printf(gettext("status: The pool uses the following " "feature(s) not supported on this sytem:\n")); @@ -1516,19 +1551,21 @@ show_import(nvlist_t *config) * Print out an action according to the overall state of the pool. */ if (vs->vs_state == VDEV_STATE_HEALTHY) { - if (reason == ZPOOL_STATUS_VERSION_OLDER) + if (reason == ZPOOL_STATUS_VERSION_OLDER || + reason == ZPOOL_STATUS_FEAT_DISABLED) { (void) printf(gettext(" action: The pool can be " "imported using its name or numeric identifier, " "though\n\tsome features will not be available " "without an explicit 'zpool upgrade'.\n")); - else if (reason == ZPOOL_STATUS_HOSTID_MISMATCH) + } else if (reason == ZPOOL_STATUS_HOSTID_MISMATCH) { (void) printf(gettext(" action: The pool can be " "imported using its name or numeric " "identifier and\n\tthe '-f' flag.\n")); - else + } else { (void) printf(gettext(" action: The pool can be " "imported using its name or numeric " "identifier.\n")); + } } else if (vs->vs_state == VDEV_STATE_DEGRADED) { (void) printf(gettext(" action: The pool can be imported " "despite missing or damaged devices. The\n\tfault " @@ -3986,12 +4023,13 @@ status_callback(zpool_handle_t *zhp, voi break; case ZPOOL_STATUS_VERSION_OLDER: - (void) printf(gettext("status: The pool is formatted using an " - "older on-disk format. The pool can\n\tstill be used, but " - "some features are unavailable.\n")); + (void) printf(gettext("status: The pool is formatted using a " + "legacy on-disk format. The pool can\n\tstill be used, " + "but some features are unavailable.\n")); (void) printf(gettext("action: Upgrade the pool using 'zpool " "upgrade'. Once this is done, the\n\tpool will no longer " - "be accessible on older software versions.\n")); + "be accessible on software that does not support feature\n" + "\tflags.\n")); break; case ZPOOL_STATUS_VERSION_NEWER: @@ -4003,6 +4041,16 @@ status_callback(zpool_handle_t *zhp, voi "backup.\n")); break; + case ZPOOL_STATUS_FEAT_DISABLED: + (void) printf(gettext("status: Some supported features are not " + "enabled on the pool. The pool can\n\tstill be used, but " + "some features are unavailable.\n")); + (void) printf(gettext("action: Enable all features using " + "'zpool upgrade'. Once this is done,\n\tthe pool may no " + "longer be accessible by software that does not support\n\t" + "the features. See zpool-features(5) for details.\n")); + break; + case ZPOOL_STATUS_UNSUP_FEAT_READ: (void) printf(gettext("status: The pool cannot be accessed on " "this system because it uses the\n\tfollowing feature(s) " @@ -4232,66 +4280,153 @@ zpool_do_status(int argc, char **argv) } typedef struct upgrade_cbdata { - int cb_all; int cb_first; - int cb_newer; int cb_argc; uint64_t cb_version; char **cb_argv; } upgrade_cbdata_t; static int +upgrade_version(zpool_handle_t *zhp, uint64_t version) +{ + int ret; + nvlist_t *config; + uint64_t oldversion; + + config = zpool_get_config(zhp, NULL); + verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION, + &oldversion) == 0); + + assert(SPA_VERSION_IS_SUPPORTED(oldversion)); + assert(oldversion < version); + + ret = zpool_upgrade(zhp, version); + if (ret != 0) + return (ret); + + if (version >= SPA_VERSION_FEATURES) { + (void) printf(gettext("Successfully upgraded " + "'%s' from version %llu to feature flags.\n"), + zpool_get_name(zhp), oldversion); + } else { + (void) printf(gettext("Successfully upgraded " + "'%s' from version %llu to version %llu.\n"), + zpool_get_name(zhp), oldversion, version); + } + + return (0); +} + +static int +upgrade_enable_all(zpool_handle_t *zhp, int *countp) +{ + int i, ret, count; + boolean_t firstff = B_TRUE; + nvlist_t *enabled = zpool_get_features(zhp); + + count = 0; + for (i = 0; i < SPA_FEATURES; i++) { + const char *fname = spa_feature_table[i].fi_uname; + const char *fguid = spa_feature_table[i].fi_guid; + if (!nvlist_exists(enabled, fguid)) { + char *propname; + verify(-1 != asprintf(&propname, "feature@%s", fname)); + ret = zpool_set_prop(zhp, propname, + ZFS_FEATURE_ENABLED); + if (ret != 0) { + free(propname); + return (ret); + } + count++; + + if (firstff) { + (void) printf(gettext("Enabled the " + "following features on '%s':\n"), + zpool_get_name(zhp)); + firstff = B_FALSE; + } + (void) printf(gettext(" %s\n"), fname); + free(propname); + } + } + + if (countp != NULL) + *countp = count; + return (0); +} + +static int upgrade_cb(zpool_handle_t *zhp, void *arg) { upgrade_cbdata_t *cbp = arg; nvlist_t *config; uint64_t version; - int ret = 0; + boolean_t printnl = B_FALSE; + int ret; config = zpool_get_config(zhp, NULL); verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION, &version) == 0); - if (!cbp->cb_newer && SPA_VERSION_IS_SUPPORTED(version) && - version != SPA_VERSION) { - if (!cbp->cb_all) { - if (cbp->cb_first) { - (void) printf(gettext("The following pools are " - "out of date, and can be upgraded. After " - "being\nupgraded, these pools will no " - "longer be accessible by older software " - "versions.\n\n")); - (void) printf(gettext("VER POOL\n")); - (void) printf(gettext("--- ------------\n")); - cbp->cb_first = B_FALSE; - } + assert(SPA_VERSION_IS_SUPPORTED(version)); - (void) printf("%2llu %s\n", (u_longlong_t)version, - zpool_get_name(zhp)); - } else { + if (version < cbp->cb_version) { + cbp->cb_first = B_FALSE; + ret = upgrade_version(zhp, cbp->cb_version); + if (ret != 0) + return (ret); + printnl = B_TRUE; + + /* + * If they did "zpool upgrade -a", then we could + * be doing ioctls to different pools. We need + * to log this history once to each pool, and bypass + * the normal history logging that happens in main(). + */ + (void) zpool_log_history(g_zfs, history_str); + log_history = B_FALSE; + } + + if (cbp->cb_version >= SPA_VERSION_FEATURES) { + int count; + ret = upgrade_enable_all(zhp, &count); + if (ret != 0) + return (ret); + + if (count > 0) { cbp->cb_first = B_FALSE; - ret = zpool_upgrade(zhp, cbp->cb_version); - if (!ret) { - (void) printf(gettext("Successfully upgraded " - "'%s'\n\n"), zpool_get_name(zhp)); - } - /* - * If they did "zpool upgrade -a", then we could - * be doing ioctls to different pools. We need - * to log this history once to each pool, and bypass - * the normal history logging that happens in main(). - */ - (void) zpool_log_history(g_zfs, history_str); - log_history = B_FALSE; + printnl = B_TRUE; } - } else if (cbp->cb_newer && !SPA_VERSION_IS_SUPPORTED(version)) { - assert(!cbp->cb_all); + } + + if (printnl) { + (void) printf(gettext("\n")); + } + + return (0); +} +static int +upgrade_list_older_cb(zpool_handle_t *zhp, void *arg) +{ + upgrade_cbdata_t *cbp = arg; + nvlist_t *config; + uint64_t version; + + config = zpool_get_config(zhp, NULL); + verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION, + &version) == 0); + + assert(SPA_VERSION_IS_SUPPORTED(version)); + + if (version < SPA_VERSION_FEATURES) { if (cbp->cb_first) { (void) printf(gettext("The following pools are " - "formatted using an unsupported software version " - "and\ncannot be accessed on the current " - "system.\n\n")); + "formatted with legacy version numbers and can\n" + "be upgraded to use feature flags. After " + "being upgraded, these pools\nwill no " + "longer be accessible by software that does not " + "support feature\nflags.\n\n")); (void) printf(gettext("VER POOL\n")); (void) printf(gettext("--- ------------\n")); cbp->cb_first = B_FALSE; @@ -4301,14 +4436,65 @@ upgrade_cb(zpool_handle_t *zhp, void *ar zpool_get_name(zhp)); } - zpool_close(zhp); - return (ret); + return (0); +} + +static int +upgrade_list_disabled_cb(zpool_handle_t *zhp, void *arg) +{ + upgrade_cbdata_t *cbp = arg; + nvlist_t *config; + uint64_t version; + + config = zpool_get_config(zhp, NULL); + verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION, + &version) == 0); + + if (version >= SPA_VERSION_FEATURES) { + int i; + boolean_t poolfirst = B_TRUE; + nvlist_t *enabled = zpool_get_features(zhp); + + for (i = 0; i < SPA_FEATURES; i++) { + const char *fguid = spa_feature_table[i].fi_guid; + const char *fname = spa_feature_table[i].fi_uname; + if (!nvlist_exists(enabled, fguid)) { + if (cbp->cb_first) { + (void) printf(gettext("\nSome " + "supported features are not " + "enabled on the following pools. " + "Once a\nfeature is enabled the " + "pool may become incompatible with " + "software\nthat does not support " + "the feature. See " + "zpool-features(5) for " + "details.\n\n")); + (void) printf(gettext("POOL " + "FEATURE\n")); + (void) printf(gettext("------" + "---------\n")); + cbp->cb_first = B_FALSE; + } + + if (poolfirst) { + (void) printf(gettext("%s\n"), + zpool_get_name(zhp)); + poolfirst = B_FALSE; + } + + (void) printf(gettext(" %s\n"), fname); + } + } + } + + return (0); } /* ARGSUSED */ static int upgrade_one(zpool_handle_t *zhp, void *data) { + boolean_t printnl = B_FALSE; upgrade_cbdata_t *cbp = data; uint64_t cur_version; int ret; @@ -4323,26 +4509,45 @@ upgrade_one(zpool_handle_t *zhp, void *d cur_version = zpool_get_prop_int(zhp, ZPOOL_PROP_VERSION, NULL); if (cur_version > cbp->cb_version) { (void) printf(gettext("Pool '%s' is already formatted " - "using more current version '%llu'.\n"), + "using more current version '%llu'.\n\n"), zpool_get_name(zhp), cur_version); return (0); } - if (cur_version == cbp->cb_version) { + + if (cbp->cb_version != SPA_VERSION && cur_version == cbp->cb_version) { (void) printf(gettext("Pool '%s' is already formatted " - "using the current version.\n"), zpool_get_name(zhp)); + "using version %llu.\n\n"), zpool_get_name(zhp), + cbp->cb_version); return (0); } - ret = zpool_upgrade(zhp, cbp->cb_version); + if (cur_version != cbp->cb_version) { + printnl = B_TRUE; + ret = upgrade_version(zhp, cbp->cb_version); + if (ret != 0) + return (ret); + } + + if (cbp->cb_version >= SPA_VERSION_FEATURES) { + int count = 0; + ret = upgrade_enable_all(zhp, &count); + if (ret != 0) + return (ret); - if (!ret) { - (void) printf(gettext("Successfully upgraded '%s' " - "from version %llu to version %llu\n\n"), - zpool_get_name(zhp), (u_longlong_t)cur_version, - (u_longlong_t)cbp->cb_version); + if (count != 0) { + printnl = B_TRUE; + } else if (cur_version == SPA_VERSION) { + (void) printf(gettext("Pool '%s' already has all " + "supported features enabled.\n"), + zpool_get_name(zhp)); + } } - return (ret != 0); + if (printnl) { + (void) printf(gettext("\n")); + } + + return (0); } /* @@ -4361,6 +4566,7 @@ zpool_do_upgrade(int argc, char **argv) upgrade_cbdata_t cb = { 0 }; int ret = 0; boolean_t showversions = B_FALSE; + boolean_t upgradeall = B_FALSE; char *end; @@ -4368,7 +4574,7 @@ zpool_do_upgrade(int argc, char **argv) while ((c = getopt(argc, argv, ":avV:")) != -1) { switch (c) { case 'a': - cb.cb_all = B_TRUE; + upgradeall = B_TRUE; break; case 'v': showversions = B_TRUE; @@ -4401,19 +4607,19 @@ zpool_do_upgrade(int argc, char **argv) if (cb.cb_version == 0) { cb.cb_version = SPA_VERSION; - } else if (!cb.cb_all && argc == 0) { + } else if (!upgradeall && argc == 0) { (void) fprintf(stderr, gettext("-V option is " "incompatible with other arguments\n")); usage(B_FALSE); } if (showversions) { - if (cb.cb_all || argc != 0) { + if (upgradeall || argc != 0) { (void) fprintf(stderr, gettext("-v option is " "incompatible with other arguments\n")); usage(B_FALSE); } - } else if (cb.cb_all) { + } else if (upgradeall) { if (argc != 0) { (void) fprintf(stderr, gettext("-a option should not " "be used along with a pool name\n")); @@ -4423,9 +4629,25 @@ zpool_do_upgrade(int argc, char **argv) (void) printf(gettext("This system supports ZFS pool feature " "flags.\n\n")); - cb.cb_first = B_TRUE; if (showversions) { - (void) printf(gettext("The following versions are " + int i; + + (void) printf(gettext("The following features are " + "supported:\n\n")); + (void) printf(gettext("FEAT DESCRIPTION\n")); + (void) printf("----------------------------------------------" + "---------------\n"); + for (i = 0; i < SPA_FEATURES; i++) { + zfeature_info_t *fi = &spa_feature_table[i]; + const char *ro = fi->fi_can_readonly ? + " (read-only compatible)" : ""; + + (void) printf("%-37s%s\n", fi->fi_uname, ro); + (void) printf(" %s\n", fi->fi_desc); + } + (void) printf("\n"); + + (void) printf(gettext("The following legacy versions are also " "supported:\n\n")); (void) printf(gettext("VER DESCRIPTION\n")); (void) printf("--- -----------------------------------------" @@ -4468,32 +4690,44 @@ zpool_do_upgrade(int argc, char **argv) (void) printf(gettext("\nFor more information on a particular " "version, including supported releases,\n")); (void) printf(gettext("see the ZFS Administration Guide.\n\n")); - } else if (argc == 0) { - int notfound; - + } else if (argc == 0 && upgradeall) { + cb.cb_first = B_TRUE; ret = zpool_iter(g_zfs, upgrade_cb, &cb); - notfound = cb.cb_first; - - if (!cb.cb_all && ret == 0) { - if (!cb.cb_first) - (void) printf("\n"); - cb.cb_first = B_TRUE; - cb.cb_newer = B_TRUE; - ret = zpool_iter(g_zfs, upgrade_cb, &cb); - if (!cb.cb_first) { - notfound = B_FALSE; - (void) printf("\n"); + if (ret == 0 && cb.cb_first) { + if (cb.cb_version == SPA_VERSION) { + (void) printf(gettext("All pools are already " + "formatted using feature flags.\n\n")); + (void) printf(gettext("Every feature flags " + "pool already has all supported features " + "enabled.\n")); + } else { + (void) printf(gettext("All pools are already " + "formatted with version %llu or higher.\n"), + cb.cb_version); } } + } else if (argc == 0) { + cb.cb_first = B_TRUE; + ret = zpool_iter(g_zfs, upgrade_list_older_cb, &cb); + assert(ret == 0); + + if (cb.cb_first) { + (void) printf(gettext("All pools are formatted " + "using feature flags.\n\n")); + } else { + (void) printf(gettext("\nUse 'zpool upgrade -v' " + "for a list of available legacy versions.\n")); + } - if (ret == 0) { - if (notfound) - (void) printf(gettext("All pools are formatted " - "using this version.\n")); - else if (!cb.cb_all) - (void) printf(gettext("Use 'zpool upgrade -v' " - "for a list of available versions and " - "their associated\nfeatures.\n")); + cb.cb_first = B_TRUE; + ret = zpool_iter(g_zfs, upgrade_list_disabled_cb, &cb); + assert(ret == 0); + + if (cb.cb_first) { + (void) printf(gettext("Every feature flags pool has " + "all supported features enabled.\n")); + } else { + (void) printf(gettext("\n")); } } else { ret = for_each_pool(argc, argv, B_FALSE, NULL, Modified: vendor/illumos/dist/lib/libzfs/common/libzfs.h ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs.h Mon Jul 23 19:23:49 2012 (r238724) +++ vendor/illumos/dist/lib/libzfs/common/libzfs.h Mon Jul 23 20:20:00 2012 (r238725) @@ -316,7 +316,8 @@ typedef enum { * requiring administrative attention. There is no corresponding * message ID. */ - ZPOOL_STATUS_VERSION_OLDER, /* older on-disk version */ + ZPOOL_STATUS_VERSION_OLDER, /* older legacy on-disk version */ + ZPOOL_STATUS_FEAT_DISABLED, /* supported features are disabled */ ZPOOL_STATUS_RESILVERING, /* device being resilvered */ ZPOOL_STATUS_OFFLINE_DEV, /* device online */ ZPOOL_STATUS_REMOVED_DEV, /* removed device */ Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_status.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_status.c Mon Jul 23 19:23:49 2012 (r238724) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_status.c Mon Jul 23 20:20:00 2012 (r238725) @@ -44,6 +44,7 @@ #include #include #include "libzfs_impl.h" +#include "zfeature_common.h" /* * Message ID table. This must be kept in sync with the ZPOOL_STATUS_* defines @@ -319,6 +320,30 @@ check_status(nvlist_t *config, boolean_t if (SPA_VERSION_IS_SUPPORTED(version) && version != SPA_VERSION) return (ZPOOL_STATUS_VERSION_OLDER); + /* + * Usable pool with disabled features + */ + if (version >= SPA_VERSION_FEATURES) { + int i; + nvlist_t *feat; + + if (isimport) { + feat = fnvlist_lookup_nvlist(config, + ZPOOL_CONFIG_LOAD_INFO); + feat = fnvlist_lookup_nvlist(feat, + ZPOOL_CONFIG_ENABLED_FEAT); + } else { + feat = fnvlist_lookup_nvlist(config, + ZPOOL_CONFIG_FEATURE_STATS); + } + + for (i = 0; i < SPA_FEATURES; i++) { + zfeature_info_t *fi = &spa_feature_table[i]; + if (!nvlist_exists(feat, fi->fi_guid)) + return (ZPOOL_STATUS_FEAT_DISABLED); + } + } + return (ZPOOL_STATUS_OK); } Modified: vendor/illumos/dist/man/man1m/zpool.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zpool.1m Mon Jul 23 19:23:49 2012 (r238724) +++ vendor/illumos/dist/man/man1m/zpool.1m Mon Jul 23 20:20:00 2012 (r238725) @@ -1692,11 +1692,10 @@ data errors since the last complete pool .ad .sp .6 .RS 4n -Displays all pools formatted using a different \fBZFS\fR on-disk version. Older -versions can continue to be used, but some features may not be available. These -pools can be upgraded using "\fBzpool upgrade -a\fR". Pools that are formatted -with a more recent version are also displayed, although these pools will be -inaccessible on the system. +Displays pools which do not have all supported features enabled and pools +formatted using a legacy ZFS version number. These pools can continue to be +used, but some features may not be available. Use "\fBzpool upgrade -a\fR" +to enable all features on all pools. .RE .sp @@ -1706,9 +1705,9 @@ inaccessible on the system. .ad .sp .6 .RS 4n -Displays \fBZFS\fR versions supported by the current software. The current -\fBZFS\fR versions and all previous supported versions are displayed, along -with an explanation of the features provided with each version. +Displays legacy \fBZFS\fR versions supported by the current software. See +\fBzfs-features\fR(5) for a description of feature flags features supported +by the current software. .RE .sp @@ -1718,16 +1717,18 @@ with an explanation of the features prov .ad .sp .6 .RS 4n -Upgrades the given pool to the latest on-disk version. Once this is done, the -pool will no longer be accessible on systems running older versions of the -software. +Enables all supported features on the given pool. Once this is done, the +pool will no longer be accessible on systems that do not support feature +flags. See \fBzfs-features\fR(5) for details on compatability with systems +that support feature flags, but do not support all features enabled on the +pool. .sp .ne 2 .na \fB\fB-a\fR\fR .ad .RS 14n -Upgrades all pools. +Enables all supported features on all pools. .RE .sp @@ -1736,10 +1737,9 @@ Upgrades all pools. \fB\fB-V\fR \fIversion\fR\fR .ad .RS 14n -Upgrade to the specified version. If the \fB-V\fR flag is not specified, the -pool is upgraded to the most recent version. This option can only be used to -increase the version number, and only up to the most recent version supported -by this software. +Upgrade to the specified legacy version. If the \fB-V\fR flag is specified, no +features will be enabled on the pool. This option can only be used to increase +the version number up to the last supported legacy version number. .RE .RE From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 20:20:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABD7310657F0; Mon, 23 Jul 2012 20:20:24 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D3108FC0A; Mon, 23 Jul 2012 20:20:24 +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 q6NKKOqn045966; Mon, 23 Jul 2012 20:20:24 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6NKKOA5045961; Mon, 23 Jul 2012 20:20:24 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207232020.q6NKKOA5045961@svn.freebsd.org> From: Martin Matuska Date: Mon, 23 Jul 2012 20:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238726 - in vendor-sys/illumos/dist/uts/common: fs/zfs fs/zfs/sys sys/fs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 20:20:24 -0000 Author: mm Date: Mon Jul 23 20:20:23 2012 New Revision: 238726 URL: http://svn.freebsd.org/changeset/base/238726 Log: Update vendor-sys/illumos to illumos-gate 13753:2aba784c276b Obtained from: ssh://anonhg@hg.illumos.org/illumos-gate Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfeature.h vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Mon Jul 23 20:20:00 2012 (r238725) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Mon Jul 23 20:20:23 2012 (r238726) @@ -2149,7 +2149,7 @@ spa_load_impl(spa_t *spa, uint64_t pool_ if (spa_version(spa) >= SPA_VERSION_FEATURES) { boolean_t missing_feat_read = B_FALSE; - nvlist_t *unsup_feat; + nvlist_t *unsup_feat, *enabled_feat; if (spa_dir_prop(spa, DMU_POOL_FEATURES_FOR_READ, &spa->spa_feat_for_read_obj) != 0) { @@ -2166,27 +2166,32 @@ spa_load_impl(spa_t *spa, uint64_t pool_ return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA, EIO)); } - VERIFY(nvlist_alloc(&unsup_feat, NV_UNIQUE_NAME, KM_SLEEP) == - 0); + enabled_feat = fnvlist_alloc(); + unsup_feat = fnvlist_alloc(); if (!feature_is_supported(spa->spa_meta_objset, spa->spa_feat_for_read_obj, spa->spa_feat_desc_obj, - unsup_feat)) + unsup_feat, enabled_feat)) missing_feat_read = B_TRUE; if (spa_writeable(spa) || state == SPA_LOAD_TRYIMPORT) { if (!feature_is_supported(spa->spa_meta_objset, spa->spa_feat_for_write_obj, spa->spa_feat_desc_obj, - unsup_feat)) + unsup_feat, enabled_feat)) { missing_feat_write = B_TRUE; + } } + fnvlist_add_nvlist(spa->spa_load_info, + ZPOOL_CONFIG_ENABLED_FEAT, enabled_feat); + if (!nvlist_empty(unsup_feat)) { - VERIFY(nvlist_add_nvlist(spa->spa_load_info, - ZPOOL_CONFIG_UNSUP_FEAT, unsup_feat) == 0); + fnvlist_add_nvlist(spa->spa_load_info, + ZPOOL_CONFIG_UNSUP_FEAT, unsup_feat); } - nvlist_free(unsup_feat); + fnvlist_free(enabled_feat); + fnvlist_free(unsup_feat); if (!missing_feat_read) { fnvlist_add_boolean(spa->spa_load_info, Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfeature.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfeature.h Mon Jul 23 20:20:00 2012 (r238725) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfeature.h Mon Jul 23 20:20:23 2012 (r238726) @@ -35,7 +35,7 @@ extern "C" { #endif extern boolean_t feature_is_supported(objset_t *os, uint64_t obj, - uint64_t desc_obj, nvlist_t *unsup_feat); + uint64_t desc_obj, nvlist_t *unsup_feat, nvlist_t *enabled_feat); struct spa; extern void spa_feature_create_zap_objects(struct spa *, dmu_tx_t *); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c Mon Jul 23 20:20:00 2012 (r238725) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c Mon Jul 23 20:20:23 2012 (r238726) @@ -173,7 +173,7 @@ typedef enum { */ boolean_t feature_is_supported(objset_t *os, uint64_t obj, uint64_t desc_obj, - nvlist_t *unsup_feat) + nvlist_t *unsup_feat, nvlist_t *enabled_feat) { boolean_t supported; zap_cursor_t zc; @@ -186,11 +186,16 @@ feature_is_supported(objset_t *os, uint6 ASSERT(za.za_integer_length == sizeof (uint64_t) && za.za_num_integers == 1); + if (NULL != enabled_feat) { + fnvlist_add_uint64(enabled_feat, za.za_name, + za.za_first_integer); + } + if (za.za_first_integer != 0 && !zfeature_is_supported(za.za_name)) { supported = B_FALSE; - if (unsup_feat != NULL) { + if (NULL != unsup_feat) { char *desc = ""; char buf[MAXPATHLEN]; Modified: vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h Mon Jul 23 20:20:00 2012 (r238725) +++ vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h Mon Jul 23 20:20:23 2012 (r238726) @@ -528,6 +528,7 @@ typedef struct zpool_rewind_policy { #define ZPOOL_CONFIG_LOAD_INFO "load_info" /* not stored on disk */ #define ZPOOL_CONFIG_REWIND_INFO "rewind_info" /* not stored on disk */ #define ZPOOL_CONFIG_UNSUP_FEAT "unsup_feat" /* not stored on disk */ +#define ZPOOL_CONFIG_ENABLED_FEAT "enabled_feat" /* not stored on disk */ #define ZPOOL_CONFIG_CAN_RDONLY "can_rdonly" /* not stored on disk */ #define ZPOOL_CONFIG_FEATURES_FOR_READ "features_for_read" #define ZPOOL_CONFIG_FEATURE_STATS "feature_stats" /* not stored on disk */ From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 21:31:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 566AB106564A; Mon, 23 Jul 2012 21:31:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A97B8FC16; Mon, 23 Jul 2012 21:31: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 q6NLVtgq051935; Mon, 23 Jul 2012 21:31:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6NLVs6x051886; Mon, 23 Jul 2012 21:31:54 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201207232131.q6NLVs6x051886@svn.freebsd.org> From: Xin LI Date: Mon, 23 Jul 2012 21:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238727 - vendor/less/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 21:31:55 -0000 Author: delphij Date: Mon Jul 23 21:31:53 2012 New Revision: 238727 URL: http://svn.freebsd.org/changeset/base/238727 Log: Vendor import of v451 (beta) Modified: vendor/less/dist/NEWS vendor/less/dist/README vendor/less/dist/brac.c vendor/less/dist/ch.c vendor/less/dist/charset.c vendor/less/dist/charset.h vendor/less/dist/cmd.h vendor/less/dist/cmdbuf.c vendor/less/dist/command.c vendor/less/dist/cvt.c vendor/less/dist/decode.c vendor/less/dist/defines.ds vendor/less/dist/defines.o2 vendor/less/dist/defines.o9 vendor/less/dist/defines.wn vendor/less/dist/edit.c vendor/less/dist/filename.c vendor/less/dist/forwback.c vendor/less/dist/funcs.h vendor/less/dist/help.c vendor/less/dist/ifile.c vendor/less/dist/input.c vendor/less/dist/jump.c vendor/less/dist/less.h vendor/less/dist/less.hlp vendor/less/dist/less.man vendor/less/dist/less.nro vendor/less/dist/lessecho.c vendor/less/dist/lessecho.man vendor/less/dist/lessecho.nro vendor/less/dist/lesskey.c vendor/less/dist/lesskey.h vendor/less/dist/lesskey.man vendor/less/dist/lesskey.nro vendor/less/dist/lglob.h vendor/less/dist/line.c vendor/less/dist/linenum.c vendor/less/dist/lsystem.c vendor/less/dist/main.c vendor/less/dist/mark.c vendor/less/dist/mkhelp.c vendor/less/dist/optfunc.c vendor/less/dist/option.c vendor/less/dist/option.h vendor/less/dist/opttbl.c vendor/less/dist/os.c vendor/less/dist/output.c vendor/less/dist/pattern.c vendor/less/dist/pattern.h vendor/less/dist/pckeys.h vendor/less/dist/position.c vendor/less/dist/position.h vendor/less/dist/prompt.c vendor/less/dist/screen.c vendor/less/dist/scrsize.c vendor/less/dist/search.c vendor/less/dist/signal.c vendor/less/dist/tags.c vendor/less/dist/ttyin.c vendor/less/dist/version.c Modified: vendor/less/dist/NEWS ============================================================================== --- vendor/less/dist/NEWS Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/NEWS Mon Jul 23 21:31:53 2012 (r238727) @@ -11,7 +11,7 @@ ====================================================================== - Major changes between "less" versions 444 and 449 + Major changes between "less" versions 444 and 451 * Add ESC-F command to keep reading data until a pattern is found. Modified: vendor/less/dist/README ============================================================================== --- vendor/less/dist/README Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/README Mon Jul 23 21:31:53 2012 (r238727) @@ -1,7 +1,7 @@ - Less, version 449 + Less, version 451 - This is the distribution of less, version 449, released 26 Jun 2012. + This is the distribution of less, version 451, released 21 Jul 2012. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or Modified: vendor/less/dist/brac.c ============================================================================== --- vendor/less/dist/brac.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/brac.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/ch.c ============================================================================== --- vendor/less/dist/ch.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/ch.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* @@ -807,6 +807,17 @@ seekable(f) } /* + * Force EOF to be at the current read position. + * This is used after an ignore_eof read, during which the EOF may change. + */ + public void +ch_set_eof() +{ + ch_fsize = ch_fpos; +} + + +/* * Initialize file state for a new file. */ public void Modified: vendor/less/dist/charset.c ============================================================================== --- vendor/less/dist/charset.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/charset.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/charset.h ============================================================================== --- vendor/less/dist/charset.h Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/charset.h Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ #define IS_ASCII_OCTET(c) (((c) & 0x80) == 0) #define IS_UTF8_TRAIL(c) (((c) & 0xC0) == 0x80) Modified: vendor/less/dist/cmd.h ============================================================================== --- vendor/less/dist/cmd.h Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/cmd.h Mon Jul 23 21:31:53 2012 (r238727) @@ -1,14 +1,14 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ -#define MAX_USERCMD 500 +#define MAX_USERCMD 1000 #define MAX_CMDLEN 16 #define A_B_LINE 2 Modified: vendor/less/dist/cmdbuf.c ============================================================================== --- vendor/less/dist/cmdbuf.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/cmdbuf.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* @@ -1087,7 +1087,11 @@ init_compl() tk_text = fcomplete(word); } else { +#if MSDOS_COMPILER + char *qword = NULL; +#else char *qword = shell_quote(word+1); +#endif if (qword == NULL) tk_text = fcomplete(word+1); else Modified: vendor/less/dist/command.c ============================================================================== --- vendor/less/dist/command.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/command.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* @@ -983,13 +983,15 @@ forw_loop(until_hilite) forward(1, 0, 0); } ignore_eoi = 0; + ch_set_eof(); /* * This gets us back in "F mode" after processing * a non-abort signal (e.g. window-change). */ if (sigs && !ABORT_SIGS()) - return (A_F_FOREVER); + return (until_hilite ? A_F_UNTIL_HILITE : A_F_FOREVER); + return (A_NOACTION); } Modified: vendor/less/dist/cvt.c ============================================================================== --- vendor/less/dist/cvt.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/cvt.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* * Routines to convert text in various ways. Used by search. Modified: vendor/less/dist/decode.c ============================================================================== --- vendor/less/dist/decode.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/decode.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/defines.ds ============================================================================== --- vendor/less/dist/defines.ds Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/defines.ds Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* DOS definition file for less. */ @@ -321,6 +321,9 @@ /* Define if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define HAVE_FLOAT if your compiler supports the "double" type. */ +#define HAVE_FLOAT 1 + /* Define if you have the header file. */ #define HAVE_LIMITS_H 1 Modified: vendor/less/dist/defines.o2 ============================================================================== --- vendor/less/dist/defines.o2 Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/defines.o2 Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* OS/2 definition file for less. */ Modified: vendor/less/dist/defines.o9 ============================================================================== --- vendor/less/dist/defines.o9 Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/defines.o9 Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* OS/9 definition file for less. */ Modified: vendor/less/dist/defines.wn ============================================================================== --- vendor/less/dist/defines.wn Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/defines.wn Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Windows definition file for less. */ Modified: vendor/less/dist/edit.c ============================================================================== --- vendor/less/dist/edit.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/edit.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ #include "less.h" Modified: vendor/less/dist/filename.c ============================================================================== --- vendor/less/dist/filename.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/filename.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/forwback.c ============================================================================== --- vendor/less/dist/forwback.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/forwback.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/funcs.h ============================================================================== --- vendor/less/dist/funcs.h Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/funcs.h Mon Jul 23 21:31:53 2012 (r238727) @@ -46,6 +46,7 @@ public void ch_setbufspace (); public void ch_flush (); public int seekable (); + public void ch_set_eof (); public void ch_init (); public void ch_close (); public int ch_getflags (); Modified: vendor/less/dist/help.c ============================================================================== --- vendor/less/dist/help.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/help.c Mon Jul 23 21:31:53 2012 (r238727) @@ -6,7 +6,7 @@ constant char helpdata[] = { '\n', ' ',' ',' ',' ',' ',' ','C','o','m','m','a','n','d','s',' ','m','a','r','k','e','d',' ','w','i','t','h',' ','*',' ','m','a','y',' ','b','e',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','n','u','m','b','e','r',',',' ','_','\b','N','.','\n', ' ',' ',' ',' ',' ',' ','N','o','t','e','s',' ','i','n',' ','p','a','r','e','n','t','h','e','s','e','s',' ','i','n','d','i','c','a','t','e',' ','t','h','e',' ','b','e','h','a','v','i','o','r',' ','i','f',' ','_','\b','N',' ','i','s',' ','g','i','v','e','n','.','\n', -' ',' ',' ',' ',' ',' ','A',' ','k','e','y',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','c','a','r','a','t',' ','i','n','d','i','c','a','t','e','s',' ','t','h','e',' ','C','t','r','l',' ','k','e','y',';',' ','t','h','u','s',' ','^','K',' ','i','s',' ','c','t','r','l','-','K','.','\n', +' ',' ',' ',' ',' ',' ','A',' ','k','e','y',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','c','a','r','e','t',' ','i','n','d','i','c','a','t','e','s',' ','t','h','e',' ','C','t','r','l',' ','k','e','y',';',' ','t','h','u','s',' ','^','K',' ','i','s',' ','c','t','r','l','-','K','.','\n', '\n', ' ',' ','h',' ',' ','H',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','t','h','i','s',' ','h','e','l','p','.','\n', ' ',' ','q',' ',' ',':','q',' ',' ','Q',' ',' ',':','Q',' ',' ','Z','Z',' ',' ',' ',' ',' ','E','x','i','t','.','\n', Modified: vendor/less/dist/ifile.c ============================================================================== --- vendor/less/dist/ifile.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/ifile.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/input.c ============================================================================== --- vendor/less/dist/input.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/input.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/jump.c ============================================================================== --- vendor/less/dist/jump.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/jump.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/less.h ============================================================================== --- vendor/less/dist/less.h Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/less.h Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ #define NEWBOT 1 Modified: vendor/less/dist/less.hlp ============================================================================== --- vendor/less/dist/less.hlp Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/less.hlp Mon Jul 23 21:31:53 2012 (r238727) @@ -3,7 +3,7 @@ Commands marked with * may be preceded by a number, _N. Notes in parentheses indicate the behavior if _N is given. - A key preceded by a carat indicates the Ctrl key; thus ^K is ctrl-K. + A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K. h H Display this help. q :q Q :Q ZZ Exit. Modified: vendor/less/dist/less.man ============================================================================== --- vendor/less/dist/less.man Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/less.man Mon Jul 23 21:31:53 2012 (r238727) @@ -1606,4 +1606,4 @@ LESS(1) - Version 449: 26 Jun 2012 LESS(1) + Version 451: 21 Jul 2012 LESS(1) Modified: vendor/less/dist/less.nro ============================================================================== --- vendor/less/dist/less.nro Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/less.nro Mon Jul 23 21:31:53 2012 (r238727) @@ -1,4 +1,4 @@ -.TH LESS 1 "Version 449: 26 Jun 2012" +.TH LESS 1 "Version 451: 21 Jul 2012" .SH NAME less \- opposite of more .SH SYNOPSIS Modified: vendor/less/dist/lessecho.c ============================================================================== --- vendor/less/dist/lessecho.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/lessecho.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/lessecho.man ============================================================================== --- vendor/less/dist/lessecho.man Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/lessecho.man Mon Jul 23 21:31:53 2012 (r238727) @@ -51,4 +51,4 @@ LESSECHO(1) - Version 449: 26 Jun 2012 LESSECHO(1) + Version 451: 21 Jul 2012 LESSECHO(1) Modified: vendor/less/dist/lessecho.nro ============================================================================== --- vendor/less/dist/lessecho.nro Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/lessecho.nro Mon Jul 23 21:31:53 2012 (r238727) @@ -1,4 +1,4 @@ -.TH LESSECHO 1 "Version 449: 26 Jun 2012" +.TH LESSECHO 1 "Version 451: 21 Jul 2012" .SH NAME lessecho \- expand metacharacters .SH SYNOPSIS Modified: vendor/less/dist/lesskey.c ============================================================================== --- vendor/less/dist/lesskey.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/lesskey.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* @@ -449,7 +449,7 @@ tstr(pp, xlate) } case '^': /* - * Carat means CONTROL. + * Caret means CONTROL. */ *pp = p+2; buf[0] = CONTROL(p[1]); Modified: vendor/less/dist/lesskey.h ============================================================================== --- vendor/less/dist/lesskey.h Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/lesskey.h Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/lesskey.man ============================================================================== --- vendor/less/dist/lesskey.man Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/lesskey.man Mon Jul 23 21:31:53 2012 (r238727) @@ -349,10 +349,8 @@ LESSKEY(1) AUTHOR Mark Nudelman - Send bug reports or comments to the above address or to bug- - less@gnu.org. + Send bug reports or comments to bug-less@gnu.org. - - Version 449: 26 Jun 2012 LESSKEY(1) + Version 451: 21 Jul 2012 LESSKEY(1) Modified: vendor/less/dist/lesskey.nro ============================================================================== --- vendor/less/dist/lesskey.nro Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/lesskey.nro Mon Jul 23 21:31:53 2012 (r238727) @@ -1,4 +1,4 @@ -.TH LESSKEY 1 "Version 449: 26 Jun 2012" +.TH LESSKEY 1 "Version 451: 21 Jul 2012" .SH NAME lesskey \- specify key bindings for less .SH SYNOPSIS @@ -378,5 +378,4 @@ Suite 330, Boston, MA 02111-1307, USA. .PP Mark Nudelman .br -Send bug reports or comments to the above address or to bug-less@gnu.org. - +Send bug reports or comments to bug-less@gnu.org. Modified: vendor/less/dist/lglob.h ============================================================================== --- vendor/less/dist/lglob.h Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/lglob.h Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/line.c ============================================================================== --- vendor/less/dist/line.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/line.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/linenum.c ============================================================================== --- vendor/less/dist/linenum.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/linenum.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/lsystem.c ============================================================================== --- vendor/less/dist/lsystem.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/lsystem.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/main.c ============================================================================== --- vendor/less/dist/main.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/main.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/mark.c ============================================================================== --- vendor/less/dist/mark.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/mark.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ #include "less.h" Modified: vendor/less/dist/mkhelp.c ============================================================================== --- vendor/less/dist/mkhelp.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/mkhelp.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/optfunc.c ============================================================================== --- vendor/less/dist/optfunc.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/optfunc.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/option.c ============================================================================== --- vendor/less/dist/option.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/option.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/option.h ============================================================================== --- vendor/less/dist/option.h Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/option.h Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ #define END_OPTION_STRING ('$') Modified: vendor/less/dist/opttbl.c ============================================================================== --- vendor/less/dist/opttbl.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/opttbl.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/os.c ============================================================================== --- vendor/less/dist/os.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/os.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: vendor/less/dist/output.c ============================================================================== --- vendor/less/dist/output.c Mon Jul 23 20:20:23 2012 (r238726) +++ vendor/less/dist/output.c Mon Jul 23 21:31:53 2012 (r238727) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* @@ -272,13 +272,16 @@ flush() break; if (at & 1) { -#if MSDOS_COMPILER==WIN32C - fg |= FOREGROUND_INTENSITY; - bg |= BACKGROUND_INTENSITY; -#else - fg = bo_fg_color; - bg = bo_bg_color; -#endif + /* + * If \e[1m use defined bold + * color, else set intensity. + */ + if (p[-2] == '[') + { + fg = bo_fg_color; + bg = bo_bg_color; + } else + fg |= 8; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 21:32:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 080021065672; Mon, 23 Jul 2012 21:32:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA7258FC1E; Mon, 23 Jul 2012 21:32: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 q6NLWbTP052032; Mon, 23 Jul 2012 21:32:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6NLWbxb052031; Mon, 23 Jul 2012 21:32:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201207232132.q6NLWbxb052031@svn.freebsd.org> From: Xin LI Date: Mon, 23 Jul 2012 21:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238728 - vendor/less/v451 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 21:32:38 -0000 Author: delphij Date: Mon Jul 23 21:32:37 2012 New Revision: 238728 URL: http://svn.freebsd.org/changeset/base/238728 Log: Tag v451. Added: vendor/less/v451/ - copied from r238727, vendor/less/dist/ From owner-svn-src-all@FreeBSD.ORG Mon Jul 23 23:40:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4F12106566B; Mon, 23 Jul 2012 23:40:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B55D48FC12; Mon, 23 Jul 2012 23:40:13 +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 q6NNeDlO062447; Mon, 23 Jul 2012 23:40:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6NNeDOb062442; Mon, 23 Jul 2012 23:40:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207232340.q6NNeDOb062442@svn.freebsd.org> From: Adrian Chadd Date: Mon, 23 Jul 2012 23:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238729 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 23:40:14 -0000 Author: adrian Date: Mon Jul 23 23:40:13 2012 New Revision: 238729 URL: http://svn.freebsd.org/changeset/base/238729 Log: Modify ath_descdma_setup() to take a descriptor size parameter. The AR9300 and later descriptors are 128 bytes, however I'd like to make sure that isn't used for earlier chips. * Populate the TX descriptor length field in the softc with sizeof(ath_desc) * Use this field when allocating the TX descriptors * Pre-AR93xx TX/RX descriptors will use the ath_desc size; newer ones will query the HAL for these sizes. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Jul 23 21:32:37 2012 (r238728) +++ head/sys/dev/ath/if_ath.c Mon Jul 23 23:40:13 2012 (r238729) @@ -2767,7 +2767,7 @@ ath_load_cb(void *arg, bus_dma_segment_t int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd, ath_bufhead *head, - const char *name, int nbuf, int ndesc) + const char *name, int ds_size, int nbuf, int ndesc) { #define DS2PHYS(_dd, _ds) \ ((_dd)->dd_desc_paddr + ((caddr_t)(_ds) - (caddr_t)(_dd)->dd_desc)) @@ -2778,7 +2778,7 @@ ath_descdma_setup(struct ath_softc *sc, struct ath_buf *bf; int i, bsize, error; - dd->dd_descsize = sizeof(struct ath_desc); + dd->dd_descsize = ds_size; DPRINTF(sc, ATH_DEBUG_RESET, "%s: %s DMA: %u buffers %u desc/buf, %d bytes per descriptor\n", @@ -3010,14 +3010,15 @@ ath_desc_alloc(struct ath_softc *sc) int error; error = ath_descdma_setup(sc, &sc->sc_txdma, &sc->sc_txbuf, - "tx", ath_txbuf, ATH_TXDESC); + "tx", sc->sc_tx_desclen, ath_txbuf, ATH_TXDESC); if (error != 0) { return error; } sc->sc_txbuf_cnt = ath_txbuf; error = ath_descdma_setup(sc, &sc->sc_txdma_mgmt, &sc->sc_txbuf_mgmt, - "tx_mgmt", ath_txbuf_mgmt, ATH_TXDESC); + "tx_mgmt", sc->sc_tx_desclen, ath_txbuf_mgmt, + ATH_TXDESC); if (error != 0) { ath_descdma_cleanup(sc, &sc->sc_txdma, &sc->sc_txbuf); return error; @@ -3029,7 +3030,7 @@ ath_desc_alloc(struct ath_softc *sc) */ error = ath_descdma_setup(sc, &sc->sc_bdma, &sc->sc_bbuf, - "beacon", ATH_BCBUF, 1); + "beacon", sc->sc_tx_desclen, ATH_BCBUF, 1); if (error != 0) { ath_descdma_cleanup(sc, &sc->sc_txdma, &sc->sc_txbuf); ath_descdma_cleanup(sc, &sc->sc_txdma_mgmt, Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Mon Jul 23 21:32:37 2012 (r238728) +++ head/sys/dev/ath/if_ath_misc.h Mon Jul 23 23:40:13 2012 (r238729) @@ -85,7 +85,8 @@ extern void ath_setdefantenna(struct ath extern void ath_setslottime(struct ath_softc *sc); extern int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd, - ath_bufhead *head, const char *name, int nbuf, int ndesc); + ath_bufhead *head, const char *name, int ds_size, int nbuf, + int ndesc); extern int ath_descdma_setup_rx_edma(struct ath_softc *sc, struct ath_descdma *dd, ath_bufhead *head, const char *name, int nbuf, int desclen); Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Mon Jul 23 21:32:37 2012 (r238728) +++ head/sys/dev/ath/if_ath_rx.c Mon Jul 23 23:40:13 2012 (r238729) @@ -1075,7 +1075,7 @@ ath_legacy_dma_rxsetup(struct ath_softc device_printf(sc->sc_dev, "%s: called\n", __func__); error = ath_descdma_setup(sc, &sc->sc_rxdma, &sc->sc_rxbuf, - "rx", ath_rxbuf, 1); + "rx", sizeof(struct ath_desc), ath_rxbuf, 1); if (error != 0) return (error); @@ -1099,6 +1099,9 @@ ath_recv_setup_legacy(struct ath_softc * device_printf(sc->sc_dev, "DMA setup: legacy\n"); + /* Sensible legacy defaults */ + sc->sc_rx_statuslen = 0; + sc->sc_rx.recv_start = ath_legacy_startrecv; sc->sc_rx.recv_stop = ath_legacy_stoprecv; sc->sc_rx.recv_flush = ath_legacy_flushrecv; Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Mon Jul 23 21:32:37 2012 (r238728) +++ head/sys/dev/ath/if_ath_tx.c Mon Jul 23 23:40:13 2012 (r238729) @@ -4483,6 +4483,13 @@ ath_legacy_dma_txteardown(struct ath_sof void ath_xmit_setup_legacy(struct ath_softc *sc) { + /* + * For now, just set the descriptor length to sizeof(ath_desc); + * worry about extracting the real length out of the HAL later. + */ + sc->sc_tx_desclen = sizeof(struct ath_desc); + sc->sc_tx_statuslen = 0; + sc->sc_tx_nmaps = 1; /* only one buffer per TX desc */ sc->sc_tx.xmit_setup = ath_legacy_dma_txsetup; sc->sc_tx.xmit_teardown = ath_legacy_dma_txteardown; From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 00:07:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEAE81065674 for ; Tue, 24 Jul 2012 00:07:23 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-gg0-f182.google.com (mail-gg0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3E12D8FC15 for ; Tue, 24 Jul 2012 00:07:23 +0000 (UTC) Received: by ggnm2 with SMTP id m2so7151980ggn.13 for ; Mon, 23 Jul 2012 17:07:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=ZnhNfJBbcko+3uTsy+u56NqbaTrqtVeJl4qouYpcP5w=; b=AMBT3F0KXjuuiELMZ+sPZIJh53jWS8vkIiwPSYZGnflc2I468/EO+R8USK6O51roz2 p6WL523UEOaP/Vr5/f3nRkMvdF6sXwFg9KbBVQY/sRhlF0pf0g43EW/nLIzX/DgQ31T8 bHHx7N6QCeC0ETUFboPPJPBQRRe/PFFE8bpCmJtHzxE3+Kd6Hu+Strrn5XBydPkoy//F 9Ec9mxh1WUcFj6381E+ADT0/9uht2GAJN++ko7u+NtwwFj6bSQG+fiwgmm2E28R2rk1L sGO6iKnLQSvpMW4N9+UPtLQ8sZOipnnFSM+Hy3WO/K8qMb1LXzedjHz75UTPWK7kHcLf tqCQ== Received: by 10.43.126.1 with SMTP id gu1mr10418677icc.6.1343088442355; Mon, 23 Jul 2012 17:07:22 -0700 (PDT) Received: from 63.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPS id s4sm659961igb.1.2012.07.23.17.07.18 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 Jul 2012 17:07:20 -0700 (PDT) Sender: Warner Losh Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Mon, 23 Jul 2012 18:07:16 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <523C5041-527B-4DBC-85E1-4AE846B014E6@bsdimp.com> References: <201207211407.q6LE7h9P042318@svn.freebsd.org> <20120721153026.GA8640@FreeBSD.org> <20120723071227.GE85230@FreeBSD.org> To: Garrett Cooper X-Mailer: Apple Mail (2.1084) X-Gm-Message-State: ALoCoQm88dcrtC1qLNQF5nL0Xu0rVAUdFSH+bFU13cIfQeL2AgXjHXn8D9LV1UdiXoH0Z5x3+WWP Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r238672 - head/sys/dev/sdhci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 00:07:24 -0000 On Jul 23, 2012, at 1:28 AM, Garrett Cooper wrote: > On Mon, Jul 23, 2012 at 12:12 AM, Gleb Smirnoff = wrote: >> On Sat, Jul 21, 2012 at 03:30:26PM +0000, Alexey Dokuchaev wrote: >> A> On Sat, Jul 21, 2012 at 02:07:43PM +0000, Gleb Smirnoff wrote: >> A> > Author: glebius >> A> > Date: Sat Jul 21 14:07:43 2012 >> A> > New Revision: 238672 >> A> > URL: http://svn.freebsd.org/changeset/base/238672 >> A> > >> A> > Log: >> A> > Fix typo in comment, should be MHz here. >> A> >> A> That's nice, but... >> A> >> A> > @@ -364,7 +364,7 @@ sdhci_lower_frequency(device_t dev) >> A> > >> A> > /* >> A> > * Some SD/MMC cards don't work with the default base >> A> > - * clock frequency of 200MHz. Lower it to 50Hz. >> A> > + * clock frequency of 200MHz. Lower it to 50MHz. >> A> >> A> ... Why losing 2-space break after a sentence (per what we are = generally >> A> adhering and AFAIR is suggested by Chicago Style Guide)? >>=20 >> Never heard about this rule. Sorry. >=20 > Actually, English spacing is discouraged in more recent texts; it > was encouraged during the late 19th century up until the late 20th > century according to ye great wikipedia [1], but I've read several > other articles in the past decade that suggest that the English > spacing convention be completely abolished. > FWIW, I'd just follow surrounding style like style(9) suggests. No > reason for fighting over an extra byte per sentence in a source file > (unless you consider how much added bandwidth / disk space those > precious bytes can consume :)...). > Thanks, > -Garrett >=20 > 1. = http://en.wikipedia.org/wiki/History_of_sentence_spacing#French_and_Englis= h_spacing Double spacing is the one true way I learned how to type in school. = Since the 1980's though, things have changed and many advocate single = spaces. However, that's for folks with fancy variable pitch font and = such. For fixed-witdh fonts, 2 is still preferred in some circles, = including ours. Warner= From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 00:25:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBCEC1065670; Tue, 24 Jul 2012 00:25:59 +0000 (UTC) (envelope-from yanegomi@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 351798FC08; Tue, 24 Jul 2012 00:25:59 +0000 (UTC) Received: by yenl8 with SMTP id l8so7181869yen.13 for ; Mon, 23 Jul 2012 17:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=+udzsrLp67vEtbA8dENSFoGi3R6yka2ekXII2BwBoQA=; b=BH1wovVYNnfHO5JZDBnGkD8c9UJtvB18trAqiHlWoI4fRcka+fQHyB9OOl/ST1hcVp BRzzcGRvJskF22baxkHkcJWgzb9a3EdFOf7YYmA126a+3MJlfRkDt5wyP/EkBiSCF+YV GMibHJUbuEYHCPiNWA3No0dpGAcTdMUxHAa6xfCmv6KihHkt61FJ5xMOp2ruJGDH+V9U lgc9FlG7TdCjgG0SHzOMC01/Dpukvf7XKeQdnxy/b3+uzU1UxqiFJluMgviO+1mGdsaq 7ochf0WfO5z15lbW6SK3Can5TwwjnQLjNIXGw/e3EIQqBOZLomtoB16Bds5eOJX8ojKa fuiQ== MIME-Version: 1.0 Received: by 10.236.153.39 with SMTP id e27mr16791410yhk.130.1343089558749; Mon, 23 Jul 2012 17:25:58 -0700 (PDT) Received: by 10.76.84.7 with HTTP; Mon, 23 Jul 2012 17:25:58 -0700 (PDT) In-Reply-To: <523C5041-527B-4DBC-85E1-4AE846B014E6@bsdimp.com> References: <201207211407.q6LE7h9P042318@svn.freebsd.org> <20120721153026.GA8640@FreeBSD.org> <20120723071227.GE85230@FreeBSD.org> <523C5041-527B-4DBC-85E1-4AE846B014E6@bsdimp.com> Date: Mon, 23 Jul 2012 17:25:58 -0700 Message-ID: From: Garrett Cooper To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r238672 - head/sys/dev/sdhci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 00:26:00 -0000 On Mon, Jul 23, 2012 at 5:07 PM, Warner Losh wrote: > > On Jul 23, 2012, at 1:28 AM, Garrett Cooper wrote: > >> On Mon, Jul 23, 2012 at 12:12 AM, Gleb Smirnoff wr= ote: >>> On Sat, Jul 21, 2012 at 03:30:26PM +0000, Alexey Dokuchaev wrote: >>> A> On Sat, Jul 21, 2012 at 02:07:43PM +0000, Gleb Smirnoff wrote: >>> A> > Author: glebius >>> A> > Date: Sat Jul 21 14:07:43 2012 >>> A> > New Revision: 238672 >>> A> > URL: http://svn.freebsd.org/changeset/base/238672 >>> A> > >>> A> > Log: >>> A> > Fix typo in comment, should be MHz here. >>> A> >>> A> That's nice, but... >>> A> >>> A> > @@ -364,7 +364,7 @@ sdhci_lower_frequency(device_t dev) >>> A> > >>> A> > /* >>> A> > * Some SD/MMC cards don't work with the default base >>> A> > - * clock frequency of 200MHz. Lower it to 50Hz. >>> A> > + * clock frequency of 200MHz. Lower it to 50MHz. >>> A> >>> A> ... Why losing 2-space break after a sentence (per what we are gener= ally >>> A> adhering and AFAIR is suggested by Chicago Style Guide)? >>> >>> Never heard about this rule. Sorry. >> >> Actually, English spacing is discouraged in more recent texts; it >> was encouraged during the late 19th century up until the late 20th >> century according to ye great wikipedia [1], but I've read several >> other articles in the past decade that suggest that the English >> spacing convention be completely abolished. >> FWIW, I'd just follow surrounding style like style(9) suggests. No >> reason for fighting over an extra byte per sentence in a source file >> (unless you consider how much added bandwidth / disk space those >> precious bytes can consume :)...). >> Thanks, >> -Garrett >> >> 1. http://en.wikipedia.org/wiki/History_of_sentence_spacing#French_and_E= nglish_spacing > > Double spacing is the one true way I learned how to type in school. Sinc= e the 1980's though, things have changed and many advocate single spaces. = However, that's for folks with fancy variable pitch font and such. For fix= ed-witdh fonts, 2 is still preferred in some circles, including ours. And now that I look at style(9), there are subtleties that demonstrate this in the roff generated text: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D FreeBSD source tree. It is also a guide for the preferred userland co= de ^^ style. Many of the style rules are implicit in the examples. Be care= ful ^^ ^^ to check the examples before assuming that style is silent on an issue= . =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D I wish this point was more explicit, but like style(9), there are other unspoken rules that should/must be adhered to. Thanks, -Garrett From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 01:09:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8B5EF106566B; Tue, 24 Jul 2012 01:09:12 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 751778FC08; Tue, 24 Jul 2012 01:09:12 +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 q6O19CMl069651; Tue, 24 Jul 2012 01:09:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6O19BQA069602; Tue, 24 Jul 2012 01:09:11 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201207240109.q6O19BQA069602@svn.freebsd.org> From: Xin LI Date: Tue, 24 Jul 2012 01:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238730 - head/contrib/less X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 01:09:12 -0000 Author: delphij Date: Tue Jul 24 01:09:11 2012 New Revision: 238730 URL: http://svn.freebsd.org/changeset/base/238730 Log: MFV: less v451. Modified: head/contrib/less/NEWS head/contrib/less/README head/contrib/less/brac.c head/contrib/less/ch.c head/contrib/less/charset.c head/contrib/less/charset.h head/contrib/less/cmd.h head/contrib/less/cmdbuf.c head/contrib/less/command.c head/contrib/less/cvt.c head/contrib/less/decode.c head/contrib/less/defines.ds head/contrib/less/defines.o2 head/contrib/less/defines.o9 head/contrib/less/defines.wn head/contrib/less/edit.c head/contrib/less/filename.c head/contrib/less/forwback.c head/contrib/less/funcs.h head/contrib/less/help.c head/contrib/less/ifile.c head/contrib/less/input.c head/contrib/less/jump.c head/contrib/less/less.h head/contrib/less/less.hlp head/contrib/less/less.man head/contrib/less/less.nro head/contrib/less/lessecho.c head/contrib/less/lessecho.man head/contrib/less/lessecho.nro head/contrib/less/lesskey.c head/contrib/less/lesskey.h head/contrib/less/lesskey.man head/contrib/less/lesskey.nro head/contrib/less/lglob.h head/contrib/less/line.c head/contrib/less/linenum.c head/contrib/less/lsystem.c head/contrib/less/main.c head/contrib/less/mark.c head/contrib/less/mkhelp.c head/contrib/less/optfunc.c head/contrib/less/option.c head/contrib/less/option.h head/contrib/less/opttbl.c head/contrib/less/os.c head/contrib/less/output.c head/contrib/less/pattern.c head/contrib/less/pattern.h head/contrib/less/pckeys.h head/contrib/less/position.c head/contrib/less/position.h head/contrib/less/prompt.c head/contrib/less/screen.c head/contrib/less/scrsize.c head/contrib/less/search.c head/contrib/less/signal.c head/contrib/less/tags.c head/contrib/less/ttyin.c head/contrib/less/version.c Directory Properties: head/contrib/less/ (props changed) Modified: head/contrib/less/NEWS ============================================================================== --- head/contrib/less/NEWS Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/NEWS Tue Jul 24 01:09:11 2012 (r238730) @@ -11,7 +11,7 @@ ====================================================================== - Major changes between "less" versions 444 and 449 + Major changes between "less" versions 444 and 451 * Add ESC-F command to keep reading data until a pattern is found. Modified: head/contrib/less/README ============================================================================== --- head/contrib/less/README Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/README Tue Jul 24 01:09:11 2012 (r238730) @@ -7,9 +7,9 @@ ************************************************************************** ************************************************************************** - Less, version 449 + Less, version 451 - This is the distribution of less, version 449, released 26 Jun 2012. + This is the distribution of less, version 451, released 21 Jul 2012. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or Modified: head/contrib/less/brac.c ============================================================================== --- head/contrib/less/brac.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/brac.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/ch.c ============================================================================== --- head/contrib/less/ch.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/ch.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* @@ -807,6 +807,17 @@ seekable(f) } /* + * Force EOF to be at the current read position. + * This is used after an ignore_eof read, during which the EOF may change. + */ + public void +ch_set_eof() +{ + ch_fsize = ch_fpos; +} + + +/* * Initialize file state for a new file. */ public void Modified: head/contrib/less/charset.c ============================================================================== --- head/contrib/less/charset.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/charset.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/charset.h ============================================================================== --- head/contrib/less/charset.h Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/charset.h Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ #define IS_ASCII_OCTET(c) (((c) & 0x80) == 0) #define IS_UTF8_TRAIL(c) (((c) & 0xC0) == 0x80) Modified: head/contrib/less/cmd.h ============================================================================== --- head/contrib/less/cmd.h Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/cmd.h Tue Jul 24 01:09:11 2012 (r238730) @@ -1,14 +1,14 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ -#define MAX_USERCMD 500 +#define MAX_USERCMD 1000 #define MAX_CMDLEN 16 #define A_B_LINE 2 Modified: head/contrib/less/cmdbuf.c ============================================================================== --- head/contrib/less/cmdbuf.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/cmdbuf.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* @@ -1087,7 +1087,11 @@ init_compl() tk_text = fcomplete(word); } else { +#if MSDOS_COMPILER + char *qword = NULL; +#else char *qword = shell_quote(word+1); +#endif if (qword == NULL) tk_text = fcomplete(word+1); else Modified: head/contrib/less/command.c ============================================================================== --- head/contrib/less/command.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/command.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,12 +1,12 @@ /* $FreeBSD$ */ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* @@ -989,13 +989,15 @@ forw_loop(until_hilite) forward(1, 0, 0); } ignore_eoi = 0; + ch_set_eof(); /* * This gets us back in "F mode" after processing * a non-abort signal (e.g. window-change). */ if (sigs && !ABORT_SIGS()) - return (A_F_FOREVER); + return (until_hilite ? A_F_UNTIL_HILITE : A_F_FOREVER); + return (A_NOACTION); } Modified: head/contrib/less/cvt.c ============================================================================== --- head/contrib/less/cvt.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/cvt.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* * Routines to convert text in various ways. Used by search. Modified: head/contrib/less/decode.c ============================================================================== --- head/contrib/less/decode.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/decode.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/defines.ds ============================================================================== --- head/contrib/less/defines.ds Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/defines.ds Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* DOS definition file for less. */ @@ -321,6 +321,9 @@ /* Define if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define HAVE_FLOAT if your compiler supports the "double" type. */ +#define HAVE_FLOAT 1 + /* Define if you have the header file. */ #define HAVE_LIMITS_H 1 Modified: head/contrib/less/defines.o2 ============================================================================== --- head/contrib/less/defines.o2 Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/defines.o2 Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* OS/2 definition file for less. */ Modified: head/contrib/less/defines.o9 ============================================================================== --- head/contrib/less/defines.o9 Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/defines.o9 Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* OS/9 definition file for less. */ Modified: head/contrib/less/defines.wn ============================================================================== --- head/contrib/less/defines.wn Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/defines.wn Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Windows definition file for less. */ Modified: head/contrib/less/edit.c ============================================================================== --- head/contrib/less/edit.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/edit.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ #include "less.h" Modified: head/contrib/less/filename.c ============================================================================== --- head/contrib/less/filename.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/filename.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/forwback.c ============================================================================== --- head/contrib/less/forwback.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/forwback.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,12 +1,12 @@ /* $FreeBSD$ */ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/funcs.h ============================================================================== --- head/contrib/less/funcs.h Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/funcs.h Tue Jul 24 01:09:11 2012 (r238730) @@ -46,6 +46,7 @@ public void ch_setbufspace (); public void ch_flush (); public int seekable (); + public void ch_set_eof (); public void ch_init (); public void ch_close (); public int ch_getflags (); Modified: head/contrib/less/help.c ============================================================================== --- head/contrib/less/help.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/help.c Tue Jul 24 01:09:11 2012 (r238730) @@ -6,7 +6,7 @@ constant char helpdata[] = { '\n', ' ',' ',' ',' ',' ',' ','C','o','m','m','a','n','d','s',' ','m','a','r','k','e','d',' ','w','i','t','h',' ','*',' ','m','a','y',' ','b','e',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','n','u','m','b','e','r',',',' ','_','\b','N','.','\n', ' ',' ',' ',' ',' ',' ','N','o','t','e','s',' ','i','n',' ','p','a','r','e','n','t','h','e','s','e','s',' ','i','n','d','i','c','a','t','e',' ','t','h','e',' ','b','e','h','a','v','i','o','r',' ','i','f',' ','_','\b','N',' ','i','s',' ','g','i','v','e','n','.','\n', -' ',' ',' ',' ',' ',' ','A',' ','k','e','y',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','c','a','r','a','t',' ','i','n','d','i','c','a','t','e','s',' ','t','h','e',' ','C','t','r','l',' ','k','e','y',';',' ','t','h','u','s',' ','^','K',' ','i','s',' ','c','t','r','l','-','K','.','\n', +' ',' ',' ',' ',' ',' ','A',' ','k','e','y',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','c','a','r','e','t',' ','i','n','d','i','c','a','t','e','s',' ','t','h','e',' ','C','t','r','l',' ','k','e','y',';',' ','t','h','u','s',' ','^','K',' ','i','s',' ','c','t','r','l','-','K','.','\n', '\n', ' ',' ','h',' ',' ','H',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','t','h','i','s',' ','h','e','l','p','.','\n', ' ',' ','q',' ',' ',':','q',' ',' ','Q',' ',' ',':','Q',' ',' ','Z','Z',' ',' ',' ',' ',' ','E','x','i','t','.','\n', Modified: head/contrib/less/ifile.c ============================================================================== --- head/contrib/less/ifile.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/ifile.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/input.c ============================================================================== --- head/contrib/less/input.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/input.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/jump.c ============================================================================== --- head/contrib/less/jump.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/jump.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/less.h ============================================================================== --- head/contrib/less/less.h Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/less.h Tue Jul 24 01:09:11 2012 (r238730) @@ -1,12 +1,12 @@ /* $FreeBSD$ */ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ #define NEWBOT 1 Modified: head/contrib/less/less.hlp ============================================================================== --- head/contrib/less/less.hlp Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/less.hlp Tue Jul 24 01:09:11 2012 (r238730) @@ -3,7 +3,7 @@ Commands marked with * may be preceded by a number, _N. Notes in parentheses indicate the behavior if _N is given. - A key preceded by a carat indicates the Ctrl key; thus ^K is ctrl-K. + A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K. h H Display this help. q :q Q :Q ZZ Exit. Modified: head/contrib/less/less.man ============================================================================== --- head/contrib/less/less.man Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/less.man Tue Jul 24 01:09:11 2012 (r238730) @@ -1606,4 +1606,4 @@ LESS(1) - Version 449: 26 Jun 2012 LESS(1) + Version 451: 21 Jul 2012 LESS(1) Modified: head/contrib/less/less.nro ============================================================================== --- head/contrib/less/less.nro Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/less.nro Tue Jul 24 01:09:11 2012 (r238730) @@ -1,4 +1,4 @@ -.TH LESS 1 "Version 449: 26 Jun 2012" +.TH LESS 1 "Version 451: 21 Jul 2012" .SH NAME less \- opposite of more .SH SYNOPSIS Modified: head/contrib/less/lessecho.c ============================================================================== --- head/contrib/less/lessecho.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/lessecho.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/lessecho.man ============================================================================== --- head/contrib/less/lessecho.man Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/lessecho.man Tue Jul 24 01:09:11 2012 (r238730) @@ -51,4 +51,4 @@ LESSECHO(1) - Version 449: 26 Jun 2012 LESSECHO(1) + Version 451: 21 Jul 2012 LESSECHO(1) Modified: head/contrib/less/lessecho.nro ============================================================================== --- head/contrib/less/lessecho.nro Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/lessecho.nro Tue Jul 24 01:09:11 2012 (r238730) @@ -1,4 +1,4 @@ -.TH LESSECHO 1 "Version 449: 26 Jun 2012" +.TH LESSECHO 1 "Version 451: 21 Jul 2012" .SH NAME lessecho \- expand metacharacters .SH SYNOPSIS Modified: head/contrib/less/lesskey.c ============================================================================== --- head/contrib/less/lesskey.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/lesskey.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* @@ -449,7 +449,7 @@ tstr(pp, xlate) } case '^': /* - * Carat means CONTROL. + * Caret means CONTROL. */ *pp = p+2; buf[0] = CONTROL(p[1]); Modified: head/contrib/less/lesskey.h ============================================================================== --- head/contrib/less/lesskey.h Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/lesskey.h Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/lesskey.man ============================================================================== --- head/contrib/less/lesskey.man Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/lesskey.man Tue Jul 24 01:09:11 2012 (r238730) @@ -349,10 +349,8 @@ LESSKEY(1) AUTHOR Mark Nudelman - Send bug reports or comments to the above address or to bug- - less@gnu.org. + Send bug reports or comments to bug-less@gnu.org. - - Version 449: 26 Jun 2012 LESSKEY(1) + Version 451: 21 Jul 2012 LESSKEY(1) Modified: head/contrib/less/lesskey.nro ============================================================================== --- head/contrib/less/lesskey.nro Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/lesskey.nro Tue Jul 24 01:09:11 2012 (r238730) @@ -1,4 +1,4 @@ -.TH LESSKEY 1 "Version 449: 26 Jun 2012" +.TH LESSKEY 1 "Version 451: 21 Jul 2012" .SH NAME lesskey \- specify key bindings for less .SH SYNOPSIS @@ -378,5 +378,4 @@ Suite 330, Boston, MA 02111-1307, USA. .PP Mark Nudelman .br -Send bug reports or comments to the above address or to bug-less@gnu.org. - +Send bug reports or comments to bug-less@gnu.org. Modified: head/contrib/less/lglob.h ============================================================================== --- head/contrib/less/lglob.h Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/lglob.h Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/line.c ============================================================================== --- head/contrib/less/line.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/line.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,12 +1,12 @@ /* $FreeBSD$ */ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/linenum.c ============================================================================== --- head/contrib/less/linenum.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/linenum.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/lsystem.c ============================================================================== --- head/contrib/less/lsystem.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/lsystem.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/main.c ============================================================================== --- head/contrib/less/main.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/main.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,12 +1,12 @@ /* $FreeBSD$ */ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/mark.c ============================================================================== --- head/contrib/less/mark.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/mark.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ #include "less.h" Modified: head/contrib/less/mkhelp.c ============================================================================== --- head/contrib/less/mkhelp.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/mkhelp.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/optfunc.c ============================================================================== --- head/contrib/less/optfunc.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/optfunc.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/option.c ============================================================================== --- head/contrib/less/option.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/option.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/option.h ============================================================================== --- head/contrib/less/option.h Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/option.h Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ #define END_OPTION_STRING ('$') Modified: head/contrib/less/opttbl.c ============================================================================== --- head/contrib/less/opttbl.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/opttbl.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/os.c ============================================================================== --- head/contrib/less/os.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/os.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* Modified: head/contrib/less/output.c ============================================================================== --- head/contrib/less/output.c Mon Jul 23 23:40:13 2012 (r238729) +++ head/contrib/less/output.c Tue Jul 24 01:09:11 2012 (r238730) @@ -1,11 +1,11 @@ -/* - * Copyright (C) 1984-2012 Mark Nudelman - * - * You may distribute under the terms of either the GNU General Public - * License or the Less License, as specified in the README file. - * - * For more information, see the README file. - */ +/* + * Copyright (C) 1984-2012 Mark Nudelman + * + * You may distribute under the terms of either the GNU General Public + * License or the Less License, as specified in the README file. + * + * For more information, see the README file. + */ /* @@ -272,13 +272,16 @@ flush() break; if (at & 1) { -#if MSDOS_COMPILER==WIN32C - fg |= FOREGROUND_INTENSITY; - bg |= BACKGROUND_INTENSITY; -#else - fg = bo_fg_color; - bg = bo_bg_color; -#endif + /* + * If \e[1m use defined bold + * color, else set intensity. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 01:18:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55DEE106564A; Tue, 24 Jul 2012 01:18:20 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4111F8FC16; Tue, 24 Jul 2012 01:18:20 +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 q6O1IKuI070495; Tue, 24 Jul 2012 01:18:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6O1IKj4070492; Tue, 24 Jul 2012 01:18:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207240118.q6O1IKj4070492@svn.freebsd.org> From: Adrian Chadd Date: Tue, 24 Jul 2012 01:18:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238731 - in head/sys/dev/ath: . ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 01:18:20 -0000 Author: adrian Date: Tue Jul 24 01:18:19 2012 New Revision: 238731 URL: http://svn.freebsd.org/changeset/base/238731 Log: Add a new HAL method - the AR93xx and later NICs have a separate TX descriptor ring for TX status completion. This API call will pass the allocated buffer details to the HAL. Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Tue Jul 24 01:09:11 2012 (r238730) +++ head/sys/dev/ath/ath_hal/ah.h Tue Jul 24 01:18:19 2012 (r238731) @@ -1090,6 +1090,9 @@ struct ath_hal { uint32_t *link); void __ahdecl(*ah_getTxDescLinkPtr)(struct ath_hal *ah, void *ds, uint32_t **linkptr); + void __ahdecl(*ah_setupTxStatusRing)(struct ath_hal *, + void *ts_start, uint32_t ts_paddr_start, + uint16_t size); /* Receive Functions */ uint32_t __ahdecl(*ah_getRxDP)(struct ath_hal*, HAL_RX_QUEUE); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Jul 24 01:09:11 2012 (r238730) +++ head/sys/dev/ath/if_athvar.h Tue Jul 24 01:18:19 2012 (r238731) @@ -1099,6 +1099,9 @@ void ath_intr(void *); ((*(_ah)->ah_getTxDescLink)((_ah), (_ds), (_link))) #define ath_hal_gettxdesclinkptr(_ah, _ds, _linkptr) \ ((*(_ah)->ah_getTxDescLinkPtr)((_ah), (_ds), (_linkptr))) +#define ath_hal_setuptxstatusring(_ah, _tsstart, _tspstart, _size) \ + ((*(_ah)->ah_setupTxStatusRing)((_ah), (_tsstart), (_tspstart), \ + (_size))) #define ath_hal_setupfirsttxdesc(_ah, _ds, _aggrlen, _flags, _txpower, \ _txr0, _txtr0, _antm, _rcr, _rcd) \ From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 02:35:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C7DB4106564A; Tue, 24 Jul 2012 02:35:30 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2D3F8FC08; Tue, 24 Jul 2012 02:35:30 +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 q6O2ZU4a076715; Tue, 24 Jul 2012 02:35:30 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6O2ZU0X076713; Tue, 24 Jul 2012 02:35:30 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201207240235.q6O2ZU0X076713@svn.freebsd.org> From: Alan Cox Date: Tue, 24 Jul 2012 02:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238732 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 02:35:31 -0000 Author: alc Date: Tue Jul 24 02:35:30 2012 New Revision: 238732 URL: http://svn.freebsd.org/changeset/base/238732 Log: Addendum to r238604. If the inactive queue scan isn't restarted, then the variable "addl_page_shortage_init" isn't needed. X-MFC after: r238604 Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Tue Jul 24 01:18:19 2012 (r238731) +++ head/sys/vm/vm_pageout.c Tue Jul 24 02:35:30 2012 (r238732) @@ -873,7 +873,7 @@ vm_pageout_scan(int pass) vm_page_t m, next; struct vm_page marker; int page_shortage, maxscan, pcount; - int addl_page_shortage, addl_page_shortage_init; + int addl_page_shortage; vm_object_t object; int actcount; int vnodes_skipped = 0; @@ -889,13 +889,13 @@ vm_pageout_scan(int pass) */ uma_reclaim(); - addl_page_shortage_init = atomic_readandclear_int(&vm_pageout_deficit); + addl_page_shortage = atomic_readandclear_int(&vm_pageout_deficit); /* * Calculate the number of pages we want to either free or move * to the cache. */ - page_shortage = vm_paging_target() + addl_page_shortage_init; + page_shortage = vm_paging_target() + addl_page_shortage; vm_pageout_init_marker(&marker, PQ_INACTIVE); @@ -921,7 +921,6 @@ vm_pageout_scan(int pass) maxlaunder = 10000; vm_page_lock_queues(); queues_locked = TRUE; - addl_page_shortage = addl_page_shortage_init; maxscan = cnt.v_inactive_count; for (m = TAILQ_FIRST(&vm_page_queues[PQ_INACTIVE].pl); From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 02:58:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1ADD8106566C; Tue, 24 Jul 2012 02:58:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03B3B8FC0C; Tue, 24 Jul 2012 02:58: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 q6O2wA4H078945; Tue, 24 Jul 2012 02:58:10 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6O2wAj0078936; Tue, 24 Jul 2012 02:58:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207240258.q6O2wAj0078936@svn.freebsd.org> From: Warner Losh Date: Tue, 24 Jul 2012 02:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238733 - in vendor/dtc/dist: . Documentation libfdt tests X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 02:58:11 -0000 Author: imp Date: Tue Jul 24 02:58:10 2012 New Revision: 238733 URL: http://svn.freebsd.org/changeset/base/238733 Log: Import dtc from git://git.jdl.com/software/dtc hash f807af192828222dee7a5c9f94d999673bb4d8a1 Modified: vendor/dtc/dist/Documentation/dts-format.txt vendor/dtc/dist/Documentation/manual.txt vendor/dtc/dist/Makefile vendor/dtc/dist/checks.c vendor/dtc/dist/convert-dtsv0-lexer.l vendor/dtc/dist/data.c vendor/dtc/dist/dtc-lexer.l vendor/dtc/dist/dtc-parser.y vendor/dtc/dist/dtc.c vendor/dtc/dist/dtc.h vendor/dtc/dist/flattree.c vendor/dtc/dist/fstree.c vendor/dtc/dist/libfdt/Makefile.libfdt vendor/dtc/dist/libfdt/fdt.c vendor/dtc/dist/libfdt/fdt_ro.c vendor/dtc/dist/libfdt/fdt_rw.c vendor/dtc/dist/libfdt/libfdt.h vendor/dtc/dist/libfdt/libfdt_env.h vendor/dtc/dist/libfdt/libfdt_internal.h vendor/dtc/dist/livetree.c vendor/dtc/dist/srcpos.c vendor/dtc/dist/srcpos.h vendor/dtc/dist/tests/Makefile.tests vendor/dtc/dist/tests/dtbs_equal_ordered.c vendor/dtc/dist/tests/dtc-checkfails.sh vendor/dtc/dist/tests/extra-terminating-null.c vendor/dtc/dist/tests/get_alias.c vendor/dtc/dist/tests/include1.dts vendor/dtc/dist/tests/mangle-layout.c vendor/dtc/dist/tests/notfound.c vendor/dtc/dist/tests/open_pack.c vendor/dtc/dist/tests/path_offset.c vendor/dtc/dist/tests/path_offset_aliases.c vendor/dtc/dist/tests/run_tests.sh vendor/dtc/dist/tests/rw_tree1.c vendor/dtc/dist/tests/setprop.c vendor/dtc/dist/tests/setprop_inplace.c vendor/dtc/dist/tests/subnode_offset.c vendor/dtc/dist/tests/sw_tree1.c vendor/dtc/dist/tests/test_tree1.dts vendor/dtc/dist/tests/testdata.h vendor/dtc/dist/tests/tests.h vendor/dtc/dist/tests/tests.sh vendor/dtc/dist/tests/testutils.c vendor/dtc/dist/tests/trees.S vendor/dtc/dist/tests/value-labels.c vendor/dtc/dist/treesource.c vendor/dtc/dist/util.c vendor/dtc/dist/util.h Modified: vendor/dtc/dist/Documentation/dts-format.txt ============================================================================== --- vendor/dtc/dist/Documentation/dts-format.txt Tue Jul 24 02:35:30 2012 (r238732) +++ vendor/dtc/dist/Documentation/dts-format.txt Tue Jul 24 02:58:10 2012 (r238733) @@ -29,18 +29,28 @@ except for properties with empty (zero l form: [label:] property-name; -Property values may be defined as an array of 32-bit integer cells, as -NUL-terminated strings, as bytestrings or a combination of these. +Property values may be defined as an array of 8, 16, 32, or 64-bit integer +elements, as NUL-terminated strings, as bytestrings or a combination of these. -* Arrays of cells are represented by angle brackets surrounding a - space separated list of C-style integers +* Arrays are represented by angle brackets surrounding a space separated list + of C-style integers or character literals. Array elements default to 32-bits + in size. An array of 32-bit elements is also known as a cell list or a list + of cells. A cell being an unsigned 32-bit integer. e.g. interrupts = <17 0xc>; -* A 64-bit value is represented with two 32-bit cells. +* A 64-bit value can be represented with two 32-bit elements. e.g. clock-frequency = <0x00000001 0x00000000>; +* The storage size of an element can be changed using the /bits/ prefix. The + /bits/ prefix allows for the creation of 8, 16, 32, and 64-bit elements. + The resulting array will not be padded to a multiple of the default 32-bit + element size. + + e.g. interrupts = /bits/ 8 <17 0xc>; + e.g. clock-frequency = /bits/ 64 <0x0000000100000000>; + * A NUL-terminated string value is represented using double quotes (the property value is considered to include the terminating NUL character). @@ -59,19 +69,20 @@ NUL-terminated strings, as bytestrings o e.g. compatible = "ns16550", "ns8250"; example = <0xf00f0000 19>, "a strange property format"; -* In a cell array a reference to another node will be expanded to that - node's phandle. References may by '&' followed by a node's label: +* In an array a reference to another node will be expanded to that node's + phandle. References may by '&' followed by a node's label: e.g. interrupt-parent = < &mpic >; or they may be '&' followed by a node's full path in braces: e.g. interrupt-parent = < &{/soc/interrupt-controller@40000} >; + References are only permitted in arrays that have an element size of + 32-bits. -* Outside a cell array, a reference to another node will be expanded - to that node's full path. +* Outside an array, a reference to another node will be expanded to that + node's full path. e.g. ethernet0 = &EMAC0; * Labels may also appear before or after any component of a property - value, or between cells of a cell array, or between bytes of a - bytestring. + value, or between elements of an array, or between bytes of a bytestring. e.g. reg = reglabel: <0 sizelabel: 0x1000000>; e.g. prop = [ab cd ef byte4: 00 ff fe]; e.g. str = start: "string value" end: ; @@ -108,3 +119,4 @@ Version 1 DTS files have the overall lay -- David Gibson -- Yoder Stuart + -- Anton Staaf Modified: vendor/dtc/dist/Documentation/manual.txt ============================================================================== --- vendor/dtc/dist/Documentation/manual.txt Tue Jul 24 02:35:30 2012 (r238732) +++ vendor/dtc/dist/Documentation/manual.txt Tue Jul 24 02:58:10 2012 (r238733) @@ -21,7 +21,7 @@ III - libfdt IV - Utility Tools 1) convert-dtsv0 -- Conversion to Version 1 - 1) ftdump + 1) fdtdump I - "dtc", the device tree compiler @@ -106,6 +106,9 @@ Options: -O The generated output format, as listed above. + -d + Generate a dependency file during compilation. + -q Quiet: -q suppress warnings, -qq errors, -qqq all @@ -643,10 +646,10 @@ a new file with a "v1" appended the file Comments, empty lines, etc. are preserved. -2) ftdump -- Flat Tree dumping utility +2) fdtdump -- Flat Device Tree dumping utility -The ftdump program prints a readable version of a flat device tree file. +The fdtdump program prints a readable version of a flat device tree file. -The syntax of the ftdump command line is: +The syntax of the fdtdump command line is: - ftdump + fdtdump Modified: vendor/dtc/dist/Makefile ============================================================================== --- vendor/dtc/dist/Makefile Tue Jul 24 02:35:30 2012 (r238732) +++ vendor/dtc/dist/Makefile Tue Jul 24 02:58:10 2012 (r238733) @@ -9,14 +9,16 @@ # CONFIG_LOCALVERSION from some future config system. # VERSION = 1 -PATCHLEVEL = 2 +PATCHLEVEL = 3 SUBLEVEL = 0 EXTRAVERSION = LOCAL_VERSION = CONFIG_LOCALVERSION = -CPPFLAGS = -I libfdt -CFLAGS = -Wall -g -Os -fPIC -Wpointer-arith -Wcast-qual +CPPFLAGS = -I libfdt -I . +WARNINGS = -Werror -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \ + -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls +CFLAGS = -g -Os -fPIC -Werror $(WARNINGS) BISON = bison LEX = flex @@ -103,12 +105,15 @@ endef include Makefile.convert-dtsv0 include Makefile.dtc -include Makefile.ftdump +include Makefile.utils BIN += convert-dtsv0 BIN += dtc -BIN += ftdump +BIN += fdtdump +BIN += fdtget +BIN += fdtput +SCRIPTS = dtdiff all: $(BIN) libfdt @@ -116,7 +121,9 @@ all: $(BIN) libfdt ifneq ($(DEPTARGETS),) -include $(DTC_OBJS:%.o=%.d) -include $(CONVERT_OBJS:%.o=%.d) --include $(FTDUMP_OBJS:%.o=%.d) +-include $(FDTDUMP_OBJS:%.o=%.d) +-include $(FDTGET_OBJS:%.o=%.d) +-include $(FDTPUT_OBJS:%.o=%.d) endif @@ -127,7 +134,7 @@ endif LIBFDT_objdir = libfdt LIBFDT_srcdir = libfdt LIBFDT_archive = $(LIBFDT_objdir)/libfdt.a -LIBFDT_lib = $(LIBFDT_objdir)/libfdt.$(SHAREDLIB_EXT) +LIBFDT_lib = $(LIBFDT_objdir)/libfdt-$(DTC_VERSION).$(SHAREDLIB_EXT) LIBFDT_include = $(addprefix $(LIBFDT_srcdir)/,$(LIBFDT_INCLUDES)) LIBFDT_version = $(addprefix $(LIBFDT_srcdir)/,$(LIBFDT_VERSION)) @@ -153,12 +160,14 @@ endif # intermediate target and building them again "for real" .SECONDARY: $(DTC_GEN_SRCS) $(CONVERT_GEN_SRCS) -install: all +install: all $(SCRIPTS) @$(VECHO) INSTALL $(INSTALL) -d $(DESTDIR)$(BINDIR) - $(INSTALL) $(BIN) $(DESTDIR)$(BINDIR) + $(INSTALL) $(BIN) $(SCRIPTS) $(DESTDIR)$(BINDIR) $(INSTALL) -d $(DESTDIR)$(LIBDIR) $(INSTALL) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR) + ln -sf $(notdir $(LIBFDT_lib)) $(DESTDIR)$(LIBDIR)/$(LIBFDT_soname) + ln -sf $(LIBFDT_soname) $(DESTDIR)$(LIBDIR)/libfdt.$(SHAREDLIB_EXT) $(INSTALL) -m 644 $(LIBFDT_archive) $(DESTDIR)$(LIBDIR) $(INSTALL) -d $(DESTDIR)$(INCLUDEDIR) $(INSTALL) -m 644 $(LIBFDT_include) $(DESTDIR)$(INCLUDEDIR) @@ -173,19 +182,29 @@ convert-dtsv0: $(CONVERT_OBJS) @$(VECHO) LD $@ $(LINK.c) -o $@ $^ -ftdump: $(FTDUMP_OBJS) +fdtdump: $(FDTDUMP_OBJS) + +fdtget: $(FDTGET_OBJS) $(LIBFDT_archive) + +fdtput: $(FDTPUT_OBJS) $(LIBFDT_archive) # # Testsuite rules # TESTS_PREFIX=tests/ + +TESTS_BIN += dtc +TESTS_BIN += convert-dtsv0 +TESTS_BIN += fdtput +TESTS_BIN += fdtget + include tests/Makefile.tests # # Clean rules # -STD_CLEANFILES = *~ *.o *.so *.d *.a *.i *.s core a.out vgcore.* \ +STD_CLEANFILES = *~ *.o *.$(SHAREDLIB_EXT) *.d *.a *.i *.s core a.out vgcore.* \ *.tab.[ch] *.lex.c *.output clean: libfdt_clean tests_clean @@ -231,8 +250,7 @@ clean: libfdt_clean tests_clean $(LIBFDT_lib): @$(VECHO) LD $@ - $(CC) $(LDFLAGS) -fPIC $(SHAREDLIB_LINK_OPTIONS)$(notdir $@) -o $(LIBFDT_objdir)/libfdt-$(DTC_VERSION).$(SHAREDLIB_EXT) $^ - ln -sf libfdt-$(DTC_VERSION).$(SHAREDLIB_EXT) $(LIBFDT_objdir)/libfdt.$(SHAREDLIB_EXT) + $(CC) $(LDFLAGS) -fPIC $(SHAREDLIB_LINK_OPTIONS)$(LIBFDT_soname) -o $(LIBFDT_lib) $^ %.lex.c: %.l @$(VECHO) LEX $@ Modified: vendor/dtc/dist/checks.c ============================================================================== --- vendor/dtc/dist/checks.c Tue Jul 24 02:35:30 2012 (r238732) +++ vendor/dtc/dist/checks.c Tue Jul 24 02:58:10 2012 (r238733) @@ -31,12 +31,6 @@ #define TRACE(c, fmt, ...) do { } while (0) #endif -enum checklevel { - IGNORE = 0, - WARN = 1, - ERROR = 2, -}; - enum checkstatus { UNCHECKED = 0, PREREQ, @@ -57,14 +51,14 @@ struct check { node_check_fn node_fn; prop_check_fn prop_fn; void *data; - enum checklevel level; + bool warn, error; enum checkstatus status; int inprogress; int num_prereqs; struct check **prereq; }; -#define CHECK(nm, tfn, nfn, pfn, d, lvl, ...) \ +#define CHECK_ENTRY(nm, tfn, nfn, pfn, d, w, e, ...) \ static struct check *nm##_prereqs[] = { __VA_ARGS__ }; \ static struct check nm = { \ .name = #nm, \ @@ -72,20 +66,37 @@ struct check { .node_fn = (nfn), \ .prop_fn = (pfn), \ .data = (d), \ - .level = (lvl), \ + .warn = (w), \ + .error = (e), \ .status = UNCHECKED, \ .num_prereqs = ARRAY_SIZE(nm##_prereqs), \ .prereq = nm##_prereqs, \ }; - -#define TREE_CHECK(nm, d, lvl, ...) \ - CHECK(nm, check_##nm, NULL, NULL, d, lvl, __VA_ARGS__) -#define NODE_CHECK(nm, d, lvl, ...) \ - CHECK(nm, NULL, check_##nm, NULL, d, lvl, __VA_ARGS__) -#define PROP_CHECK(nm, d, lvl, ...) \ - CHECK(nm, NULL, NULL, check_##nm, d, lvl, __VA_ARGS__) -#define BATCH_CHECK(nm, lvl, ...) \ - CHECK(nm, NULL, NULL, NULL, NULL, lvl, __VA_ARGS__) +#define WARNING(nm, tfn, nfn, pfn, d, ...) \ + CHECK_ENTRY(nm, tfn, nfn, pfn, d, true, false, __VA_ARGS__) +#define ERROR(nm, tfn, nfn, pfn, d, ...) \ + CHECK_ENTRY(nm, tfn, nfn, pfn, d, false, true, __VA_ARGS__) +#define CHECK(nm, tfn, nfn, pfn, d, ...) \ + CHECK_ENTRY(nm, tfn, nfn, pfn, d, false, false, __VA_ARGS__) + +#define TREE_WARNING(nm, d, ...) \ + WARNING(nm, check_##nm, NULL, NULL, d, __VA_ARGS__) +#define TREE_ERROR(nm, d, ...) \ + ERROR(nm, check_##nm, NULL, NULL, d, __VA_ARGS__) +#define TREE_CHECK(nm, d, ...) \ + CHECK(nm, check_##nm, NULL, NULL, d, __VA_ARGS__) +#define NODE_WARNING(nm, d, ...) \ + WARNING(nm, NULL, check_##nm, NULL, d, __VA_ARGS__) +#define NODE_ERROR(nm, d, ...) \ + ERROR(nm, NULL, check_##nm, NULL, d, __VA_ARGS__) +#define NODE_CHECK(nm, d, ...) \ + CHECK(nm, NULL, check_##nm, NULL, d, __VA_ARGS__) +#define PROP_WARNING(nm, d, ...) \ + WARNING(nm, NULL, NULL, check_##nm, d, __VA_ARGS__) +#define PROP_ERROR(nm, d, ...) \ + ERROR(nm, NULL, NULL, check_##nm, d, __VA_ARGS__) +#define PROP_CHECK(nm, d, ...) \ + CHECK(nm, NULL, NULL, check_##nm, d, __VA_ARGS__) #ifdef __GNUC__ static inline void check_msg(struct check *c, const char *fmt, ...) __attribute__((format (printf, 2, 3))); @@ -95,13 +106,13 @@ static inline void check_msg(struct chec va_list ap; va_start(ap, fmt); - if ((c->level < WARN) || (c->level <= quiet)) - return; /* Suppress message */ - - fprintf(stderr, "%s (%s): ", - (c->level == ERROR) ? "ERROR" : "Warning", c->name); - vfprintf(stderr, fmt, ap); - fprintf(stderr, "\n"); + if ((c->warn && (quiet < 1)) + || (c->error && (quiet < 2))) { + fprintf(stderr, "%s (%s): ", + (c->error) ? "ERROR" : "Warning", c->name); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + } } #define FAIL(c, ...) \ @@ -167,7 +178,7 @@ static int run_check(struct check *c, st out: c->inprogress = 0; - if ((c->status != PASSED) && (c->level == ERROR)) + if ((c->status != PASSED) && (c->error)) error = 1; return error; } @@ -176,6 +187,13 @@ out: * Utility check functions */ +/* A check which always fails, for testing purposes only */ +static inline void check_always_fail(struct check *c, struct node *dt) +{ + FAIL(c, "always_fail check"); +} +TREE_CHECK(always_fail, NULL); + static void check_is_string(struct check *c, struct node *root, struct node *node) { @@ -190,8 +208,10 @@ static void check_is_string(struct check FAIL(c, "\"%s\" property in %s is not a string", propname, node->fullpath); } -#define CHECK_IS_STRING(nm, propname, lvl) \ - CHECK(nm, NULL, check_is_string, NULL, (propname), (lvl)) +#define WARNING_IF_NOT_STRING(nm, propname) \ + WARNING(nm, NULL, check_is_string, NULL, (propname)) +#define ERROR_IF_NOT_STRING(nm, propname) \ + ERROR(nm, NULL, check_is_string, NULL, (propname)) static void check_is_cell(struct check *c, struct node *root, struct node *node) @@ -207,8 +227,10 @@ static void check_is_cell(struct check * FAIL(c, "\"%s\" property in %s is not a single cell", propname, node->fullpath); } -#define CHECK_IS_CELL(nm, propname, lvl) \ - CHECK(nm, NULL, check_is_cell, NULL, (propname), (lvl)) +#define WARNING_IF_NOT_CELL(nm, propname) \ + WARNING(nm, NULL, check_is_cell, NULL, (propname)) +#define ERROR_IF_NOT_CELL(nm, propname) \ + ERROR(nm, NULL, check_is_cell, NULL, (propname)) /* * Structural check functions @@ -227,7 +249,7 @@ static void check_duplicate_node_names(s FAIL(c, "Duplicate node name %s", child->fullpath); } -NODE_CHECK(duplicate_node_names, NULL, ERROR); +NODE_ERROR(duplicate_node_names, NULL); static void check_duplicate_property_names(struct check *c, struct node *dt, struct node *node) @@ -240,7 +262,7 @@ static void check_duplicate_property_nam FAIL(c, "Duplicate property name %s in %s", prop->name, node->fullpath); } -NODE_CHECK(duplicate_property_names, NULL, ERROR); +NODE_ERROR(duplicate_property_names, NULL); #define LOWERCASE "abcdefghijklmnopqrstuvwxyz" #define UPPERCASE "ABCDEFGHIJKLMNOPQRSTUVWXYZ" @@ -256,7 +278,7 @@ static void check_node_name_chars(struct FAIL(c, "Bad character '%c' in node %s", node->name[n], node->fullpath); } -NODE_CHECK(node_name_chars, PROPNODECHARS "@", ERROR); +NODE_ERROR(node_name_chars, PROPNODECHARS "@"); static void check_node_name_format(struct check *c, struct node *dt, struct node *node) @@ -265,7 +287,7 @@ static void check_node_name_format(struc FAIL(c, "Node %s has multiple '@' characters in name", node->fullpath); } -NODE_CHECK(node_name_format, NULL, ERROR, &node_name_chars); +NODE_ERROR(node_name_format, NULL, &node_name_chars); static void check_property_name_chars(struct check *c, struct node *dt, struct node *node, struct property *prop) @@ -276,7 +298,63 @@ static void check_property_name_chars(st FAIL(c, "Bad character '%c' in property name \"%s\", node %s", prop->name[n], prop->name, node->fullpath); } -PROP_CHECK(property_name_chars, PROPNODECHARS, ERROR); +PROP_ERROR(property_name_chars, PROPNODECHARS); + +#define DESCLABEL_FMT "%s%s%s%s%s" +#define DESCLABEL_ARGS(node,prop,mark) \ + ((mark) ? "value of " : ""), \ + ((prop) ? "'" : ""), \ + ((prop) ? (prop)->name : ""), \ + ((prop) ? "' in " : ""), (node)->fullpath + +static void check_duplicate_label(struct check *c, struct node *dt, + const char *label, struct node *node, + struct property *prop, struct marker *mark) +{ + struct node *othernode = NULL; + struct property *otherprop = NULL; + struct marker *othermark = NULL; + + othernode = get_node_by_label(dt, label); + + if (!othernode) + otherprop = get_property_by_label(dt, label, &othernode); + if (!othernode) + othermark = get_marker_label(dt, label, &othernode, + &otherprop); + + if (!othernode) + return; + + if ((othernode != node) || (otherprop != prop) || (othermark != mark)) + FAIL(c, "Duplicate label '%s' on " DESCLABEL_FMT + " and " DESCLABEL_FMT, + label, DESCLABEL_ARGS(node, prop, mark), + DESCLABEL_ARGS(othernode, otherprop, othermark)); +} + +static void check_duplicate_label_node(struct check *c, struct node *dt, + struct node *node) +{ + struct label *l; + + for_each_label(node->labels, l) + check_duplicate_label(c, dt, l->label, node, NULL, NULL); +} +static void check_duplicate_label_prop(struct check *c, struct node *dt, + struct node *node, struct property *prop) +{ + struct marker *m = prop->val.markers; + struct label *l; + + for_each_label(prop->labels, l) + check_duplicate_label(c, dt, l->label, node, prop, NULL); + + for_each_marker_of_type(m, LABEL) + check_duplicate_label(c, dt, m->ref, node, prop, m); +} +ERROR(duplicate_label, NULL, check_duplicate_label_node, + check_duplicate_label_prop, NULL); static void check_explicit_phandles(struct check *c, struct node *root, struct node *node, struct property *prop) @@ -335,7 +413,7 @@ static void check_explicit_phandles(stru node->phandle = phandle; } -PROP_CHECK(explicit_phandles, NULL, ERROR); +PROP_ERROR(explicit_phandles, NULL); static void check_name_properties(struct check *c, struct node *root, struct node *node) @@ -364,8 +442,8 @@ static void check_name_properties(struct free(prop); } } -CHECK_IS_STRING(name_is_string, "name", ERROR); -NODE_CHECK(name_properties, NULL, ERROR, &name_is_string); +ERROR_IF_NOT_STRING(name_is_string, "name"); +NODE_ERROR(name_properties, NULL, &name_is_string); /* * Reference fixup functions @@ -392,7 +470,7 @@ static void fixup_phandle_references(str *((cell_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle); } } -CHECK(phandle_references, NULL, NULL, fixup_phandle_references, NULL, ERROR, +ERROR(phandle_references, NULL, NULL, fixup_phandle_references, NULL, &duplicate_node_names, &explicit_phandles); static void fixup_path_references(struct check *c, struct node *dt, @@ -417,19 +495,19 @@ static void fixup_path_references(struct strlen(path) + 1); } } -CHECK(path_references, NULL, NULL, fixup_path_references, NULL, ERROR, +ERROR(path_references, NULL, NULL, fixup_path_references, NULL, &duplicate_node_names); /* * Semantic checks */ -CHECK_IS_CELL(address_cells_is_cell, "#address-cells", WARN); -CHECK_IS_CELL(size_cells_is_cell, "#size-cells", WARN); -CHECK_IS_CELL(interrupt_cells_is_cell, "#interrupt-cells", WARN); - -CHECK_IS_STRING(device_type_is_string, "device_type", WARN); -CHECK_IS_STRING(model_is_string, "model", WARN); -CHECK_IS_STRING(status_is_string, "status", WARN); +WARNING_IF_NOT_CELL(address_cells_is_cell, "#address-cells"); +WARNING_IF_NOT_CELL(size_cells_is_cell, "#size-cells"); +WARNING_IF_NOT_CELL(interrupt_cells_is_cell, "#interrupt-cells"); + +WARNING_IF_NOT_STRING(device_type_is_string, "device_type"); +WARNING_IF_NOT_STRING(model_is_string, "model"); +WARNING_IF_NOT_STRING(status_is_string, "status"); static void fixup_addr_size_cells(struct check *c, struct node *dt, struct node *node) @@ -447,8 +525,8 @@ static void fixup_addr_size_cells(struct if (prop) node->size_cells = propval_cell(prop); } -CHECK(addr_size_cells, NULL, fixup_addr_size_cells, NULL, NULL, WARN, - &address_cells_is_cell, &size_cells_is_cell); +WARNING(addr_size_cells, NULL, fixup_addr_size_cells, NULL, NULL, + &address_cells_is_cell, &size_cells_is_cell); #define node_addr_cells(n) \ (((n)->addr_cells == -1) ? 2 : (n)->addr_cells) @@ -482,7 +560,7 @@ static void check_reg_format(struct chec "(#address-cells == %d, #size-cells == %d)", node->fullpath, prop->val.len, addr_cells, size_cells); } -NODE_CHECK(reg_format, NULL, WARN, &addr_size_cells); +NODE_WARNING(reg_format, NULL, &addr_size_cells); static void check_ranges_format(struct check *c, struct node *dt, struct node *node) @@ -523,7 +601,7 @@ static void check_ranges_format(struct c p_addr_cells, c_addr_cells, c_size_cells); } } -NODE_CHECK(ranges_format, NULL, WARN, &addr_size_cells); +NODE_WARNING(ranges_format, NULL, &addr_size_cells); /* * Style checks @@ -550,7 +628,7 @@ static void check_avoid_default_addr_siz FAIL(c, "Relying on default #size-cells value for %s", node->fullpath); } -NODE_CHECK(avoid_default_addr_size, NULL, WARN, &addr_size_cells); +NODE_WARNING(avoid_default_addr_size, NULL, &addr_size_cells); static void check_obsolete_chosen_interrupt_controller(struct check *c, struct node *dt) @@ -567,12 +645,15 @@ static void check_obsolete_chosen_interr FAIL(c, "/chosen has obsolete \"interrupt-controller\" " "property"); } -TREE_CHECK(obsolete_chosen_interrupt_controller, NULL, WARN); +TREE_WARNING(obsolete_chosen_interrupt_controller, NULL); static struct check *check_table[] = { &duplicate_node_names, &duplicate_property_names, &node_name_chars, &node_name_format, &property_name_chars, &name_is_string, &name_properties, + + &duplicate_label, + &explicit_phandles, &phandle_references, &path_references, @@ -583,8 +664,71 @@ static struct check *check_table[] = { &avoid_default_addr_size, &obsolete_chosen_interrupt_controller, + + &always_fail, }; +static void enable_warning_error(struct check *c, bool warn, bool error) +{ + int i; + + /* Raising level, also raise it for prereqs */ + if ((warn && !c->warn) || (error && !c->error)) + for (i = 0; i < c->num_prereqs; i++) + enable_warning_error(c->prereq[i], warn, error); + + c->warn = c->warn || warn; + c->error = c->error || error; +} + +static void disable_warning_error(struct check *c, bool warn, bool error) +{ + int i; + + /* Lowering level, also lower it for things this is the prereq + * for */ + if ((warn && c->warn) || (error && c->error)) { + for (i = 0; i < ARRAY_SIZE(check_table); i++) { + struct check *cc = check_table[i]; + int j; + + for (j = 0; j < cc->num_prereqs; j++) + if (cc->prereq[j] == c) + disable_warning_error(cc, warn, error); + } + } + + c->warn = c->warn && !warn; + c->error = c->error && !error; +} + +void parse_checks_option(bool warn, bool error, const char *optarg) +{ + int i; + const char *name = optarg; + bool enable = true; + + if ((strncmp(optarg, "no-", 3) == 0) + || (strncmp(optarg, "no_", 3) == 0)) { + name = optarg + 3; + enable = false; + } + + for (i = 0; i < ARRAY_SIZE(check_table); i++) { + struct check *c = check_table[i]; + + if (streq(c->name, name)) { + if (enable) + enable_warning_error(c, warn, error); + else + disable_warning_error(c, warn, error); + return; + } + } + + die("Unrecognized check name \"%s\"\n", name); +} + void process_checks(int force, struct boot_info *bi) { struct node *dt = bi->dt; @@ -594,7 +738,7 @@ void process_checks(int force, struct bo for (i = 0; i < ARRAY_SIZE(check_table); i++) { struct check *c = check_table[i]; - if (c->level != IGNORE) + if (c->warn || c->error) error = error || run_check(c, dt); } Modified: vendor/dtc/dist/convert-dtsv0-lexer.l ============================================================================== --- vendor/dtc/dist/convert-dtsv0-lexer.l Tue Jul 24 02:35:30 2012 (r238732) +++ vendor/dtc/dist/convert-dtsv0-lexer.l Tue Jul 24 02:58:10 2012 (r238733) @@ -17,7 +17,7 @@ * USA */ -%option noyywrap nounput noinput +%option noyywrap nounput noinput never-interactive %x INCLUDE %x BYTESTRING @@ -210,8 +210,10 @@ static void convert_file(const char *fna memcpy(newname, fname, len); memcpy(newname + len, suffix, sizeof(suffix)); - srcpos_file = dtc_open_file(fname, NULL); - yyin = srcpos_file->file; + yyin = fopen(fname, "r"); + if (!yyin) + die("Couldn't open input file %s: %s\n", + fname, strerror(errno)); yyout = fopen(newname, "w"); if (!yyout) Modified: vendor/dtc/dist/data.c ============================================================================== --- vendor/dtc/dist/data.c Tue Jul 24 02:35:30 2012 (r238732) +++ vendor/dtc/dist/data.c Tue Jul 24 02:58:10 2012 (r238733) @@ -68,40 +68,6 @@ struct data data_copy_mem(const char *me return d; } -static char get_oct_char(const char *s, int *i) -{ - char x[4]; - char *endx; - long val; - - x[3] = '\0'; - strncpy(x, s + *i, 3); - - val = strtol(x, &endx, 8); - - assert(endx > x); - - (*i) += endx - x; - return val; -} - -static char get_hex_char(const char *s, int *i) -{ - char x[3]; - char *endx; - long val; - - x[2] = '\0'; - strncpy(x, s + *i, 2); - - val = strtol(x, &endx, 16); - if (!(endx > x)) - die("\\x used with no following hex digits\n"); - - (*i) += endx - x; - return val; -} - struct data data_copy_escape_string(const char *s, int len) { int i = 0; @@ -114,53 +80,10 @@ struct data data_copy_escape_string(cons while (i < len) { char c = s[i++]; - if (c != '\\') { - q[d.len++] = c; - continue; - } - - c = s[i++]; - assert(c); - switch (c) { - case 'a': - q[d.len++] = '\a'; - break; - case 'b': - q[d.len++] = '\b'; - break; - case 't': - q[d.len++] = '\t'; - break; - case 'n': - q[d.len++] = '\n'; - break; - case 'v': - q[d.len++] = '\v'; - break; - case 'f': - q[d.len++] = '\f'; - break; - case 'r': - q[d.len++] = '\r'; - break; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - i--; /* need to re-read the first digit as - * part of the octal value */ - q[d.len++] = get_oct_char(s, &i); - break; - case 'x': - q[d.len++] = get_hex_char(s, &i); - break; - default: - q[d.len++] = c; - } + if (c == '\\') + c = get_escape_char(s, &i); + + q[d.len++] = c; } q[d.len++] = '\0'; @@ -245,11 +168,33 @@ struct data data_merge(struct data d1, s return d; } -struct data data_append_cell(struct data d, cell_t word) +struct data data_append_integer(struct data d, uint64_t value, int bits) { - cell_t beword = cpu_to_fdt32(word); + uint8_t value_8; + uint16_t value_16; + uint32_t value_32; + uint64_t value_64; + + switch (bits) { + case 8: + value_8 = value; + return data_append_data(d, &value_8, 1); + + case 16: + value_16 = cpu_to_fdt16(value); + return data_append_data(d, &value_16, 2); + + case 32: + value_32 = cpu_to_fdt32(value); + return data_append_data(d, &value_32, 4); + + case 64: + value_64 = cpu_to_fdt64(value); + return data_append_data(d, &value_64, 8); - return data_append_data(d, &beword, sizeof(beword)); + default: + die("Invalid literal size (%d)\n", bits); + } } struct data data_append_re(struct data d, const struct fdt_reserve_entry *re) @@ -262,11 +207,14 @@ struct data data_append_re(struct data d return data_append_data(d, &bere, sizeof(bere)); } -struct data data_append_addr(struct data d, uint64_t addr) +struct data data_append_cell(struct data d, cell_t word) { - uint64_t beaddr = cpu_to_fdt64(addr); + return data_append_integer(d, word, sizeof(word) * 8); +} - return data_append_data(d, &beaddr, sizeof(beaddr)); +struct data data_append_addr(struct data d, uint64_t addr) +{ + return data_append_integer(d, addr, sizeof(addr) * 8); } struct data data_append_byte(struct data d, uint8_t byte) Modified: vendor/dtc/dist/dtc-lexer.l ============================================================================== --- vendor/dtc/dist/dtc-lexer.l Tue Jul 24 02:35:30 2012 (r238732) +++ vendor/dtc/dist/dtc-lexer.l Tue Jul 24 02:58:10 2012 (r238733) @@ -18,7 +18,7 @@ * USA */ -%option noyywrap nounput noinput yylineno +%option noyywrap nounput noinput never-interactive %x INCLUDE %x BYTESTRING @@ -29,6 +29,7 @@ PROPNODECHAR [a-zA-Z0-9,._+*#?@-] PATHCHAR ({PROPNODECHAR}|[/]) LABEL [a-zA-Z_][a-zA-Z0-9_]* STRING \"([^\\"]|\\.)*\" +CHAR_LITERAL '([^']|\\')*' WS [[:space:]] COMMENT "/*"([^*]|\*+[^*/])*\*+"/" LINECOMMENT "//".*\n @@ -38,10 +39,12 @@ LINECOMMENT "//".*\n #include "srcpos.h" #include "dtc-parser.tab.h" +YYLTYPE yylloc; + +/* CAUTION: this will stop working if we ever use yyless() or yyunput() */ #define YY_USER_ACTION \ { \ - yylloc.file = srcpos_file; \ - yylloc.first_line = yylineno; \ + srcpos_update(&yylloc, yytext, yyleng); \ } /*#define LEXDEBUG 1*/ @@ -94,6 +97,12 @@ static int pop_input_file(void); return DT_MEMRESERVE; } +<*>"/bits/" { + DPRINT("Keyword: /bits/\n"); + BEGIN_DEFAULT(); + return DT_BITS; + } + <*>{LABEL}: { DPRINT("Label: %s\n", yytext); yylval.labelref = xstrdup(yytext); @@ -101,19 +110,26 @@ static int pop_input_file(void); return DT_LABEL; } -[0-9]+|0[xX][0-9a-fA-F]+ { +([0-9]+|0[xX][0-9a-fA-F]+)(U|L|UL|LL|ULL)? { yylval.literal = xstrdup(yytext); DPRINT("Literal: '%s'\n", yylval.literal); return DT_LITERAL; } -\&{LABEL} { /* label reference */ +<*>{CHAR_LITERAL} { + yytext[yyleng-1] = '\0'; + yylval.literal = xstrdup(yytext+1); + DPRINT("Character literal: %s\n", yylval.literal); + return DT_CHAR_LITERAL; + } + +<*>\&{LABEL} { /* label reference */ DPRINT("Ref: %s\n", yytext+1); yylval.labelref = xstrdup(yytext+1); return DT_REF; } -"&{/"{PATHCHAR}+\} { /* new-style path reference */ +<*>"&{/"{PATHCHAR}+\} { /* new-style path reference */ yytext[yyleng-1] = '\0'; DPRINT("Ref: %s\n", yytext+2); yylval.labelref = xstrdup(yytext+2); @@ -148,6 +164,15 @@ static int pop_input_file(void); <*>{COMMENT}+ /* eat C-style comments */ <*>{LINECOMMENT}+ /* eat C++-style comments */ +<*>"<<" { return DT_LSHIFT; }; +<*>">>" { return DT_RSHIFT; }; +<*>"<=" { return DT_LE; }; +<*>">=" { return DT_GE; }; +<*>"==" { return DT_EQ; }; +<*>"!=" { return DT_NE; }; +<*>"&&" { return DT_AND; }; +<*>"||" { return DT_OR; }; + <*>. { DPRINT("Char: %c (\\x%02x)\n", yytext[0], (unsigned)yytext[0]); @@ -165,100 +190,25 @@ static int pop_input_file(void); %% - -/* - * Stack of nested include file contexts. - */ - -struct incl_file { - struct dtc_file *file; - YY_BUFFER_STATE yy_prev_buf; - int yy_prev_lineno; - struct incl_file *prev; -}; - -static struct incl_file *incl_file_stack; - - -/* - * Detect infinite include recursion. - */ -#define MAX_INCLUDE_DEPTH (100) - -static int incl_depth = 0; - - static void push_input_file(const char *filename) { - struct incl_file *incl_file; - struct dtc_file *newfile; - struct search_path search, *searchptr = NULL; - assert(filename); - if (incl_depth++ >= MAX_INCLUDE_DEPTH) - die("Includes nested too deeply"); - - if (srcpos_file) { - search.dir = srcpos_file->dir; - search.next = NULL; - search.prev = NULL; - searchptr = &search; - } - - newfile = dtc_open_file(filename, searchptr); + srcfile_push(filename); - incl_file = xmalloc(sizeof(struct incl_file)); + yyin = current_srcfile->f; - /* - * Save current context. - */ - incl_file->yy_prev_buf = YY_CURRENT_BUFFER; - incl_file->yy_prev_lineno = yylineno; - incl_file->file = srcpos_file; - incl_file->prev = incl_file_stack; - - incl_file_stack = incl_file; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 03:03:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 40929106566B; Tue, 24 Jul 2012 03:03:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11E2F8FC0A; Tue, 24 Jul 2012 03:03:13 +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 q6O33C5f079480; Tue, 24 Jul 2012 03:03:12 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6O33CX0079479; Tue, 24 Jul 2012 03:03:12 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207240303.q6O33CX0079479@svn.freebsd.org> From: Warner Losh Date: Tue, 24 Jul 2012 03:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238734 - vendor/dtc/dtc-f807af19 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 03:03:13 -0000 Author: imp Date: Tue Jul 24 03:03:12 2012 New Revision: 238734 URL: http://svn.freebsd.org/changeset/base/238734 Log: Tag DTC f807af192828222dee7a5c9f94d999673bb4d8a1 Added: vendor/dtc/dtc-f807af19/ - copied from r238733, vendor/dtc/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 03:46:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30F39106564A; Tue, 24 Jul 2012 03:46:59 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AC828FC08; Tue, 24 Jul 2012 03:46: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 q6O3kw1D083407; Tue, 24 Jul 2012 03:46:58 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6O3kwgH083405; Tue, 24 Jul 2012 03:46:58 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201207240346.q6O3kwgH083405@svn.freebsd.org> From: Eitan Adler Date: Tue, 24 Jul 2012 03:46:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238735 - stable/7/sys/cddl/compat/opensolaris/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 03:46:59 -0000 Author: eadler Date: Tue Jul 24 03:46:58 2012 New Revision: 238735 URL: http://svn.freebsd.org/changeset/base/238735 Log: MFC r230454: Use provided name when allocating ksid domain. It isn't really used on FreeBSD, but should fix a panic when pool is imported from another OS that is using this. Requested by: nox No objections: pjd Approved by: cperciva (implicit) Modified: stable/7/sys/cddl/compat/opensolaris/sys/sid.h Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/cddl/compat/opensolaris/sys/sid.h ============================================================================== --- stable/7/sys/cddl/compat/opensolaris/sys/sid.h Tue Jul 24 03:03:12 2012 (r238734) +++ stable/7/sys/cddl/compat/opensolaris/sys/sid.h Tue Jul 24 03:46:58 2012 (r238735) @@ -30,7 +30,7 @@ #define _OPENSOLARIS_SYS_SID_H_ typedef struct ksiddomain { - char kd_name[16]; /* Domain part of SID */ + char kd_name[1]; /* Domain part of SID */ } ksiddomain_t; typedef void ksid_t; @@ -39,8 +39,8 @@ ksid_lookupdomain(const char *domain) { ksiddomain_t *kd; - kd = kmem_alloc(sizeof(*kd), KM_SLEEP); - strlcpy(kd->kd_name, "FreeBSD", sizeof(kd->kd_name)); + kd = kmem_alloc(sizeof(*kd) + strlen(domain), KM_SLEEP); + strcpy(kd->kd_name, domain); return (kd); } From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 03:47:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28F56106564A; Tue, 24 Jul 2012 03:47:50 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 132728FC1C; Tue, 24 Jul 2012 03:47:49 +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 q6O3lnSw083508; Tue, 24 Jul 2012 03:47:49 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6O3ln5W083506; Tue, 24 Jul 2012 03:47:49 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201207240347.q6O3ln5W083506@svn.freebsd.org> From: Eitan Adler Date: Tue, 24 Jul 2012 03:47:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238736 - stable/8/sys/cddl/compat/opensolaris/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 03:47:50 -0000 Author: eadler Date: Tue Jul 24 03:47:49 2012 New Revision: 238736 URL: http://svn.freebsd.org/changeset/base/238736 Log: MFC r230454: Use provided name when allocating ksid domain. It isn't really used on FreeBSD, but should fix a panic when pool is imported from another OS that is using this. Requested by: nox No objections: pjd Approved by: cperciva (implicit) Modified: stable/8/sys/cddl/compat/opensolaris/sys/sid.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/cddl/compat/opensolaris/sys/sid.h ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/sys/sid.h Tue Jul 24 03:46:58 2012 (r238735) +++ stable/8/sys/cddl/compat/opensolaris/sys/sid.h Tue Jul 24 03:47:49 2012 (r238736) @@ -30,7 +30,7 @@ #define _OPENSOLARIS_SYS_SID_H_ typedef struct ksiddomain { - char kd_name[16]; /* Domain part of SID */ + char kd_name[1]; /* Domain part of SID */ } ksiddomain_t; typedef void ksid_t; @@ -39,8 +39,8 @@ ksid_lookupdomain(const char *domain) { ksiddomain_t *kd; - kd = kmem_alloc(sizeof(*kd), KM_SLEEP); - strlcpy(kd->kd_name, "FreeBSD", sizeof(kd->kd_name)); + kd = kmem_alloc(sizeof(*kd) + strlen(domain), KM_SLEEP); + strcpy(kd->kd_name, domain); return (kd); } From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 04:12:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 31F35106564A; Tue, 24 Jul 2012 04:12:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18D218FC12; Tue, 24 Jul 2012 04:12: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 q6O4Cji5085495; Tue, 24 Jul 2012 04:12:45 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6O4Cic3085487; Tue, 24 Jul 2012 04:12:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207240412.q6O4Cic3085487@svn.freebsd.org> From: Warner Losh Date: Tue, 24 Jul 2012 04:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238737 - in vendor/dtc/dist: . libfdt tests tests/search_dir tests/search_dir_b X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 04:12:45 -0000 Author: imp Date: Tue Jul 24 04:12:44 2012 New Revision: 238737 URL: http://svn.freebsd.org/changeset/base/238737 Log: Add missing files in f807af192828222dee7a5c9f94d999673bb4d8a1 import. Added: vendor/dtc/dist/Makefile.utils (contents, props changed) vendor/dtc/dist/dtdiff vendor/dtc/dist/fdtdump.c (contents, props changed) vendor/dtc/dist/fdtget.c (contents, props changed) vendor/dtc/dist/fdtput.c (contents, props changed) vendor/dtc/dist/libfdt/fdt_empty_tree.c (contents, props changed) vendor/dtc/dist/tests/appendprop.dts vendor/dtc/dist/tests/appendprop1.c (contents, props changed) vendor/dtc/dist/tests/appendprop2.c (contents, props changed) vendor/dtc/dist/tests/boot-cpuid.dts vendor/dtc/dist/tests/char_literal.c (contents, props changed) vendor/dtc/dist/tests/char_literal.dts vendor/dtc/dist/tests/dependencies.cmp vendor/dtc/dist/tests/dependencies.dts vendor/dtc/dist/tests/deps_inc1.dtsi vendor/dtc/dist/tests/deps_inc2.dtsi vendor/dtc/dist/tests/dtb_reverse.c (contents, props changed) vendor/dtc/dist/tests/dtbs_equal_unordered.c (contents, props changed) vendor/dtc/dist/tests/dtc-fails.sh (contents, props changed) vendor/dtc/dist/tests/fdtget-runtest.sh (contents, props changed) vendor/dtc/dist/tests/fdtput-runtest.sh (contents, props changed) vendor/dtc/dist/tests/include5a.dts vendor/dtc/dist/tests/integer-expressions.c (contents, props changed) vendor/dtc/dist/tests/label_repeated.dts vendor/dtc/dist/tests/lorem.txt (contents, props changed) vendor/dtc/dist/tests/multilabel.dts vendor/dtc/dist/tests/multilabel_merge.dts vendor/dtc/dist/tests/nonexist-node-ref2.dts vendor/dtc/dist/tests/reuse-label.dts vendor/dtc/dist/tests/reuse-label1.dts vendor/dtc/dist/tests/reuse-label2.dts vendor/dtc/dist/tests/reuse-label3.dts vendor/dtc/dist/tests/reuse-label4.dts vendor/dtc/dist/tests/reuse-label5.dts vendor/dtc/dist/tests/reuse-label6.dts vendor/dtc/dist/tests/search_dir/ vendor/dtc/dist/tests/search_dir/search_test.dtsi vendor/dtc/dist/tests/search_dir/search_test2.dtsi vendor/dtc/dist/tests/search_dir_b/ vendor/dtc/dist/tests/search_dir_b/search_paths_subdir.dts vendor/dtc/dist/tests/search_dir_b/search_test_b.dtsi vendor/dtc/dist/tests/search_dir_b/search_test_b2.dtsi vendor/dtc/dist/tests/search_dir_b/search_test_c.dtsi vendor/dtc/dist/tests/search_paths.dts vendor/dtc/dist/tests/search_paths_b.dts vendor/dtc/dist/tests/sized_cells.c (contents, props changed) vendor/dtc/dist/tests/sized_cells.dts vendor/dtc/dist/tests/test_tree1_merge.dts vendor/dtc/dist/tests/test_tree1_merge_labelled.dts vendor/dtc/dist/tests/test_tree1_merge_path.dts vendor/dtc/dist/tests/test_tree1_wrong1.dts vendor/dtc/dist/tests/test_tree1_wrong2.dts vendor/dtc/dist/tests/test_tree1_wrong3.dts vendor/dtc/dist/tests/test_tree1_wrong4.dts vendor/dtc/dist/tests/test_tree1_wrong5.dts vendor/dtc/dist/tests/test_tree1_wrong6.dts vendor/dtc/dist/tests/test_tree1_wrong7.dts vendor/dtc/dist/tests/test_tree1_wrong8.dts vendor/dtc/dist/tests/test_tree1_wrong9.dts vendor/dtc/dist/tests/utilfdt_test.c (contents, props changed) Added: vendor/dtc/dist/Makefile.utils ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dtc/dist/Makefile.utils Tue Jul 24 04:12:44 2012 (r238737) @@ -0,0 +1,24 @@ +# +# This is not a complete Makefile of itself. Instead, it is designed to +# be easily embeddable into other systems of Makefiles. +# + +FDTDUMP_SRCS = \ + fdtdump.c \ + util.c + +FDTDUMP_OBJS = $(FDTDUMP_SRCS:%.c=%.o) + + +FDTGET_SRCS = \ + fdtget.c \ + util.c + +FDTGET_OBJS = $(FDTGET_SRCS:%.c=%.o) + + +FDTPUT_SRCS = \ + fdtput.c \ + util.c + +FDTPUT_OBJS = $(FDTPUT_SRCS:%.c=%.o) Added: vendor/dtc/dist/dtdiff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dtc/dist/dtdiff Tue Jul 24 04:12:44 2012 (r238737) @@ -0,0 +1,38 @@ +#! /bin/bash + +# This script uses the bash <(...) extension. +# If you want to change this to work with a generic /bin/sh, make sure +# you fix that. + + +DTC=dtc + +source_and_sort () { + DT="$1" + if [ -d "$DT" ]; then + IFORMAT=fs + elif [ -f "$DT" ]; then + case "$DT" in + *.dts) + IFORMAT=dts + ;; + *.dtb) + IFORMAT=dtb + ;; + esac + fi + + if [ -z "$IFORMAT" ]; then + echo "Unrecognized format for $DT" >&2 + exit 2 + fi + + $DTC -I $IFORMAT -O dts -qq -f -s -o - "$DT" +} + +if [ $# != 2 ]; then + echo "Usage: dtdiff " >&2 + exit 1 +fi + +diff -u <(source_and_sort "$1") <(source_and_sort "$2") Added: vendor/dtc/dist/fdtdump.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dtc/dist/fdtdump.c Tue Jul 24 04:12:44 2012 (r238737) @@ -0,0 +1,162 @@ +/* + * fdtdump.c - Contributed by Pantelis Antoniou + */ + +#include +#include +#include +#include +#include + +#include +#include + +#include "util.h" + +#define ALIGN(x, a) (((x) + ((a) - 1)) & ~((a) - 1)) +#define PALIGN(p, a) ((void *)(ALIGN((unsigned long)(p), (a)))) +#define GET_CELL(p) (p += 4, *((const uint32_t *)(p-4))) + +static void print_data(const char *data, int len) +{ + int i; + const char *p = data; + + /* no data, don't print */ + if (len == 0) + return; + + if (util_is_printable_string(data, len)) { + printf(" = \"%s\"", (const char *)data); + } else if ((len % 4) == 0) { + printf(" = <"); + for (i = 0; i < len; i += 4) + printf("0x%08x%s", fdt32_to_cpu(GET_CELL(p)), + i < (len - 4) ? " " : ""); + printf(">"); + } else { + printf(" = ["); + for (i = 0; i < len; i++) + printf("%02x%s", *p++, i < len - 1 ? " " : ""); + printf("]"); + } +} + +static void dump_blob(void *blob) +{ + struct fdt_header *bph = blob; + uint32_t off_mem_rsvmap = fdt32_to_cpu(bph->off_mem_rsvmap); + uint32_t off_dt = fdt32_to_cpu(bph->off_dt_struct); + uint32_t off_str = fdt32_to_cpu(bph->off_dt_strings); + struct fdt_reserve_entry *p_rsvmap = + (struct fdt_reserve_entry *)((char *)blob + off_mem_rsvmap); + const char *p_struct = (const char *)blob + off_dt; + const char *p_strings = (const char *)blob + off_str; + uint32_t version = fdt32_to_cpu(bph->version); + uint32_t totalsize = fdt32_to_cpu(bph->totalsize); + uint32_t tag; + const char *p, *s, *t; + int depth, sz, shift; + int i; + uint64_t addr, size; + + depth = 0; + shift = 4; + + printf("/dts-v1/;\n"); + printf("// magic:\t\t0x%x\n", fdt32_to_cpu(bph->magic)); + printf("// totalsize:\t\t0x%x (%d)\n", totalsize, totalsize); + printf("// off_dt_struct:\t0x%x\n", off_dt); + printf("// off_dt_strings:\t0x%x\n", off_str); + printf("// off_mem_rsvmap:\t0x%x\n", off_mem_rsvmap); + printf("// version:\t\t%d\n", version); + printf("// last_comp_version:\t%d\n", + fdt32_to_cpu(bph->last_comp_version)); + if (version >= 2) + printf("// boot_cpuid_phys:\t0x%x\n", + fdt32_to_cpu(bph->boot_cpuid_phys)); + + if (version >= 3) + printf("// size_dt_strings:\t0x%x\n", + fdt32_to_cpu(bph->size_dt_strings)); + if (version >= 17) + printf("// size_dt_struct:\t0x%x\n", + fdt32_to_cpu(bph->size_dt_struct)); + printf("\n"); + + for (i = 0; ; i++) { + addr = fdt64_to_cpu(p_rsvmap[i].address); + size = fdt64_to_cpu(p_rsvmap[i].size); + if (addr == 0 && size == 0) + break; + + printf("/memreserve/ %llx %llx;\n", + (unsigned long long)addr, (unsigned long long)size); + } + + p = p_struct; + while ((tag = fdt32_to_cpu(GET_CELL(p))) != FDT_END) { + + /* printf("tag: 0x%08x (%d)\n", tag, p - p_struct); */ + + if (tag == FDT_BEGIN_NODE) { + s = p; + p = PALIGN(p + strlen(s) + 1, 4); + + if (*s == '\0') + s = "/"; + + printf("%*s%s {\n", depth * shift, "", s); + + depth++; + continue; + } + + if (tag == FDT_END_NODE) { + depth--; + + printf("%*s};\n", depth * shift, ""); + continue; + } + + if (tag == FDT_NOP) { + printf("%*s// [NOP]\n", depth * shift, ""); + continue; + } + + if (tag != FDT_PROP) { + fprintf(stderr, "%*s ** Unknown tag 0x%08x\n", depth * shift, "", tag); + break; + } + sz = fdt32_to_cpu(GET_CELL(p)); + s = p_strings + fdt32_to_cpu(GET_CELL(p)); + if (version < 16 && sz >= 8) + p = PALIGN(p, 8); + t = p; + + p = PALIGN(p + sz, 4); + + printf("%*s%s", depth * shift, "", s); + print_data(t, sz); + printf(";\n"); + } +} + + +int main(int argc, char *argv[]) +{ + char *buf; + + if (argc < 2) { + fprintf(stderr, "supply input filename\n"); + return 5; + } + + buf = utilfdt_read(argv[1]); + if (buf) + dump_blob(buf); + else + return 10; + + return 0; +} Added: vendor/dtc/dist/fdtget.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dtc/dist/fdtget.c Tue Jul 24 04:12:44 2012 (r238737) @@ -0,0 +1,366 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. + * + * Portions from U-Boot cmd_fdt.c (C) Copyright 2007 + * Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com + * Based on code written by: + * Pantelis Antoniou and + * Matthew McClintock + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include "util.h" + +enum display_mode { + MODE_SHOW_VALUE, /* show values for node properties */ + MODE_LIST_PROPS, /* list the properties for a node */ + MODE_LIST_SUBNODES, /* list the subnodes of a node */ +}; + +/* Holds information which controls our output and options */ +struct display_info { + int type; /* data type (s/i/u/x or 0 for default) */ + int size; /* data size (1/2/4) */ + enum display_mode mode; /* display mode that we are using */ + const char *default_val; /* default value if node/property not found */ +}; + +static void report_error(const char *where, int err) +{ + fprintf(stderr, "Error at '%s': %s\n", where, fdt_strerror(err)); +} + +/** + * Displays data of a given length according to selected options + * + * If a specific data type is provided in disp, then this is used. Otherwise + * we try to guess the data type / size from the contents. + * + * @param disp Display information / options + * @param data Data to display + * @param len Maximum length of buffer + * @return 0 if ok, -1 if data does not match format + */ +static int show_data(struct display_info *disp, const char *data, int len) +{ + int i, size; + const uint8_t *p = (const uint8_t *)data; + const char *s; + int value; + int is_string; + char fmt[3]; + + /* no data, don't print */ + if (len == 0) + return 0; + + is_string = (disp->type) == 's' || + (!disp->type && util_is_printable_string(data, len)); + if (is_string) { + if (data[len - 1] != '\0') { + fprintf(stderr, "Unterminated string\n"); + return -1; + } + for (s = data; s - data < len; s += strlen(s) + 1) { + if (s != data) + printf(" "); + printf("%s", (const char *)s); + } + return 0; + } + size = disp->size; + if (size == -1) { + size = (len % 4) == 0 ? 4 : 1; + } else if (len % size) { + fprintf(stderr, "Property length must be a multiple of " + "selected data size\n"); + return -1; + } + fmt[0] = '%'; + fmt[1] = disp->type ? disp->type : 'd'; + fmt[2] = '\0'; + for (i = 0; i < len; i += size, p += size) { + if (i) + printf(" "); + value = size == 4 ? fdt32_to_cpu(*(const uint32_t *)p) : + size == 2 ? (*p << 8) | p[1] : *p; + printf(fmt, value); + } + return 0; +} + +/** + * List all properties in a node, one per line. + * + * @param blob FDT blob + * @param node Node to display + * @return 0 if ok, or FDT_ERR... if not. + */ +static int list_properties(const void *blob, int node) +{ + const struct fdt_property *data; + const char *name; + int prop; + + prop = fdt_first_property_offset(blob, node); + do { + /* Stop silently when there are no more properties */ + if (prop < 0) + return prop == -FDT_ERR_NOTFOUND ? 0 : prop; + data = fdt_get_property_by_offset(blob, prop, NULL); + name = fdt_string(blob, fdt32_to_cpu(data->nameoff)); + if (name) + puts(name); + prop = fdt_next_property_offset(blob, prop); + } while (1); +} + +#define MAX_LEVEL 32 /* how deeply nested we will go */ + +/** + * List all subnodes in a node, one per line + * + * @param blob FDT blob + * @param node Node to display + * @return 0 if ok, or FDT_ERR... if not. + */ +static int list_subnodes(const void *blob, int node) +{ + int nextoffset; /* next node offset from libfdt */ + uint32_t tag; /* current tag */ + int level = 0; /* keep track of nesting level */ + const char *pathp; + int depth = 1; /* the assumed depth of this node */ + + while (level >= 0) { + tag = fdt_next_tag(blob, node, &nextoffset); + switch (tag) { + case FDT_BEGIN_NODE: + pathp = fdt_get_name(blob, node, NULL); + if (level <= depth) { + if (pathp == NULL) + pathp = "/* NULL pointer error */"; + if (*pathp == '\0') + pathp = "/"; /* root is nameless */ + if (level == 1) + puts(pathp); + } + level++; + if (level >= MAX_LEVEL) { + printf("Nested too deep, aborting.\n"); + return 1; + } + break; + case FDT_END_NODE: + level--; + if (level == 0) + level = -1; /* exit the loop */ + break; + case FDT_END: + return 1; + case FDT_PROP: + break; + default: + if (level <= depth) + printf("Unknown tag 0x%08X\n", tag); + return 1; + } + node = nextoffset; + } + return 0; +} + +/** + * Show the data for a given node (and perhaps property) according to the + * display option provided. + * + * @param blob FDT blob + * @param disp Display information / options + * @param node Node to display + * @param property Name of property to display, or NULL if none + * @return 0 if ok, -ve on error + */ +static int show_data_for_item(const void *blob, struct display_info *disp, + int node, const char *property) +{ + const void *value = NULL; + int len, err = 0; + + switch (disp->mode) { + case MODE_LIST_PROPS: + err = list_properties(blob, node); + break; + + case MODE_LIST_SUBNODES: + err = list_subnodes(blob, node); + break; + + default: + assert(property); + value = fdt_getprop(blob, node, property, &len); + if (value) { + if (show_data(disp, value, len)) + err = -1; + else + printf("\n"); + } else if (disp->default_val) { + puts(disp->default_val); + } else { + report_error(property, len); + err = -1; + } + break; + } + + return err; +} + +/** + * Run the main fdtget operation, given a filename and valid arguments + * + * @param disp Display information / options + * @param filename Filename of blob file + * @param arg List of arguments to process + * @param arg_count Number of arguments + * @param return 0 if ok, -ve on error + */ +static int do_fdtget(struct display_info *disp, const char *filename, + char **arg, int arg_count, int args_per_step) +{ + char *blob; + const char *prop; + int i, node; + + blob = utilfdt_read(filename); + if (!blob) + return -1; + + for (i = 0; i + args_per_step <= arg_count; i += args_per_step) { + node = fdt_path_offset(blob, arg[i]); + if (node < 0) { + if (disp->default_val) { + puts(disp->default_val); + continue; + } else { + report_error(arg[i], node); + return -1; + } + } + prop = args_per_step == 1 ? NULL : arg[i + 1]; + + if (show_data_for_item(blob, disp, node, prop)) + return -1; + } + return 0; +} + +static const char *usage_msg = + "fdtget - read values from device tree\n" + "\n" + "Each value is printed on a new line.\n\n" + "Usage:\n" + " fdtget
[ ]...\n" + " fdtget -p
[ ]...\n" + "Options:\n" + "\t-t \tType of data\n" + "\t-p\t\tList properties for each node\n" + "\t-l\t\tList subnodes for each node\n" + "\t-d\t\tDefault value to display when the property is " + "missing\n" + "\t-h\t\tPrint this help\n\n" + USAGE_TYPE_MSG; + +static void usage(const char *msg) +{ + if (msg) + fprintf(stderr, "Error: %s\n\n", msg); + + fprintf(stderr, "%s", usage_msg); + exit(2); +} + +int main(int argc, char *argv[]) +{ + char *filename = NULL; + struct display_info disp; + int args_per_step = 2; + + /* set defaults */ + memset(&disp, '\0', sizeof(disp)); + disp.size = -1; + disp.mode = MODE_SHOW_VALUE; + for (;;) { + int c = getopt(argc, argv, "d:hlpt:"); + if (c == -1) + break; + + switch (c) { + case 'h': + case '?': + usage(NULL); + + case 't': + if (utilfdt_decode_type(optarg, &disp.type, + &disp.size)) + usage("Invalid type string"); + break; + + case 'p': + disp.mode = MODE_LIST_PROPS; + args_per_step = 1; + break; + + case 'l': + disp.mode = MODE_LIST_SUBNODES; + args_per_step = 1; + break; + + case 'd': + disp.default_val = optarg; + break; + } + } + + if (optind < argc) + filename = argv[optind++]; + if (!filename) + usage("Missing filename"); + + argv += optind; + argc -= optind; + + /* Allow no arguments, and silently succeed */ + if (!argc) + return 0; + + /* Check for node, property arguments */ + if (args_per_step == 2 && (argc % 2)) + usage("Must have an even number of arguments"); + + if (do_fdtget(&disp, filename, argv, argc, args_per_step)) + return 1; + return 0; +} Added: vendor/dtc/dist/fdtput.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dtc/dist/fdtput.c Tue Jul 24 04:12:44 2012 (r238737) @@ -0,0 +1,362 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include "util.h" + +/* These are the operations we support */ +enum oper_type { + OPER_WRITE_PROP, /* Write a property in a node */ + OPER_CREATE_NODE, /* Create a new node */ +}; + +struct display_info { + enum oper_type oper; /* operation to perform */ + int type; /* data type (s/i/u/x or 0 for default) */ + int size; /* data size (1/2/4) */ + int verbose; /* verbose output */ + int auto_path; /* automatically create all path components */ +}; + + +/** + * Report an error with a particular node. + * + * @param name Node name to report error on + * @param namelen Length of node name, or -1 to use entire string + * @param err Error number to report (-FDT_ERR_...) + */ +static void report_error(const char *name, int namelen, int err) +{ + if (namelen == -1) + namelen = strlen(name); + fprintf(stderr, "Error at '%1.*s': %s\n", namelen, name, + fdt_strerror(err)); +} + +/** + * Encode a series of arguments in a property value. + * + * @param disp Display information / options + * @param arg List of arguments from command line + * @param arg_count Number of arguments (may be 0) + * @param valuep Returns buffer containing value + * @param *value_len Returns length of value encoded + */ +static int encode_value(struct display_info *disp, char **arg, int arg_count, + char **valuep, int *value_len) +{ + char *value = NULL; /* holding area for value */ + int value_size = 0; /* size of holding area */ + char *ptr; /* pointer to current value position */ + int len; /* length of this cell/string/byte */ + int ival; + int upto; /* the number of bytes we have written to buf */ + char fmt[3]; + + upto = 0; + + if (disp->verbose) + fprintf(stderr, "Decoding value:\n"); + + fmt[0] = '%'; + fmt[1] = disp->type ? disp->type : 'd'; + fmt[2] = '\0'; + for (; arg_count > 0; arg++, arg_count--, upto += len) { + /* assume integer unless told otherwise */ + if (disp->type == 's') + len = strlen(*arg) + 1; + else + len = disp->size == -1 ? 4 : disp->size; + + /* enlarge our value buffer by a suitable margin if needed */ + if (upto + len > value_size) { + value_size = (upto + len) + 500; + value = realloc(value, value_size); + if (!value) { + fprintf(stderr, "Out of mmory: cannot alloc " + "%d bytes\n", value_size); + return -1; + } + } + + ptr = value + upto; + if (disp->type == 's') { + memcpy(ptr, *arg, len); + if (disp->verbose) + fprintf(stderr, "\tstring: '%s'\n", ptr); + } else { + int *iptr = (int *)ptr; + sscanf(*arg, fmt, &ival); + if (len == 4) + *iptr = cpu_to_fdt32(ival); + else + *ptr = (uint8_t)ival; + if (disp->verbose) { + fprintf(stderr, "\t%s: %d\n", + disp->size == 1 ? "byte" : + disp->size == 2 ? "short" : "int", + ival); + } + } + } + *value_len = upto; + *valuep = value; + if (disp->verbose) + fprintf(stderr, "Value size %d\n", upto); + return 0; +} + +static int store_key_value(void *blob, const char *node_name, + const char *property, const char *buf, int len) +{ + int node; + int err; + + node = fdt_path_offset(blob, node_name); + if (node < 0) { + report_error(node_name, -1, node); + return -1; + } + + err = fdt_setprop(blob, node, property, buf, len); + if (err) { + report_error(property, -1, err); + return -1; + } + return 0; +} + +/** + * Create paths as needed for all components of a path + * + * Any components of the path that do not exist are created. Errors are + * reported. + * + * @param blob FDT blob to write into + * @param in_path Path to process + * @return 0 if ok, -1 on error + */ +static int create_paths(void *blob, const char *in_path) +{ + const char *path = in_path; + const char *sep; + int node, offset = 0; + + /* skip leading '/' */ + while (*path == '/') + path++; + + for (sep = path; *sep; path = sep + 1, offset = node) { + /* equivalent to strchrnul(), but it requires _GNU_SOURCE */ + sep = strchr(path, '/'); + if (!sep) + sep = path + strlen(path); + + node = fdt_subnode_offset_namelen(blob, offset, path, + sep - path); + if (node == -FDT_ERR_NOTFOUND) { + node = fdt_add_subnode_namelen(blob, offset, path, + sep - path); + } + if (node < 0) { + report_error(path, sep - path, node); + return -1; + } + } + + return 0; +} + +/** + * Create a new node in the fdt. + * + * This will overwrite the node_name string. Any error is reported. + * + * TODO: Perhaps create fdt_path_offset_namelen() so we don't need to do this. + * + * @param blob FDT blob to write into + * @param node_name Name of node to create + * @return new node offset if found, or -1 on failure + */ +static int create_node(void *blob, const char *node_name) +{ + int node = 0; + char *p; + + p = strrchr(node_name, '/'); + if (!p) { + report_error(node_name, -1, -FDT_ERR_BADPATH); + return -1; + } + *p = '\0'; + + if (p > node_name) { + node = fdt_path_offset(blob, node_name); + if (node < 0) { + report_error(node_name, -1, node); + return -1; + } + } + + node = fdt_add_subnode(blob, node, p + 1); + if (node < 0) { + report_error(p + 1, -1, node); + return -1; + } + + return 0; +} + +static int do_fdtput(struct display_info *disp, const char *filename, + char **arg, int arg_count) +{ + char *value; + char *blob; + int len, ret = 0; + + blob = utilfdt_read(filename); + if (!blob) + return -1; + + switch (disp->oper) { + case OPER_WRITE_PROP: + /* + * Convert the arguments into a single binary value, then + * store them into the property. + */ + assert(arg_count >= 2); + if (disp->auto_path && create_paths(blob, *arg)) + return -1; + if (encode_value(disp, arg + 2, arg_count - 2, &value, &len) || + store_key_value(blob, *arg, arg[1], value, len)) + ret = -1; + break; + case OPER_CREATE_NODE: + for (; ret >= 0 && arg_count--; arg++) { + if (disp->auto_path) + ret = create_paths(blob, *arg); + else + ret = create_node(blob, *arg); + } + break; + } + if (ret >= 0) + ret = utilfdt_write(filename, blob); + + free(blob); + return ret; +} + +static const char *usage_msg = + "fdtput - write a property value to a device tree\n" + "\n" + "The command line arguments are joined together into a single value.\n" + "\n" + "Usage:\n" + " fdtput
[...]\n" + " fdtput -c
[...]\n" + "Options:\n" + "\t-c\t\tCreate nodes if they don't already exist\n" + "\t-p\t\tAutomatically create nodes as needed for the node path\n" + "\t-t \tType of data\n" + "\t-v\t\tVerbose: display each value decoded from command line\n" + "\t-h\t\tPrint this help\n\n" + USAGE_TYPE_MSG; + +static void usage(const char *msg) +{ + if (msg) + fprintf(stderr, "Error: %s\n\n", msg); + + fprintf(stderr, "%s", usage_msg); + exit(2); +} + +int main(int argc, char *argv[]) +{ + struct display_info disp; + char *filename = NULL; + + memset(&disp, '\0', sizeof(disp)); + disp.size = -1; + disp.oper = OPER_WRITE_PROP; + for (;;) { + int c = getopt(argc, argv, "chpt:v"); + if (c == -1) + break; + + /* + * TODO: add options to: + * - delete property + * - delete node (optionally recursively) + * - rename node + * - pack fdt before writing + * - set amount of free space when writing + * - expand fdt if value doesn't fit + */ + switch (c) { + case 'c': + disp.oper = OPER_CREATE_NODE; + break; + case 'h': + case '?': + usage(NULL); + case 'p': + disp.auto_path = 1; + break; + case 't': + if (utilfdt_decode_type(optarg, &disp.type, + &disp.size)) + usage("Invalid type string"); + break; + + case 'v': + disp.verbose = 1; + break; + } + } + + if (optind < argc) + filename = argv[optind++]; + if (!filename) + usage("Missing filename"); + + argv += optind; + argc -= optind; + + if (disp.oper == OPER_WRITE_PROP) { + if (argc < 1) + usage("Missing node"); + if (argc < 2) + usage("Missing property"); + } + + if (do_fdtput(&disp, filename, argv, argc)) + return 1; + return 0; +} Added: vendor/dtc/dist/libfdt/fdt_empty_tree.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dtc/dist/libfdt/fdt_empty_tree.c Tue Jul 24 04:12:44 2012 (r238737) @@ -0,0 +1,84 @@ +/* + * libfdt - Flat Device Tree manipulation + * Copyright (C) 2012 David Gibson, IBM Corporation. + * + * libfdt is dual licensed: you can use it either under the terms of + * the GPL, or the BSD license, at your option. + * + * a) This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * Alternatively, + * + * b) 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 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 04:14:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 991C1106564A; Tue, 24 Jul 2012 04:14:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B02D8FC18; Tue, 24 Jul 2012 04:14: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 q6O4EHwN085645; Tue, 24 Jul 2012 04:14:17 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6O4EHiE085644; Tue, 24 Jul 2012 04:14:17 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207240414.q6O4EHiE085644@svn.freebsd.org> From: Warner Losh Date: Tue, 24 Jul 2012 04:14:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238738 - vendor/dtc/dtc-f807af19/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 04:14:17 -0000 Author: imp Date: Tue Jul 24 04:14:16 2012 New Revision: 238738 URL: http://svn.freebsd.org/changeset/base/238738 Log: Recopy after fixing f807af192828222dee7a5c9f94d999673bb4d8a1 import. Added: vendor/dtc/dtc-f807af19/dist/ - copied from r238737, vendor/dtc/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 08:43:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 78202106580E; Tue, 24 Jul 2012 08:43:35 +0000 (UTC) Date: Tue, 24 Jul 2012 08:43:35 +0000 From: Alexey Dokuchaev To: Steve Kargl Message-ID: <20120724084335.GB28038@FreeBSD.org> References: <201207231913.q6NJDucB040333@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201207231913.q6NJDucB040333@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238722 - in head/lib/msun: . ld128 ld80 man src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 08:43:35 -0000 On Mon, Jul 23, 2012 at 07:13:56PM +0000, Steve Kargl wrote: > Author: kargl > Date: Mon Jul 23 19:13:55 2012 > New Revision: 238722 > URL: http://svn.freebsd.org/changeset/base/238722 > > Log: > Compute the exponential of x for Intel 80-bit format and IEEE 128-bit > format. These implementations are based on > > PTP Tang, "Table-driven implementation of the exponential function > in IEEE floating-point arithmetic," ACM Trans. Math. Soft., 15, > 144-157 (1989). I believe some ports could benefit from OSVERSION bump for this one. ./danfe From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 10:40:48 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4E12106566B; Tue, 24 Jul 2012 10:40:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 1C3B88FC12; Tue, 24 Jul 2012 10:40:47 +0000 (UTC) Received: from c122-106-171-246.carlnfd1.nsw.optusnet.com.au (c122-106-171-246.carlnfd1.nsw.optusnet.com.au [122.106.171.246]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q6OAcnrN009690 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 24 Jul 2012 20:38:56 +1000 Date: Tue, 24 Jul 2012 20:38:49 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper In-Reply-To: Message-ID: <20120724201105.I2548@besplex.bde.org> References: <201207211407.q6LE7h9P042318@svn.freebsd.org> <20120721153026.GA8640@FreeBSD.org> <20120723071227.GE85230@FreeBSD.org> <523C5041-527B-4DBC-85E1-4AE846B014E6@bsdimp.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Alexey Dokuchaev , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Gleb Smirnoff , svn-src-head@FreeBSD.org, Warner Losh Subject: Re: svn commit: r238672 - head/sys/dev/sdhci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 10:40:48 -0000 On Mon, 23 Jul 2012, Garrett Cooper wrote: > On Mon, Jul 23, 2012 at 5:07 PM, Warner Losh wrote: >>[>* trimmed] >> Double spacing is the one true way I learned how to type in school. Since the 1980's though, things have changed and many advocate single spaces. However, that's for folks with fancy variable pitch font and such. For fixed-witdh fonts, 2 is still preferred in some circles, including ours. > > And now that I look at style(9), there are subtleties that > demonstrate this in the roff generated text: > > ================= > > FreeBSD source tree. It is also a guide for the preferred userland code > ^^ > style. Many of the style rules are implicit in the examples. Be careful > ^^ > ^^ > to check the examples before assuming that style is silent on an issue. > > ================= Where's the indentometer when you need it? :-) roff understands formatting, and generates these 2-space sentence breaks automatically for -Tascii, and something different (more like 1.5 spaces?) for proportional fonts. This is provided you don't hard-code sentence breaks in the man page source. Not starting sentences on new lines gives hard-coded sentence breaks a their start. > I wish this point was more explicit, but like style(9), there are > other unspoken rules that should/must be adhered to. style(9) consisted entirely of examples before it was mangled to create a man page. The mangling gave zillions of whitespace errors (mainly for man pages' 5-space indentation and corresponding tab lossage (leading tabs in literal source code become 1 tab followed by 5 spaces)), but there are no examples of single-space sentence breaks in literal source code. Unfortunately, this is because there are almost no examples of sentence breaks in literal source code. There used to be about 25 such examples (in C comments of course), but most of these rotted to meta-descriptions in man page text. In the man page source, all of the latter are correctly formatted (with new sentences on new lines, so that there are no literal spaces. In the man output, these are formatted according to man/roff rules which are unrelated to C style rules and in fact differ for proportional fonts, so they don't provide examples of C style. 4 examples on 3 lines remain. The most relevant one is: " * Multi-line comments look like this. Make them real sentences. Fill ..." Single-space sentence breaks give comments that don't look like this. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 12:37:23 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E6EBD106564A; Tue, 24 Jul 2012 12:37:23 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 7C7778FC14; Tue, 24 Jul 2012 12:37:23 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q6OCbLCP065583; Tue, 24 Jul 2012 08:37:21 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q6OCbLvF065582; Tue, 24 Jul 2012 08:37:21 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Tue, 24 Jul 2012 08:37:21 -0400 From: David Schultz To: Doug Barton Message-ID: <20120724123721.GA65519@zim.MIT.EDU> Mail-Followup-To: Doug Barton , Andrey Chernov , Konstantin Belousov , Pawel Jakub Dawidek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, markm@freebsd.org References: <201207041951.q64JpPXu029310@svn.freebsd.org> <20120704200220.GM2337@deviant.kiev.zoral.com.ua> <20120704203239.GA42326@vniz.net> <4FF4AC3D.9070109@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FF4AC3D.9070109@FreeBSD.org> Cc: src-committers@FreeBSD.ORG, Pawel Jakub Dawidek , svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG, Konstantin Belousov , Andrey Chernov , markm@FreeBSD.ORG Subject: Re: svn commit: r238118 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 12:37:24 -0000 On Wed, Jul 04, 2012, Doug Barton wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > On 07/04/2012 13:32, Andrey Chernov wrote: > > 1) /dev/urandom may not exist in jails/sandboxes > > That would be a pretty serious configuration error. Yes -- but the scary part is that arc4random() is not fail-safe at all. If /dev/random isn't there, you just silently get predictable "randomness". If you needed that randomness for cryptographic purposes you're out of luck; you might as well have used rot13. Using the sysctl doesn't fix the failure mode (in fact, as I recall the sysctl dubiously never reports failure even if there is no entropy), but there's a narrower set of circumstances under which the sysctl can fail. From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 13:08:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A47E1065674; Tue, 24 Jul 2012 13:08:44 +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 E9AB68FC20; Tue, 24 Jul 2012 13:08:43 +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 q6OD8hZ5032970; Tue, 24 Jul 2012 13:08:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6OD8hIV032968; Tue, 24 Jul 2012 13:08:43 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201207241308.q6OD8hIV032968@svn.freebsd.org> From: Alexander Motin Date: Tue, 24 Jul 2012 13:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238739 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 13:08:44 -0000 Author: mav Date: Tue Jul 24 13:08:43 2012 New Revision: 238739 URL: http://svn.freebsd.org/changeset/base/238739 Log: Do not call ses_softc_cleanup() in case of configuration read failure. Just free inclomplete daemon cache instead to let it retry next time. Premature ses_softc_cleanup() caused NULL dereference when freed softc was accessed later. Modified: head/sys/cam/scsi/scsi_enc_ses.c Modified: head/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_ses.c Tue Jul 24 04:14:16 2012 (r238738) +++ head/sys/cam/scsi/scsi_enc_ses.c Tue Jul 24 13:08:43 2012 (r238739) @@ -1473,7 +1473,7 @@ ses_process_config(enc_softc_t *enc, str out: if (err) - ses_softc_cleanup(enc); + ses_cache_free(enc, enc_cache); else { enc_update_request(enc, SES_UPDATE_GETSTATUS); enc_update_request(enc, SES_UPDATE_GETELMDESCS); From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 13:32:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EB4F4106566B; Tue, 24 Jul 2012 13:32:49 +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 D663E8FC0A; Tue, 24 Jul 2012 13:32:49 +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 q6ODWniJ034915; Tue, 24 Jul 2012 13:32:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6ODWnn5034913; Tue, 24 Jul 2012 13:32:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201207241332.q6ODWnn5034913@svn.freebsd.org> From: Alexander Motin Date: Tue, 24 Jul 2012 13:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238740 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 13:32:50 -0000 Author: mav Date: Tue Jul 24 13:32:49 2012 New Revision: 238740 URL: http://svn.freebsd.org/changeset/base/238740 Log: Fix off by one error in ses_enc_desc_last_byte(). Modified: head/sys/cam/scsi/scsi_ses.h Modified: head/sys/cam/scsi/scsi_ses.h ============================================================================== --- head/sys/cam/scsi/scsi_ses.h Tue Jul 24 13:08:43 2012 (r238739) +++ head/sys/cam/scsi/scsi_ses.h Tue Jul 24 13:32:49 2012 (r238740) @@ -117,7 +117,7 @@ struct ses_enc_desc { static inline uint8_t * ses_enc_desc_last_byte(struct ses_enc_desc *encdesc) { - return (&encdesc->length + encdesc->length + 1); + return (&encdesc->length + encdesc->length); } static inline struct ses_enc_desc * From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 16:03:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46DD71065675; Tue, 24 Jul 2012 16:03:29 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3178C8FC16; Tue, 24 Jul 2012 16:03:29 +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 q6OG3T2a048056; Tue, 24 Jul 2012 16:03:29 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6OG3Sex048054; Tue, 24 Jul 2012 16:03:28 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201207241603.q6OG3Sex048054@svn.freebsd.org> From: "Andrey A. Chernov" Date: Tue, 24 Jul 2012 16:03:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238741 - head/lib/libelf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 16:03:29 -0000 Author: ache Date: Tue Jul 24 16:03:28 2012 New Revision: 238741 URL: http://svn.freebsd.org/changeset/base/238741 Log: Don't ever build files depending on the directory where they are placed in. It is obvious that its modification time will change with each such file builded. This bug cause whole libelf to rebuild itself each second make run (and relink that files on each first make run) in the loop. Modified: head/lib/libelf/Makefile Modified: head/lib/libelf/Makefile ============================================================================== --- head/lib/libelf/Makefile Tue Jul 24 13:32:49 2012 (r238740) +++ head/lib/libelf/Makefile Tue Jul 24 16:03:28 2012 (r238741) @@ -68,11 +68,9 @@ CLEANFILES= ${GENSRCS} CLEANDIRS= sys CFLAGS+= -I${.CURDIR} -I. -sys/elf32.h sys/elf64.h sys/elf_common.h: sys - ln -sf ${.CURDIR}/../../sys/${.TARGET} ${.TARGET} - -sys: +sys/elf32.h sys/elf64.h sys/elf_common.h: ${.CURDIR}/../../sys/${.TARGET} mkdir -p ${.OBJDIR}/sys + ln -sf ${.CURDIR}/../../sys/${.TARGET} ${.TARGET} SHLIB_MAJOR= 1 From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 16:29:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0BA23106564A; Tue, 24 Jul 2012 16:29:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E75918FC0A; Tue, 24 Jul 2012 16:29:33 +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 q6OGTXs3050157; Tue, 24 Jul 2012 16:29:33 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6OGTXHw050148; Tue, 24 Jul 2012 16:29:33 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207241629.q6OGTXHw050148@svn.freebsd.org> From: Warner Losh Date: Tue, 24 Jul 2012 16:29:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238742 - in head: contrib/dtc contrib/dtc/Documentation contrib/dtc/libfdt sys/contrib/libfdt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 16:29:34 -0000 Author: imp Date: Tue Jul 24 16:29:33 2012 New Revision: 238742 URL: http://svn.freebsd.org/changeset/base/238742 Log: Update to latest git version of dtc to get new dtsv2 support, including the include directive. Fix minor build issue corrected by converting yypush_buffer_state and yypop_buffer_state to yy_set_buffer_state and a hard-coded 100-deep stack. It was easier to fix it here than to import that support into our flex. The new tools and test hardness remain unsupported at the moment. Added: head/contrib/dtc/dtdiff - copied unchanged from r238738, vendor/dtc/dist/dtdiff head/contrib/dtc/fdtdump.c - copied unchanged from r238738, vendor/dtc/dist/fdtdump.c head/contrib/dtc/fdtget.c - copied unchanged from r238738, vendor/dtc/dist/fdtget.c head/contrib/dtc/fdtput.c - copied unchanged from r238738, vendor/dtc/dist/fdtput.c head/contrib/dtc/libfdt/fdt_empty_tree.c - copied unchanged from r238738, vendor/dtc/dist/libfdt/fdt_empty_tree.c head/sys/contrib/libfdt/fdt_empty_tree.c - copied unchanged from r238738, vendor/dtc/dist/libfdt/fdt_empty_tree.c Modified: head/contrib/dtc/Documentation/dts-format.txt head/contrib/dtc/Documentation/manual.txt head/contrib/dtc/Makefile head/contrib/dtc/checks.c head/contrib/dtc/convert-dtsv0-lexer.l head/contrib/dtc/data.c head/contrib/dtc/dtc-lexer.l head/contrib/dtc/dtc-parser.y head/contrib/dtc/dtc.c head/contrib/dtc/dtc.h head/contrib/dtc/flattree.c head/contrib/dtc/fstree.c head/contrib/dtc/libfdt/Makefile.libfdt head/contrib/dtc/libfdt/fdt.c head/contrib/dtc/libfdt/fdt_ro.c head/contrib/dtc/libfdt/fdt_rw.c head/contrib/dtc/libfdt/libfdt.h head/contrib/dtc/libfdt/libfdt_env.h head/contrib/dtc/libfdt/libfdt_internal.h head/contrib/dtc/livetree.c head/contrib/dtc/srcpos.c head/contrib/dtc/srcpos.h head/contrib/dtc/treesource.c head/contrib/dtc/util.c head/contrib/dtc/util.h head/sys/contrib/libfdt/fdt.c head/sys/contrib/libfdt/fdt_ro.c head/sys/contrib/libfdt/fdt_rw.c head/sys/contrib/libfdt/libfdt.h head/sys/contrib/libfdt/libfdt_env.h head/sys/contrib/libfdt/libfdt_internal.h Directory Properties: head/contrib/dtc/ (props changed) head/sys/contrib/libfdt/ (props changed) Modified: head/contrib/dtc/Documentation/dts-format.txt ============================================================================== --- head/contrib/dtc/Documentation/dts-format.txt Tue Jul 24 16:03:28 2012 (r238741) +++ head/contrib/dtc/Documentation/dts-format.txt Tue Jul 24 16:29:33 2012 (r238742) @@ -29,18 +29,28 @@ except for properties with empty (zero l form: [label:] property-name; -Property values may be defined as an array of 32-bit integer cells, as -NUL-terminated strings, as bytestrings or a combination of these. +Property values may be defined as an array of 8, 16, 32, or 64-bit integer +elements, as NUL-terminated strings, as bytestrings or a combination of these. -* Arrays of cells are represented by angle brackets surrounding a - space separated list of C-style integers +* Arrays are represented by angle brackets surrounding a space separated list + of C-style integers or character literals. Array elements default to 32-bits + in size. An array of 32-bit elements is also known as a cell list or a list + of cells. A cell being an unsigned 32-bit integer. e.g. interrupts = <17 0xc>; -* A 64-bit value is represented with two 32-bit cells. +* A 64-bit value can be represented with two 32-bit elements. e.g. clock-frequency = <0x00000001 0x00000000>; +* The storage size of an element can be changed using the /bits/ prefix. The + /bits/ prefix allows for the creation of 8, 16, 32, and 64-bit elements. + The resulting array will not be padded to a multiple of the default 32-bit + element size. + + e.g. interrupts = /bits/ 8 <17 0xc>; + e.g. clock-frequency = /bits/ 64 <0x0000000100000000>; + * A NUL-terminated string value is represented using double quotes (the property value is considered to include the terminating NUL character). @@ -59,19 +69,20 @@ NUL-terminated strings, as bytestrings o e.g. compatible = "ns16550", "ns8250"; example = <0xf00f0000 19>, "a strange property format"; -* In a cell array a reference to another node will be expanded to that - node's phandle. References may by '&' followed by a node's label: +* In an array a reference to another node will be expanded to that node's + phandle. References may by '&' followed by a node's label: e.g. interrupt-parent = < &mpic >; or they may be '&' followed by a node's full path in braces: e.g. interrupt-parent = < &{/soc/interrupt-controller@40000} >; + References are only permitted in arrays that have an element size of + 32-bits. -* Outside a cell array, a reference to another node will be expanded - to that node's full path. +* Outside an array, a reference to another node will be expanded to that + node's full path. e.g. ethernet0 = &EMAC0; * Labels may also appear before or after any component of a property - value, or between cells of a cell array, or between bytes of a - bytestring. + value, or between elements of an array, or between bytes of a bytestring. e.g. reg = reglabel: <0 sizelabel: 0x1000000>; e.g. prop = [ab cd ef byte4: 00 ff fe]; e.g. str = start: "string value" end: ; @@ -108,3 +119,4 @@ Version 1 DTS files have the overall lay -- David Gibson -- Yoder Stuart + -- Anton Staaf Modified: head/contrib/dtc/Documentation/manual.txt ============================================================================== --- head/contrib/dtc/Documentation/manual.txt Tue Jul 24 16:03:28 2012 (r238741) +++ head/contrib/dtc/Documentation/manual.txt Tue Jul 24 16:29:33 2012 (r238742) @@ -21,7 +21,7 @@ III - libfdt IV - Utility Tools 1) convert-dtsv0 -- Conversion to Version 1 - 1) ftdump + 1) fdtdump I - "dtc", the device tree compiler @@ -106,6 +106,9 @@ Options: -O The generated output format, as listed above. + -d + Generate a dependency file during compilation. + -q Quiet: -q suppress warnings, -qq errors, -qqq all @@ -643,10 +646,10 @@ a new file with a "v1" appended the file Comments, empty lines, etc. are preserved. -2) ftdump -- Flat Tree dumping utility +2) fdtdump -- Flat Device Tree dumping utility -The ftdump program prints a readable version of a flat device tree file. +The fdtdump program prints a readable version of a flat device tree file. -The syntax of the ftdump command line is: +The syntax of the fdtdump command line is: - ftdump + fdtdump Modified: head/contrib/dtc/Makefile ============================================================================== --- head/contrib/dtc/Makefile Tue Jul 24 16:03:28 2012 (r238741) +++ head/contrib/dtc/Makefile Tue Jul 24 16:29:33 2012 (r238742) @@ -9,14 +9,16 @@ # CONFIG_LOCALVERSION from some future config system. # VERSION = 1 -PATCHLEVEL = 2 +PATCHLEVEL = 3 SUBLEVEL = 0 EXTRAVERSION = LOCAL_VERSION = CONFIG_LOCALVERSION = -CPPFLAGS = -I libfdt -CFLAGS = -Wall -g -Os -fPIC -Wpointer-arith -Wcast-qual +CPPFLAGS = -I libfdt -I . +WARNINGS = -Werror -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \ + -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls +CFLAGS = -g -Os -fPIC -Werror $(WARNINGS) BISON = bison LEX = flex @@ -103,12 +105,15 @@ endef include Makefile.convert-dtsv0 include Makefile.dtc -include Makefile.ftdump +include Makefile.utils BIN += convert-dtsv0 BIN += dtc -BIN += ftdump +BIN += fdtdump +BIN += fdtget +BIN += fdtput +SCRIPTS = dtdiff all: $(BIN) libfdt @@ -116,7 +121,9 @@ all: $(BIN) libfdt ifneq ($(DEPTARGETS),) -include $(DTC_OBJS:%.o=%.d) -include $(CONVERT_OBJS:%.o=%.d) --include $(FTDUMP_OBJS:%.o=%.d) +-include $(FDTDUMP_OBJS:%.o=%.d) +-include $(FDTGET_OBJS:%.o=%.d) +-include $(FDTPUT_OBJS:%.o=%.d) endif @@ -127,7 +134,7 @@ endif LIBFDT_objdir = libfdt LIBFDT_srcdir = libfdt LIBFDT_archive = $(LIBFDT_objdir)/libfdt.a -LIBFDT_lib = $(LIBFDT_objdir)/libfdt.$(SHAREDLIB_EXT) +LIBFDT_lib = $(LIBFDT_objdir)/libfdt-$(DTC_VERSION).$(SHAREDLIB_EXT) LIBFDT_include = $(addprefix $(LIBFDT_srcdir)/,$(LIBFDT_INCLUDES)) LIBFDT_version = $(addprefix $(LIBFDT_srcdir)/,$(LIBFDT_VERSION)) @@ -153,12 +160,14 @@ endif # intermediate target and building them again "for real" .SECONDARY: $(DTC_GEN_SRCS) $(CONVERT_GEN_SRCS) -install: all +install: all $(SCRIPTS) @$(VECHO) INSTALL $(INSTALL) -d $(DESTDIR)$(BINDIR) - $(INSTALL) $(BIN) $(DESTDIR)$(BINDIR) + $(INSTALL) $(BIN) $(SCRIPTS) $(DESTDIR)$(BINDIR) $(INSTALL) -d $(DESTDIR)$(LIBDIR) $(INSTALL) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR) + ln -sf $(notdir $(LIBFDT_lib)) $(DESTDIR)$(LIBDIR)/$(LIBFDT_soname) + ln -sf $(LIBFDT_soname) $(DESTDIR)$(LIBDIR)/libfdt.$(SHAREDLIB_EXT) $(INSTALL) -m 644 $(LIBFDT_archive) $(DESTDIR)$(LIBDIR) $(INSTALL) -d $(DESTDIR)$(INCLUDEDIR) $(INSTALL) -m 644 $(LIBFDT_include) $(DESTDIR)$(INCLUDEDIR) @@ -173,19 +182,29 @@ convert-dtsv0: $(CONVERT_OBJS) @$(VECHO) LD $@ $(LINK.c) -o $@ $^ -ftdump: $(FTDUMP_OBJS) +fdtdump: $(FDTDUMP_OBJS) + +fdtget: $(FDTGET_OBJS) $(LIBFDT_archive) + +fdtput: $(FDTPUT_OBJS) $(LIBFDT_archive) # # Testsuite rules # TESTS_PREFIX=tests/ + +TESTS_BIN += dtc +TESTS_BIN += convert-dtsv0 +TESTS_BIN += fdtput +TESTS_BIN += fdtget + include tests/Makefile.tests # # Clean rules # -STD_CLEANFILES = *~ *.o *.so *.d *.a *.i *.s core a.out vgcore.* \ +STD_CLEANFILES = *~ *.o *.$(SHAREDLIB_EXT) *.d *.a *.i *.s core a.out vgcore.* \ *.tab.[ch] *.lex.c *.output clean: libfdt_clean tests_clean @@ -231,8 +250,7 @@ clean: libfdt_clean tests_clean $(LIBFDT_lib): @$(VECHO) LD $@ - $(CC) $(LDFLAGS) -fPIC $(SHAREDLIB_LINK_OPTIONS)$(notdir $@) -o $(LIBFDT_objdir)/libfdt-$(DTC_VERSION).$(SHAREDLIB_EXT) $^ - ln -sf libfdt-$(DTC_VERSION).$(SHAREDLIB_EXT) $(LIBFDT_objdir)/libfdt.$(SHAREDLIB_EXT) + $(CC) $(LDFLAGS) -fPIC $(SHAREDLIB_LINK_OPTIONS)$(LIBFDT_soname) -o $(LIBFDT_lib) $^ %.lex.c: %.l @$(VECHO) LEX $@ Modified: head/contrib/dtc/checks.c ============================================================================== --- head/contrib/dtc/checks.c Tue Jul 24 16:03:28 2012 (r238741) +++ head/contrib/dtc/checks.c Tue Jul 24 16:29:33 2012 (r238742) @@ -31,12 +31,6 @@ #define TRACE(c, fmt, ...) do { } while (0) #endif -enum checklevel { - IGNORE = 0, - WARN = 1, - ERROR = 2, -}; - enum checkstatus { UNCHECKED = 0, PREREQ, @@ -57,14 +51,14 @@ struct check { node_check_fn node_fn; prop_check_fn prop_fn; void *data; - enum checklevel level; + bool warn, error; enum checkstatus status; int inprogress; int num_prereqs; struct check **prereq; }; -#define CHECK(nm, tfn, nfn, pfn, d, lvl, ...) \ +#define CHECK_ENTRY(nm, tfn, nfn, pfn, d, w, e, ...) \ static struct check *nm##_prereqs[] = { __VA_ARGS__ }; \ static struct check nm = { \ .name = #nm, \ @@ -72,20 +66,37 @@ struct check { .node_fn = (nfn), \ .prop_fn = (pfn), \ .data = (d), \ - .level = (lvl), \ + .warn = (w), \ + .error = (e), \ .status = UNCHECKED, \ .num_prereqs = ARRAY_SIZE(nm##_prereqs), \ .prereq = nm##_prereqs, \ }; - -#define TREE_CHECK(nm, d, lvl, ...) \ - CHECK(nm, check_##nm, NULL, NULL, d, lvl, __VA_ARGS__) -#define NODE_CHECK(nm, d, lvl, ...) \ - CHECK(nm, NULL, check_##nm, NULL, d, lvl, __VA_ARGS__) -#define PROP_CHECK(nm, d, lvl, ...) \ - CHECK(nm, NULL, NULL, check_##nm, d, lvl, __VA_ARGS__) -#define BATCH_CHECK(nm, lvl, ...) \ - CHECK(nm, NULL, NULL, NULL, NULL, lvl, __VA_ARGS__) +#define WARNING(nm, tfn, nfn, pfn, d, ...) \ + CHECK_ENTRY(nm, tfn, nfn, pfn, d, true, false, __VA_ARGS__) +#define ERROR(nm, tfn, nfn, pfn, d, ...) \ + CHECK_ENTRY(nm, tfn, nfn, pfn, d, false, true, __VA_ARGS__) +#define CHECK(nm, tfn, nfn, pfn, d, ...) \ + CHECK_ENTRY(nm, tfn, nfn, pfn, d, false, false, __VA_ARGS__) + +#define TREE_WARNING(nm, d, ...) \ + WARNING(nm, check_##nm, NULL, NULL, d, __VA_ARGS__) +#define TREE_ERROR(nm, d, ...) \ + ERROR(nm, check_##nm, NULL, NULL, d, __VA_ARGS__) +#define TREE_CHECK(nm, d, ...) \ + CHECK(nm, check_##nm, NULL, NULL, d, __VA_ARGS__) +#define NODE_WARNING(nm, d, ...) \ + WARNING(nm, NULL, check_##nm, NULL, d, __VA_ARGS__) +#define NODE_ERROR(nm, d, ...) \ + ERROR(nm, NULL, check_##nm, NULL, d, __VA_ARGS__) +#define NODE_CHECK(nm, d, ...) \ + CHECK(nm, NULL, check_##nm, NULL, d, __VA_ARGS__) +#define PROP_WARNING(nm, d, ...) \ + WARNING(nm, NULL, NULL, check_##nm, d, __VA_ARGS__) +#define PROP_ERROR(nm, d, ...) \ + ERROR(nm, NULL, NULL, check_##nm, d, __VA_ARGS__) +#define PROP_CHECK(nm, d, ...) \ + CHECK(nm, NULL, NULL, check_##nm, d, __VA_ARGS__) #ifdef __GNUC__ static inline void check_msg(struct check *c, const char *fmt, ...) __attribute__((format (printf, 2, 3))); @@ -95,13 +106,13 @@ static inline void check_msg(struct chec va_list ap; va_start(ap, fmt); - if ((c->level < WARN) || (c->level <= quiet)) - return; /* Suppress message */ - - fprintf(stderr, "%s (%s): ", - (c->level == ERROR) ? "ERROR" : "Warning", c->name); - vfprintf(stderr, fmt, ap); - fprintf(stderr, "\n"); + if ((c->warn && (quiet < 1)) + || (c->error && (quiet < 2))) { + fprintf(stderr, "%s (%s): ", + (c->error) ? "ERROR" : "Warning", c->name); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + } } #define FAIL(c, ...) \ @@ -167,7 +178,7 @@ static int run_check(struct check *c, st out: c->inprogress = 0; - if ((c->status != PASSED) && (c->level == ERROR)) + if ((c->status != PASSED) && (c->error)) error = 1; return error; } @@ -176,6 +187,13 @@ out: * Utility check functions */ +/* A check which always fails, for testing purposes only */ +static inline void check_always_fail(struct check *c, struct node *dt) +{ + FAIL(c, "always_fail check"); +} +TREE_CHECK(always_fail, NULL); + static void check_is_string(struct check *c, struct node *root, struct node *node) { @@ -190,8 +208,10 @@ static void check_is_string(struct check FAIL(c, "\"%s\" property in %s is not a string", propname, node->fullpath); } -#define CHECK_IS_STRING(nm, propname, lvl) \ - CHECK(nm, NULL, check_is_string, NULL, (propname), (lvl)) +#define WARNING_IF_NOT_STRING(nm, propname) \ + WARNING(nm, NULL, check_is_string, NULL, (propname)) +#define ERROR_IF_NOT_STRING(nm, propname) \ + ERROR(nm, NULL, check_is_string, NULL, (propname)) static void check_is_cell(struct check *c, struct node *root, struct node *node) @@ -207,8 +227,10 @@ static void check_is_cell(struct check * FAIL(c, "\"%s\" property in %s is not a single cell", propname, node->fullpath); } -#define CHECK_IS_CELL(nm, propname, lvl) \ - CHECK(nm, NULL, check_is_cell, NULL, (propname), (lvl)) +#define WARNING_IF_NOT_CELL(nm, propname) \ + WARNING(nm, NULL, check_is_cell, NULL, (propname)) +#define ERROR_IF_NOT_CELL(nm, propname) \ + ERROR(nm, NULL, check_is_cell, NULL, (propname)) /* * Structural check functions @@ -227,7 +249,7 @@ static void check_duplicate_node_names(s FAIL(c, "Duplicate node name %s", child->fullpath); } -NODE_CHECK(duplicate_node_names, NULL, ERROR); +NODE_ERROR(duplicate_node_names, NULL); static void check_duplicate_property_names(struct check *c, struct node *dt, struct node *node) @@ -240,7 +262,7 @@ static void check_duplicate_property_nam FAIL(c, "Duplicate property name %s in %s", prop->name, node->fullpath); } -NODE_CHECK(duplicate_property_names, NULL, ERROR); +NODE_ERROR(duplicate_property_names, NULL); #define LOWERCASE "abcdefghijklmnopqrstuvwxyz" #define UPPERCASE "ABCDEFGHIJKLMNOPQRSTUVWXYZ" @@ -256,7 +278,7 @@ static void check_node_name_chars(struct FAIL(c, "Bad character '%c' in node %s", node->name[n], node->fullpath); } -NODE_CHECK(node_name_chars, PROPNODECHARS "@", ERROR); +NODE_ERROR(node_name_chars, PROPNODECHARS "@"); static void check_node_name_format(struct check *c, struct node *dt, struct node *node) @@ -265,7 +287,7 @@ static void check_node_name_format(struc FAIL(c, "Node %s has multiple '@' characters in name", node->fullpath); } -NODE_CHECK(node_name_format, NULL, ERROR, &node_name_chars); +NODE_ERROR(node_name_format, NULL, &node_name_chars); static void check_property_name_chars(struct check *c, struct node *dt, struct node *node, struct property *prop) @@ -276,7 +298,63 @@ static void check_property_name_chars(st FAIL(c, "Bad character '%c' in property name \"%s\", node %s", prop->name[n], prop->name, node->fullpath); } -PROP_CHECK(property_name_chars, PROPNODECHARS, ERROR); +PROP_ERROR(property_name_chars, PROPNODECHARS); + +#define DESCLABEL_FMT "%s%s%s%s%s" +#define DESCLABEL_ARGS(node,prop,mark) \ + ((mark) ? "value of " : ""), \ + ((prop) ? "'" : ""), \ + ((prop) ? (prop)->name : ""), \ + ((prop) ? "' in " : ""), (node)->fullpath + +static void check_duplicate_label(struct check *c, struct node *dt, + const char *label, struct node *node, + struct property *prop, struct marker *mark) +{ + struct node *othernode = NULL; + struct property *otherprop = NULL; + struct marker *othermark = NULL; + + othernode = get_node_by_label(dt, label); + + if (!othernode) + otherprop = get_property_by_label(dt, label, &othernode); + if (!othernode) + othermark = get_marker_label(dt, label, &othernode, + &otherprop); + + if (!othernode) + return; + + if ((othernode != node) || (otherprop != prop) || (othermark != mark)) + FAIL(c, "Duplicate label '%s' on " DESCLABEL_FMT + " and " DESCLABEL_FMT, + label, DESCLABEL_ARGS(node, prop, mark), + DESCLABEL_ARGS(othernode, otherprop, othermark)); +} + +static void check_duplicate_label_node(struct check *c, struct node *dt, + struct node *node) +{ + struct label *l; + + for_each_label(node->labels, l) + check_duplicate_label(c, dt, l->label, node, NULL, NULL); +} +static void check_duplicate_label_prop(struct check *c, struct node *dt, + struct node *node, struct property *prop) +{ + struct marker *m = prop->val.markers; + struct label *l; + + for_each_label(prop->labels, l) + check_duplicate_label(c, dt, l->label, node, prop, NULL); + + for_each_marker_of_type(m, LABEL) + check_duplicate_label(c, dt, m->ref, node, prop, m); +} +ERROR(duplicate_label, NULL, check_duplicate_label_node, + check_duplicate_label_prop, NULL); static void check_explicit_phandles(struct check *c, struct node *root, struct node *node, struct property *prop) @@ -335,7 +413,7 @@ static void check_explicit_phandles(stru node->phandle = phandle; } -PROP_CHECK(explicit_phandles, NULL, ERROR); +PROP_ERROR(explicit_phandles, NULL); static void check_name_properties(struct check *c, struct node *root, struct node *node) @@ -364,8 +442,8 @@ static void check_name_properties(struct free(prop); } } -CHECK_IS_STRING(name_is_string, "name", ERROR); -NODE_CHECK(name_properties, NULL, ERROR, &name_is_string); +ERROR_IF_NOT_STRING(name_is_string, "name"); +NODE_ERROR(name_properties, NULL, &name_is_string); /* * Reference fixup functions @@ -392,7 +470,7 @@ static void fixup_phandle_references(str *((cell_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle); } } -CHECK(phandle_references, NULL, NULL, fixup_phandle_references, NULL, ERROR, +ERROR(phandle_references, NULL, NULL, fixup_phandle_references, NULL, &duplicate_node_names, &explicit_phandles); static void fixup_path_references(struct check *c, struct node *dt, @@ -417,19 +495,19 @@ static void fixup_path_references(struct strlen(path) + 1); } } -CHECK(path_references, NULL, NULL, fixup_path_references, NULL, ERROR, +ERROR(path_references, NULL, NULL, fixup_path_references, NULL, &duplicate_node_names); /* * Semantic checks */ -CHECK_IS_CELL(address_cells_is_cell, "#address-cells", WARN); -CHECK_IS_CELL(size_cells_is_cell, "#size-cells", WARN); -CHECK_IS_CELL(interrupt_cells_is_cell, "#interrupt-cells", WARN); - -CHECK_IS_STRING(device_type_is_string, "device_type", WARN); -CHECK_IS_STRING(model_is_string, "model", WARN); -CHECK_IS_STRING(status_is_string, "status", WARN); +WARNING_IF_NOT_CELL(address_cells_is_cell, "#address-cells"); +WARNING_IF_NOT_CELL(size_cells_is_cell, "#size-cells"); +WARNING_IF_NOT_CELL(interrupt_cells_is_cell, "#interrupt-cells"); + +WARNING_IF_NOT_STRING(device_type_is_string, "device_type"); +WARNING_IF_NOT_STRING(model_is_string, "model"); +WARNING_IF_NOT_STRING(status_is_string, "status"); static void fixup_addr_size_cells(struct check *c, struct node *dt, struct node *node) @@ -447,8 +525,8 @@ static void fixup_addr_size_cells(struct if (prop) node->size_cells = propval_cell(prop); } -CHECK(addr_size_cells, NULL, fixup_addr_size_cells, NULL, NULL, WARN, - &address_cells_is_cell, &size_cells_is_cell); +WARNING(addr_size_cells, NULL, fixup_addr_size_cells, NULL, NULL, + &address_cells_is_cell, &size_cells_is_cell); #define node_addr_cells(n) \ (((n)->addr_cells == -1) ? 2 : (n)->addr_cells) @@ -482,7 +560,7 @@ static void check_reg_format(struct chec "(#address-cells == %d, #size-cells == %d)", node->fullpath, prop->val.len, addr_cells, size_cells); } -NODE_CHECK(reg_format, NULL, WARN, &addr_size_cells); +NODE_WARNING(reg_format, NULL, &addr_size_cells); static void check_ranges_format(struct check *c, struct node *dt, struct node *node) @@ -523,7 +601,7 @@ static void check_ranges_format(struct c p_addr_cells, c_addr_cells, c_size_cells); } } -NODE_CHECK(ranges_format, NULL, WARN, &addr_size_cells); +NODE_WARNING(ranges_format, NULL, &addr_size_cells); /* * Style checks @@ -550,7 +628,7 @@ static void check_avoid_default_addr_siz FAIL(c, "Relying on default #size-cells value for %s", node->fullpath); } -NODE_CHECK(avoid_default_addr_size, NULL, WARN, &addr_size_cells); +NODE_WARNING(avoid_default_addr_size, NULL, &addr_size_cells); static void check_obsolete_chosen_interrupt_controller(struct check *c, struct node *dt) @@ -567,12 +645,15 @@ static void check_obsolete_chosen_interr FAIL(c, "/chosen has obsolete \"interrupt-controller\" " "property"); } -TREE_CHECK(obsolete_chosen_interrupt_controller, NULL, WARN); +TREE_WARNING(obsolete_chosen_interrupt_controller, NULL); static struct check *check_table[] = { &duplicate_node_names, &duplicate_property_names, &node_name_chars, &node_name_format, &property_name_chars, &name_is_string, &name_properties, + + &duplicate_label, + &explicit_phandles, &phandle_references, &path_references, @@ -583,8 +664,71 @@ static struct check *check_table[] = { &avoid_default_addr_size, &obsolete_chosen_interrupt_controller, + + &always_fail, }; +static void enable_warning_error(struct check *c, bool warn, bool error) +{ + int i; + + /* Raising level, also raise it for prereqs */ + if ((warn && !c->warn) || (error && !c->error)) + for (i = 0; i < c->num_prereqs; i++) + enable_warning_error(c->prereq[i], warn, error); + + c->warn = c->warn || warn; + c->error = c->error || error; +} + +static void disable_warning_error(struct check *c, bool warn, bool error) +{ + int i; + + /* Lowering level, also lower it for things this is the prereq + * for */ + if ((warn && c->warn) || (error && c->error)) { + for (i = 0; i < ARRAY_SIZE(check_table); i++) { + struct check *cc = check_table[i]; + int j; + + for (j = 0; j < cc->num_prereqs; j++) + if (cc->prereq[j] == c) + disable_warning_error(cc, warn, error); + } + } + + c->warn = c->warn && !warn; + c->error = c->error && !error; +} + +void parse_checks_option(bool warn, bool error, const char *optarg) +{ + int i; + const char *name = optarg; + bool enable = true; + + if ((strncmp(optarg, "no-", 3) == 0) + || (strncmp(optarg, "no_", 3) == 0)) { + name = optarg + 3; + enable = false; + } + + for (i = 0; i < ARRAY_SIZE(check_table); i++) { + struct check *c = check_table[i]; + + if (streq(c->name, name)) { + if (enable) + enable_warning_error(c, warn, error); + else + disable_warning_error(c, warn, error); + return; + } + } + + die("Unrecognized check name \"%s\"\n", name); +} + void process_checks(int force, struct boot_info *bi) { struct node *dt = bi->dt; @@ -594,7 +738,7 @@ void process_checks(int force, struct bo for (i = 0; i < ARRAY_SIZE(check_table); i++) { struct check *c = check_table[i]; - if (c->level != IGNORE) + if (c->warn || c->error) error = error || run_check(c, dt); } Modified: head/contrib/dtc/convert-dtsv0-lexer.l ============================================================================== --- head/contrib/dtc/convert-dtsv0-lexer.l Tue Jul 24 16:03:28 2012 (r238741) +++ head/contrib/dtc/convert-dtsv0-lexer.l Tue Jul 24 16:29:33 2012 (r238742) @@ -17,7 +17,7 @@ * USA */ -%option noyywrap nounput noinput +%option noyywrap nounput noinput never-interactive %x INCLUDE %x BYTESTRING @@ -210,8 +210,10 @@ static void convert_file(const char *fna memcpy(newname, fname, len); memcpy(newname + len, suffix, sizeof(suffix)); - srcpos_file = dtc_open_file(fname, NULL); - yyin = srcpos_file->file; + yyin = fopen(fname, "r"); + if (!yyin) + die("Couldn't open input file %s: %s\n", + fname, strerror(errno)); yyout = fopen(newname, "w"); if (!yyout) Modified: head/contrib/dtc/data.c ============================================================================== --- head/contrib/dtc/data.c Tue Jul 24 16:03:28 2012 (r238741) +++ head/contrib/dtc/data.c Tue Jul 24 16:29:33 2012 (r238742) @@ -68,40 +68,6 @@ struct data data_copy_mem(const char *me return d; } -static char get_oct_char(const char *s, int *i) -{ - char x[4]; - char *endx; - long val; - - x[3] = '\0'; - strncpy(x, s + *i, 3); - - val = strtol(x, &endx, 8); - - assert(endx > x); - - (*i) += endx - x; - return val; -} - -static char get_hex_char(const char *s, int *i) -{ - char x[3]; - char *endx; - long val; - - x[2] = '\0'; - strncpy(x, s + *i, 2); - - val = strtol(x, &endx, 16); - if (!(endx > x)) - die("\\x used with no following hex digits\n"); - - (*i) += endx - x; - return val; -} - struct data data_copy_escape_string(const char *s, int len) { int i = 0; @@ -114,53 +80,10 @@ struct data data_copy_escape_string(cons while (i < len) { char c = s[i++]; - if (c != '\\') { - q[d.len++] = c; - continue; - } - - c = s[i++]; - assert(c); - switch (c) { - case 'a': - q[d.len++] = '\a'; - break; - case 'b': - q[d.len++] = '\b'; - break; - case 't': - q[d.len++] = '\t'; - break; - case 'n': - q[d.len++] = '\n'; - break; - case 'v': - q[d.len++] = '\v'; - break; - case 'f': - q[d.len++] = '\f'; - break; - case 'r': - q[d.len++] = '\r'; - break; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - i--; /* need to re-read the first digit as - * part of the octal value */ - q[d.len++] = get_oct_char(s, &i); - break; - case 'x': - q[d.len++] = get_hex_char(s, &i); - break; - default: - q[d.len++] = c; - } + if (c == '\\') + c = get_escape_char(s, &i); + + q[d.len++] = c; } q[d.len++] = '\0'; @@ -245,11 +168,33 @@ struct data data_merge(struct data d1, s return d; } -struct data data_append_cell(struct data d, cell_t word) +struct data data_append_integer(struct data d, uint64_t value, int bits) { - cell_t beword = cpu_to_fdt32(word); + uint8_t value_8; + uint16_t value_16; + uint32_t value_32; + uint64_t value_64; + + switch (bits) { + case 8: + value_8 = value; + return data_append_data(d, &value_8, 1); + + case 16: + value_16 = cpu_to_fdt16(value); + return data_append_data(d, &value_16, 2); + + case 32: + value_32 = cpu_to_fdt32(value); + return data_append_data(d, &value_32, 4); + + case 64: + value_64 = cpu_to_fdt64(value); + return data_append_data(d, &value_64, 8); - return data_append_data(d, &beword, sizeof(beword)); + default: + die("Invalid literal size (%d)\n", bits); + } } struct data data_append_re(struct data d, const struct fdt_reserve_entry *re) @@ -262,11 +207,14 @@ struct data data_append_re(struct data d return data_append_data(d, &bere, sizeof(bere)); } -struct data data_append_addr(struct data d, uint64_t addr) +struct data data_append_cell(struct data d, cell_t word) { - uint64_t beaddr = cpu_to_fdt64(addr); + return data_append_integer(d, word, sizeof(word) * 8); +} - return data_append_data(d, &beaddr, sizeof(beaddr)); +struct data data_append_addr(struct data d, uint64_t addr) +{ + return data_append_integer(d, addr, sizeof(addr) * 8); } struct data data_append_byte(struct data d, uint8_t byte) Modified: head/contrib/dtc/dtc-lexer.l ============================================================================== --- head/contrib/dtc/dtc-lexer.l Tue Jul 24 16:03:28 2012 (r238741) +++ head/contrib/dtc/dtc-lexer.l Tue Jul 24 16:29:33 2012 (r238742) @@ -18,7 +18,7 @@ * USA */ -%option noyywrap nounput noinput yylineno +%option noyywrap nounput noinput never-interactive %x INCLUDE %x BYTESTRING @@ -29,6 +29,7 @@ PROPNODECHAR [a-zA-Z0-9,._+*#?@-] PATHCHAR ({PROPNODECHAR}|[/]) LABEL [a-zA-Z_][a-zA-Z0-9_]* STRING \"([^\\"]|\\.)*\" +CHAR_LITERAL '([^']|\\')*' WS [[:space:]] COMMENT "/*"([^*]|\*+[^*/])*\*+"/" LINECOMMENT "//".*\n @@ -38,12 +39,16 @@ LINECOMMENT "//".*\n #include "srcpos.h" #include "dtc-parser.tab.h" +#define MAX_INCLUDE_NESTING 100 +YY_BUFFER_STATE include_stack[MAX_INCLUDE_NESTING]; +int include_stack_pointer = 0; + YYLTYPE yylloc; +/* CAUTION: this will stop working if we ever use yyless() or yyunput() */ #define YY_USER_ACTION \ { \ - yylloc.file = srcpos_file; \ - yylloc.first_line = yylineno; \ + srcpos_update(&yylloc, yytext, yyleng); \ } /*#define LEXDEBUG 1*/ @@ -96,6 +101,12 @@ static int pop_input_file(void); return DT_MEMRESERVE; } +<*>"/bits/" { + DPRINT("Keyword: /bits/\n"); + BEGIN_DEFAULT(); + return DT_BITS; + } + <*>{LABEL}: { DPRINT("Label: %s\n", yytext); yylval.labelref = xstrdup(yytext); @@ -103,19 +114,26 @@ static int pop_input_file(void); return DT_LABEL; } -[0-9]+|0[xX][0-9a-fA-F]+ { +([0-9]+|0[xX][0-9a-fA-F]+)(U|L|UL|LL|ULL)? { yylval.literal = xstrdup(yytext); DPRINT("Literal: '%s'\n", yylval.literal); return DT_LITERAL; } -\&{LABEL} { /* label reference */ +<*>{CHAR_LITERAL} { + yytext[yyleng-1] = '\0'; + yylval.literal = xstrdup(yytext+1); + DPRINT("Character literal: %s\n", yylval.literal); + return DT_CHAR_LITERAL; + } + +<*>\&{LABEL} { /* label reference */ DPRINT("Ref: %s\n", yytext+1); yylval.labelref = xstrdup(yytext+1); return DT_REF; } -"&{/"{PATHCHAR}+\} { /* new-style path reference */ +<*>"&{/"{PATHCHAR}+\} { /* new-style path reference */ yytext[yyleng-1] = '\0'; DPRINT("Ref: %s\n", yytext+2); yylval.labelref = xstrdup(yytext+2); @@ -150,6 +168,15 @@ static int pop_input_file(void); <*>{COMMENT}+ /* eat C-style comments */ <*>{LINECOMMENT}+ /* eat C++-style comments */ +<*>"<<" { return DT_LSHIFT; }; +<*>">>" { return DT_RSHIFT; }; +<*>"<=" { return DT_LE; }; +<*>">=" { return DT_GE; }; +<*>"==" { return DT_EQ; }; +<*>"!=" { return DT_NE; }; +<*>"&&" { return DT_AND; }; +<*>"||" { return DT_OR; }; + <*>. { DPRINT("Char: %c (\\x%02x)\n", yytext[0], (unsigned)yytext[0]); @@ -167,100 +194,34 @@ static int pop_input_file(void); %% - -/* - * Stack of nested include file contexts. - */ - -struct incl_file { - struct dtc_file *file; - YY_BUFFER_STATE yy_prev_buf; - int yy_prev_lineno; - struct incl_file *prev; -}; - -static struct incl_file *incl_file_stack; - - -/* - * Detect infinite include recursion. - */ -#define MAX_INCLUDE_DEPTH (100) - -static int incl_depth = 0; - - static void push_input_file(const char *filename) { - struct incl_file *incl_file; - struct dtc_file *newfile; - struct search_path search, *searchptr = NULL; - assert(filename); - if (incl_depth++ >= MAX_INCLUDE_DEPTH) - die("Includes nested too deeply"); + assert(include_stack_pointer >= MAX_INCLUDE_NESTING); - if (srcpos_file) { - search.dir = srcpos_file->dir; - search.next = NULL; - search.prev = NULL; - searchptr = &search; - } + srcfile_push(filename); - newfile = dtc_open_file(filename, searchptr); + yyin = current_srcfile->f; - incl_file = xmalloc(sizeof(struct incl_file)); + include_stack[include_stack_pointer++] = YY_CURRENT_BUFFER; - /* - * Save current context. - */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 17:42:10 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 70A351065672; Tue, 24 Jul 2012 17:42:10 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by mx1.freebsd.org (Postfix) with ESMTP id 2E88E8FC14; Tue, 24 Jul 2012 17:42:07 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.5/8.14.5) with ESMTP id q6OHg6Fs063897; Tue, 24 Jul 2012 10:42:06 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.5/8.14.5/Submit) id q6OHg6en063896; Tue, 24 Jul 2012 10:42:06 -0700 (PDT) (envelope-from sgk) Date: Tue, 24 Jul 2012 10:42:06 -0700 From: Steve Kargl To: Alexey Dokuchaev Message-ID: <20120724174206.GA63841@troutmask.apl.washington.edu> References: <201207231913.q6NJDucB040333@svn.freebsd.org> <20120724084335.GB28038@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120724084335.GB28038@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Steve Kargl Subject: Re: svn commit: r238722 - in head/lib/msun: . ld128 ld80 man src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 17:42:10 -0000 On Tue, Jul 24, 2012 at 08:43:35AM +0000, Alexey Dokuchaev wrote: > On Mon, Jul 23, 2012 at 07:13:56PM +0000, Steve Kargl wrote: > > Author: kargl > > Date: Mon Jul 23 19:13:55 2012 > > New Revision: 238722 > > URL: http://svn.freebsd.org/changeset/base/238722 > > > > Log: > > Compute the exponential of x for Intel 80-bit format and IEEE 128-bit > > format. These implementations are based on > > > > PTP Tang, "Table-driven implementation of the exponential function > > in IEEE floating-point arithmetic," ACM Trans. Math. Soft., 15, > > 144-157 (1989). > > I believe some ports could benefit from OSVERSION bump for this one. > I've never done a OSVERSION bump, so you'll need to tell me how. But, more importantly, I can find no information in the Developer's Handbook and only two rather terse references in the Porter's Handbook. So, what is OSVERSION? Why do you think it needs a bump? -- Steve From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 17:57:14 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12B42106564A; Tue, 24 Jul 2012 17:57:14 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id A98DB8FC16; Tue, 24 Jul 2012 17:57:13 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q6OHvCAA066931; Tue, 24 Jul 2012 13:57:12 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q6OHvC5b066930; Tue, 24 Jul 2012 13:57:12 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Tue, 24 Jul 2012 13:57:12 -0400 From: David Schultz To: Steve Kargl Message-ID: <20120724175712.GA66863@zim.MIT.EDU> Mail-Followup-To: Steve Kargl , Alexey Dokuchaev , Steve Kargl , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201207231913.q6NJDucB040333@svn.freebsd.org> <20120724084335.GB28038@FreeBSD.org> <20120724174206.GA63841@troutmask.apl.washington.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120724174206.GA63841@troutmask.apl.washington.edu> Cc: svn-src-head@FreeBSD.ORG, Alexey Dokuchaev , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, Steve Kargl Subject: Re: svn commit: r238722 - in head/lib/msun: . ld128 ld80 man src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 17:57:14 -0000 On Tue, Jul 24, 2012, Steve Kargl wrote: > On Tue, Jul 24, 2012 at 08:43:35AM +0000, Alexey Dokuchaev wrote: > > On Mon, Jul 23, 2012 at 07:13:56PM +0000, Steve Kargl wrote: > > > Author: kargl > > > Date: Mon Jul 23 19:13:55 2012 > > > New Revision: 238722 > > > URL: http://svn.freebsd.org/changeset/base/238722 > > > > > > Log: > > > Compute the exponential of x for Intel 80-bit format and IEEE 128-bit > > > format. These implementations are based on > > > > > > PTP Tang, "Table-driven implementation of the exponential function > > > in IEEE floating-point arithmetic," ACM Trans. Math. Soft., 15, > > > 144-157 (1989). > > > > I believe some ports could benefit from OSVERSION bump for this one. > > > > I've never done a OSVERSION bump, so you'll need to tell me how. > But, more importantly, I can find no information in the Developer's > Handbook and only two rather terse references in the Porter's > Handbook. So, what is OSVERSION? Why do you think it needs a > bump? It is the same as the __FreeBSD_version bump I mentioned in my email last week. Basically it is a number you increment in sys/sys/param.h whenever there is a significant change that porters and developers of third-party software might want to test against. In this case, it would help any ports that have workarounds for the lack of expl() to compile both before and after this change. But it's also important not to bump the version gratuitously if there's no reason to believe the change might introduce incompatibilities. The purpose of each __FreeBSD_version bump is documented here: http://www.freebsd.org/doc/en/books/porters-handbook/freebsd-versions.html We should probably talk about how to update this file at some point, although for the first one or two times, it's probably fine to get a doc committer to help out with this step. From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 18:01:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4790106564A; Tue, 24 Jul 2012 18:01:28 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF2F28FC12; Tue, 24 Jul 2012 18:01:28 +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 q6OI1SJU057814; Tue, 24 Jul 2012 18:01:28 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6OI1SPS057812; Tue, 24 Jul 2012 18:01:28 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201207241801.q6OI1SPS057812@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 24 Jul 2012 18:01:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238743 - head/cddl/contrib/opensolaris/cmd/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 18:01:29 -0000 Author: gnn Date: Tue Jul 24 18:01:28 2012 New Revision: 238743 URL: http://svn.freebsd.org/changeset/base/238743 Log: Fix a bug in interrupt handling so that we're only considered impatient if we sent more than 2 INT signals. This fixes a bug where we wouldn't see aggregations print on the command line if we Ctrl-C'd a dtrace script or command line invocation. MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Tue Jul 24 16:29:33 2012 (r238742) +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Tue Jul 24 18:01:28 2012 (r238743) @@ -70,6 +70,8 @@ typedef struct dtrace_cmd { #define E_ERROR 1 #define E_USAGE 2 +#define IMPATIENT_LIMIT 2 + static const char DTRACE_OPTSTR[] = "3:6:aAb:Bc:CD:ef:FGhHi:I:lL:m:n:o:p:P:qs:SU:vVwx:X:Z"; @@ -1202,7 +1204,7 @@ intr(int signo) if (!g_intr) g_newline = 1; - if (g_intr++) + if (g_intr++ > IMPATIENT_LIMIT) g_impatient = 1; } From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 18:48:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA013106566C; Tue, 24 Jul 2012 18:48:17 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B41808FC15; Tue, 24 Jul 2012 18:48: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 q6OImHBs061688; Tue, 24 Jul 2012 18:48:17 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6OImHtG061683; Tue, 24 Jul 2012 18:48:17 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201207241848.q6OImHtG061683@svn.freebsd.org> From: Doug Barton Date: Tue, 24 Jul 2012 18:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238744 - in vendor/bind9/dist: . lib/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 18:48:17 -0000 Author: dougb Date: Tue Jul 24 18:48:17 2012 New Revision: 238744 URL: http://svn.freebsd.org/changeset/base/238744 Log: Vendor import of BIND 9.8.3-P2 Modified: vendor/bind9/dist/CHANGES vendor/bind9/dist/lib/dns/resolver.c vendor/bind9/dist/lib/dns/zone.c vendor/bind9/dist/version Modified: vendor/bind9/dist/CHANGES ============================================================================== --- vendor/bind9/dist/CHANGES Tue Jul 24 18:01:28 2012 (r238743) +++ vendor/bind9/dist/CHANGES Tue Jul 24 18:48:17 2012 (r238744) @@ -1,3 +1,12 @@ + --- 9.8.3-P2 released --- + +3346. [security] Bad-cache data could be used before it was + initialized, causing an assert. [RT #30025] + +3342. [bug] Change #3314 broke saving of stub zones to disk + resulting in excessive cpu usage in some cases. + [RT #29952] + --- 9.8.3-P1 released --- 3331. [security] dns_rdataslab_fromrdataset could produce bad Modified: vendor/bind9/dist/lib/dns/resolver.c ============================================================================== --- vendor/bind9/dist/lib/dns/resolver.c Tue Jul 24 18:01:28 2012 (r238743) +++ vendor/bind9/dist/lib/dns/resolver.c Tue Jul 24 18:48:17 2012 (r238744) @@ -8448,6 +8448,7 @@ dns_resolver_addbadcache(dns_resolver_t goto cleanup; bad->type = type; bad->hashval = hashval; + bad->expire = *expire; isc_buffer_init(&buffer, bad + 1, name->length); dns_name_init(&bad->name, NULL); dns_name_copy(name, &bad->name, &buffer); @@ -8459,8 +8460,8 @@ dns_resolver_addbadcache(dns_resolver_t if (resolver->badcount < resolver->badhash * 2 && resolver->badhash > DNS_BADCACHE_SIZE) resizehash(resolver, &now, ISC_FALSE); - } - bad->expire = *expire; + } else + bad->expire = *expire; cleanup: UNLOCK(&resolver->lock); } Modified: vendor/bind9/dist/lib/dns/zone.c ============================================================================== --- vendor/bind9/dist/lib/dns/zone.c Tue Jul 24 18:01:28 2012 (r238743) +++ vendor/bind9/dist/lib/dns/zone.c Tue Jul 24 18:48:17 2012 (r238744) @@ -8027,13 +8027,14 @@ zone_maintenance(dns_zone_t *zone) { case dns_zone_master: case dns_zone_slave: case dns_zone_key: + case dns_zone_stub: LOCK_ZONE(zone); if (zone->masterfile != NULL && isc_time_compare(&now, &zone->dumptime) >= 0 && DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADED) && DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NEEDDUMP)) { dumping = was_dumping(zone); - } else + } else dumping = ISC_TRUE; UNLOCK_ZONE(zone); if (!dumping) { @@ -8386,7 +8387,7 @@ zone_dump(dns_zone_t *zone, isc_boolean_ goto fail; } - if (compact) { + if (compact && zone->type != dns_zone_stub) { dns_zone_t *dummy = NULL; LOCK_ZONE(zone); zone_iattach(zone, &dummy); @@ -9242,7 +9243,7 @@ stub_callback(isc_task_t *task, isc_even dns_zone_t *zone = NULL; char master[ISC_SOCKADDR_FORMATSIZE]; char source[ISC_SOCKADDR_FORMATSIZE]; - isc_uint32_t nscnt, cnamecnt; + isc_uint32_t nscnt, cnamecnt, refresh, retry, expire; isc_result_t result; isc_time_t now; isc_boolean_t exiting = ISC_FALSE; @@ -9390,19 +9391,32 @@ stub_callback(isc_task_t *task, isc_even ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_write); if (zone->db == NULL) zone_attachdb(zone, stub->db); + result = zone_get_from_db(zone, zone->db, NULL, NULL, NULL, &refresh, + &retry, &expire, NULL, NULL); + if (result == ISC_R_SUCCESS) { + zone->refresh = RANGE(refresh, zone->minrefresh, + zone->maxrefresh); + zone->retry = RANGE(retry, zone->minretry, zone->maxretry); + zone->expire = RANGE(expire, zone->refresh + zone->retry, + DNS_MAX_EXPIRE); + DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_HAVETIMERS); + } ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_write); dns_db_detach(&stub->db); - if (zone->masterfile != NULL) - zone_needdump(zone, 0); - dns_message_destroy(&msg); isc_event_free(&event); dns_request_destroy(&zone->request); + DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_REFRESH); + DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_LOADED); DNS_ZONE_JITTER_ADD(&now, zone->refresh, &zone->refreshtime); isc_interval_set(&i, zone->expire, 0); DNS_ZONE_TIME_ADD(&now, zone->expire, &zone->expiretime); + + if (zone->masterfile != NULL) + zone_needdump(zone, 0); + zone_settimer(zone, &now); goto free_stub; Modified: vendor/bind9/dist/version ============================================================================== --- vendor/bind9/dist/version Tue Jul 24 18:01:28 2012 (r238743) +++ vendor/bind9/dist/version Tue Jul 24 18:48:17 2012 (r238744) @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=8 PATCHVER=3 RELEASETYPE=-P -RELEASEVER=1 +RELEASEVER=2 From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 18:49:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2ED581065677; Tue, 24 Jul 2012 18:49:19 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 017548FC20; Tue, 24 Jul 2012 18:49:19 +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 q6OInII6061806; Tue, 24 Jul 2012 18:49:18 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6OInIXq061805; Tue, 24 Jul 2012 18:49:18 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201207241849.q6OInIXq061805@svn.freebsd.org> From: Doug Barton Date: Tue, 24 Jul 2012 18:49:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238745 - vendor/bind9/9.8.3-P2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 18:49:19 -0000 Author: dougb Date: Tue Jul 24 18:49:18 2012 New Revision: 238745 URL: http://svn.freebsd.org/changeset/base/238745 Log: Tag the 9.8.3-P2 release Added: vendor/bind9/9.8.3-P2/ - copied from r238744, vendor/bind9/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 18:53:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 415C91065674; Tue, 24 Jul 2012 18:53:29 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21A918FC0C; Tue, 24 Jul 2012 18:53:29 +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 q6OIrSKg062181; Tue, 24 Jul 2012 18:53:28 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6OIrSJK062176; Tue, 24 Jul 2012 18:53:28 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201207241853.q6OIrSJK062176@svn.freebsd.org> From: Doug Barton Date: Tue, 24 Jul 2012 18:53:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238746 - in head/contrib/bind9: . lib/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 18:53:29 -0000 Author: dougb Date: Tue Jul 24 18:53:28 2012 New Revision: 238746 URL: http://svn.freebsd.org/changeset/base/238746 Log: Heavy DNSSEC Validation Load Can Cause a "Bad Cache" Assertion Failure in BIND9 High numbers of queries with DNSSEC validation enabled can cause an assertion failure in named, caused by using a "bad cache" data structure before it has been initialized. CVE: CVE-2012-3817 Posting date: 24 July, 2012 Modified: head/contrib/bind9/CHANGES head/contrib/bind9/lib/dns/resolver.c head/contrib/bind9/lib/dns/zone.c head/contrib/bind9/version Directory Properties: head/contrib/bind9/ (props changed) Modified: head/contrib/bind9/CHANGES ============================================================================== --- head/contrib/bind9/CHANGES Tue Jul 24 18:49:18 2012 (r238745) +++ head/contrib/bind9/CHANGES Tue Jul 24 18:53:28 2012 (r238746) @@ -1,3 +1,12 @@ + --- 9.8.3-P2 released --- + +3346. [security] Bad-cache data could be used before it was + initialized, causing an assert. [RT #30025] + +3342. [bug] Change #3314 broke saving of stub zones to disk + resulting in excessive cpu usage in some cases. + [RT #29952] + --- 9.8.3-P1 released --- 3331. [security] dns_rdataslab_fromrdataset could produce bad Modified: head/contrib/bind9/lib/dns/resolver.c ============================================================================== --- head/contrib/bind9/lib/dns/resolver.c Tue Jul 24 18:49:18 2012 (r238745) +++ head/contrib/bind9/lib/dns/resolver.c Tue Jul 24 18:53:28 2012 (r238746) @@ -8448,6 +8448,7 @@ dns_resolver_addbadcache(dns_resolver_t goto cleanup; bad->type = type; bad->hashval = hashval; + bad->expire = *expire; isc_buffer_init(&buffer, bad + 1, name->length); dns_name_init(&bad->name, NULL); dns_name_copy(name, &bad->name, &buffer); @@ -8459,8 +8460,8 @@ dns_resolver_addbadcache(dns_resolver_t if (resolver->badcount < resolver->badhash * 2 && resolver->badhash > DNS_BADCACHE_SIZE) resizehash(resolver, &now, ISC_FALSE); - } - bad->expire = *expire; + } else + bad->expire = *expire; cleanup: UNLOCK(&resolver->lock); } Modified: head/contrib/bind9/lib/dns/zone.c ============================================================================== --- head/contrib/bind9/lib/dns/zone.c Tue Jul 24 18:49:18 2012 (r238745) +++ head/contrib/bind9/lib/dns/zone.c Tue Jul 24 18:53:28 2012 (r238746) @@ -8027,13 +8027,14 @@ zone_maintenance(dns_zone_t *zone) { case dns_zone_master: case dns_zone_slave: case dns_zone_key: + case dns_zone_stub: LOCK_ZONE(zone); if (zone->masterfile != NULL && isc_time_compare(&now, &zone->dumptime) >= 0 && DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADED) && DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NEEDDUMP)) { dumping = was_dumping(zone); - } else + } else dumping = ISC_TRUE; UNLOCK_ZONE(zone); if (!dumping) { @@ -8386,7 +8387,7 @@ zone_dump(dns_zone_t *zone, isc_boolean_ goto fail; } - if (compact) { + if (compact && zone->type != dns_zone_stub) { dns_zone_t *dummy = NULL; LOCK_ZONE(zone); zone_iattach(zone, &dummy); @@ -9242,7 +9243,7 @@ stub_callback(isc_task_t *task, isc_even dns_zone_t *zone = NULL; char master[ISC_SOCKADDR_FORMATSIZE]; char source[ISC_SOCKADDR_FORMATSIZE]; - isc_uint32_t nscnt, cnamecnt; + isc_uint32_t nscnt, cnamecnt, refresh, retry, expire; isc_result_t result; isc_time_t now; isc_boolean_t exiting = ISC_FALSE; @@ -9390,19 +9391,32 @@ stub_callback(isc_task_t *task, isc_even ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_write); if (zone->db == NULL) zone_attachdb(zone, stub->db); + result = zone_get_from_db(zone, zone->db, NULL, NULL, NULL, &refresh, + &retry, &expire, NULL, NULL); + if (result == ISC_R_SUCCESS) { + zone->refresh = RANGE(refresh, zone->minrefresh, + zone->maxrefresh); + zone->retry = RANGE(retry, zone->minretry, zone->maxretry); + zone->expire = RANGE(expire, zone->refresh + zone->retry, + DNS_MAX_EXPIRE); + DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_HAVETIMERS); + } ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_write); dns_db_detach(&stub->db); - if (zone->masterfile != NULL) - zone_needdump(zone, 0); - dns_message_destroy(&msg); isc_event_free(&event); dns_request_destroy(&zone->request); + DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_REFRESH); + DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_LOADED); DNS_ZONE_JITTER_ADD(&now, zone->refresh, &zone->refreshtime); isc_interval_set(&i, zone->expire, 0); DNS_ZONE_TIME_ADD(&now, zone->expire, &zone->expiretime); + + if (zone->masterfile != NULL) + zone_needdump(zone, 0); + zone_settimer(zone, &now); goto free_stub; Modified: head/contrib/bind9/version ============================================================================== --- head/contrib/bind9/version Tue Jul 24 18:49:18 2012 (r238745) +++ head/contrib/bind9/version Tue Jul 24 18:53:28 2012 (r238746) @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=8 PATCHVER=3 RELEASETYPE=-P -RELEASEVER=1 +RELEASEVER=2 From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 19:00:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 105341065670; Tue, 24 Jul 2012 19:00:37 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E49BC8FC15; Tue, 24 Jul 2012 19:00:36 +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 q6OJ0axm062854; Tue, 24 Jul 2012 19:00:36 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6OJ0aiG062848; Tue, 24 Jul 2012 19:00:36 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201207241900.q6OJ0aiG062848@svn.freebsd.org> From: Doug Barton Date: Tue, 24 Jul 2012 19:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238747 - in vendor/bind9/dist-9.6: . lib/dns lib/isc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 19:00:37 -0000 Author: dougb Date: Tue Jul 24 19:00:36 2012 New Revision: 238747 URL: http://svn.freebsd.org/changeset/base/238747 Log: Vendor import of BIND 9.6-ESV-R7-P2 Modified: vendor/bind9/dist-9.6/CHANGES vendor/bind9/dist-9.6/lib/dns/resolver.c vendor/bind9/dist-9.6/lib/dns/zone.c vendor/bind9/dist-9.6/lib/isc/random.c vendor/bind9/dist-9.6/version Modified: vendor/bind9/dist-9.6/CHANGES ============================================================================== --- vendor/bind9/dist-9.6/CHANGES Tue Jul 24 18:53:28 2012 (r238746) +++ vendor/bind9/dist-9.6/CHANGES Tue Jul 24 19:00:36 2012 (r238747) @@ -1,3 +1,14 @@ + --- 9.6-ESV-R7-P2 released --- + +3346. [security] Bad-cache data could be used before it was + initialized, causing an assert. [RT #30025] + +3343. [bug] Relax isc_random_jitter() REQUIRE tests. [RT #29821] + +3342. [bug] Change #3314 broke saving of stub zones to disk + resulting in excessive cpu usage in some cases. + [RT #29952] + --- 9.6-ESV-R7-P1 released --- 3331. [security] dns_rdataslab_fromrdataset could produce bad Modified: vendor/bind9/dist-9.6/lib/dns/resolver.c ============================================================================== --- vendor/bind9/dist-9.6/lib/dns/resolver.c Tue Jul 24 18:53:28 2012 (r238746) +++ vendor/bind9/dist-9.6/lib/dns/resolver.c Tue Jul 24 19:00:36 2012 (r238747) @@ -8124,6 +8124,7 @@ dns_resolver_addbadcache(dns_resolver_t goto cleanup; bad->type = type; bad->hashval = hashval; + bad->expire = *expire; isc_buffer_init(&buffer, bad + 1, name->length); dns_name_init(&bad->name, NULL); dns_name_copy(name, &bad->name, &buffer); @@ -8135,8 +8136,8 @@ dns_resolver_addbadcache(dns_resolver_t if (resolver->badcount < resolver->badhash * 2 && resolver->badhash > DNS_BADCACHE_SIZE) resizehash(resolver, &now, ISC_FALSE); - } - bad->expire = *expire; + } else + bad->expire = *expire; cleanup: UNLOCK(&resolver->lock); } Modified: vendor/bind9/dist-9.6/lib/dns/zone.c ============================================================================== --- vendor/bind9/dist-9.6/lib/dns/zone.c Tue Jul 24 18:53:28 2012 (r238746) +++ vendor/bind9/dist-9.6/lib/dns/zone.c Tue Jul 24 19:00:36 2012 (r238747) @@ -6054,6 +6054,7 @@ zone_maintenance(dns_zone_t *zone) { switch (zone->type) { case dns_zone_master: case dns_zone_slave: + case dns_zone_stub: LOCK_ZONE(zone); if (zone->masterfile != NULL && isc_time_compare(&now, &zone->dumptime) >= 0 && @@ -6395,7 +6396,7 @@ zone_dump(dns_zone_t *zone, isc_boolean_ goto fail; } - if (compact) { + if (compact && zone->type != dns_zone_stub) { dns_zone_t *dummy = NULL; LOCK_ZONE(zone); zone_iattach(zone, &dummy); @@ -7251,7 +7252,7 @@ stub_callback(isc_task_t *task, isc_even dns_zone_t *zone = NULL; char master[ISC_SOCKADDR_FORMATSIZE]; char source[ISC_SOCKADDR_FORMATSIZE]; - isc_uint32_t nscnt, cnamecnt; + isc_uint32_t nscnt, cnamecnt, refresh, retry, expire; isc_result_t result; isc_time_t now; isc_boolean_t exiting = ISC_FALSE; @@ -7399,19 +7400,32 @@ stub_callback(isc_task_t *task, isc_even ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_write); if (zone->db == NULL) zone_attachdb(zone, stub->db); + result = zone_get_from_db(zone, zone->db, NULL, NULL, NULL, &refresh, + &retry, &expire, NULL, NULL); + if (result == ISC_R_SUCCESS) { + zone->refresh = RANGE(refresh, zone->minrefresh, + zone->maxrefresh); + zone->retry = RANGE(retry, zone->minretry, zone->maxretry); + zone->expire = RANGE(expire, zone->refresh + zone->retry, + DNS_MAX_EXPIRE); + DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_HAVETIMERS); + } ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_write); dns_db_detach(&stub->db); - if (zone->masterfile != NULL) - zone_needdump(zone, 0); - dns_message_destroy(&msg); isc_event_free(&event); dns_request_destroy(&zone->request); + DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_REFRESH); + DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_LOADED); DNS_ZONE_JITTER_ADD(&now, zone->refresh, &zone->refreshtime); isc_interval_set(&i, zone->expire, 0); DNS_ZONE_TIME_ADD(&now, zone->expire, &zone->expiretime); + + if (zone->masterfile != NULL) + zone_needdump(zone, 0); + zone_settimer(zone, &now); goto free_stub; Modified: vendor/bind9/dist-9.6/lib/isc/random.c ============================================================================== --- vendor/bind9/dist-9.6/lib/isc/random.c Tue Jul 24 18:53:28 2012 (r238746) +++ vendor/bind9/dist-9.6/lib/isc/random.c Tue Jul 24 19:00:36 2012 (r238747) @@ -103,7 +103,7 @@ isc_uint32_t isc_random_jitter(isc_uint32_t max, isc_uint32_t jitter) { isc_uint32_t rnd; - REQUIRE(jitter < max); + REQUIRE(jitter < max || (jitter == 0 && max == 0)); if (jitter == 0) return (max); Modified: vendor/bind9/dist-9.6/version ============================================================================== --- vendor/bind9/dist-9.6/version Tue Jul 24 18:53:28 2012 (r238746) +++ vendor/bind9/dist-9.6/version Tue Jul 24 19:00:36 2012 (r238747) @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=6 PATCHVER= RELEASETYPE=-ESV -RELEASEVER=-R7-P1 +RELEASEVER=-R7-P2 From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 19:00:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0BFBA106564A; Tue, 24 Jul 2012 19:00:57 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D156F8FC08; Tue, 24 Jul 2012 19:00:56 +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 q6OJ0ujR062911; Tue, 24 Jul 2012 19:00:56 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6OJ0uWW062910; Tue, 24 Jul 2012 19:00:56 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201207241900.q6OJ0uWW062910@svn.freebsd.org> From: Doug Barton Date: Tue, 24 Jul 2012 19:00:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238748 - vendor/bind9/9.6-ESV-R7-P2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 19:00:57 -0000 Author: dougb Date: Tue Jul 24 19:00:56 2012 New Revision: 238748 URL: http://svn.freebsd.org/changeset/base/238748 Log: Tag the 9.6-ESV-R7-P2 release Added: vendor/bind9/9.6-ESV-R7-P2/ - copied from r238747, vendor/bind9/dist-9.6/ From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 19:04:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 14D9B106564A; Tue, 24 Jul 2012 19:04:36 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E844F8FC15; Tue, 24 Jul 2012 19:04:35 +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 q6OJ4ZZ4063293; Tue, 24 Jul 2012 19:04:35 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6OJ4ZD0063287; Tue, 24 Jul 2012 19:04:35 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201207241904.q6OJ4ZD0063287@svn.freebsd.org> From: Doug Barton Date: Tue, 24 Jul 2012 19:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238749 - in stable/8/contrib/bind9: . lib/dns lib/isc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 19:04:36 -0000 Author: dougb Date: Tue Jul 24 19:04:35 2012 New Revision: 238749 URL: http://svn.freebsd.org/changeset/base/238749 Log: Heavy DNSSEC Validation Load Can Cause a "Bad Cache" Assertion Failure in BIND9 High numbers of queries with DNSSEC validation enabled can cause an assertion failure in named, caused by using a "bad cache" data structure before it has been initialized. CVE: CVE-2012-3817 Posting date: 24 July, 2012 Modified: stable/8/contrib/bind9/CHANGES stable/8/contrib/bind9/lib/dns/resolver.c stable/8/contrib/bind9/lib/dns/zone.c stable/8/contrib/bind9/lib/isc/random.c stable/8/contrib/bind9/version Directory Properties: stable/8/contrib/bind9/ (props changed) Modified: stable/8/contrib/bind9/CHANGES ============================================================================== --- stable/8/contrib/bind9/CHANGES Tue Jul 24 19:00:56 2012 (r238748) +++ stable/8/contrib/bind9/CHANGES Tue Jul 24 19:04:35 2012 (r238749) @@ -1,3 +1,14 @@ + --- 9.6-ESV-R7-P2 released --- + +3346. [security] Bad-cache data could be used before it was + initialized, causing an assert. [RT #30025] + +3343. [bug] Relax isc_random_jitter() REQUIRE tests. [RT #29821] + +3342. [bug] Change #3314 broke saving of stub zones to disk + resulting in excessive cpu usage in some cases. + [RT #29952] + --- 9.6-ESV-R7-P1 released --- 3331. [security] dns_rdataslab_fromrdataset could produce bad Modified: stable/8/contrib/bind9/lib/dns/resolver.c ============================================================================== --- stable/8/contrib/bind9/lib/dns/resolver.c Tue Jul 24 19:00:56 2012 (r238748) +++ stable/8/contrib/bind9/lib/dns/resolver.c Tue Jul 24 19:04:35 2012 (r238749) @@ -8124,6 +8124,7 @@ dns_resolver_addbadcache(dns_resolver_t goto cleanup; bad->type = type; bad->hashval = hashval; + bad->expire = *expire; isc_buffer_init(&buffer, bad + 1, name->length); dns_name_init(&bad->name, NULL); dns_name_copy(name, &bad->name, &buffer); @@ -8135,8 +8136,8 @@ dns_resolver_addbadcache(dns_resolver_t if (resolver->badcount < resolver->badhash * 2 && resolver->badhash > DNS_BADCACHE_SIZE) resizehash(resolver, &now, ISC_FALSE); - } - bad->expire = *expire; + } else + bad->expire = *expire; cleanup: UNLOCK(&resolver->lock); } Modified: stable/8/contrib/bind9/lib/dns/zone.c ============================================================================== --- stable/8/contrib/bind9/lib/dns/zone.c Tue Jul 24 19:00:56 2012 (r238748) +++ stable/8/contrib/bind9/lib/dns/zone.c Tue Jul 24 19:04:35 2012 (r238749) @@ -6054,6 +6054,7 @@ zone_maintenance(dns_zone_t *zone) { switch (zone->type) { case dns_zone_master: case dns_zone_slave: + case dns_zone_stub: LOCK_ZONE(zone); if (zone->masterfile != NULL && isc_time_compare(&now, &zone->dumptime) >= 0 && @@ -6395,7 +6396,7 @@ zone_dump(dns_zone_t *zone, isc_boolean_ goto fail; } - if (compact) { + if (compact && zone->type != dns_zone_stub) { dns_zone_t *dummy = NULL; LOCK_ZONE(zone); zone_iattach(zone, &dummy); @@ -7251,7 +7252,7 @@ stub_callback(isc_task_t *task, isc_even dns_zone_t *zone = NULL; char master[ISC_SOCKADDR_FORMATSIZE]; char source[ISC_SOCKADDR_FORMATSIZE]; - isc_uint32_t nscnt, cnamecnt; + isc_uint32_t nscnt, cnamecnt, refresh, retry, expire; isc_result_t result; isc_time_t now; isc_boolean_t exiting = ISC_FALSE; @@ -7399,19 +7400,32 @@ stub_callback(isc_task_t *task, isc_even ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_write); if (zone->db == NULL) zone_attachdb(zone, stub->db); + result = zone_get_from_db(zone, zone->db, NULL, NULL, NULL, &refresh, + &retry, &expire, NULL, NULL); + if (result == ISC_R_SUCCESS) { + zone->refresh = RANGE(refresh, zone->minrefresh, + zone->maxrefresh); + zone->retry = RANGE(retry, zone->minretry, zone->maxretry); + zone->expire = RANGE(expire, zone->refresh + zone->retry, + DNS_MAX_EXPIRE); + DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_HAVETIMERS); + } ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_write); dns_db_detach(&stub->db); - if (zone->masterfile != NULL) - zone_needdump(zone, 0); - dns_message_destroy(&msg); isc_event_free(&event); dns_request_destroy(&zone->request); + DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_REFRESH); + DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_LOADED); DNS_ZONE_JITTER_ADD(&now, zone->refresh, &zone->refreshtime); isc_interval_set(&i, zone->expire, 0); DNS_ZONE_TIME_ADD(&now, zone->expire, &zone->expiretime); + + if (zone->masterfile != NULL) + zone_needdump(zone, 0); + zone_settimer(zone, &now); goto free_stub; Modified: stable/8/contrib/bind9/lib/isc/random.c ============================================================================== --- stable/8/contrib/bind9/lib/isc/random.c Tue Jul 24 19:00:56 2012 (r238748) +++ stable/8/contrib/bind9/lib/isc/random.c Tue Jul 24 19:04:35 2012 (r238749) @@ -103,7 +103,7 @@ isc_uint32_t isc_random_jitter(isc_uint32_t max, isc_uint32_t jitter) { isc_uint32_t rnd; - REQUIRE(jitter < max); + REQUIRE(jitter < max || (jitter == 0 && max == 0)); if (jitter == 0) return (max); Modified: stable/8/contrib/bind9/version ============================================================================== --- stable/8/contrib/bind9/version Tue Jul 24 19:00:56 2012 (r238748) +++ stable/8/contrib/bind9/version Tue Jul 24 19:04:35 2012 (r238749) @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=6 PATCHVER= RELEASETYPE=-ESV -RELEASEVER=-R7-P1 +RELEASEVER=-R7-P2 From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 19:08:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C14761065673; Tue, 24 Jul 2012 19:08:12 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91E278FC19; Tue, 24 Jul 2012 19:08:12 +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 q6OJ8CK6063622; Tue, 24 Jul 2012 19:08:12 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6OJ8CJj063618; Tue, 24 Jul 2012 19:08:12 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201207241908.q6OJ8CJj063618@svn.freebsd.org> From: Doug Barton Date: Tue, 24 Jul 2012 19:08:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238750 - in vendor/bind9: dist dist-9.6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 19:08:12 -0000 Author: dougb Date: Tue Jul 24 19:08:12 2012 New Revision: 238750 URL: http://svn.freebsd.org/changeset/base/238750 Log: Update to reflect new svn realities Modified: vendor/bind9/dist-9.6/FREEBSD-Upgrade vendor/bind9/dist/FREEBSD-Upgrade Modified: vendor/bind9/dist-9.6/FREEBSD-Upgrade ============================================================================== --- vendor/bind9/dist-9.6/FREEBSD-Upgrade Tue Jul 24 19:04:35 2012 (r238749) +++ vendor/bind9/dist-9.6/FREEBSD-Upgrade Tue Jul 24 19:08:12 2012 (r238750) @@ -7,7 +7,8 @@ 2) Check out the head of the subversion "vendor branch" - svn co $REPO/vendor/bind9/dist-9.6 + REPO=svn+ssh://svn.freebsd.org/ + svn co $REPO/base/vendor/bind9/dist-9.6 3) Unpack the tarball in a suitable directory: @@ -32,21 +33,21 @@ 7) Commit the update to the vendor files: cd dist-9.6 ; svn ci -m "Vendor import of BIND 9.X.Y" - svn cp $REPO/vendor/bind9/dist-9.6 $REPO/vendor/bind9/${version} + svn cp $REPO/base/vendor/bind9/dist-9.6 $REPO/base/vendor/bind9/${version} (this is a server-side operation, you dont have to check it out) 8) Update the files in src/contrib/bind9: - cd head/contrib/bind9 + cd stable/8/contrib/bind9 Make sure you are up to date: svn update ; svn status - svn merge $REPO/vendor/bind9/dist-9.6 . + svn merge $REPO/base/vendor/bind9/dist-9.6 . Resolve conflicts (if any) Carefully check the output of 'svn status' and 'svn diff' - NOTE: You may need 2 copies of head/contrib/bind9 at this point, + NOTE: You may need 2 copies of stable/8/contrib/bind9 at this point, one to do the work in steps 9 and 10 below, and a clean version to commit in step 16. Modified: vendor/bind9/dist/FREEBSD-Upgrade ============================================================================== --- vendor/bind9/dist/FREEBSD-Upgrade Tue Jul 24 19:04:35 2012 (r238749) +++ vendor/bind9/dist/FREEBSD-Upgrade Tue Jul 24 19:08:12 2012 (r238750) @@ -7,7 +7,8 @@ 2) Check out the head of the subversion "vendor branch" - svn co $REPO/vendor/bind9/dist + REPO=svn+ssh://svn.freebsd.org/ + svn co $REPO/base/vendor/bind9/dist 3) Unpack the tarball in a suitable directory: @@ -32,7 +33,7 @@ 7) Commit the update to the vendor files: cd dist ; svn ci -m "Vendor import of BIND 9.X.Y" - svn cp $REPO/vendor/bind9/dist $REPO/vendor/bind9/${version} + svn cp $REPO/base/vendor/bind9/dist $REPO/base/vendor/bind9/${version} (this is a server-side operation, you dont have to check it out) 8) Update the files in src/contrib/bind9: @@ -42,7 +43,7 @@ Make sure you are up to date: svn update ; svn status - svn merge $REPO/vendor/bind9/dist . + svn merge $REPO/base/vendor/bind9/dist . Resolve conflicts (if any) Carefully check the output of 'svn status' and 'svn diff' From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 19:10:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A40981065674; Tue, 24 Jul 2012 19:10:44 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 748798FC1A; Tue, 24 Jul 2012 19:10:44 +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 q6OJAieV063854; Tue, 24 Jul 2012 19:10:44 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6OJAinu063851; Tue, 24 Jul 2012 19:10:44 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201207241910.q6OJAinu063851@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 24 Jul 2012 19:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238751 - in stable/8/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 19:10:44 -0000 Author: trociny Date: Tue Jul 24 19:10:43 2012 New Revision: 238751 URL: http://svn.freebsd.org/changeset/base/238751 Log: MFC r227316: Add KVME_FLAG_SUPER and use it in sysctl_kern_proc_vmmap for marking entries with superpages. Submitted by: Mel Flynn Reviewed by: alc, rwatson Modified: stable/8/sys/kern/kern_proc.c stable/8/sys/sys/user.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/kern_proc.c ============================================================================== --- stable/8/sys/kern/kern_proc.c Tue Jul 24 19:08:12 2012 (r238750) +++ stable/8/sys/kern/kern_proc.c Tue Jul 24 19:10:43 2012 (r238751) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -74,6 +75,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef COMPAT_FREEBSD32 @@ -1750,7 +1752,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR entry = entry->next) { vm_object_t obj, tobj, lobj; vm_offset_t addr; - int vfslocked; + int vfslocked, mincoreinfo; if (entry->eflags & MAP_ENTRY_IS_SUB_MAP) continue; @@ -1768,8 +1770,11 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR kve->kve_resident = 0; addr = entry->start; while (addr < entry->end) { - if (pmap_extract(map->pmap, addr)) + mincoreinfo = pmap_mincore(map->pmap, addr); + if (mincoreinfo & MINCORE_INCORE) kve->kve_resident++; + if (mincoreinfo & MINCORE_SUPER) + kve->kve_flags |= KVME_FLAG_SUPER; addr += PAGE_SIZE; } Modified: stable/8/sys/sys/user.h ============================================================================== --- stable/8/sys/sys/user.h Tue Jul 24 19:08:12 2012 (r238750) +++ stable/8/sys/sys/user.h Tue Jul 24 19:10:43 2012 (r238751) @@ -338,6 +338,7 @@ struct kinfo_file { #define KVME_FLAG_COW 0x00000001 #define KVME_FLAG_NEEDS_COPY 0x00000002 #define KVME_FLAG_NOCOREDUMP 0x00000004 +#define KVME_FLAG_SUPER 0x00000008 #if defined(__amd64__) #define KINFO_OVMENTRY_SIZE 1168 From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 19:11:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B158A106566C; Tue, 24 Jul 2012 19:11:51 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 829C88FC1D; Tue, 24 Jul 2012 19:11:51 +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 q6OJBptW063992; Tue, 24 Jul 2012 19:11:51 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6OJBpnD063991; Tue, 24 Jul 2012 19:11:51 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201207241911.q6OJBpnD063991@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 24 Jul 2012 19:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238752 - stable/8/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 19:11:51 -0000 Author: trociny Date: Tue Jul 24 19:11:50 2012 New Revision: 238752 URL: http://svn.freebsd.org/changeset/base/238752 Log: MFC r227317, r227355: When displaying process virtual memory mappings print superpage mapping flag. Submitted by: Mel Flynn Reviewed by: alc, rwatson Modified: stable/8/usr.bin/procstat/procstat.1 stable/8/usr.bin/procstat/procstat_vm.c Directory Properties: stable/8/usr.bin/procstat/ (props changed) Modified: stable/8/usr.bin/procstat/procstat.1 ============================================================================== --- stable/8/usr.bin/procstat/procstat.1 Tue Jul 24 19:10:43 2012 (r238751) +++ stable/8/usr.bin/procstat/procstat.1 Tue Jul 24 19:11:50 2012 (r238752) @@ -391,6 +391,8 @@ The following mapping flags may be displ copy-on-write .It N needs copy +.It S +one or more superpage mappings are used .El .Sh EXIT STATUS .Ex -std Modified: stable/8/usr.bin/procstat/procstat_vm.c ============================================================================== --- stable/8/usr.bin/procstat/procstat_vm.c Tue Jul 24 19:10:43 2012 (r238751) +++ stable/8/usr.bin/procstat/procstat_vm.c Tue Jul 24 19:11:50 2012 (r238752) @@ -49,7 +49,7 @@ procstat_vm(pid_t pid, struct kinfo_proc ptrwidth = 2*sizeof(void *) + 2; if (!hflag) - printf("%5s %*s %*s %3s %4s %4s %3s %3s %2s %-2s %-s\n", + printf("%5s %*s %*s %3s %4s %4s %3s %3s %3s %-2s %-s\n", "PID", ptrwidth, "START", ptrwidth, "END", "PRT", "RES", "PRES", "REF", "SHD", "FL", "TP", "PATH"); @@ -69,8 +69,9 @@ procstat_vm(pid_t pid, struct kinfo_proc printf("%3d ", kve->kve_ref_count); printf("%3d ", kve->kve_shadow_count); printf("%-1s", kve->kve_flags & KVME_FLAG_COW ? "C" : "-"); - printf("%-1s ", kve->kve_flags & KVME_FLAG_NEEDS_COPY ? "N" : + printf("%-1s", kve->kve_flags & KVME_FLAG_NEEDS_COPY ? "N" : "-"); + printf("%-1s ", kve->kve_flags & KVME_FLAG_SUPER ? "S" : "-"); switch (kve->kve_type) { case KVME_TYPE_NONE: str = "--"; From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 19:40:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7620E1065672; Tue, 24 Jul 2012 19:40:13 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6064B8FC08; Tue, 24 Jul 2012 19:40:13 +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 q6OJeDLe066406; Tue, 24 Jul 2012 19:40:13 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6OJeDfb066404; Tue, 24 Jul 2012 19:40:13 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201207241940.q6OJeDfb066404@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 24 Jul 2012 19:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238753 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 19:40:13 -0000 Author: trociny Date: Tue Jul 24 19:40:12 2012 New Revision: 238753 URL: http://svn.freebsd.org/changeset/base/238753 Log: Align the header with output. MFC after: 3 days Modified: head/usr.bin/procstat/procstat_vm.c Modified: head/usr.bin/procstat/procstat_vm.c ============================================================================== --- head/usr.bin/procstat/procstat_vm.c Tue Jul 24 19:11:50 2012 (r238752) +++ head/usr.bin/procstat/procstat_vm.c Tue Jul 24 19:40:12 2012 (r238753) @@ -50,7 +50,7 @@ procstat_vm(struct kinfo_proc *kipp) ptrwidth = 2*sizeof(void *) + 2; if (!hflag) - printf("%5s %*s %*s %3s %4s %4s %3s %3s %3s %-2s %-s\n", + printf("%5s %*s %*s %3s %4s %4s %3s %3s %4s %-2s %-s\n", "PID", ptrwidth, "START", ptrwidth, "END", "PRT", "RES", "PRES", "REF", "SHD", "FL", "TP", "PATH"); From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 20:53:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2444F106566B; Tue, 24 Jul 2012 20:53:52 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by mx1.freebsd.org (Postfix) with ESMTP id F04A18FC0C; Tue, 24 Jul 2012 20:53:51 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.5/8.14.5) with ESMTP id q6OKrpFj065478; Tue, 24 Jul 2012 13:53:51 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.5/8.14.5/Submit) id q6OKrpVV065477; Tue, 24 Jul 2012 13:53:51 -0700 (PDT) (envelope-from sgk) Date: Tue, 24 Jul 2012 13:53:51 -0700 From: Steve Kargl To: Alexey Dokuchaev , Steve Kargl , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20120724205351.GA65323@troutmask.apl.washington.edu> References: <201207231913.q6NJDucB040333@svn.freebsd.org> <20120724084335.GB28038@FreeBSD.org> <20120724174206.GA63841@troutmask.apl.washington.edu> <20120724175712.GA66863@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120724175712.GA66863@zim.MIT.EDU> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: svn commit: r238722 - in head/lib/msun: . ld128 ld80 man src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 20:53:52 -0000 On Tue, Jul 24, 2012 at 01:57:12PM -0400, David Schultz wrote: > On Tue, Jul 24, 2012, Steve Kargl wrote: > > On Tue, Jul 24, 2012 at 08:43:35AM +0000, Alexey Dokuchaev wrote: > > > On Mon, Jul 23, 2012 at 07:13:56PM +0000, Steve Kargl wrote: > > > > Author: kargl > > > > Date: Mon Jul 23 19:13:55 2012 > > > > New Revision: 238722 > > > > URL: http://svn.freebsd.org/changeset/base/238722 > > > > > > > > Log: > > > > Compute the exponential of x for Intel 80-bit format and IEEE 128-bit > > > > format. These implementations are based on > > > > > > > > PTP Tang, "Table-driven implementation of the exponential function > > > > in IEEE floating-point arithmetic," ACM Trans. Math. Soft., 15, > > > > 144-157 (1989). > > > > > > I believe some ports could benefit from OSVERSION bump for this one. > > > > > > > I've never done a OSVERSION bump, so you'll need to tell me how. > > But, more importantly, I can find no information in the Developer's > > Handbook and only two rather terse references in the Porter's > > Handbook. So, what is OSVERSION? Why do you think it needs a > > bump? > > It is the same as the __FreeBSD_version bump I mentioned in my > email last week. Basically it is a number you increment in > sys/sys/param.h whenever there is a significant change that > porters and developers of third-party software might want to test > against. In this case, it would help any ports that have > workarounds for the lack of expl() to compile both before and > after this change. But it's also important not to bump the > version gratuitously if there's no reason to believe the change > might introduce incompatibilities. > > The purpose of each __FreeBSD_version bump is documented here: > > http://www.freebsd.org/doc/en/books/porters-handbook/freebsd-versions.html > > We should probably talk about how to update this file at some > point, although for the first one or two times, it's probably fine > to get a doc committer to help out with this step. The only time that __FreeBSD_version has been bumped for a libm change occurred at 802502 March 6, 2011 8.2-STABLE after merging log2 and log2f into libm. 900027 December 5, 2010 9.0-CURRENT after the addition of log2 to libm. Conspicuously, missing are bumps for additions of sqrtl(), cbrtl(), long double trig. functions, exp2l(), and few other changes. But, if people want a bump here's a diff Index: sys/sys/param.h =================================================================== --- sys/sys/param.h (revision 238752) +++ sys/sys/param.h (working copy) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000015 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000016 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, I can't change the porters-handbook, as I grab sources with csup and the following supfile: *default host=cvsup3.FreeBSD.org *default base=/usr/home/kargl/freebsd/ncvs *default prefix=/usr/home/kargl/freebsd/ncvs *default release=cvs *default delete use-rel-suffix *default compress doc-all www A check out of doc/ yields a file named doc/en_US.ISO8859-1/books/porters-handbook/book.sgml The last entry in this file reads 1000012 May 2, 2012 10-CURRENT jemalloc import (rev 234924). If one checks the URL you posted, one see that 1000013 May 22, 2012 10-CURRENT after byacc import (rev 235788). 1000014 June 27, 2012 10-CURRENT after BSD sort becoming the default sort (rev 237629). 1000015 July 12, 2012 10-CURRENT after import of OpenSSL 1.0.1c (rev 238405). (not changed) July 13, 2012 10-CURRENT after the fix for LLVM/Clang 3.1 regression (rev 238429). So, I have no idea were the most current source lives. -- Steve From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 21:00:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 898AA1065673 for ; Tue, 24 Jul 2012 21:00:34 +0000 (UTC) (envelope-from dougb@dougbarton.us) Received: from mail2.fluidhosting.com (mx22.fluidhosting.com [204.14.89.5]) by mx1.freebsd.org (Postfix) with ESMTP id BEFFA8FC14 for ; Tue, 24 Jul 2012 21:00:33 +0000 (UTC) Received: (qmail 15064 invoked by uid 399); 24 Jul 2012 21:00:23 -0000 Received: from unknown (HELO ?172.17.127.241?) (dougb@dougbarton.us@12.207.105.210) by mail2.fluidhosting.com with ESMTPAM; 24 Jul 2012 21:00:23 -0000 X-Originating-IP: 12.207.105.210 X-Sender: dougb@dougbarton.us Message-ID: <500F0CEA.2070405@dougbarton.us> Date: Tue, 24 Jul 2012 14:00:26 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: Steve Kargl References: <201207231913.q6NJDucB040333@svn.freebsd.org> <20120724084335.GB28038@FreeBSD.org> <20120724174206.GA63841@troutmask.apl.washington.edu> <20120724175712.GA66863@zim.MIT.EDU> <20120724205351.GA65323@troutmask.apl.washington.edu> In-Reply-To: <20120724205351.GA65323@troutmask.apl.washington.edu> X-Enigmail-Version: 1.4.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, Steve Kargl Subject: Re: svn commit: r238722 - in head/lib/msun: . ld128 ld80 man src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 21:00:34 -0000 On 7/24/2012 1:53 PM, Steve Kargl wrote: > So, I have no idea were the most current source lives. All 3 parts of the project are in svn now. There is a primer for doc svn on the wiki. -- If you're never wrong, you're not trying hard enough From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 21:10:48 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B52F71065678; Tue, 24 Jul 2012 21:10:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 6FCBE8FC1A; Tue, 24 Jul 2012 21:10:47 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA07667; Wed, 25 Jul 2012 00:10:39 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1StmNL-00051m-GZ; Wed, 25 Jul 2012 00:10:39 +0300 Message-ID: <500F0F4D.2050409@FreeBSD.org> Date: Wed, 25 Jul 2012 00:10:37 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120620 Thunderbird/13.0.1 MIME-Version: 1.0 To: "George V. Neville-Neil" References: <201207241801.q6OI1SPS057812@svn.freebsd.org> In-Reply-To: <201207241801.q6OI1SPS057812@svn.freebsd.org> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238743 - head/cddl/contrib/opensolaris/cmd/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 21:10:48 -0000 on 24/07/2012 21:01 George V. Neville-Neil said the following: > Author: gnn > Date: Tue Jul 24 18:01:28 2012 > New Revision: 238743 > URL: http://svn.freebsd.org/changeset/base/238743 > > Log: > Fix a bug in interrupt handling so that we're only considered > impatient if we sent more than 2 INT signals. This fixes a bug where > we wouldn't see aggregations print on the command line if we Ctrl-C'd > a dtrace script or command line invocation. I'd rather fix the shell that sends 2 or 2+ SIGINTs on one Ctrl-C. [half-joking] I think that _a bug_ is there, not here. I do not experience any such problems with zsh. > MFC after: 2 weeks > > Modified: > head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c > > Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c > ============================================================================== > --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Tue Jul 24 16:29:33 2012 (r238742) > +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Tue Jul 24 18:01:28 2012 (r238743) > @@ -70,6 +70,8 @@ typedef struct dtrace_cmd { > #define E_ERROR 1 > #define E_USAGE 2 > > +#define IMPATIENT_LIMIT 2 > + > static const char DTRACE_OPTSTR[] = > "3:6:aAb:Bc:CD:ef:FGhHi:I:lL:m:n:o:p:P:qs:SU:vVwx:X:Z"; > > @@ -1202,7 +1204,7 @@ intr(int signo) > if (!g_intr) > g_newline = 1; > > - if (g_intr++) > + if (g_intr++ > IMPATIENT_LIMIT) > g_impatient = 1; Because of the postfix ++ g_impatient will be set to one at the _forth_ run through this code (assuming that the initial value of g_intr is zero) contrary to what you say in the commit message. > } > > BTW, posting even trivial patches for a review as a part of the routine seems to be a good habit in general. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 22:10:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BF49106566B; Tue, 24 Jul 2012 22:10:12 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66F608FC16; Tue, 24 Jul 2012 22:10:12 +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 q6OMACQR079605; Tue, 24 Jul 2012 22:10:12 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6OMACqV079603; Tue, 24 Jul 2012 22:10:12 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201207242210.q6OMACqV079603@svn.freebsd.org> From: Jim Harris Date: Tue, 24 Jul 2012 22:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 22:10:12 -0000 Author: jimharris Date: Tue Jul 24 22:10:11 2012 New Revision: 238755 URL: http://svn.freebsd.org/changeset/base/238755 Log: Add rmb() to tsc_read_##x to enforce serialization of rdtsc captures. Intel Architecture Manual specifies that rdtsc instruction is not serialized, so without this change, TSC synchronization test would periodically fail, resulting in use of HPET timecounter instead of TSC-low. This caused severe performance degradation (40-50%) when running high IO/s workloads due to HPET MMIO reads and GEOM stat collection. Tests on Xeon E5-2600 (Sandy Bridge) 8C systems were seeing TSC synchronization fail approximately 20% of the time. Sponsored by: Intel Reviewed by: kib MFC after: 3 days Modified: head/sys/x86/x86/tsc.c Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Tue Jul 24 20:15:41 2012 (r238754) +++ head/sys/x86/x86/tsc.c Tue Jul 24 22:10:11 2012 (r238755) @@ -328,6 +328,7 @@ init_TSC(void) #ifdef SMP +/* rmb is required here because rdtsc is not a serializing instruction. */ #define TSC_READ(x) \ static void \ tsc_read_##x(void *arg) \ @@ -335,6 +336,7 @@ tsc_read_##x(void *arg) \ uint32_t *tsc = arg; \ u_int cpu = PCPU_GET(cpuid); \ \ + rmb(); \ tsc[cpu * 3 + x] = rdtsc32(); \ } TSC_READ(0) From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 22:32:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 276611065689; Tue, 24 Jul 2012 22:32:04 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07A648FC17; Tue, 24 Jul 2012 22:32:03 +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 q6OMW3pc081509; Tue, 24 Jul 2012 22:32:03 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6OMW3Ch081504; Tue, 24 Jul 2012 22:32:03 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201207242232.q6OMW3Ch081504@svn.freebsd.org> From: Doug Barton Date: Tue, 24 Jul 2012 22:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238756 - in stable/9/contrib/bind9: . lib/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 22:32:04 -0000 Author: dougb Date: Tue Jul 24 22:32:03 2012 New Revision: 238756 URL: http://svn.freebsd.org/changeset/base/238756 Log: MFV r238744: Heavy DNSSEC Validation Load Can Cause a "Bad Cache" Assertion Failure in BIND9 High numbers of queries with DNSSEC validation enabled can cause an assertion failure in named, caused by using a "bad cache" data structure before it has been initialized. CVE: CVE-2012-3817 Posting date: 24 July, 2012 Approved by: re (kib) Modified: stable/9/contrib/bind9/CHANGES stable/9/contrib/bind9/lib/dns/resolver.c stable/9/contrib/bind9/lib/dns/zone.c stable/9/contrib/bind9/version Directory Properties: stable/9/contrib/bind9/ (props changed) Modified: stable/9/contrib/bind9/CHANGES ============================================================================== --- stable/9/contrib/bind9/CHANGES Tue Jul 24 22:10:11 2012 (r238755) +++ stable/9/contrib/bind9/CHANGES Tue Jul 24 22:32:03 2012 (r238756) @@ -1,3 +1,12 @@ + --- 9.8.3-P2 released --- + +3346. [security] Bad-cache data could be used before it was + initialized, causing an assert. [RT #30025] + +3342. [bug] Change #3314 broke saving of stub zones to disk + resulting in excessive cpu usage in some cases. + [RT #29952] + --- 9.8.3-P1 released --- 3331. [security] dns_rdataslab_fromrdataset could produce bad Modified: stable/9/contrib/bind9/lib/dns/resolver.c ============================================================================== --- stable/9/contrib/bind9/lib/dns/resolver.c Tue Jul 24 22:10:11 2012 (r238755) +++ stable/9/contrib/bind9/lib/dns/resolver.c Tue Jul 24 22:32:03 2012 (r238756) @@ -8448,6 +8448,7 @@ dns_resolver_addbadcache(dns_resolver_t goto cleanup; bad->type = type; bad->hashval = hashval; + bad->expire = *expire; isc_buffer_init(&buffer, bad + 1, name->length); dns_name_init(&bad->name, NULL); dns_name_copy(name, &bad->name, &buffer); @@ -8459,8 +8460,8 @@ dns_resolver_addbadcache(dns_resolver_t if (resolver->badcount < resolver->badhash * 2 && resolver->badhash > DNS_BADCACHE_SIZE) resizehash(resolver, &now, ISC_FALSE); - } - bad->expire = *expire; + } else + bad->expire = *expire; cleanup: UNLOCK(&resolver->lock); } Modified: stable/9/contrib/bind9/lib/dns/zone.c ============================================================================== --- stable/9/contrib/bind9/lib/dns/zone.c Tue Jul 24 22:10:11 2012 (r238755) +++ stable/9/contrib/bind9/lib/dns/zone.c Tue Jul 24 22:32:03 2012 (r238756) @@ -8027,13 +8027,14 @@ zone_maintenance(dns_zone_t *zone) { case dns_zone_master: case dns_zone_slave: case dns_zone_key: + case dns_zone_stub: LOCK_ZONE(zone); if (zone->masterfile != NULL && isc_time_compare(&now, &zone->dumptime) >= 0 && DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADED) && DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NEEDDUMP)) { dumping = was_dumping(zone); - } else + } else dumping = ISC_TRUE; UNLOCK_ZONE(zone); if (!dumping) { @@ -8386,7 +8387,7 @@ zone_dump(dns_zone_t *zone, isc_boolean_ goto fail; } - if (compact) { + if (compact && zone->type != dns_zone_stub) { dns_zone_t *dummy = NULL; LOCK_ZONE(zone); zone_iattach(zone, &dummy); @@ -9242,7 +9243,7 @@ stub_callback(isc_task_t *task, isc_even dns_zone_t *zone = NULL; char master[ISC_SOCKADDR_FORMATSIZE]; char source[ISC_SOCKADDR_FORMATSIZE]; - isc_uint32_t nscnt, cnamecnt; + isc_uint32_t nscnt, cnamecnt, refresh, retry, expire; isc_result_t result; isc_time_t now; isc_boolean_t exiting = ISC_FALSE; @@ -9390,19 +9391,32 @@ stub_callback(isc_task_t *task, isc_even ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_write); if (zone->db == NULL) zone_attachdb(zone, stub->db); + result = zone_get_from_db(zone, zone->db, NULL, NULL, NULL, &refresh, + &retry, &expire, NULL, NULL); + if (result == ISC_R_SUCCESS) { + zone->refresh = RANGE(refresh, zone->minrefresh, + zone->maxrefresh); + zone->retry = RANGE(retry, zone->minretry, zone->maxretry); + zone->expire = RANGE(expire, zone->refresh + zone->retry, + DNS_MAX_EXPIRE); + DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_HAVETIMERS); + } ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_write); dns_db_detach(&stub->db); - if (zone->masterfile != NULL) - zone_needdump(zone, 0); - dns_message_destroy(&msg); isc_event_free(&event); dns_request_destroy(&zone->request); + DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_REFRESH); + DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_LOADED); DNS_ZONE_JITTER_ADD(&now, zone->refresh, &zone->refreshtime); isc_interval_set(&i, zone->expire, 0); DNS_ZONE_TIME_ADD(&now, zone->expire, &zone->expiretime); + + if (zone->masterfile != NULL) + zone_needdump(zone, 0); + zone_settimer(zone, &now); goto free_stub; Modified: stable/9/contrib/bind9/version ============================================================================== --- stable/9/contrib/bind9/version Tue Jul 24 22:10:11 2012 (r238755) +++ stable/9/contrib/bind9/version Tue Jul 24 22:32:03 2012 (r238756) @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=8 PATCHVER=3 RELEASETYPE=-P -RELEASEVER=1 +RELEASEVER=2 From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 23:01:06 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8665E1065670; Tue, 24 Jul 2012 23:01:06 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 5306B8FC0C; Tue, 24 Jul 2012 23:01:06 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q6ON15F6068326; Tue, 24 Jul 2012 19:01:05 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q6ON1581068325; Tue, 24 Jul 2012 19:01:05 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Tue, 24 Jul 2012 19:01:05 -0400 From: David Schultz To: Steve Kargl Message-ID: <20120724230105.GA68050@zim.MIT.EDU> Mail-Followup-To: Steve Kargl , Alexey Dokuchaev , Steve Kargl , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201207231913.q6NJDucB040333@svn.freebsd.org> <20120724084335.GB28038@FreeBSD.org> <20120724174206.GA63841@troutmask.apl.washington.edu> <20120724175712.GA66863@zim.MIT.EDU> <20120724205351.GA65323@troutmask.apl.washington.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120724205351.GA65323@troutmask.apl.washington.edu> Cc: svn-src-head@FreeBSD.ORG, Alexey Dokuchaev , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, Steve Kargl Subject: Re: svn commit: r238722 - in head/lib/msun: . ld128 ld80 man src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 23:01:06 -0000 On Tue, Jul 24, 2012, Steve Kargl wrote: > On Tue, Jul 24, 2012 at 01:57:12PM -0400, David Schultz wrote: > > On Tue, Jul 24, 2012, Steve Kargl wrote: > > > On Tue, Jul 24, 2012 at 08:43:35AM +0000, Alexey Dokuchaev wrote: > > > > On Mon, Jul 23, 2012 at 07:13:56PM +0000, Steve Kargl wrote: > > > > > Author: kargl > > > > > Date: Mon Jul 23 19:13:55 2012 > > > > > New Revision: 238722 > > > > > URL: http://svn.freebsd.org/changeset/base/238722 > > > > > > > > > > Log: > > > > > Compute the exponential of x for Intel 80-bit format and IEEE 128-bit > > > > > format. These implementations are based on > > > > > > > > > > PTP Tang, "Table-driven implementation of the exponential function > > > > > in IEEE floating-point arithmetic," ACM Trans. Math. Soft., 15, > > > > > 144-157 (1989). > > > > > > > > I believe some ports could benefit from OSVERSION bump for this one. > > > > > > > > > > I've never done a OSVERSION bump, so you'll need to tell me how. > > > But, more importantly, I can find no information in the Developer's > > > Handbook and only two rather terse references in the Porter's > > > Handbook. So, what is OSVERSION? Why do you think it needs a > > > bump? > > > > It is the same as the __FreeBSD_version bump I mentioned in my > > email last week. Basically it is a number you increment in > > sys/sys/param.h whenever there is a significant change that > > porters and developers of third-party software might want to test > > against. In this case, it would help any ports that have > > workarounds for the lack of expl() to compile both before and > > after this change. But it's also important not to bump the > > version gratuitously if there's no reason to believe the change > > might introduce incompatibilities. > > > > The purpose of each __FreeBSD_version bump is documented here: > > > > http://www.freebsd.org/doc/en/books/porters-handbook/freebsd-versions.html > > > > We should probably talk about how to update this file at some > > point, although for the first one or two times, it's probably fine > > to get a doc committer to help out with this step. > > The only time that __FreeBSD_version has been bumped for a libm change > occurred at > > 802502 March 6, 2011 8.2-STABLE after merging log2 and log2f into libm. > 900027 December 5, 2010 9.0-CURRENT after the addition of log2 to libm. > > Conspicuously, missing are bumps for additions of sqrtl(), cbrtl(), long > double trig. functions, exp2l(), and few other changes. But, if people > want a bump here's a diff I believe there's at least one other; if a bump occurred due to another recent change, we usually don't bump it again. For most of those functions there weren't any workarounds in ports that had to be ifdef'd. With expl(), there probably are, although I haven't checked. > Index: sys/sys/param.h > =================================================================== > --- sys/sys/param.h (revision 238752) > +++ sys/sys/param.h (working copy) > @@ -58,7 +58,7 @@ > * in the range 5 to 9. > */ > #undef __FreeBSD_version > -#define __FreeBSD_version 1000015 /* Master, propagated to newvers */ > +#define __FreeBSD_version 1000016 /* Master, propagated to newvers */ > > /* > * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, This looks good. Note that if you MFC the change, there will need to be a different bump in -STABLE. > I can't change the porters-handbook, as I grab sources with csup and > the following supfile: > > *default host=cvsup3.FreeBSD.org > *default base=/usr/home/kargl/freebsd/ncvs > *default prefix=/usr/home/kargl/freebsd/ncvs > *default release=cvs > *default delete use-rel-suffix > *default compress > doc-all > www > > A check out of doc/ yields a file named > doc/en_US.ISO8859-1/books/porters-handbook/book.sgml > > The last entry in this file reads > > > 1000012 > May 2, 2012 > 10-CURRENT jemalloc import > (rev 234924). > That's the right file, and you can commit changes with 'cvs -dkargl@ncvs.FreeBSD.ORG:/home/dcvs' even if you checked the file out from a local repo. As a src committer, you want to be careful if you touch other repositories, i.e., ask a doc committer to review it if you're unsure. > If one checks the URL you posted, one see that > 1000013 May 22, 2012 10-CURRENT after byacc import (rev 235788). > 1000014 June 27, 2012 10-CURRENT after BSD sort becoming the default sort (rev 237629). > 1000015 July 12, 2012 10-CURRENT after import of OpenSSL 1.0.1c (rev 238405). > (not changed) July 13, 2012 10-CURRENT after the fix for LLVM/Clang 3.1 regression (rev 238429). > > So, I have no idea were the most current source lives. Yeah, often people neglect to document version bumps until someone cleans up after them. From owner-svn-src-all@FreeBSD.ORG Tue Jul 24 23:03:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EE81B1065670; Tue, 24 Jul 2012 23:03:48 +0000 (UTC) (envelope-from das@freebsd.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id A98CB8FC14; Tue, 24 Jul 2012 23:03:48 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q6ON3mRN068385; Tue, 24 Jul 2012 19:03:48 -0400 (EDT) (envelope-from das@freebsd.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q6ON3mQh068384; Tue, 24 Jul 2012 19:03:48 -0400 (EDT) (envelope-from das@freebsd.org) Date: Tue, 24 Jul 2012 19:03:48 -0400 From: David Schultz To: Steve Kargl , Alexey Dokuchaev , Steve Kargl , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20120724230348.GB68050@zim.MIT.EDU> Mail-Followup-To: Steve Kargl , Alexey Dokuchaev , Steve Kargl , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201207231913.q6NJDucB040333@svn.freebsd.org> <20120724084335.GB28038@FreeBSD.org> <20120724174206.GA63841@troutmask.apl.washington.edu> <20120724175712.GA66863@zim.MIT.EDU> <20120724205351.GA65323@troutmask.apl.washington.edu> <20120724230105.GA68050@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120724230105.GA68050@zim.MIT.EDU> Cc: Subject: Re: svn commit: r238722 - in head/lib/msun: . ld128 ld80 man src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 23:03:49 -0000 On Tue, Jul 24, 2012, David Schultz wrote: > That's the right file, and you can commit changes with > 'cvs -dkargl@ncvs.FreeBSD.ORG:/home/dcvs' even if you checked > the file out from a local repo. As a src committer, you want > to be careful if you touch other repositories, i.e., ask a doc > committer to review it if you're unsure. I just remembered that the doc repo was recently switched to svn, so ignore the first sentence. The second sentence still applies, and this is an example of why. :) From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 01:57:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1E22F106564A; Wed, 25 Jul 2012 01:57:54 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07E1B8FC08; Wed, 25 Jul 2012 01:57:54 +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 q6P1vrnC097711; Wed, 25 Jul 2012 01:57:53 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6P1vrNI097708; Wed, 25 Jul 2012 01:57:53 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201207250157.q6P1vrNI097708@svn.freebsd.org> From: David Xu Date: Wed, 25 Jul 2012 01:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238760 - stable/8/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 01:57:54 -0000 Author: davidxu Date: Wed Jul 25 01:57:53 2012 New Revision: 238760 URL: http://svn.freebsd.org/changeset/base/238760 Log: Revert r238715, the revision breaks firefox. Reported by: dougb Modified: stable/8/lib/libthr/thread/thr_setprio.c (contents, props changed) stable/8/lib/libthr/thread/thr_setschedparam.c (contents, props changed) Modified: stable/8/lib/libthr/thread/thr_setprio.c ============================================================================== --- stable/8/lib/libthr/thread/thr_setprio.c Wed Jul 25 01:05:49 2012 (r238759) +++ stable/8/lib/libthr/thread/thr_setprio.c Wed Jul 25 01:57:53 2012 (r238760) @@ -45,22 +45,38 @@ _pthread_setprio(pthread_t pthread, int int ret; param.sched_priority = prio; - if (pthread == curthread) + if (pthread == curthread) { THR_LOCK(curthread); - else if ((ret = _thr_find_thread(curthread, pthread, /*include dead*/0))) - return (ret); - if (pthread->attr.sched_policy == SCHED_OTHER || - pthread->attr.prio == prio) { - pthread->attr.prio = prio; - ret = 0; - } else { - ret = _thr_setscheduler(pthread->tid, - pthread->attr.sched_policy, ¶m); - if (ret == -1) - ret = errno; - else + if (curthread->attr.sched_policy == SCHED_OTHER || + curthread->attr.prio == prio) { + curthread->attr.prio = prio; + ret = 0; + } else { + ret = _thr_setscheduler(curthread->tid, + curthread->attr.sched_policy, ¶m); + if (ret == -1) + ret = errno; + else + curthread->attr.prio = prio; + } + THR_UNLOCK(curthread); + } else if ((ret = _thr_ref_add(curthread, pthread, /*include dead*/0)) + == 0) { + THR_THREAD_LOCK(curthread, pthread); + if (pthread->attr.sched_policy == SCHED_OTHER || + pthread->attr.prio == prio) { pthread->attr.prio = prio; + ret = 0; + } else { + ret = _thr_setscheduler(pthread->tid, + curthread->attr.sched_policy, ¶m); + if (ret == -1) + ret = errno; + else + pthread->attr.prio = prio; + } + THR_THREAD_UNLOCK(curthread, pthread); + _thr_ref_delete(curthread, pthread); } - THR_THREAD_UNLOCK(curthread, pthread); return (ret); } Modified: stable/8/lib/libthr/thread/thr_setschedparam.c ============================================================================== --- stable/8/lib/libthr/thread/thr_setschedparam.c Wed Jul 25 01:05:49 2012 (r238759) +++ stable/8/lib/libthr/thread/thr_setschedparam.c Wed Jul 25 01:57:53 2012 (r238760) @@ -53,25 +53,42 @@ _pthread_setschedparam(pthread_t pthread struct pthread *curthread = _get_curthread(); int ret; - if (pthread == curthread) + if (pthread == curthread) { THR_LOCK(curthread); - else if ((ret = _thr_find_thread(curthread, pthread, - /*include dead*/0)) != 0) - return (ret); - if (pthread->attr.sched_policy == policy && - (policy == SCHED_OTHER || - pthread->attr.prio == param->sched_priority)) { - pthread->attr.prio = param->sched_priority; + if (curthread->attr.sched_policy == policy && + (policy == SCHED_OTHER || + curthread->attr.prio == param->sched_priority)) { + pthread->attr.prio = param->sched_priority; + THR_UNLOCK(curthread); + return (0); + } + ret = _thr_setscheduler(curthread->tid, policy, param); + if (ret == -1) + ret = errno; + else { + curthread->attr.sched_policy = policy; + curthread->attr.prio = param->sched_priority; + } + THR_UNLOCK(curthread); + } else if ((ret = _thr_ref_add(curthread, pthread, /*include dead*/0)) + == 0) { + THR_THREAD_LOCK(curthread, pthread); + if (pthread->attr.sched_policy == policy && + (policy == SCHED_OTHER || + pthread->attr.prio == param->sched_priority)) { + pthread->attr.prio = param->sched_priority; + THR_THREAD_UNLOCK(curthread, pthread); + return (0); + } + ret = _thr_setscheduler(pthread->tid, policy, param); + if (ret == -1) + ret = errno; + else { + pthread->attr.sched_policy = policy; + pthread->attr.prio = param->sched_priority; + } THR_THREAD_UNLOCK(curthread, pthread); - return (0); + _thr_ref_delete(curthread, pthread); } - ret = _thr_setscheduler(pthread->tid, policy, param); - if (ret == -1) - ret = errno; - else { - pthread->attr.sched_policy = policy; - pthread->attr.prio = param->sched_priority; - } - THR_THREAD_UNLOCK(curthread, pthread); return (ret); } From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 02:06:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECBCA106566C; Wed, 25 Jul 2012 02:05:59 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D76BB8FC0C; Wed, 25 Jul 2012 02:05: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 q6P25xe4098382; Wed, 25 Jul 2012 02:05:59 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6P25xHf098381; Wed, 25 Jul 2012 02:05:59 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201207250205.q6P25xHf098381@svn.freebsd.org> From: David Xu Date: Wed, 25 Jul 2012 02:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238761 - stable/8/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 02:06:00 -0000 Author: davidxu Date: Wed Jul 25 02:05:59 2012 New Revision: 238761 URL: http://svn.freebsd.org/changeset/base/238761 Log: Release a reference count in case priority needn't to be changed. Modified: stable/8/lib/libthr/thread/thr_setschedparam.c Modified: stable/8/lib/libthr/thread/thr_setschedparam.c ============================================================================== --- stable/8/lib/libthr/thread/thr_setschedparam.c Wed Jul 25 01:57:53 2012 (r238760) +++ stable/8/lib/libthr/thread/thr_setschedparam.c Wed Jul 25 02:05:59 2012 (r238761) @@ -78,6 +78,7 @@ _pthread_setschedparam(pthread_t pthread pthread->attr.prio == param->sched_priority)) { pthread->attr.prio = param->sched_priority; THR_THREAD_UNLOCK(curthread, pthread); + _thr_ref_delete(curthread, pthread); return (0); } ret = _thr_setscheduler(pthread->tid, policy, param); From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 02:09:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7573D106564A; Wed, 25 Jul 2012 02:09:07 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FF458FC08; Wed, 25 Jul 2012 02:09:07 +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 q6P297I3098663; Wed, 25 Jul 2012 02:09:07 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6P297iY098661; Wed, 25 Jul 2012 02:09:07 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201207250209.q6P297iY098661@svn.freebsd.org> From: David Xu Date: Wed, 25 Jul 2012 02:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238762 - stable/8/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 02:09:07 -0000 Author: davidxu Date: Wed Jul 25 02:09:06 2012 New Revision: 238762 URL: http://svn.freebsd.org/changeset/base/238762 Log: Use target thread's scheduling policy not current's. Modified: stable/8/lib/libthr/thread/thr_setprio.c Modified: stable/8/lib/libthr/thread/thr_setprio.c ============================================================================== --- stable/8/lib/libthr/thread/thr_setprio.c Wed Jul 25 02:05:59 2012 (r238761) +++ stable/8/lib/libthr/thread/thr_setprio.c Wed Jul 25 02:09:06 2012 (r238762) @@ -69,7 +69,7 @@ _pthread_setprio(pthread_t pthread, int ret = 0; } else { ret = _thr_setscheduler(pthread->tid, - curthread->attr.sched_policy, ¶m); + pthread->attr.sched_policy, ¶m); if (ret == -1) ret = errno; else From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 06:04:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F0783106564A; Wed, 25 Jul 2012 06:04:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3A638FC17; Wed, 25 Jul 2012 06:04:38 +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 q6P64crR017772; Wed, 25 Jul 2012 06:04:38 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6P64cbL017771; Wed, 25 Jul 2012 06:04:38 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207250604.q6P64cbL017771@svn.freebsd.org> From: Warner Losh Date: Wed, 25 Jul 2012 06:04:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238763 - head/contrib/dtc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 06:04:39 -0000 Author: imp Date: Wed Jul 25 06:04:38 2012 New Revision: 238763 URL: http://svn.freebsd.org/changeset/base/238763 Log: Preen unused Makefiles, programs and ftdump.c which has been renamed to fdtdump.c in the upstream repo. This escaped my attention in the import. Deleted: head/contrib/dtc/Makefile.convert-dtsv0 head/contrib/dtc/Makefile.ftdump head/contrib/dtc/convert-dtsv0-lexer.l head/contrib/dtc/ftdump.c From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 07:20:06 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 268E9106566B; Wed, 25 Jul 2012 07:20:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 9ED228FC08; Wed, 25 Jul 2012 07:20:04 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA13077; Wed, 25 Jul 2012 10:20:03 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Stvt5-0008B5-2u; Wed, 25 Jul 2012 10:20:03 +0300 Message-ID: <500F9E22.4080608@FreeBSD.org> Date: Wed, 25 Jul 2012 10:20:02 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120620 Thunderbird/13.0.1 MIME-Version: 1.0 To: Jim Harris References: <201207242210.q6OMACqV079603@svn.freebsd.org> In-Reply-To: <201207242210.q6OMACqV079603@svn.freebsd.org> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 07:20:06 -0000 on 25/07/2012 01:10 Jim Harris said the following: > Author: jimharris > Date: Tue Jul 24 22:10:11 2012 > New Revision: 238755 > URL: http://svn.freebsd.org/changeset/base/238755 > > Log: > Add rmb() to tsc_read_##x to enforce serialization of rdtsc captures. > > Intel Architecture Manual specifies that rdtsc instruction is not serialized, > so without this change, TSC synchronization test would periodically fail, > resulting in use of HPET timecounter instead of TSC-low. This caused > severe performance degradation (40-50%) when running high IO/s workloads due to > HPET MMIO reads and GEOM stat collection. > > Tests on Xeon E5-2600 (Sandy Bridge) 8C systems were seeing TSC synchronization > fail approximately 20% of the time. Should rather the synchronization test be fixed if it's the culprit? Or is this change universally good for the real uses of TSC? > Sponsored by: Intel > Reviewed by: kib > MFC after: 3 days > > Modified: > head/sys/x86/x86/tsc.c > > Modified: head/sys/x86/x86/tsc.c > ============================================================================== > --- head/sys/x86/x86/tsc.c Tue Jul 24 20:15:41 2012 (r238754) > +++ head/sys/x86/x86/tsc.c Tue Jul 24 22:10:11 2012 (r238755) > @@ -328,6 +328,7 @@ init_TSC(void) > > #ifdef SMP > > +/* rmb is required here because rdtsc is not a serializing instruction. */ > #define TSC_READ(x) \ > static void \ > tsc_read_##x(void *arg) \ > @@ -335,6 +336,7 @@ tsc_read_##x(void *arg) \ > uint32_t *tsc = arg; \ > u_int cpu = PCPU_GET(cpuid); \ > \ > + rmb(); \ > tsc[cpu * 3 + x] = rdtsc32(); \ > } > TSC_READ(0) > -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 07:32:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70478106566B; Wed, 25 Jul 2012 07:32:16 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vps.rulingia.com (host-122-100-2-194.octopus.com.au [122.100.2.194]) by mx1.freebsd.org (Postfix) with ESMTP id D13B68FC17; Wed, 25 Jul 2012 07:32:15 +0000 (UTC) Received: from server.rulingia.com (c220-239-247-45.belrs5.nsw.optusnet.com.au [220.239.247.45]) by vps.rulingia.com (8.14.5/8.14.5) with ESMTP id q6P7WDsc025368 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 25 Jul 2012 17:32:13 +1000 (EST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from aspire.rulingia.com (aspire.rulingia.com [192.168.123.161]) by server.rulingia.com (8.14.5/8.14.5) with ESMTP id q6P7VwHb022303 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 25 Jul 2012 17:31:58 +1000 (EST) (envelope-from peter@rulingia.com) Received: from aspire.rulingia.com (localhost [127.0.0.1]) by aspire.rulingia.com (8.14.5/8.14.5) with ESMTP id q6P7Vvqu095337 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 25 Jul 2012 17:31:57 +1000 (EST) (envelope-from peter@aspire.rulingia.com) Received: (from peter@localhost) by aspire.rulingia.com (8.14.5/8.14.5/Submit) id q6P7VuJu095336; Wed, 25 Jul 2012 17:31:56 +1000 (EST) (envelope-from peter) Date: Wed, 25 Jul 2012 17:31:56 +1000 From: Peter Jeremy To: Steve Kargl , Alexey Dokuchaev , Steve Kargl , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20120725073156.GA91536@aspire.rulingia.com> References: <201207231913.q6NJDucB040333@svn.freebsd.org> <20120724084335.GB28038@FreeBSD.org> <20120724174206.GA63841@troutmask.apl.washington.edu> <20120724175712.GA66863@zim.MIT.EDU> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SLDf9lqlvOQaIe6s" Content-Disposition: inline In-Reply-To: <20120724175712.GA66863@zim.MIT.EDU> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r238722 - in head/lib/msun: . ld128 ld80 man src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 07:32:16 -0000 --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2012-Jul-24 13:57:12 -0400, David Schultz wrote: >On Tue, Jul 24, 2012, Steve Kargl wrote: >> On Tue, Jul 24, 2012 at 08:43:35AM +0000, Alexey Dokuchaev wrote: >> > On Mon, Jul 23, 2012 at 07:13:56PM +0000, Steve Kargl wrote: >> > > Compute the exponential of x for Intel 80-bit format and IEEE 128-= bit >> > > format. These implementations are based on >> > I believe some ports could benefit from OSVERSION bump for this one. =2E.. >against. In this case, it would help any ports that have >workarounds for the lack of expl() to compile both before and >after this change. But it's also important not to bump the >version gratuitously if there's no reason to believe the change >might introduce incompatibilities. Hopefully, this is just the first of a series of similar commits over the next 4-5 months so if we bump OSVERSION for this, we are probably looking at another half-dozen or so bumps. Do any ports actually have a hard-wired decision for expl() (or other libm functions)? I would hope most ports that are interested in complex and/or long double functions have some sort of configure-time test that will automatically detect their presence or absence. --=20 Peter Jeremy --SLDf9lqlvOQaIe6s Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlAPoOwACgkQ/opHv/APuIcNaQCghMNyIi83Qk31vY4aBcMth3EV MXIAn03npk0yCgsAuxjglCI9TLszHFSq =/sqP -----END PGP SIGNATURE----- --SLDf9lqlvOQaIe6s-- From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 10:21:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34B5B1065672; Wed, 25 Jul 2012 10:21:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id C22DF8FC12; Wed, 25 Jul 2012 10:21:36 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6PALgsi019427; Wed, 25 Jul 2012 13:21:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6PALU8M087580; Wed, 25 Jul 2012 13:21:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6PALUmj087579; Wed, 25 Jul 2012 13:21:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 25 Jul 2012 13:21:30 +0300 From: Konstantin Belousov To: Andriy Gapon Message-ID: <20120725102130.GH2676@deviant.kiev.zoral.com.ua> References: <201207242210.q6OMACqV079603@svn.freebsd.org> <500F9E22.4080608@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1Dj3cEIIrBZAiNOW" Content-Disposition: inline In-Reply-To: <500F9E22.4080608@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, Jim Harris , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 10:21:37 -0000 --1Dj3cEIIrBZAiNOW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 25, 2012 at 10:20:02AM +0300, Andriy Gapon wrote: > on 25/07/2012 01:10 Jim Harris said the following: > > Author: jimharris > > Date: Tue Jul 24 22:10:11 2012 > > New Revision: 238755 > > URL: http://svn.freebsd.org/changeset/base/238755 > >=20 > > Log: > > Add rmb() to tsc_read_##x to enforce serialization of rdtsc captures. > > =20 > > Intel Architecture Manual specifies that rdtsc instruction is not ser= ialized, > > so without this change, TSC synchronization test would periodically f= ail, > > resulting in use of HPET timecounter instead of TSC-low. This caused > > severe performance degradation (40-50%) when running high IO/s worklo= ads due to > > HPET MMIO reads and GEOM stat collection. > > =20 > > Tests on Xeon E5-2600 (Sandy Bridge) 8C systems were seeing TSC synch= ronization > > fail approximately 20% of the time. >=20 > Should rather the synchronization test be fixed if it's the culprit? Synchronization test for what ? > Or is this change universally good for the real uses of TSC? What I understood from the Intel SDM, and also from additional experiments which Jim kindly made despite me being annoying as usual, is that 'read memory barrier' AKA LFENCE there is used for its secondary implementation effects, not for load/load barrier as you might assume. According to SDM, LFENCE fully drains execution pipeline (but comparing with MFENCE, does not drain write buffers). The result is that RDTSC is not started before previous instructions are finished. For tsc test, this means that after the change RDTSC executions are not reordered on the single core among themself. As I understand, CPU has no dependency noted between two reads of tsc by RDTSC, which allows later read to give lower value of counter. This is fixed by Intel by introduction of RDTSCP instruction, which is defined to be serialization point, and use of which (instead of LFENCE; RDTSC sequence) also fixes test, as confirmed by Jim. In fact, I now think that we should also apply the following patch. Otherwise, consequtive calls to e.g. binuptime(9) could return decreased time stamps. Note that libc __vdso_gettc.c already has LFENCE nearby the tsc reads, which was done not for this reason, but apparently needed for the reason too. diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index 085c339..229b351 100644 --- a/sys/x86/x86/tsc.c +++ b/sys/x86/x86/tsc.c @@ -594,6 +594,7 @@ static u_int tsc_get_timecount(struct timecounter *tc __unused) { =20 + rmb(); return (rdtsc32()); } =20 @@ -602,8 +603,9 @@ tsc_get_timecount_low(struct timecounter *tc) { uint32_t rv; =20 + rmb(); __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" - : "=3Da" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); + : "=3Da" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); return (rv); } =20 --1Dj3cEIIrBZAiNOW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlAPyKkACgkQC3+MBN1Mb4h5lgCfX7aUTYLRIMXAkkPPXxP8nS4Q xmkAn2aZIRz0JMn3SWE6ifZOHUh7ZkHd =ass/ -----END PGP SIGNATURE----- --1Dj3cEIIrBZAiNOW-- From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 10:55:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB191106566B; Wed, 25 Jul 2012 10:55:14 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C093F8FC0C; Wed, 25 Jul 2012 10:55:14 +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 q6PAtEHJ049011; Wed, 25 Jul 2012 10:55:14 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6PAtE3h049010; Wed, 25 Jul 2012 10:55:14 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207251055.q6PAtE3h049010@svn.freebsd.org> From: Christian Brueffer Date: Wed, 25 Jul 2012 10:55:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238764 - stable/9/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 10:55:15 -0000 Author: brueffer Date: Wed Jul 25 10:55:14 2012 New Revision: 238764 URL: http://svn.freebsd.org/changeset/base/238764 Log: MFC: r238574 Fix a small memory leak in mpssas_get_sata_identify(). The change has been submitted upstream as well. Approved by: re (kib) Modified: stable/9/sys/dev/mps/mps_sas_lsi.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mps/mps_sas_lsi.c ============================================================================== --- stable/9/sys/dev/mps/mps_sas_lsi.c Wed Jul 25 06:04:38 2012 (r238763) +++ stable/9/sys/dev/mps/mps_sas_lsi.c Wed Jul 25 10:55:14 2012 (r238764) @@ -796,8 +796,10 @@ mpssas_get_sata_identify(struct mps_soft if (!buffer) return ENOMEM; - if ((cm = mps_alloc_command(sc)) == NULL) + if ((cm = mps_alloc_command(sc)) == NULL) { + free(buffer, M_MPT2); return (EBUSY); + } mpi_request = (MPI2_SATA_PASSTHROUGH_REQUEST *)cm->cm_req; bzero(mpi_request,sizeof(MPI2_SATA_PASSTHROUGH_REQUEST)); mpi_request->Function = MPI2_FUNCTION_SATA_PASSTHROUGH; From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 11:28:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBB7A106564A; Wed, 25 Jul 2012 11:28:15 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CD478FC1B; Wed, 25 Jul 2012 11:28: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 q6PBSFTw052577; Wed, 25 Jul 2012 11:28:15 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6PBSFlt052575; Wed, 25 Jul 2012 11:28:15 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201207251128.q6PBSFlt052575@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 25 Jul 2012 11:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238765 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 11:28:15 -0000 Author: luigi Date: Wed Jul 25 11:28:15 2012 New Revision: 238765 URL: http://svn.freebsd.org/changeset/base/238765 Log: Use legacy interrupts as a default. This gives up to 10% speedup when used in qemu (and this driver is for non-PCIe cards, so probably its largest use is in virtualized environments). Approved by: Jack Vogel MFC after: 3 days Modified: head/sys/dev/e1000/if_lem.c Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Wed Jul 25 10:55:14 2012 (r238764) +++ head/sys/dev/e1000/if_lem.c Wed Jul 25 11:28:15 2012 (r238765) @@ -239,6 +239,7 @@ static void lem_enable_wakeup(device static int lem_enable_phy_wakeup(struct adapter *); static void lem_led_func(void *, int); +#define EM_LEGACY_IRQ /* slightly faster, at least in qemu */ #ifdef EM_LEGACY_IRQ static void lem_intr(void *); #else /* FAST IRQ */ @@ -1549,6 +1550,13 @@ lem_xmit(struct adapter *adapter, struct u32 txd_upper, txd_lower, txd_used, txd_saved; int error, nsegs, i, j, first, last = 0; +extern int netmap_drop; + if (netmap_drop == 95) { +dropme: + m_freem(*m_headp); + *m_headp = NULL; + return (ENOBUFS); + } m_head = *m_headp; txd_upper = txd_lower = txd_used = txd_saved = 0; @@ -1688,6 +1696,9 @@ lem_xmit(struct adapter *adapter, struct } } + if (netmap_drop == 96) + goto dropme; + adapter->next_avail_tx_desc = i; if (adapter->pcix_82544) @@ -1715,6 +1726,16 @@ lem_xmit(struct adapter *adapter, struct */ ctxd->lower.data |= htole32(E1000_TXD_CMD_EOP | E1000_TXD_CMD_RS); + +if (netmap_drop == 97) { + static int count=0; + if (count++ & 63 != 0) + ctxd->lower.data &= + ~htole32(E1000_TXD_CMD_RS); + else + D("preserve RS"); + +} /* * Keep track in the first buffer which * descriptor will be written back @@ -1733,6 +1754,12 @@ lem_xmit(struct adapter *adapter, struct adapter->link_duplex == HALF_DUPLEX) lem_82547_move_tail(adapter); else { +extern int netmap_repeat; + if (netmap_repeat) { + int x; + for (x = 0; x < netmap_repeat; x++) + E1000_WRITE_REG(&adapter->hw, E1000_TDT(0), i); + } E1000_WRITE_REG(&adapter->hw, E1000_TDT(0), i); if (adapter->hw.mac.type == e1000_82547) lem_82547_update_fifo_head(adapter, @@ -2986,6 +3013,13 @@ lem_txeof(struct adapter *adapter) return; } #endif /* DEV_NETMAP */ +{ + static int drops = 0; + if (netmap_copy && drops++ < netmap_copy) + return; + drops = 0; +} + if (adapter->num_tx_desc_avail == adapter->num_tx_desc) return; From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 11:33:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 40658106567B; Wed, 25 Jul 2012 11:33:44 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A85A8FC1C; Wed, 25 Jul 2012 11:33:44 +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 q6PBXi2a053093; Wed, 25 Jul 2012 11:33:44 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6PBXh5j053090; Wed, 25 Jul 2012 11:33:43 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201207251133.q6PBXh5j053090@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 25 Jul 2012 11:33:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238766 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 11:33:44 -0000 Author: gavin Date: Wed Jul 25 11:33:43 2012 New Revision: 238766 URL: http://svn.freebsd.org/changeset/base/238766 Log: Update the list of devices supported by uplcom. Although this only adds one device (support for Motorola cables), this syncronises us with: OpenBSD src/sys/dev/usb/uplcom.c 1.56 NetBSD src/sys/dev/usb/uplcom.c 1.73 Linux kernel.org HEAD MFC after: 1 week Modified: head/sys/dev/usb/serial/uplcom.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/uplcom.c ============================================================================== --- head/sys/dev/usb/serial/uplcom.c Wed Jul 25 11:28:15 2012 (r238765) +++ head/sys/dev/usb/serial/uplcom.c Wed Jul 25 11:33:43 2012 (r238766) @@ -279,6 +279,7 @@ static const STRUCT_USB_HOST_ID uplcom_d UPLCOM_DEV(PROLIFIC, DCU11), /* DCU-11 Phone Cable */ UPLCOM_DEV(PROLIFIC, HCR331), /* HCR331 Card Reader */ UPLCOM_DEV(PROLIFIC, MICROMAX_610U), /* Micromax 610U modem */ + UPLCOM_DEV(PROLIFIC, MOTOROLA), /* Motorola cable */ UPLCOM_DEV(PROLIFIC, PHAROS), /* Prolific Pharos */ UPLCOM_DEV(PROLIFIC, PL2303), /* Generic adapter */ UPLCOM_DEV(PROLIFIC, RSAQ2), /* I/O DATA USB-RSAQ2 */ Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Jul 25 11:28:15 2012 (r238765) +++ head/sys/dev/usb/usbdevs Wed Jul 25 11:33:43 2012 (r238766) @@ -2667,6 +2667,7 @@ product PRIMAX HP_RH304AA 0x4d17 HP RH30 /* Prolific products */ product PROLIFIC PL2301 0x0000 PL2301 Host-Host interface product PROLIFIC PL2302 0x0001 PL2302 Host-Host interface +product PROLIFIC MOTOROLA 0x0307 Motorola Cable product PROLIFIC RSAQ2 0x04bb PL2303 Serial (IODATA USB-RSAQ2) product PROLIFIC ALLTRONIX_GPRS 0x0609 Alltronix ACM003U00 modem product PROLIFIC ALDIGA_AL11U 0x0611 AlDiga AL-11U modem From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 12:06:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D18571065686; Wed, 25 Jul 2012 12:06:52 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB60C8FC1B; Wed, 25 Jul 2012 12:06:52 +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 q6PC6qY4055707; Wed, 25 Jul 2012 12:06:52 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6PC6qIx055705; Wed, 25 Jul 2012 12:06:52 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207251206.q6PC6qIx055705@svn.freebsd.org> From: Christian Brueffer Date: Wed, 25 Jul 2012 12:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238768 - stable/8/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 12:06:52 -0000 Author: brueffer Date: Wed Jul 25 12:06:52 2012 New Revision: 238768 URL: http://svn.freebsd.org/changeset/base/238768 Log: MFC: r238574 Fix a small memory leak in mpssas_get_sata_identify(). The change has been submitted upstream as well. Modified: stable/8/sys/dev/mps/mps_sas_lsi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/mps/mps_sas_lsi.c ============================================================================== --- stable/8/sys/dev/mps/mps_sas_lsi.c Wed Jul 25 11:50:36 2012 (r238767) +++ stable/8/sys/dev/mps/mps_sas_lsi.c Wed Jul 25 12:06:52 2012 (r238768) @@ -796,8 +796,10 @@ mpssas_get_sata_identify(struct mps_soft if (!buffer) return ENOMEM; - if ((cm = mps_alloc_command(sc)) == NULL) + if ((cm = mps_alloc_command(sc)) == NULL) { + free(buffer, M_MPT2); return (EBUSY); + } mpi_request = (MPI2_SATA_PASSTHROUGH_REQUEST *)cm->cm_req; bzero(mpi_request,sizeof(MPI2_SATA_PASSTHROUGH_REQUEST)); mpi_request->Function = MPI2_FUNCTION_SATA_PASSTHROUGH; From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 12:14:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50D50106564A; Wed, 25 Jul 2012 12:14:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BF7D8FC08; Wed, 25 Jul 2012 12:14:40 +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 q6PCEeSW056357; Wed, 25 Jul 2012 12:14:40 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6PCEe2u056355; Wed, 25 Jul 2012 12:14:40 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207251214.q6PCEe2u056355@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 25 Jul 2012 12:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238769 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 12:14:40 -0000 Author: bz Date: Wed Jul 25 12:14:39 2012 New Revision: 238769 URL: http://svn.freebsd.org/changeset/base/238769 Log: Fix a problem when CARP is enabled on the interface for IPv4 but not for IPv6. The current checks in nd6_nbr.c along with the old version will result in ifa being NULL and subsequently the packet will be dropped. This prevented NS/NA, from working and with that IPv6. Now return the ifa from the carp lookup function in two cases: 1) if the address matches, is a carp address, and we are MASTER (as before), 2) if the address matches but it is not a carp address at all (new). Reported by: Peter Wemm (new Y! FreeBSD cluster, eating our own dogfood) Tested on: New Y! FreeBSD cluster machines Reviewed by: glebius Modified: head/sys/netinet/ip_carp.c Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Wed Jul 25 12:06:52 2012 (r238768) +++ head/sys/netinet/ip_carp.c Wed Jul 25 12:14:39 2012 (r238769) @@ -1027,23 +1027,31 @@ carp_send_na(struct carp_softc *sc) } } +/* + * Returns ifa in case it's a carp address and it is MASTER, or if the address + * matches and is not a carp address. Returns NULL otherwise. + */ struct ifaddr * carp_iamatch6(struct ifnet *ifp, struct in6_addr *taddr) { struct ifaddr *ifa; + ifa = NULL; IF_ADDR_RLOCK(ifp); - IFNET_FOREACH_IFA(ifp, ifa) - if (ifa->ifa_addr->sa_family == AF_INET6 && - ifa->ifa_carp->sc_state == MASTER && - IN6_ARE_ADDR_EQUAL(taddr, IFA_IN6(ifa))) { + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family != AF_INET6) + continue; + if (!IN6_ARE_ADDR_EQUAL(taddr, IFA_IN6(ifa))) + continue; + if (ifa->ifa_carp && ifa->ifa_carp->sc_state != MASTER) + ifa = NULL; + else ifa_ref(ifa); - IF_ADDR_RUNLOCK(ifp); - return (ifa); - } + break; + } IF_ADDR_RUNLOCK(ifp); - return (NULL); + return (ifa); } caddr_t From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 12:29:38 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42F03106567B; Wed, 25 Jul 2012 12:29:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 13CFA8FC26; Wed, 25 Jul 2012 12:29:36 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA17235; Wed, 25 Jul 2012 15:29:34 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <500FE6AE.8070706@FreeBSD.org> Date: Wed, 25 Jul 2012 15:29:34 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120625 Thunderbird/13.0.1 MIME-Version: 1.0 To: Konstantin Belousov References: <201207242210.q6OMACqV079603@svn.freebsd.org> <500F9E22.4080608@FreeBSD.org> <20120725102130.GH2676@deviant.kiev.zoral.com.ua> In-Reply-To: <20120725102130.GH2676@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: svn-src-head@FreeBSD.org, Jim Harris , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 12:29:38 -0000 on 25/07/2012 13:21 Konstantin Belousov said the following: > On Wed, Jul 25, 2012 at 10:20:02AM +0300, Andriy Gapon wrote: >> on 25/07/2012 01:10 Jim Harris said the following: >>> Author: jimharris >>> Date: Tue Jul 24 22:10:11 2012 >>> New Revision: 238755 >>> URL: http://svn.freebsd.org/changeset/base/238755 >>> >>> Log: >>> Add rmb() to tsc_read_##x to enforce serialization of rdtsc captures. >>> >>> Intel Architecture Manual specifies that rdtsc instruction is not serialized, >>> so without this change, TSC synchronization test would periodically fail, >>> resulting in use of HPET timecounter instead of TSC-low. This caused >>> severe performance degradation (40-50%) when running high IO/s workloads due to >>> HPET MMIO reads and GEOM stat collection. >>> >>> Tests on Xeon E5-2600 (Sandy Bridge) 8C systems were seeing TSC synchronization >>> fail approximately 20% of the time. >> >> Should rather the synchronization test be fixed if it's the culprit? > Synchronization test for what ? The synchronization test mentioned above. So, oops, very sorry - I missed the fact that the change was precisely in the test. I confused it for another place where tsc is used. Thank you for pointing this out. >> Or is this change universally good for the real uses of TSC? > > What I understood from the Intel SDM, and also from additional experiments > which Jim kindly made despite me being annoying as usual, is that 'read > memory barrier' AKA LFENCE there is used for its secondary implementation > effects, not for load/load barrier as you might assume. > > According to SDM, LFENCE fully drains execution pipeline (but comparing > with MFENCE, does not drain write buffers). The result is that RDTSC is > not started before previous instructions are finished. Yes, I am fully aware of this. > For tsc test, this means that after the change RDTSC executions are not > reordered on the single core among themself. As I understand, CPU has > no dependency noted between two reads of tsc by RDTSC, which allows > later read to give lower value of counter. This is fixed by Intel by > introduction of RDTSCP instruction, which is defined to be serialization > point, and use of which (instead of LFENCE; RDTSC sequence) also fixes > test, as confirmed by Jim. Yes. I think that previously Intel recommended to precede rdtsc with cpuid for all the same reasons. Not sure if there is any difference performance-wise comparing to lfence. Unfortunately, rdtscp is not available on all CPUs, so using it would require extra work. > In fact, I now think that we should also apply the following patch. > Otherwise, consequtive calls to e.g. binuptime(9) could return decreased > time stamps. Note that libc __vdso_gettc.c already has LFENCE nearby the > tsc reads, which was done not for this reason, but apparently needed for > the reason too. > > diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c > index 085c339..229b351 100644 > --- a/sys/x86/x86/tsc.c > +++ b/sys/x86/x86/tsc.c > @@ -594,6 +594,7 @@ static u_int > tsc_get_timecount(struct timecounter *tc __unused) > { > > + rmb(); > return (rdtsc32()); > } > This makes sense to me. We probably want correctness over performance here. [BTW, I originally thought that the change was here; brain malfunction] > @@ -602,8 +603,9 @@ tsc_get_timecount_low(struct timecounter *tc) > { > uint32_t rv; > > + rmb(); > __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" > - : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); > + : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); > return (rv); > } > It would correct here too, but not sure if it would make any difference given that some lower bits are discarded anyway. Probably depends on exact CPU. And, oh hmm, I read AMD Software Optimization Guide for AMD Family 10h Processors and they suggest using cpuid (with a note that it may be intercepted in virtualized environments) or _mfence_ in the discussed role (Appendix F of the document). Googling for 'rdtsc mfence lfence' yields some interesting results. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 12:51:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2D70B106566B; Wed, 25 Jul 2012 12:51:34 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F28E88FC14; Wed, 25 Jul 2012 12:51:33 +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 q6PCpXV0059418; Wed, 25 Jul 2012 12:51:33 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6PCpXp8059416; Wed, 25 Jul 2012 12:51:33 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201207251251.q6PCpXp8059416@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 25 Jul 2012 12:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238770 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 12:51:34 -0000 Author: luigi Date: Wed Jul 25 12:51:33 2012 New Revision: 238770 URL: http://svn.freebsd.org/changeset/base/238770 Log: remove some extra testing code that slipped into the previous commit Reported-by: Alexander Motin Modified: head/sys/dev/e1000/if_lem.c Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Wed Jul 25 12:14:39 2012 (r238769) +++ head/sys/dev/e1000/if_lem.c Wed Jul 25 12:51:33 2012 (r238770) @@ -1550,13 +1550,6 @@ lem_xmit(struct adapter *adapter, struct u32 txd_upper, txd_lower, txd_used, txd_saved; int error, nsegs, i, j, first, last = 0; -extern int netmap_drop; - if (netmap_drop == 95) { -dropme: - m_freem(*m_headp); - *m_headp = NULL; - return (ENOBUFS); - } m_head = *m_headp; txd_upper = txd_lower = txd_used = txd_saved = 0; @@ -1696,9 +1689,6 @@ dropme: } } - if (netmap_drop == 96) - goto dropme; - adapter->next_avail_tx_desc = i; if (adapter->pcix_82544) @@ -1726,16 +1716,6 @@ dropme: */ ctxd->lower.data |= htole32(E1000_TXD_CMD_EOP | E1000_TXD_CMD_RS); - -if (netmap_drop == 97) { - static int count=0; - if (count++ & 63 != 0) - ctxd->lower.data &= - ~htole32(E1000_TXD_CMD_RS); - else - D("preserve RS"); - -} /* * Keep track in the first buffer which * descriptor will be written back @@ -1754,12 +1734,6 @@ if (netmap_drop == 97) { adapter->link_duplex == HALF_DUPLEX) lem_82547_move_tail(adapter); else { -extern int netmap_repeat; - if (netmap_repeat) { - int x; - for (x = 0; x < netmap_repeat; x++) - E1000_WRITE_REG(&adapter->hw, E1000_TDT(0), i); - } E1000_WRITE_REG(&adapter->hw, E1000_TDT(0), i); if (adapter->hw.mac.type == e1000_82547) lem_82547_update_fifo_head(adapter, @@ -3013,13 +2987,6 @@ lem_txeof(struct adapter *adapter) return; } #endif /* DEV_NETMAP */ -{ - static int drops = 0; - if (netmap_copy && drops++ < netmap_copy) - return; - drops = 0; -} - if (adapter->num_tx_desc_avail == adapter->num_tx_desc) return; From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 13:05:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DB638106567A; Wed, 25 Jul 2012 13:05:11 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F2A38FC18; Wed, 25 Jul 2012 13: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 q6PD5BhM060523; Wed, 25 Jul 2012 13:05:11 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6PD5BJ3060521; Wed, 25 Jul 2012 13:05:11 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201207251305.q6PD5BJ3060521@svn.freebsd.org> From: Warren Block Date: Wed, 25 Jul 2012 13:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238771 - stable/9/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 13:05:12 -0000 Author: wblock (doc committer) Date: Wed Jul 25 13:05:11 2012 New Revision: 238771 URL: http://svn.freebsd.org/changeset/base/238771 Log: MFC r238705: Correct ugen.4 to show that it has been integrated into usb(4). Also fix some punctuation errors. Approved by: re (kib) Modified: stable/9/share/man/man4/ugen.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/ugen.4 ============================================================================== --- stable/9/share/man/man4/ugen.4 Wed Jul 25 12:51:33 2012 (r238770) +++ stable/9/share/man/man4/ugen.4 Wed Jul 25 13:05:11 2012 (r238771) @@ -29,26 +29,17 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2006 +.Dd July 22, 2012 .Dt UGEN 4 .Os .Sh NAME .Nm ugen .Nd USB generic device support .Sh SYNOPSIS -To compile this driver into the kernel, -place the following line in your -kernel configuration file: -.Bd -ragged -offset indent -.Cd "device ugen" -.Ed -.Pp -Alternatively, to load the driver as a -module at boot time, place the following line in -.Xr loader.conf 5 : -.Bd -literal -offset indent -ugen_load="YES" -.Ed +.Nm +is integrated into the +.Xr usb 4 +kernel module. .Sh DESCRIPTION The .Nm @@ -65,22 +56,22 @@ bulk, or interrupt. Each of the endpoints will have a different device node. The four least significant bits in the minor device -number determines which endpoint the device accesses and the rest -of the bits determines which USB device. +number determine which endpoint the device accesses, and the rest +of the bits determine which USB device. .Pp -If an endpoint address is used both for input and output the device +If an endpoint address is used both for input and output, the device can be opened for both read or write. .Pp -To find out what endpoints that exist there are a series of +To find out which endpoints exist, there are a series of .Xr ioctl 2 -operation on the control endpoint that returns the USB descriptors +operations on the control endpoint that return the USB descriptors of the device, configurations, interfaces, and endpoints. .Pp The control transfer mode can only happen on the control endpoint which is always endpoint 0. -The control endpoint accepts request -and may respond with an answer to such request. -Control request +The control endpoint accepts a request +and may respond with an answer to such a request. +Control requests are issued by .Xr ioctl 2 calls. @@ -129,8 +120,8 @@ Normally a transfer from the device which is shorter than the request specified is reported as an error. .It Dv USB_SET_TIMEOUT Pq Vt int -Set the timeout on the device operations, the time is specified -in milliseconds. +Set the timeout on the device operations +The time is specified in milliseconds. The value 0 is used to indicate that there is no timeout. .El @@ -176,7 +167,7 @@ field. Return the device descriptor. .It Dv USB_GET_CONFIG_DESC Pq Vt "struct usb_config_desc" Return the descriptor for the configuration with the given index. -For convenience the current configuration can be specified by +For convenience, the current configuration can be specified by .Dv USB_CURRENT_CONFIG_INDEX . .Bd -literal struct usb_config_desc { @@ -187,7 +178,7 @@ struct usb_config_desc { .It Dv USB_GET_INTERFACE_DESC Pq Vt "struct usb_interface_desc" Return the interface descriptor for an interface specified by its configuration index, interface index, and alternative index. -For convenience the current alternative can be specified by +For convenience, the current alternative can be specified by .Dv USB_CURRENT_ALT_INDEX . .Bd -literal struct usb_interface_desc { @@ -251,7 +242,7 @@ field is ignored in this call. The .Va ucr_flags field can be used to flag that the request is allowed to -be shorter than the requested size, and the +be shorter than the requested size, and .Va ucr_actlen will contain the actual size on completion. .Bd -literal @@ -270,18 +261,17 @@ Some of the most dangerous (e.g., changi address) are not allowed. .It Dv USB_GET_DEVICEINFO Pq Vt "struct usb_device_info" Get an information summary for the device. -This call will not -issue any USB transactions. +This call will not issue any USB transactions. .El .Pp -Note that there are two different ways of addressing configurations, interfaces, -alternatives, and endpoints: by index or by number. +Note that there are two different ways of addressing configurations, +interfaces, alternatives, and endpoints: by index or by number. The index is the ordinal number (starting from 0) of the descriptor as presented by the device. The number is the respective number of the entity as found in its descriptor. Enumeration of descriptors -use the index, getting and setting typically uses numbers. +uses the index, getting and setting typically uses numbers. .Pp Example: all endpoints (except the control endpoint) for the current configuration @@ -289,13 +279,13 @@ can be found by iterating the .Va interface_index from 0 to .Va config_desc->bNumInterface Ns \-1 -and for each of these iterating the +and for each of these, iterating the .Va endpoint_index from 0 to .Va interface_desc->bNumEndpoints . The .Va config_index -should set to +should be set to .Dv USB_CURRENT_CONFIG_INDEX and .Va alt_index From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 13:11:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A3038106566B; Wed, 25 Jul 2012 13:11:37 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8305E8FC14; Wed, 25 Jul 2012 13:11: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 q6PDBbZ0061182; Wed, 25 Jul 2012 13:11:37 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6PDBb6g061180; Wed, 25 Jul 2012 13:11:37 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201207251311.q6PDBb6g061180@svn.freebsd.org> From: Warren Block Date: Wed, 25 Jul 2012 13:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238772 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 13:11:37 -0000 Author: wblock (doc committer) Date: Wed Jul 25 13:11:36 2012 New Revision: 238772 URL: http://svn.freebsd.org/changeset/base/238772 Log: MFC r238705: Correct ugen.4 to show that it has been integrated into usb(4). Also fix some punctuation errors. Approved by: hps Modified: stable/8/share/man/man4/ugen.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/ugen.4 ============================================================================== --- stable/8/share/man/man4/ugen.4 Wed Jul 25 13:05:11 2012 (r238771) +++ stable/8/share/man/man4/ugen.4 Wed Jul 25 13:11:36 2012 (r238772) @@ -36,26 +36,17 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2006 +.Dd July 22, 2012 .Dt UGEN 4 .Os .Sh NAME .Nm ugen .Nd USB generic device support .Sh SYNOPSIS -To compile this driver into the kernel, -place the following line in your -kernel configuration file: -.Bd -ragged -offset indent -.Cd "device ugen" -.Ed -.Pp -Alternatively, to load the driver as a -module at boot time, place the following line in -.Xr loader.conf 5 : -.Bd -literal -offset indent -ugen_load="YES" -.Ed +.Nm +is integrated into the +.Xr usb 4 +kernel module. .Sh DESCRIPTION The .Nm @@ -72,22 +63,22 @@ bulk, or interrupt. Each of the endpoints will have a different device node. The four least significant bits in the minor device -number determines which endpoint the device accesses and the rest -of the bits determines which USB device. +number determine which endpoint the device accesses, and the rest +of the bits determine which USB device. .Pp -If an endpoint address is used both for input and output the device +If an endpoint address is used both for input and output, the device can be opened for both read or write. .Pp -To find out what endpoints that exist there are a series of +To find out which endpoints exist, there are a series of .Xr ioctl 2 -operation on the control endpoint that returns the USB descriptors +operations on the control endpoint that return the USB descriptors of the device, configurations, interfaces, and endpoints. .Pp The control transfer mode can only happen on the control endpoint which is always endpoint 0. -The control endpoint accepts request -and may respond with an answer to such request. -Control request +The control endpoint accepts a request +and may respond with an answer to such a request. +Control requests are issued by .Xr ioctl 2 calls. @@ -136,8 +127,8 @@ Normally a transfer from the device which is shorter than the request specified is reported as an error. .It Dv USB_SET_TIMEOUT Pq Vt int -Set the timeout on the device operations, the time is specified -in milliseconds. +Set the timeout on the device operations +The time is specified in milliseconds. The value 0 is used to indicate that there is no timeout. .El @@ -183,7 +174,7 @@ field. Return the device descriptor. .It Dv USB_GET_CONFIG_DESC Pq Vt "struct usb_config_desc" Return the descriptor for the configuration with the given index. -For convenience the current configuration can be specified by +For convenience, the current configuration can be specified by .Dv USB_CURRENT_CONFIG_INDEX . .Bd -literal struct usb_config_desc { @@ -194,7 +185,7 @@ struct usb_config_desc { .It Dv USB_GET_INTERFACE_DESC Pq Vt "struct usb_interface_desc" Return the interface descriptor for an interface specified by its configuration index, interface index, and alternative index. -For convenience the current alternative can be specified by +For convenience, the current alternative can be specified by .Dv USB_CURRENT_ALT_INDEX . .Bd -literal struct usb_interface_desc { @@ -258,7 +249,7 @@ field is ignored in this call. The .Va ucr_flags field can be used to flag that the request is allowed to -be shorter than the requested size, and the +be shorter than the requested size, and .Va ucr_actlen will contain the actual size on completion. .Bd -literal @@ -277,18 +268,17 @@ Some of the most dangerous (e.g., changi address) are not allowed. .It Dv USB_GET_DEVICEINFO Pq Vt "struct usb_device_info" Get an information summary for the device. -This call will not -issue any USB transactions. +This call will not issue any USB transactions. .El .Pp -Note that there are two different ways of addressing configurations, interfaces, -alternatives, and endpoints: by index or by number. +Note that there are two different ways of addressing configurations, +interfaces, alternatives, and endpoints: by index or by number. The index is the ordinal number (starting from 0) of the descriptor as presented by the device. The number is the respective number of the entity as found in its descriptor. Enumeration of descriptors -use the index, getting and setting typically uses numbers. +uses the index, getting and setting typically uses numbers. .Pp Example: all endpoints (except the control endpoint) for the current configuration @@ -296,13 +286,13 @@ can be found by iterating the .Va interface_index from 0 to .Va config_desc->bNumInterface Ns \-1 -and for each of these iterating the +and for each of these, iterating the .Va endpoint_index from 0 to .Va interface_desc->bNumEndpoints . The .Va config_index -should set to +should be set to .Dv USB_CURRENT_CONFIG_INDEX and .Va alt_index From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 13:35:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB2A5106564A; Wed, 25 Jul 2012 13:35:24 +0000 (UTC) (envelope-from jensrasmus@gmail.com) Received: from mail-qa0-f54.google.com (mail-qa0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6EE388FC12; Wed, 25 Jul 2012 13:35:24 +0000 (UTC) Received: by qaat11 with SMTP id t11so502514qaa.13 for ; Wed, 25 Jul 2012 06:35:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=IZIvdkL4PjyJwNI0ZoXfcRypEVdowlPt5zEtknYOLXQ=; b=ue8IFNRZ9w19EfU37bGNo3P8msiz0+J4iZjfUmvXWxMu2EMTKpHdJBdaaNv7Kg09l6 qgvn79fyW3IW0jb9avdobpMPoJ+tlv9zUDDV6GvPei0QiQ/0chZHnfBR55EPOyjSnZbr kpMVdo+sxDZx1DmxnNG28amP/BJQoR9OmbOklm8Ka+EqrncdEJfsmdwQup6qorVf3BBE fw2sdv/zQ0rbc9tx8VqUioW07839V71wtCZvN4ylJKZW8WmiRgFH4oxoIXZcoQPrytVf A/8cx0dK7bUFWerClv6QO0ptLkfsS+wg5M9JlLi32r3PPyhIqfP+MTT+8NIW9MMOBSfi KXlA== MIME-Version: 1.0 Received: by 10.224.208.8 with SMTP id ga8mr15162019qab.83.1343223318398; Wed, 25 Jul 2012 06:35:18 -0700 (PDT) Received: by 10.229.13.17 with HTTP; Wed, 25 Jul 2012 06:35:18 -0700 (PDT) Date: Wed, 25 Jul 2012 15:35:18 +0200 Message-ID: From: Jens Rasmus Liland To: svn-src-all@freebsd.org, freebsd-arm@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: When will r237367 be merged from current? X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 13:35:24 -0000 Hello. When will commit r237367 (src/sys/fs/nfsclient/nfs_clvfsops.c) be merged from current to stable? It says two weeks ... I am asking because ticket arm/149288 ( http://www.freebsd.org/cgi/query-pr.cgi?pr=149288 ) says mail/dovecot{,2} is going to be able to compile without panic on FreeBSD/arm (kernel SHEEVAPLUG), and I am a wee bit optimistic about it. Regards, Rasmus Liland From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 13:38:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F3281065670; Wed, 25 Jul 2012 13:38:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 9B3D38FC14; Wed, 25 Jul 2012 13:37:59 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6PDc7kj035584; Wed, 25 Jul 2012 16:38:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6PDbsxp089281; Wed, 25 Jul 2012 16:37:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6PDbscE089280; Wed, 25 Jul 2012 16:37:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 25 Jul 2012 16:37:54 +0300 From: Konstantin Belousov To: Andriy Gapon Message-ID: <20120725133754.GK2676@deviant.kiev.zoral.com.ua> References: <201207242210.q6OMACqV079603@svn.freebsd.org> <500F9E22.4080608@FreeBSD.org> <20120725102130.GH2676@deviant.kiev.zoral.com.ua> <500FE6AE.8070706@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0QJ8DMHdp6MMZYsr" Content-Disposition: inline In-Reply-To: <500FE6AE.8070706@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, Jim Harris , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 13:38:00 -0000 --0QJ8DMHdp6MMZYsr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 25, 2012 at 03:29:34PM +0300, Andriy Gapon wrote: > on 25/07/2012 13:21 Konstantin Belousov said the following: > > On Wed, Jul 25, 2012 at 10:20:02AM +0300, Andriy Gapon wrote: > >> on 25/07/2012 01:10 Jim Harris said the following: > >>> Author: jimharris > >>> Date: Tue Jul 24 22:10:11 2012 > >>> New Revision: 238755 > >>> URL: http://svn.freebsd.org/changeset/base/238755 > >>> > >>> Log: > >>> Add rmb() to tsc_read_##x to enforce serialization of rdtsc capture= s. > >>> =20 > >>> Intel Architecture Manual specifies that rdtsc instruction is not s= erialized, > >>> so without this change, TSC synchronization test would periodically= fail, > >>> resulting in use of HPET timecounter instead of TSC-low. This caus= ed > >>> severe performance degradation (40-50%) when running high IO/s work= loads due to > >>> HPET MMIO reads and GEOM stat collection. > >>> =20 > >>> Tests on Xeon E5-2600 (Sandy Bridge) 8C systems were seeing TSC syn= chronization > >>> fail approximately 20% of the time. > >> > >> Should rather the synchronization test be fixed if it's the culprit? > > Synchronization test for what ? >=20 > The synchronization test mentioned above. > So, oops, very sorry - I missed the fact that the change was precisely in= the > test. I confused it for another place where tsc is used. Thank you for = pointing > this out. >=20 > >> Or is this change universally good for the real uses of TSC? > >=20 > > What I understood from the Intel SDM, and also from additional experime= nts > > which Jim kindly made despite me being annoying as usual, is that 'read > > memory barrier' AKA LFENCE there is used for its secondary implementati= on > > effects, not for load/load barrier as you might assume. > >=20 > > According to SDM, LFENCE fully drains execution pipeline (but comparing > > with MFENCE, does not drain write buffers). The result is that RDTSC is > > not started before previous instructions are finished. >=20 > Yes, I am fully aware of this. >=20 > > For tsc test, this means that after the change RDTSC executions are not > > reordered on the single core among themself. As I understand, CPU has > > no dependency noted between two reads of tsc by RDTSC, which allows > > later read to give lower value of counter. This is fixed by Intel by > > introduction of RDTSCP instruction, which is defined to be serialization > > point, and use of which (instead of LFENCE; RDTSC sequence) also fixes > > test, as confirmed by Jim. >=20 > Yes. I think that previously Intel recommended to precede rdtsc with cpu= id for > all the same reasons. Not sure if there is any difference performance-wi= se > comparing to lfence. > Unfortunately, rdtscp is not available on all CPUs, so using it would req= uire > extra work. >=20 > > In fact, I now think that we should also apply the following patch. > > Otherwise, consequtive calls to e.g. binuptime(9) could return decreased > > time stamps. Note that libc __vdso_gettc.c already has LFENCE nearby the > > tsc reads, which was done not for this reason, but apparently needed for > > the reason too. > >=20 > > diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c > > index 085c339..229b351 100644 > > --- a/sys/x86/x86/tsc.c > > +++ b/sys/x86/x86/tsc.c > > @@ -594,6 +594,7 @@ static u_int > > tsc_get_timecount(struct timecounter *tc __unused) > > { > > =20 > > + rmb(); > > return (rdtsc32()); > > } > > =20 >=20 > This makes sense to me. We probably want correctness over performance he= re. > [BTW, I originally thought that the change was here; brain malfunction] >=20 > > @@ -602,8 +603,9 @@ tsc_get_timecount_low(struct timecounter *tc) > > { > > uint32_t rv; > > =20 > > + rmb(); > > __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" > > - : "=3Da" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); > > + : "=3Da" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); > > return (rv); > > } > > =20 >=20 > It would correct here too, but not sure if it would make any difference g= iven that > some lower bits are discarded anyway. Probably depends on exact CPU. >=20 >=20 > And, oh hmm, I read AMD Software Optimization Guide for AMD Family 10h > Processors and they suggest using cpuid (with a note that it may be > intercepted in virtualized environments) or _mfence_ in the discussed > role (Appendix F of the document). Googling for 'rdtsc mfence lfence' > yields some interesting results. Yes, MFENCE for AMD. Since I was infected with these Google results anyway, I looked at the Linux code. Apparently, they use MFENCE on amd, and LFENCE on Intel. They also use LFENCE on VIA, it seems. Intel documentation claims that MFENCE does not serialize instruction execution, which is contrary to used LFENCE behaviour. So we definitely want to add some barrier right before rdtsc. And we do want LFENCE for Intels. Patch below ends with the following code: Dump of assembler code for function tsc_get_timecount_lfence: 0xffffffff805563a0 <+0>: push %rbp 0xffffffff805563a1 <+1>: mov %rsp,%rbp 0xffffffff805563a4 <+4>: lfence=20 0xffffffff805563a7 <+7>: rdtsc =20 0xffffffff805563a9 <+9>: leaveq=20 0xffffffff805563aa <+10>: retq =20 Dump of assembler code for function tsc_get_timecount_low_lfence: 0xffffffff805556a0 <+0>: push %rbp 0xffffffff805556a1 <+1>: mov %rsp,%rbp 0xffffffff805556a4 <+4>: lfence=20 0xffffffff805556a7 <+7>: mov 0x30(%rdi),%rcx 0xffffffff805556ab <+11>: rdtsc =20 0xffffffff805556ad <+13>: shrd %cl,%edx,%eax 0xffffffff805556b0 <+16>: leaveq=20 0xffffffff805556b1 <+17>: retq=20 which I would qualify as perfect outcome. Patch below still leaves libc only suitable for Intels and VIA, not for AMD, but I will take care of it later. diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index c253a96..06cfe10 100644 --- a/sys/x86/x86/tsc.c +++ b/sys/x86/x86/tsc.c @@ -83,6 +83,10 @@ static void tsc_freq_changing(void *arg, const struct cf= _level *level, int *status); static unsigned tsc_get_timecount(struct timecounter *tc); static unsigned tsc_get_timecount_low(struct timecounter *tc); +static unsigned tsc_get_timecount_lfence(struct timecounter *tc); +static unsigned tsc_get_timecount_low_lfence(struct timecounter *tc); +static unsigned tsc_get_timecount_mfence(struct timecounter *tc); +static unsigned tsc_get_timecount_low_mfence(struct timecounter *tc); static void tsc_levels_changed(void *arg, int unit); =20 static struct timecounter tsc_timecounter =3D { @@ -262,6 +266,10 @@ probe_tsc_freq(void) (vm_guest =3D=3D VM_GUEST_NO && CPUID_TO_FAMILY(cpu_id) >=3D 0x10)) tsc_is_invariant =3D 1; + if (cpu_feature & CPUID_SSE2) { + tsc_timecounter.tc_get_timecount =3D + tsc_get_timecount_mfence; + } break; case CPU_VENDOR_INTEL: if ((amd_pminfo & AMDPM_TSC_INVARIANT) !=3D 0 || @@ -271,6 +279,10 @@ probe_tsc_freq(void) (CPUID_TO_FAMILY(cpu_id) =3D=3D 0xf && CPUID_TO_MODEL(cpu_id) >=3D 0x3)))) tsc_is_invariant =3D 1; + if (cpu_feature & CPUID_SSE2) { + tsc_timecounter.tc_get_timecount =3D + tsc_get_timecount_lfence; + } break; case CPU_VENDOR_CENTAUR: if (vm_guest =3D=3D VM_GUEST_NO && @@ -278,6 +290,10 @@ probe_tsc_freq(void) CPUID_TO_MODEL(cpu_id) >=3D 0xf && (rdmsr(0x1203) & 0x100000000ULL) =3D=3D 0) tsc_is_invariant =3D 1; + if (cpu_feature & CPUID_SSE2) { + tsc_timecounter.tc_get_timecount =3D + tsc_get_timecount_lfence; + } break; } =20 @@ -328,7 +344,15 @@ init_TSC(void) =20 #ifdef SMP =20 -/* rmb is required here because rdtsc is not a serializing instruction. */ +/* + * RDTSC is not a serializing instruction, so we need to drain + * instruction stream before executing it. It could be fixed by use of + * RDTSCP, except the instruction is not available everywhere. + * + * Insert both MFENCE for AMD CPUs, and LFENCE for others (Intel and + * VIA), and assume that SMP test is only performed on CPUs that have + * SSE2 anyway. + */ #define TSC_READ(x) \ static void \ tsc_read_##x(void *arg) \ @@ -337,6 +361,7 @@ tsc_read_##x(void *arg) \ u_int cpu =3D PCPU_GET(cpuid); \ \ rmb(); \ + mb(); \ tsc[cpu * 3 + x] =3D rdtsc32(); \ } TSC_READ(0) @@ -487,7 +512,16 @@ init: for (shift =3D 0; shift < 31 && (tsc_freq >> shift) > max_freq; shift++) ; if (shift > 0) { - tsc_timecounter.tc_get_timecount =3D tsc_get_timecount_low; + if (cpu_feature & CPUID_SSE2) { + if (cpu_vendor_id =3D=3D CPU_VENDOR_AMD) { + tsc_timecounter.tc_get_timecount =3D + tsc_get_timecount_low_mfence; + } else { + tsc_timecounter.tc_get_timecount =3D + tsc_get_timecount_low_lfence; + } + } else + tsc_timecounter.tc_get_timecount =3D tsc_get_timecount_low; tsc_timecounter.tc_name =3D "TSC-low"; if (bootverbose) printf("TSC timecounter discards lower %d bit(s)\n", @@ -592,23 +626,55 @@ sysctl_machdep_tsc_freq(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq, CTLTYPE_U64 | CTLFLAG_RW, 0, 0, sysctl_machdep_tsc_freq, "QU", "Time Stamp Counter frequency"); =20 -static u_int +static inline u_int tsc_get_timecount(struct timecounter *tc __unused) { =20 return (rdtsc32()); } =20 -static u_int +static inline u_int tsc_get_timecount_low(struct timecounter *tc) { uint32_t rv; =20 __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" - : "=3Da" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); + : "=3Da" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); return (rv); } =20 +static inline u_int +tsc_get_timecount_lfence(struct timecounter *tc __unused) +{ + + rmb(); + return (rdtsc32()); +} + +static inline u_int +tsc_get_timecount_low_lfence(struct timecounter *tc) +{ + + rmb(); + return (tsc_get_timecount_low(tc)); +} + +static inline u_int +tsc_get_timecount_mfence(struct timecounter *tc __unused) +{ + + mb(); + return (rdtsc32()); +} + +static inline u_int +tsc_get_timecount_low_mfence(struct timecounter *tc) +{ + + mb(); + return (tsc_get_timecount_low(tc)); +} + uint32_t cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th) { --0QJ8DMHdp6MMZYsr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlAP9rIACgkQC3+MBN1Mb4jVcQCgubtMzsGjHtDAnAHyeH4Mhu6F PjoAoKAmcKaMMerzmF3Cs2g7IRA/6yvO =PXg8 -----END PGP SIGNATURE----- --0QJ8DMHdp6MMZYsr-- From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 14:16:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9EC2106566C; Wed, 25 Jul 2012 14:16:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7A17E8FC0A; Wed, 25 Jul 2012 14:16:04 +0000 (UTC) Received: from c122-106-171-246.carlnfd1.nsw.optusnet.com.au (c122-106-171-246.carlnfd1.nsw.optusnet.com.au [122.106.171.246]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q6PEFs7i032071 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 26 Jul 2012 00:15:55 +1000 Date: Thu, 26 Jul 2012 00:15:54 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov In-Reply-To: <20120725102130.GH2676@deviant.kiev.zoral.com.ua> Message-ID: <20120725233033.N5406@besplex.bde.org> References: <201207242210.q6OMACqV079603@svn.freebsd.org> <500F9E22.4080608@FreeBSD.org> <20120725102130.GH2676@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Jim Harris , svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 14:16:05 -0000 On Wed, 25 Jul 2012, Konstantin Belousov wrote: > On Wed, Jul 25, 2012 at 10:20:02AM +0300, Andriy Gapon wrote: >> on 25/07/2012 01:10 Jim Harris said the following: >>> Author: jimharris >>> Date: Tue Jul 24 22:10:11 2012 >>> New Revision: 238755 >>> URL: http://svn.freebsd.org/changeset/base/238755 >>> >>> Log: >>> Add rmb() to tsc_read_##x to enforce serialization of rdtsc captures. >>> >>> Intel Architecture Manual specifies that rdtsc instruction is not serialized, >>> so without this change, TSC synchronization test would periodically fail, >>> resulting in use of HPET timecounter instead of TSC-low. This caused >>> severe performance degradation (40-50%) when running high IO/s workloads due to >>> HPET MMIO reads and GEOM stat collection. >>> >>> Tests on Xeon E5-2600 (Sandy Bridge) 8C systems were seeing TSC synchronization >>> fail approximately 20% of the time. >> >> Should rather the synchronization test be fixed if it's the culprit? > Synchronization test for what ? > >> Or is this change universally good for the real uses of TSC? It's too slow for real uses. But synchronization code, and some uses that requires serialization may need it for, er, synchronization and serialization. It's hard to think of many uses that need serialization. I often use it for timing instructions. For timng a large number of instructions, serialization doesn't matter since errors of a few tens in a few billion done matter. For timing a small number of instructions, I don't want serialization, since the serialization invalidates the timing. Most uses in FreeBSD are for timecounters. Timecounters deliver the current time. This is unrelated to whatever instructions haven't completed when the TSC is read. Except possibly when the time needs to be synchronized across CPUs, and when the uncompleted instruction is a TSC read. > For tsc test, this means that after the change RDTSC executions are not > reordered on the single core among themself. As I understand, CPU has > no dependency noted between two reads of tsc by RDTSC, which allows > later read to give lower value of counter. Gak. Even when they are in the same instruction sequence? Even though the TSC reads fixed registers and some other instructions in the sequence between the TSC use these registers? The CPU would have to do significant register renaming to break this. > This is fixed by Intel by > introduction of RDTSCP instruction, which is defined to be serialization > point, and use of which (instead of LFENCE; RDTSC sequence) also fixes > test, as confirmed by Jim. This is not a fix if it is full serialization. It just gives slowness using a single instruction instead of a couple. > In fact, I now think that we should also apply the following patch. > Otherwise, consequtive calls to e.g. binuptime(9) could return decreased > time stamps. Note that libc __vdso_gettc.c already has LFENCE nearby the > tsc reads, which was done not for this reason, but apparently needed for > the reason too. > > diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c > index 085c339..229b351 100644 > --- a/sys/x86/x86/tsc.c > +++ b/sys/x86/x86/tsc.c > @@ -594,6 +594,7 @@ static u_int > tsc_get_timecount(struct timecounter *tc __unused) > { > > + rmb(); > return (rdtsc32()); > } Please don't pessimize this further. The time for rdtsc went from 6.5 cycles on AthlonXP to 65 cycles on core2 (mainly for for P-state-invariance hardware synchronization I think). Pretty soon it will be as slow as an HPET and heading towards an i8254. Adding rmb() only makes it 12 cycles slower on core2, but 16 cycles (almost 3 times) slower on AthlonXP. > @@ -602,8 +603,9 @@ tsc_get_timecount_low(struct timecounter *tc) > { > uint32_t rv; > > + rmb(); > __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" > - : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); > + : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); > return (rv); > } The previous TSC-low/shrd pessimization adds only 2 cycles on AthlonXP and core2. I think it only "works" by backing the TSC's resolution so low that it usually can't see its own, or at least other TSC's lack of serialness. The shift count is usually 7 or 8, so the resolution is reduced from 1 cycle to 128 or 256. Out of order times that fall in the same block of 128 or 256 cycles would appear to be the same, but out of order times like 129 and 127 would apear to be even more out of order after a shift of 7 turns them into 128 and 0. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 14:44:07 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3A5BC106566C; Wed, 25 Jul 2012 14:44:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id BF88A8FC0C; Wed, 25 Jul 2012 14:44:06 +0000 (UTC) Received: from c122-106-171-246.carlnfd1.nsw.optusnet.com.au (c122-106-171-246.carlnfd1.nsw.optusnet.com.au [122.106.171.246]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q6PEi4Jp023193 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 26 Jul 2012 00:44:05 +1000 Date: Thu, 26 Jul 2012 00:44:04 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andriy Gapon In-Reply-To: <500FE6AE.8070706@FreeBSD.org> Message-ID: <20120726001659.M5406@besplex.bde.org> References: <201207242210.q6OMACqV079603@svn.freebsd.org> <500F9E22.4080608@FreeBSD.org> <20120725102130.GH2676@deviant.kiev.zoral.com.ua> <500FE6AE.8070706@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Konstantin Belousov , Jim Harris , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 14:44:07 -0000 On Wed, 25 Jul 2012, Andriy Gapon wrote: > on 25/07/2012 13:21 Konstantin Belousov said the following: >> ... >> diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c >> index 085c339..229b351 100644 >> --- a/sys/x86/x86/tsc.c >> +++ b/sys/x86/x86/tsc.c >> @@ -594,6 +594,7 @@ static u_int >> tsc_get_timecount(struct timecounter *tc __unused) >> { >> >> + rmb(); >> return (rdtsc32()); >> } > > This makes sense to me. We probably want correctness over performance here. > [BTW, I originally thought that the change was here; brain malfunction] And I liked the original change because it wasn't here :-). >> @@ -602,8 +603,9 @@ tsc_get_timecount_low(struct timecounter *tc) >> { >> uint32_t rv; >> >> + rmb(); >> __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" >> - : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); >> + : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); >> return (rv); >> } >> > > It would correct here too, but not sure if it would make any difference given that > some lower bits are discarded anyway. Probably depends on exact CPU. It is needed to pessimize this too. :-) As I have complained before, the loss of resolution from the shift is easy to see by reading the time from userland, even with syscall overhead taking 10-20 times longer than the read. On core2 with TSC-low, a clock- checking utility gives: % min 481, max 12031, mean 530.589452, std 51.633626 % 1th: 550 (1296487 observations) % 2th: 481 (448425 observations) % 3th: 482 (142650 observations) % 4th: 549 (61945 observations) % 5th: 551 (47619 observations) The numbers are diffences in nanoseconds measured by clock_gettime(). The jump from 481 to 549 is 68. From this I can tell that the clock frequency is 1.86 Ghz and the shift is 128, or the clock frequency is 3.72 Ghz and the shift is 256. On AthlonXP with TSC: % min 273, max 29075, mean 274.412811, std 80.425963 % 1th: 273 (853962 observations) % 2th: 274 (745606 observations) % 3th: 275 (400212 observations) % 4th: 276 (20 observations) % 5th: 280 (10 observations) Now the numbers cluster about the mean. Although syscalls take much longer than the loss of resolution with TSC-low, and even the core2 TSC takes almost as long to read as the loss, it is still possible to see things happening at the limits of the resolution (~0.5 nsec). > And, oh hmm, I read AMD Software Optimization Guide for AMD Family 10h Processors > and they suggest using cpuid (with a note that it may be intercepted in > virtualized environments) or _mfence_ in the discussed role (Appendix F of the > document). > Googling for 'rdtsc mfence lfence' yields some interesting results. The second hit was for the shrd pessimization/loss of resolution and a memory access hack in lkml in 2011. I now seem to remember jkim mentioning the memory access hack. rmb() on i386 has a related memory access hack, but now with a lock prefix that defeats the point of the 2011 hack (it wanted to save 5 nsec by removing fences). rmb() on amd64 uses lfence. Some of the other hits are a bit old. The 8th one was by me in the thread about kib@ implementing gettimeofday() in userland. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 15:29:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 728FA1065670; Wed, 25 Jul 2012 15:29:59 +0000 (UTC) (envelope-from jim.harris@gmail.com) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 77C6C8FC0C; Wed, 25 Jul 2012 15:29:58 +0000 (UTC) Received: by wgbds11 with SMTP id ds11so833228wgb.31 for ; Wed, 25 Jul 2012 08:29:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=lTjsmjHxLEMcE2byPuhgIijBjwUEZIjXtw010Q3vR4c=; b=jvq3mi8VIsy2oFJaKsPTqY8M1HOopAVQw9ePNq2z+aNH4M1DBbPS+2cks7RTeo56bF rVl0HcLoisYjpnCikwitSexlUS/CNSBxzm52E7OdgTk/hxiadOROVNKJ/kVfMZJ1sGWb YHo1IDsDXaHejxmDKzTkm22HIsHhkhwnJ5y+vx7WI1PgOQO1CNPYS9fyORjYd4cIxbaW ICPqYukNBj/ghXYEF6c35IxXva+J1SSyEO3cFcSBaMkmytNmcK08mTa1rl/8bmFhZSq0 7j0xz6YSNIjsKwxBY4ziPvUV1MNApkSAlroCGPCF8ij2XxXBYhqges0H/+F1cfrIuzKW VpAA== MIME-Version: 1.0 Received: by 10.216.181.195 with SMTP id l45mr5117628wem.52.1343230197420; Wed, 25 Jul 2012 08:29:57 -0700 (PDT) Received: by 10.216.178.212 with HTTP; Wed, 25 Jul 2012 08:29:57 -0700 (PDT) In-Reply-To: <20120725133754.GK2676@deviant.kiev.zoral.com.ua> References: <201207242210.q6OMACqV079603@svn.freebsd.org> <500F9E22.4080608@FreeBSD.org> <20120725102130.GH2676@deviant.kiev.zoral.com.ua> <500FE6AE.8070706@FreeBSD.org> <20120725133754.GK2676@deviant.kiev.zoral.com.ua> Date: Wed, 25 Jul 2012 08:29:57 -0700 Message-ID: From: Jim Harris To: Konstantin Belousov Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 15:29:59 -0000 On Wed, Jul 25, 2012 at 6:37 AM, Konstantin Belousov wrote: > On Wed, Jul 25, 2012 at 03:29:34PM +0300, Andriy Gapon wrote: >> on 25/07/2012 13:21 Konstantin Belousov said the following: >> > On Wed, Jul 25, 2012 at 10:20:02AM +0300, Andriy Gapon wrote: >> >> on 25/07/2012 01:10 Jim Harris said the following: >> >>> Author: jimharris >> >>> Date: Tue Jul 24 22:10:11 2012 >> >>> New Revision: 238755 >> >>> URL: http://svn.freebsd.org/changeset/base/238755 >> >>> >> >>> Log: >> >>> Add rmb() to tsc_read_##x to enforce serialization of rdtsc captures. >> >>> >> >>> Intel Architecture Manual specifies that rdtsc instruction is not serialized, >> >>> so without this change, TSC synchronization test would periodically fail, >> >>> resulting in use of HPET timecounter instead of TSC-low. This caused >> >>> severe performance degradation (40-50%) when running high IO/s workloads due to >> >>> HPET MMIO reads and GEOM stat collection. >> >>> >> >>> Tests on Xeon E5-2600 (Sandy Bridge) 8C systems were seeing TSC synchronization >> >>> fail approximately 20% of the time. >> >> >> >> Should rather the synchronization test be fixed if it's the culprit? >> > Synchronization test for what ? >> >> The synchronization test mentioned above. >> So, oops, very sorry - I missed the fact that the change was precisely in the >> test. I confused it for another place where tsc is used. Thank you for pointing >> this out. >> >> >> Or is this change universally good for the real uses of TSC? >> > >> > What I understood from the Intel SDM, and also from additional experiments >> > which Jim kindly made despite me being annoying as usual, is that 'read >> > memory barrier' AKA LFENCE there is used for its secondary implementation >> > effects, not for load/load barrier as you might assume. >> > >> > According to SDM, LFENCE fully drains execution pipeline (but comparing >> > with MFENCE, does not drain write buffers). The result is that RDTSC is >> > not started before previous instructions are finished. >> >> Yes, I am fully aware of this. >> >> > For tsc test, this means that after the change RDTSC executions are not >> > reordered on the single core among themself. As I understand, CPU has >> > no dependency noted between two reads of tsc by RDTSC, which allows >> > later read to give lower value of counter. This is fixed by Intel by >> > introduction of RDTSCP instruction, which is defined to be serialization >> > point, and use of which (instead of LFENCE; RDTSC sequence) also fixes >> > test, as confirmed by Jim. >> >> Yes. I think that previously Intel recommended to precede rdtsc with cpuid for >> all the same reasons. Not sure if there is any difference performance-wise >> comparing to lfence. >> Unfortunately, rdtscp is not available on all CPUs, so using it would require >> extra work. >> >> > In fact, I now think that we should also apply the following patch. >> > Otherwise, consequtive calls to e.g. binuptime(9) could return decreased >> > time stamps. Note that libc __vdso_gettc.c already has LFENCE nearby the >> > tsc reads, which was done not for this reason, but apparently needed for >> > the reason too. >> > >> > diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c >> > index 085c339..229b351 100644 >> > --- a/sys/x86/x86/tsc.c >> > +++ b/sys/x86/x86/tsc.c >> > @@ -594,6 +594,7 @@ static u_int >> > tsc_get_timecount(struct timecounter *tc __unused) >> > { >> > >> > + rmb(); >> > return (rdtsc32()); >> > } >> > >> >> This makes sense to me. We probably want correctness over performance here. >> [BTW, I originally thought that the change was here; brain malfunction] >> >> > @@ -602,8 +603,9 @@ tsc_get_timecount_low(struct timecounter *tc) >> > { >> > uint32_t rv; >> > >> > + rmb(); >> > __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" >> > - : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); >> > + : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); >> > return (rv); >> > } >> > >> >> It would correct here too, but not sure if it would make any difference given that >> some lower bits are discarded anyway. Probably depends on exact CPU. >> >> >> And, oh hmm, I read AMD Software Optimization Guide for AMD Family 10h >> Processors and they suggest using cpuid (with a note that it may be >> intercepted in virtualized environments) or _mfence_ in the discussed >> role (Appendix F of the document). Googling for 'rdtsc mfence lfence' >> yields some interesting results. > Yes, MFENCE for AMD. > > Since I was infected with these Google results anyway, I looked at the > Linux code. Apparently, they use MFENCE on amd, and LFENCE on Intel. > They also use LFENCE on VIA, it seems. Intel documentation claims that > MFENCE does not serialize instruction execution, which is contrary to > used LFENCE behaviour. > > So we definitely want to add some barrier right before rdtsc. And we do > want LFENCE for Intels. Patch below ends with the following code: > > Dump of assembler code for function tsc_get_timecount_lfence: > 0xffffffff805563a0 <+0>: push %rbp > 0xffffffff805563a1 <+1>: mov %rsp,%rbp > 0xffffffff805563a4 <+4>: lfence > 0xffffffff805563a7 <+7>: rdtsc > 0xffffffff805563a9 <+9>: leaveq > 0xffffffff805563aa <+10>: retq > Dump of assembler code for function tsc_get_timecount_low_lfence: > 0xffffffff805556a0 <+0>: push %rbp > 0xffffffff805556a1 <+1>: mov %rsp,%rbp > 0xffffffff805556a4 <+4>: lfence > 0xffffffff805556a7 <+7>: mov 0x30(%rdi),%rcx > 0xffffffff805556ab <+11>: rdtsc > 0xffffffff805556ad <+13>: shrd %cl,%edx,%eax > 0xffffffff805556b0 <+16>: leaveq > 0xffffffff805556b1 <+17>: retq > which I would qualify as perfect outcome. > > Patch below still leaves libc only suitable for Intels and VIA, not for AMD, > but I will take care of it later. > > diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c > index c253a96..06cfe10 100644 > --- a/sys/x86/x86/tsc.c > +++ b/sys/x86/x86/tsc.c > @@ -83,6 +83,10 @@ static void tsc_freq_changing(void *arg, const struct cf_level *level, > int *status); > static unsigned tsc_get_timecount(struct timecounter *tc); > static unsigned tsc_get_timecount_low(struct timecounter *tc); > +static unsigned tsc_get_timecount_lfence(struct timecounter *tc); > +static unsigned tsc_get_timecount_low_lfence(struct timecounter *tc); > +static unsigned tsc_get_timecount_mfence(struct timecounter *tc); > +static unsigned tsc_get_timecount_low_mfence(struct timecounter *tc); > static void tsc_levels_changed(void *arg, int unit); > > static struct timecounter tsc_timecounter = { > @@ -262,6 +266,10 @@ probe_tsc_freq(void) > (vm_guest == VM_GUEST_NO && > CPUID_TO_FAMILY(cpu_id) >= 0x10)) > tsc_is_invariant = 1; > + if (cpu_feature & CPUID_SSE2) { > + tsc_timecounter.tc_get_timecount = > + tsc_get_timecount_mfence; > + } > break; > case CPU_VENDOR_INTEL: > if ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || > @@ -271,6 +279,10 @@ probe_tsc_freq(void) > (CPUID_TO_FAMILY(cpu_id) == 0xf && > CPUID_TO_MODEL(cpu_id) >= 0x3)))) > tsc_is_invariant = 1; > + if (cpu_feature & CPUID_SSE2) { > + tsc_timecounter.tc_get_timecount = > + tsc_get_timecount_lfence; > + } > break; > case CPU_VENDOR_CENTAUR: > if (vm_guest == VM_GUEST_NO && > @@ -278,6 +290,10 @@ probe_tsc_freq(void) > CPUID_TO_MODEL(cpu_id) >= 0xf && > (rdmsr(0x1203) & 0x100000000ULL) == 0) > tsc_is_invariant = 1; > + if (cpu_feature & CPUID_SSE2) { > + tsc_timecounter.tc_get_timecount = > + tsc_get_timecount_lfence; > + } > break; > } > > @@ -328,7 +344,15 @@ init_TSC(void) > > #ifdef SMP > > -/* rmb is required here because rdtsc is not a serializing instruction. */ > +/* > + * RDTSC is not a serializing instruction, so we need to drain > + * instruction stream before executing it. It could be fixed by use of > + * RDTSCP, except the instruction is not available everywhere. > + * > + * Insert both MFENCE for AMD CPUs, and LFENCE for others (Intel and > + * VIA), and assume that SMP test is only performed on CPUs that have > + * SSE2 anyway. > + */ > #define TSC_READ(x) \ > static void \ > tsc_read_##x(void *arg) \ > @@ -337,6 +361,7 @@ tsc_read_##x(void *arg) \ > u_int cpu = PCPU_GET(cpuid); \ > \ > rmb(); \ > + mb(); \ > tsc[cpu * 3 + x] = rdtsc32(); \ I've seen bde@'s comments, so perhaps this patch will not move forward, but I'm wondering if it would make sense here to just call the new tsc_get_timecount_mfence() function rather than explicitly call mb() and then rdtsc32(). > } > TSC_READ(0) > @@ -487,7 +512,16 @@ init: > for (shift = 0; shift < 31 && (tsc_freq >> shift) > max_freq; shift++) > ; > if (shift > 0) { > - tsc_timecounter.tc_get_timecount = tsc_get_timecount_low; > + if (cpu_feature & CPUID_SSE2) { > + if (cpu_vendor_id == CPU_VENDOR_AMD) { > + tsc_timecounter.tc_get_timecount = > + tsc_get_timecount_low_mfence; > + } else { > + tsc_timecounter.tc_get_timecount = > + tsc_get_timecount_low_lfence; > + } > + } else > + tsc_timecounter.tc_get_timecount = tsc_get_timecount_low; > tsc_timecounter.tc_name = "TSC-low"; > if (bootverbose) > printf("TSC timecounter discards lower %d bit(s)\n", > @@ -592,23 +626,55 @@ sysctl_machdep_tsc_freq(SYSCTL_HANDLER_ARGS) > SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq, CTLTYPE_U64 | CTLFLAG_RW, > 0, 0, sysctl_machdep_tsc_freq, "QU", "Time Stamp Counter frequency"); > > -static u_int > +static inline u_int > tsc_get_timecount(struct timecounter *tc __unused) > { > > return (rdtsc32()); > } > > -static u_int > +static inline u_int > tsc_get_timecount_low(struct timecounter *tc) > { > uint32_t rv; > > __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" > - : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); > + : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); > return (rv); > } > > +static inline u_int > +tsc_get_timecount_lfence(struct timecounter *tc __unused) > +{ > + > + rmb(); > + return (rdtsc32()); > +} > + > +static inline u_int > +tsc_get_timecount_low_lfence(struct timecounter *tc) > +{ > + > + rmb(); > + return (tsc_get_timecount_low(tc)); > +} > + > +static inline u_int > +tsc_get_timecount_mfence(struct timecounter *tc __unused) > +{ > + > + mb(); > + return (rdtsc32()); > +} > + > +static inline u_int > +tsc_get_timecount_low_mfence(struct timecounter *tc) > +{ > + > + mb(); > + return (tsc_get_timecount_low(tc)); > +} > + > uint32_t > cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th) > { From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 17:01:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1478B106566B; Wed, 25 Jul 2012 17:01:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id A2B398FC08; Wed, 25 Jul 2012 17:01:52 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6PH1t8M058665; Wed, 25 Jul 2012 20:01:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6PH1hOS090179; Wed, 25 Jul 2012 20:01:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6PH1hDS090178; Wed, 25 Jul 2012 20:01:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 25 Jul 2012 20:01:42 +0300 From: Konstantin Belousov To: Jim Harris Message-ID: <20120725170142.GM2676@deviant.kiev.zoral.com.ua> References: <201207242210.q6OMACqV079603@svn.freebsd.org> <500F9E22.4080608@FreeBSD.org> <20120725102130.GH2676@deviant.kiev.zoral.com.ua> <500FE6AE.8070706@FreeBSD.org> <20120725133754.GK2676@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IwdZRIiUtqUn88AE" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 17:01:53 -0000 --IwdZRIiUtqUn88AE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 25, 2012 at 08:29:57AM -0700, Jim Harris wrote: > On Wed, Jul 25, 2012 at 6:37 AM, Konstantin Belousov > wrote: > > -/* rmb is required here because rdtsc is not a serializing instruction= . */ > > +/* > > + * RDTSC is not a serializing instruction, so we need to drain > > + * instruction stream before executing it. It could be fixed by use of > > + * RDTSCP, except the instruction is not available everywhere. > > + * > > + * Insert both MFENCE for AMD CPUs, and LFENCE for others (Intel and > > + * VIA), and assume that SMP test is only performed on CPUs that have > > + * SSE2 anyway. > > + */ > > #define TSC_READ(x) \ > > static void \ > > tsc_read_##x(void *arg) \ > > @@ -337,6 +361,7 @@ tsc_read_##x(void *arg) \ > > u_int cpu =3D PCPU_GET(cpuid); \ > > \ > > rmb(); \ > > + mb(); \ > > tsc[cpu * 3 + x] =3D rdtsc32(); \ >=20 > I've seen bde@'s comments, so perhaps this patch will not move > forward, but I'm wondering if it would make sense here to just call > the new tsc_get_timecount_mfence() function rather than explicitly > call mb() and then rdtsc32(). I think that this in fact shall call cpuid() instead of rmb()/mb(). The genuine Pentiums, PentiumPro and Pentium II/III can be used in SMP configuration but definitely lack LFENCE. Regarding the patch, either it or some close relative to it shall be implemented, since otherwise we are simply incorrect, as you demonstrated. --IwdZRIiUtqUn88AE Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlAQJnYACgkQC3+MBN1Mb4i5AgCgiW2xQex3PvC3EY0wKOylby1h GKoAoNx1UV/w7SNmiPajaTMdOerb+VKj =qD7F -----END PGP SIGNATURE----- --IwdZRIiUtqUn88AE-- From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 17:25:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93074106564A; Wed, 25 Jul 2012 17:25:45 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D9688FC0C; Wed, 25 Jul 2012 17:25: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 q6PHPj0r081677; Wed, 25 Jul 2012 17:25:45 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6PHPj4T081675; Wed, 25 Jul 2012 17:25:45 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201207251725.q6PHPj4T081675@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 25 Jul 2012 17:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238774 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 17:25:45 -0000 Author: gavin Date: Wed Jul 25 17:25:44 2012 New Revision: 238774 URL: http://svn.freebsd.org/changeset/base/238774 Log: Update supported hardware list after r238766. MFC after: 1 week Modified: head/share/man/man4/uplcom.4 Modified: head/share/man/man4/uplcom.4 ============================================================================== --- head/share/man/man4/uplcom.4 Wed Jul 25 17:15:52 2012 (r238773) +++ head/share/man/man4/uplcom.4 Wed Jul 25 17:25:44 2012 (r238774) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 20, 2011 +.Dd July 25, 2012 .Dt UPLCOM 4 .Os .Sh NAME @@ -118,6 +118,8 @@ Microsoft Palm 700WX .It Mobile Action MA-620 Infrared Adapter .It +Motorola Cables +.It Nokia CA-42 Cable .It OTI DKU-5 cable From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 17:27:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F0F391065693; Wed, 25 Jul 2012 17:27:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 35C678FC08; Wed, 25 Jul 2012 17:27:49 +0000 (UTC) Message-ID: <50102C94.9030706@FreeBSD.org> Date: Wed, 25 Jul 2012 13:27:48 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120626 Thunderbird/13.0.1 MIME-Version: 1.0 To: Bruce Evans References: <201207242210.q6OMACqV079603@svn.freebsd.org> <500F9E22.4080608@FreeBSD.org> <20120725102130.GH2676@deviant.kiev.zoral.com.ua> <500FE6AE.8070706@FreeBSD.org> <20120726001659.M5406@besplex.bde.org> In-Reply-To: <20120726001659.M5406@besplex.bde.org> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Jim Harris , src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , svn-src-head@freebsd.org, Konstantin Belousov Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 17:27:50 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2012-07-25 10:44:04 -0400, Bruce Evans wrote: > On Wed, 25 Jul 2012, Andriy Gapon wrote: > >> on 25/07/2012 13:21 Konstantin Belousov said the following: >>> ... diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index >>> 085c339..229b351 100644 --- a/sys/x86/x86/tsc.c +++ >>> b/sys/x86/x86/tsc.c @@ -594,6 +594,7 @@ static u_int >>> tsc_get_timecount(struct timecounter *tc __unused) { >>> >>> + rmb(); return (rdtsc32()); } >> >> This makes sense to me. We probably want correctness over >> performance here. [BTW, I originally thought that the change was >> here; brain malfunction] > > And I liked the original change because it wasn't here :-). > >>> @@ -602,8 +603,9 @@ tsc_get_timecount_low(struct timecounter >>> *tc) { uint32_t rv; >>> >>> + rmb(); __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" - >>> : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); + >>> : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); return >>> (rv); } >>> >> >> It would correct here too, but not sure if it would make any >> difference given that some lower bits are discarded anyway. >> Probably depends on exact CPU. > > It is needed to pessimize this too. :-) > > As I have complained before, the loss of resolution from the shift > is easy to see by reading the time from userland, even with syscall > overhead taking 10-20 times longer than the read. On core2 with > TSC-low, a clock- checking utility gives: > > % min 481, max 12031, mean 530.589452, std 51.633626 % 1th: 550 > (1296487 observations) % 2th: 481 (448425 observations) % 3th: 482 > (142650 observations) % 4th: 549 (61945 observations) % 5th: 551 > (47619 observations) > > The numbers are diffences in nanoseconds measured by > clock_gettime(). The jump from 481 to 549 is 68. From this I can > tell that the clock frequency is 1.86 Ghz and the shift is 128, or > the clock frequency is 3.72 Ghz and the shift is 256. > > On AthlonXP with TSC: > > % min 273, max 29075, mean 274.412811, std 80.425963 % 1th: 273 > (853962 observations) % 2th: 274 (745606 observations) % 3th: 275 > (400212 observations) % 4th: 276 (20 observations) % 5th: 280 (10 > observations) > > Now the numbers cluster about the mean. Although syscalls take > much longer than the loss of resolution with TSC-low, and even the > core2 TSC takes almost as long to read as the loss, it is still > possible to see things happening at the limits of the resolution > (~0.5 nsec). > >> And, oh hmm, I read AMD Software Optimization Guide for AMD >> Family 10h Processors and they suggest using cpuid (with a note >> that it may be intercepted in virtualized environments) or >> _mfence_ in the discussed role (Appendix F of the document). >> Googling for 'rdtsc mfence lfence' yields some interesting >> results. > > The second hit was for the shrd pessimization/loss of resolution > and a memory access hack in lkml in 2011. I now seem to remember > jkim mentioning the memory access hack. rmb() on i386 has a > related memory access hack, but now with a lock prefix that defeats > the point of the 2011 hack (it wanted to save 5 nsec by removing > fences). rmb() on amd64 uses lfence. I believe I mentioned this thread at the time: https://patchwork.kernel.org/patch/691712/ FYI, r238755 is essentially this commit for Linux: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=93ce99e849433ede4ce8b410b749dc0cad1100b2 > Some of the other hits are a bit old. The 8th one was by me in > the thread about kib@ implementing gettimeofday() in userland. Since we have gettimeofday() in userland, the above Linux thread is more relevant now, I guess. Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlAQLJQACgkQmlay1b9qnVMR8ACglzKrNWGeYJeqRhHQmna5stQQ qM4AoKn4xdey8nglvdVm7UiQ1NZRr81E =15v+ -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 17:32:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D1EA1065672; Wed, 25 Jul 2012 17:32:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 9FEEF8FC08; Wed, 25 Jul 2012 17:32:31 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6PHWOAp060924; Wed, 25 Jul 2012 20:32:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6PHWCUR090303; Wed, 25 Jul 2012 20:32:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6PHWCbK090302; Wed, 25 Jul 2012 20:32:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 25 Jul 2012 20:32:12 +0300 From: Konstantin Belousov To: Bruce Evans Message-ID: <20120725173212.GN2676@deviant.kiev.zoral.com.ua> References: <201207242210.q6OMACqV079603@svn.freebsd.org> <500F9E22.4080608@FreeBSD.org> <20120725102130.GH2676@deviant.kiev.zoral.com.ua> <20120725233033.N5406@besplex.bde.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ruMf52VDn1nA85Y/" Content-Disposition: inline In-Reply-To: <20120725233033.N5406@besplex.bde.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, Jim Harris , svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 17:32:32 -0000 --ruMf52VDn1nA85Y/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 26, 2012 at 12:15:54AM +1000, Bruce Evans wrote: > On Wed, 25 Jul 2012, Konstantin Belousov wrote: >=20 > >On Wed, Jul 25, 2012 at 10:20:02AM +0300, Andriy Gapon wrote: > >>on 25/07/2012 01:10 Jim Harris said the following: > >>>Author: jimharris > >>>Date: Tue Jul 24 22:10:11 2012 > >>>New Revision: 238755 > >>>URL: http://svn.freebsd.org/changeset/base/238755 > >>> > >>>Log: > >>> Add rmb() to tsc_read_##x to enforce serialization of rdtsc captures. > >>> > >>> Intel Architecture Manual specifies that rdtsc instruction is not=20 > >>> serialized, > >>> so without this change, TSC synchronization test would periodically= =20 > >>> fail, > >>> resulting in use of HPET timecounter instead of TSC-low. This caused > >>> severe performance degradation (40-50%) when running high IO/s=20 > >>> workloads due to > >>> HPET MMIO reads and GEOM stat collection. > >>> > >>> Tests on Xeon E5-2600 (Sandy Bridge) 8C systems were seeing TSC=20 > >>> synchronization > >>> fail approximately 20% of the time. > >> > >>Should rather the synchronization test be fixed if it's the culprit? > >Synchronization test for what ? > > > >>Or is this change universally good for the real uses of TSC? >=20 > It's too slow for real uses. But synchronization code, and some uses > that requires serialization may need it for, er, synchronization and > serialization. >=20 > It's hard to think of many uses that need serialization. I often use > it for timing instructions. For timng a large number of instructions, > serialization doesn't matter since errors of a few tens in a few billion > done matter. For timing a small number of instructions, I don't want > serialization, since the serialization invalidates the timing. >=20 > Most uses in FreeBSD are for timecounters. Timecounters deliver the > current time. This is unrelated to whatever instructions haven't > completed when the TSC is read. Except possibly when the time needs > to be synchronized across CPUs, and when the uncompleted instruction > is a TSC read. >=20 > >For tsc test, this means that after the change RDTSC executions are not > >reordered on the single core among themself. As I understand, CPU has > >no dependency noted between two reads of tsc by RDTSC, which allows > >later read to give lower value of counter. >=20 > Gak. Even when they are in the same instruction sequence? Even though > the TSC reads fixed registers and some other instructions in the sequence > between the TSC use these registers? The CPU would have to do significant > register renaming to break this. As I could only speculate, I believe that any modern CPU executes RDTSC as at least two separate steps, one is read from internal counter, and second is the registers update. It seems that the first kind of action is not serialized. I have no other explanation for the Jim findings. I also asked Jim to test whether the cause the TSC sync test failure is the lack of synchronization between gathering data and tasting it, but ut appeared that the reason is genuine timecounter value going backward. Sp the bug seems real, and I cannot imagine we will live with the known defect in timecounters which can step back. >=20 > >This is fixed by Intel by > >introduction of RDTSCP instruction, which is defined to be serialization > >point, and use of which (instead of LFENCE; RDTSC sequence) also fixes > >test, as confirmed by Jim. >=20 > This is not a fix if it is full serialization. It just gives slowness > using a single instruction instead of a couple. >=20 > >In fact, I now think that we should also apply the following patch. > >Otherwise, consequtive calls to e.g. binuptime(9) could return decreased > >time stamps. Note that libc __vdso_gettc.c already has LFENCE nearby the > >tsc reads, which was done not for this reason, but apparently needed for > >the reason too. > > > >diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c > >index 085c339..229b351 100644 > >--- a/sys/x86/x86/tsc.c > >+++ b/sys/x86/x86/tsc.c > >@@ -594,6 +594,7 @@ static u_int > >tsc_get_timecount(struct timecounter *tc __unused) > >{ > > > >+ rmb(); > > return (rdtsc32()); > >} >=20 > Please don't pessimize this further. The time for rdtsc went from 6.5 > cycles on AthlonXP to 65 cycles on core2 (mainly for for > P-state-invariance hardware synchronization I think). Pretty soon it > will be as slow as an HPET and heading towards an i8254. Adding rmb() > only makes it 12 cycles slower on core2, but 16 cycles (almost 3 times) > slower on AthlonXP. AthlonXP does not look as interesting target for optimizations. Fom what I can find this is PIII-era CPU. >=20 > >@@ -602,8 +603,9 @@ tsc_get_timecount_low(struct timecounter *tc) > >{ > > uint32_t rv; > > > >+ rmb(); > > __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" > >- : "=3Da" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); > >+ : "=3Da" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); > > return (rv); > >} >=20 > The previous TSC-low/shrd pessimization adds only 2 cycles on AthlonXP > and core2. I think it only "works" by backing the TSC's resolution > so low that it usually can't see its own, or at least other TSC's lack of > serialness. The shift count is usually 7 or 8, so the resolution is > reduced from 1 cycle to 128 or 256. Out of order times that fall in > the same block of 128 or 256 cycles would appear to be the same, but > out of order times like 129 and 127 would apear to be even more out > of order after a shift of 7 turns them into 128 and 0. >=20 > Bruce --ruMf52VDn1nA85Y/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlAQLZwACgkQC3+MBN1Mb4i3zgCg8c5jgAPQcRXWCRODzG+BM4N5 ilcAoOxpsYuxNbviGLhASp7vhe6C0Xw5 =g12l -----END PGP SIGNATURE----- --ruMf52VDn1nA85Y/-- From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 17:42:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBC40106564A; Wed, 25 Jul 2012 17:42:57 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C61408FC15; Wed, 25 Jul 2012 17:42:57 +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 q6PHgvpR083180; Wed, 25 Jul 2012 17:42:57 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6PHgvDj083177; Wed, 25 Jul 2012 17:42:57 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201207251742.q6PHgvDj083177@svn.freebsd.org> From: Max Khon Date: Wed, 25 Jul 2012 17:42:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238775 - stable/8/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 17:42:58 -0000 Author: fjoe Date: Wed Jul 25 17:42:57 2012 New Revision: 238775 URL: http://svn.freebsd.org/changeset/base/238775 Log: MFC: r227457, r237350, r237357 Add support for the following Moxa PCIe multiport serial boards: - CP102E - CP102EL - CP104EL-A - CP104JU - CP114EL - CP118EL-A - CP168EL-A Modified: stable/8/sys/dev/puc/puc_cfg.h stable/8/sys/dev/puc/pucdata.c Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/puc/puc_cfg.h ============================================================================== --- stable/8/sys/dev/puc/puc_cfg.h Wed Jul 25 17:25:44 2012 (r238774) +++ stable/8/sys/dev/puc/puc_cfg.h Wed Jul 25 17:42:57 2012 (r238775) @@ -79,7 +79,7 @@ struct puc_cfg { int8_t ports; int8_t rid; /* Rid of first port */ int8_t d_rid; /* Delta rid of next ports */ - int8_t d_ofs; /* Delta offset of next ports */ + int16_t d_ofs; /* Delta offset of next ports */ puc_config_f *config_function; }; Modified: stable/8/sys/dev/puc/pucdata.c ============================================================================== --- stable/8/sys/dev/puc/pucdata.c Wed Jul 25 17:25:44 2012 (r238774) +++ stable/8/sys/dev/puc/pucdata.c Wed Jul 25 17:42:57 2012 (r238775) @@ -51,6 +51,7 @@ static puc_config_f puc_config_amc; static puc_config_f puc_config_diva; static puc_config_f puc_config_exar; static puc_config_f puc_config_icbook; +static puc_config_f puc_config_moxa; static puc_config_f puc_config_oxford_pcie; static puc_config_f puc_config_quatech; static puc_config_f puc_config_syba; @@ -506,6 +507,18 @@ const struct puc_cfg puc_pci_devices[] = .config_function = puc_config_quatech }, + { 0x1393, 0x1024, 0xffff, 0, + "Moxa Technologies, Smartio CP-102E/PCIe", + DEFAULT_RCLK * 8, + PUC_PORT_2S, 0x14, 0, 0x200 + }, + + { 0x1393, 0x1025, 0xffff, 0, + "Moxa Technologies, Smartio CP-102EL/PCIe", + DEFAULT_RCLK * 8, + PUC_PORT_2S, 0x14, 0, 0x200, + }, + { 0x1393, 0x1040, 0xffff, 0, "Moxa Technologies, Smartio C104H/PCI", DEFAULT_RCLK * 8, @@ -518,12 +531,25 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_4S, 0x18, 0, 8, }, + { 0x1393, 0x1042, 0xffff, 0, + "Moxa Technologies, Smartio CP-104JU/PCI", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x18, 0, 8, + }, + { 0x1393, 0x1043, 0xffff, 0, "Moxa Technologies, Smartio CP-104EL/PCIe", DEFAULT_RCLK * 8, PUC_PORT_4S, 0x18, 0, 8, }, + { 0x1393, 0x1045, 0xffff, 0, + "Moxa Technologies, Smartio CP-104EL-A/PCIe", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x14, 0, -1, + .config_function = puc_config_moxa + }, + { 0x1393, 0x1120, 0xffff, 0, "Moxa Technologies, CP-112UL", DEFAULT_RCLK * 8, @@ -536,6 +562,19 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_4S, 0x18, 0, 8, }, + { 0x1393, 0x1144, 0xffff, 0, + "Moxa Technologies, Smartio CP-114EL/PCIe", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x14, 0, -1, + .config_function = puc_config_moxa + }, + + { 0x1393, 0x1182, 0xffff, 0, + "Moxa Technologies, Smartio CP-118EL-A/PCIe", + DEFAULT_RCLK * 8, + PUC_PORT_8S, 0x14, 0, 0x200, + }, + { 0x1393, 0x1680, 0xffff, 0, "Moxa Technologies, C168H/PCI", DEFAULT_RCLK * 8, @@ -554,6 +593,12 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_8S, 0x18, 0, 8, }, + { 0x1393, 0x1683, 0xffff, 0, + "Moxa Technologies, Smartio CP-168EL-A/PCIe", + DEFAULT_RCLK * 8, + PUC_PORT_8S, 0x14, 0, 0x200, + }, + { 0x13a8, 0x0152, 0xffff, 0, "Exar XR17C/D152", DEFAULT_RCLK * 8, @@ -1104,6 +1149,17 @@ puc_config_icbook(struct puc_softc *sc, } static int +puc_config_moxa(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, + intptr_t *res) +{ + if (cmd == PUC_CFG_GET_OFS) { + *res = ((port == 3) ? 7 : port) * 0x200; + return 0; + } + return (ENXIO); +} + +static int puc_config_quatech(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, intptr_t *res) { From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 17:49:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9FEA8106566B; Wed, 25 Jul 2012 17:49:01 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A81D8FC08; Wed, 25 Jul 2012 17:49:01 +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 q6PHn1n3083721; Wed, 25 Jul 2012 17:49:01 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6PHn16Y083719; Wed, 25 Jul 2012 17:49:01 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201207251749.q6PHn16Y083719@svn.freebsd.org> From: "George V. Neville-Neil" Date: Wed, 25 Jul 2012 17:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238776 - head/cddl/contrib/opensolaris/cmd/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 17:49:01 -0000 Author: gnn Date: Wed Jul 25 17:49:01 2012 New Revision: 238776 URL: http://svn.freebsd.org/changeset/base/238776 Log: Revert previous commit. The bug was actually caused by an issue in pre 1.8.5 versions of sudo which were sending too many SIGINTs to processes when the user hit Ctrl-C. Pointed out by: avg@, rpaulo@, sbruno@ Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Wed Jul 25 17:42:57 2012 (r238775) +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Wed Jul 25 17:49:01 2012 (r238776) @@ -70,8 +70,6 @@ typedef struct dtrace_cmd { #define E_ERROR 1 #define E_USAGE 2 -#define IMPATIENT_LIMIT 2 - static const char DTRACE_OPTSTR[] = "3:6:aAb:Bc:CD:ef:FGhHi:I:lL:m:n:o:p:P:qs:SU:vVwx:X:Z"; @@ -1204,7 +1202,7 @@ intr(int signo) if (!g_intr) g_newline = 1; - if (g_intr++ > IMPATIENT_LIMIT) + if (g_intr++) g_impatient = 1; } From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 18:00:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4C6001065673; Wed, 25 Jul 2012 18:00:43 +0000 (UTC) (envelope-from jim.harris@gmail.com) Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com [74.125.82.42]) by mx1.freebsd.org (Postfix) with ESMTP id 5C8D18FC18; Wed, 25 Jul 2012 18:00:42 +0000 (UTC) Received: by wgbfm10 with SMTP id fm10so4736505wgb.1 for ; Wed, 25 Jul 2012 11:00:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=VGNZxUqeN19sKL5EevWhrAOX8ocXi3j3e/ik8tDCBzo=; b=fQesXM/bjJlNsfoiB48T2Rq2IrA0oyZn2OcRPW6lBGhGzuGiGRHOBkjIQV+2tyayMi BoFUNgBLFbBGResHbaYQisTjizhfTlKWMvyjLKSwbQWfbVcnaouoSm/hZRmWyCAk+xMZ npEstndz3x5QsNoLhJm3NuLZ3w+yl2cder4F93qWS//H7Hb4+ZDMiwVw2z7O1kUnJCGH Ev378wzNaeaX+LIwI1KqzEEJI+mtSDvsYAr4855iN4ZuoiuFxgmU7hH2qvmT68hn0eA9 V8HxmDNjyMgat9taYGsjWlKYzcMtFCCLr+1Za1LNkAPrPZ5jXk02Dcmlh9rpbNu0rQNQ JqqA== MIME-Version: 1.0 Received: by 10.216.196.94 with SMTP id q72mr429421wen.149.1343239241444; Wed, 25 Jul 2012 11:00:41 -0700 (PDT) Received: by 10.216.178.212 with HTTP; Wed, 25 Jul 2012 11:00:41 -0700 (PDT) In-Reply-To: <20120725173212.GN2676@deviant.kiev.zoral.com.ua> References: <201207242210.q6OMACqV079603@svn.freebsd.org> <500F9E22.4080608@FreeBSD.org> <20120725102130.GH2676@deviant.kiev.zoral.com.ua> <20120725233033.N5406@besplex.bde.org> <20120725173212.GN2676@deviant.kiev.zoral.com.ua> Date: Wed, 25 Jul 2012 11:00:41 -0700 Message-ID: From: Jim Harris To: Konstantin Belousov Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon , Bruce Evans Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 18:00:43 -0000 On Wed, Jul 25, 2012 at 10:32 AM, Konstantin Belousov wrote: > On Thu, Jul 26, 2012 at 12:15:54AM +1000, Bruce Evans wrote: >> On Wed, 25 Jul 2012, Konstantin Belousov wrote: >> >> >On Wed, Jul 25, 2012 at 10:20:02AM +0300, Andriy Gapon wrote: >> >>on 25/07/2012 01:10 Jim Harris said the following: >> >>>Author: jimharris >> >>>Date: Tue Jul 24 22:10:11 2012 >> >>>New Revision: 238755 >> >>>URL: http://svn.freebsd.org/changeset/base/238755 >> >>> >> >>>Log: >> >>> Add rmb() to tsc_read_##x to enforce serialization of rdtsc captures. >> >>> >> >>> Intel Architecture Manual specifies that rdtsc instruction is not >> >>> serialized, >> >>> so without this change, TSC synchronization test would periodically >> >>> fail, >> >>> resulting in use of HPET timecounter instead of TSC-low. This caused >> >>> severe performance degradation (40-50%) when running high IO/s >> >>> workloads due to >> >>> HPET MMIO reads and GEOM stat collection. >> >>> >> >>> Tests on Xeon E5-2600 (Sandy Bridge) 8C systems were seeing TSC >> >>> synchronization >> >>> fail approximately 20% of the time. >> >> >> >>Should rather the synchronization test be fixed if it's the culprit? >> >Synchronization test for what ? >> > >> >>Or is this change universally good for the real uses of TSC? >> >> It's too slow for real uses. But synchronization code, and some uses >> that requires serialization may need it for, er, synchronization and >> serialization. >> >> It's hard to think of many uses that need serialization. I often use >> it for timing instructions. For timng a large number of instructions, >> serialization doesn't matter since errors of a few tens in a few billion >> done matter. For timing a small number of instructions, I don't want >> serialization, since the serialization invalidates the timing. >> >> Most uses in FreeBSD are for timecounters. Timecounters deliver the >> current time. This is unrelated to whatever instructions haven't >> completed when the TSC is read. Except possibly when the time needs >> to be synchronized across CPUs, and when the uncompleted instruction >> is a TSC read. >> >> >For tsc test, this means that after the change RDTSC executions are not >> >reordered on the single core among themself. As I understand, CPU has >> >no dependency noted between two reads of tsc by RDTSC, which allows >> >later read to give lower value of counter. >> >> Gak. Even when they are in the same instruction sequence? Even though >> the TSC reads fixed registers and some other instructions in the sequence >> between the TSC use these registers? The CPU would have to do significant >> register renaming to break this. > As I could only speculate, I believe that any modern CPU executes RDTSC > as at least two separate steps, one is read from internal counter, and > second is the registers update. It seems that the first kind of action > is not serialized. I have no other explanation for the Jim findings. > > I also asked Jim to test whether the cause the TSC sync test failure > is the lack of synchronization between gathering data and tasting it, > but ut appeared that the reason is genuine timecounter value going > backward. I wonder if instead of timecounter going backward, that TSC test fails because CPU speculatively performs rdtsc instruction in relation to waiter checks in smp_rendezvous_action. Or maybe we are saying the same thing. > > Sp the bug seems real, and I cannot imagine we will live with the known > defect in timecounters which can step back. >> >> >This is fixed by Intel by >> >introduction of RDTSCP instruction, which is defined to be serialization >> >point, and use of which (instead of LFENCE; RDTSC sequence) also fixes >> >test, as confirmed by Jim. >> >> This is not a fix if it is full serialization. It just gives slowness >> using a single instruction instead of a couple. >> >> >In fact, I now think that we should also apply the following patch. >> >Otherwise, consequtive calls to e.g. binuptime(9) could return decreased >> >time stamps. Note that libc __vdso_gettc.c already has LFENCE nearby the >> >tsc reads, which was done not for this reason, but apparently needed for >> >the reason too. >> > >> >diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c >> >index 085c339..229b351 100644 >> >--- a/sys/x86/x86/tsc.c >> >+++ b/sys/x86/x86/tsc.c >> >@@ -594,6 +594,7 @@ static u_int >> >tsc_get_timecount(struct timecounter *tc __unused) >> >{ >> > >> >+ rmb(); >> > return (rdtsc32()); >> >} >> >> Please don't pessimize this further. The time for rdtsc went from 6.5 >> cycles on AthlonXP to 65 cycles on core2 (mainly for for >> P-state-invariance hardware synchronization I think). Pretty soon it >> will be as slow as an HPET and heading towards an i8254. Adding rmb() >> only makes it 12 cycles slower on core2, but 16 cycles (almost 3 times) >> slower on AthlonXP. > AthlonXP does not look as interesting target for optimizations. Fom what I > can find this is PIII-era CPU. > >> >> >@@ -602,8 +603,9 @@ tsc_get_timecount_low(struct timecounter *tc) >> >{ >> > uint32_t rv; >> > >> >+ rmb(); >> > __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" >> >- : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); >> >+ : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); >> > return (rv); >> >} >> >> The previous TSC-low/shrd pessimization adds only 2 cycles on AthlonXP >> and core2. I think it only "works" by backing the TSC's resolution >> so low that it usually can't see its own, or at least other TSC's lack of >> serialness. The shift count is usually 7 or 8, so the resolution is >> reduced from 1 cycle to 128 or 256. Out of order times that fall in >> the same block of 128 or 256 cycles would appear to be the same, but >> out of order times like 129 and 127 would apear to be even more out >> of order after a shift of 7 turns them into 128 and 0. >> >> Bruce From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 18:05:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44242106564A; Wed, 25 Jul 2012 18:05:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 7CC848FC16; Wed, 25 Jul 2012 18:05:43 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6PI5ovj063384; Wed, 25 Jul 2012 21:05:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6PI5bVG090460; Wed, 25 Jul 2012 21:05:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6PI5bWW090459; Wed, 25 Jul 2012 21:05:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 25 Jul 2012 21:05:37 +0300 From: Konstantin Belousov To: Jung-uk Kim Message-ID: <20120725180537.GO2676@deviant.kiev.zoral.com.ua> References: <201207242210.q6OMACqV079603@svn.freebsd.org> <500F9E22.4080608@FreeBSD.org> <20120725102130.GH2676@deviant.kiev.zoral.com.ua> <500FE6AE.8070706@FreeBSD.org> <20120726001659.M5406@besplex.bde.org> <50102C94.9030706@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ycB2AJa2FexhOtH6" Content-Disposition: inline In-Reply-To: <50102C94.9030706@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Jim Harris , src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 18:05:44 -0000 --ycB2AJa2FexhOtH6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 25, 2012 at 01:27:48PM -0400, Jung-uk Kim wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 >=20 > On 2012-07-25 10:44:04 -0400, Bruce Evans wrote: > > On Wed, 25 Jul 2012, Andriy Gapon wrote: > >=20 > >> on 25/07/2012 13:21 Konstantin Belousov said the following: > >>> ... diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index > >>> 085c339..229b351 100644 --- a/sys/x86/x86/tsc.c +++ > >>> b/sys/x86/x86/tsc.c @@ -594,6 +594,7 @@ static u_int=20 > >>> tsc_get_timecount(struct timecounter *tc __unused) { > >>>=20 > >>> + rmb(); return (rdtsc32()); } > >>=20 > >> This makes sense to me. We probably want correctness over > >> performance here. [BTW, I originally thought that the change was > >> here; brain malfunction] > >=20 > > And I liked the original change because it wasn't here :-). > >=20 > >>> @@ -602,8 +603,9 @@ tsc_get_timecount_low(struct timecounter > >>> *tc) { uint32_t rv; > >>>=20 > >>> + rmb(); __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" - > >>> : "=3Da" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); + > >>> : "=3Da" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); return > >>> (rv); } > >>>=20 > >>=20 > >> It would correct here too, but not sure if it would make any=20 > >> difference given that some lower bits are discarded anyway. > >> Probably depends on exact CPU. > >=20 > > It is needed to pessimize this too. :-) > >=20 > > As I have complained before, the loss of resolution from the shift > > is easy to see by reading the time from userland, even with syscall > > overhead taking 10-20 times longer than the read. On core2 with > > TSC-low, a clock- checking utility gives: > >=20 > > % min 481, max 12031, mean 530.589452, std 51.633626 % 1th: 550 > > (1296487 observations) % 2th: 481 (448425 observations) % 3th: 482 > > (142650 observations) % 4th: 549 (61945 observations) % 5th: 551 > > (47619 observations) > >=20 > > The numbers are diffences in nanoseconds measured by > > clock_gettime(). The jump from 481 to 549 is 68. From this I can > > tell that the clock frequency is 1.86 Ghz and the shift is 128, or > > the clock frequency is 3.72 Ghz and the shift is 256. > >=20 > > On AthlonXP with TSC: > >=20 > > % min 273, max 29075, mean 274.412811, std 80.425963 % 1th: 273 > > (853962 observations) % 2th: 274 (745606 observations) % 3th: 275 > > (400212 observations) % 4th: 276 (20 observations) % 5th: 280 (10 > > observations) > >=20 > > Now the numbers cluster about the mean. Although syscalls take > > much longer than the loss of resolution with TSC-low, and even the > > core2 TSC takes almost as long to read as the loss, it is still > > possible to see things happening at the limits of the resolution > > (~0.5 nsec). > >=20 > >> And, oh hmm, I read AMD Software Optimization Guide for AMD > >> Family 10h Processors and they suggest using cpuid (with a note > >> that it may be intercepted in virtualized environments) or > >> _mfence_ in the discussed role (Appendix F of the document).=20 > >> Googling for 'rdtsc mfence lfence' yields some interesting > >> results. > >=20 > > The second hit was for the shrd pessimization/loss of resolution > > and a memory access hack in lkml in 2011. I now seem to remember > > jkim mentioning the memory access hack. rmb() on i386 has a > > related memory access hack, but now with a lock prefix that defeats > > the point of the 2011 hack (it wanted to save 5 nsec by removing > > fences). rmb() on amd64 uses lfence. >=20 > I believe I mentioned this thread at the time: >=20 > https://patchwork.kernel.org/patch/691712/ >=20 > FYI, r238755 is essentially this commit for Linux: >=20 > http://git.kernel.org/?p=3Dlinux/kernel/git/torvalds/linux.git;a=3Dcommit= ;h=3D93ce99e849433ede4ce8b410b749dc0cad1100b2 >=20 > > Some of the other hits are a bit old. The 8th one was by me in > > the thread about kib@ implementing gettimeofday() in userland. >=20 > Since we have gettimeofday() in userland, the above Linux thread is > more relevant now, I guess. For some unrelated reasons, we do have lfence;rdtsc sequence in the userland already. Well, it is not exactly such sequence, there are some instructions between, but the main fact is that two consequtive invocations of gettimeofday(2) (*) or clock_gettime(2) are interleaved with lfence on Intels, guaranteeing that backstep of the counter is impossible. * - it is not a syscall anymore. As I said, using recommended mfence;rdtsc sequence for AMDs would require some work, but lets handle the kernel and userspace issues separately. And, I really failed to find what the patch from the thread you referenced tried to fix. Was it really committed into Linux ? I see actual problem of us allowing timecounters going back, and a solution that exactly follows words of both Intel and AMD documentation. This is good one step forward IMHO. --ycB2AJa2FexhOtH6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlAQNXEACgkQC3+MBN1Mb4hyXgCgjfz+zMNYK1zsP9IKc+ei3bCd VDUAn1pzLAZ0u7ssFpdo2nqairvnaSPi =s+f/ -----END PGP SIGNATURE----- --ycB2AJa2FexhOtH6-- From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 18:35:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 205CD1065677; Wed, 25 Jul 2012 18:35:15 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 301738FC14; Wed, 25 Jul 2012 18:35:14 +0000 (UTC) Message-ID: <50103C61.8040904@FreeBSD.org> Date: Wed, 25 Jul 2012 14:35:13 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120626 Thunderbird/13.0.1 MIME-Version: 1.0 To: Konstantin Belousov References: <201207242210.q6OMACqV079603@svn.freebsd.org> <500F9E22.4080608@FreeBSD.org> <20120725102130.GH2676@deviant.kiev.zoral.com.ua> <500FE6AE.8070706@FreeBSD.org> <20120726001659.M5406@besplex.bde.org> <50102C94.9030706@FreeBSD.org> <20120725180537.GO2676@deviant.kiev.zoral.com.ua> In-Reply-To: <20120725180537.GO2676@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Jim Harris , src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 18:35:15 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2012-07-25 14:05:37 -0400, Konstantin Belousov wrote: > On Wed, Jul 25, 2012 at 01:27:48PM -0400, Jung-uk Kim wrote: >> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 >> >> On 2012-07-25 10:44:04 -0400, Bruce Evans wrote: >>> On Wed, 25 Jul 2012, Andriy Gapon wrote: >>> >>>> on 25/07/2012 13:21 Konstantin Belousov said the following: >>>>> ... diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c >>>>> index 085c339..229b351 100644 --- a/sys/x86/x86/tsc.c +++ >>>>> b/sys/x86/x86/tsc.c @@ -594,6 +594,7 @@ static u_int >>>>> tsc_get_timecount(struct timecounter *tc __unused) { >>>>> >>>>> + rmb(); return (rdtsc32()); } >>>> >>>> This makes sense to me. We probably want correctness over >>>> performance here. [BTW, I originally thought that the change >>>> was here; brain malfunction] >>> >>> And I liked the original change because it wasn't here :-). >>> >>>>> @@ -602,8 +603,9 @@ tsc_get_timecount_low(struct >>>>> timecounter *tc) { uint32_t rv; >>>>> >>>>> + rmb(); __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" >>>>> - : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); >>>>> + : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); >>>>> return (rv); } >>>>> >>>> >>>> It would correct here too, but not sure if it would make any >>>> difference given that some lower bits are discarded anyway. >>>> Probably depends on exact CPU. >>> >>> It is needed to pessimize this too. :-) >>> >>> As I have complained before, the loss of resolution from the >>> shift is easy to see by reading the time from userland, even >>> with syscall overhead taking 10-20 times longer than the read. >>> On core2 with TSC-low, a clock- checking utility gives: >>> >>> % min 481, max 12031, mean 530.589452, std 51.633626 % 1th: >>> 550 (1296487 observations) % 2th: 481 (448425 observations) % >>> 3th: 482 (142650 observations) % 4th: 549 (61945 observations) >>> % 5th: 551 (47619 observations) >>> >>> The numbers are diffences in nanoseconds measured by >>> clock_gettime(). The jump from 481 to 549 is 68. From this I >>> can tell that the clock frequency is 1.86 Ghz and the shift is >>> 128, or the clock frequency is 3.72 Ghz and the shift is 256. >>> >>> On AthlonXP with TSC: >>> >>> % min 273, max 29075, mean 274.412811, std 80.425963 % 1th: >>> 273 (853962 observations) % 2th: 274 (745606 observations) % >>> 3th: 275 (400212 observations) % 4th: 276 (20 observations) % >>> 5th: 280 (10 observations) >>> >>> Now the numbers cluster about the mean. Although syscalls >>> take much longer than the loss of resolution with TSC-low, and >>> even the core2 TSC takes almost as long to read as the loss, it >>> is still possible to see things happening at the limits of the >>> resolution (~0.5 nsec). >>> >>>> And, oh hmm, I read AMD Software Optimization Guide for AMD >>>> Family 10h Processors and they suggest using cpuid (with a >>>> note that it may be intercepted in virtualized environments) >>>> or _mfence_ in the discussed role (Appendix F of the >>>> document). Googling for 'rdtsc mfence lfence' yields some >>>> interesting results. >>> >>> The second hit was for the shrd pessimization/loss of >>> resolution and a memory access hack in lkml in 2011. I now >>> seem to remember jkim mentioning the memory access hack. rmb() >>> on i386 has a related memory access hack, but now with a lock >>> prefix that defeats the point of the 2011 hack (it wanted to >>> save 5 nsec by removing fences). rmb() on amd64 uses lfence. >> >> I believe I mentioned this thread at the time: >> >> https://patchwork.kernel.org/patch/691712/ >> >> FYI, r238755 is essentially this commit for Linux: >> >> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=93ce99e849433ede4ce8b410b749dc0cad1100b2 >> >>> >> Some of the other hits are a bit old. The 8th one was by me in >>> the thread about kib@ implementing gettimeofday() in userland. >> >> Since we have gettimeofday() in userland, the above Linux thread >> is more relevant now, I guess. > > For some unrelated reasons, we do have lfence;rdtsc sequence in > the userland already. Well, it is not exactly such sequence, there > are some instructions between, but the main fact is that two > consequtive invocations of gettimeofday(2) (*) or clock_gettime(2) > are interleaved with lfence on Intels, guaranteeing that backstep > of the counter is impossible. > > * - it is not a syscall anymore. > > As I said, using recommended mfence;rdtsc sequence for AMDs would > require some work, but lets handle the kernel and userspace issues > separately. Agreed. > And, I really failed to find what the patch from the thread you > referenced tried to fix. The patch was supposed to reduce a barrier, i.e., vsyscall optimization. Please note I brought it up at the time, not because it fixed any problem but because we completely lack necessary serialization. > Was it really committed into Linux ? Yes, it was committed in a simpler form: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=057e6a8c660e95c3f4e7162e00e2fee1fc90c50d This function was moved around from time to time and now it sits here: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob_plain;f=arch/x86/vdso/vclock_gettime.c It still carries one barrier before rdtsc. Please see the comments. > I see actual problem of us allowing timecounters going back, and a > solution that exactly follows words of both Intel and AMD > documentation. This is good one step forward IMHO. I agree with you here. Correctness outweighs performance, IMHO. Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlAQPGEACgkQmlay1b9qnVOsqwCgvOBLBkbEW+IJhsJBtrXF0mD6 jGAAoL/pj530VFFKQqSGQ5vBpe8xVfQz =0y/R -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 19:18:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E95B106566B; Wed, 25 Jul 2012 19:18:29 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2913F8FC16; Wed, 25 Jul 2012 19:18:29 +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 q6PJITuB091078; Wed, 25 Jul 2012 19:18:29 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6PJIS67091076; Wed, 25 Jul 2012 19:18:28 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207251918.q6PJIS67091076@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 25 Jul 2012 19:18:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238777 - stable/9/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 19:18:29 -0000 Author: bz Date: Wed Jul 25 19:18:28 2012 New Revision: 238777 URL: http://svn.freebsd.org/changeset/base/238777 Log: MFC r238700: Fix a bug introduced in r221129 that leads to a panic when using bundled SAs. For now allow same address family bundles. PR: kern/164400 Approved by: re (kib) Modified: stable/9/sys/netipsec/ipsec_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netipsec/ipsec_output.c ============================================================================== --- stable/9/sys/netipsec/ipsec_output.c Wed Jul 25 17:49:01 2012 (r238776) +++ stable/9/sys/netipsec/ipsec_output.c Wed Jul 25 19:18:28 2012 (r238777) @@ -165,8 +165,7 @@ ipsec_process_done(struct mbuf *m, struc */ if (isr->next) { V_ipsec4stat.ips_out_bundlesa++; - sav = isr->next->sav; - saidx = &sav->sah->saidx; + /* XXX-BZ currently only support same AF bundles. */ switch (saidx->dst.sa.sa_family) { #ifdef INET case AF_INET: From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 19:23:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 56A0110656A9; Wed, 25 Jul 2012 19:23:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id BC34F8FC23; Wed, 25 Jul 2012 19:23:54 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6PJO4EY068724; Wed, 25 Jul 2012 22:24:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6PJNpTQ090861; Wed, 25 Jul 2012 22:23:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6PJNpWH090860; Wed, 25 Jul 2012 22:23:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 25 Jul 2012 22:23:51 +0300 From: Konstantin Belousov To: Jim Harris Message-ID: <20120725192351.GR2676@deviant.kiev.zoral.com.ua> References: <201207242210.q6OMACqV079603@svn.freebsd.org> <500F9E22.4080608@FreeBSD.org> <20120725102130.GH2676@deviant.kiev.zoral.com.ua> <20120725233033.N5406@besplex.bde.org> <20120725173212.GN2676@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DPQvABvJ16HvCXZu" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon , Bruce Evans Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 19:23:55 -0000 --DPQvABvJ16HvCXZu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 25, 2012 at 11:00:41AM -0700, Jim Harris wrote: > On Wed, Jul 25, 2012 at 10:32 AM, Konstantin Belousov > wrote: > > I also asked Jim to test whether the cause the TSC sync test failure > > is the lack of synchronization between gathering data and tasting it, > > but ut appeared that the reason is genuine timecounter value going > > backward. >=20 > I wonder if instead of timecounter going backward, that TSC test > fails because CPU speculatively performs rdtsc instruction in relation > to waiter checks in smp_rendezvous_action. Or maybe we are saying > the same thing. Ok, the definition of the 'timecounter goes back', as I understand it: you have two events A and B in two threads, provable ordered, say, A is a lock release and B is the same lock acquisition. Assume that you take rdtsc values tA and tB under the scope of the lock right before A and right after B. Then it should be impossible to have tA > tB. I do not think that we can ever observe tA > tB if both threads are executing on the same CPU. --DPQvABvJ16HvCXZu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlAQR8cACgkQC3+MBN1Mb4j+dQCgp7HrGcliuvwV1trGrXhrkND8 u7wAnRrJEgINxLU1l1fGSA5HB5F2LXpr =jvTV -----END PGP SIGNATURE----- --DPQvABvJ16HvCXZu-- From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 20:46:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CFB81106566C; Wed, 25 Jul 2012 20:46:22 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0FF48FC08; Wed, 25 Jul 2012 20:46:22 +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 q6PKkMxM098021; Wed, 25 Jul 2012 20:46:22 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6PKkMGD098019; Wed, 25 Jul 2012 20:46:22 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201207252046.q6PKkMGD098019@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 25 Jul 2012 20:46:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238778 - head/sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 20:46:22 -0000 Author: gavin Date: Wed Jul 25 20:46:22 2012 New Revision: 238778 URL: http://svn.freebsd.org/changeset/base/238778 Log: The baud rate on CP1201/2/3 devices can be set in one of two ways: - The USLCOM_SET_BAUD_DIV command (0x01) - The USLCOM_SET_BAUD_RATE command (0x13) Devices based on the CP1204 will only accept the latter command, and ignore the former. As the latter command works on all chips that this driver supports, switch to always using it. A slight confusion here is that the previously used command was incorrectly named USLCOM_BAUD_RATE - even though we no longer use it, rename it to USLCOM_SET_BAUD_DIV to closer match the name used in the datasheet. This change reflects a similar change made in the Linux driver, which was submitted by preston.fick at silabs.com, and has been tested on all of the uslcom(4) devices I have to hand. MFC after: 2 weeks Modified: head/sys/dev/usb/serial/uslcom.c Modified: head/sys/dev/usb/serial/uslcom.c ============================================================================== --- head/sys/dev/usb/serial/uslcom.c Wed Jul 25 19:18:28 2012 (r238777) +++ head/sys/dev/usb/serial/uslcom.c Wed Jul 25 20:46:22 2012 (r238778) @@ -70,12 +70,13 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, deb /* Request codes */ #define USLCOM_UART 0x00 -#define USLCOM_BAUD_RATE 0x01 +#define USLCOM_SET_BAUD_DIV 0x01 #define USLCOM_DATA 0x03 #define USLCOM_BREAK 0x05 #define USLCOM_CTRL 0x07 #define USLCOM_RCTRL 0x08 #define USLCOM_SET_FLOWCTRL 0x13 +#define USLCOM_SET_BAUD_RATE 0x1e #define USLCOM_VENDOR_SPECIFIC 0xff /* USLCOM_UART values */ @@ -92,8 +93,8 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, deb #define USLCOM_CTRL_RI 0x0040 #define USLCOM_CTRL_DCD 0x0080 -/* USLCOM_BAUD_RATE values */ -#define USLCOM_BAUD_REF 0x384000 +/* USLCOM_SET_BAUD_DIV values */ +#define USLCOM_BAUD_REF 3686400 /* 3.6864 MHz */ /* USLCOM_DATA values */ #define USLCOM_STOP_BITS_1 0x00 @@ -511,19 +512,20 @@ uslcom_param(struct ucom_softc *ucom, st { struct uslcom_softc *sc = ucom->sc_parent; struct usb_device_request req; - uint32_t flowctrl[4]; + uint32_t baudrate, flowctrl[4]; uint16_t data; DPRINTF("\n"); + baudrate = t->c_ospeed; req.bmRequestType = USLCOM_WRITE; - req.bRequest = USLCOM_BAUD_RATE; - USETW(req.wValue, USLCOM_BAUD_REF / t->c_ospeed); + req.bRequest = USLCOM_SET_BAUD_RATE; + USETW(req.wValue, 0); USETW(req.wIndex, USLCOM_PORT_NO); - USETW(req.wLength, 0); + USETW(req.wLength, sizeof(baudrate)); - if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, - &req, NULL, 0, 1000)) { + if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + &req, &baudrate, 0, 1000)) { DPRINTF("Set baudrate failed (ignored)\n"); } From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 21:32:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D2C4106564A; Wed, 25 Jul 2012 21:32:56 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 088608FC12; Wed, 25 Jul 2012 21:32:56 +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 q6PLWtIp002077; Wed, 25 Jul 2012 21:32:55 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6PLWt9c002075; Wed, 25 Jul 2012 21:32:55 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201207252132.q6PLWt9c002075@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 25 Jul 2012 21:32:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238779 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 21:32:56 -0000 Author: gavin Date: Wed Jul 25 21:32:55 2012 New Revision: 238779 URL: http://svn.freebsd.org/changeset/base/238779 Log: Add vendor.product for a mouse I have laying around Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Jul 25 20:46:22 2012 (r238778) +++ head/sys/dev/usb/usbdevs Wed Jul 25 21:32:55 2012 (r238779) @@ -672,6 +672,7 @@ vendor STELERA 0x1a8d Stelera Wireless vendor MATRIXORBITAL 0x1b3d Matrix Orbital vendor OVISLINK 0x1b75 OvisLink vendor TCTMOBILE 0x1bbb TCT Mobile +vendor SUNPLUS 0x1bcf Sunplus Innovation Technology Inc. vendor WAGO 0x1be3 WAGO Kontakttechnik GmbH. vendor TELIT 0x1bc7 Telit vendor LONGCHEER 0x1c9e Longcheer Holdings, Ltd. @@ -3268,6 +3269,9 @@ product SUN KEYBOARD_TYPE_7 0x00a2 Type product SUN MOUSE 0x0100 Type 6 USB mouse product SUN KBD_HUB 0x100e Kbd Hub +/* Sunplus Innovation Technology Inc. products */ +product SUNPLUS USBMOUSE 0x0007 USB Optical Mouse + /* Super Top products */ product SUPERTOP IDE 0x6600 USB-IDE From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 21:59:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 936E7106564A; Wed, 25 Jul 2012 21:59:11 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 734998FC0A; Wed, 25 Jul 2012 21:59: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 q6PLxBff004259; Wed, 25 Jul 2012 21:59:11 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6PLxB5o004252; Wed, 25 Jul 2012 21:59:11 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201207252159.q6PLxB5o004252@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 25 Jul 2012 21:59:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238780 - head/usr.bin/find X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 21:59:11 -0000 Author: jilles Date: Wed Jul 25 21:59:10 2012 New Revision: 238780 URL: http://svn.freebsd.org/changeset/base/238780 Log: find: Implement real -ignore_readdir_race. If -ignore_readdir_race is present, [ENOENT] errors caused by deleting a file after find has read its name from a directory are ignored. Formerly, -ignore_readdir_race did nothing. PR: bin/169723 Submitted by: Valery Khromov and Andrey Ignatov Modified: head/usr.bin/find/extern.h head/usr.bin/find/find.1 head/usr.bin/find/find.c head/usr.bin/find/function.c head/usr.bin/find/main.c head/usr.bin/find/option.c Modified: head/usr.bin/find/extern.h ============================================================================== --- head/usr.bin/find/extern.h Wed Jul 25 21:32:55 2012 (r238779) +++ head/usr.bin/find/extern.h Wed Jul 25 21:59:10 2012 (r238780) @@ -58,6 +58,7 @@ creat_f c_flags; creat_f c_follow; creat_f c_fstype; creat_f c_group; +creat_f c_ignore_readdir_race; creat_f c_inum; creat_f c_links; creat_f c_ls; @@ -111,7 +112,8 @@ exec_f f_size; exec_f f_type; exec_f f_user; -extern int ftsoptions, isdeprecated, isdepth, isoutput, issort, isxargs; +extern int ftsoptions, ignore_readdir_race, isdeprecated, isdepth, isoutput; +extern int issort, isxargs; extern int mindepth, maxdepth; extern int regexp_flags; extern time_t now; Modified: head/usr.bin/find/find.1 ============================================================================== --- head/usr.bin/find/find.1 Wed Jul 25 21:32:55 2012 (r238779) +++ head/usr.bin/find/find.1 Wed Jul 25 21:59:10 2012 (r238780) @@ -31,7 +31,7 @@ .\" @(#)find.1 8.7 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd June 13, 2012 +.Dd July 25, 2012 .Dt FIND 1 .Os .Sh NAME @@ -470,7 +470,9 @@ is numeric and there is no such group na .Ar gname is treated as a group ID. .It Ic -ignore_readdir_race -This option is for GNU find compatibility and is ignored. +Ignore errors because a file or a directory is deleted +after reading the name from a directory. +This option does not affect errors occurring on starting points. .It Ic -ilname Ar pattern Like .Ic -lname , @@ -618,7 +620,9 @@ is equivalent to .It Ic -nogroup True if the file belongs to an unknown group. .It Ic -noignore_readdir_race -This option is for GNU find compatibility and is ignored. +Turn off the effect of +.Ic -ignore_readdir_race . +This is default behaviour. .It Ic -noleaf This option is for GNU find compatibility. In GNU find it disables an optimization not relevant to Modified: head/usr.bin/find/find.c ============================================================================== --- head/usr.bin/find/find.c Wed Jul 25 21:32:55 2012 (r238779) +++ head/usr.bin/find/find.c Wed Jul 25 21:59:10 2012 (r238780) @@ -197,8 +197,12 @@ find_execute(PLAN *plan, char *paths[]) continue; break; case FTS_DNR: - case FTS_ERR: case FTS_NS: + if (ignore_readdir_race && + entry->fts_errno == ENOENT && entry->fts_level > 0) + continue; + /* FALLTHROUGH */ + case FTS_ERR: (void)fflush(stdout); warnx("%s: %s", entry->fts_path, strerror(entry->fts_errno)); @@ -228,7 +232,7 @@ find_execute(PLAN *plan, char *paths[]) for (p = plan; p && (p->execute)(p, entry); p = p->next); } finish_execplus(); - if (errno) + if (errno && (!ignore_readdir_race || errno != ENOENT)) err(1, "fts_read"); return (rval); } Modified: head/usr.bin/find/function.c ============================================================================== --- head/usr.bin/find/function.c Wed Jul 25 21:32:55 2012 (r238779) +++ head/usr.bin/find/function.c Wed Jul 25 21:59:10 2012 (r238780) @@ -975,6 +975,25 @@ c_group(OPTION *option, char ***argvp) } /* + * -ignore_readdir_race functions -- + * + * Always true. Ignore errors which occur if a file or a directory + * in a starting point gets deleted between reading the name and calling + * stat on it while find is traversing the starting point. + */ + +PLAN * +c_ignore_readdir_race(OPTION *option, char ***argvp __unused) +{ + if (strcmp(option->name, "-ignore_readdir_race") == 0) + ignore_readdir_race = 1; + else + ignore_readdir_race = 0; + + return palloc(option); +} + +/* * -inum n functions -- * * True if the file has inode # n. Modified: head/usr.bin/find/main.c ============================================================================== --- head/usr.bin/find/main.c Wed Jul 25 21:32:55 2012 (r238779) +++ head/usr.bin/find/main.c Wed Jul 25 21:59:10 2012 (r238780) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); time_t now; /* time find was run */ int dotfd; /* starting directory */ int ftsoptions; /* options for the ftsopen(3) call */ +int ignore_readdir_race = 0; /* ignore readdir race */ int isdeprecated; /* using deprecated syntax */ int isdepth; /* do directories on post-order visit */ int isoutput; /* user specified output operator */ Modified: head/usr.bin/find/option.c ============================================================================== --- head/usr.bin/find/option.c Wed Jul 25 21:32:55 2012 (r238779) +++ head/usr.bin/find/option.c Wed Jul 25 21:59:10 2012 (r238780) @@ -88,7 +88,7 @@ static OPTION const options[] = { { "-fstype", c_fstype, f_fstype, 0 }, { "-gid", c_group, f_group, 0 }, { "-group", c_group, f_group, 0 }, - { "-ignore_readdir_race",c_simple, f_always_true,0 }, + { "-ignore_readdir_race",c_ignore_readdir_race, f_always_true,0 }, { "-ilname", c_name, f_name, F_LINK | F_IGNCASE }, { "-iname", c_name, f_name, F_IGNCASE }, { "-inum", c_inum, f_inum, 0 }, @@ -127,7 +127,7 @@ static OPTION const options[] = { { "-newermm", c_newer, f_newer, 0 }, { "-newermt", c_newer, f_newer, F_TIME2_T }, { "-nogroup", c_nogroup, f_nogroup, 0 }, - { "-noignore_readdir_race",c_simple, f_always_true,0 }, + { "-noignore_readdir_race",c_ignore_readdir_race, f_always_true,0 }, { "-noleaf", c_simple, f_always_true, 0 }, { "-not", c_simple, f_not, 0 }, { "-nouser", c_nouser, f_nouser, 0 }, From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 22:17:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 20669106566C; Wed, 25 Jul 2012 22:17:45 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 094818FC1C; Wed, 25 Jul 2012 22:17: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 q6PMHiVm005807; Wed, 25 Jul 2012 22:17:44 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6PMHiaj005804; Wed, 25 Jul 2012 22:17:44 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201207252217.q6PMHiaj005804@svn.freebsd.org> From: Isabell Long Date: Wed, 25 Jul 2012 22:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238781 - head/lib/libc/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 22:17:45 -0000 Author: issyl0 (doc committer) Date: Wed Jul 25 22:17:44 2012 New Revision: 238781 URL: http://svn.freebsd.org/changeset/base/238781 Log: Add a new man page containing details of new locale-specific functions for wctype.h, iswalnum_l(3). Add it and its functions to the Makefile. Reviewed by: gavin, jilles Approved by: theraven MFC after: 5 days Added: head/lib/libc/locale/iswalnum_l.3 (contents, props changed) Modified: head/lib/libc/locale/Makefile.inc Modified: head/lib/libc/locale/Makefile.inc ============================================================================== --- head/lib/libc/locale/Makefile.inc Wed Jul 25 21:59:10 2012 (r238780) +++ head/lib/libc/locale/Makefile.inc Wed Jul 25 22:17:44 2012 (r238781) @@ -30,7 +30,8 @@ MAN+= btowc.3 \ ctype.3 digittoint.3 isalnum.3 isalpha.3 isascii.3 isblank.3 iscntrl.3 \ isdigit.3 isgraph.3 isideogram.3 islower.3 isphonogram.3 isprint.3 \ ispunct.3 isrune.3 isspace.3 isspecial.3 \ - isupper.3 iswalnum.3 isxdigit.3 localeconv.3 mblen.3 mbrlen.3 \ + isupper.3 iswalnum.3 iswalnum_l.3 isxdigit.3 \ + localeconv.3 mblen.3 mbrlen.3 \ mbrtowc.3 \ mbsinit.3 \ mbsrtowcs.3 mbstowcs.3 mbtowc.3 multibyte.3 \ @@ -53,6 +54,18 @@ MLINKS+=iswalnum.3 iswalpha.3 iswalnum.3 iswalnum.3 iswphonogram.3 iswalnum.3 iswprint.3 iswalnum.3 iswpunct.3 \ iswalnum.3 iswrune.3 iswalnum.3 iswspace.3 iswalnum.3 iswspecial.3 \ iswalnum.3 iswupper.3 iswalnum.3 iswxdigit.3 +MLINKS+=iswalnum_l.3 iswalpha_l.3 iswalnum_l.3 iswcntrl_l.3 \ + iswalnum_l.3 iswctype_l.3 iswalnum_l.3 iswdigit_l.3 \ + iswalnum_l.3 iswgraph_l.3 iswalnum_l.3 iswlower_l.3 \ + iswalnum_l.3 iswprint_l.3 iswalnum_l.3 iswpunct_l.3 \ + iswalnum_l.3 iswspace_l.3 iswalnum_l.3 iswupper_l.3 \ + iswalnum_l.3 iswxdigit_l.3 iswalnum_l.3 towlower_l.3 \ + iswalnum_l.3 towupper_l.3 iswalnum_l.3 wctype_l.3 \ + iswalnum_l.3 iswblank_l.3 iswalnum_l.3 iswhexnumber_l.3 \ + iswalnum_l.3 iswideogram_l.3 iswalnum_l.3 iswnumber_l.3 \ + iswalnum_l.3 iswphonogram_l.3 iswalnum_l.3 iswrune_l.3 \ + iswalnum_l.3 iswspecial_l.3 iswalnum_l.3 nextwctype_l.3 \ + iswalnum_l.3 towctrans_l.3 iswalnum_l.3 wctrans_l.3 MLINKS+=isxdigit.3 ishexnumber.3 MLINKS+=mbsrtowcs.3 mbsnrtowcs.3 MLINKS+=wcsrtombs.3 wcsnrtombs.3 Added: head/lib/libc/locale/iswalnum_l.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/locale/iswalnum_l.3 Wed Jul 25 22:17:44 2012 (r238781) @@ -0,0 +1,168 @@ +.\" Copyright (c) 2012 Isabell Long +.\" 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. +.\" +.\" $FreeBSD$ +.\" +.Dt ISWALNUM_L 3 +.Dd July 25, 2012 +.Os +.Sh NAME +.Nm iswalnum_l , +.Nm iswalpha_l , +.Nm iswcntrl_l , +.Nm iswctype_l , +.Nm iswdigit_l , +.Nm iswgraph_l , +.Nm iswlower_l , +.Nm iswprint_l , +.Nm iswpunct_l , +.Nm iswspace_l , +.Nm iswupper_l , +.Nm iswxdigit_l , +.Nm towlower_l , +.Nm towupper_l , +.Nm wctype_l , +.Nm iswblank_l , +.Nm iswhexnumber_l , +.Nm iswideogram_l , +.Nm iswnumber_l , +.Nm iswphonogram_l , +.Nm iswrune_l , +.Nm iswspecial_l , +.Nm nextwctype_l , +.Nm towctrans_l , +.Nm wctrans_l +.Nd wide character classification utilities +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In wctype.h +.Ft int +.Fn iswalnum_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswalpha_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswcntrl_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswctype_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswdigit_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswgraph_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswlower_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswprint_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswpunct_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswspace_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswupper_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswxdigit_l "wint_t wc" "locale_t loc" +.Ft wint_t +.Fn towlower_l "wint_t wc" "locale_t loc" +.Ft wint_t +.Fn towupper_l "wint_t wc" "locale_t loc" +.Ft wctype_t +.Fn wctype_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswblank_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswhexnumber_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswideogram_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswnumber_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswphonogram_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswrune_l "wint_t wc" "locale_t loc" +.Ft int +.Fn iswspecial_l "wint_t wc" "locale_t loc" +.Ft wint_t +.Fn nextwctype_l "wint_t wc" "locale_t loc" +.Ft wint_t +.Fn towctrans_l "wint_t wc" "wctrans_t" "locale_t loc" +.Ft wctrans_t +.Fn wctrans_l "const char *" "locale_t loc" +.Sh DESCRIPTION +The above functions are character classification utility functions, +for use with wide characters +.Vt ( wchar_t +or +.Vt wint_t ) +in the locale +.Fa loc . +They behave in the same way as the versions without the _l suffix, but use +the specified locale rather than the global or per-thread locale. +These functions may be implemented as inline functions in +.In wctype.h +and as functions in the C library. +See the specific manual pages for more information. +.Sh RETURN VALUES +These functions return the same things as their non-locale versions. +If the locale is invalid, their behaviors are undefined. +.Sh SEE ALSO +.Xr iswalnum 3 , +.Xr iswalpha 3 , +.Xr iswblank 3 , +.Xr iswcntrl 3 , +.Xr iswctype 3 , +.Xr iswdigit 3 , +.Xr iswgraph 3 , +.Xr iswhexnumber 3 , +.Xr iswideogram 3 , +.Xr iswlower 3 , +.Xr iswnumber 3 , +.Xr iswphonogram 3 , +.Xr iswprint 3 , +.Xr iswpunct 3 , +.Xr iswrune 3 , +.Xr iswspace 3 , +.Xr iswspecial 3 , +.Xr iswupper 3 , +.Xr iswxdigit 3 , +.Xr nextwctype 3 , +.Xr towctrans 3 , +.Xr towlower 3 , +.Xr towupper 3 , +.Xr wctrans 3 , +.Xr wctype 3 +.Sh STANDARDS +These functions conform to +.St -p1003.1-2008 , +except for +.Fn iswascii_l , +.Fn iswhexnumber_l , +.Fn iswideogram_l , +.Fn iswphonogram_l , +.Fn iswrune_l , +.Fn iswspecial_l +and +.Fn nextwctype_l +which are +.Fx +extensions. From owner-svn-src-all@FreeBSD.ORG Wed Jul 25 23:27:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C2681065670; Wed, 25 Jul 2012 23:27:11 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 463108FC17; Wed, 25 Jul 2012 23:27:11 +0000 (UTC) Received: by pbbro2 with SMTP id ro2so2349820pbb.13 for ; Wed, 25 Jul 2012 16:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; bh=khWWH9IxXNKzuvC0DwJSPAblRxb6fWDmkerN295jcMw=; b=NiiAk9FZoerzqq7phUt0BC3f/q/ieewNH23dRXy8HMUerK4/TL0ywI8GuW8M0U4Ny9 conx8PyU7Uv1dbeOv1apRbAIW4d7COqc/L1tqOOjx8KABaGu5QOgHZKi91P96dpnUxPX 6VPAAoGapv/Bb0aJnGERw8FlraeNVpgClTru6MpNR3NqWD6uoHYVkAe8OhyeLdw7cov9 h4nJ0eUw5OVtyZw6ee0wECMOHZ01VwQc+bGTqvcmFWUZEyFYSoYJ90Oey3F4g3zJzehT EuN0OaSS6k2nJ5lgSNahvrtlPPJdV/ywGf/psE+EOcsTpjYNuw5ZpDWNWmG0OffMVsRe NomA== Received: by 10.68.195.167 with SMTP id if7mr228608pbc.16.1343258831083; Wed, 25 Jul 2012 16:27:11 -0700 (PDT) Received: from [10.65.86.217] (mobile-166-147-093-222.mycingular.net. [166.147.93.222]) by mx.google.com with ESMTPS id ms9sm15240260pbb.43.2012.07.25.16.27.00 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 Jul 2012 16:27:09 -0700 (PDT) References: <201207241603.q6OG3Sex048054@svn.freebsd.org> In-Reply-To: <201207241603.q6OG3Sex048054@svn.freebsd.org> Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: <0FB11763-EC8E-4396-BC4B-1FD2FC516A8C@gmail.com> X-Mailer: iPhone Mail (9B206) From: Garrett Cooper Date: Wed, 25 Jul 2012 16:26:29 -0700 To: "Andrey A. Chernov" Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r238741 - head/lib/libelf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jul 2012 23:27:11 -0000 Sent from my iPhone On Jul 24, 2012, at 9:03 AM, "Andrey A. Chernov" wrote: > Author: ache > Date: Tue Jul 24 16:03:28 2012 > New Revision: 238741 > URL: http://svn.freebsd.org/changeset/base/238741 >=20 > Log: > Don't ever build files depending on the directory where they are placed i= n. > It is obvious that its modification time will change with each such file > builded. > This bug cause whole libelf to rebuild itself each second make run > (and relink that files on each first make run) in the loop. A bunch of the sys/boot directories probably need this too..= From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 03:50:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E58C106564A; Thu, 26 Jul 2012 03:50:25 +0000 (UTC) (envelope-from kargl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18AEB8FC08; Thu, 26 Jul 2012 03:50:25 +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 q6Q3oOF8031903; Thu, 26 Jul 2012 03:50:24 GMT (envelope-from kargl@svn.freebsd.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6Q3oOgO031901; Thu, 26 Jul 2012 03:50:24 GMT (envelope-from kargl@svn.freebsd.org) Message-Id: <201207260350.q6Q3oOgO031901@svn.freebsd.org> From: Steve Kargl Date: Thu, 26 Jul 2012 03:50:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238782 - head/lib/msun/src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 03:50:25 -0000 Author: kargl Date: Thu Jul 26 03:50:24 2012 New Revision: 238782 URL: http://svn.freebsd.org/changeset/base/238782 Log: Replace code that toggles between 53 and 64 bits on i386 class hardware with the ENTERI and RETURNI macros, which are now available in math_private.h. Suggested by: bde Approved by: das (mentor) Modified: head/lib/msun/src/s_cbrtl.c Modified: head/lib/msun/src/s_cbrtl.c ============================================================================== --- head/lib/msun/src/s_cbrtl.c Wed Jul 25 22:17:44 2012 (r238781) +++ head/lib/msun/src/s_cbrtl.c Thu Jul 26 03:50:24 2012 (r238782) @@ -51,23 +51,12 @@ cbrtl(long double x) if (k == BIAS + LDBL_MAX_EXP) return (x + x); -#ifdef __i386__ - fp_prec_t oprec; - - oprec = fpgetprec(); - if (oprec != FP_PE) - fpsetprec(FP_PE); -#endif + ENTERI(); if (k == 0) { /* If x = +-0, then cbrt(x) = +-0. */ - if ((u.bits.manh | u.bits.manl) == 0) { -#ifdef __i386__ - if (oprec != FP_PE) - fpsetprec(oprec); -#endif - return (x); - } + if ((u.bits.manh | u.bits.manl) == 0) + RETURNI(x); /* Adjust subnormal numbers. */ u.e *= 0x1.0p514; k = u.bits.exp; @@ -149,9 +138,5 @@ cbrtl(long double x) t=t+t*r; /* error <= 0.5 + 0.5/3 + epsilon */ t *= v.e; -#ifdef __i386__ - if (oprec != FP_PE) - fpsetprec(oprec); -#endif - return (t); + RETURNI(t); } From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 03:59:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 88E6E106564A; Thu, 26 Jul 2012 03:59:34 +0000 (UTC) (envelope-from kargl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73FB38FC12; Thu, 26 Jul 2012 03:59:34 +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 q6Q3xYV6032652; Thu, 26 Jul 2012 03:59:34 GMT (envelope-from kargl@svn.freebsd.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6Q3xXvj032649; Thu, 26 Jul 2012 03:59:34 GMT (envelope-from kargl@svn.freebsd.org) Message-Id: <201207260359.q6Q3xXvj032649@svn.freebsd.org> From: Steve Kargl Date: Thu, 26 Jul 2012 03:59:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238783 - in head/lib/msun: ld128 ld80 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 03:59:34 -0000 Author: kargl Date: Thu Jul 26 03:59:33 2012 New Revision: 238783 URL: http://svn.freebsd.org/changeset/base/238783 Log: * ld80/expl.c: . Remove a few #ifdefs that should have been removed in the initial commit. . Sort fpmath.h to its rightful place. * ld128/s_expl.c: . Replace EXPMASK with its actual value. . Sort fpmath.h to its rightful place. Requested by: bde Approved by: das (mentor) Modified: head/lib/msun/ld128/s_expl.c head/lib/msun/ld80/s_expl.c Modified: head/lib/msun/ld128/s_expl.c ============================================================================== --- head/lib/msun/ld128/s_expl.c Thu Jul 26 03:50:24 2012 (r238782) +++ head/lib/msun/ld128/s_expl.c Thu Jul 26 03:59:33 2012 (r238783) @@ -29,12 +29,11 @@ __FBSDID("$FreeBSD$"); #include +#include "fpmath.h" #include "math.h" #include "math_private.h" -#include "fpmath.h" #define BIAS (LDBL_MAX_EXP - 1) -#define EXPMASK (BIAS + LDBL_MAX_EXP) static volatile const long double twom10000 = 0x1p-10000L, tiny = 0x1p-10000L; @@ -205,7 +204,7 @@ expl(long double x) /* Filter out exceptional cases. */ u.e = x; hx = u.xbits.expsign; - ix = hx & EXPMASK; + ix = hx & 0x7fff; if (ix >= BIAS + 13) { /* |x| >= 8192 or x is NaN */ if (ix == BIAS + LDBL_MAX_EXP) { if (u.xbits.manh != 0 Modified: head/lib/msun/ld80/s_expl.c ============================================================================== --- head/lib/msun/ld80/s_expl.c Thu Jul 26 03:50:24 2012 (r238782) +++ head/lib/msun/ld80/s_expl.c Thu Jul 26 03:59:33 2012 (r238783) @@ -45,13 +45,9 @@ __FBSDID("$FreeBSD$"); #include #endif +#include "fpmath.h" #include "math.h" -#define FPSETPREC -#ifdef NO_FPSETPREC -#undef FPSETPREC -#endif #include "math_private.h" -#include "fpmath.h" #define BIAS (LDBL_MAX_EXP - 1) From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 04:05:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6C92C106564A; Thu, 26 Jul 2012 04:05:09 +0000 (UTC) (envelope-from kargl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 575988FC08; Thu, 26 Jul 2012 04:05:09 +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 q6Q459gS033123; Thu, 26 Jul 2012 04:05:09 GMT (envelope-from kargl@svn.freebsd.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6Q459un033120; Thu, 26 Jul 2012 04:05:09 GMT (envelope-from kargl@svn.freebsd.org) Message-Id: <201207260405.q6Q459un033120@svn.freebsd.org> From: Steve Kargl Date: Thu, 26 Jul 2012 04:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238784 - in head/lib/msun: ld128 ld80 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 04:05:09 -0000 Author: kargl Date: Thu Jul 26 04:05:08 2012 New Revision: 238784 URL: http://svn.freebsd.org/changeset/base/238784 Log: Replace the macro name NUM with INTERVALS. This change provides compatibility with the INTERVALS macro used in the soon-to-be-commmitted expm1l() and someday-to-be-committed log*l() functions. Add a comment into ld128/s_expl.c noting at gcc issue that was deleted when rewriting ld80/e_expl.c as ld128/s_expl.c. Requested by: bde Approved by: das (mentor) Modified: head/lib/msun/ld128/s_expl.c head/lib/msun/ld80/s_expl.c Modified: head/lib/msun/ld128/s_expl.c ============================================================================== --- head/lib/msun/ld128/s_expl.c Thu Jul 26 03:59:33 2012 (r238783) +++ head/lib/msun/ld128/s_expl.c Thu Jul 26 04:05:08 2012 (r238784) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #define BIAS (LDBL_MAX_EXP - 1) +/* XXX Prevent gcc from erroneously constant folding this: */ static volatile const long double twom10000 = 0x1p-10000L, tiny = 0x1p-10000L; static const long double @@ -57,12 +58,12 @@ P9 = 2.755731922401038678178761995444688 P10 = 2.75573236172670046201884000197885520e-7L, P11 = 2.50517544183909126492878226167697856e-8L; -#define NUM 128 +#define INTERVALS 128 static const struct { long double hi; long double lo; -} s[NUM] = { +} s[INTERVALS] = { 0x1p0L, 0x0p0L, 0x1.0163da9fb33356d84a66aep0L, 0x3.36dcdfa4003ec04c360be2404078p-92L, 0x1.02c9a3e778060ee6f7cacap0L, 0x4.f7a29bde93d70a2cabc5cb89ba10p-92L, @@ -226,8 +227,8 @@ expl(long double x) fn = x * INV_L + 0x1.8p112 - 0x1.8p112; n = (int)fn; - n2 = (unsigned)n % NUM; /* Tang's j. */ - k = (n - n2) / NUM; + n2 = (unsigned)n % INTERVALS; /* Tang's j. */ + k = (n - n2) / INTERVALS; r1 = x - fn * L1; r2 = -fn * L2; Modified: head/lib/msun/ld80/s_expl.c ============================================================================== --- head/lib/msun/ld80/s_expl.c Thu Jul 26 03:59:33 2012 (r238783) +++ head/lib/msun/ld80/s_expl.c Thu Jul 26 04:05:08 2012 (r238784) @@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$"); * in IEEE floating-point arithmetic," ACM Trans. Math. Soft., 15, * 144-157 (1989). * - * where the 32 table entries have been expanded to NUM (see below). + * where the 32 table entries have been expanded to INTERVALS (see below). */ #include @@ -65,9 +65,9 @@ u_threshold = LD80C(0xb21dfe7f09e2baa9, static const double __aligned(64) /* - * ln2/NUM = L1+L2 (hi+lo decomposition for multiplication). L1 must have - * at least 22 (= log2(|LDBL_MIN_EXP-extras|) + log2(NUM)) lowest bits zero - * so that multiplication of it by n is exact. + * ln2/INTERVALS = L1+L2 (hi+lo decomposition for multiplication). L1 must + * have at least 22 (= log2(|LDBL_MIN_EXP-extras|) + log2(INTERVALS)) lowest + * bits zero so that multiplication of it by n is exact. */ L1 = 5.4152123484527692e-3, /* 0x162e42ff000000.0p-60 */ L2 = -3.2819649005320973e-13, /* -0x1718432a1b0e26.0p-94 */ @@ -75,7 +75,7 @@ INV_L = 1.8466496523378731e+2, /* 0x17 /* * Domain [-0.002708, 0.002708], range ~[-5.7136e-24, 5.7110e-24]: * |exp(x) - p(x)| < 2**-77.2 - * (0.002708 is ln2/(2*NUM) rounded up a little). + * (0.002708 is ln2/(2*INTERVALS) rounded up a little). */ P2 = 0.5, P3 = 1.6666666666666119e-1, /* 0x15555555555490.0p-55 */ @@ -84,16 +84,16 @@ P5 = 8.3333354987869413e-3, /* 0x1111 P6 = 1.3888891738560272e-3; /* 0x16c16c651633ae.0p-62 */ /* - * 2^(i/NUM) for i in [0,NUM] is represented by two values where the - * first 47 (?!) bits of the significand is stored in hi and the next 53 + * 2^(i/INTERVALS) for i in [0,INTERVALS] is represented by two values where + * the first 47 (?!) bits of the significand is stored in hi and the next 53 * bits are in lo. */ -#define NUM 128 +#define INTERVALS 128 static const struct { double hi; double lo; -} s[NUM] __aligned(16) = { +} s[INTERVALS] __aligned(16) = { 0x1p+0, 0x0p+0, 0x1.0163da9fb330p+0, 0x1.ab6c25335719bp-47, 0x1.02c9a3e77804p+0, 0x1.07737be56527cp-47, @@ -265,8 +265,8 @@ expl(long double x) #else n = (int)fn; #endif - n2 = (unsigned)n % NUM; /* Tang's j. */ - k = (n - n2) / NUM; + n2 = (unsigned)n % INTERVALS; /* Tang's j. */ + k = (n - n2) / INTERVALS; r1 = x - fn * L1; r2 = -fn * L2; From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 05:35:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C50A31065701; Thu, 26 Jul 2012 05:35:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9D468FC17; Thu, 26 Jul 2012 05:35:10 +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 q6Q5ZAag040227; Thu, 26 Jul 2012 05:35:10 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6Q5ZADq040224; Thu, 26 Jul 2012 05:35:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207260535.q6Q5ZADq040224@svn.freebsd.org> From: Warner Losh Date: Thu, 26 Jul 2012 05:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238785 - head/sys/arm/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 05:35:11 -0000 Author: imp Date: Thu Jul 26 05:35:10 2012 New Revision: 238785 URL: http://svn.freebsd.org/changeset/base/238785 Log: Update partitions to reflect "sam9 demo" defaults. Update i2c devices to just include the eeprom. Update dataflash chip select to be CS 1 (this doesn't work yet and needs changes to at91_spi and the spibus infrastructure). Fix typo in comment. Modified: head/sys/arm/conf/SAM9260EK head/sys/arm/conf/SAM9260EK.hints Modified: head/sys/arm/conf/SAM9260EK ============================================================================== --- head/sys/arm/conf/SAM9260EK Thu Jul 26 04:05:08 2012 (r238784) +++ head/sys/arm/conf/SAM9260EK Thu Jul 26 05:35:10 2012 (r238785) @@ -17,12 +17,12 @@ # # $FreeBSD$ -ident ETHERNUT5 +ident SAM9260EK -include "../at91/std.ethernut5" +include "../at91/std.sam9260ek" # To statically compile in device wiring instead of /boot/device.hints -hints "ETHERNUT5.hints" +hints "SAM9260EK.hints" #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols @@ -103,13 +103,13 @@ device bpf # Berkeley packet filter # Ethernet device mii # Minimal MII support -device ate # Atmel AT91 Ethernet friver +device ate # Atmel AT91 Ethernet driver # I2C device at91_twi # Atmel AT91 Two-wire Interface device iic # I2C generic I/O device driver device iicbus # I2C bus system -device pcf8563 # NXP PCF8563 clock/calendar +device icee # I2C eeprom # MMC/SD device at91_mci # Atmel AT91 Multimedia Card Interface Modified: head/sys/arm/conf/SAM9260EK.hints ============================================================================== --- head/sys/arm/conf/SAM9260EK.hints Thu Jul 26 04:05:08 2012 (r238784) +++ head/sys/arm/conf/SAM9260EK.hints Thu Jul 26 05:35:10 2012 (r238785) @@ -2,50 +2,48 @@ # Atmel AT45DB21D hint.at45d.0.at="spibus0" -hint.at45d.0.addr=0x00 -# user 132 kbytes +hint.at45d.0.cs=1 +# Area 0: 00000000 to 000041FF (RO) Bootstrap +# Area 1: 00004200 to 000083FF Environment +# Area 2: 00008400 to 00041FFF (RO) U-Boot +# Area 3: 00042000 to 00251FFF Kernel +# Area 4: 00252000 to 0083FFFF FS +# bootstrap hint.map.0.at="flash/spi0" hint.map.0.start=0x00000000 -hint.map.0.end=0x00020fff -hint.map.0.name="user" +hint.map.0.end=0x000041ff +hint.map.0.name="bootstrap" hint.map.0.readonly=1 -# setup 132 kbytes +# uboot environment hint.map.1.at="flash/spi0" -hint.map.1.start=0x00021000 -hint.map.1.end=0x00041fff -hint.map.1.name="setup" -hint.map.1.readonly=1 -# uboot 528 kbytes +hint.map.1.start=0x00004200 +hint.map.1.end=0x00083ff +hint.map.1.name="uboot-env" +#hint.map.1.readonly=1 +# uboot hint.map.2.at="flash/spi0" -hint.map.2.start=0x00042000 -hint.map.2.end=0x000c5fff +hint.map.2.start=0x00008400 +hint.map.2.end=0x00041fff hint.map.2.name="uboot" hint.map.2.readonly=1 -# kernel 2640 kbytes +# kernel hint.map.3.at="flash/spi0" -hint.map.3.start=0x000c6000 -hint.map.3.end=0x00359fff -hint.map.3.name="kernel" +hint.map.3.start=0x00042000 +hint.map.3.end=0x00251fff +hint.map.3.name="fs" #hint.map.3.readonly=1 -# nutos 528 kbytes +# fs hint.map.4.at="flash/spi0" -hint.map.4.start=0x0035a000 -hint.map.4.end=0x003ddfff -hint.map.4.name="nutos" -hint.map.4.readonly=1 -# env 132 kbytes -hint.map.5.at="flash/spi0" -hint.map.5.start=0x003de000 -hint.map.5.end=0x003fefff -hint.map.5.name="env" -hint.map.5.readonly=1 -# env 132 kbytes -hint.map.6.at="flash/spi0" -hint.map.6.start=0x003ff000 -hint.map.6.end=0x0041ffff -hint.map.6.name="nutoscfg" -hint.map.6.readonly=1 +hint.map.4.start=0x00252000 +hint.map.4.end=0x0083ffff +hint.map.4.name="fs" +#hint.map.4.readonly=1 + +# EEPROM +hint.icee.0.at="iicbus0" +hint.icee.0.addr=0xa0 +hint.icee.0.type=16 +hint.icee.0.size=65536 +hint.icee.0.rd_sz=256 +hint.icee.0.wr_sz=256 -# NXP PCF8563 clock/calendar -hint.pcf8563_rtc.0.at="iicbus0" -hint.pcf8563_rtc.0.addr=0xa2 From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 05:37:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A33AC1065670; Thu, 26 Jul 2012 05:37:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CB748FC15; Thu, 26 Jul 2012 05:37: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 q6Q5bbDN040469; Thu, 26 Jul 2012 05:37:37 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6Q5bbO6040466; Thu, 26 Jul 2012 05:37:37 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207260537.q6Q5bbO6040466@svn.freebsd.org> From: Warner Losh Date: Thu, 26 Jul 2012 05:37:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238786 - head/sys/arm/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 05:37:37 -0000 Author: imp Date: Thu Jul 26 05:37:36 2012 New Revision: 238786 URL: http://svn.freebsd.org/changeset/base/238786 Log: Fix typo in comment. spibus uses cs= rather than addr=, so fix hints to use that (nop since spibus cs defaults to 0, and at91_spi assumes 0). Modified: head/sys/arm/conf/ETHERNUT5 head/sys/arm/conf/ETHERNUT5.hints Modified: head/sys/arm/conf/ETHERNUT5 ============================================================================== --- head/sys/arm/conf/ETHERNUT5 Thu Jul 26 05:35:10 2012 (r238785) +++ head/sys/arm/conf/ETHERNUT5 Thu Jul 26 05:37:36 2012 (r238786) @@ -103,7 +103,7 @@ device bpf # Berkeley packet filter # Ethernet device mii # Minimal MII support -device ate # Atmel AT91 Ethernet friver +device ate # Atmel AT91 Ethernet driver # I2C device at91_twi # Atmel AT91 Two-wire Interface Modified: head/sys/arm/conf/ETHERNUT5.hints ============================================================================== --- head/sys/arm/conf/ETHERNUT5.hints Thu Jul 26 05:35:10 2012 (r238785) +++ head/sys/arm/conf/ETHERNUT5.hints Thu Jul 26 05:37:36 2012 (r238786) @@ -2,7 +2,7 @@ # Atmel AT45DB21D hint.at45d.0.at="spibus0" -hint.at45d.0.addr=0x00 +hint.at45d.0.cs=0 # user 132 kbytes hint.map.0.at="flash/spi0" hint.map.0.start=0x00000000 From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 05:46:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0D3731065670; Thu, 26 Jul 2012 05:46:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC7688FC0C; Thu, 26 Jul 2012 05:46:56 +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 q6Q5kuWr043255; Thu, 26 Jul 2012 05:46:56 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6Q5ku95043253; Thu, 26 Jul 2012 05:46:56 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207260546.q6Q5ku95043253@svn.freebsd.org> From: Warner Losh Date: Thu, 26 Jul 2012 05:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238787 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 05:46:57 -0000 Author: imp Date: Thu Jul 26 05:46:56 2012 New Revision: 238787 URL: http://svn.freebsd.org/changeset/base/238787 Log: Some models have 6 USARTS + DBGU. Set a consistent name. Modified: head/sys/arm/at91/uart_bus_at91usart.c Modified: head/sys/arm/at91/uart_bus_at91usart.c ============================================================================== --- head/sys/arm/at91/uart_bus_at91usart.c Thu Jul 26 05:37:36 2012 (r238786) +++ head/sys/arm/at91/uart_bus_at91usart.c Thu Jul 26 05:46:56 2012 (r238787) @@ -95,6 +95,12 @@ usart_at91_probe(device_t dev) case 4: device_set_desc(dev, "USART3"); break; + case 5: + device_set_desc(dev, "USART4"); + break; + case 6: + device_set_desc(dev, "USART5"); + break; } sc->sc_class = &at91_usart_class; if (sc->sc_class->uc_rclk == 0) From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 06:25:05 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEAEC1065689; Thu, 26 Jul 2012 06:25:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 2CFAE8FC18; Thu, 26 Jul 2012 06:25:05 +0000 (UTC) Received: from c122-106-171-246.carlnfd1.nsw.optusnet.com.au (c122-106-171-246.carlnfd1.nsw.optusnet.com.au [122.106.171.246]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q6Q6P1Fm032081 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 26 Jul 2012 16:25:02 +1000 Date: Thu, 26 Jul 2012 16:25:01 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov In-Reply-To: <20120725192351.GR2676@deviant.kiev.zoral.com.ua> Message-ID: <20120726145325.U2026@besplex.bde.org> References: <201207242210.q6OMACqV079603@svn.freebsd.org> <500F9E22.4080608@FreeBSD.org> <20120725102130.GH2676@deviant.kiev.zoral.com.ua> <20120725233033.N5406@besplex.bde.org> <20120725173212.GN2676@deviant.kiev.zoral.com.ua> <20120725192351.GR2676@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Andriy Gapon , Bruce Evans , svn-src-head@FreeBSD.org, Jim Harris Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 06:25:05 -0000 On Wed, 25 Jul 2012, Konstantin Belousov wrote: > On Wed, Jul 25, 2012 at 11:00:41AM -0700, Jim Harris wrote: >> On Wed, Jul 25, 2012 at 10:32 AM, Konstantin Belousov >> wrote: >>> I also asked Jim to test whether the cause the TSC sync test failure >>> is the lack of synchronization between gathering data and tasting it, >>> but ut appeared that the reason is genuine timecounter value going >>> backward. >> >> I wonder if instead of timecounter going backward, that TSC test >> fails because CPU speculatively performs rdtsc instruction in relation >> to waiter checks in smp_rendezvous_action. Or maybe we are saying >> the same thing. > > Ok, the definition of the 'timecounter goes back', as I understand it: > > you have two events A and B in two threads, provable ordered, say, A is > a lock release and B is the same lock acquisition. Assume that you take > rdtsc values tA and tB under the scope of the lock right before A and > right after B. Then it should be impossible to have tA > tB. For the threaded case, there has to something for the accesses to be provably ordered. It is hard to see how the something can be strong enough unless it serializes all thread state in A and B. The rdtsc state is not part of the thread state as know to APIs, but it is hard to see how threads can serialize themselves without also serializing the TSC. For most uses, the scope of the serialization and locking also needs to extend across multiple timer reads. Otherwise you can have situations like: read the time interrupt or context switch read later time in other intr handler/thread save late time back to previous context save earlier time It is unclear how to even prevent such situations. You (at least, I) don't want heavyweight locking/synchronization to prevent the context switches. And the kernel rarely if ever does such synchronization. binuptime() has none internally. It just spins if necessary until the read becomes stable. Most callers of binuptime() just call it. > I do not think that we can ever observe tA > tB if both threads are > executing on the same CPU. I thought that that was the problem, with a single thread and no context switches seeing the TSC go backwards. Even then, it would take non-useful behaviour (except for calibration and benchmarks) like spinning executing rdtsc to see it going backwards. Normally there are many instructions between rdtsc's and the non-serialization isn't as deep as that. Using syscalls, you just can't read the timecounter without about 1000 cycles between reads. When there is a context switch, there is usually accidental serialization from locking. I care about timestamps being ordered more than most people, and tried to kill the get*time() APIs because they are weakly ordered relative to the non-get variants (they return times in the past, and there is no way to round down to get consistent times). I tried to fix them by adding locking and updating them to the latest time whenever a non-get variant gives a later time (by being used). This was too slow, and breaks the design criteria that timecounter calls should not use any explicit locking. However, if you want slowness, then you can get it similarly by fixing the monotonicity of rdtsc in software. I think I just figured out how to do this with the same slowness as serialization, if a locked instruction serialzes; maybe less otherwise: spin: ptsc = prev_tsc; /* memory -> local (intentionally !atomic) */ tsc = rdtsc(); /* only 32 bits for timecounters */ if (tsc <= ptsc) { /* I forgot about wrap at first -- see below */ /* * It went backwards, or stopped. Could handle more * completely, starting with panic() to see if this * happens at all. */ return (ptsc); /* stopped is better than backwards */ } /* Usual case; update (32 bits). */ if (atomic_cmpset_int(&prev_tsc, ptsc, tsc)) return (tsc); goto spin; The 32-bitness of timecounters is important for the algorithm, and for efficiency on i386. We assume that the !atomic read gives coherent bits. The value may be in the past. When tsc <= ptsc, the value is in the future, so value must be up to date, unless there is massive non-seriality with another CPU having just written a value more up to date than this CPU read. We don't care about this, since losing this race is no different from being preempted after we read. When tsc > ptsc, we want to write it as 32 bits to avoid the cmpxchg8b slowness/unportability. Again, the value may be out of date when we try to update it, because we were preempted. We don't care about this either, as above, but detected some cases as a side effect of checking that ptsc is up to date. Normally ptsc was up to date when it was read, but it could easly be out of date when it was checked by the cmpset, iff another CPU updated it. This would enforce monotonicity across multiple CPUs even if their TSCs are very unsynchronized, but you wouldn't want it much then. But if they are synchronized to within the serialization time or the 1< Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0046B106566B; Thu, 26 Jul 2012 07:35:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail27.syd.optusnet.com.au (mail27.syd.optusnet.com.au [211.29.133.168]) by mx1.freebsd.org (Postfix) with ESMTP id 8199D8FC08; Thu, 26 Jul 2012 07:35:34 +0000 (UTC) Received: from c122-106-171-246.carlnfd1.nsw.optusnet.com.au (c122-106-171-246.carlnfd1.nsw.optusnet.com.au [122.106.171.246]) by mail27.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q6Q7ZNeh025069 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 26 Jul 2012 17:35:25 +1000 Date: Thu, 26 Jul 2012 17:35:23 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jung-uk Kim In-Reply-To: <50103C61.8040904@FreeBSD.org> Message-ID: <20120726170837.Q2536@besplex.bde.org> References: <201207242210.q6OMACqV079603@svn.freebsd.org> <500F9E22.4080608@FreeBSD.org> <20120725102130.GH2676@deviant.kiev.zoral.com.ua> <500FE6AE.8070706@FreeBSD.org> <20120726001659.M5406@besplex.bde.org> <50102C94.9030706@FreeBSD.org> <20120725180537.GO2676@deviant.kiev.zoral.com.ua> <50103C61.8040904@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Jim Harris , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Andriy Gapon , svn-src-head@FreeBSD.org, Bruce Evans , Konstantin Belousov Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 07:35:35 -0000 On Wed, 25 Jul 2012, Jung-uk Kim wrote: > On 2012-07-25 14:05:37 -0400, Konstantin Belousov wrote: >>> Since we have gettimeofday() in userland, the above Linux thread >>> is more relevant now, I guess. Indeed. syscalls put squillions of instructions between. Maybe even a serialization instruction. >> For some unrelated reasons, we do have lfence;rdtsc sequence in >> the userland already. Well, it is not exactly such sequence, there >> are some instructions between, but the main fact is that two >> consequtive invocations of gettimeofday(2) (*) or clock_gettime(2) >> are interleaved with lfence on Intels, guaranteeing that backstep >> of the counter is impossible. In fact, there is always a full documented serialization instruction for syscalls, except maybe in FreeBSD-1 compat code on i386, at least on Athlon64. i386 syscalls use int 0x80 (except in FreeBSD-1 compat code they use lcalls, and the iret necessary to return from this is serializing on at least Athlon64. amd64 syscalls use sysenter/sysret. sysret isn't serializing (like far returns), at least on Athlon64, but at least in FreeBSD, the syscall implementation uses at least 2 swapgs's (one on entry and one just before the sysret), and swapgs is serializing, at least on Athlon64. >> * - it is not a syscall anymore. >> >> As I said, using recommended mfence;rdtsc sequence for AMDs would >> require some work, but lets handle the kernel and userspace issues >> separately. Benchmarks for various methods on AthlonXP: I started with a program that loops making a fe million clock_gettime() calls: unchanged program: 1.15 seconds add lfence: 1.16 seconds add mfence: 1.15 seconds (yes, faster than mfence) add atomic_cmpset: 1.20 seconds add cpuid: 1.25 seconds >> And, I really failed to find what the patch from the thread you >> referenced tried to fix. > > The patch was supposed to reduce a barrier, i.e., vsyscall > optimization. Please note I brought it up at the time, not because it > fixed any problem but because we completely lack necessary serialization. > >> Was it really committed into Linux ? > > Yes, it was committed in a simpler form: > > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=057e6a8c660e95c3f4e7162e00e2fee1fc90c50d > > This function was moved around from time to time and now it sits here: > > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob_plain;f=arch/x86/vdso/vclock_gettime.c > > It still carries one barrier before rdtsc. Please see the comments. For safety, you probably need to use the slowest (cpuid) method. Linux seems to be just using fences that are observed to work. Original Athlon64 manuals say this about rdtsc: "... not serializing... even when bound by serializing instructions, the system environment at the time the instruction is executed can cause additional cycles [before it reaches EDX:EAX]". With multiple CPUs, the hardware would have to be smarter and might need more or different serialization instructions so that these additional cycles don't break monotonicity across all CPUs. >> I see actual problem of us allowing timecounters going back, and a >> solution that exactly follows words of both Intel and AMD >> documentation. This is good one step forward IMHO. > > I agree with you here. Correctness outweighs performance, IMHO. Use an i8254 then :-). Bruce From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 08:01:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 023E6106566B; Thu, 26 Jul 2012 08:01:25 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBD788FC0A; Thu, 26 Jul 2012 08:01:25 +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 q6Q81PfZ054620; Thu, 26 Jul 2012 08:01:25 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6Q81PHx054611; Thu, 26 Jul 2012 08:01:25 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201207260801.q6Q81PHx054611@svn.freebsd.org> From: Andrew Turner Date: Thu, 26 Jul 2012 08:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238788 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 08:01:26 -0000 Author: andrew Date: Thu Jul 26 08:01:25 2012 New Revision: 238788 URL: http://svn.freebsd.org/changeset/base/238788 Log: Add support for the Atmel AT91SAM9G45 CPU. Reviewed by: imp Added: head/sys/arm/at91/at91_pio_sam9g45.h (contents, props changed) head/sys/arm/at91/at91sam9g45.c (contents, props changed) head/sys/arm/at91/at91sam9g45reg.h (contents, props changed) head/sys/arm/at91/std.at91sam9g45 (contents, props changed) Modified: head/sys/arm/at91/at91_machdep.c head/sys/arm/at91/at91_pmc.c head/sys/arm/at91/at91_pmcreg.h head/sys/arm/at91/files.at91 Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Thu Jul 26 05:46:56 2012 (r238787) +++ head/sys/arm/at91/at91_machdep.c Thu Jul 26 08:01:25 2012 (r238788) @@ -94,6 +94,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* Page table for mapping proc0 zero page */ #define KERNEL_PT_SYS 0 @@ -201,6 +202,17 @@ const struct pmap_devmap at91_devmap[] = VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, + /* + * The next should be good for the 9G45. + */ + { + /* Internal Memory 1MB */ + AT91SAM9G45_OHCI_BASE, + AT91SAM9G45_OHCI_PA_BASE, + 0x00100000, + VM_PROT_READ|VM_PROT_WRITE, + PTE_NOCACHE, + }, { 0, 0, 0, 0, 0, } }; @@ -213,7 +225,7 @@ extern int memsize[]; long at91_ramsize(void) { - uint32_t cr, mr, *SDRAMC; + uint32_t cr, mdr, mr, *SDRAMC; int banks, rows, cols, bw; #ifdef LINUX_BOOT_ABI /* @@ -231,6 +243,24 @@ at91_ramsize(void) rows = ((cr & AT91RM92_SDRAMC_CR_NR_MASK) >> 2) + 11; cols = (cr & AT91RM92_SDRAMC_CR_NC_MASK) + 8; bw = (mr & AT91RM92_SDRAMC_MR_DBW_16) ? 1 : 2; + } else if (at91_cpu_is(AT91_T_SAM9G45)) { + SDRAMC = (uint32_t *)(AT91_BASE + AT91SAM9G45_DDRSDRC0_BASE); + cr = SDRAMC[AT91SAM9G45_DDRSDRC_CR / 4]; + mdr = SDRAMC[AT91SAM9G45_DDRSDRC_MDR / 4]; + banks = 0; + rows = ((cr & AT91SAM9G45_DDRSDRC_CR_NR_MASK) >> 2) + 11; + cols = (cr & AT91SAM9G45_DDRSDRC_CR_NC_MASK) + 8; + bw = (mdr & AT91SAM9G45_DDRSDRC_MDR_DBW_16) ? 1 : 2; + + /* Fix the calculation for DDR memory */ + mdr &= AT91SAM9G45_DDRSDRC_MDR_MASK; + if (mdr & AT91SAM9G45_DDRSDRC_MDR_LPDDR1 || + mdr & AT91SAM9G45_DDRSDRC_MDR_DDR2) { + /* The cols value is 1 higher for DDR */ + cols += 1; + /* DDR has 4 internal banks. */ + banks = 2; + } } else { /* * This should be good for the 9260, 9261, 9G20, 9G35 and 9X25 Added: head/sys/arm/at91/at91_pio_sam9g45.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/at91_pio_sam9g45.h Thu Jul 26 08:01:25 2012 (r238788) @@ -0,0 +1,272 @@ +/*- + * ---------------------------------------------------------------------------- + * ATMEL Microcontroller Software Support - ROUSSET - + * ---------------------------------------------------------------------------- + * Copyright (c) 2009, Atmel Corporation + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL 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 AT91LIB version 1.9 boards/at91sam9g45-ek/at91sam9g45/AT91SAM9G45.h + */ + +/* $FreeBSD$ */ + +#ifndef ARM_AT91_AT91_PIO_SAM9G45_H +#define ARM_AT91_AT91_PIO_SAM9G45_H + +#include + +// ***************************************************************************** +// PIO DEFINITIONS FOR AT91SAM9G45 +// ***************************************************************************** +#define AT91C_PA0_MCI0_CK (AT91C_PIO_PA0) // +#define AT91C_PA0_TCLK3 (AT91C_PIO_PA0) // +#define AT91C_PA1_MCI0_CDA (AT91C_PIO_PA1) // +#define AT91C_PA1_TIOA3 (AT91C_PIO_PA1) // +#define AT91C_PA10_ETX0 (AT91C_PIO_PA10) // Ethernet MAC Transmit Data 0 +#define AT91C_PA11_ETX1 (AT91C_PIO_PA11) // Ethernet MAC Transmit Data 1 +#define AT91C_PA12_ERX0 (AT91C_PIO_PA12) // Ethernet MAC Receive Data 0 +#define AT91C_PA13_ERX1 (AT91C_PIO_PA13) // Ethernet MAC Receive Data 1 +#define AT91C_PA14_ETXEN (AT91C_PIO_PA14) // Ethernet MAC Transmit Enable +#define AT91C_PA15_ERXDV (AT91C_PIO_PA15) // Ethernet MAC Receive Data Valid +#define AT91C_PA16_ERXER (AT91C_PIO_PA16) // Ethernet MAC Receive Error +#define AT91C_PA17_ETXCK_EREFCK (AT91C_PIO_PA17) // Ethernet MAC Transmit Clock/Reference Clock +#define AT91C_PA18_EMDC (AT91C_PIO_PA18) // Ethernet MAC Management Data Clock +#define AT91C_PA19_EMDIO (AT91C_PIO_PA19) // Ethernet MAC Management Data Input/Output +#define AT91C_PA2_MCI0_DA0 (AT91C_PIO_PA2) // +#define AT91C_PA2_TIOB3 (AT91C_PIO_PA2) // +#define AT91C_PA20_TWD0 (AT91C_PIO_PA20) // TWI Two-wire Serial Data +#define AT91C_PA21_TWCK0 (AT91C_PIO_PA21) // TWI Two-wire Serial Clock +#define AT91C_PA22_MCI1_CDA (AT91C_PIO_PA22) // +#define AT91C_PA22_SCK3 (AT91C_PIO_PA22) // +#define AT91C_PA23_MCI1_DA0 (AT91C_PIO_PA23) // +#define AT91C_PA23_RTS3 (AT91C_PIO_PA23) // +#define AT91C_PA24_MCI1_DA1 (AT91C_PIO_PA24) // +#define AT91C_PA24_CTS3 (AT91C_PIO_PA24) // +#define AT91C_PA25_MCI1_DA2 (AT91C_PIO_PA25) // +#define AT91C_PA25_PWM3 (AT91C_PIO_PA25) // +#define AT91C_PA26_MCI1_DA3 (AT91C_PIO_PA26) // +#define AT91C_PA26_TIOB2 (AT91C_PIO_PA26) // +#define AT91C_PA27_MCI1_DA4 (AT91C_PIO_PA27) // +#define AT91C_PA27_ETXER (AT91C_PIO_PA27) // Ethernet MAC Transmikt Coding Error +#define AT91C_PA28_MCI1_DA5 (AT91C_PIO_PA28) // +#define AT91C_PA28_ERXCK (AT91C_PIO_PA28) // Ethernet MAC Receive Clock +#define AT91C_PA29_MCI1_DA6 (AT91C_PIO_PA29) // +#define AT91C_PA29_ECRS (AT91C_PIO_PA29) // Ethernet MAC Carrier Sense/Carrier Sense and Data Valid +#define AT91C_PA3_MCI0_DA1 (AT91C_PIO_PA3) // +#define AT91C_PA3_TCLK4 (AT91C_PIO_PA3) // +#define AT91C_PA30_MCI1_DA7 (AT91C_PIO_PA30) // +#define AT91C_PA30_ECOL (AT91C_PIO_PA30) // Ethernet MAC Collision Detected +#define AT91C_PA31_MCI1_CK (AT91C_PIO_PA31) // +#define AT91C_PA31_PCK0 (AT91C_PIO_PA31) // +#define AT91C_PA4_MCI0_DA2 (AT91C_PIO_PA4) // +#define AT91C_PA4_TIOA4 (AT91C_PIO_PA4) // +#define AT91C_PA5_MCI0_DA3 (AT91C_PIO_PA5) // +#define AT91C_PA5_TIOB4 (AT91C_PIO_PA5) // +#define AT91C_PA6_MCI0_DA4 (AT91C_PIO_PA6) // +#define AT91C_PA6_ETX2 (AT91C_PIO_PA6) // Ethernet MAC Transmit Data 2 +#define AT91C_PA7_MCI0_DA5 (AT91C_PIO_PA7) // +#define AT91C_PA7_ETX3 (AT91C_PIO_PA7) // Ethernet MAC Transmit Data 3 +#define AT91C_PA8_MCI0_DA6 (AT91C_PIO_PA8) // +#define AT91C_PA8_ERX2 (AT91C_PIO_PA8) // Ethernet MAC Receive Data 2 +#define AT91C_PA9_MCI0_DA7 (AT91C_PIO_PA9) // +#define AT91C_PA9_ERX3 (AT91C_PIO_PA9) // Ethernet MAC Receive Data 3 +#define AT91C_PB0_SPI0_MISO (AT91C_PIO_PB0) // SPI 0 Master In Slave +#define AT91C_PB1_SPI0_MOSI (AT91C_PIO_PB1) // SPI 0 Master Out Slave +#define AT91C_PB10_TWD1 (AT91C_PIO_PB10) // +#define AT91C_PB10_ISI_D10 (AT91C_PIO_PB10) // +#define AT91C_PB11_TWCK1 (AT91C_PIO_PB11) // +#define AT91C_PB11_ISI_D11 (AT91C_PIO_PB11) // +#define AT91C_PB12_DRXD (AT91C_PIO_PB12) // +#define AT91C_PB13_DTXD (AT91C_PIO_PB13) // +#define AT91C_PB14_SPI1_MISO (AT91C_PIO_PB14) // +#define AT91C_PB15_SPI1_MOSI (AT91C_PIO_PB15) // +#define AT91C_PB15_CTS0 (AT91C_PIO_PB15) // +#define AT91C_PB16_SPI1_SPCK (AT91C_PIO_PB16) // +#define AT91C_PB16_SCK0 (AT91C_PIO_PB16) // +#define AT91C_PB17_SPI1_NPCS0 (AT91C_PIO_PB17) // +#define AT91C_PB17_RTS0 (AT91C_PIO_PB17) // +#define AT91C_PB18_RXD0 (AT91C_PIO_PB18) // +#define AT91C_PB18_SPI0_NPCS1 (AT91C_PIO_PB18) // +#define AT91C_PB19_TXD0 (AT91C_PIO_PB19) // +#define AT91C_PB19_SPI0_NPCS2 (AT91C_PIO_PB19) // +#define AT91C_PB2_SPI0_SPCK (AT91C_PIO_PB2) // SPI 0 Serial Clock +#define AT91C_PB20_ISI_D0 (AT91C_PIO_PB20) // +#define AT91C_PB21_ISI_D1 (AT91C_PIO_PB21) // +#define AT91C_PB22_ISI_D2 (AT91C_PIO_PB22) // +#define AT91C_PB23_ISI_D3 (AT91C_PIO_PB23) // +#define AT91C_PB24_ISI_D4 (AT91C_PIO_PB24) // +#define AT91C_PB25_ISI_D5 (AT91C_PIO_PB25) // +#define AT91C_PB26_ISI_D6 (AT91C_PIO_PB26) // +#define AT91C_PB27_ISI_D7 (AT91C_PIO_PB27) // +#define AT91C_PB28_ISI_PCK (AT91C_PIO_PB28) // +#define AT91C_PB29_ISI_VSYNC (AT91C_PIO_PB29) // +#define AT91C_PB3_SPI0_NPCS0 (AT91C_PIO_PB3) // SPI 0 Peripheral Chip Select 0 +#define AT91C_PB30_ISI_HSYNC (AT91C_PIO_PB30) // +#define AT91C_PB31_ (AT91C_PIO_PB31) // +#define AT91C_PB31_PCK1 (AT91C_PIO_PB31) // +#define AT91C_PB4_TXD1 (AT91C_PIO_PB4) // USART 1 Transmit Data +#define AT91C_PB5_RXD1 (AT91C_PIO_PB5) // USART 1 Receive Data +#define AT91C_PB6_TXD2 (AT91C_PIO_PB6) // USART 2 Transmit Data +#define AT91C_PB7_RXD2 (AT91C_PIO_PB7) // USART 2 Receive Data +#define AT91C_PB8_TXD3 (AT91C_PIO_PB8) // USART 3 Transmit Data +#define AT91C_PB8_ISI_D8 (AT91C_PIO_PB8) // +#define AT91C_PB9_RXD3 (AT91C_PIO_PB9) // USART 3 Receive Data +#define AT91C_PB9_ISI_D9 (AT91C_PIO_PB9) // +#define AT91C_PC0_DQM2 (AT91C_PIO_PC0) // DQM2 +#define AT91C_PC1_DQM3 (AT91C_PIO_PC1) // DQM3 +#define AT91C_PC10_NCS4_CFCS0 (AT91C_PIO_PC10) // +#define AT91C_PC10_TCLK2 (AT91C_PIO_PC10) // +#define AT91C_PC11_NCS5_CFCS1 (AT91C_PIO_PC11) // +#define AT91C_PC11_CTS2 (AT91C_PIO_PC11) // +#define AT91C_PC12_A25_CFRNW (AT91C_PIO_PC12) // +#define AT91C_PC13_NCS2 (AT91C_PIO_PC13) // +#define AT91C_PC14_NCS3_NANDCS (AT91C_PIO_PC14) // +#define AT91C_PC15_NWAIT (AT91C_PIO_PC15) // +#define AT91C_PC16_D16 (AT91C_PIO_PC16) // +#define AT91C_PC17_D17 (AT91C_PIO_PC17) // +#define AT91C_PC18_D18 (AT91C_PIO_PC18) // +#define AT91C_PC19_D19 (AT91C_PIO_PC19) // +#define AT91C_PC2_A19 (AT91C_PIO_PC2) // +#define AT91C_PC20_D20 (AT91C_PIO_PC20) // +#define AT91C_PC21_D21 (AT91C_PIO_PC21) // +#define AT91C_PC22_D22 (AT91C_PIO_PC22) // +#define AT91C_PC23_D23 (AT91C_PIO_PC23) // +#define AT91C_PC24_D24 (AT91C_PIO_PC24) // +#define AT91C_PC25_D25 (AT91C_PIO_PC25) // +#define AT91C_PC26_D26 (AT91C_PIO_PC26) // +#define AT91C_PC27_D27 (AT91C_PIO_PC27) // +#define AT91C_PC28_D28 (AT91C_PIO_PC28) // +#define AT91C_PC29_D29 (AT91C_PIO_PC29) // +#define AT91C_PC3_A20 (AT91C_PIO_PC3) // +#define AT91C_PC30_D30 (AT91C_PIO_PC30) // +#define AT91C_PC31_D31 (AT91C_PIO_PC31) // +#define AT91C_PC4_A21_NANDALE (AT91C_PIO_PC4) // +#define AT91C_PC5_A22_NANDCLE (AT91C_PIO_PC5) // +#define AT91C_PC6_A23 (AT91C_PIO_PC6) // +#define AT91C_PC7_A24 (AT91C_PIO_PC7) // +#define AT91C_PC8_CFCE1 (AT91C_PIO_PC8) // +#define AT91C_PC9_CFCE2 (AT91C_PIO_PC9) // +#define AT91C_PC9_RTS2 (AT91C_PIO_PC9) // +#define AT91C_PD0_TK0 (AT91C_PIO_PD0) // +#define AT91C_PD0_PWM3 (AT91C_PIO_PD0) // +#define AT91C_PD1_TF0 (AT91C_PIO_PD1) // +#define AT91C_PD10_TD1 (AT91C_PIO_PD10) // +#define AT91C_PD11_RD1 (AT91C_PIO_PD11) // +#define AT91C_PD12_TK1 (AT91C_PIO_PD12) // +#define AT91C_PD12_PCK0 (AT91C_PIO_PD12) // +#define AT91C_PD13_RK1 (AT91C_PIO_PD13) // +#define AT91C_PD14_TF1 (AT91C_PIO_PD14) // +#define AT91C_PD15_RF1 (AT91C_PIO_PD15) // +#define AT91C_PD16_RTS1 (AT91C_PIO_PD16) // +#define AT91C_PD17_CTS1 (AT91C_PIO_PD17) // +#define AT91C_PD18_SPI1_NPCS2 (AT91C_PIO_PD18) // +#define AT91C_PD18_IRQ (AT91C_PIO_PD18) // +#define AT91C_PD19_SPI1_NPCS3 (AT91C_PIO_PD19) // +#define AT91C_PD19_FIQ (AT91C_PIO_PD19) // +#define AT91C_PD2_TD0 (AT91C_PIO_PD2) // +#define AT91C_PD20_TIOA0 (AT91C_PIO_PD20) // +#define AT91C_PD21_TIOA1 (AT91C_PIO_PD21) // +#define AT91C_PD22_TIOA2 (AT91C_PIO_PD22) // +#define AT91C_PD23_TCLK0 (AT91C_PIO_PD23) // +#define AT91C_PD24_SPI0_NPCS1 (AT91C_PIO_PD24) // +#define AT91C_PD24_PWM0 (AT91C_PIO_PD24) // +#define AT91C_PD25_SPI0_NPCS2 (AT91C_PIO_PD25) // +#define AT91C_PD25_PWM1 (AT91C_PIO_PD25) // +#define AT91C_PD26_PCK0 (AT91C_PIO_PD26) // +#define AT91C_PD26_PWM2 (AT91C_PIO_PD26) // +#define AT91C_PD27_PCK1 (AT91C_PIO_PD27) // +#define AT91C_PD27_SPI0_NPCS3 (AT91C_PIO_PD27) // +#define AT91C_PD28_TSADTRG (AT91C_PIO_PD28) // +#define AT91C_PD28_SPI1_NPCS1 (AT91C_PIO_PD28) // +#define AT91C_PD29_TCLK1 (AT91C_PIO_PD29) // +#define AT91C_PD29_SCK1 (AT91C_PIO_PD29) // +#define AT91C_PD3_RD0 (AT91C_PIO_PD3) // +#define AT91C_PD30_TIOB0 (AT91C_PIO_PD30) // +#define AT91C_PD30_SCK2 (AT91C_PIO_PD30) // +#define AT91C_PD31_TIOB1 (AT91C_PIO_PD31) // +#define AT91C_PD31_PWM1 (AT91C_PIO_PD31) // +#define AT91C_PD4_RK0 (AT91C_PIO_PD4) // +#define AT91C_PD5_RF0 (AT91C_PIO_PD5) // +#define AT91C_PD6_AC97RX (AT91C_PIO_PD6) // +#define AT91C_PD7_AC97TX (AT91C_PIO_PD7) // +#define AT91C_PD7_TIOA5 (AT91C_PIO_PD7) // +#define AT91C_PD8_AC97FS (AT91C_PIO_PD8) // +#define AT91C_PD8_TIOB5 (AT91C_PIO_PD8) // +#define AT91C_PD9_AC97CK (AT91C_PIO_PD9) // +#define AT91C_PD9_TCLK5 (AT91C_PIO_PD9) // +#define AT91C_PE0_LCDPWR (AT91C_PIO_PE0) // +#define AT91C_PE0_PCK0 (AT91C_PIO_PE0) // +#define AT91C_PE1_LCDMOD (AT91C_PIO_PE1) // +#define AT91C_PE10_LCDD3 (AT91C_PIO_PE10) // +#define AT91C_PE10_LCDD5 (AT91C_PIO_PE10) // +#define AT91C_PE11_LCDD4 (AT91C_PIO_PE11) // +#define AT91C_PE11_LCDD6 (AT91C_PIO_PE11) // +#define AT91C_PE12_LCDD5 (AT91C_PIO_PE12) // +#define AT91C_PE12_LCDD7 (AT91C_PIO_PE12) // +#define AT91C_PE13_LCDD6 (AT91C_PIO_PE13) // +#define AT91C_PE13_LCDD10 (AT91C_PIO_PE13) // +#define AT91C_PE14_LCDD7 (AT91C_PIO_PE14) // +#define AT91C_PE14_LCDD11 (AT91C_PIO_PE14) // +#define AT91C_PE15_LCDD8 (AT91C_PIO_PE15) // +#define AT91C_PE15_LCDD12 (AT91C_PIO_PE15) // +#define AT91C_PE16_LCDD9 (AT91C_PIO_PE16) // +#define AT91C_PE16_LCDD13 (AT91C_PIO_PE16) // +#define AT91C_PE17_LCDD10 (AT91C_PIO_PE17) // +#define AT91C_PE17_LCDD14 (AT91C_PIO_PE17) // +#define AT91C_PE18_LCDD11 (AT91C_PIO_PE18) // +#define AT91C_PE18_LCDD15 (AT91C_PIO_PE18) // +#define AT91C_PE19_LCDD12 (AT91C_PIO_PE19) // +#define AT91C_PE19_LCDD18 (AT91C_PIO_PE19) // +#define AT91C_PE2_LCDCC (AT91C_PIO_PE2) // +#define AT91C_PE20_LCDD13 (AT91C_PIO_PE20) // +#define AT91C_PE20_LCDD19 (AT91C_PIO_PE20) // +#define AT91C_PE21_LCDD14 (AT91C_PIO_PE21) // +#define AT91C_PE21_LCDD20 (AT91C_PIO_PE21) // +#define AT91C_PE22_LCDD15 (AT91C_PIO_PE22) // +#define AT91C_PE22_LCDD21 (AT91C_PIO_PE22) // +#define AT91C_PE23_LCDD16 (AT91C_PIO_PE23) // +#define AT91C_PE23_LCDD22 (AT91C_PIO_PE23) // +#define AT91C_PE24_LCDD17 (AT91C_PIO_PE24) // +#define AT91C_PE24_LCDD23 (AT91C_PIO_PE24) // +#define AT91C_PE25_LCDD18 (AT91C_PIO_PE25) // +#define AT91C_PE26_LCDD19 (AT91C_PIO_PE26) // +#define AT91C_PE27_LCDD20 (AT91C_PIO_PE27) // +#define AT91C_PE28_LCDD21 (AT91C_PIO_PE28) // +#define AT91C_PE29_LCDD22 (AT91C_PIO_PE29) // +#define AT91C_PE3_LCDVSYNC (AT91C_PIO_PE3) // +#define AT91C_PE30_LCDD23 (AT91C_PIO_PE30) // +#define AT91C_PE31_PWM2 (AT91C_PIO_PE31) // +#define AT91C_PE31_PCK1 (AT91C_PIO_PE31) // +#define AT91C_PE4_LCDHSYNC (AT91C_PIO_PE4) // +#define AT91C_PE5_LCDDOTCK (AT91C_PIO_PE5) // +#define AT91C_PE6_LCDDEN (AT91C_PIO_PE6) // +#define AT91C_PE7_LCDD0 (AT91C_PIO_PE7) // +#define AT91C_PE7_LCDD2 (AT91C_PIO_PE7) // +#define AT91C_PE8_LCDD1 (AT91C_PIO_PE8) // +#define AT91C_PE8_LCDD3 (AT91C_PIO_PE8) // +#define AT91C_PE9_LCDD2 (AT91C_PIO_PE9) // +#define AT91C_PE9_LCDD4 (AT91C_PIO_PE9) // + +#endif /* ARM_AT91_AT91_PIO_SAM9G45_H */ Modified: head/sys/arm/at91/at91_pmc.c ============================================================================== --- head/sys/arm/at91/at91_pmc.c Thu Jul 26 05:46:56 2012 (r238787) +++ head/sys/arm/at91/at91_pmc.c Thu Jul 26 08:01:25 2012 (r238788) @@ -65,6 +65,7 @@ MALLOC_DEFINE(M_PMC, "at91_pmc_clocks", #define AT91_PMC_BASE 0xffffc00 static void at91_pmc_set_pllb_mode(struct at91_pmc_clock *, int); +static void at91_pmc_set_upll_mode(struct at91_pmc_clock *, int); static void at91_pmc_set_sys_mode(struct at91_pmc_clock *, int); static void at91_pmc_set_periph_mode(struct at91_pmc_clock *, int); static void at91_pmc_clock_alias(const char *name, const char *alias); @@ -110,6 +111,18 @@ static struct at91_pmc_clock pllb = { .set_mode = &at91_pmc_set_pllb_mode, }; +/* Used by USB on at91sam9g45 */ +static struct at91_pmc_clock upll = { + .name = "upll", // UTMI PLL, used for USB functions on 9G45 + .parent = &main_ck, + .refcnt = 0, + .id = 0, + .primary = 1, + .pll = 1, + .pmc_mask = (1 << 6), + .set_mode = &at91_pmc_set_upll_mode, +}; + static struct at91_pmc_clock udpck = { .name = "udpck", .parent = &pllb, @@ -143,6 +156,7 @@ static struct at91_pmc_clock *clock_list &main_ck, &plla, &pllb, + &upll, &udpck, &uhpck, &mck, @@ -199,6 +213,26 @@ at91_pmc_set_pllb_mode(struct at91_pmc_c } static void +at91_pmc_set_upll_mode(struct at91_pmc_clock *clk, int on) +{ + struct at91_pmc_softc *sc = pmc_softc; + uint32_t value; + + if (on) { + on = PMC_IER_LOCKU; + value = CKGR_UCKR_UPLLEN | CKGR_UCKR_BIASEN; + } else + value = 0; + + WR4(sc, CKGR_UCKR, RD4(sc, CKGR_UCKR) | value); + while ((RD4(sc, PMC_SR) & PMC_IER_LOCKU) != on) + continue; + + WR4(sc, PMC_USB, PMC_USB_USBDIV(9) | PMC_USB_USBS); + WR4(sc, PMC_SCER, PMC_SCER_UHP_SAM9); +} + +static void at91_pmc_set_sys_mode(struct at91_pmc_clock *clk, int on) { struct at91_pmc_softc *sc = pmc_softc; @@ -466,6 +500,12 @@ at91_pmc_init_clock(void) uhpck.pmc_mask = PMC_SCER_UHP_SAM9; udpck.pmc_mask = PMC_SCER_UDP_SAM9; } + /* There is no pllb on AT91SAM9G45 */ + if (at91_cpu_is(AT91_T_SAM9G45)) { + uhpck.parent = &upll; + uhpck.pmc_mask = PMC_SCER_UHP_SAM9; + } + mckr = RD4(sc, PMC_MCKR); main_ck.hz = main_clock; @@ -506,8 +546,14 @@ at91_pmc_init_clock(void) mdiv = (mckr & PMC_MCKR_MDIV_MASK) >> 8; if (at91_is_sam9() || at91_is_sam9xe()) { + /* + * On AT91SAM9G45 when mdiv == 3 we need to divide + * MCK by 3 but not, for example, on 9g20. + */ + if (!at91_cpu_is(AT91_T_SAM9G45) || mdiv <= 2) + mdiv *= 2; if (mdiv > 0) - mck.hz /= mdiv * 2; + mck.hz /= mdiv; } else mck.hz /= (1 + mdiv); Modified: head/sys/arm/at91/at91_pmcreg.h ============================================================================== --- head/sys/arm/at91/at91_pmcreg.h Thu Jul 26 05:46:56 2012 (r238787) +++ head/sys/arm/at91/at91_pmcreg.h Thu Jul 26 08:01:25 2012 (r238788) @@ -36,14 +36,14 @@ #define PMC_PCER 0x10 /* Peripheral Clock Enable Register */ #define PMC_PCDR 0x14 /* Peripheral Clock Disable Register */ #define PMC_PCSR 0x18 /* Peripheral Clock Status Register */ - /* 0x1c reserved */ +#define CKGR_UCKR 0x1c /* UTMI Clock Configuration Register */ #define CKGR_MOR 0x20 /* Main Oscillator Register */ #define CKGR_MCFR 0x24 /* Main Clock Frequency Register */ #define CKGR_PLLAR 0x28 /* PLL A Register */ #define CKGR_PLLBR 0x2c /* PLL B Register */ #define PMC_MCKR 0x30 /* Master Clock Register */ /* 0x34 reserved */ - /* 0x38 reserved */ +#define PMC_USB 0x38 /* USB Clock Register */ /* 0x3c reserved */ #define PMC_PCK0 0x40 /* Programmable Clock 0 Register */ #define PMC_PCK1 0x44 /* Programmable Clock 1 Register */ @@ -77,6 +77,10 @@ /* PMC Peripheral Clock Status Register */ /* Each bit here is 1 << peripheral number to enable/disable/status */ +/* PMC UTMI Clock Configuration Register */ +#define CKGR_UCKR_BIASEN (1UL << 24) +#define CKGR_UCKR_UPLLEN (1UL << 16) + /* PMC Clock Generator Main Oscillator Register */ #define CKGR_MOR_MOSCEN (1UL << 0) /* MOSCEN: Main Oscillator Enable */ #define CKGR_MOR_OSCBYPASS (1UL << 1) /* Oscillator Bypass */ @@ -93,6 +97,10 @@ #define PMC_MCKR_MDIV_MASK (3 << 8) #define PMC_MCKR_PRES_MASK (7 << 2) +/* PMC USB Clock Register */ +#define PMC_USB_USBDIV(n) (((n) & 0x0F) << 8) +#define PMC_USB_USBS (1 << 0) + /* PMC Interrupt Enable Register */ /* PMC Interrupt Disable Register */ /* PMC Status Register */ @@ -101,6 +109,7 @@ #define PMC_IER_LOCKA (1UL << 1) /* PLL A Locked */ #define PMC_IER_LOCKB (1UL << 2) /* PLL B Locked */ #define PMC_IER_MCKRDY (1UL << 3) /* Master Clock Status */ +#define PMC_IER_LOCKU (1UL << 6) /* UPLL Locked */ #define PMC_IER_PCK0RDY (1UL << 8) /* Programmable Clock 0 Ready */ #define PMC_IER_PCK1RDY (1UL << 9) /* Programmable Clock 1 Ready */ #define PMC_IER_PCK2RDY (1UL << 10) /* Programmable Clock 2 Ready */ Added: head/sys/arm/at91/at91sam9g45.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/at91sam9g45.c Thu Jul 26 08:01:25 2012 (r238788) @@ -0,0 +1,177 @@ +/*- + * Copyright (c) 2005 Olivier Houchard. All rights reserved. + * Copyright (c) 2010 Greg Ansley. All rights reserved. + * Copyright (c) 2012 Andrew Turner. 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 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 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#define _ARM32_BUS_DMA_PRIVATE +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Standard priority levels for the system. 0 is lowest and 7 is highest. + * These values are the ones Atmel uses for its Linux port + */ +static const int at91_irq_prio[32] = +{ + 7, /* Advanced Interrupt Controller */ + 7, /* System Peripherals */ + 1, /* Parallel IO Controller A */ + 1, /* Parallel IO Controller B */ + 1, /* Parallel IO Controller C */ + 1, /* Parallel IO Controller D and E */ + 0, + 5, /* USART 0 */ + 5, /* USART 1 */ + 5, /* USART 2 */ + 5, /* USART 3 */ + 0, /* Multimedia Card Interface 0 */ + 6, /* Two-Wire Interface 0 */ + 6, /* Two-Wire Interface 1 */ + 5, /* Serial Peripheral Interface 0 */ + 5, /* Serial Peripheral Interface 1 */ + 4, /* Serial Synchronous Controller 0 */ + 4, /* Serial Synchronous Controller 1 */ + 0, /* Timer Counter 0, 1, 2, 3, 4 and 5 */ + 0, /* Pulse Width Modulation Controller */ + 0, /* Touch Screen Controller */ + 0, /* DMA Controller */ + 2, /* USB Host High Speed port */ + 3, /* LCD Controller */ + 5, /* AC97 Controller */ + 3, /* Ethernet */ + 0, /* Image Sensor Interface */ + 2, /* USB Device High Speed port */ + 0, /* (reserved) */ + 0, /* Multimedia Card Interface 1 */ + 0, /* (reserved) */ + 0, /* Advanced Interrupt Controller IRQ0 */ +}; + +#define DEVICE(_name, _id, _unit) \ + { \ + _name, _unit, \ + AT91SAM9G45_ ## _id ##_BASE, \ + AT91SAM9G45_ ## _id ## _SIZE, \ + AT91SAM9G45_IRQ_ ## _id \ + } + +static const struct cpu_devs at91_devs[] = +{ + DEVICE("at91_pmc", PMC, 0), + DEVICE("at91_wdt", WDT, 0), + DEVICE("at91_rst", RSTC, 0), + DEVICE("at91_pit", PIT, 0), + DEVICE("at91_pio", PIOA, 0), + DEVICE("at91_pio", PIOB, 1), + DEVICE("at91_pio", PIOC, 2), + DEVICE("at91_pio", PIOD, 3), + DEVICE("at91_pio", PIOE, 4), + DEVICE("at91_twi", TWI0, 0), + DEVICE("at91_twi", TWI1, 1), + DEVICE("at91_mci", HSMCI0, 0), + DEVICE("at91_mci", HSMCI1, 1), + DEVICE("uart", DBGU, 0), + DEVICE("uart", USART0, 1), + DEVICE("uart", USART1, 2), + DEVICE("uart", USART2, 3), + DEVICE("uart", USART3, 4), + DEVICE("spi", SPI0, 0), + DEVICE("spi", SPI1, 1), + DEVICE("ate", EMAC, 0), + DEVICE("macb", EMAC, 0), + DEVICE("nand", NAND, 0), + DEVICE("ohci", OHCI, 0), + { 0, 0, 0, 0, 0 } +}; + +static uint32_t +at91_pll_outa(int freq) +{ + + switch (freq / 10000000) { + case 747 ... 801: return ((1 << 29) | (0 << 14)); + case 697 ... 746: return ((1 << 29) | (1 << 14)); + case 647 ... 696: return ((1 << 29) | (2 << 14)); + case 597 ... 646: return ((1 << 29) | (3 << 14)); + case 547 ... 596: return ((1 << 29) | (4 << 14)); + case 497 ... 546: return ((1 << 29) | (5 << 14)); + case 447 ... 496: return ((1 << 29) | (6 << 14)); + case 397 ... 446: return ((1 << 29) | (7 << 14)); + default: return (1 << 29); + } +} + +static void +at91_clock_init(void) +{ + struct at91_pmc_clock *clk; + + /* Update USB host port clock info */ + clk = at91_pmc_clock_ref("uhpck"); + clk->pmc_mask = PMC_SCER_UHP_SAM9; + at91_pmc_clock_deref(clk); + + /* Each SOC has different PLL contraints */ + clk = at91_pmc_clock_ref("plla"); + clk->pll_min_in = SAM9G45_PLL_A_MIN_IN_FREQ; /* 2 MHz */ + clk->pll_max_in = SAM9G45_PLL_A_MAX_IN_FREQ; /* 32 MHz */ + clk->pll_min_out = SAM9G45_PLL_A_MIN_OUT_FREQ; /* 400 MHz */ + clk->pll_max_out = SAM9G45_PLL_A_MAX_OUT_FREQ; /* 800 MHz */ + clk->pll_mul_shift = SAM9G45_PLL_A_MUL_SHIFT; + clk->pll_mul_mask = SAM9G45_PLL_A_MUL_MASK; + clk->pll_div_shift = SAM9G45_PLL_A_DIV_SHIFT; + clk->pll_div_mask = SAM9G45_PLL_A_DIV_MASK; + clk->set_outb = at91_pll_outa; + at91_pmc_clock_deref(clk); +} + +static struct at91_soc_data soc_data = { + .soc_delay = at91_pit_delay, + .soc_reset = at91_rst_cpu_reset, + .soc_clock_init = at91_clock_init, + .soc_irq_prio = at91_irq_prio, + .soc_children = at91_devs, +}; + +AT91_SOC(AT91_T_SAM9G45, &soc_data); Added: head/sys/arm/at91/at91sam9g45reg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/at91sam9g45reg.h Thu Jul 26 08:01:25 2012 (r238788) @@ -0,0 +1,294 @@ +/*- + * Copyright (c) 2009 Sylvestre Gallon. All rights reserved. + * Copyright (c) 2010 Greg Ansley. All rights reserved. + * Copyright (c) 2012 Andrew Turner. 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 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 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. + */ + +/* $FreeBSD$ */ + +#ifndef AT91SAM9G45REG_H_ +#define AT91SAM9G45REG_H_ + +/* Chip Specific limits */ +#define SAM9G45_PLL_A_MIN_IN_FREQ 2000000 /* 2 Mhz */ +#define SAM9G45_PLL_A_MAX_IN_FREQ 32000000 /* 32 Mhz */ +#define SAM9G45_PLL_A_MIN_OUT_FREQ 400000000 /* 400 Mhz */ +#define SAM9G45_PLL_A_MAX_OUT_FREQ 800000000 /* 800 Mhz */ +#define SAM9G45_PLL_A_MUL_SHIFT 16 +#define SAM9G45_PLL_A_MUL_MASK 0xFF +#define SAM9G45_PLL_A_DIV_SHIFT 0 +#define SAM9G45_PLL_A_DIV_MASK 0xFF + +/* + * Memory map, from datasheet : + * 0x00000000 - 0x0ffffffff : Internal Memories + * 0x10000000 - 0x1ffffffff : Chip Select 0 + * 0x20000000 - 0x2ffffffff : Chip Select 1 + * 0x30000000 - 0x3ffffffff : Chip Select 2 + * 0x40000000 - 0x4ffffffff : Chip Select 3 + * 0x50000000 - 0x5ffffffff : Chip Select 4 + * 0x60000000 - 0x6ffffffff : Chip Select 5 + * 0x70000000 - 0x7ffffffff : DDR SDRC 0 + * 0x80000000 - 0xeffffffff : Undefined (Abort) + * 0xf0000000 - 0xfffffffff : Peripherals + */ + +#define AT91_CHIPSELECT_0 0x10000000 +#define AT91_CHIPSELECT_1 0x20000000 +#define AT91_CHIPSELECT_2 0x30000000 +#define AT91_CHIPSELECT_3 0x40000000 +#define AT91_CHIPSELECT_4 0x50000000 +#define AT91_CHIPSELECT_5 0x60000000 + + +#define AT91SAM9G45_EMAC_BASE 0xffbc000 +#define AT91SAM9G45_EMAC_SIZE 0x4000 + +#define AT91SAM9G45_RSTC_BASE 0xffffd00 +#define AT91SAM9G45_RSTC_SIZE 0x10 + +/* USART*/ + +#define AT91SAM9G45_USART_SIZE 0x4000 +#define AT91SAM9G45_USART0_BASE 0xff8c000 +#define AT91SAM9G45_USART0_SIZE AT91SAM9G45_USART_SIZE +#define AT91SAM9G45_USART1_BASE 0xff90000 +#define AT91SAM9G45_USART1_SIZE AT91SAM9G45_USART_SIZE +#define AT91SAM9G45_USART2_BASE 0xff94000 +#define AT91SAM9G45_USART2_SIZE AT91SAM9G45_USART_SIZE +#define AT91SAM9G45_USART3_BASE 0xff98000 +#define AT91SAM9G45_USART3_SIZE AT91SAM9G45_USART_SIZE + +/*TC*/ +#define AT91SAM9G45_TC0_BASE 0xff7c000 +#define AT91SAM9G45_TC0_SIZE 0x4000 +#define AT91SAM9G45_TC0C0_BASE 0xff7c000 +#define AT91SAM9G45_TC0C1_BASE 0xff7c040 +#define AT91SAM9G45_TC0C2_BASE 0xff7c080 + +#define AT91SAM9G45_TC1_BASE 0xffd4000 +#define AT91SAM9G45_TC1_SIZE 0x4000 +#define AT91SAM9G45_TC1C0_BASE 0xffd4000 +#define AT91SAM9G45_TC1C1_BASE 0xffd4040 +#define AT91SAM9G45_TC1C2_BASE 0xffd4080 + +/*SPI*/ + +#define AT91SAM9G45_SPI0_BASE 0xffa48000 +#define AT91SAM9G45_SPI0_SIZE 0x4000 + +#define AT91SAM9G45_SPI1_BASE 0xffa8000 +#define AT91SAM9G45_SPI1_SIZE 0x4000 + +/* System Registers */ +#define AT91SAM9G45_SYS_BASE 0xffff000 +#define AT91SAM9G45_SYS_SIZE 0x1000 + +#define AT91SAM9G45_MATRIX_BASE 0xfffea00 +#define AT91SAM9G45_MATRIX_SIZE 0x200 + +#define AT91SAM9G45_DBGU_BASE 0xfffee00 +#define AT91SAM9G45_DBGU_SIZE 0x200 + +/* + * PIO + */ +#define AT91SAM9G45_PIOA_BASE 0xffff200 +#define AT91SAM9G45_PIOA_SIZE 0x200 +#define AT91SAM9G45_PIOB_BASE 0xffff400 +#define AT91SAM9G45_PIOB_SIZE 0x200 +#define AT91SAM9G45_PIOC_BASE 0xffff600 +#define AT91SAM9G45_PIOC_SIZE 0x200 +#define AT91SAM9G45_PIOD_BASE 0xffff800 +#define AT91SAM9G45_PIOD_SIZE 0x200 +#define AT91SAM9G45_PIOE_BASE 0xffffa00 +#define AT91SAM9G45_PIOE_SIZE 0x200 + +#define AT91SAM9G45_PMC_BASE 0xffffc00 +#define AT91SAM9G45_PMC_SIZE 0x100 + +/* IRQs : */ +/* + * 0: AIC + * 1: System peripheral (System timer, RTC, DBGU) + * 2: PIO Controller A + * 3: PIO Controller B + * 4: PIO Controller C + * 5: PIO Controller D/E + * 6: TRNG + * 7: USART 0 + * 8: USART 1 + * 9: USART 2 + * 10: USART 3 + * 11: Multimedia Card interface 0 + * 12: Two-wirte interface 0 + * 13: Two-wirte interface 1 + * 14: SPI 0 + * 15: SPI 1 + * 16: SSC 0 + * 17: SSC 0 + * 18: Timer Counter 0, 2, 3, 4, 5 + * 19: PWM + * 20: Touch Screen ADC + * 21: DMA + * 22: USB Host port + * 23: LCD + * 24: AC97 + * 25: EMAC + * 26: Image Sensor Interface + * 27: USB Device High Speed + * 28: - + * 29: Multimedia Card interface 1 + * 30: Reserved + * 31: AIC + */ + +#define AT91SAM9G45_IRQ_SYSTEM 1 +#define AT91SAM9G45_IRQ_PIOA 2 +#define AT91SAM9G45_IRQ_PIOB 3 +#define AT91SAM9G45_IRQ_PIOC 4 +#define AT91SAM9G45_IRQ_PIOD 5 +#define AT91SAM9G45_IRQ_PIOE 6 +#define AT91SAM9G45_IRQ_USART0 7 +#define AT91SAM9G45_IRQ_USART1 8 +#define AT91SAM9G45_IRQ_USART2 9 +#define AT91SAM9G45_IRQ_USART3 10 +#define AT91SAM9G45_IRQ_HSMCI0 11 +#define AT91SAM9G45_IRQ_TWI0 12 +#define AT91SAM9G45_IRQ_TWI1 13 +#define AT91SAM9G45_IRQ_SPI0 14 +#define AT91SAM9G45_IRQ_SPI1 15 +#define AT91SAM9G45_IRQ_SSC0 16 +#define AT91SAM9G45_IRQ_SSC1 17 +#define AT91SAM9G45_IRQ_TC0_TC5 18 +#define AT91SAM9G45_IRQ_PWM 19 +#define AT91SAM9G45_IRQ_TSADCC 20 +#define AT91SAM9G45_IRQ_DMA 21 +#define AT91SAM9G45_IRQ_UHP 22 +#define AT91SAM9G45_IRQ_LCDC 23 +#define AT91SAM9G45_IRQ_AC97C 24 +#define AT91SAM9G45_IRQ_EMAC 25 +#define AT91SAM9G45_IRQ_ISI 26 +#define AT91SAM9G45_IRQ_UDPHS 27 +/* Reserved 28 */ +#define AT91SAM9G45_IRQ_HSMCI1 29 +/* Reserved 30 */ +#define AT91SAM9G45_IRQ_AICBASE 31 + +/* Alias */ +#define AT91SAM9G45_IRQ_DBGU AT91SAM9G45_IRQ_SYSTEM +#define AT91SAM9G45_IRQ_PMC AT91SAM9G45_IRQ_SYSTEM +#define AT91SAM9G45_IRQ_WDT AT91SAM9G45_IRQ_SYSTEM +#define AT91SAM9G45_IRQ_PIT AT91SAM9G45_IRQ_SYSTEM +#define AT91SAM9G45_IRQ_RSTC AT91SAM9G45_IRQ_SYSTEM +#define AT91SAM9G45_IRQ_OHCI AT91SAM9G45_IRQ_UHP +#define AT91SAM9G45_IRQ_TC0 AT91SAM9G45_IRQ_TC0_TC5 +#define AT91SAM9G45_IRQ_TC1 AT91SAM9G45_IRQ_TC0_TC5 +#define AT91SAM9G45_IRQ_TC2 AT91SAM9G45_IRQ_TC0_TC5 +#define AT91SAM9G45_IRQ_TC3 AT91SAM9G45_IRQ_TC0_TC5 +#define AT91SAM9G45_IRQ_TC4 AT91SAM9G45_IRQ_TC0_TC5 +#define AT91SAM9G45_IRQ_TC5 AT91SAM9G45_IRQ_TC0_TC5 +#define AT91SAM9G45_IRQ_NAND (-1) + +#define AT91SAM9G45_AIC_BASE 0xffff000 +#define AT91SAM9G45_AIC_SIZE 0x200 + +/* Timer */ + +#define AT91SAM9G45_WDT_BASE 0xffffd40 +#define AT91SAM9G45_WDT_SIZE 0x10 + +#define AT91SAM9G45_PIT_BASE 0xffffd30 +#define AT91SAM9G45_PIT_SIZE 0x10 + +#define AT91SAM9G45_SMC_BASE 0xfffe800 +#define AT91SAM9G45_SMC_SIZE 0x200 + +#define AT91SAM9G45_PMC_BASE 0xffffc00 +#define AT91SAM9G45_PMC_SIZE 0x100 + +#define AT91SAM9G45_HSMCI0_BASE 0xff80000 +#define AT91SAM9G45_HSMCI0_SIZE 0x4000 + +#define AT91SAM9G45_HSMCI1_BASE 0xffd0000 +#define AT91SAM9G45_HSMCI1_SIZE 0x4000 + +#define AT91SAM9G45_TWI0_BASE 0xff84000 +#define AT91SAM9G45_TWI0_SIZE 0x4000 +#define AT91SAM9G45_TWI1_BASE 0xff88000 +#define AT91SAM9G45_TWI1_SIZE 0x4000 + +/* XXX Needs to be carfully coordinated with + * other * soc's so phyical and vm address + * mapping are unique. XXX + */ +#define AT91SAM9G45_OHCI_BASE 0xdfb00000 +#define AT91SAM9G45_OHCI_PA_BASE 0x00700000 +#define AT91SAM9G45_OHCI_SIZE 0x00100000 + +#define AT91SAM9G45_NAND_BASE 0xe0000000 +#define AT91SAM9G45_NAND_PA_BASE 0x40000000 +#define AT91SAM9G45_NAND_SIZE 0x10000000 + + +/* DDRSDRC */ +#define AT91SAM9G45_DDRSDRC1_BASE 0xfffea00 +#define AT91SAM9G45_DDRSDRC0_BASE 0xfffe600 +#define AT91SAM9G45_DDRSDRC_MR 0x00 +#define AT91SAM9G45_DDRSDRC_TR 0x04 +#define AT91SAM9G45_DDRSDRC_CR 0x08 +#define AT91SAM9G45_DDRSDRC_CR_NC_8 0x0 +#define AT91SAM9G45_DDRSDRC_CR_NC_9 0x1 +#define AT91SAM9G45_DDRSDRC_CR_NC_10 0x2 +#define AT91SAM9G45_DDRSDRC_CR_NC_11 0x3 +#define AT91SAM9G45_DDRSDRC_CR_NC_MASK 0x00000003 +#define AT91SAM9G45_DDRSDRC_CR_NR_11 0x0 +#define AT91SAM9G45_DDRSDRC_CR_NR_12 0x4 +#define AT91SAM9G45_DDRSDRC_CR_NR_13 0x8 +#define AT91SAM9G45_DDRSDRC_CR_NR_14 0xc +#define AT91SAM9G45_DDRSDRC_CR_NR_MASK 0x0000000c +#define AT91SAM9G45_DDRSDRC_TPR0 0x0c +#define AT91SAM9G45_DDRSDRC_TPR1 0x10 +#define AT91SAM9G45_DDRSDRC_TPR2 0x14 +/* Reserved 0x18 */ +#define AT91SAM9G45_DDRSDRC_LPR 0x1c +#define AT91SAM9G45_DDRSDRC_MDR 0x20 +#define AT91SAM9G45_DDRSDRC_MDR_SDR 0x0 +#define AT91SAM9G45_DDRSDRC_MDR_LPSDR 0x1 +#define AT91SAM9G45_DDRSDRC_MDR_LPDDR1 0x3 +#define AT91SAM9G45_DDRSDRC_MDR_DDR2 0x6 +#define AT91SAM9G45_DDRSDRC_MDR_MASK 0x00000007 +#define AT91SAM9G45_DDRSDRC_MDR_DBW_16 0x10 +#define AT91SAM9G45_DDRSDRC_DLL 0x24 +#define AT91SAM9G45_DDRSDRC_HSR 0x2c +#define AT91SAM9G45_DDRSDRC_DELAY1R 0x40 +#define AT91SAM9G45_DDRSDRC_DELAY2R 0x44 +#define AT91SAM9G45_DDRSDRC_DELAY3R 0x48 +#define AT91SAM9G45_DDRSDRC_DELAY4R 0x4c +/* Reserved 0x50 - 0xe0 */ +#define AT91SAM9G45_DDRSDRC_WPMR 0xe4 +#define AT91SAM9G45_DDRSDRC_WPSR 0xe8 + +#endif /* AT91SAM9G45REG_H_*/ + Modified: head/sys/arm/at91/files.at91 ============================================================================== --- head/sys/arm/at91/files.at91 Thu Jul 26 05:46:56 2012 (r238787) +++ head/sys/arm/at91/files.at91 Thu Jul 26 08:01:25 2012 (r238788) @@ -32,6 +32,7 @@ arm/at91/at91rm9200.c optional at91rm92 arm/at91/at91rm9200_devices.c optional at91rm9200 arm/at91/at91sam9260.c optional at91sam9260 arm/at91/at91sam9g20.c optional at91sam9g20 +arm/at91/at91sam9g45.c optional at91sam9g45 arm/at91/at91sam9x25.c optional at91sam9x25 # # All the boards we support Added: head/sys/arm/at91/std.at91sam9g45 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/std.at91sam9g45 Thu Jul 26 08:01:25 2012 (r238788) @@ -0,0 +1,11 @@ +# $FreeBSD$ +# +# PHYSADDR is different on at91sam9g45 than the other at91sam SoCs + +files "../at91/files.at91" +cpu CPU_ARM9 +makeoptions CONF_CFLAGS=-mcpu=arm9 +options PHYSADDR=0x70000000 + +# bring in the sam specific timers and such +device at91sam9 From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 08:02:38 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 488D81065675; Thu, 26 Jul 2012 08:02:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail34.syd.optusnet.com.au (mail34.syd.optusnet.com.au [211.29.133.218]) by mx1.freebsd.org (Postfix) with ESMTP id D1ED98FC12; Thu, 26 Jul 2012 08:02:37 +0000 (UTC) Received: from c122-106-171-246.carlnfd1.nsw.optusnet.com.au (c122-106-171-246.carlnfd1.nsw.optusnet.com.au [122.106.171.246]) by mail34.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q6Q82Sic007783 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 26 Jul 2012 18:02:29 +1000 Date: Thu, 26 Jul 2012 18:02:28 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov In-Reply-To: <20120725173212.GN2676@deviant.kiev.zoral.com.ua> Message-ID: <20120726174611.N2603@besplex.bde.org> References: <201207242210.q6OMACqV079603@svn.freebsd.org> <500F9E22.4080608@FreeBSD.org> <20120725102130.GH2676@deviant.kiev.zoral.com.ua> <20120725233033.N5406@besplex.bde.org> <20120725173212.GN2676@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Jim Harris , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Andriy Gapon , Bruce Evans , svn-src-head@FreeBSD.org Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 08:02:38 -0000 On Wed, 25 Jul 2012, Konstantin Belousov wrote: > On Thu, Jul 26, 2012 at 12:15:54AM +1000, Bruce Evans wrote: >> On Wed, 25 Jul 2012, Konstantin Belousov wrote: >> ... >> Most uses in FreeBSD are for timecounters. Timecounters deliver the >> current time. This is unrelated to whatever instructions haven't >> completed when the TSC is read. Except possibly when the time needs >> to be synchronized across CPUs, and when the uncompleted instruction >> is a TSC read. >> >>> For tsc test, this means that after the change RDTSC executions are not >>> reordered on the single core among themself. As I understand, CPU has >>> no dependency noted between two reads of tsc by RDTSC, which allows >>> later read to give lower value of counter. >> >> Gak. Even when they are in the same instruction sequence? Even though >> the TSC reads fixed registers and some other instructions in the sequence >> between the TSC use these registers? The CPU would have to do significant >> register renaming to break this. > As I could only speculate, I believe that any modern CPU executes RDTSC > as at least two separate steps, one is read from internal counter, and > second is the registers update. It seems that the first kind of action > is not serialized. I have no other explanation for the Jim findings. In a reply to your later mail (made earlier), I quoted the Athlon64 manual documenting this problem (everything except exactly where the serialization is applied). The delay is similar to what happens in software if the thread is preempted between reading the hardware time and using the result. It doesn't help to serializing the read and the use without serializing everything between, which costs more. Most uses don't care about the delay (else they need more than serialization to limit it). But if we care then we might have to use a slow new instruction like rdtscp to tell the hardware to care, or add slow locking to uses of the result in software (needs more than critical_enter() to stop fast interrupt handlers. BTW, binuptime() is supposed to work in fast interrupt handlers. This is fragile but useful). >>> { >>> >>> + rmb(); >>> return (rdtsc32()); >>> } >> >> Please don't pessimize this further. The time for rdtsc went from 6.5 >> cycles on AthlonXP to 65 cycles on core2 (mainly for for >> P-state-invariance hardware synchronization I think). Pretty soon it >> will be as slow as an HPET and heading towards an i8254. Adding rmb() >> only makes it 12 cycles slower on core2, but 16 cycles (almost 3 times) >> slower on AthlonXP. > AthlonXP does not look as interesting target for optimizations. Fom what I > can find this is PIII-era CPU. Since CPUs hit the frequency wall just after AthlonXP, it is almost as fast as a single modern CPU. Much faster than a modern CPU for rdtsc, and already optimized. Probably much faster than a PIII for systemy things like rdtsc. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 08:05:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E12E106564A; Thu, 26 Jul 2012 08:05:29 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2855D8FC12; Thu, 26 Jul 2012 08:05:29 +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 q6Q85TlU054969; Thu, 26 Jul 2012 08:05:29 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6Q85SeE054965; Thu, 26 Jul 2012 08:05:28 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201207260805.q6Q85SeE054965@svn.freebsd.org> From: Andrew Turner Date: Thu, 26 Jul 2012 08:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238789 - in head/sys/arm: at91 conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 08:05:29 -0000 Author: andrew Date: Thu Jul 26 08:05:28 2012 New Revision: 238789 URL: http://svn.freebsd.org/changeset/base/238789 Log: Add support for the DesignA Electronics Snapper9g45 System on Module. Reviewed by: imp Added: head/sys/arm/at91/board_sn9g45.c (contents, props changed) head/sys/arm/at91/std.sn9g45 (contents, props changed) head/sys/arm/conf/SN9G45 (contents, props changed) Modified: head/sys/arm/at91/files.at91 Added: head/sys/arm/at91/board_sn9g45.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/board_sn9g45.c Thu Jul 26 08:05:28 2012 (r238789) @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 2009 Greg Ansley. 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 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 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. + */ + +/* + * DesignA Electronics Snapper9g45 + * http://www.designa-electronics.com/ + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +long +board_init(void) +{ + + /* PIOB's A periph: Turn the debug USART's TX/RX pins */ + at91_pio_use_periph_a(AT91SAM9G45_PIOB_BASE, AT91C_PB12_DRXD, 0); + at91_pio_use_periph_a(AT91SAM9G45_PIOB_BASE, AT91C_PB13_DTXD, 1); + + return (at91_ramsize()); +} + +ARM_BOARD(SNAPPER9G45, "DesignA Electronics Snapper9G45"); Modified: head/sys/arm/at91/files.at91 ============================================================================== --- head/sys/arm/at91/files.at91 Thu Jul 26 08:01:25 2012 (r238788) +++ head/sys/arm/at91/files.at91 Thu Jul 26 08:05:28 2012 (r238789) @@ -46,4 +46,5 @@ arm/at91/board_qila9g20.c optional at91_ arm/at91/board_sam9260ek.c optional at91_board_sam9260ek arm/at91/board_sam9g20ek.c optional at91_board_sam9g20ek arm/at91/board_sam9x25ek.c optional at91_board_sam9x25ek +arm/at91/board_sn9g45.c optional at91_board_sn9g45 arm/at91/board_tsc4370.c optional at91_board_tsc4370 Added: head/sys/arm/at91/std.sn9g45 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/at91/std.sn9g45 Thu Jul 26 08:05:28 2012 (r238789) @@ -0,0 +1,12 @@ +#$FreeBSD$ +include "../at91/std.at91sam9g45" + +options STARTUP_PAGETABLE_ADDR=0x70800000 +makeoptions KERNPHYSADDR=0x70008000 +options KERNPHYSADDR=0x70008000 +makeoptions KERNVIRTADDR=0xc0008000 +options KERNVIRTADDR=0xc0008000 + +device at91sam9g45 +device at91_board_sn9g45 + Added: head/sys/arm/conf/SN9G45 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/SN9G45 Thu Jul 26 08:05:28 2012 (r238789) @@ -0,0 +1,130 @@ +# Kernel configuration for DesignA Electronics Snapper9G45 System on Module +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +ident SN9G45 + +include "../at91/std.sn9g45" + +#To statically compile in device wiring instead of /boot/device.hints +#hints "SN9G45.hints" +makeoptions MODULES_OVERRIDE="" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +options DDB +options KDB + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +#options INET6 #IPv6 communications protocols +options FFS #Berkeley Fast Filesystem +#options SOFTUPDATES #Enable FFS soft updates support +#options UFS_ACL #Support for access control lists +#options UFS_DIRHASH #Improve performance on big directories +#options MD_ROOT #MD is a potential root device +#options MD_ROOT_SIZE=4096 # 3MB ram disk +options NFSCL #New Network Filesystem Client +#options NFSD #New Network Filesystem Server +#options NFSLOCKD #Network Lock Manager +#options NFS_ROOT #NFS usable as /, requires NFSCL +#options BOOTP_NFSROOT +#options BOOTP +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ate0 +#options BOOTP_COMPAT + +options ROOTDEVNAME=\"ufs:/dev/da0s1\" + +options ALT_BREAK_TO_DEBUGGER + +#options MSDOSFS #MSDOS Filesystem +#options CD9660 #ISO 9660 Filesystem +#options PROCFS #Process filesystem (requires PSEUDOFS) +#options PSEUDOFS #Pseudo-filesystem framework +options SCSI_DELAY=1000 #Delay (in ms) before probing SCSI +#options KTRACE #ktrace(1) support +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +#options SYSCTL_OMIT_DESCR +options MUTEX_NOINLINE +options RWLOCK_NOINLINE +options NO_FFS_SNAPSHOT +options NO_SWAPPING + +# Debugging for use in -current +#options INVARIANTS #Enable calls of extra sanity checking +#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +#options DIAGNOSTIC + +device random +device loop +device bpf +device ether +device md + +device uart # Serial Ports + +# Ethernet +device ate # Ethernet Driver +#device macb # Alternate Ethernet driver +device mii +option AT91_ATE_USE_RMII + +device at91_wdt # WDT: Watchdog timer + +# SCSI peripherals +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device cd # CD +device pass # Passthrough device (direct SCSI access) + +# USB support +device ohci # OHCI localbus->USB interface +device usb # USB Bus (required) +device umass # Disks/Mass storage - Requires scbus and da +device uhid # "Human Interface Devices" +#device ulpt # Printer +#device udbp # USB Double Bulk Pipe devices + +# USB Ethernet, requires miibus +device miibus +#device aue # ADMtek USB Ethernet +#device axe # ASIX Electronics USB Ethernet +#device cdce # Generic USB over Ethernet +#device cue # CATC USB Ethernet +#device kue # Kawasaki LSI USB Ethernet +#device rue # RealTek RTL8150 USB Ethernet +device udav # Davicom DM9601E USB + +# USB Wireless +#device rum # Ralink Technology RT2501USB wireless NICs +#device uath # Atheros AR5523 wireless NICs +#device ural # Ralink Technology RT2500USB wireless NICs +#device zyd # ZyDAS zd1211/zd1211b wireless NICs + +# Wireless NIC cards +#device wlan # 802.11 support +#device wlan_wep # 802.11 WEP support +#device wlan_ccmp # 802.11 CCMP support +#device wlan_tkip # 802.11 TKIP support +#device wlan_amrr # AMRR transmit rate control algorithm + From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 08:10:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D62D9106566B; Thu, 26 Jul 2012 08:10:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1CFE8FC15; Thu, 26 Jul 2012 08:10:29 +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 q6Q8ATvG055397; Thu, 26 Jul 2012 08:10:29 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6Q8ATP2055395; Thu, 26 Jul 2012 08:10:29 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207260810.q6Q8ATP2055395@svn.freebsd.org> From: Michael Tuexen Date: Thu, 26 Jul 2012 08:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238790 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 08:10:30 -0000 Author: tuexen Date: Thu Jul 26 08:10:29 2012 New Revision: 238790 URL: http://svn.freebsd.org/changeset/base/238790 Log: Fix the sctp_sockstore union such that userland programs don't depend on INET and/or INET6 to be defined and in-tune with how the kernel was compiled. MFC after: 3 days Discussed with: rrs Modified: head/sys/netinet/sctp_uio.h Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Thu Jul 26 08:05:28 2012 (r238789) +++ head/sys/netinet/sctp_uio.h Thu Jul 26 08:10:29 2012 (r238790) @@ -1124,12 +1124,8 @@ struct sctpstat { #define SCTP_STAT_DECR_GAUGE32(_x) SCTP_STAT_DECR(_x) union sctp_sockstore { -#if defined(INET) struct sockaddr_in sin; -#endif -#if defined(INET6) struct sockaddr_in6 sin6; -#endif struct sockaddr sa; }; From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 08:49:05 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from lo0.su (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by hub.freebsd.org (Postfix) with ESMTP id 5AA4C106566B; Thu, 26 Jul 2012 08:49:04 +0000 (UTC) (envelope-from ru@FreeBSD.org) Date: Thu, 26 Jul 2012 12:49:03 +0400 From: Ruslan Ermilov To: "David E. O'Brien" , Simon Gerraty Message-ID: <20120726084903.GA48240@lo0.su> References: <201207180557.q6I5vheM034018@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201207180557.q6I5vheM034018@svn.freebsd.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238563 - head/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 08:49:05 -0000 On Wed, Jul 18, 2012 at 05:57:43AM +0000, David E. O'Brien wrote: > Author: obrien > Date: Wed Jul 18 05:57:42 2012 > New Revision: 238563 > URL: http://svn.freebsd.org/changeset/base/238563 > > Log: > a ";" tells make we want the shell to be used > > Submitted by: Simon Gerraty > > Modified: > head/gnu/usr.bin/groff/tmac/Makefile I don't quite understand what this change does, could you elaborate? Without -jN (in backwards compatibility mode), the "cd" is a no-op (whether it's terminated by `;' or not) because make will execute a single shell per command, with cwd set to ${.OBJDIR}. With -jN, "cd" becomes necessary because all commands are executed as a script by one shell (the reason it was added in the first place), but adding `;' is a no-op because commands are on separate lines. > Modified: head/gnu/usr.bin/groff/tmac/Makefile > ============================================================================== > --- head/gnu/usr.bin/groff/tmac/Makefile Wed Jul 18 05:50:40 2012 (r238562) > +++ head/gnu/usr.bin/groff/tmac/Makefile Wed Jul 18 05:57:42 2012 (r238563) > @@ -68,7 +68,7 @@ beforeinstall: > cd ${.CURDIR}; \ > ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ > koi8-r.tmac hyphen.ru ${DESTDIR}${TMACDIR} > - cd ${.OBJDIR} > + cd ${.OBJDIR}; > .for f in ${STRIPFILES} ${SPECIALFILES} > ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \ > $f-s ${DESTDIR}${TMACDIR}/$f > -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 09:06:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5A744106566C; Thu, 26 Jul 2012 09:06:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4669D8FC08; Thu, 26 Jul 2012 09:06:49 +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 q6Q96nS8059911; Thu, 26 Jul 2012 09:06:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6Q96n1W059909; Thu, 26 Jul 2012 09:06:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207260906.q6Q96n1W059909@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 26 Jul 2012 09:06:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238791 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 09:06:49 -0000 Author: kib Date: Thu Jul 26 09:06:48 2012 New Revision: 238791 URL: http://svn.freebsd.org/changeset/base/238791 Log: Do not requeue held page or page for which locking failed, just leave them alone. Process the act_count updates for the held pages in the vm_pageout loop over the inactive queue, instead of refusing to do anything with such page. Clarify the intent of the addl_page_shortage counter and change its use for pages which are not processed in the loop according to the description. Reviewed by: alc MFC after: 2 weeks Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Thu Jul 26 08:10:29 2012 (r238790) +++ head/sys/vm/vm_pageout.c Thu Jul 26 09:06:48 2012 (r238791) @@ -889,6 +889,12 @@ vm_pageout_scan(int pass) */ uma_reclaim(); + /* + * The addl_page_shortage is the the number of temporarily + * stuck pages in the inactive queue. In other words, the + * number of pages from cnt.v_inactive_count that should be + * discounted in setting the target for the active queue scan. + */ addl_page_shortage = atomic_readandclear_int(&vm_pageout_deficit); /* @@ -945,38 +951,31 @@ vm_pageout_scan(int pass) ("Unmanaged page %p cannot be in inactive queue", m)); /* - * Lock the page. + * The page or object lock acquisitions fail if the + * page was removed from the queue or moved to a + * different position within the queue. In either + * case, addl_page_shortage should not be incremented. */ if (!vm_pageout_page_lock(m, &next)) { vm_page_unlock(m); - addl_page_shortage++; continue; } - - /* - * A held page may be undergoing I/O, so skip it. - */ - if (m->hold_count) { + object = m->object; + if (!VM_OBJECT_TRYLOCK(object) && + !vm_pageout_fallback_object_lock(m, &next)) { vm_page_unlock(m); - vm_page_requeue(m); - addl_page_shortage++; + VM_OBJECT_UNLOCK(object); continue; } /* - * Don't mess with busy pages, keep in the front of the - * queue, most likely are being paged out. + * Don't mess with busy pages, keep them at at the + * front of the queue, most likely they are being + * paged out. Increment addl_page_shortage for busy + * pages, because they may leave the inactive queue + * shortly after page scan is finished. */ - object = m->object; - if (!VM_OBJECT_TRYLOCK(object) && - (!vm_pageout_fallback_object_lock(m, &next) || - m->hold_count != 0)) { - VM_OBJECT_UNLOCK(object); - vm_page_unlock(m); - addl_page_shortage++; - continue; - } - if (m->busy || (m->oflags & VPO_BUSY)) { + if (m->busy != 0 || (m->oflags & VPO_BUSY) != 0) { vm_page_unlock(m); VM_OBJECT_UNLOCK(object); addl_page_shortage++; @@ -1036,6 +1035,21 @@ vm_pageout_scan(int pass) goto relock_queues; } + if (m->hold_count != 0) { + vm_page_unlock(m); + VM_OBJECT_UNLOCK(object); + + /* + * Held pages are essentially stuck in the + * queue. So, they ought to be discounted + * from cnt.v_inactive_count. See the + * calculation of the page_shortage for the + * loop over the active queue below. + */ + addl_page_shortage++; + goto relock_queues; + } + /* * If the upper level VM system does not believe that the page * is fully dirty, but it is mapped for write access, then we From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 09:11:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAE97106566B; Thu, 26 Jul 2012 09:11:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B53AC8FC12; Thu, 26 Jul 2012 09:11: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 q6Q9BbrM060338; Thu, 26 Jul 2012 09:11:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6Q9Bb8D060330; Thu, 26 Jul 2012 09:11:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207260911.q6Q9Bb8D060330@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 26 Jul 2012 09:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238792 - in head/sys/i386: i386 include isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 09:11:37 -0000 Author: kib Date: Thu Jul 26 09:11:37 2012 New Revision: 238792 URL: http://svn.freebsd.org/changeset/base/238792 Log: MFamd64 r238623: Introduce curpcb magic variable. Requested and reviewed by: bde MFC after: 3 weeks Modified: head/sys/i386/i386/machdep.c head/sys/i386/i386/pmap.c head/sys/i386/i386/trap.c head/sys/i386/i386/vm86.c head/sys/i386/i386/vm_machdep.c head/sys/i386/include/pcpu.h head/sys/i386/isa/npx.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Thu Jul 26 09:06:48 2012 (r238791) +++ head/sys/i386/i386/machdep.c Thu Jul 26 09:11:37 2012 (r238792) @@ -1606,7 +1606,7 @@ exec_setregs(struct thread *td, struct i pcb->pcb_dr3 = 0; pcb->pcb_dr6 = 0; pcb->pcb_dr7 = 0; - if (pcb == PCPU_GET(curpcb)) { + if (pcb == curpcb) { /* * Clear the debug registers on the running * CPU, otherwise they will end up affecting Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Jul 26 09:06:48 2012 (r238791) +++ head/sys/i386/i386/pmap.c Thu Jul 26 09:11:37 2012 (r238792) @@ -1962,7 +1962,7 @@ pmap_lazyfix_action(void) (*ipi_lazypmap_counts[PCPU_GET(cpuid)])++; #endif if (rcr3() == lazyptd) - load_cr3(PCPU_GET(curpcb)->pcb_cr3); + load_cr3(curpcb->pcb_cr3); CPU_CLR_ATOMIC(PCPU_GET(cpuid), lazymask); atomic_store_rel_int(&lazywait, 1); } @@ -1972,7 +1972,7 @@ pmap_lazyfix_self(u_int cpuid) { if (rcr3() == lazyptd) - load_cr3(PCPU_GET(curpcb)->pcb_cr3); + load_cr3(curpcb->pcb_cr3); CPU_CLR_ATOMIC(cpuid, lazymask); } @@ -2039,7 +2039,7 @@ pmap_lazyfix(pmap_t pmap) cr3 = vtophys(pmap->pm_pdir); if (cr3 == rcr3()) { - load_cr3(PCPU_GET(curpcb)->pcb_cr3); + load_cr3(curpcb->pcb_cr3); CPU_CLR(PCPU_GET(cpuid), &pmap->pm_active); } } Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Thu Jul 26 09:06:48 2012 (r238791) +++ head/sys/i386/i386/trap.c Thu Jul 26 09:11:37 2012 (r238792) @@ -344,7 +344,7 @@ trap(struct trapframe *frame) if ((ISPL(frame->tf_cs) == SEL_UPL) || ((frame->tf_eflags & PSL_VM) && - !(PCPU_GET(curpcb)->pcb_flags & PCB_VM86CALL))) { + !(curpcb->pcb_flags & PCB_VM86CALL))) { /* user trap */ td->td_pticks = 0; @@ -593,7 +593,7 @@ trap(struct trapframe *frame) /* FALL THROUGH */ case T_SEGNPFLT: /* segment not present fault */ - if (PCPU_GET(curpcb)->pcb_flags & PCB_VM86CALL) + if (curpcb->pcb_flags & PCB_VM86CALL) break; /* @@ -606,7 +606,7 @@ trap(struct trapframe *frame) * a signal. */ if (frame->tf_eip == (int)cpu_switch_load_gs) { - PCPU_GET(curpcb)->pcb_gs = 0; + curpcb->pcb_gs = 0; #if 0 PROC_LOCK(p); kern_psignal(p, SIGBUS); @@ -644,9 +644,9 @@ trap(struct trapframe *frame) frame->tf_eip = (int)doreti_popl_fs_fault; goto out; } - if (PCPU_GET(curpcb)->pcb_onfault != NULL) { + if (curpcb->pcb_onfault != NULL) { frame->tf_eip = - (int)PCPU_GET(curpcb)->pcb_onfault; + (int)curpcb->pcb_onfault; goto out; } break; @@ -696,7 +696,7 @@ trap(struct trapframe *frame) * debugging the kernel. */ if (user_dbreg_trap() && - !(PCPU_GET(curpcb)->pcb_flags & PCB_VM86CALL)) { + !(curpcb->pcb_flags & PCB_VM86CALL)) { /* * Reset breakpoint bits because the * processor doesn't @@ -877,7 +877,7 @@ trap_pfault(frame, usermode, eva) * it normally, and panic immediately. */ if (!usermode && (td->td_intr_nesting_level != 0 || - PCPU_GET(curpcb)->pcb_onfault == NULL)) { + curpcb->pcb_onfault == NULL)) { trap_fatal(frame, eva); return (-1); } @@ -935,8 +935,8 @@ trap_pfault(frame, usermode, eva) nogo: if (!usermode) { if (td->td_intr_nesting_level == 0 && - PCPU_GET(curpcb)->pcb_onfault != NULL) { - frame->tf_eip = (int)PCPU_GET(curpcb)->pcb_onfault; + curpcb->pcb_onfault != NULL) { + frame->tf_eip = (int)curpcb->pcb_onfault; return (0); } trap_fatal(frame, eva); Modified: head/sys/i386/i386/vm86.c ============================================================================== --- head/sys/i386/i386/vm86.c Thu Jul 26 09:06:48 2012 (r238791) +++ head/sys/i386/i386/vm86.c Thu Jul 26 09:11:37 2012 (r238792) @@ -143,9 +143,9 @@ vm86_emulate(vmf) * the extension is not present. (This check should not be needed, * as we can't enter vm86 mode until we set up an extension area) */ - if (PCPU_GET(curpcb)->pcb_ext == 0) + if (curpcb->pcb_ext == 0) return (SIGBUS); - vm86 = &PCPU_GET(curpcb)->pcb_ext->ext_vm86; + vm86 = &curpcb->pcb_ext->ext_vm86; if (vmf->vmf_eflags & PSL_T) retcode = SIGTRAP; @@ -535,7 +535,7 @@ vm86_prepcall(struct vm86frame *vmf) vmf->kernel_fs = vmf->kernel_es = vmf->kernel_ds = 0; vmf->vmf_eflags = PSL_VIF | PSL_VM | PSL_USER; - vm86 = &PCPU_GET(curpcb)->pcb_ext->ext_vm86; + vm86 = &curpcb->pcb_ext->ext_vm86; if (!vm86->vm86_has_vme) vm86->vm86_eflags = vmf->vmf_eflags; /* save VIF, VIP */ } Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Thu Jul 26 09:06:48 2012 (r238791) +++ head/sys/i386/i386/vm_machdep.c Thu Jul 26 09:11:37 2012 (r238792) @@ -106,6 +106,10 @@ __FBSDID("$FreeBSD$"); #define NSFBUFS (512 + maxusers * 16) #endif +CTASSERT((struct thread **)OFFSETOF_CURTHREAD == + &((struct pcpu *)NULL)->pc_curthread); +CTASSERT((struct pcb **)OFFSETOF_CURPCB == &((struct pcpu *)NULL)->pc_curpcb); + static void cpu_reset_real(void); #ifdef SMP static void cpu_reset_proxy(void); Modified: head/sys/i386/include/pcpu.h ============================================================================== --- head/sys/i386/include/pcpu.h Thu Jul 26 09:06:48 2012 (r238791) +++ head/sys/i386/include/pcpu.h Thu Jul 26 09:11:37 2012 (r238792) @@ -236,16 +236,36 @@ extern struct pcpu *pcpup; #define PCPU_PTR(member) __PCPU_PTR(pc_ ## member) #define PCPU_SET(member, val) __PCPU_SET(pc_ ## member, val) +#define OFFSETOF_CURTHREAD 0 +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnull-dereference" +#endif static __inline __pure2 struct thread * __curthread(void) { struct thread *td; - __asm("movl %%fs:0,%0" : "=r" (td)); + __asm("movl %%fs:%1,%0" : "=r" (td) + : "m" (*(char *)OFFSETOF_CURTHREAD)); return (td); } +#ifdef __clang__ +#pragma clang diagnostic pop +#endif #define curthread (__curthread()) +#define OFFSETOF_CURPCB 16 +static __inline __pure2 struct pcb * +__curpcb(void) +{ + struct pcb *pcb; + + __asm("movl %%fs:%1,%0" : "=r" (pcb) : "m" (*(char *)OFFSETOF_CURPCB)); + return (pcb); +} +#define curpcb (__curpcb()) + #else /* !lint || defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) */ #error "this file needs to be ported to your compiler" Modified: head/sys/i386/isa/npx.c ============================================================================== --- head/sys/i386/isa/npx.c Thu Jul 26 09:06:48 2012 (r238791) +++ head/sys/i386/isa/npx.c Thu Jul 26 09:11:37 2012 (r238792) @@ -378,7 +378,7 @@ npxexit(td) critical_enter(); if (curthread == PCPU_GET(fpcurthread)) - npxsave(PCPU_GET(curpcb)->pcb_save); + npxsave(curpcb->pcb_save); critical_exit(); #ifdef NPX_DEBUG if (hw_float) { @@ -663,7 +663,6 @@ static int err_count = 0; int npxdna(void) { - struct pcb *pcb; if (!hw_float) return (0); @@ -687,25 +686,24 @@ npxdna(void) * Record new context early in case frstor causes an IRQ13. */ PCPU_SET(fpcurthread, curthread); - pcb = PCPU_GET(curpcb); #ifdef CPU_ENABLE_SSE if (cpu_fxsr) fpu_clean_state(); #endif - if ((pcb->pcb_flags & PCB_NPXINITDONE) == 0) { + if ((curpcb->pcb_flags & PCB_NPXINITDONE) == 0) { /* * This is the first time this thread has used the FPU or * the PCB doesn't contain a clean FPU state. Explicitly * load an initial state. */ fpurstor(&npx_initialstate); - if (pcb->pcb_initial_npxcw != __INITIAL_NPXCW__) - fldcw(pcb->pcb_initial_npxcw); - pcb->pcb_flags |= PCB_NPXINITDONE; - if (PCB_USER_FPU(pcb)) - pcb->pcb_flags |= PCB_NPXUSERINITDONE; + if (curpcb->pcb_initial_npxcw != __INITIAL_NPXCW__) + fldcw(curpcb->pcb_initial_npxcw); + curpcb->pcb_flags |= PCB_NPXINITDONE; + if (PCB_USER_FPU(curpcb)) + curpcb->pcb_flags |= PCB_NPXUSERINITDONE; } else { /* * The following fpurstor() may cause an IRQ13 when the @@ -721,7 +719,7 @@ npxdna(void) * fnclex if it is the first FPU instruction after a context * switch. */ - fpurstor(pcb->pcb_save); + fpurstor(curpcb->pcb_save); } critical_exit(); @@ -1099,13 +1097,14 @@ fpu_kern_thread(u_int flags) { struct pcb *pcb; - pcb = PCPU_GET(curpcb); + pcb = curpcb; KASSERT((curthread->td_pflags & TDP_KTHREAD) != 0, ("Only kthread may use fpu_kern_thread")); - KASSERT(pcb->pcb_save == &pcb->pcb_user_save, ("mangled pcb_save")); - KASSERT(PCB_USER_FPU(pcb), ("recursive call")); + KASSERT(curpcb->pcb_save == &curpcb->pcb_user_save, + ("mangled pcb_save")); + KASSERT(PCB_USER_FPU(curpcb), ("recursive call")); - pcb->pcb_flags |= PCB_KERNNPX; + curpcb->pcb_flags |= PCB_KERNNPX; return (0); } @@ -1115,5 +1114,5 @@ is_fpu_kern_thread(u_int flags) if ((curthread->td_pflags & TDP_KTHREAD) == 0) return (0); - return ((PCPU_GET(curpcb)->pcb_flags & PCB_KERNNPX) != 0); + return ((curpcb->pcb_flags & PCB_KERNNPX) != 0); } From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 09:13:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A2EA106566B; Thu, 26 Jul 2012 09:13:48 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFFEE8FC16; Thu, 26 Jul 2012 09:13:47 +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 q6Q9Dl23060541; Thu, 26 Jul 2012 09:13:47 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6Q9DlMn060538; Thu, 26 Jul 2012 09:13:47 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207260913.q6Q9DlMn060538@svn.freebsd.org> From: Christian Brueffer Date: Thu, 26 Jul 2012 09:13:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238793 - in stable/9/sys: cam/ata sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 09:13:48 -0000 Author: brueffer Date: Thu Jul 26 09:13:47 2012 New Revision: 238793 URL: http://svn.freebsd.org/changeset/base/238793 Log: MFC: r238393 Add and utilize defines for the ATA device register. Approved by: re (kib) Modified: stable/9/sys/cam/ata/ata_all.c stable/9/sys/sys/ata.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_all.c ============================================================================== --- stable/9/sys/cam/ata/ata_all.c Thu Jul 26 09:11:37 2012 (r238792) +++ stable/9/sys/cam/ata/ata_all.c Thu Jul 26 09:13:47 2012 (r238793) @@ -359,7 +359,7 @@ ata_28bit_cmd(struct ccb_ataio *ataio, u ataio->cmd.lba_low = lba; ataio->cmd.lba_mid = lba >> 8; ataio->cmd.lba_high = lba >> 16; - ataio->cmd.device = 0x40 | ((lba >> 24) & 0x0f); + ataio->cmd.device = ATA_DEV_LBA | ((lba >> 24) & 0x0f); ataio->cmd.sector_count = sector_count; } @@ -384,7 +384,7 @@ ata_48bit_cmd(struct ccb_ataio *ataio, u ataio->cmd.lba_low = lba; ataio->cmd.lba_mid = lba >> 8; ataio->cmd.lba_high = lba >> 16; - ataio->cmd.device = 0x40; + ataio->cmd.device = ATA_DEV_LBA; ataio->cmd.lba_low_exp = lba >> 24; ataio->cmd.lba_mid_exp = lba >> 32; ataio->cmd.lba_high_exp = lba >> 40; @@ -404,7 +404,7 @@ ata_ncq_cmd(struct ccb_ataio *ataio, uin ataio->cmd.lba_low = lba; ataio->cmd.lba_mid = lba >> 8; ataio->cmd.lba_high = lba >> 16; - ataio->cmd.device = 0x40; + ataio->cmd.device = ATA_DEV_LBA; ataio->cmd.lba_low_exp = lba >> 24; ataio->cmd.lba_mid_exp = lba >> 32; ataio->cmd.lba_high_exp = lba >> 40; Modified: stable/9/sys/sys/ata.h ============================================================================== --- stable/9/sys/sys/ata.h Thu Jul 26 09:11:37 2012 (r238792) +++ stable/9/sys/sys/ata.h Thu Jul 26 09:13:47 2012 (r238793) @@ -261,6 +261,20 @@ struct ata_params { /*255*/ u_int16_t integrity; } __packed; +/* + * ATA Device Register + * + * bit 7 Obsolete (was 1 in early ATA specs) + * bit 6 Sets LBA/CHS mode. 1=LBA, 0=CHS + * bit 5 Obsolete (was 1 in early ATA specs) + * bit 4 1 = Slave Drive, 0 = Master Drive + * bit 3-0 In LBA mode, 27-24 of address. In CHS mode, head number +*/ + +#define ATA_DEV_MASTER 0x00 +#define ATA_DEV_SLAVE 0x10 +#define ATA_DEV_LBA 0x40 + /* ATA transfer modes */ #define ATA_MODE_MASK 0x0f From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 09:27:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C1896106566B; Thu, 26 Jul 2012 09:27:01 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9278A8FC1B; Thu, 26 Jul 2012 09:27:01 +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 q6Q9R1cZ061701; Thu, 26 Jul 2012 09:27:01 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6Q9R11e061698; Thu, 26 Jul 2012 09:27:01 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201207260927.q6Q9R11e061698@svn.freebsd.org> From: Christian Brueffer Date: Thu, 26 Jul 2012 09:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238794 - in stable/8/sys: cam/ata sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 09:27:01 -0000 Author: brueffer Date: Thu Jul 26 09:27:00 2012 New Revision: 238794 URL: http://svn.freebsd.org/changeset/base/238794 Log: MFC: r238393 Add and utilize defines for the ATA device register. Modified: stable/8/sys/cam/ata/ata_all.c stable/8/sys/sys/ata.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/cam/ata/ata_all.c ============================================================================== --- stable/8/sys/cam/ata/ata_all.c Thu Jul 26 09:13:47 2012 (r238793) +++ stable/8/sys/cam/ata/ata_all.c Thu Jul 26 09:27:00 2012 (r238794) @@ -334,7 +334,7 @@ ata_28bit_cmd(struct ccb_ataio *ataio, u ataio->cmd.lba_low = lba; ataio->cmd.lba_mid = lba >> 8; ataio->cmd.lba_high = lba >> 16; - ataio->cmd.device = 0x40 | ((lba >> 24) & 0x0f); + ataio->cmd.device = ATA_DEV_LBA | ((lba >> 24) & 0x0f); ataio->cmd.sector_count = sector_count; } @@ -359,7 +359,7 @@ ata_48bit_cmd(struct ccb_ataio *ataio, u ataio->cmd.lba_low = lba; ataio->cmd.lba_mid = lba >> 8; ataio->cmd.lba_high = lba >> 16; - ataio->cmd.device = 0x40; + ataio->cmd.device = ATA_DEV_LBA; ataio->cmd.lba_low_exp = lba >> 24; ataio->cmd.lba_mid_exp = lba >> 32; ataio->cmd.lba_high_exp = lba >> 40; @@ -379,7 +379,7 @@ ata_ncq_cmd(struct ccb_ataio *ataio, uin ataio->cmd.lba_low = lba; ataio->cmd.lba_mid = lba >> 8; ataio->cmd.lba_high = lba >> 16; - ataio->cmd.device = 0x40; + ataio->cmd.device = ATA_DEV_LBA; ataio->cmd.lba_low_exp = lba >> 24; ataio->cmd.lba_mid_exp = lba >> 32; ataio->cmd.lba_high_exp = lba >> 40; Modified: stable/8/sys/sys/ata.h ============================================================================== --- stable/8/sys/sys/ata.h Thu Jul 26 09:13:47 2012 (r238793) +++ stable/8/sys/sys/ata.h Thu Jul 26 09:27:00 2012 (r238794) @@ -261,6 +261,20 @@ struct ata_params { /*255*/ u_int16_t integrity; } __packed; +/* + * ATA Device Register + * + * bit 7 Obsolete (was 1 in early ATA specs) + * bit 6 Sets LBA/CHS mode. 1=LBA, 0=CHS + * bit 5 Obsolete (was 1 in early ATA specs) + * bit 4 1 = Slave Drive, 0 = Master Drive + * bit 3-0 In LBA mode, 27-24 of address. In CHS mode, head number +*/ + +#define ATA_DEV_MASTER 0x00 +#define ATA_DEV_SLAVE 0x10 +#define ATA_DEV_LBA 0x40 + /* ATA transfer modes */ #define ATA_MODE_MASK 0x0f From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 10:10:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86363106566B; Thu, 26 Jul 2012 10:10:55 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7117B8FC16; Thu, 26 Jul 2012 10:10: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 q6QAAttX065279; Thu, 26 Jul 2012 10:10:55 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6QAAtlo065276; Thu, 26 Jul 2012 10:10:55 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201207261010.q6QAAtlo065276@svn.freebsd.org> From: "Andrey A. Chernov" Date: Thu, 26 Jul 2012 10:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238795 - in head/sys/boot: ficl zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 10:10:55 -0000 Author: ache Date: Thu Jul 26 10:10:54 2012 New Revision: 238795 URL: http://svn.freebsd.org/changeset/base/238795 Log: Try to avoid all files dependence on the modification time of the large and often modified directory created symbolic links points to - it cause unnecessary full rebuilds each time make runs when directory is changed. So do it only if symbolic link does not exists, which usually means that objdir is clean anyway. MFC after: 1 week Modified: head/sys/boot/ficl/Makefile head/sys/boot/zfs/Makefile Modified: head/sys/boot/ficl/Makefile ============================================================================== --- head/sys/boot/ficl/Makefile Thu Jul 26 09:27:00 2012 (r238794) +++ head/sys/boot/ficl/Makefile Thu Jul 26 10:10:54 2012 (r238795) @@ -54,9 +54,11 @@ softcore.c: ${SOFTWORDS} softcore.awk | awk -f softcore.awk -v datestamp="`LC_ALL=C date`") > ${.TARGET} .if ${MACHINE_CPUARCH} == "amd64" +.if !exists(machine) ${SRCS:M*.c:R:S/$/.o/g}: machine beforedepend ${OBJS}: machine +.endif machine: ln -sf ${.CURDIR}/../../i386/include machine Modified: head/sys/boot/zfs/Makefile ============================================================================== --- head/sys/boot/zfs/Makefile Thu Jul 26 09:27:00 2012 (r238794) +++ head/sys/boot/zfs/Makefile Thu Jul 26 10:10:54 2012 (r238795) @@ -33,5 +33,7 @@ machine: .include .if ${MACHINE_CPUARCH} == "amd64" +.if !exists(machine) beforedepend ${OBJS}: machine .endif +.endif From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 10:13:13 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68A21106566C; Thu, 26 Jul 2012 10:13:13 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id D6EF88FC08; Thu, 26 Jul 2012 10:13:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q6QAD51x061055; Thu, 26 Jul 2012 14:13:05 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q6QAD5ee061054; Thu, 26 Jul 2012 14:13:05 +0400 (MSK) (envelope-from ache) Date: Thu, 26 Jul 2012 14:13:05 +0400 From: Andrey Chernov To: Garrett Cooper Message-ID: <20120726101305.GA61029@vniz.net> Mail-Followup-To: Andrey Chernov , Garrett Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201207241603.q6OG3Sex048054@svn.freebsd.org> <0FB11763-EC8E-4396-BC4B-1FD2FC516A8C@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0FB11763-EC8E-4396-BC4B-1FD2FC516A8C@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r238741 - head/lib/libelf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 10:13:13 -0000 On Wed, Jul 25, 2012 at 04:26:29PM -0700, Garrett Cooper wrote: > > A bunch of the sys/boot directories probably need this too.. Two of them (ficl and zfs) just fixed in r238795. If I miss some others, point me to. -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 10:41:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD583106566B; Thu, 26 Jul 2012 10:41:49 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D43E8FC14; Thu, 26 Jul 2012 10:41:49 +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 q6QAfnFg067810; Thu, 26 Jul 2012 10:41:49 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6QAfnIX067806; Thu, 26 Jul 2012 10:41:49 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201207261041.q6QAfnIX067806@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 26 Jul 2012 10:41:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238796 - vendor/groff/dist/tmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 10:41:50 -0000 Author: ru Date: Thu Jul 26 10:41:48 2012 New Revision: 238796 URL: http://svn.freebsd.org/changeset/base/238796 Log: Cherry-pick vendor changes to mdoc: : 2012-07-17 Ingo Schwarze : : [mdoc] Make `Fl' correctly restore fonts. : : * tmac/doc.tmac (doc-flag-recursion): Do it. : : 2012-01-25 Ingo Schwarze : : [mdoc] * tmac/doc-syms: Fix meaning of XBD acronym. : : 2012-01-03 Kristaps Dzonsons : : [mdoc] Add `-isoC-2011'. : : * tmac/doc-syms (doc-str-St--isoC-2011): Add it. : * tmac/groff_mdoc.man: Document it. Modified: vendor/groff/dist/tmac/doc-syms vendor/groff/dist/tmac/doc.tmac vendor/groff/dist/tmac/groff_mdoc.man Modified: vendor/groff/dist/tmac/doc-syms ============================================================================== --- vendor/groff/dist/tmac/doc-syms Thu Jul 26 10:10:54 2012 (r238795) +++ vendor/groff/dist/tmac/doc-syms Thu Jul 26 10:41:48 2012 (r238796) @@ -605,6 +605,8 @@ .ds doc-str-St--isoC \*[doc-Tn-font-size]ISO/IEC\*[doc-str-St] 9899:1990 .as doc-str-St--isoC " (\*[Lq]\*[doc-Tn-font-size]ISO\~C\^90\*[doc-str-St]\*[Rq]) .als doc-str-St--isoC-90 doc-str-St--isoC +.ds doc-str-St--isoC-2011 \*[doc-Tn-font-size]ISO/IEC\*[doc-str-St] 9899:2011 +.as doc-str-St--isoC-2011 " (\*[Lq]\*[doc-Tn-font-size]ISO\~C\^11\*[doc-str-St]\*[Rq]) .ds doc-str-St--isoC-99 \*[doc-Tn-font-size]ISO/IEC\*[doc-str-St] 9899:1999 .as doc-str-St--isoC-99 " (\*[Lq]\*[doc-Tn-font-size]ISO\~C\^99\*[doc-str-St]\*[Rq]) .ds doc-str-St--isoC-amd1 \*[doc-Tn-font-size]ISO/IEC\*[doc-str-St] 9899/AMD1:1995 @@ -659,7 +661,7 @@ .as doc-str-St--susv3 " (\*[Lq]\*[doc-Tn-font-size]SUSv3\*[doc-str-St]\*[Rq]) .ds doc-str-St--svid4 System\~V Interface Definition, Fourth Edition .as doc-str-St--svid4 " (\*[Lq]\*[doc-Tn-font-size]SVID\*[doc-str-St]\^4\*[Rq]) -.ds doc-str-St--xbd5 \*[doc-Tn-font-size]X/Open\*[doc-str-St] System Interface Definitions Issue\~5 +.ds doc-str-St--xbd5 \*[doc-Tn-font-size]X/Open\*[doc-str-St] Base Definitions Issue\~5 .as doc-str-St--xbd5 " (\*[Lq]\*[doc-Tn-font-size]XBD\*[doc-str-St]\^5\*[Rq]) .ds doc-str-St--xcu5 \*[doc-Tn-font-size]X/Open\*[doc-str-St] Commands and Utilities Issue\~5 .as doc-str-St--xcu5 " (\*[Lq]\*[doc-Tn-font-size]XCU\*[doc-str-St]\^5\*[Rq]) Modified: vendor/groff/dist/tmac/doc.tmac ============================================================================== --- vendor/groff/dist/tmac/doc.tmac Thu Jul 26 10:10:54 2012 (r238795) +++ vendor/groff/dist/tmac/doc.tmac Thu Jul 26 10:41:48 2012 (r238796) @@ -438,7 +438,7 @@ . \" last argument . if (\n[doc-reg-dfr1] == 4) \ . nop \|\-\c -. nop \f[]\s[0]\c +. nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c . doc-print-and-reset . \} . el \{\ Modified: vendor/groff/dist/tmac/groff_mdoc.man ============================================================================== --- vendor/groff/dist/tmac/groff_mdoc.man Thu Jul 26 10:10:54 2012 (r238795) +++ vendor/groff/dist/tmac/groff_mdoc.man Thu Jul 26 10:41:48 2012 (r238796) @@ -2036,6 +2036,8 @@ are: .St -isoC-90 .It Li \-isoC\-99 .St -isoC-99 +.It Li \-isoC\-2011 +.St -isoC-2011 .El .Pp . From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 10:49:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8746D1065670; Thu, 26 Jul 2012 10:49:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id E354A8FC16; Thu, 26 Jul 2012 10:49:26 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6QAnVlH040673; Thu, 26 Jul 2012 13:49:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6QAnJVs096573; Thu, 26 Jul 2012 13:49:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6QAnIO2096572; Thu, 26 Jul 2012 13:49:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 26 Jul 2012 13:49:18 +0300 From: Konstantin Belousov To: Bruce Evans Message-ID: <20120726104918.GW2676@deviant.kiev.zoral.com.ua> References: <201207242210.q6OMACqV079603@svn.freebsd.org> <500F9E22.4080608@FreeBSD.org> <20120725102130.GH2676@deviant.kiev.zoral.com.ua> <500FE6AE.8070706@FreeBSD.org> <20120726001659.M5406@besplex.bde.org> <50102C94.9030706@FreeBSD.org> <20120725180537.GO2676@deviant.kiev.zoral.com.ua> <50103C61.8040904@FreeBSD.org> <20120726170837.Q2536@besplex.bde.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TU7weI3G/zBf4KwC" Content-Disposition: inline In-Reply-To: <20120726170837.Q2536@besplex.bde.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Jim Harris , src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , svn-src-head@freebsd.org, Jung-uk Kim Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 10:49:27 -0000 --TU7weI3G/zBf4KwC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 26, 2012 at 05:35:23PM +1000, Bruce Evans wrote: > On Wed, 25 Jul 2012, Jung-uk Kim wrote: > >>For some unrelated reasons, we do have lfence;rdtsc sequence in > >>the userland already. Well, it is not exactly such sequence, there > >>are some instructions between, but the main fact is that two > >>consequtive invocations of gettimeofday(2) (*) or clock_gettime(2) > >>are interleaved with lfence on Intels, guaranteeing that backstep > >>of the counter is impossible. >=20 > In fact, there is always a full documented serialization instruction > for syscalls, except maybe in FreeBSD-1 compat code on i386, at > least on Athlon64. i386 syscalls use int 0x80 (except in FreeBSD-1 > compat code they use lcalls, and the iret necessary to return from > this is serializing on at least Athlon64. amd64 syscalls use > sysenter/sysret. sysret isn't serializing (like far returns), at least > on Athlon64, but at least in FreeBSD, the syscall implementation uses > at least 2 swapgs's (one on entry and one just before the sysret), and > swapgs is serializing, at least on Athlon64. Yes, SWAPGS is not documented as serializing on Intels. I reviewed the whole syscall sequence for e.g. gettimeofday(2), and there is no serialization point for fast path. E.g. ast would add locking and thus serialization, as well as return by IRET, but fast path on amd64 has no such things. >=20 > >>* - it is not a syscall anymore. > >> > >>As I said, using recommended mfence;rdtsc sequence for AMDs would > >>require some work, but lets handle the kernel and userspace issues > >>separately. >=20 > Benchmarks for various methods on AthlonXP: I started with a program > that loops making a fe million clock_gettime() calls: >=20 > unchanged program: 1.15 seconds > add lfence: 1.16 seconds > add mfence: 1.15 seconds (yes, faster than mfence) > add atomic_cmpset: 1.20 seconds > add cpuid: 1.25 seconds >=20 > >>And, I really failed to find what the patch from the thread you > >>referenced tried to fix. > > > >The patch was supposed to reduce a barrier, i.e., vsyscall > >optimization. Please note I brought it up at the time, not because it > >fixed any problem but because we completely lack necessary serialization. > > > >>Was it really committed into Linux ? > > > >Yes, it was committed in a simpler form: > > > >http://git.kernel.org/?p=3Dlinux/kernel/git/torvalds/linux.git;a=3Dcommi= tdiff;h=3D057e6a8c660e95c3f4e7162e00e2fee1fc90c50d > > > >This function was moved around from time to time and now it sits here: > > > >http://git.kernel.org/?p=3Dlinux/kernel/git/torvalds/linux.git;a=3Dblob_= plain;f=3Darch/x86/vdso/vclock_gettime.c > > > >It still carries one barrier before rdtsc. Please see the comments. >=20 > For safety, you probably need to use the slowest (cpuid) method. Linux > seems to be just using fences that are observed to work. No, there is explicit mention of the recommended barriers in the vendor documentation, which is LFENCE for Intels, and MFENCE for AMDs. My patch just follows what is suggested in documentation. >=20 > Original Athlon64 manuals say this about rdtsc: "... not serializing... > even when bound by serializing instructions, the system environment at > the time the instruction is executed can cause additional cycles > [before it reaches EDX:EAX]". Both Intel and AMD current manuals state that RDTSC is not serializing. RDTSCP is documented by AMD as "forces all older instructions to retire before reading the time-stamp counter." Intel says essentially the same. [Replying to other mail in-place, the thread goes wild] On Thu, Jul 26, 2012 at 04:25:01PM +1000, Bruce Evans wrote: > On Wed, 25 Jul 2012, Konstantin Belousov wrote: >=20 > >On Wed, Jul 25, 2012 at 11:00:41AM -0700, Jim Harris wrote: > >>I wonder if instead of timecounter going backward, that TSC test > >>fails because CPU speculatively performs rdtsc instruction in relation > >>to waiter checks in smp_rendezvous_action. Or maybe we are saying > >>the same thing. > > > >Ok, the definition of the 'timecounter goes back', as I understand it: > > > >you have two events A and B in two threads, provable ordered, say, A is > >a lock release and B is the same lock acquisition. Assume that you take > >rdtsc values tA and tB under the scope of the lock right before A and > >right after B. Then it should be impossible to have tA > tB. >=20 > For the threaded case, there has to something for the accesses to be > provably ordered. It is hard to see how the something can be strong > enough unless it serializes all thread state in A and B. The rdtsc > state is not part of the thread state as know to APIs, but it is hard > to see how threads can serialize themselves without also serializing > the TSC. TSC timer read is not synchronized, and I found the Linux test for the thing I described above. Adopted version is available at http://people.freebsd.org/~kib/misc/time-warp-test.c. It shall be compiled in 32bit mode only. The code does full lock/unlock around RDTSC. Please note that there is CPUID instruction commented out in __rdtscll(). On my Nehalem workstation, I get enormous amount of wraps reported for RDTSC without CPUID. Adding CPUID back fixes the issue. So at least on Nehalems (and probably Westmere, I will test later today) RDTSC can even pass LOCKed instructions. Curiously enough, SandyBridge is sane and reports zero wraps, it seems Intel fixed the bug. >=20 > For most uses, the scope of the serialization and locking also needs > to extend across multiple timer reads. Otherwise you can have situations > like: >=20 > read the time > interrupt or context switch > read later time in other intr handler/thread > save late time > back to previous context > save earlier time >=20 > It is unclear how to even prevent such situations. You (at least, I) > don't want heavyweight locking/synchronization to prevent the context > switches. And the kernel rarely if ever does such synchronization. > binuptime() has none internally. It just spins if necessary until the > read becomes stable. Most callers of binuptime() just call it. >=20 > >I do not think that we can ever observe tA > tB if both threads are > >executing on the same CPU. >=20 > I thought that that was the problem, with a single thread and no context > switches seeing the TSC go backwards. Even then, it would take > non-useful behaviour (except for calibration and benchmarks) like > spinning executing rdtsc to see it going backwards. Normally there > are many instructions between rdtsc's and the non-serialization isn't > as deep as that. Using syscalls, you just can't read the timecounter > without about 1000 cycles between reads. When there is a context switch, > there is usually accidental serialization from locking. >=20 > I care about timestamps being ordered more than most people, and tried > to kill the get*time() APIs because they are weakly ordered relative > to the non-get variants (they return times in the past, and there is > no way to round down to get consistent times). I tried to fix them > by adding locking and updating them to the latest time whenever a > non-get variant gives a later time (by being used). This was too slow, > and breaks the design criteria that timecounter calls should not use > any explicit locking. However, if you want slowness, then you can get > it similarly by fixing the monotonicity of rdtsc in software. I think > I just figured out how to do this with the same slowness as serialization, > if a locked instruction serialzes; maybe less otherwise: >=20 > spin: > ptsc =3D prev_tsc; /* memory -> local (intentionally !atomic) */ > tsc =3D rdtsc(); /* only 32 bits for timecounters */ > if (tsc <=3D ptsc) { /* I forgot about wrap at first -- see below=20 > */ > /* > * It went backwards, or stopped. Could handle more > * completely, starting with panic() to see if this > * happens at all. > */ > return (ptsc); /* stopped is better than backwards */ > } > /* Usual case; update (32 bits). */ > if (atomic_cmpset_int(&prev_tsc, ptsc, tsc)) > return (tsc); > goto spin; I do not understand this. Algorithm is clear, but what you propose is very heavy-weight comparing with adding just LFENCE or MFENCE before rdtsc. First, the cache-line for prev_tsc becomes heavy-contended. Second, CAS is expensive. LFENCE is fully local to the core it executes on. --TU7weI3G/zBf4KwC Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlARIK0ACgkQC3+MBN1Mb4i7AACcCQIJt0k5D+2KqvPb7E9WoGQK kZQAmwS0TPTEqoCTVJMGCCux4wZBUtU/ =N9HI -----END PGP SIGNATURE----- --TU7weI3G/zBf4KwC-- From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 10:58:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 124BF106566B; Thu, 26 Jul 2012 10:58:31 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F020E8FC12; Thu, 26 Jul 2012 10:58:30 +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 q6QAwURg076255; Thu, 26 Jul 2012 10:58:30 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6QAwUaB076252; Thu, 26 Jul 2012 10:58:30 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201207261058.q6QAwUaB076252@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 26 Jul 2012 10:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238798 - in head: contrib/groff/tmac gnu/usr.bin/groff/tmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 10:58:31 -0000 Author: ru Date: Thu Jul 26 10:58:30 2012 New Revision: 238798 URL: http://svn.freebsd.org/changeset/base/238798 Log: Backed out r236255, and added FreeBSD 9.1 support to mdoc(7) to where it belongs. Modified: head/contrib/groff/tmac/doc-common head/gnu/usr.bin/groff/tmac/mdoc.local Modified: head/contrib/groff/tmac/doc-common ============================================================================== --- head/contrib/groff/tmac/doc-common Thu Jul 26 10:47:26 2012 (r238797) +++ head/contrib/groff/tmac/doc-common Thu Jul 26 10:58:30 2012 (r238798) @@ -574,10 +574,7 @@ .ds doc-operating-system-FreeBSD-8.0 8.0 .ds doc-operating-system-FreeBSD-8.1 8.1 .ds doc-operating-system-FreeBSD-8.2 8.2 -.ds doc-operating-system-FreeBSD-8.3 8.3 .ds doc-operating-system-FreeBSD-9.0 9.0 -.ds doc-operating-system-FreeBSD-9.1 9.1 -.ds doc-operating-system-FreeBSD-10.0 10.0 . .ds doc-operating-system-Darwin-8.0.0 8.0.0 .ds doc-operating-system-Darwin-8.1.0 8.1.0 Modified: head/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- head/gnu/usr.bin/groff/tmac/mdoc.local Thu Jul 26 10:47:26 2012 (r238797) +++ head/gnu/usr.bin/groff/tmac/mdoc.local Thu Jul 26 10:58:30 2012 (r238798) @@ -49,6 +49,7 @@ .\" FreeBSD releases not found in doc-common .ds doc-operating-system-FreeBSD-7.4 7.4 .ds doc-operating-system-FreeBSD-8.3 8.3 +.ds doc-operating-system-FreeBSD-9.1 9.1 .ds doc-operating-system-FreeBSD-10.0 10.0 . .\" Definitions not (yet) in doc-syms From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 11:01:07 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from lo0.su (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by hub.freebsd.org (Postfix) with ESMTP id 868891065672; Thu, 26 Jul 2012 11:01:06 +0000 (UTC) (envelope-from ru@FreeBSD.org) Date: Thu, 26 Jul 2012 15:01:05 +0400 From: Ruslan Ermilov To: David O'Brien Message-ID: <20120726110105.GB48240@lo0.su> References: <201205291949.q4TJnqtS099250@svn.freebsd.org> <20120531030738.GA77656@dragon.NUXI.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20120531030738.GA77656@dragon.NUXI.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Sergey Kandaurov , src-committers@FreeBSD.org Subject: Re: svn commit: r236255 - head/contrib/groff/tmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 11:01:08 -0000 On Wed, May 30, 2012 at 08:07:38PM -0700, David O'Brien wrote: > On Wed, May 30, 2012 at 07:34:33AM +0400, Sergey Kandaurov wrote: > > On 29 May 2012 23:49, David E. O'Brien wrote: > ... > > > Modified: head/contrib/groff/tmac/doc-common > ... > > > +.ds doc-operating-system-FreeBSD-8.3     8.3 > > > +.ds doc-operating-system-FreeBSD-9.1     9.1 > > > +.ds doc-operating-system-FreeBSD-10.0    10.0 > > This should be imported from savannah.gnu.org repository, > > and not changed directly. > > Unfortunately we cannot do that per r217595: > > This is a direct commit to contrib/ as we will no longer import > any newer groff snapshots, due to licensing issues. > > > For local changes not found in the (latest) contrib doc-common > > you should use gnu/usr.bin/groff/tmac/mdoc.local > > I followed r217595, was that commit the wrong approach? Wrong. mdoc is still distributed under the BSD license, and changes to it should be cherry picked and merged via vendor/groff/dist/. "8.3" and "10.0" that you added were already present in mdoc.local. I've cleaned up this mess now while I was pulling up latest changes to mdoc. And BTW, I still recommend a pre-commit review for groff, as hinted in src/MAINTAINERS. From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 11:10:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABA241065670; Thu, 26 Jul 2012 11:10:26 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CCC58FC12; Thu, 26 Jul 2012 11:10: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 q6QBAQbc077226; Thu, 26 Jul 2012 11:10:26 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6QBAQCR077222; Thu, 26 Jul 2012 11:10:26 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201207261110.q6QBAQCR077222@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 26 Jul 2012 11:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238799 - in head: contrib/groff/tmac gnu/usr.bin/groff/tmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 11:10:26 -0000 Author: ru Date: Thu Jul 26 11:10:25 2012 New Revision: 238799 URL: http://svn.freebsd.org/changeset/base/238799 Log: Backed out r228904, and added libstdthreads support to mdoc(7) to where it belongs. Modified: head/contrib/groff/tmac/doc-syms head/contrib/groff/tmac/groff_mdoc.man head/gnu/usr.bin/groff/tmac/mdoc.local Modified: head/contrib/groff/tmac/doc-syms ============================================================================== --- head/contrib/groff/tmac/doc-syms Thu Jul 26 10:58:30 2012 (r238798) +++ head/contrib/groff/tmac/doc-syms Thu Jul 26 11:10:25 2012 (r238799) @@ -814,7 +814,6 @@ .ds doc-str-Lb-librt \*[Px] \*[doc-str-Lb]Real-time Library (librt, \-lrt) .ds doc-str-Lb-libsdp Bluetooth Service Discovery Protocol User Library (libsdp, \-lsdp) .ds doc-str-Lb-libssp Buffer Overflow Protection Library (libssp, \-lssp) -.ds doc-str-Lb-libstdthreads C11 Threads Library (libstdthreads, \-lstdthreads) .ds doc-str-Lb-libSystem System Library (libSystem, \-lSystem) .ds doc-str-Lb-libtermcap Termcap Access Library (libtermcap, \-ltermcap) .ds doc-str-Lb-libterminfo Terminal Information Library (libterminfo, \-lterminfo) Modified: head/contrib/groff/tmac/groff_mdoc.man ============================================================================== --- head/contrib/groff/tmac/groff_mdoc.man Thu Jul 26 10:58:30 2012 (r238798) +++ head/contrib/groff/tmac/groff_mdoc.man Thu Jul 26 11:10:25 2012 (r238799) @@ -1797,8 +1797,6 @@ and their results are: .Lb libsdp .It Li libssp .Lb libssp -.It Li libstdthreads -.Lb libstdthreads .It Li libSystem .Lb libSystem .It Li libtermcap Modified: head/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- head/gnu/usr.bin/groff/tmac/mdoc.local Thu Jul 26 10:58:30 2012 (r238798) +++ head/gnu/usr.bin/groff/tmac/mdoc.local Thu Jul 26 11:10:25 2012 (r238799) @@ -42,6 +42,7 @@ .ds doc-str-Lb-libproc Processor Monitoring and Analysis Library (libproc, \-lproc) .ds doc-str-Lb-libprocstat Process and Files Information Retrieval (libprocstat, \-lprocstat) .ds doc-str-Lb-librtld_db Run-time Linker Debugging Library (librtld_db, \-lrtld_db) +.ds doc-str-Lb-libstdthreads C11 Threads Library (libstdthreads, \-lstdthreads) . .\" Default .Os value .ds doc-default-operating-system FreeBSD\~10.0 From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 11:12:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 13DE6106564A; Thu, 26 Jul 2012 11:12:39 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F28728FC08; Thu, 26 Jul 2012 11:12:38 +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 q6QBCc5o077467; Thu, 26 Jul 2012 11:12:38 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6QBCcjU077464; Thu, 26 Jul 2012 11:12:38 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201207261112.q6QBCcjU077464@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 26 Jul 2012 11:12:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238800 - head/contrib/groff/tmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 11:12:39 -0000 Author: ru Date: Thu Jul 26 11:12:38 2012 New Revision: 238800 URL: http://svn.freebsd.org/changeset/base/238800 Log: Pull up vendor changes to mdoc(7). Modified: head/contrib/groff/tmac/doc-syms head/contrib/groff/tmac/doc.tmac Directory Properties: head/contrib/groff/ (props changed) Modified: head/contrib/groff/tmac/doc-syms ============================================================================== --- head/contrib/groff/tmac/doc-syms Thu Jul 26 11:10:25 2012 (r238799) +++ head/contrib/groff/tmac/doc-syms Thu Jul 26 11:12:38 2012 (r238800) @@ -661,7 +661,7 @@ .as doc-str-St--susv3 " (\*[Lq]\*[doc-Tn-font-size]SUSv3\*[doc-str-St]\*[Rq]) .ds doc-str-St--svid4 System\~V Interface Definition, Fourth Edition .as doc-str-St--svid4 " (\*[Lq]\*[doc-Tn-font-size]SVID\*[doc-str-St]\^4\*[Rq]) -.ds doc-str-St--xbd5 \*[doc-Tn-font-size]X/Open\*[doc-str-St] System Interface Definitions Issue\~5 +.ds doc-str-St--xbd5 \*[doc-Tn-font-size]X/Open\*[doc-str-St] Base Definitions Issue\~5 .as doc-str-St--xbd5 " (\*[Lq]\*[doc-Tn-font-size]XBD\*[doc-str-St]\^5\*[Rq]) .ds doc-str-St--xcu5 \*[doc-Tn-font-size]X/Open\*[doc-str-St] Commands and Utilities Issue\~5 .as doc-str-St--xcu5 " (\*[Lq]\*[doc-Tn-font-size]XCU\*[doc-str-St]\^5\*[Rq]) Modified: head/contrib/groff/tmac/doc.tmac ============================================================================== --- head/contrib/groff/tmac/doc.tmac Thu Jul 26 11:10:25 2012 (r238799) +++ head/contrib/groff/tmac/doc.tmac Thu Jul 26 11:12:38 2012 (r238800) @@ -438,7 +438,7 @@ . \" last argument . if (\n[doc-reg-dfr1] == 4) \ . nop \|\-\c -. nop \f[]\s[0]\c +. nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c . doc-print-and-reset . \} . el \{\ From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 11:24:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from lo0.su (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by hub.freebsd.org (Postfix) with ESMTP id DAB561065672; Thu, 26 Jul 2012 11:24:31 +0000 (UTC) (envelope-from ru@FreeBSD.org) Date: Thu, 26 Jul 2012 15:24:30 +0400 From: Ruslan Ermilov To: Ed Schouten , Ulrich Spoerlein Message-ID: <20120726112430.GC48240@lo0.su> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201052136.q05LaCE2056678@svn.freebsd.org> <201112262151.pBQLprF2023340@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: contrib/groff/tmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 11:24:33 -0000 On Mon, Dec 26, 2011 at 09:51:53PM +0000, Ed Schouten wrote: > Author: ed > Date: Mon Dec 26 21:51:53 2011 > New Revision: 228904 > URL: http://svn.freebsd.org/changeset/base/228904 > > Log: > Add libstdthreads. [...] > Modified: > head/contrib/groff/tmac/doc-syms > head/contrib/groff/tmac/groff_mdoc.man On Thu, Jan 05, 2012 at 09:36:12PM +0000, Ulrich Spoerlein wrote: > Author: uqs > Date: Thu Jan 5 21:36:12 2012 > New Revision: 229651 > URL: http://svn.freebsd.org/changeset/base/229651 > > Log: > Pull up vendor changes to mdoc(7) > > This switches us to using -isoC-2011 as the symbol name which is used by > groff and mdocml. It follows the change to 4 digit years as done with > IEEE Std 1003 post-1999. > > MFC after: 2 weeks (groff changes only) > > Modified: > head/contrib/groff/tmac/doc-syms > head/contrib/groff/tmac/groff_mdoc.man > head/lib/libstdthreads/thrd_create.3 [...] Please don't directly commit to "mdoc" in contrib/groff/. mdoc is still distributed under the BSD license, here's the quote from groff/LICENSES: : . The -mdoc macro set, using the BSD license. : : tmac/doc.tmac : tmac/doc-old.tmac : tmac/doc-common : tmac/doc-ditroff : tmac/doc-nroff : tmac/doc-syms : tmac/groff_mdoc.man Vendor changes to mdoc should first be committed to vendor/groff/dist/ and then merged from there. Local changes should be made to gnu/usr.bin/groff/tmac/mdoc.local and may also be submitted upstream at your discretion. Cheers, -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 11:51:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AD17106564A; Thu, 26 Jul 2012 11:51:30 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 061E68FC08; Thu, 26 Jul 2012 11:51:30 +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 q6QBpTIZ080566; Thu, 26 Jul 2012 11:51:29 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6QBpTbv080564; Thu, 26 Jul 2012 11:51:29 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201207261151.q6QBpTbv080564@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 26 Jul 2012 11:51:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238801 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 11:51:30 -0000 Author: pluknet Date: Thu Jul 26 11:51:29 2012 New Revision: 238801 URL: http://svn.freebsd.org/changeset/base/238801 Log: Add OS X 10.8. Although they dropped the 'Mac' in this version, prefer to stick with it for consistency. Reviewed by: maxim Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Thu Jul 26 11:12:38 2012 (r238800) +++ head/share/misc/bsd-family-tree Thu Jul 26 11:51:29 2012 (r238801) @@ -254,7 +254,8 @@ FreeBSD 5.2 | | | 9.0 | | | | DragonFly 3.0.1 | v FreeBSD | | | | | 8.3 | | OpenBSD 5.1 | - | | | | | + | Mac OS X | | | + | 10.8 | | | FreeBSD 10 -current | NetBSD -current OpenBSD -current | | | | | | v v v v v @@ -547,6 +548,7 @@ FreeBSD 9.0 2012-01-12 [FBD] DragonFly 3.0.1 2012-02-21 [DFB] FreeBSD 8.3 2012-04-18 [FBD] OpenBSD 5.1 2012-05-01 [OBD] +Mac OS X 10.8 2012-07-25 [APL] Bibliography ------------------------ From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 12:04:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 899CF1065695; Thu, 26 Jul 2012 12:04:12 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 725C18FC1C; Thu, 26 Jul 2012 12:04:12 +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 q6QC4CUD081606; Thu, 26 Jul 2012 12:04:12 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6QC4CYC081603; Thu, 26 Jul 2012 12:04:12 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201207261204.q6QC4CYC081603@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 26 Jul 2012 12:04:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238802 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 12:04:12 -0000 Author: pluknet Date: Thu Jul 26 12:04:11 2012 New Revision: 238802 URL: http://svn.freebsd.org/changeset/base/238802 Log: Update the 'C1x draft' reference to '.St -isoC-2011' mdoc macro. Reviewed by: theraven MFC after: 1 week Modified: head/lib/libc/stdlib/at_quick_exit.3 head/lib/libc/stdlib/quick_exit.3 Modified: head/lib/libc/stdlib/at_quick_exit.3 ============================================================================== --- head/lib/libc/stdlib/at_quick_exit.3 Thu Jul 26 11:51:29 2012 (r238801) +++ head/lib/libc/stdlib/at_quick_exit.3 Thu Jul 26 12:04:11 2012 (r238802) @@ -58,4 +58,5 @@ function returns the value 0 if successf .Sh STANDARDS The .Fn at_quick_exit -function conforms to the C1x draft specification. +function conforms to +.St -isoC-2011 . Modified: head/lib/libc/stdlib/quick_exit.3 ============================================================================== --- head/lib/libc/stdlib/quick_exit.3 Thu Jul 26 11:51:29 2012 (r238801) +++ head/lib/libc/stdlib/quick_exit.3 Thu Jul 26 12:04:11 2012 (r238802) @@ -54,4 +54,5 @@ function does not return. .Sh STANDARDS The .Fn quick_exit -function conforms to the C1x draft specification. +function conforms to +.St -isoC-2011 . From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 12:10:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D7D6E1065670; Thu, 26 Jul 2012 12:10:19 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B82F28FC12; Thu, 26 Jul 2012 12:10:19 +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 q6QCAJG4082186; Thu, 26 Jul 2012 12:10:19 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6QCAJPD082182; Thu, 26 Jul 2012 12:10:19 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201207261210.q6QCAJPD082182@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 26 Jul 2012 12:10:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238803 - in head: share/man/man4 sys/dev/usb sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 12:10:20 -0000 Author: gavin Date: Thu Jul 26 12:10:19 2012 New Revision: 238803 URL: http://svn.freebsd.org/changeset/base/238803 Log: Add support for more devices to uslcom(4). This commit syncronises the list of supported devices with the union of: NetBSD src/sys/dev/usb/uslsa.c 1.18 OpenBSD src/sys/dev/usb/uslcom.c 1.24 Linux source/drivers/usb/serial/cp210x.c HEAD Remove duplicate JABLOTRON PC60B entry. Note that some of the devices added here are multi-port devices. The uslcom(4) driver currently only supports the first port on such devices. Update the man page to reflect the full list of supported devices. Remove two caveats from the CAVEATS section, as both listed caveats no longer apply. Add a caveat about multi-port devices. MFC after: 2 weeks Modified: head/share/man/man4/uslcom.4 head/sys/dev/usb/serial/uslcom.c head/sys/dev/usb/usbdevs Modified: head/share/man/man4/uslcom.4 ============================================================================== --- head/share/man/man4/uslcom.4 Thu Jul 26 12:04:11 2012 (r238802) +++ head/share/man/man4/uslcom.4 Thu Jul 26 12:10:19 2012 (r238803) @@ -16,12 +16,12 @@ .\" .\" $FreeBSD$ .\" -.Dd November 20, 2011 +.Dd July 26, 2012 .Dt USLCOM 4 .Os .Sh NAME .Nm uslcom -.Nd Silicon Laboratories CP2101/CP2102 based USB serial adapter +.Nd Silicon Laboratories CP2101/CP2102/CP2103/CP2104 based USB serial adapter .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -41,7 +41,8 @@ uslcom_load="YES" .Sh DESCRIPTION The .Nm -driver supports Silicon Laboratories CP2101/CP2102 based USB serial adapters. +driver supports Silicon Laboratories CP2101/CP2102/CP2103/CP2104 +based USB serial adapters. .Sh HARDWARE The following devices should work with the .Nm @@ -49,29 +50,147 @@ driver: .Pp .Bl -bullet -compact .It +AC-Services CAN, CIS-IBUS, IBUS and OBD interfaces +.It +Aerocomm Radio +.It +AKTACOM ACE-1001 cable +.It +AMBER Wireless AMB2560 +.It +Arkham DS-101 Adapter +.It Argussoft ISP .It +Arygon Technologies Mifare RFID Reader +.It +AVIT Research USB-TTL interface +.It +B&G H3000 Data Cable +.It +Balluff RFID reader +.It Baltech card reader .It +BEI USB VCP Sensor +.It Burnside Telecom Desktop Mobile .It chip45.com Crumb128 module .It +Clipsal 5000CT2, 5500PACA, 5500PCU, 560884, 5800PC, C5000CT2 +and L51xx C-Bus Home Automation products +.It +Commander 2 EDGE(GSM) Modem +.It +Cygnal Fasttrax GPS and Debug adapter +.It +DataApex MultiCOM USB to RS232 converter +.It +Degree Controls USB adapter +.It +DekTec DTA Plus VHF/UHF Booster +.It +Dell DW700 GPS Receiver +.It +Digianswer ZigBee/802.15.4 MAC +.It +Dynastream ANT Development kits +.It +Elan USBcount50, USBscope50, USBpulse100 and USBwave12 +.It +ELV USB-I2C interface +.It +EMS C1007 HF RFID controller +.It +Festo CPX-USB and CMSP interfaces +.It +Gemalto Prox-PU/CU contactless card reader +.It +Helicomm IP-Link 1220-DVM +.It +IMS USB-RS422 adapter +.It +Infinity GPS-MIC-1 Radio Monophone +.It +INSYS Modem +.It +IRZ SG-10 and MC35pu GSM/GPRS Modems +.It Jablotron PC-60B .It -Lipowsky Baby-JTAG +Kamstrup M-Bus Master MultiPort 250D +and Optical Eye/3 wire utility meter interfaces .It -Lipowsky Baby-LIN +Kyocera GPS .It -Lipowsky HARP-1 +Link Instruments MS-019 and MS-028 +Oscilloscope/Logic Analyzer/Pattern Generators +.It +Lipowsky Baby-JTAG, Baby-LIN and HARP-1 +.It +MEI CashFlow SC and Series 2000 cash acceptors +.It +MJS USB-TOSLINK Adapter +.It +MobiData GPRS USB Modems +.It +MSD DashHawk +.It +Multiplex RC adapter +.It +Optris MSpro LT Thermometer +.It +Owen AC4 USB-RS485 converter +.It +Pirelli DP-L10 SIP phone +.It +PLX CA-42 Phone cable .It Pololu USB to Serial .It -Silicon Laboratories CP2101 +Procyon AVS Mind Machine +.It +Renesas RX-Stick for RX610 +.It +Siemens MC60 Cable +.It +Silicon Laboratories generic CP2101/CP2102/CP2103/CP2104 chips +.It +Software Bisque Paramount ME +.It +SPORTident BSM7-D USB .It -Silicon Laboratories CP2102 +Suunto Sports Instrument +.It +Syntech CipherLab USB Barcode Scanner +.It +T-Com TC 300 SIP phone +.It +Tams Master Easy Control +.It +Telegesis ETRX2USB +.It +Timewave HamLinkUSB +.It +Tracient RFID Reader .It Track Systems Traqmate +.It +Vaisala USB Instrument cable +.It +VStabi Controller +.It +WAGO 750-923 USB Service Cable +.It +WaveSense Jazz Blood Glucose Meter +.It +WIENER Plein & Baus CML Data Logger, RCM Remote, +and PL512 and MPOD PSUs +.It +WMR RIGblaster Plug&Play and RIGtalk RT1 +.It +Zephyr Bioharness .El .Sh SEE ALSO .Xr tty 4 , @@ -92,7 +211,5 @@ The driver was written by .An Jonathan Gray Aq jsg@openbsd.org . .Sh CAVEATS -Setting hardware flow control is not currently supported. -.Pp -Silicon Laboratories do not release any programming information -on their products. +On devices with multiple ports attached to a single chip, +only the first port is currently supported. Modified: head/sys/dev/usb/serial/uslcom.c ============================================================================== --- head/sys/dev/usb/serial/uslcom.c Thu Jul 26 12:04:11 2012 (r238802) +++ head/sys/dev/usb/serial/uslcom.c Thu Jul 26 12:10:19 2012 (r238803) @@ -214,7 +214,13 @@ static struct ucom_callback uslcom_callb static const STRUCT_USB_HOST_ID uslcom_devs[] = { #define USLCOM_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } USLCOM_DEV(BALTECH, CARDREADER), + USLCOM_DEV(CLIPSAL, 5000CT2), + USLCOM_DEV(CLIPSAL, 5500PACA), USLCOM_DEV(CLIPSAL, 5500PCU), + USLCOM_DEV(CLIPSAL, 560884), + USLCOM_DEV(CLIPSAL, 5800PC), + USLCOM_DEV(CLIPSAL, C5000CT2), + USLCOM_DEV(CLIPSAL, L51xx), USLCOM_DEV(DATAAPEX, MULTICOM), USLCOM_DEV(DELL, DW700), USLCOM_DEV(DIGIANSWER, ZIGBEE802154), @@ -222,17 +228,27 @@ static const STRUCT_USB_HOST_ID uslcom_d USLCOM_DEV(DYNASTREAM, ANTDEVBOARD2), USLCOM_DEV(DYNASTREAM, ANT2USB), USLCOM_DEV(ELV, USBI2C), + USLCOM_DEV(FESTO, CMSP), + USLCOM_DEV(FESTO, CPX_USB), USLCOM_DEV(FOXCONN, PIRELLI_DP_L10), USLCOM_DEV(FOXCONN, TCOM_TC_300), USLCOM_DEV(GEMALTO, PROXPU), USLCOM_DEV(JABLOTRON, PC60B), + USLCOM_DEV(KAMSTRUP, OPTICALEYE), + USLCOM_DEV(KAMSTRUP, MBUS_250D), + USLCOM_DEV(LINKINSTRUMENTS, MSO19), + USLCOM_DEV(LINKINSTRUMENTS, MSO28), + USLCOM_DEV(LINKINSTRUMENTS, MSO28_2), USLCOM_DEV(MEI, CASHFLOW_SC), USLCOM_DEV(MEI, S2000), - USLCOM_DEV(JABLOTRON, PC60B), USLCOM_DEV(OWEN, AC4), USLCOM_DEV(PHILIPS, ACE1001), USLCOM_DEV(PLX, CA42), USLCOM_DEV(RENESAS, RX610), + USLCOM_DEV(SILABS, AC_SERV_CAN), + USLCOM_DEV(SILABS, AC_SERV_CIS), + USLCOM_DEV(SILABS, AC_SERV_IBUS), + USLCOM_DEV(SILABS, AC_SERV_OBD), USLCOM_DEV(SILABS, AEROCOMM), USLCOM_DEV(SILABS, AMBER_AMB2560), USLCOM_DEV(SILABS, ARGUSISP), @@ -248,16 +264,21 @@ static const STRUCT_USB_HOST_ID uslcom_d USLCOM_DEV(SILABS, C2_EDGE_MODEM), USLCOM_DEV(SILABS, CP2102), USLCOM_DEV(SILABS, CP210X_2), + USLCOM_DEV(SILABS, CP210X_3), + USLCOM_DEV(SILABS, CP210X_4), USLCOM_DEV(SILABS, CRUMB128), USLCOM_DEV(SILABS, CYGNAL), USLCOM_DEV(SILABS, CYGNAL_DEBUG), USLCOM_DEV(SILABS, CYGNAL_GPS), USLCOM_DEV(SILABS, DEGREE), + USLCOM_DEV(SILABS, DEKTEK_DTAPLUS), USLCOM_DEV(SILABS, EMS_C1007), + USLCOM_DEV(SILABS, HAMLINKUSB), USLCOM_DEV(SILABS, HELICOM), USLCOM_DEV(SILABS, IMS_USB_RS422), USLCOM_DEV(SILABS, INFINITY_MIC), USLCOM_DEV(SILABS, INSYS_MODEM), + USLCOM_DEV(SILABS, IRZ_SG10), USLCOM_DEV(SILABS, KYOCERA_GPS), USLCOM_DEV(SILABS, LIPOWSKY_HARP), USLCOM_DEV(SILABS, LIPOWSKY_JTAG), @@ -265,6 +286,8 @@ static const STRUCT_USB_HOST_ID uslcom_d USLCOM_DEV(SILABS, MC35PU), USLCOM_DEV(SILABS, MJS_TOSLINK), USLCOM_DEV(SILABS, MSD_DASHHAWK), + USLCOM_DEV(SILABS, MULTIPLEX_RC), + USLCOM_DEV(SILABS, OPTRIS_MSPRO), USLCOM_DEV(SILABS, POLOLU), USLCOM_DEV(SILABS, PROCYON_AVS), USLCOM_DEV(SILABS, SB_PARAMOUNT_ME), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Jul 26 12:04:11 2012 (r238802) +++ head/sys/dev/usb/usbdevs Thu Jul 26 12:10:19 2012 (r238803) @@ -659,6 +659,7 @@ vendor SENAO 0x1740 Senao vendor ASUS2 0x1761 ASUS vendor SWEEX2 0x177f Sweex vendor METAGEEK 0x1781 MetaGeek +vendor KAMSTRUP 0x17a8 Kamstrup A/S vendor WAVESENSE 0x17f4 WaveSense vendor VAISALA 0x1843 Vaisala vendor AMIT 0x18c5 AMIT @@ -684,6 +685,7 @@ vendor QISDA 0x1da5 Qisda vendor METAGEEK2 0x1dd5 MetaGeek vendor ALINK 0x1e0e Alink vendor AIRTIES 0x1eda AirTies +vendor FESTO 0x1e29 Festo vendor VERTEX 0x1fe7 Vertex Wireless Co., Ltd. vendor DLINK 0x2001 D-Link vendor PLANEX2 0x2019 Planex Communications @@ -700,6 +702,7 @@ vendor HIROSE 0x2631 Hirose Electric vendor NHJ 0x2770 NHJ vendor PLANEX 0x2c02 Planex Communications vendor VIDZMEDIA 0x3275 VidzMedia Pte Ltd +vendor LINKINSTRUMENTS 0x3195 Link Instruments Inc. vendor AEI 0x3334 AEI vendor HANK 0x3353 Hank Connection vendor PQI 0x3538 PQI @@ -1246,7 +1249,13 @@ product CISCOLINKSYS2 RT3070 0x4001 RT30 product CISCOLINKSYS3 RT3070 0x0101 RT3070 /* Clipsal products */ +product CLIPSAL 560884 0x0101 560884 C-Bus Audio Matrix Switch +product CLIPSAL 5500PACA 0x0201 5500PACA C-Bus Pascal Automation Controller +product CLIPSAL 5800PC 0x0301 5800PC C-Bus Wireless Interface product CLIPSAL 5500PCU 0x0303 5500PCU C-Bus +product CLIPSAL 5000CT2 0x0304 5000CT2 C-Bus Touch Screen +product CLIPSAL C5000CT2 0x0305 C5000CT2 C-Bus Touch Screen +product CLIPSAL L51xx 0x0401 L51xx C-Bus Dimmer /* CMOTECH products */ product CMOTECH CNU510 0x5141 CDMA Technologies USB modem @@ -1592,6 +1601,10 @@ product FEIYA DUMMY 0x0000 Dummy produc product FEIYA 5IN1 0x1132 5-in-1 Card Reader product FEIYA AC110 0x6300 AC-110 Card Reader +/* Festo */ +product FESTO CPX_USB 0x0102 CPX-USB +product FESTO CMSP 0x0501 CMSP + /* Fiberline */ product FIBERLINE WL430U 0x6003 WL-430U @@ -1992,6 +2005,10 @@ product JVC MP_PRX1 0x3008 MP-PRX1 Ethe /* JRC products */ product JRC AH_J3001V_J3002V 0x0001 AirH PHONE AH-J3001V/J3002V +/* Kamstrrup products */ +product KAMSTRUP OPTICALEYE 0x0001 Optical Eye/3-wire +product KAMSTRUP MBUS_250D 0x0005 M-Bus Master MultiPort 250D + /* Kawatsu products */ product KAWATSU MH4000P 0x0003 MiniHub 4000P @@ -2087,6 +2104,11 @@ product LEXMARK S2450 0x0009 Optra S 24 /* Liebert products */ product LIEBERT POWERSURE_PXT 0xffff PowerSure Personal XT +/* Link Instruments Inc. products */ +product LINKINSTRUMENTS MSO19 0xf190 Link Instruments MSO-19 +product LINKINSTRUMENTS MSO28 0xf280 Link Instruments MSO-28 +product LINKINSTRUMENTS MSO28_2 0xf281 Link Instruments MSO-28 + /* Linksys products */ product LINKSYS MAUSB2 0x0105 Camedia MAUSB-2 product LINKSYS USB10TX1 0x200c USB10TX @@ -3069,6 +3091,7 @@ product SILABS GSM2228 0x8054 Enfora GS product SILABS ARGUSISP 0x8066 Argussoft ISP product SILABS IMS_USB_RS422 0x806f IMS USB-RS422 product SILABS CRUMB128 0x807a Crumb128 board +product SILABS OPTRIS_MSPRO 0x80c4 Optris MSpro LT Thermometer product SILABS DEGREE 0x80ca Degree Controls Inc product SILABS TRACIENT 0x80dd Tracient RFID product SILABS TRAQMATE 0x80ed Track Systems Traqmate @@ -3081,9 +3104,11 @@ product SILABS WMRRIGBLASTER 0x814a WMR product SILABS WMRRIGTALK 0x814b WMR RIGtalk RT1 product SILABS B_G_H3000 0x8156 B&G H3000 Data Cable product SILABS HELICOM 0x815e Helicomm IP-Link 1220-DVM +product SILABS HAMLINKUSB 0x815f Timewave HamLinkUSB product SILABS AVIT_USB_TTL 0x818b AVIT Research USB-TTL product SILABS MJS_TOSLINK 0x819f MJS USB-TOSLINk product SILABS WAVIT 0x81a6 ThinkOptics WavIt +product SILABS MULTIPLEX_RC 0x81a9 Multiplex RC adapter product SILABS MSD_DASHHAWK 0x81ac MSD DashHawk product SILABS INSYS_MODEM 0x81ad INSYS Modem product SILABS LIPOWSKY_JTAG 0x81c8 Lipowsky Baby-JTAG @@ -3099,11 +3124,19 @@ product SILABS PROCYON_AVS 0x82f9 Procyo product SILABS MC35PU 0x8341 MC35pu product SILABS CYGNAL 0x8382 Cygnal product SILABS AMBER_AMB2560 0x83a8 Amber Wireless AMB2560 +product SILABS DEKTEK_DTAPLUS 0x83d8 DekTec DTA Plus VHF/UHF Booster product SILABS KYOCERA_GPS 0x8411 Kyocera GPS +product SILABS IRZ_SG10 0x8418 IRZ SG-10 GSM/GPRS Modem product SILABS BEI_VCP 0x846e BEI USB Sensor (VCP) product SILABS BALLUFF_RFID 0x8477 Balluff RFID reader +product SILABS AC_SERV_IBUS 0x85ea AC-Services IBUS Interface +product SILABS AC_SERV_CIS 0x85eb AC-Services CIS-IBUS +product SILABS AC_SERV_CAN 0x8664 AC-Services CAN Interface +product SILABS AC_SERV_OBD 0x8665 AC-Services OBD Interface product SILABS CP2102 0xea60 SILABS USB UART product SILABS CP210X_2 0xea61 CP210x Serial +product SILABS CP210X_3 0xea70 CP210x Serial +product SILABS CP210X_4 0xea80 CP210x Serial product SILABS INFINITY_MIC 0xea71 Infinity GPS-MIC-1 Radio Monophone product SILABS USBSCOPE50 0xf001 USBscope50 product SILABS USBWAVE12 0xf002 USBwave12 From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 12:18:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 842231065670; Thu, 26 Jul 2012 12:18:24 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64A4B8FC0A; Thu, 26 Jul 2012 12:18:24 +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 q6QCIOth082841; Thu, 26 Jul 2012 12:18:24 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6QCIOKL082838; Thu, 26 Jul 2012 12:18:24 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201207261218.q6QCIOKL082838@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 26 Jul 2012 12:18:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238804 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 12:18:24 -0000 Author: gavin Date: Thu Jul 26 12:18:23 2012 New Revision: 238804 URL: http://svn.freebsd.org/changeset/base/238804 Log: Improve descriptions for several devices supported by uslcom(4). Correct the spelling of the company Telegesis. Move MpMan to the correct location alphabetically. MFC after: 2 weeks Modified: head/sys/dev/usb/serial/uslcom.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/uslcom.c ============================================================================== --- head/sys/dev/usb/serial/uslcom.c Thu Jul 26 12:10:19 2012 (r238803) +++ head/sys/dev/usb/serial/uslcom.c Thu Jul 26 12:18:23 2012 (r238804) @@ -293,7 +293,7 @@ static const STRUCT_USB_HOST_ID uslcom_d USLCOM_DEV(SILABS, SB_PARAMOUNT_ME), USLCOM_DEV(SILABS, SUUNTO), USLCOM_DEV(SILABS, TAMSMASTER), - USLCOM_DEV(SILABS, TELEGESYS_ETRX2), + USLCOM_DEV(SILABS, TELEGESIS_ETRX2), USLCOM_DEV(SILABS, TRACIENT), USLCOM_DEV(SILABS, TRAQMATE), USLCOM_DEV(SILABS, USBCOUNT50), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Jul 26 12:10:19 2012 (r238803) +++ head/sys/dev/usb/usbdevs Thu Jul 26 12:18:23 2012 (r238804) @@ -1252,7 +1252,7 @@ product CISCOLINKSYS3 RT3070 0x0101 RT30 product CLIPSAL 560884 0x0101 560884 C-Bus Audio Matrix Switch product CLIPSAL 5500PACA 0x0201 5500PACA C-Bus Pascal Automation Controller product CLIPSAL 5800PC 0x0301 5800PC C-Bus Wireless Interface -product CLIPSAL 5500PCU 0x0303 5500PCU C-Bus +product CLIPSAL 5500PCU 0x0303 5500PCU C-Bus Interface product CLIPSAL 5000CT2 0x0304 5000CT2 C-Bus Touch Screen product CLIPSAL C5000CT2 0x0305 C5000CT2 C-Bus Touch Screen product CLIPSAL L51xx 0x0401 L51xx C-Bus Dimmer @@ -1672,7 +1672,7 @@ product FUJITSUSIEMENS SCR 0x0009 Fujits product GARMIN IQUE_3600 0x0004 iQue 3600 /* Gemalto products */ -product GEMALTO PROXPU 0x5501 Prox-PU/CU +product GEMALTO PROXPU 0x5501 Prox-PU/CU RFID Card Reader /* General Instruments (Motorola) products */ product GENERALINSTMNTS SB5100 0x5100 SURFboard SB5100 Cable modem @@ -2251,7 +2251,7 @@ product MGE UPS2 0xffff MGE UPS SYSTEMS /* MEI products */ product MEI CASHFLOW_SC 0x1100 Cashflow-SC Cash Acceptor -product MEI S2000 0x1101 Seies 2000 Combo Acceptor +product MEI S2000 0x1101 Series 2000 Combo Acceptor /* Micro Star International products */ product MSI BT_DONGLE 0x1967 Bluetooth USB dongle @@ -2364,6 +2364,10 @@ product MOTOROLA2 USBLAN2 0x6027 USBLAN product MOTOROLA4 RT2770 0x9031 RT2770 product MOTOROLA4 RT3070 0x9032 RT3070 +/* MpMan products */ +product MPMAN MPF400_2 0x25a8 MPF400 Music Player 2Go +product MPMAN MPF400_1 0x36d0 MPF400 Music Player 1Go + /* MultiTech products */ product MULTITECH ATLAS 0xf101 MT5634ZBA-USB modem @@ -3079,10 +3083,10 @@ product SILICOM U2E 0x0001 U2E product SILICOM GPE 0x0002 Psion Gold Port Ethernet /* SI Labs */ -product SILABS VSTABI 0x0f91 Vstabi +product SILABS VSTABI 0x0f91 VStabi Controller product SILABS ARKHAM_DS101_M 0x1101 Arkham DS101 Monitor product SILABS ARKHAM_DS101_A 0x1601 Arkham DS101 Adapter -product SILABS BSM7DUSB 0x800a BSM7-D-USB +product SILABS BSM7DUSB 0x800a SPORTident BSM7-D USB product SILABS POLOLU 0x803b Pololu Serial product SILABS CYGNAL_DEBUG 0x8044 Cygnal Debug Adapter product SILABS SB_PARAMOUNT_ME 0x8043 Software Bisque Paramount ME @@ -3106,7 +3110,7 @@ product SILABS B_G_H3000 0x8156 B&G H300 product SILABS HELICOM 0x815e Helicomm IP-Link 1220-DVM product SILABS HAMLINKUSB 0x815f Timewave HamLinkUSB product SILABS AVIT_USB_TTL 0x818b AVIT Research USB-TTL -product SILABS MJS_TOSLINK 0x819f MJS USB-TOSLINk +product SILABS MJS_TOSLINK 0x819f MJS USB-TOSLINK product SILABS WAVIT 0x81a6 ThinkOptics WavIt product SILABS MULTIPLEX_RC 0x81a9 Multiplex RC adapter product SILABS MSD_DASHHAWK 0x81ac MSD DashHawk @@ -3119,7 +3123,7 @@ product SILABS EMS_C1007 0x81f2 EMS C100 product SILABS LIPOWSKY_HARP 0x8218 Lipowsky HARP-1 product SILABS C2_EDGE_MODEM 0x822b Commander 2 EDGE(GSM) Modem product SILABS CYGNAL_GPS 0x826b Cygnal Fasttrax GPS -product SILABS TELEGESYS_ETRX2 0x8293 Telegesys ETRX2USB +product SILABS TELEGESIS_ETRX2 0x8293 Telegesis ETRX2USB product SILABS PROCYON_AVS 0x82f9 Procyon AVS product SILABS MC35PU 0x8341 MC35pu product SILABS CYGNAL 0x8382 Cygnal @@ -3276,10 +3280,6 @@ product STELERA E1010 0x1010 3G modem product STELERA E1011 0x1011 3G modem product STELERA E1012 0x1012 3G modem -/* MpMan products */ -product MPMAN MPF400_1 0x36d0 MPF400 Music Player 1Go -product MPMAN MPF400_2 0x25a8 MPF400 Music Player 2Go - /* STMicroelectronics products */ product STMICRO BIOCPU 0x2016 Biometric Coprocessor product STMICRO COMMUNICATOR 0x7554 USB Communicator From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 12:31:00 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B731106564A; Thu, 26 Jul 2012 12:31:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 057EE8FC18; Thu, 26 Jul 2012 12:30:59 +0000 (UTC) Received: from c122-106-171-246.carlnfd1.nsw.optusnet.com.au (c122-106-171-246.carlnfd1.nsw.optusnet.com.au [122.106.171.246]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q6QCUp6s000320 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 26 Jul 2012 22:30:52 +1000 Date: Thu, 26 Jul 2012 22:30:51 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov In-Reply-To: <20120726104918.GW2676@deviant.kiev.zoral.com.ua> Message-ID: <20120726213001.K3621@besplex.bde.org> References: <201207242210.q6OMACqV079603@svn.freebsd.org> <500F9E22.4080608@FreeBSD.org> <20120725102130.GH2676@deviant.kiev.zoral.com.ua> <500FE6AE.8070706@FreeBSD.org> <20120726001659.M5406@besplex.bde.org> <50102C94.9030706@FreeBSD.org> <20120725180537.GO2676@deviant.kiev.zoral.com.ua> <50103C61.8040904@FreeBSD.org> <20120726170837.Q2536@besplex.bde.org> <20120726104918.GW2676@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Jim Harris , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Andriy Gapon , Bruce Evans , svn-src-head@FreeBSD.org, Jung-uk Kim Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 12:31:00 -0000 On Thu, 26 Jul 2012, Konstantin Belousov wrote: > On Thu, Jul 26, 2012 at 05:35:23PM +1000, Bruce Evans wrote: >> In fact, there is always a full documented serialization instruction >> for syscalls, except maybe in FreeBSD-1 compat code on i386, at >> least on Athlon64. i386 syscalls use int 0x80 (except in FreeBSD-1 >> compat code they use lcalls, and the iret necessary to return from >> this is serializing on at least Athlon64. amd64 syscalls use >> sysenter/sysret. sysret isn't serializing (like far returns), at least >> on Athlon64, but at least in FreeBSD, the syscall implementation uses >> at least 2 swapgs's (one on entry and one just before the sysret), and >> swapgs is serializing, at least on Athlon64. > Yes, SWAPGS is not documented as serializing on Intels. I reviewed Isn't that too incompatible? > the whole syscall sequence for e.g. gettimeofday(2), and there is no > serialization point for fast path. E.g. ast would add locking and thus > serialization, as well as return by IRET, but fast path on amd64 has > no such things. >>> This function was moved around from time to time and now it sits here: >>> >>> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob_plain;f=arch/x86/vdso/vclock_gettime.c >>> >>> It still carries one barrier before rdtsc. Please see the comments. >> >> For safety, you probably need to use the slowest (cpuid) method. Linux >> seems to be just using fences that are observed to work. > No, there is explicit mention of the recommended barriers in the vendor > documentation, which is LFENCE for Intels, and MFENCE for AMDs. My patch > just follows what is suggested in documentation. But you say later theat CPUID is needed (instead of just lock?). The original Athlon64 manual doesn't seem to mention MFENCE for RTDSC. Maybe later manuals clarify that MFENCE works on old CPUs too. > [Replying to other mail in-place, the thread goes wild] Too much quoting :-). > On Thu, Jul 26, 2012 at 04:25:01PM +1000, Bruce Evans wrote: >> ... >> For the threaded case, there has to something for the accesses to be >> provably ordered. It is hard to see how the something can be strong >> enough unless it serializes all thread state in A and B. The rdtsc >> state is not part of the thread state as know to APIs, but it is hard >> to see how threads can serialize themselves without also serializing >> the TSC. > TSC timer read is not synchronized, and I found the Linux test for the > thing I described above. Adopted version is available at > http://people.freebsd.org/~kib/misc/time-warp-test.c. > It shall be compiled in 32bit mode only. My point is that it will normally be synchronized by whatever the threads do to provide synchronization for themself. Only the case of a single thread doing sequential timer reads should expect the reads to be monotonic without any explicit synchronization. I hope this case doesn't require stalling everything in low-level code. > On my Nehalem workstation, I get enormous amount of wraps reported for > RDTSC without CPUID. Adding CPUID back fixes the issue. So at least on > Nehalems (and probably Westmere, I will test later today) RDTSC can even > pass LOCKed instructions. Oh, you mean with the test program, that it needs CPUID because it only has locks and no fences and its CPUID is commented out. > Curiously enough, SandyBridge is sane and reports zero wraps, it seems > Intel fixed the bug. The original Athlon64 manual doesn't seem to mention locks being sufficient any more than it mentions fences. >> I care about timestamps being ordered more than most people, and tried >> to kill the get*time() APIs because they are weakly ordered relative >> to the non-get variants (they return times in the past, and there is >> no way to round down to get consistent times). I tried to fix them >> by adding locking and updating them to the latest time whenever a >> non-get variant gives a later time (by being used). This was too slow, >> and breaks the design criteria that timecounter calls should not use >> any explicit locking. However, if you want slowness, then you can get >> it similarly by fixing the monotonicity of rdtsc in software. I think >> I just figured out how to do this with the same slowness as serialization, >> if a locked instruction serialzes; maybe less otherwise: >> >> spin: >> ptsc = prev_tsc; /* memory -> local (intentionally !atomic) */ >> tsc = rdtsc(); /* only 32 bits for timecounters */ >> if (tsc <= ptsc) { /* I forgot about wrap at first -- see below >> */ >> /* >> * It went backwards, or stopped. Could handle more >> * completely, starting with panic() to see if this >> * happens at all. >> */ >> return (ptsc); /* stopped is better than backwards */ >> } >> /* Usual case; update (32 bits). */ >> if (atomic_cmpset_int(&prev_tsc, ptsc, tsc)) >> return (tsc); >> goto spin; > I do not understand this. Algorithm is clear, but what you propose is > very heavy-weight comparing with adding just LFENCE or MFENCE before rdtsc. > First, the cache-line for prev_tsc becomes heavy-contended. Second, CAS > is expensive. LFENCE is fully local to the core it executes on. I expect the contention to be rare, but then optimization isn't important either. But if the problem is fully local, as it apparently is for fences to fix it, then prev_tsc can be per-CPU with a non-atomic cmpset to access it. We don't care if rdtsc gives an old value due to some delay in copying the result to EDX:EAX any more than we care about an old value due to being interrupted. The case where we are interrupted, and context-switched, and come back on a different CPU, is especially interesting. Then we may have an old tsc value from another CPU. Sometimes we detect that it is old for the new CPU, sometimes not. There is a problem in theory but I think none in practice. The switch could set a flag to tell us to loop (set prev_tsc to a sentinel value), and it accidentally already does, except with serious our of orderness: switches happen to always call the TSC if the TSC is usable, to maintain the the pcpu switchtime variable. The call for this will give a tsc value for the new CPU that is in advance of the old one, provided there all the TSC are in sync and there is sufficient monotonicity across CPUs. Then the loop will see that its tsc is old, and repeat. I am only half serious in proposing the above. If you want to be slow then you can do useful work like ensuring monotonicity across all CPUs in much the same time that is wasted by stalling the hardware until everything is serialized. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 13:44:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD6291065673; Thu, 26 Jul 2012 13:44:49 +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 950CD8FC12; Thu, 26 Jul 2012 13:44:49 +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 q6QDinQm089869; Thu, 26 Jul 2012 13:44:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6QDinAs089862; Thu, 26 Jul 2012 13:44:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201207261344.q6QDinAs089862@svn.freebsd.org> From: Alexander Motin Date: Thu, 26 Jul 2012 13:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238805 - in head: share/man/man4 sys/conf sys/dev/ahci sys/modules/ahci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 13:44:49 -0000 Author: mav Date: Thu Jul 26 13:44:48 2012 New Revision: 238805 URL: http://svn.freebsd.org/changeset/base/238805 Log: Refactor enclosure manegement support in ahci(4). Move it out into separate subdevice ahciem. Emulate SEMB SES device from AHCI LED interface to expose it to users in form of ses(4) CAM device. If we ever see AHCI controllers supporting SES of SAF-TE over I2C as described by specification, they should fit well into this new picture. Sponsored by: iXsystems, Inc. Added: head/sys/dev/ahci/ahciem.c (contents, props changed) Modified: head/share/man/man4/ahci.4 head/sys/conf/files head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci.h head/sys/modules/ahci/Makefile Modified: head/share/man/man4/ahci.4 ============================================================================== --- head/share/man/man4/ahci.4 Thu Jul 26 12:18:23 2012 (r238804) +++ head/share/man/man4/ahci.4 Thu Jul 26 13:44:48 2012 (r238805) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2009 Alexander Motin +.\" Copyright (c) 2009-2012 Alexander Motin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 18, 2012 +.Dd July 25, 2012 .Dt AHCI 4 .Os .Sh NAME @@ -132,7 +132,9 @@ Driver supports "LED" enclosure manageme When supported by hardware, it allows to control per-port activity, locate and fault LEDs via the .Xr led 4 -API for localization and status reporting purposes. +API or emulated +.Xr ses 4 +device for localization and status reporting purposes. Supporting AHCI controllers may transmit that information to the backplane controllers via SGPIO interface. Backplane controllers interpret received statuses in some way (IBPI standard) to report them using present indicators. @@ -153,11 +155,11 @@ it supports AHCI part of legacy-PATA + A such as JMicron JMB36x and Marvell 88SE61xx. .Sh FILES .Bl -tag -width /dev/led/ahcich*.locate -.It Pa /dev/led/ahcich*.act +.It Pa /dev/led/ahci*.*.act activity LED device nodes -.It Pa /dev/led/ahcich*.fault +.It Pa /dev/led/ahci*.*.fault fault LED device nodes -.It Pa /dev/led/ahcich*.locate +.It Pa /dev/led/ahci*.*.locate locate LED device nodes .El .Sh SEE ALSO @@ -166,7 +168,8 @@ locate LED device nodes .Xr cam 4 , .Xr cd 4 , .Xr da 4 , -.Xr sa 4 +.Xr sa 4 , +.Xr ses 4 .Sh HISTORY The .Nm Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jul 26 12:18:23 2012 (r238804) +++ head/sys/conf/files Thu Jul 26 13:44:48 2012 (r238805) @@ -639,6 +639,7 @@ dev/aha/aha_isa.c optional aha isa dev/aha/aha_mca.c optional aha mca dev/ahb/ahb.c optional ahb eisa dev/ahci/ahci.c optional ahci pci +dev/ahci/ahciem.c optional ahci pci dev/aic/aic.c optional aic dev/aic/aic_pccard.c optional aic pccard dev/aic7xxx/ahc_eisa.c optional ahc eisa Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Thu Jul 26 12:18:23 2012 (r238804) +++ head/sys/dev/ahci/ahci.c Thu Jul 26 13:44:48 2012 (r238805) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009 Alexander Motin + * Copyright (c) 2009-2012 Alexander Motin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,21 +31,16 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include #include #include -#include -#include -#include #include #include #include #include -#include #include #include #include "ahci.h" @@ -69,7 +64,6 @@ static int ahci_ch_resume(device_t dev); static void ahci_ch_pm(void *arg); static void ahci_ch_intr_locked(void *data); static void ahci_ch_intr(void *data); -static void ahci_ch_led(void *priv, int onoff); static int ahci_ctlr_reset(device_t dev); static int ahci_ctlr_setup(device_t dev); static void ahci_begin_transaction(device_t dev, union ccb *ccb); @@ -441,7 +435,6 @@ ahci_attach(device_t dev) ctlr->caps &= ~AHCI_CAP_SNCQ; if ((ctlr->caps & AHCI_CAP_CCCS) == 0) ctlr->ccc = 0; - mtx_init(&ctlr->em_mtx, "AHCI EM lock", NULL, MTX_DEF); ctlr->emloc = ATA_INL(ctlr->r_mem, AHCI_EM_LOC); ahci_ctlr_setup(dev); /* Setup interrupts. */ @@ -494,17 +487,6 @@ ahci_attach(device_t dev) (ctlr->caps2 & AHCI_CAP2_NVMP) ? " NVMP":"", (ctlr->caps2 & AHCI_CAP2_BOH) ? " BOH":""); } - if (bootverbose && (ctlr->caps & AHCI_CAP_EMS)) { - device_printf(dev, "EM Caps:%s%s%s%s%s%s%s%s\n", - (ctlr->capsem & AHCI_EM_PM) ? " PM":"", - (ctlr->capsem & AHCI_EM_ALHD) ? " ALHD":"", - (ctlr->capsem & AHCI_EM_XMT) ? " XMT":"", - (ctlr->capsem & AHCI_EM_SMB) ? " SMB":"", - (ctlr->capsem & AHCI_EM_SGPIO) ? " SGPIO":"", - (ctlr->capsem & AHCI_EM_SES2) ? " SES-2":"", - (ctlr->capsem & AHCI_EM_SAFTE) ? " SAF-TE":"", - (ctlr->capsem & AHCI_EM_LED) ? " LED":""); - } /* Attach all channels on this controller */ for (unit = 0; unit < ctlr->channels; unit++) { child = device_add_child(dev, "ahcich", -1); @@ -516,6 +498,13 @@ ahci_attach(device_t dev) if ((ctlr->ichannels & (1 << unit)) == 0) device_disable(child); } + if (ctlr->caps & AHCI_CAP_EMS) { + child = device_add_child(dev, "ahciem", -1); + if (child == NULL) + device_printf(dev, "failed to add enclosure device\n"); + else + device_set_ivars(child, (void *)(intptr_t)-1); + } bus_generic_attach(dev); return 0; } @@ -543,7 +532,6 @@ ahci_detach(device_t dev) rman_fini(&ctlr->sc_iomem); if (ctlr->r_mem) bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); - mtx_destroy(&ctlr->em_mtx); return (0); } @@ -753,16 +741,34 @@ ahci_alloc_resource(device_t dev, device u_long start, u_long end, u_long count, u_int flags) { struct ahci_controller *ctlr = device_get_softc(dev); - int unit = ((struct ahci_channel *)device_get_softc(child))->unit; - struct resource *res = NULL; - int offset = AHCI_OFFSET + (unit << 7); + struct resource *res; long st; + int offset, size, unit; + unit = (intptr_t)device_get_ivars(child); + res = NULL; switch (type) { case SYS_RES_MEMORY: + if (unit >= 0) { + offset = AHCI_OFFSET + (unit << 7); + size = 128; + } else if (*rid == 0) { + offset = AHCI_EM_CTL; + size = 4; + } else { + offset = (ctlr->emloc & 0xffff0000) >> 14; + size = (ctlr->emloc & 0x0000ffff) << 2; + if (*rid != 1) { + if (*rid == 2 && (ctlr->capsem & + (AHCI_EM_XMT | AHCI_EM_SMB)) == 0) + offset += size; + else + break; + } + } st = rman_get_start(ctlr->r_mem); res = rman_reserve_resource(&ctlr->sc_iomem, st + offset, - st + offset + 127, 128, RF_ACTIVE, child); + st + offset + size - 1, size, RF_ACTIVE, child); if (res) { bus_space_handle_t bsh; bus_space_tag_t bst; @@ -830,13 +836,13 @@ ahci_teardown_intr(device_t dev, device_ static int ahci_print_child(device_t dev, device_t child) { - int retval; + int retval, channel; retval = bus_print_child_header(dev, child); - retval += printf(" at channel %d", - (int)(intptr_t)device_get_ivars(child)); + channel = (int)(intptr_t)device_get_ivars(child); + if (channel >= 0) + retval += printf(" at channel %d", channel); retval += bus_print_child_footer(dev, child); - return (retval); } @@ -844,9 +850,11 @@ static int ahci_child_location_str(device_t dev, device_t child, char *buf, size_t buflen) { + int channel; - snprintf(buf, buflen, "channel=%d", - (int)(intptr_t)device_get_ivars(child)); + channel = (int)(intptr_t)device_get_ivars(child); + if (channel >= 0) + snprintf(buf, buflen, "channel=%d", channel); return (0); } @@ -910,7 +918,6 @@ ahci_ch_attach(device_t dev) struct cam_devq *devq; int rid, error, i, sata_rev = 0; u_int32_t version; - char buf[32]; ch->dev = dev; ch->unit = (intptr_t)device_get_ivars(dev); @@ -950,7 +957,7 @@ ahci_ch_attach(device_t dev) ch->user[i].caps |= CTS_SATA_CAPS_H_DMAAA | CTS_SATA_CAPS_H_AN; } - rid = ch->unit; + rid = 0; if (!(ch->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE))) return (ENXIO); @@ -1019,25 +1026,6 @@ ahci_ch_attach(device_t dev) ahci_ch_pm, dev); } mtx_unlock(&ch->mtx); - if ((ch->caps & AHCI_CAP_EMS) && - (ctlr->capsem & AHCI_EM_LED)) { - for (i = 0; i < AHCI_NUM_LEDS; i++) { - ch->leds[i].dev = dev; - ch->leds[i].num = i; - } - if ((ctlr->capsem & AHCI_EM_ALHD) == 0) { - snprintf(buf, sizeof(buf), "%s.act", - device_get_nameunit(dev)); - ch->leds[0].led = led_create(ahci_ch_led, - &ch->leds[0], buf); - } - snprintf(buf, sizeof(buf), "%s.locate", - device_get_nameunit(dev)); - ch->leds[1].led = led_create(ahci_ch_led, &ch->leds[1], buf); - snprintf(buf, sizeof(buf), "%s.fault", - device_get_nameunit(dev)); - ch->leds[2].led = led_create(ahci_ch_led, &ch->leds[2], buf); - } return (0); err3: @@ -1057,12 +1045,7 @@ static int ahci_ch_detach(device_t dev) { struct ahci_channel *ch = device_get_softc(dev); - int i; - for (i = 0; i < AHCI_NUM_LEDS; i++) { - if (ch->leds[i].led) - led_destroy(ch->leds[i].led); - } mtx_lock(&ch->mtx); xpt_async(AC_LOST_DEVICE, ch->path, NULL); /* Forget about reset. */ @@ -1185,47 +1168,6 @@ static driver_t ahcich_driver = { }; DRIVER_MODULE(ahcich, ahci, ahcich_driver, ahcich_devclass, 0, 0); -static void -ahci_ch_setleds(device_t dev) -{ - struct ahci_channel *ch; - struct ahci_controller *ctlr; - size_t buf; - int i, timeout; - int16_t val; - - ctlr = device_get_softc(device_get_parent(dev)); - ch = device_get_softc(dev); - - val = 0; - for (i = 0; i < AHCI_NUM_LEDS; i++) - val |= ch->leds[i].state << (i * 3); - - buf = (ctlr->emloc & 0xffff0000) >> 14; - mtx_lock(&ctlr->em_mtx); - timeout = 1000; - while (ATA_INL(ctlr->r_mem, AHCI_EM_CTL) & (AHCI_EM_TM | AHCI_EM_RST) && - --timeout > 0) - DELAY(1000); - if (timeout == 0) - device_printf(dev, "EM timeout\n"); - ATA_OUTL(ctlr->r_mem, buf, (1 << 8) | (0 << 16) | (0 << 24)); - ATA_OUTL(ctlr->r_mem, buf + 4, ch->unit | (val << 16)); - ATA_OUTL(ctlr->r_mem, AHCI_EM_CTL, AHCI_EM_TM); - mtx_unlock(&ctlr->em_mtx); -} - -static void -ahci_ch_led(void *priv, int onoff) -{ - struct ahci_led *led; - - led = (struct ahci_led *)priv; - - led->state = onoff; - ahci_ch_setleds(led->dev); -} - struct ahci_dc_cb_args { bus_addr_t maddr; int error; Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Thu Jul 26 12:18:23 2012 (r238804) +++ head/sys/dev/ahci/ahci.h Thu Jul 26 13:44:48 2012 (r238805) @@ -1,6 +1,6 @@ /*- * Copyright (c) 1998 - 2008 Søren Schmidt - * Copyright (c) 2009 Alexander Motin + * Copyright (c) 2009-2012 Alexander Motin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -395,7 +395,6 @@ struct ahci_channel { struct ata_dma dma; /* DMA data */ struct cam_sim *sim; struct cam_path *path; - struct ahci_led leds[3]; uint32_t caps; /* Controller capabilities */ uint32_t caps2; /* Controller capabilities */ uint32_t chcaps; /* Channel capabilities */ @@ -435,6 +434,22 @@ struct ahci_channel { struct ahci_device curr[16]; /* Current settings */ }; +struct ahci_enclosure { + device_t dev; /* Device handle */ + struct resource *r_memc; /* Control register */ + struct resource *r_memt; /* Transmit buffer */ + struct resource *r_memr; /* Recieve buffer */ + struct cam_sim *sim; + struct cam_path *path; + struct mtx mtx; /* state lock */ + struct ahci_led leds[AHCI_MAX_PORTS * 3]; + uint32_t capsem; /* Controller capabilities */ + uint8_t status[AHCI_MAX_PORTS][4]; /* ArrayDev statuses */ + int quirks; + int channels; + int ichannels; +}; + /* structure describing a AHCI controller */ struct ahci_controller { device_t dev; @@ -465,7 +480,6 @@ struct ahci_controller { void (*function)(void *); void *argument; } interrupt[AHCI_MAX_PORTS]; - struct mtx em_mtx; /* EM access lock */ }; enum ahci_err_type { Added: head/sys/dev/ahci/ahciem.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ahci/ahciem.c Thu Jul 26 13:44:48 2012 (r238805) @@ -0,0 +1,600 @@ +/*- + * Copyright (c) 2012 Alexander Motin + * 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, + * without modification, immediately at the beginning of the file. + * 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, + * 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ahci.h" + +#include +#include +#include +#include +#include +#include + +/* local prototypes */ +static void ahciemaction(struct cam_sim *sim, union ccb *ccb); +static void ahciempoll(struct cam_sim *sim); +static int ahci_em_reset(device_t dev); +static void ahci_em_led(void *priv, int onoff); +static void ahci_em_setleds(device_t dev, int c); + +static int +ahci_em_probe(device_t dev) +{ + + device_set_desc_copy(dev, "AHCI enclosure management bridge"); + return (0); +} + +static int +ahci_em_attach(device_t dev) +{ + device_t parent = device_get_parent(dev); + struct ahci_controller *ctlr = device_get_softc(parent); + struct ahci_enclosure *enc = device_get_softc(dev); + struct cam_devq *devq; + int i, c, rid, error; + char buf[32]; + + enc->dev = dev; + enc->quirks = ctlr->quirks; + enc->channels = ctlr->channels; + enc->ichannels = ctlr->ichannels; + mtx_init(&enc->mtx, "AHCI enclosure lock", NULL, MTX_DEF); + rid = 0; + if (!(enc->r_memc = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE))) + return (ENXIO); + enc->capsem = ATA_INL(enc->r_memc, 0);; + rid = 1; + if (!(enc->r_memt = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE))) { + error = ENXIO; + goto err0; + } + if ((enc->capsem & (AHCI_EM_XMT | AHCI_EM_SMB)) == 0) { + rid = 2; + if (!(enc->r_memr = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE))) { + error = ENXIO; + goto err0; + } + } else + enc->r_memr = NULL; + mtx_lock(&enc->mtx); + ahci_em_reset(dev); + rid = ATA_IRQ_RID; + /* Create the device queue for our SIM. */ + devq = cam_simq_alloc(1); + if (devq == NULL) { + device_printf(dev, "Unable to allocate SIM queue\n"); + error = ENOMEM; + goto err1; + } + /* Construct SIM entry */ + enc->sim = cam_sim_alloc(ahciemaction, ahciempoll, "ahciem", enc, + device_get_unit(dev), &enc->mtx, + 1, 0, devq); + if (enc->sim == NULL) { + cam_simq_free(devq); + device_printf(dev, "Unable to allocate SIM\n"); + error = ENOMEM; + goto err1; + } + if (xpt_bus_register(enc->sim, dev, 0) != CAM_SUCCESS) { + device_printf(dev, "unable to register xpt bus\n"); + error = ENXIO; + goto err2; + } + if (xpt_create_path(&enc->path, /*periph*/NULL, cam_sim_path(enc->sim), + CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + device_printf(dev, "Unable to create path\n"); + error = ENXIO; + goto err3; + } + mtx_unlock(&enc->mtx); + if (bootverbose) { + device_printf(dev, "Caps:%s%s%s%s%s%s%s%s\n", + (enc->capsem & AHCI_EM_PM) ? " PM":"", + (enc->capsem & AHCI_EM_ALHD) ? " ALHD":"", + (enc->capsem & AHCI_EM_XMT) ? " XMT":"", + (enc->capsem & AHCI_EM_SMB) ? " SMB":"", + (enc->capsem & AHCI_EM_SGPIO) ? " SGPIO":"", + (enc->capsem & AHCI_EM_SES2) ? " SES-2":"", + (enc->capsem & AHCI_EM_SAFTE) ? " SAF-TE":"", + (enc->capsem & AHCI_EM_LED) ? " LED":""); + } + if ((enc->capsem & AHCI_EM_LED)) { + for (c = 0; c < enc->channels; c++) { + if ((enc->ichannels & (1 << c)) == 0) + continue; + for (i = 0; i < AHCI_NUM_LEDS; i++) { + enc->leds[c * AHCI_NUM_LEDS + i].dev = dev; + enc->leds[c * AHCI_NUM_LEDS + i].num = + c * AHCI_NUM_LEDS + i; + } + if ((enc->capsem & AHCI_EM_ALHD) == 0) { + snprintf(buf, sizeof(buf), "%s.%d.act", + device_get_nameunit(parent), c); + enc->leds[c * AHCI_NUM_LEDS + 0].led = + led_create(ahci_em_led, + &enc->leds[c * AHCI_NUM_LEDS + 0], buf); + } + snprintf(buf, sizeof(buf), "%s.%d.locate", + device_get_nameunit(parent), c); + enc->leds[c * AHCI_NUM_LEDS + 1].led = + led_create(ahci_em_led, + &enc->leds[c * AHCI_NUM_LEDS + 1], buf); + snprintf(buf, sizeof(buf), "%s.%d.fault", + device_get_nameunit(parent), c); + enc->leds[c * AHCI_NUM_LEDS + 2].led = + led_create(ahci_em_led, + &enc->leds[c * AHCI_NUM_LEDS + 2], buf); + } + } + return (0); + +err3: + xpt_bus_deregister(cam_sim_path(enc->sim)); +err2: + cam_sim_free(enc->sim, /*free_devq*/TRUE); +err1: + mtx_unlock(&enc->mtx); + if (enc->r_memr) + bus_release_resource(dev, SYS_RES_MEMORY, 2, enc->r_memr); +err0: + if (enc->r_memt) + bus_release_resource(dev, SYS_RES_MEMORY, 1, enc->r_memt); + bus_release_resource(dev, SYS_RES_MEMORY, 0, enc->r_memc); + mtx_destroy(&enc->mtx); + return (error); +} + +static int +ahci_em_detach(device_t dev) +{ + struct ahci_enclosure *enc = device_get_softc(dev); + int i; + + for (i = 0; i < enc->channels * AHCI_NUM_LEDS; i++) { + if (enc->leds[i].led) + led_destroy(enc->leds[i].led); + } + mtx_lock(&enc->mtx); + xpt_async(AC_LOST_DEVICE, enc->path, NULL); + xpt_free_path(enc->path); + xpt_bus_deregister(cam_sim_path(enc->sim)); + cam_sim_free(enc->sim, /*free_devq*/TRUE); + mtx_unlock(&enc->mtx); + + bus_release_resource(dev, SYS_RES_MEMORY, 0, enc->r_memc); + bus_release_resource(dev, SYS_RES_MEMORY, 1, enc->r_memt); + if (enc->r_memr) + bus_release_resource(dev, SYS_RES_MEMORY, 2, enc->r_memr); + mtx_destroy(&enc->mtx); + return (0); +} + +static int +ahci_em_reset(device_t dev) +{ + struct ahci_enclosure *enc; + int i, timeout; + + enc = device_get_softc(dev); + ATA_OUTL(enc->r_memc, 0, AHCI_EM_RST); + timeout = 1000; + while ((ATA_INL(enc->r_memc, 0) & AHCI_EM_RST) && + --timeout > 0) + DELAY(1000); + if (timeout == 0) { + device_printf(dev, "EM timeout\n"); + return (1); + } + for (i = 0; i < enc->channels; i++) + ahci_em_setleds(dev, i); + return (0); +} + +static int +ahci_em_suspend(device_t dev) +{ + struct ahci_enclosure *enc = device_get_softc(dev); + + mtx_lock(&enc->mtx); + xpt_freeze_simq(enc->sim, 1); + mtx_unlock(&enc->mtx); + return (0); +} + +static int +ahci_em_resume(device_t dev) +{ + struct ahci_enclosure *enc = device_get_softc(dev); + + mtx_lock(&enc->mtx); + ahci_em_reset(dev); + xpt_release_simq(enc->sim, TRUE); + mtx_unlock(&enc->mtx); + return (0); +} + +devclass_t ahciem_devclass; +static device_method_t ahciem_methods[] = { + DEVMETHOD(device_probe, ahci_em_probe), + DEVMETHOD(device_attach, ahci_em_attach), + DEVMETHOD(device_detach, ahci_em_detach), + DEVMETHOD(device_suspend, ahci_em_suspend), + DEVMETHOD(device_resume, ahci_em_resume), + { 0, 0 } +}; +static driver_t ahciem_driver = { + "ahciem", + ahciem_methods, + sizeof(struct ahci_enclosure) +}; +DRIVER_MODULE(ahciem, ahci, ahciem_driver, ahciem_devclass, 0, 0); + +static void +ahci_em_setleds(device_t dev, int c) +{ + struct ahci_enclosure *enc; + int timeout; + int16_t val; + + enc = device_get_softc(dev); + + val = 0; + if (enc->status[c][2] & 0x80) /* Activity */ + val |= (1 << 0); + if (enc->status[c][2] & SESCTL_RQSID) /* Identification */ + val |= (1 << 3); + else if (enc->status[c][3] & SESCTL_RQSFLT) /* Fault */ + val |= (1 << 6); + else if (enc->status[c][1] & 0x02) /* Rebuild */ + val |= (1 << 6) | (1 << 3); + + timeout = 10000; + while (ATA_INL(enc->r_memc, 0) & (AHCI_EM_TM | AHCI_EM_RST) && + --timeout > 0) + DELAY(100); + if (timeout == 0) + device_printf(dev, "Transmit timeout\n"); + ATA_OUTL(enc->r_memt, 0, (1 << 8) | (0 << 16) | (0 << 24)); + ATA_OUTL(enc->r_memt, 4, c | (0 << 8) | (val << 16)); + ATA_OUTL(enc->r_memc, 0, AHCI_EM_TM); +} + +static void +ahci_em_led(void *priv, int onoff) +{ + struct ahci_led *led; + struct ahci_enclosure *enc; + int c, l; + + led = (struct ahci_led *)priv; + enc = device_get_softc(led->dev); + c = led->num / AHCI_NUM_LEDS; + l = led->num % AHCI_NUM_LEDS; + + if (l == 0) { + if (onoff) + enc->status[c][2] |= 0x80; + else + enc->status[c][2] &= ~0x80; + } else if (l == 1) { + if (onoff) + enc->status[c][2] |= SESCTL_RQSID; + else + enc->status[c][2] &= ~SESCTL_RQSID; + } else if (l == 2) { + if (onoff) + enc->status[c][3] |= SESCTL_RQSFLT; + else + enc->status[c][3] &= SESCTL_RQSFLT; + } + ahci_em_setleds(led->dev, c); +} + +static int +ahci_check_ids(device_t dev, union ccb *ccb) +{ + + if (ccb->ccb_h.target_id != 0) { + ccb->ccb_h.status = CAM_TID_INVALID; + xpt_done(ccb); + return (-1); + } + if (ccb->ccb_h.target_lun != 0) { + ccb->ccb_h.status = CAM_LUN_INVALID; + xpt_done(ccb); + return (-1); + } + return (0); +} + +static void +ahci_em_emulate_ses_on_led(device_t dev, union ccb *ccb) +{ + struct ahci_enclosure *enc; + struct ses_status_page *page; + struct ses_status_array_dev_slot *ads, *ads0; + struct ses_elm_desc_hdr *elmd; + uint8_t *buf; + int i; + + enc = device_get_softc(dev); + buf = ccb->ataio.data_ptr; + + /* General request validation. */ + if (ccb->ataio.cmd.command != ATA_SEP_ATTN || + ccb->ataio.dxfer_len < ccb->ataio.cmd.sector_count * 4) { + ccb->ccb_h.status = CAM_REQ_INVALID; + goto out; + } + + /* SEMB IDENTIFY */ + if (ccb->ataio.cmd.features == 0xEC && + ccb->ataio.cmd.sector_count >= 16) { + bzero(buf, ccb->ataio.dxfer_len); + buf[0] = 64; /* Valid bytes. */ + strncpy(&buf[10], "AHCI ", SID_VENDOR_SIZE); + strncpy(&buf[18], "SGPIO Enclosure ", SID_PRODUCT_SIZE); + strncpy(&buf[34], "1.00", SID_REVISION_SIZE); + strncpy(&buf[39], "0001", 4); + strncpy(&buf[43], "S-E-S ", 6); + strncpy(&buf[49], "2.00", 4); + ccb->ccb_h.status = CAM_REQ_CMP; + goto out; + } + + /* SEMB RECEIVE DIAGNOSTIC RESULT (0) */ + page = (struct ses_status_page *)buf; + if (ccb->ataio.cmd.lba_low == 0x02 && + ccb->ataio.cmd.features == 0x00 && + ccb->ataio.cmd.sector_count >= 2) { + bzero(buf, ccb->ataio.dxfer_len); + page->hdr.page_code = 0; + scsi_ulto2b(3, page->hdr.length); + buf[4] = 0; + buf[5] = 1; + buf[6] = 2; + ccb->ccb_h.status = CAM_REQ_CMP; + goto out; + } + + /* SEMB RECEIVE DIAGNOSTIC RESULT (1) */ + if (ccb->ataio.cmd.lba_low == 0x02 && + ccb->ataio.cmd.features == 0x01 && + ccb->ataio.cmd.sector_count >= 13) { + struct ses_enc_desc *ed; + struct ses_elm_type_desc *td; + + bzero(buf, ccb->ataio.dxfer_len); + page->hdr.page_code = 0x01; + scsi_ulto2b(4 + 4 + 36 + 4, page->hdr.length); + ed = (struct ses_enc_desc *)&buf[8]; + ed->byte0 = 0x11; + ed->subenc_id = 0; + ed->num_types = 1; + ed->length = 36; + strncpy(ed->vendor_id, "AHCI ", SID_VENDOR_SIZE); + strncpy(ed->product_id, "SGPIO Enclosure ", SID_PRODUCT_SIZE); + strncpy(ed->product_rev, " ", SID_REVISION_SIZE); + td = (struct ses_elm_type_desc *)ses_enc_desc_next(ed); + td->etype_elm_type = 0x17; + td->etype_maxelt = enc->channels; + td->etype_subenc = 0; + td->etype_txt_len = 0; + ccb->ccb_h.status = CAM_REQ_CMP; + goto out; + } + + /* SEMB RECEIVE DIAGNOSTIC RESULT (2) */ + if (ccb->ataio.cmd.lba_low == 0x02 && + ccb->ataio.cmd.features == 0x02 && + ccb->ataio.cmd.sector_count >= (3 + enc->channels)) { + bzero(buf, ccb->ataio.dxfer_len); + page->hdr.page_code = 0x02; + scsi_ulto2b(4 + 4 * (1 + enc->channels), + page->hdr.length); + for (i = 0; i < enc->channels; i++) { + ads = &page->elements[i + 1].array_dev_slot; + memcpy(ads, enc->status[i], 4); + ads->common.bytes[0] |= + (enc->ichannels & (1 << i)) ? + SES_OBJSTAT_UNKNOWN : + SES_OBJSTAT_NOTINSTALLED; + } + ccb->ccb_h.status = CAM_REQ_CMP; + goto out; + } + + /* SEMB SEND DIAGNOSTIC (2) */ + if (ccb->ataio.cmd.lba_low == 0x82 && + ccb->ataio.cmd.features == 0x02 && + ccb->ataio.cmd.sector_count >= (3 + enc->channels)) { + ads0 = &page->elements[0].array_dev_slot; + for (i = 0; i < enc->channels; i++) { + ads = &page->elements[i + 1].array_dev_slot; + if (ads->common.bytes[0] & SESCTL_CSEL) { + enc->status[i][0] = 0; + enc->status[i][1] = + ads->bytes[0] & 0x02; + enc->status[i][2] = + ads->bytes[1] & (0x80 | SESCTL_RQSID); + enc->status[i][3] = + ads->bytes[2] & SESCTL_RQSFLT; + ahci_em_setleds(dev, i); + } else if (ads0->common.bytes[0] & SESCTL_CSEL) { + enc->status[i][0] = 0; + enc->status[i][1] = + ads0->bytes[0] & 0x02; + enc->status[i][2] = + ads0->bytes[1] & (0x80 | SESCTL_RQSID); + enc->status[i][3] = + ads0->bytes[2] & SESCTL_RQSFLT; + ahci_em_setleds(dev, i); + } + } + ccb->ccb_h.status = CAM_REQ_CMP; + goto out; + } + + /* SEMB RECEIVE DIAGNOSTIC RESULT (7) */ + if (ccb->ataio.cmd.lba_low == 0x02 && + ccb->ataio.cmd.features == 0x07 && + ccb->ataio.cmd.sector_count >= (3 + 3 * enc->channels)) { + bzero(buf, ccb->ataio.dxfer_len); + page->hdr.page_code = 0x07; + scsi_ulto2b(4 + 4 + 12 * enc->channels, + page->hdr.length); + for (i = 0; i < enc->channels; i++) { + elmd = (struct ses_elm_desc_hdr *)&buf[8 + 4 + 12 * i]; + scsi_ulto2b(8, elmd->length); + snprintf((char *)(elmd + 1), 9, "SLOT %03d", i); + } + ccb->ccb_h.status = CAM_REQ_CMP; + goto out; + } + + ccb->ccb_h.status = CAM_REQ_INVALID; +out: + xpt_done(ccb); +} + +static void +ahci_em_begin_transaction(device_t dev, union ccb *ccb) +{ + struct ahci_enclosure *enc; + struct ata_res *res; + + enc = device_get_softc(dev); + res = &ccb->ataio.res; + bzero(res, sizeof(*res)); + if ((ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL) && + (ccb->ataio.cmd.control & ATA_A_RESET)) { + res->lba_high = 0xc3; + res->lba_mid = 0x3c; + ccb->ccb_h.status = CAM_REQ_CMP; + xpt_done(ccb); + return; + } + + if (enc->capsem & AHCI_EM_LED) { + ahci_em_emulate_ses_on_led(dev, ccb); + return; + } else + device_printf(dev, "Unsupported enclosure interface\n"); + + ccb->ccb_h.status = CAM_REQ_INVALID; + xpt_done(ccb); +} + +static void +ahciemaction(struct cam_sim *sim, union ccb *ccb) +{ + device_t dev, parent; + struct ahci_enclosure *enc; + + CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, + ("ahciemaction func_code=%x\n", ccb->ccb_h.func_code)); + + enc = cam_sim_softc(sim); + dev = enc->dev; + switch (ccb->ccb_h.func_code) { + case XPT_ATA_IO: /* Execute the requested I/O operation */ + if (ahci_check_ids(dev, ccb)) + return; + ahci_em_begin_transaction(dev, ccb); + return; + case XPT_RESET_BUS: /* Reset the specified bus */ + case XPT_RESET_DEV: /* Bus Device Reset the specified device */ + ahci_em_reset(dev); + ccb->ccb_h.status = CAM_REQ_CMP; + break; + case XPT_PATH_INQ: /* Path routing inquiry */ + { + struct ccb_pathinq *cpi = &ccb->cpi; + + parent = device_get_parent(dev); + cpi->version_num = 1; /* XXX??? */ + cpi->hba_inquiry = PI_SDTR_ABLE; + cpi->target_sprt = 0; + cpi->hba_misc = PIM_SEQSCAN; + cpi->hba_eng_cnt = 0; + cpi->max_target = 0; + cpi->max_lun = 0; + cpi->initiator_id = 0; + cpi->bus_id = cam_sim_bus(sim); + cpi->base_transfer_speed = 150000; + strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); + strncpy(cpi->hba_vid, "AHCI", HBA_IDLEN); + strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); + cpi->unit_number = cam_sim_unit(sim); + cpi->transport = XPORT_SATA; + cpi->transport_version = XPORT_VERSION_UNSPECIFIED; + cpi->protocol = PROTO_ATA; + cpi->protocol_version = PROTO_VERSION_UNSPECIFIED; + cpi->maxio = MAXPHYS; + cpi->hba_vendor = pci_get_vendor(parent); + cpi->hba_device = pci_get_device(parent); + cpi->hba_subvendor = pci_get_subvendor(parent); + cpi->hba_subdevice = pci_get_subdevice(parent); + cpi->ccb_h.status = CAM_REQ_CMP; + break; + } + default: + ccb->ccb_h.status = CAM_REQ_INVALID; + break; + } + xpt_done(ccb); +} + +static void +ahciempoll(struct cam_sim *sim) +{ + +} Modified: head/sys/modules/ahci/Makefile ============================================================================== --- head/sys/modules/ahci/Makefile Thu Jul 26 12:18:23 2012 (r238804) +++ head/sys/modules/ahci/Makefile Thu Jul 26 13:44:48 2012 (r238805) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../dev/ahci KMOD= ahci -SRCS= ahci.c ahci.h device_if.h bus_if.h pci_if.h opt_cam.h +SRCS= ahci.c ahciem.c ahci.h device_if.h bus_if.h pci_if.h opt_cam.h .include From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 13:58:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2915A106564A; Thu, 26 Jul 2012 13:58:44 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10B088FC0C; Thu, 26 Jul 2012 13:58:44 +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 q6QDwiiW090967; Thu, 26 Jul 2012 13:58:44 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6QDwhnF090964; Thu, 26 Jul 2012 13:58:43 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201207261358.q6QDwhnF090964@svn.freebsd.org> From: Matt Jacob Date: Thu, 26 Jul 2012 13:58:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238806 - head/sys/dev/ispfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 13:58:44 -0000 Author: mjacob Date: Thu Jul 26 13:58:43 2012 New Revision: 238806 URL: http://svn.freebsd.org/changeset/base/238806 Log: Switch to using FC-Tape firmware. Sponsered by: Spectralogic MFC after: 1 week Modified: head/sys/dev/ispfw/asm_2300.h Modified: head/sys/dev/ispfw/asm_2300.h ============================================================================== --- head/sys/dev/ispfw/asm_2300.h Thu Jul 26 13:44:48 2012 (r238805) +++ head/sys/dev/ispfw/asm_2300.h Thu Jul 26 13:58:43 2012 (r238806) @@ -27,17 +27,17 @@ /************************************************************************ * * - * --- ISP2300 Initiator/Target Firmware --- * - * with Fabric support (Public Loop), with expanded LUN * - * addressing and 2K port logins. * + * --- ISP2300 Initiator/Target Firmware --- * + * with Fabric (Public Loop), Point-point, * + * expanded LUN addressing for FCTAPE, and 2K port logins * * * ************************************************************************/ /* - * Firmware Version 3.03.26 (16:54 Aug 14, 2007) + * Firmware Version 3.03.26 (16:58 Aug 14, 2007) */ static const uint16_t isp_2300_risc_code[] = { - 0x0470, 0x0000, 0x0000, 0xd048, 0x0000, 0x0003, 0x0003, 0x001a, - 0x0107, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2032, 0x3030, + 0x0470, 0x0000, 0x0000, 0xddef, 0x0000, 0x0003, 0x0003, 0x001a, + 0x0117, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2032, 0x3030, 0x3120, 0x514c, 0x4f47, 0x4943, 0x2043, 0x4f52, 0x504f, 0x5241, 0x5449, 0x4f4e, 0x2049, 0x5350, 0x3233, 0x3030, 0x2046, 0x6972, 0x6d77, 0x6172, 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030, @@ -50,487 +50,496 @@ static const uint16_t isp_2300_risc_code 0x2c00, 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2e00, 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2000, 0x2001, 0x0000, 0x20c1, 0x0004, 0x20c9, 0x1bff, 0x2059, 0x0000, 0x2b78, - 0x7883, 0x0004, 0x2089, 0x2bf2, 0x2051, 0x1800, 0x2a70, 0x20e1, - 0x0001, 0x20e9, 0x0001, 0x2009, 0x0000, 0x080c, 0x0e53, 0x2029, - 0x3500, 0x2031, 0xffff, 0x2039, 0x34c8, 0x2021, 0x0200, 0x20e9, + 0x7883, 0x0004, 0x2089, 0x2c69, 0x2051, 0x1800, 0x2a70, 0x20e1, + 0x0001, 0x20e9, 0x0001, 0x2009, 0x0000, 0x080c, 0x0e51, 0x2029, + 0x4d00, 0x2031, 0xffff, 0x2039, 0x4cd0, 0x2021, 0x0200, 0x20e9, 0x0001, 0x20a1, 0x0000, 0x20a9, 0x0800, 0x900e, 0x4104, 0x20e9, 0x0001, 0x20a1, 0x1000, 0x900e, 0x2001, 0x0cc0, 0x9084, 0x0fff, 0x20a8, 0x4104, 0x2001, 0x0000, 0x9086, 0x0000, 0x0120, 0x21a8, 0x4104, 0x8001, 0x1de0, 0x756a, 0x766e, 0x7766, 0x7472, 0x7476, - 0x00e6, 0x2071, 0x1aa0, 0x2472, 0x00ee, 0x20a1, 0x1cc8, 0x716c, + 0x00e6, 0x2071, 0x1aac, 0x2472, 0x00ee, 0x20a1, 0x1cd0, 0x716c, 0x810d, 0x810d, 0x810d, 0x810d, 0x918c, 0x000f, 0x2001, 0x0001, 0x9112, 0x900e, 0x21a8, 0x4104, 0x8211, 0x1de0, 0x716c, 0x3400, 0x8001, 0x9102, 0x0120, 0x0218, 0x20a8, 0x900e, 0x4104, 0x2009, 0x1800, 0x810d, 0x810d, 0x810d, 0x810d, 0x810d, 0x918c, 0x001f, 0x2001, 0x0001, 0x9112, 0x20e9, 0x0001, 0x20a1, 0x0800, 0x900e, - 0x20a9, 0x0800, 0x4104, 0x8211, 0x1dd8, 0x080c, 0x0f19, 0x080c, - 0x5f04, 0x080c, 0x9eae, 0x080c, 0x10d0, 0x080c, 0x12b8, 0x080c, - 0x1a99, 0x080c, 0x0d58, 0x080c, 0x1055, 0x080c, 0x32cc, 0x080c, - 0x75f0, 0x080c, 0x6836, 0x080c, 0x8273, 0x080c, 0x235c, 0x080c, - 0x857b, 0x080c, 0x7c59, 0x080c, 0x2191, 0x080c, 0x22c5, 0x080c, - 0x2351, 0x2091, 0x3009, 0x7883, 0x0000, 0x1004, 0x091d, 0x7880, + 0x20a9, 0x0800, 0x4104, 0x8211, 0x1dd8, 0x080c, 0x0f25, 0x080c, + 0x5fc1, 0x080c, 0xa333, 0x080c, 0x10dc, 0x080c, 0x12c4, 0x080c, + 0x1ae1, 0x080c, 0x0d55, 0x080c, 0x1061, 0x080c, 0x3368, 0x080c, + 0x7660, 0x080c, 0x695d, 0x080c, 0x83d5, 0x080c, 0x23a4, 0x080c, + 0x874c, 0x080c, 0x7cf9, 0x080c, 0x21d9, 0x080c, 0x230d, 0x080c, + 0x2399, 0x2091, 0x3009, 0x7883, 0x0000, 0x1004, 0x091d, 0x7880, 0x9086, 0x0002, 0x1190, 0x7883, 0x4000, 0x7837, 0x4000, 0x7833, 0x0010, 0x0e04, 0x0911, 0x2091, 0x5000, 0x2091, 0x4080, 0x2001, - 0x0089, 0x2004, 0xd084, 0x190c, 0x119d, 0x2071, 0x1800, 0x7003, + 0x0089, 0x2004, 0xd084, 0x190c, 0x11a9, 0x2071, 0x1800, 0x7003, 0x0000, 0x2071, 0x1800, 0x7000, 0x908e, 0x0003, 0x1168, 0x080c, - 0x4b82, 0x080c, 0x32f3, 0x080c, 0x7661, 0x080c, 0x6d5c, 0x080c, - 0x829f, 0x080c, 0x2b09, 0x0c68, 0x000b, 0x0c88, 0x0940, 0x0941, - 0x0ade, 0x093e, 0x0b9e, 0x0d57, 0x0d57, 0x0d57, 0x080c, 0x0dc4, + 0x4c32, 0x080c, 0x338f, 0x080c, 0x76d1, 0x080c, 0x6e62, 0x080c, + 0x8401, 0x080c, 0x2b72, 0x0c68, 0x000b, 0x0c88, 0x0940, 0x0941, + 0x0ade, 0x093e, 0x0b9e, 0x0d54, 0x0d54, 0x0d54, 0x080c, 0x0dc3, 0x0005, 0x0126, 0x00f6, 0x2091, 0x8000, 0x7000, 0x9086, 0x0001, - 0x1904, 0x0ab1, 0x080c, 0x0ecd, 0x080c, 0x72e5, 0x0150, 0x080c, - 0x7308, 0x15b0, 0x2079, 0x0100, 0x7828, 0x9085, 0x1800, 0x782a, - 0x0478, 0x080c, 0x7212, 0x7000, 0x9086, 0x0001, 0x1904, 0x0ab1, - 0x7094, 0x9086, 0x0029, 0x1904, 0x0ab1, 0x080c, 0x8253, 0x080c, - 0x8245, 0x2079, 0x0100, 0x782f, 0x0008, 0x2001, 0x0161, 0x2003, + 0x1904, 0x0ab1, 0x080c, 0x0e93, 0x080c, 0x7351, 0x0150, 0x080c, + 0x7374, 0x15b0, 0x2079, 0x0100, 0x7828, 0x9085, 0x1800, 0x782a, + 0x0478, 0x080c, 0x727e, 0x7000, 0x9086, 0x0001, 0x1904, 0x0ab1, + 0x7094, 0x9086, 0x0029, 0x1904, 0x0ab1, 0x080c, 0x83b5, 0x080c, + 0x83a7, 0x2079, 0x0100, 0x782f, 0x0008, 0x2001, 0x0161, 0x2003, 0x0001, 0x7827, 0xffff, 0x7a28, 0x9295, 0x5e2f, 0x7a2a, 0x2011, - 0x7176, 0x080c, 0x835e, 0x2011, 0x7169, 0x080c, 0x8474, 0x2011, - 0x5d5f, 0x080c, 0x835e, 0x2011, 0x8030, 0x901e, 0x7392, 0x04d0, - 0x080c, 0x5607, 0x2079, 0x0100, 0x7844, 0x9005, 0x1904, 0x0ab1, - 0x2011, 0x5d5f, 0x080c, 0x835e, 0x2011, 0x7176, 0x080c, 0x835e, - 0x2011, 0x7169, 0x080c, 0x8474, 0x2001, 0x0265, 0x2001, 0x0205, + 0x71cd, 0x080c, 0x84c2, 0x2011, 0x71c0, 0x080c, 0x85e0, 0x2011, + 0x5e1c, 0x080c, 0x84c2, 0x2011, 0x8030, 0x901e, 0x7392, 0x04d0, + 0x080c, 0x56c4, 0x2079, 0x0100, 0x7844, 0x9005, 0x1904, 0x0ab1, + 0x2011, 0x5e1c, 0x080c, 0x84c2, 0x2011, 0x71cd, 0x080c, 0x84c2, + 0x2011, 0x71c0, 0x080c, 0x85e0, 0x2001, 0x0265, 0x2001, 0x0205, 0x2003, 0x0000, 0x7840, 0x9084, 0xfffb, 0x7842, 0x2001, 0x1983, - 0x2004, 0x9005, 0x1140, 0x00c6, 0x2061, 0x0100, 0x080c, 0x5eac, - 0x00ce, 0x0804, 0x0ab1, 0x780f, 0x006b, 0x7a28, 0x080c, 0x72ed, + 0x2004, 0x9005, 0x1140, 0x00c6, 0x2061, 0x0100, 0x080c, 0x5f69, + 0x00ce, 0x0804, 0x0ab1, 0x780f, 0x006b, 0x7a28, 0x080c, 0x7359, 0x0118, 0x9295, 0x5e2f, 0x0010, 0x9295, 0x402f, 0x7a2a, 0x2011, - 0x8010, 0x73d4, 0x2001, 0x1984, 0x2003, 0x0001, 0x080c, 0x29ae, - 0x080c, 0x4abd, 0x7244, 0xc284, 0x7246, 0x2001, 0x180c, 0x200c, - 0xc1ac, 0xc1cc, 0x2102, 0x080c, 0x98cb, 0x2011, 0x0004, 0x080c, - 0xb965, 0x080c, 0x664c, 0x080c, 0x72e5, 0x1120, 0x080c, 0x29f2, - 0x02e0, 0x0400, 0x080c, 0x5eb3, 0x0140, 0x7093, 0x0001, 0x70cf, - 0x0000, 0x080c, 0x57d9, 0x0804, 0x0ab1, 0x080c, 0x55a7, 0xd094, - 0x0188, 0x2011, 0x180c, 0x2204, 0xc0cd, 0x2012, 0x080c, 0x55ab, - 0xd0d4, 0x1118, 0x080c, 0x29f2, 0x1270, 0x2011, 0x180c, 0x2204, - 0xc0bc, 0x00a8, 0x080c, 0x55ab, 0xd0d4, 0x1db8, 0x2011, 0x180c, + 0x8010, 0x73d4, 0x2001, 0x1984, 0x2003, 0x0001, 0x080c, 0x2a17, + 0x080c, 0x4b6d, 0x7244, 0xc284, 0x7246, 0x2001, 0x180c, 0x200c, + 0xc1ac, 0xc1cc, 0x2102, 0x080c, 0x9b9c, 0x2011, 0x0004, 0x080c, + 0xc1dd, 0x080c, 0x6758, 0x080c, 0x7351, 0x1120, 0x080c, 0x2a5b, + 0x02e0, 0x0400, 0x080c, 0x5f70, 0x0140, 0x7093, 0x0001, 0x70cf, + 0x0000, 0x080c, 0x5896, 0x0804, 0x0ab1, 0x080c, 0x5664, 0xd094, + 0x0188, 0x2011, 0x180c, 0x2204, 0xc0cd, 0x2012, 0x080c, 0x5668, + 0xd0d4, 0x1118, 0x080c, 0x2a5b, 0x1270, 0x2011, 0x180c, 0x2204, + 0xc0bc, 0x00a8, 0x080c, 0x5668, 0xd0d4, 0x1db8, 0x2011, 0x180c, 0x2204, 0xc0bd, 0x0060, 0x2011, 0x180c, 0x2204, 0xc0bd, 0x2012, - 0x080c, 0x673e, 0x1128, 0xd0a4, 0x0118, 0x2204, 0xc0fd, 0x2012, - 0x080c, 0x6704, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e, 0x00a8, 0x707b, - 0x0000, 0x080c, 0x72e5, 0x1130, 0x70ac, 0x9005, 0x1168, 0x080c, - 0xbc7a, 0x0050, 0x080c, 0xbc7a, 0x70d8, 0xd09c, 0x1128, 0x70ac, - 0x9005, 0x0110, 0x080c, 0x5e89, 0x70e3, 0x0000, 0x70df, 0x0000, - 0x70a3, 0x0000, 0x080c, 0x29fa, 0x0228, 0x2011, 0x0101, 0x2204, - 0xc0c4, 0x2012, 0x72d8, 0x080c, 0x72e5, 0x1178, 0x9016, 0x0016, - 0x080c, 0x27b7, 0x2019, 0x194a, 0x211a, 0x001e, 0x705b, 0xffff, - 0x705f, 0x00ef, 0x707f, 0x0000, 0x0020, 0x2019, 0x194a, 0x201b, + 0x080c, 0x6865, 0x1128, 0xd0a4, 0x0118, 0x2204, 0xc0fd, 0x2012, + 0x080c, 0x682b, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e, 0x00a8, 0x707b, + 0x0000, 0x080c, 0x7351, 0x1130, 0x70ac, 0x9005, 0x1168, 0x080c, + 0xc617, 0x0050, 0x080c, 0xc617, 0x70d8, 0xd09c, 0x1128, 0x70ac, + 0x9005, 0x0110, 0x080c, 0x5f46, 0x70e3, 0x0000, 0x70df, 0x0000, + 0x70a3, 0x0000, 0x080c, 0x2a63, 0x0228, 0x2011, 0x0101, 0x2204, + 0xc0c4, 0x2012, 0x72d8, 0x080c, 0x7351, 0x1178, 0x9016, 0x0016, + 0x080c, 0x2820, 0x2019, 0x1949, 0x211a, 0x001e, 0x705b, 0xffff, + 0x705f, 0x00ef, 0x707f, 0x0000, 0x0020, 0x2019, 0x1949, 0x201b, 0x0000, 0x2079, 0x185e, 0x7804, 0xd0ac, 0x0108, 0xc295, 0x72da, - 0x080c, 0x72e5, 0x0118, 0x9296, 0x0004, 0x0548, 0x2011, 0x0001, - 0x080c, 0xb965, 0x70a7, 0x0000, 0x70ab, 0xffff, 0x7003, 0x0002, + 0x080c, 0x7351, 0x0118, 0x9296, 0x0004, 0x0548, 0x2011, 0x0001, + 0x080c, 0xc1dd, 0x70a7, 0x0000, 0x70ab, 0xffff, 0x7003, 0x0002, 0x2079, 0x0100, 0x7827, 0x0003, 0x7828, 0x9085, 0x0003, 0x782a, - 0x00fe, 0x080c, 0x2e5f, 0x2011, 0x0005, 0x080c, 0x99d6, 0x080c, - 0x8c37, 0x080c, 0x72e5, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, - 0x080c, 0x27b7, 0x61e2, 0x001e, 0x00ce, 0x012e, 0x0420, 0x70a7, + 0x00fe, 0x080c, 0x2ed6, 0x2011, 0x0005, 0x080c, 0x9ca7, 0x080c, + 0x8e38, 0x080c, 0x7351, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, + 0x080c, 0x2820, 0x61e2, 0x001e, 0x00ce, 0x012e, 0x0420, 0x70a7, 0x0000, 0x70ab, 0xffff, 0x7003, 0x0002, 0x00f6, 0x2079, 0x0100, 0x7827, 0x0003, 0x7828, 0x9085, 0x0003, 0x782a, 0x00fe, 0x2011, - 0x0005, 0x080c, 0x99d6, 0x080c, 0x8c37, 0x080c, 0x72e5, 0x0148, - 0x00c6, 0x2061, 0x0100, 0x0016, 0x080c, 0x27b7, 0x61e2, 0x001e, - 0x00ce, 0x00fe, 0x012e, 0x0005, 0x00c6, 0x00b6, 0x080c, 0x72e5, - 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782, 0x080c, 0x72e5, + 0x0005, 0x080c, 0x9ca7, 0x080c, 0x8e38, 0x080c, 0x7351, 0x0148, + 0x00c6, 0x2061, 0x0100, 0x0016, 0x080c, 0x2820, 0x61e2, 0x001e, + 0x00ce, 0x00fe, 0x012e, 0x0005, 0x00c6, 0x00b6, 0x080c, 0x7351, + 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782, 0x080c, 0x7351, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e, 0x86ff, 0x0138, 0x9180, - 0x1000, 0x2004, 0x905d, 0x0110, 0xb800, 0xd0bc, 0x090c, 0x3162, + 0x1000, 0x2004, 0x905d, 0x0110, 0xb800, 0xd0bc, 0x090c, 0x31fe, 0x8108, 0x1f04, 0x0ac5, 0x707b, 0x0000, 0x707c, 0x9084, 0x00ff, 0x707e, 0x70af, 0x0000, 0x00be, 0x00ce, 0x0005, 0x00b6, 0x0126, 0x2091, 0x8000, 0x7000, 0x9086, 0x0002, 0x1904, 0x0b9b, 0x70a8, - 0x9086, 0xffff, 0x0130, 0x080c, 0x2e5f, 0x080c, 0x8c37, 0x0804, + 0x9086, 0xffff, 0x0130, 0x080c, 0x2ed6, 0x080c, 0x8e38, 0x0804, 0x0b9b, 0x70d8, 0xd0ac, 0x1110, 0xd09c, 0x0558, 0xd084, 0x0548, 0x0006, 0x2001, 0x0103, 0x2003, 0x002b, 0x000e, 0xd08c, 0x0508, - 0x080c, 0x31c5, 0x11d0, 0x70dc, 0x9086, 0xffff, 0x01b0, 0x080c, - 0x2fd8, 0x080c, 0x8c37, 0x70d8, 0xd094, 0x1904, 0x0b9b, 0x2011, - 0x0001, 0x080c, 0xbef8, 0x0110, 0x2011, 0x0003, 0x901e, 0x080c, - 0x3012, 0x080c, 0x8c37, 0x0804, 0x0b9b, 0x70e0, 0x9005, 0x1904, + 0x080c, 0x3261, 0x11d0, 0x70dc, 0x9086, 0xffff, 0x01b0, 0x080c, + 0x306e, 0x080c, 0x8e38, 0x70d8, 0xd094, 0x1904, 0x0b9b, 0x2011, + 0x0001, 0x080c, 0xc8ce, 0x0110, 0x2011, 0x0003, 0x901e, 0x080c, + 0x30a8, 0x080c, 0x8e38, 0x0804, 0x0b9b, 0x70e0, 0x9005, 0x1904, 0x0b9b, 0x70a4, 0x9005, 0x1904, 0x0b9b, 0x70d8, 0xd0a4, 0x0118, - 0xd0b4, 0x0904, 0x0b9b, 0x080c, 0x6704, 0x1904, 0x0b9b, 0x080c, - 0x6757, 0x1904, 0x0b9b, 0x080c, 0x673e, 0x01c0, 0x0156, 0x00c6, - 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x6411, 0x1118, 0xb800, + 0xd0b4, 0x0904, 0x0b9b, 0x080c, 0x682b, 0x1904, 0x0b9b, 0x080c, + 0x687e, 0x1904, 0x0b9b, 0x080c, 0x6865, 0x01c0, 0x0156, 0x00c6, + 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x64fc, 0x1118, 0xb800, 0xd0ec, 0x1138, 0x001e, 0x8108, 0x1f04, 0x0b3b, 0x00ce, 0x015e, 0x0028, 0x001e, 0x00ce, 0x015e, 0x0804, 0x0b9b, 0x0006, 0x2001, - 0x0103, 0x2003, 0x006b, 0x000e, 0x2011, 0x1990, 0x080c, 0x0f89, - 0x2011, 0x19aa, 0x080c, 0x0f89, 0x7030, 0xc08c, 0x7032, 0x7003, - 0x0003, 0x70ab, 0xffff, 0x080c, 0x0ecd, 0x9006, 0x080c, 0x264c, - 0x080c, 0x31c5, 0x0118, 0x080c, 0x4c5a, 0x0050, 0x0036, 0x0046, - 0x2019, 0xffff, 0x2021, 0x0006, 0x080c, 0x4c74, 0x004e, 0x003e, - 0x00f6, 0x2079, 0x0100, 0x080c, 0x7308, 0x0150, 0x080c, 0x72e5, + 0x0103, 0x2003, 0x006b, 0x000e, 0x2011, 0x1990, 0x080c, 0x0f95, + 0x2011, 0x19aa, 0x080c, 0x0f95, 0x7030, 0xc08c, 0x7032, 0x7003, + 0x0003, 0x70ab, 0xffff, 0x080c, 0x0e75, 0x9006, 0x080c, 0x26b1, + 0x080c, 0x3261, 0x0118, 0x080c, 0x4d0a, 0x0050, 0x0036, 0x0046, + 0x2019, 0xffff, 0x2021, 0x0006, 0x080c, 0x4d24, 0x004e, 0x003e, + 0x00f6, 0x2079, 0x0100, 0x080c, 0x7374, 0x0150, 0x080c, 0x7351, 0x7828, 0x0118, 0x9084, 0xe1ff, 0x0010, 0x9084, 0xffdf, 0x782a, 0x00fe, 0x2001, 0x19c5, 0x2004, 0x9086, 0x0005, 0x1120, 0x2011, - 0x0000, 0x080c, 0x99d6, 0x2011, 0x0000, 0x080c, 0x99e0, 0x080c, - 0x8c37, 0x080c, 0x8d06, 0x012e, 0x00be, 0x0005, 0x0016, 0x0046, + 0x0000, 0x080c, 0x9ca7, 0x2011, 0x0000, 0x080c, 0x9cb1, 0x080c, + 0x8e38, 0x080c, 0x8f0e, 0x012e, 0x00be, 0x0005, 0x0016, 0x0046, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0100, 0x7904, 0x918c, - 0xfffd, 0x7906, 0x2009, 0x00f7, 0x080c, 0x5e72, 0x7940, 0x918c, + 0xfffd, 0x7906, 0x2009, 0x00f7, 0x080c, 0x5f2f, 0x7940, 0x918c, 0x0010, 0x7942, 0x7924, 0xd1b4, 0x0110, 0x7827, 0x0040, 0xd19c, 0x0110, 0x7827, 0x0008, 0x0006, 0x0036, 0x0156, 0x7954, 0xd1ac, 0x1904, 0x0c2b, 0x2001, 0x1984, 0x2004, 0x9005, 0x1518, 0x080c, - 0x2a75, 0x1148, 0x2001, 0x0001, 0x080c, 0x29dd, 0x2001, 0x0001, - 0x080c, 0x29c0, 0x00b8, 0x080c, 0x2a7d, 0x1138, 0x9006, 0x080c, - 0x29dd, 0x9006, 0x080c, 0x29c0, 0x0068, 0x080c, 0x2a85, 0x1d50, - 0x2001, 0x1974, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c, 0x27eb, - 0x0804, 0x0d0a, 0x080c, 0x72f6, 0x0148, 0x080c, 0x7308, 0x1118, - 0x080c, 0x75eb, 0x0050, 0x080c, 0x72ed, 0x0dd0, 0x080c, 0x75e6, - 0x080c, 0x75dc, 0x080c, 0x7212, 0x0058, 0x080c, 0x72e5, 0x0140, - 0x2009, 0x00f8, 0x080c, 0x5e72, 0x7843, 0x0090, 0x7843, 0x0010, - 0x20a9, 0x09c4, 0x7820, 0xd09c, 0x1138, 0x080c, 0x72e5, 0x0138, - 0x7824, 0xd0ac, 0x1904, 0x0d0f, 0x1f04, 0x0c0a, 0x0070, 0x7824, - 0x080c, 0x72ff, 0x0118, 0xd0ac, 0x1904, 0x0d0f, 0x9084, 0x1800, - 0x0d98, 0x7003, 0x0001, 0x0804, 0x0d0f, 0x2001, 0x0001, 0x080c, - 0x264c, 0x0804, 0x0d22, 0x2001, 0x1984, 0x2004, 0x9005, 0x1518, - 0x080c, 0x2a75, 0x1148, 0x2001, 0x0001, 0x080c, 0x29dd, 0x2001, - 0x0001, 0x080c, 0x29c0, 0x00b8, 0x080c, 0x2a7d, 0x1138, 0x9006, - 0x080c, 0x29dd, 0x9006, 0x080c, 0x29c0, 0x0068, 0x080c, 0x2a85, + 0x2ade, 0x1148, 0x2001, 0x0001, 0x080c, 0x2a46, 0x2001, 0x0001, + 0x080c, 0x2a29, 0x00b8, 0x080c, 0x2ae6, 0x1138, 0x9006, 0x080c, + 0x2a46, 0x9006, 0x080c, 0x2a29, 0x0068, 0x080c, 0x2aee, 0x1d50, + 0x2001, 0x1974, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c, 0x2854, + 0x0804, 0x0d0b, 0x080c, 0x7362, 0x0148, 0x080c, 0x7374, 0x1118, + 0x080c, 0x765b, 0x0050, 0x080c, 0x7359, 0x0dd0, 0x080c, 0x7656, + 0x080c, 0x764c, 0x080c, 0x727e, 0x0058, 0x080c, 0x7351, 0x0140, + 0x2009, 0x00f8, 0x080c, 0x5f2f, 0x7843, 0x0090, 0x7843, 0x0010, + 0x20a9, 0x09c4, 0x7820, 0xd09c, 0x1138, 0x080c, 0x7351, 0x0138, + 0x7824, 0xd0ac, 0x1904, 0x0d10, 0x1f04, 0x0c0a, 0x0070, 0x7824, + 0x080c, 0x736b, 0x0118, 0xd0ac, 0x1904, 0x0d10, 0x9084, 0x1800, + 0x0d98, 0x7003, 0x0001, 0x0804, 0x0d10, 0x2001, 0x0001, 0x080c, + 0x26b1, 0x0804, 0x0d23, 0x2001, 0x1984, 0x2004, 0x9005, 0x1518, + 0x080c, 0x2ade, 0x1148, 0x2001, 0x0001, 0x080c, 0x2a46, 0x2001, + 0x0001, 0x080c, 0x2a29, 0x00b8, 0x080c, 0x2ae6, 0x1138, 0x9006, + 0x080c, 0x2a46, 0x9006, 0x080c, 0x2a29, 0x0068, 0x080c, 0x2aee, 0x1d50, 0x2001, 0x1974, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c, - 0x27eb, 0x0804, 0x0d0a, 0x7850, 0x9085, 0x0040, 0x7852, 0x7938, - 0x7850, 0x9084, 0xfbcf, 0x7852, 0x080c, 0x2a8d, 0x9085, 0x2000, - 0x7852, 0x793a, 0x20a9, 0x0046, 0x1d04, 0x0c64, 0x080c, 0x8454, + 0x2854, 0x0804, 0x0d0b, 0x7850, 0x9085, 0x0040, 0x7852, 0x7938, + 0x7850, 0x9084, 0xfbcf, 0x7852, 0x080c, 0x2af6, 0x9085, 0x2000, + 0x7852, 0x793a, 0x20a9, 0x0046, 0x1d04, 0x0c64, 0x080c, 0x85c0, 0x1f04, 0x0c64, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfbf, 0x7852, - 0x793a, 0x080c, 0x72f6, 0x0148, 0x080c, 0x7308, 0x1118, 0x080c, - 0x75eb, 0x0050, 0x080c, 0x72ed, 0x0dd0, 0x080c, 0x75e6, 0x080c, - 0x75dc, 0x080c, 0x7212, 0x0020, 0x2009, 0x00f8, 0x080c, 0x5e72, + 0x793a, 0x080c, 0x7362, 0x0148, 0x080c, 0x7374, 0x1118, 0x080c, + 0x765b, 0x0050, 0x080c, 0x7359, 0x0dd0, 0x080c, 0x7656, 0x080c, + 0x764c, 0x080c, 0x727e, 0x0020, 0x2009, 0x00f8, 0x080c, 0x5f2f, 0x20a9, 0x0028, 0xa001, 0x1f04, 0x0c8a, 0x7850, 0x9085, 0x1400, - 0x7852, 0x080c, 0x72e5, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010, - 0x2021, 0xe678, 0x2019, 0xea60, 0x0d0c, 0x8454, 0x7820, 0xd09c, - 0x1580, 0x080c, 0x72e5, 0x0904, 0x0cef, 0x7824, 0xd0ac, 0x1904, - 0x0d0f, 0x080c, 0x7308, 0x1528, 0x0046, 0x2021, 0x0320, 0x8421, - 0x1df0, 0x004e, 0x7827, 0x1800, 0x080c, 0x2a8d, 0x7824, 0x9084, - 0x1800, 0x1160, 0x9484, 0x0fff, 0x1138, 0x2001, 0x1810, 0x2004, - 0xd0fc, 0x0110, 0x080c, 0x0d34, 0x8421, 0x1158, 0x1d04, 0x0cca, - 0x080c, 0x8454, 0x080c, 0x75e6, 0x080c, 0x75dc, 0x7003, 0x0001, - 0x04f0, 0x8319, 0x1948, 0x1d04, 0x0cd7, 0x080c, 0x8454, 0x2009, - 0x1977, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a, 0x1178, 0x200b, - 0x000a, 0x7827, 0x0048, 0x20a9, 0x0002, 0x080c, 0x2a6e, 0x7924, - 0x080c, 0x2a8d, 0xd19c, 0x0110, 0x080c, 0x29ae, 0x00d8, 0x080c, - 0x72f6, 0x1140, 0x94a2, 0x03e8, 0x1128, 0x080c, 0x72bd, 0x7003, - 0x0001, 0x00a8, 0x7827, 0x1800, 0x080c, 0x2a8d, 0x7824, 0x080c, - 0x72ff, 0x0110, 0xd0ac, 0x1158, 0x9084, 0x1800, 0x0950, 0x7003, - 0x0001, 0x0028, 0x2001, 0x0001, 0x080c, 0x264c, 0x0078, 0x2009, - 0x180c, 0x210c, 0xd19c, 0x1120, 0x7904, 0x918d, 0x0002, 0x7906, - 0x7827, 0x0048, 0x7828, 0x9085, 0x0028, 0x782a, 0x7850, 0x9085, - 0x0400, 0x7852, 0x2001, 0x1984, 0x2003, 0x0000, 0x9006, 0x78f2, - 0x015e, 0x003e, 0x000e, 0x080c, 0x55b6, 0x090c, 0x0e64, 0x012e, - 0x00fe, 0x004e, 0x001e, 0x0005, 0x0006, 0x0016, 0x0036, 0x0046, - 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0156, 0x0069, 0x0d0c, - 0x8454, 0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x004e, - 0x003e, 0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x189f, 0x7004, - 0x9086, 0x0001, 0x1110, 0x080c, 0x32f3, 0x00ee, 0x0005, 0x0005, - 0x2a70, 0x2061, 0x1988, 0x2063, 0x0003, 0x6007, 0x0003, 0x600b, - 0x001a, 0x600f, 0x0107, 0x2001, 0x1959, 0x900e, 0x2102, 0x7192, - 0x2001, 0x0100, 0x2004, 0x9082, 0x0002, 0x0218, 0x705b, 0xffff, - 0x0008, 0x715a, 0x7063, 0xffff, 0x717a, 0x717e, 0x080c, 0xbc7a, - 0x2061, 0x1949, 0x6003, 0x0909, 0x6106, 0x600b, 0x8800, 0x600f, - 0x0200, 0x6013, 0x00ff, 0x6017, 0x000f, 0x611a, 0x601f, 0x07d0, - 0x2061, 0x1951, 0x6003, 0x8000, 0x6106, 0x610a, 0x600f, 0x0200, - 0x6013, 0x00ff, 0x6116, 0x601b, 0x0001, 0x611e, 0x2061, 0x1965, - 0x6003, 0x514c, 0x6007, 0x4f47, 0x600b, 0x4943, 0x600f, 0x2020, - 0x2001, 0x182b, 0x2102, 0x0005, 0x9016, 0x080c, 0x6411, 0x1178, - 0xb804, 0x90c4, 0x00ff, 0x98c6, 0x0006, 0x0128, 0x90c4, 0xff00, - 0x98c6, 0x0600, 0x1120, 0x9186, 0x0080, 0x0108, 0x8210, 0x8108, - 0x9186, 0x0800, 0x1d50, 0x2208, 0x0005, 0x2091, 0x8000, 0x2079, - 0x0000, 0x000e, 0x00f6, 0x0010, 0x2091, 0x8000, 0x0e04, 0x0dc6, - 0x0006, 0x0016, 0x2001, 0x8002, 0x0006, 0x2079, 0x0000, 0x000e, - 0x7882, 0x7836, 0x001e, 0x798e, 0x000e, 0x788a, 0x000e, 0x7886, - 0x3900, 0x789a, 0x00d6, 0x2069, 0x0300, 0x6818, 0x78ae, 0x681c, - 0x78b2, 0x2001, 0x19e5, 0x2004, 0x78b6, 0x2001, 0x1a61, 0x2004, - 0x78ba, 0x6808, 0x78be, 0x00de, 0x7833, 0x0012, 0x2091, 0x5000, - 0x0156, 0x00d6, 0x0036, 0x0026, 0x2079, 0x0300, 0x2069, 0x1a84, - 0x7a08, 0x226a, 0x2069, 0x1a85, 0x7a18, 0x226a, 0x8d68, 0x7a1c, - 0x226a, 0x782c, 0x2019, 0x1a92, 0x201a, 0x2019, 0x1a95, 0x9016, - 0x7808, 0xd09c, 0x0168, 0x7820, 0x201a, 0x8210, 0x8318, 0x9386, - 0x1a9e, 0x0108, 0x0ca8, 0x7808, 0xd09c, 0x0110, 0x2011, 0xdead, - 0x2019, 0x1a93, 0x782c, 0x201a, 0x8318, 0x221a, 0x7803, 0x0000, - 0x2069, 0x1a64, 0x901e, 0x20a9, 0x0020, 0x7b26, 0x7a28, 0x226a, - 0x8d68, 0x8318, 0x1f04, 0x0e25, 0x002e, 0x003e, 0x00de, 0x015e, - 0x2079, 0x1800, 0x7803, 0x0005, 0x2091, 0x4080, 0x2001, 0x0089, - 0x2004, 0xd084, 0x0188, 0x2001, 0x19f8, 0x2004, 0x9005, 0x0130, - 0x2001, 0x008b, 0x2004, 0x9084, 0x8004, 0x0dd0, 0x2001, 0x008a, - 0x2003, 0x0002, 0x2003, 0x1001, 0x080c, 0x55b6, 0x1110, 0x080c, - 0x0e9b, 0x0cd0, 0x0005, 0x918c, 0x03ff, 0x2001, 0x0003, 0x2004, - 0x9084, 0x0600, 0x1118, 0x918d, 0x2800, 0x0010, 0x918d, 0x2000, - 0x2001, 0x017f, 0x2102, 0x0005, 0x00f6, 0x0006, 0x2079, 0x1826, - 0x2f04, 0x8000, 0x207a, 0x080c, 0x2a85, 0x1150, 0x0006, 0x2001, - 0x1974, 0x2004, 0xd0fc, 0x000e, 0x1118, 0x9082, 0x7530, 0x0010, - 0x9082, 0x000f, 0x0258, 0x9006, 0x207a, 0x2079, 0x1829, 0x2f04, - 0x9084, 0x0001, 0x9086, 0x0001, 0x207a, 0x0090, 0x2079, 0x1829, - 0x2f7c, 0x8fff, 0x1138, 0x0026, 0x2011, 0x0080, 0x080c, 0x0ee1, - 0x002e, 0x0030, 0x0026, 0x2011, 0x0000, 0x080c, 0x0ee1, 0x002e, - 0x000e, 0x00fe, 0x0005, 0x0026, 0x0126, 0x2011, 0x0080, 0x080c, - 0x0ee1, 0x20a9, 0x0fff, 0x080c, 0x0f02, 0x2011, 0x0040, 0x04c9, - 0x20a9, 0x0fff, 0x080c, 0x0f02, 0x0c80, 0x2011, 0x0040, 0x0488, - 0x2011, 0x0080, 0x0470, 0x0005, 0x0026, 0x70eb, 0x0000, 0x04b1, - 0x1148, 0x080c, 0x2a85, 0x1118, 0x2011, 0x8484, 0x0058, 0x2011, - 0x8282, 0x0040, 0x080c, 0x2a85, 0x1118, 0x2011, 0xcdc5, 0x0010, - 0x2011, 0xcac2, 0x0441, 0x002e, 0x0005, 0x080c, 0x55b6, 0x1140, - 0x0026, 0x2001, 0x1800, 0x2004, 0x9084, 0x0007, 0x0013, 0x002e, - 0x0005, 0x0ecc, 0x0eb0, 0x0eb0, 0x0ead, 0x0e64, 0x0eb0, 0x0eb0, - 0x0e64, 0x0016, 0x3b08, 0x3a00, 0x9104, 0x918d, 0x00c0, 0x21d8, - 0x9084, 0xff3f, 0x9205, 0x20d0, 0x001e, 0x0005, 0x2001, 0x1839, - 0x2004, 0xd0dc, 0x0005, 0x9e86, 0x1800, 0x190c, 0x0dc4, 0x70e4, - 0xd0e4, 0x0108, 0xc2e5, 0x72e6, 0xd0e4, 0x1118, 0x9294, 0x00c0, - 0x0c01, 0x0005, 0x1d04, 0x0f02, 0x2091, 0x6000, 0x1f04, 0x0f02, - 0x0005, 0x890e, 0x810e, 0x810f, 0x9194, 0x003f, 0x918c, 0xffc0, - 0x0005, 0x0006, 0x2200, 0x914d, 0x894f, 0x894d, 0x894d, 0x000e, - 0x0005, 0x01d6, 0x0146, 0x0036, 0x0096, 0x2061, 0x188e, 0x600b, - 0x0000, 0x600f, 0x0000, 0x6003, 0x0000, 0x6007, 0x0000, 0x2009, - 0xffc0, 0x2105, 0x0006, 0x2001, 0xaaaa, 0x200f, 0x2019, 0x5555, - 0x9016, 0x2049, 0x0bff, 0xab02, 0xa001, 0xa001, 0xa800, 0x9306, - 0x1138, 0x2105, 0x9306, 0x0120, 0x8210, 0x99c8, 0x0400, 0x0c98, - 0x000e, 0x200f, 0x2001, 0x189e, 0x928a, 0x000e, 0x1638, 0x928a, - 0x0006, 0x2011, 0x0006, 0x1210, 0x2011, 0x0000, 0x2202, 0x9006, - 0x2008, 0x82ff, 0x01b0, 0x8200, 0x600a, 0x600f, 0xffff, 0x6003, - 0x0002, 0x6007, 0x0000, 0x0026, 0x2019, 0x0010, 0x9280, 0x0001, - 0x20e8, 0x21a0, 0x21a8, 0x4104, 0x8319, 0x1de0, 0x8211, 0x1da0, - 0x002e, 0x009e, 0x003e, 0x014e, 0x01de, 0x0005, 0x2011, 0x000e, - 0x08e8, 0x0016, 0x0026, 0x0096, 0x3348, 0x080c, 0x0f09, 0x2100, - 0x9300, 0x2098, 0x22e0, 0x009e, 0x002e, 0x001e, 0x0036, 0x3518, - 0x20a9, 0x0001, 0x4002, 0x8007, 0x4004, 0x8319, 0x1dd8, 0x003e, - 0x0005, 0x20e9, 0x0001, 0x71b4, 0x81ff, 0x11c0, 0x9006, 0x2009, - 0x0200, 0x20a9, 0x0002, 0x9298, 0x0018, 0x23a0, 0x4001, 0x2009, - 0x0700, 0x20a9, 0x0002, 0x9298, 0x0008, 0x23a0, 0x4001, 0x7078, - 0x8007, 0x717c, 0x810f, 0x20a9, 0x0002, 0x4001, 0x9298, 0x000c, - 0x23a0, 0x900e, 0x080c, 0x0da4, 0x2001, 0x0000, 0x810f, 0x20a9, - 0x0002, 0x4001, 0x0005, 0x89ff, 0x0140, 0xa804, 0xa807, 0x0000, - 0x0006, 0x080c, 0x1033, 0x009e, 0x0cb0, 0x0005, 0x00e6, 0x2071, - 0x1800, 0x080c, 0x10ac, 0x090c, 0x0dc4, 0x00ee, 0x0005, 0x0086, - 0x00e6, 0x0006, 0x0026, 0x0036, 0x0126, 0x2091, 0x8000, 0x00c9, - 0x2071, 0x1800, 0x73bc, 0x702c, 0x9016, 0x9045, 0x0158, 0x8210, - 0x9906, 0x090c, 0x0dc4, 0x2300, 0x9202, 0x0120, 0x1a0c, 0x0dc4, - 0xa000, 0x0c98, 0x012e, 0x003e, 0x002e, 0x000e, 0x00ee, 0x008e, - 0x0005, 0x0086, 0x00e6, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, - 0x1911, 0x7010, 0x9005, 0x0140, 0x7018, 0x9045, 0x0128, 0x9906, - 0x090c, 0x0dc4, 0xa000, 0x0cc8, 0x012e, 0x000e, 0x00ee, 0x008e, - 0x0005, 0x00e6, 0x2071, 0x1800, 0x0126, 0x2091, 0x8000, 0x70bc, - 0x8001, 0x0270, 0x70be, 0x702c, 0x2048, 0x9085, 0x0001, 0xa800, - 0x702e, 0xa803, 0x0000, 0xa807, 0x0000, 0x012e, 0x00ee, 0x0005, - 0x904e, 0x0cd8, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1800, - 0x70bc, 0x90ca, 0x0040, 0x0268, 0x8001, 0x70be, 0x702c, 0x2048, - 0xa800, 0x702e, 0xa803, 0x0000, 0xa807, 0x0000, 0x012e, 0x00ee, - 0x0005, 0x904e, 0x0cd8, 0x00e6, 0x0126, 0x2091, 0x8000, 0x0016, - 0x890e, 0x810e, 0x810f, 0x9184, 0x003f, 0xa862, 0x9184, 0xffc0, - 0xa85e, 0x001e, 0x0020, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, - 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, - 0x080c, 0x8245, 0x012e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9026, - 0x2009, 0x0000, 0x2049, 0x0400, 0x2900, 0x702e, 0x8940, 0x2800, - 0xa802, 0xa95e, 0xa863, 0x0001, 0x8420, 0x9886, 0x0440, 0x0120, - 0x2848, 0x9188, 0x0040, 0x0c90, 0x2071, 0x188e, 0x7000, 0x9005, - 0x11a0, 0x2001, 0x04d4, 0xa802, 0x2048, 0x2009, 0x3500, 0x8940, - 0x2800, 0xa802, 0xa95e, 0xa863, 0x0001, 0x8420, 0x9886, 0x0800, - 0x0120, 0x2848, 0x9188, 0x0040, 0x0c90, 0x2071, 0x188e, 0x7104, - 0x7200, 0x82ff, 0x01d0, 0x7308, 0x8318, 0x831f, 0x831b, 0x831b, - 0x7312, 0x8319, 0x2001, 0x0800, 0xa802, 0x2048, 0x8900, 0xa802, - 0x2040, 0xa95e, 0xaa62, 0x8420, 0x2300, 0x9906, 0x0130, 0x2848, - 0x9188, 0x0040, 0x9291, 0x0000, 0x0c88, 0xa803, 0x0000, 0x2071, - 0x1800, 0x74ba, 0x74be, 0x0005, 0x00e6, 0x0016, 0x9984, 0xfc00, - 0x01e8, 0x908c, 0xf800, 0x1168, 0x9982, 0x0400, 0x02b8, 0x9982, - 0x0440, 0x0278, 0x9982, 0x04d4, 0x0288, 0x9982, 0x0800, 0x1270, - 0x0040, 0x9982, 0x0800, 0x0250, 0x2071, 0x188e, 0x7010, 0x9902, - 0x1228, 0x9085, 0x0001, 0x001e, 0x00ee, 0x0005, 0x9006, 0x0cd8, - 0x00e6, 0x2071, 0x19f7, 0x7007, 0x0000, 0x9006, 0x701e, 0x7022, - 0x7002, 0x2071, 0x0000, 0x7010, 0x9085, 0x8044, 0x7012, 0x2071, - 0x0080, 0x9006, 0x20a9, 0x0040, 0x7022, 0x1f04, 0x10e4, 0x702b, - 0x0020, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x00e6, 0xa073, - 0x0000, 0x2071, 0x19f7, 0x701c, 0x9088, 0x1a01, 0x280a, 0x8000, - 0x9084, 0x003f, 0x701e, 0x7120, 0x9106, 0x090c, 0x0dc4, 0x7004, - 0x9005, 0x1128, 0x00f6, 0x2079, 0x0080, 0x00a9, 0x00fe, 0x00ee, - 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x00e6, 0x2071, 0x19f7, - 0x7004, 0x9005, 0x1128, 0x00f6, 0x2079, 0x0080, 0x0021, 0x00fe, - 0x00ee, 0x012e, 0x0005, 0x7004, 0x9086, 0x0000, 0x1110, 0x7007, - 0x0006, 0x7000, 0x0002, 0x112d, 0x112b, 0x112b, 0x112b, 0x12a7, - 0x12a7, 0x12a7, 0x12a7, 0x080c, 0x0dc4, 0x701c, 0x7120, 0x9106, - 0x1148, 0x792c, 0x9184, 0x0001, 0x1120, 0xd1fc, 0x1110, 0x7007, - 0x0000, 0x0005, 0x0096, 0x9180, 0x1a01, 0x2004, 0x700a, 0x2048, - 0x8108, 0x918c, 0x003f, 0x7122, 0x782b, 0x0026, 0xa890, 0x7802, - 0xa894, 0x7806, 0xa898, 0x780a, 0xa89c, 0x780e, 0xa87c, 0x700e, - 0xa874, 0x7016, 0xa878, 0x701a, 0xa86c, 0x009e, 0xd084, 0x0120, - 0x7007, 0x0001, 0x0029, 0x0005, 0x7007, 0x0002, 0x00b1, 0x0005, - 0x0016, 0x0026, 0x710c, 0x2011, 0x0040, 0x9182, 0x0040, 0x1210, - 0x2110, 0x9006, 0x700e, 0x7212, 0x8203, 0x7812, 0x782b, 0x0020, - 0x782b, 0x0041, 0x002e, 0x001e, 0x0005, 0x0016, 0x0026, 0x0136, - 0x0146, 0x0156, 0x7014, 0x20e0, 0x7018, 0x2098, 0x20e9, 0x0000, - 0x20a1, 0x0088, 0x782b, 0x0026, 0x710c, 0x2011, 0x0040, 0x9182, - 0x0040, 0x1210, 0x2110, 0x9006, 0x700e, 0x22a8, 0x4006, 0x8203, - 0x7812, 0x782b, 0x0020, 0x3300, 0x701a, 0x782b, 0x0001, 0x015e, - 0x014e, 0x013e, 0x002e, 0x001e, 0x0005, 0x0016, 0x2009, 0x19f7, - 0x2104, 0xc095, 0x200a, 0x080c, 0x110a, 0x001e, 0x0005, 0x0016, - 0x00e6, 0x2071, 0x19f7, 0x00f6, 0x2079, 0x0080, 0x792c, 0xd1bc, - 0x190c, 0x0dbd, 0x782b, 0x0002, 0xd1fc, 0x0120, 0x918c, 0x0700, - 0x7004, 0x0023, 0x00fe, 0x00ee, 0x001e, 0x0005, 0x111b, 0x11c5, - 0x11f9, 0x0dc4, 0x0dc4, 0x12b3, 0x0dc4, 0x918c, 0x0700, 0x1550, - 0x0136, 0x0146, 0x0156, 0x7014, 0x20e8, 0x7018, 0x20a0, 0x20e1, - 0x0000, 0x2099, 0x0088, 0x782b, 0x0040, 0x7010, 0x20a8, 0x4005, - 0x3400, 0x701a, 0x015e, 0x014e, 0x013e, 0x700c, 0x9005, 0x0578, - 0x7800, 0x7802, 0x7804, 0x7806, 0x080c, 0x1160, 0x0005, 0x7008, - 0x0096, 0x2048, 0xa873, 0x0100, 0x009e, 0x7007, 0x0000, 0x080c, - 0x111b, 0x0005, 0x7008, 0x0096, 0x2048, 0xa873, 0x0200, 0x009e, - 0x0ca0, 0x918c, 0x0700, 0x1150, 0x700c, 0x9005, 0x0180, 0x7800, - 0x7802, 0x7804, 0x7806, 0x080c, 0x1175, 0x0005, 0x7008, 0x0096, - 0x2048, 0xa873, 0x0200, 0x009e, 0x7007, 0x0000, 0x0080, 0x0096, - 0x7008, 0x2048, 0x7800, 0xa892, 0x7804, 0xa896, 0x7808, 0xa89a, - 0x780c, 0xa89e, 0xa873, 0x0100, 0x009e, 0x7007, 0x0000, 0x0096, - 0x00d6, 0x7008, 0x2048, 0x2001, 0x18ba, 0x2004, 0x9906, 0x1128, - 0xa8a0, 0x080f, 0x00de, 0x009e, 0x00a0, 0x00de, 0x009e, 0x0096, - 0x00d6, 0x7008, 0x2048, 0x0081, 0x0150, 0xa8a0, 0x0086, 0x2940, - 0x080f, 0x008e, 0x00de, 0x009e, 0x080c, 0x110a, 0x0005, 0x00de, - 0x009e, 0x080c, 0x110a, 0x0005, 0xa8ac, 0xd08c, 0x0005, 0x0096, - 0xa0a4, 0x904d, 0x090c, 0x0dc4, 0xa070, 0x908e, 0x0100, 0x0130, - 0xa87f, 0x0030, 0xa887, 0x0000, 0xa89b, 0x4002, 0xa898, 0x908e, - 0x006b, 0x090c, 0x469d, 0x080c, 0x6b11, 0xa0a3, 0x0000, 0xa0a7, - 0x0000, 0x2848, 0x080c, 0x1033, 0x009e, 0x0005, 0x00a6, 0xa0a4, - 0x904d, 0x090c, 0x0dc4, 0xa070, 0x908e, 0x0100, 0x0128, 0xa87f, - 0x0001, 0xa887, 0x0000, 0x00c0, 0xa80c, 0x2050, 0xb004, 0x9005, - 0x0198, 0xa80e, 0x2050, 0x8006, 0x8006, 0x8007, 0x908c, 0x003f, - 0x9084, 0xffc0, 0x9080, 0x0002, 0xa07a, 0xa176, 0xb000, 0xa07e, - 0x2810, 0x080c, 0x10eb, 0x00c8, 0xa980, 0xa898, 0x0016, 0x0006, - 0x080c, 0x6b11, 0x000e, 0x001e, 0xd1a4, 0x0128, 0x00c6, 0x2060, - 0x080c, 0x9f18, 0x00ce, 0x7008, 0x2048, 0xa8a3, 0x0000, 0xa8a7, - 0x0000, 0x080c, 0x1033, 0x080c, 0x110a, 0x00ae, 0x0005, 0x0126, - 0x2091, 0x8000, 0x782b, 0x1001, 0x7007, 0x0005, 0x7000, 0xc094, - 0x7002, 0x012e, 0x0005, 0x7007, 0x0000, 0x080c, 0x111b, 0x0005, - 0x0126, 0x2091, 0x2200, 0x2079, 0x0300, 0x2071, 0x1a41, 0x7003, - 0x0000, 0x78bf, 0x00f6, 0x781b, 0x4800, 0x00c1, 0x7803, 0x0003, - 0x780f, 0x0000, 0x20a9, 0x0259, 0x2061, 0xd387, 0x2c0d, 0x7912, - 0xe104, 0x9ce0, 0x0002, 0x7916, 0x1f04, 0x12ce, 0x7807, 0x0007, - 0x7803, 0x0000, 0x7803, 0x0001, 0x012e, 0x0005, 0x00c6, 0x7803, - 0x0000, 0x7808, 0xd09c, 0x0110, 0x7820, 0x0cd8, 0x2001, 0x1a42, - 0x2003, 0x0000, 0x78ab, 0x0004, 0x78ac, 0xd0ac, 0x1de8, 0x78ab, - 0x0002, 0x7807, 0x0007, 0x7827, 0x0030, 0x782b, 0x0400, 0x7827, - 0x0031, 0x782b, 0x1a64, 0x781f, 0xff00, 0x781b, 0xb700, 0x2001, - 0x0200, 0x2004, 0xd0dc, 0x0110, 0x781f, 0x0303, 0x2061, 0x1a64, - 0x602f, 0x1cc8, 0x2001, 0x1819, 0x2004, 0x9082, 0x1cc8, 0x6032, - 0x603b, 0x1f70, 0x2001, 0x31cc, 0xd0fc, 0x190c, 0x0dc4, 0x2001, - 0x1810, 0x2004, 0xd0c4, 0x1128, 0x2001, 0x0003, 0x2004, 0xd0d4, - 0x1118, 0x783f, 0x31cc, 0x0020, 0x9084, 0xc000, 0x783f, 0xb1cc, - 0x00ce, 0x0005, 0x0126, 0x2091, 0x2200, 0x7908, 0x9184, 0x0030, - 0x190c, 0x0dbd, 0xd19c, 0x0158, 0x7820, 0x908c, 0xf000, 0x15f0, - 0x908a, 0x0024, 0x1a0c, 0x0dc4, 0x0023, 0x012e, 0x0005, 0x012e, - 0x0005, 0x1366, 0x1366, 0x137d, 0x1382, 0x1386, 0x138b, 0x13b3, - 0x13b7, 0x13c5, 0x13c9, 0x1366, 0x1452, 0x1456, 0x14c6, 0x1366, - 0x1366, 0x1366, 0x1366, 0x1366, 0x1366, 0x1366, 0x1366, 0x1366, - 0x1366, 0x1366, 0x1366, 0x1366, 0x138d, 0x1366, 0x1366, 0x1366, - 0x1366, 0x1366, 0x1366, 0x136a, 0x1368, 0x1366, 0x080c, 0x0dc4, - 0x080c, 0x0dbd, 0x080c, 0x14cd, 0x2009, 0x1a59, 0x2104, 0x8000, - 0x200a, 0x080c, 0x7d22, 0x080c, 0x199b, 0x0005, 0x2009, 0x0048, - 0x2060, 0x080c, 0x9f88, 0x012e, 0x0005, 0x7004, 0xc085, 0xc0b5, - 0x7006, 0x0005, 0x7004, 0xc085, 0x7006, 0x0005, 0x080c, 0x14cd, - 0x080c, 0x1636, 0x0005, 0x080c, 0x0dc4, 0x080c, 0x14cd, 0x2060, - 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, 0x2009, 0x0048, - 0x080c, 0x9f88, 0x2001, 0x015d, 0x2003, 0x0000, 0x2009, 0x03e8, - 0x8109, 0x0160, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001, - 0x0218, 0x2004, 0xd0ec, 0x1110, 0x080c, 0x14d2, 0x2001, 0x0307, - 0x2003, 0x8000, 0x0005, 0x7004, 0xc095, 0x7006, 0x0005, 0x080c, - 0x14cd, 0x2060, 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, - 0x2009, 0x0048, 0x080c, 0x9f88, 0x0005, 0x080c, 0x14cd, 0x080c, - 0x0dc4, 0x080c, 0x14cd, 0x080c, 0x143d, 0x7827, 0x0018, 0x79ac, - 0xd1dc, 0x0540, 0x7827, 0x0015, 0x7828, 0x782b, 0x0000, 0x9065, - 0x0138, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x0400, - 0x7004, 0x9005, 0x1180, 0x78ab, 0x0004, 0x7827, 0x0018, 0x782b, - 0x0000, 0xd1bc, 0x090c, 0x0dc4, 0x2001, 0x020d, 0x2003, 0x0050, - 0x2003, 0x0020, 0x0478, 0x78ab, 0x0004, 0x7803, 0x0001, 0x080c, - 0x1456, 0x0005, 0x7828, 0x782b, 0x0000, 0x9065, 0x090c, 0x0dc4, - 0x6014, 0x2048, 0x78ab, 0x0004, 0x918c, 0x0700, 0x01d8, 0x080c, - 0x7d22, 0x080c, 0x199b, 0x080c, 0xb955, 0x0158, 0xa9b0, 0xa936, - 0xa9b4, 0xa93a, 0xa83f, 0xffff, 0xa843, 0xffff, 0xa884, 0xc0bd, - 0xa886, 0xa984, 0x9184, 0x0020, 0x1120, 0xc1ad, 0xa986, 0x080c, - 0xb5c5, 0x0005, 0x2029, 0x00c8, 0x8529, 0x0128, 0x2001, 0x0201, - 0x2004, 0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xd314, 0xd5a4, 0x1118, - 0x080c, 0x14d2, 0x0005, 0x080c, 0x7d22, 0x080c, 0x199b, 0x0005, - 0x781f, 0x0300, 0x7803, 0x0001, 0x0005, 0x0016, 0x0066, 0x0076, - 0x00f6, 0x2079, 0x0300, 0x7908, 0x918c, 0x0007, 0x9186, 0x0003, - 0x0120, 0x2001, 0x0016, 0x080c, 0x1553, 0x00fe, 0x007e, 0x006e, - 0x001e, 0x0005, 0x7004, 0xc09d, 0x7006, 0x0005, 0x7104, 0x9184, - 0x0004, 0x190c, 0x0dc4, 0xd184, 0x11b1, 0xd19c, 0x0180, 0xc19c, - 0x7106, 0x0016, 0x080c, 0x1619, 0x001e, 0x0148, 0x2001, 0x020d, - 0x2003, 0x0050, 0x2003, 0x0020, 0x080c, 0x14d2, 0x0005, 0x81ff, - 0x190c, 0x0dc4, 0x0005, 0x2100, 0xc184, 0xc1b4, 0x7106, 0xd0b4, - 0x0016, 0x00e6, 0x1904, 0x14bb, 0x2071, 0x0200, 0x080c, 0x160d, - 0x080c, 0x1619, 0x05a8, 0x6014, 0x9005, 0x05a8, 0x0096, 0x2048, - 0xa868, 0x009e, 0x9084, 0x00ff, 0x908e, 0x0029, 0x0160, 0x908e, - 0x0048, 0x1548, 0x601c, 0xd084, 0x11d8, 0x00f6, 0x2c78, 0x080c, - 0x1679, 0x00fe, 0x00a8, 0x00f6, 0x2c78, 0x080c, 0x17bd, 0x00fe, - 0x2009, 0x01f4, 0x8109, 0x0160, 0x2001, 0x0201, 0x2004, 0x9005, - 0x0dc8, 0x2001, 0x0218, 0x2004, 0xd0ec, 0x1110, 0x0419, 0x0040, - 0x2001, 0x020d, 0x2003, 0x0020, 0x080c, 0x12de, 0x7803, 0x0001, - 0x00ee, 0x001e, 0x0005, 0x080c, 0x1619, 0x0dd0, 0x2001, 0x020d, - 0x2003, 0x0050, 0x2003, 0x0020, 0x0069, 0x0c90, 0x0031, 0x2060, - 0x2009, 0x0053, 0x080c, 0x9f88, 0x0005, 0x7808, 0xd09c, 0x0de8, - 0x7820, 0x0005, 0x080c, 0x143d, 0x00d6, 0x2069, 0x0200, 0x2009, - 0x01f4, 0x8109, 0x0520, 0x6804, 0x9005, 0x0dd8, 0x2001, 0x015d, - 0x2003, 0x0000, 0x79bc, 0xd1a4, 0x1578, 0x79b8, 0x918c, 0x0fff, - 0x0180, 0x9182, 0x0841, 0x1268, 0x9188, 0x0007, 0x918c, 0x0ff8, - 0x810c, 0x810c, 0x810c, 0x080c, 0x153f, 0x6827, 0x0001, 0x8109, - 0x1dd0, 0x080c, 0x153f, 0x6827, 0x0002, 0x080c, 0x153f, 0x6804, - 0x9005, 0x1170, 0x682c, 0xd0e4, 0x1540, 0x691c, 0x9184, 0x0014, - 0x0120, 0x6830, 0x9084, 0x9554, 0x15b9, 0x6804, 0x9005, 0x0da8, - 0x79b8, 0xd1ec, 0x1130, 0x0870, 0x080c, 0x7d22, 0x080c, 0x199b, - 0x0090, 0x7827, 0x0015, 0x782b, 0x0000, 0x7827, 0x0018, 0x782b, - 0x0000, 0x2001, 0x020d, 0x2003, 0x0020, 0x2001, 0x0307, 0x2003, - 0x0300, 0x7803, 0x0001, 0x00de, 0x0005, 0x682c, 0x9084, 0x5400, - 0x9086, 0x5400, 0x0d30, 0x7827, 0x0015, 0x782b, 0x0000, 0x7803, - 0x0001, 0x6800, 0x9085, 0x1800, 0x6802, 0x00de, 0x0005, 0x6824, - 0x9084, 0x0003, 0x1de0, 0x0005, 0x2079, 0x0001, 0x000e, 0x00f6, - 0x0804, 0x0dc6, 0x2001, 0x0030, 0x2c08, 0x621c, 0x0021, 0x7830, - 0x9086, 0x0041, 0x0005, 0x00f6, 0x2079, 0x0300, 0x0006, 0x7808, - 0xd09c, 0x0140, 0x0016, 0x0026, 0x00c6, 0x080c, 0x132a, 0x00ce, - 0x002e, 0x001e, 0x000e, 0x0006, 0x7832, 0x7936, 0x7a3a, 0x781b, - 0x8080, 0x0059, 0x1118, 0x000e, 0x00fe, 0x0005, 0x000e, 0x792c, - 0x3900, 0x8000, 0x2004, 0x080c, 0x0dc4, 0x2009, 0x180c, 0x2104, - 0xc0f4, 0x200a, 0x2009, 0xff00, 0x8109, 0x0904, 0x15d1, 0x7a18, - 0x9284, 0x0030, 0x0904, 0x15cc, 0x9284, 0x0048, 0x9086, 0x0008, - 0x1904, 0x15cc, 0x2001, 0x0109, 0x2004, 0xd08c, 0x01f0, 0x0006, - 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x0126, 0x2091, 0x2800, - 0x00f6, 0x0026, 0x0016, 0x2009, 0x1a5c, 0x2104, 0x8000, 0x0208, - 0x200a, 0x080c, 0x8689, 0x001e, 0x002e, 0x00fe, 0x012e, 0x015e, - 0x014e, 0x013e, 0x01de, 0x01ce, 0x000e, 0x2001, 0x009b, 0x2004, - 0xd0fc, 0x01d0, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, - 0x0156, 0x00f6, 0x0016, 0x2009, 0x1a5d, 0x2104, 0x8000, 0x0208, - 0x200a, 0x080c, 0x1d94, 0x001e, 0x00fe, 0x015e, 0x014e, 0x013e, - 0x01de, 0x01ce, 0x012e, 0x000e, 0x7818, 0xd0bc, 0x1904, 0x157c, - 0x0005, 0x2001, 0x180c, 0x2004, 0xd0f4, 0x1528, 0x7a18, 0x9284, - 0x0030, 0x0508, 0x9284, 0x0048, 0x9086, 0x0008, 0x11e0, 0x2001, - 0x19d3, 0x2004, 0x9005, 0x01b8, 0x2001, 0x1a44, 0x2004, 0x9086, - 0x0000, 0x0188, 0x2009, 0x1a5b, 0x2104, 0x8000, 0x0208, 0x200a, - 0x080c, 0x96a1, 0x2009, 0x180c, 0x2104, 0xc0f5, 0x200a, 0x2009, - 0xff00, 0x0804, 0x157c, 0x9085, 0x0001, 0x0005, 0x7832, 0x7936, - 0x7a3a, 0x781b, 0x8080, 0x080c, 0x1575, 0x1108, 0x0005, 0x792c, - 0x3900, 0x8000, 0x2004, 0x080c, 0x0dc4, 0x7037, 0x0001, 0x7150, - 0x7037, 0x0002, 0x7050, 0x2060, 0xd1bc, 0x1110, 0x7054, 0x2060, - 0x0005, 0x0006, 0x0046, 0x00e6, 0x2071, 0x0200, 0x7037, 0x0002, - 0x7058, 0x9084, 0xff00, 0x8007, 0x9086, 0x00bc, 0x1158, 0x2021, - 0x1a5a, 0x2404, 0x8000, 0x0208, 0x2022, 0x080c, 0x7d22, 0x080c, - 0x199b, 0x9006, 0x00ee, 0x004e, 0x000e, 0x0005, 0x0c11, 0x1108, - 0x0005, 0x00e6, 0x0016, 0x2071, 0x0200, 0x0879, 0x6120, 0x9186, - 0x0000, 0x0560, 0x9186, 0x0002, 0x0548, 0x7358, 0x745c, 0x6014, - 0x905d, 0x0520, 0x2b48, 0xab42, 0xac3e, 0x2001, 0x1880, 0x2004, - 0xd0b4, 0x1138, 0x601c, 0xd0e4, 0x1120, 0xa83b, 0x7fff, 0xa837, - 0xffff, 0x080c, 0x1f90, 0x1190, 0x080c, 0x181a, 0x2a00, 0xa816, + 0x7852, 0x080c, 0x7351, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010, + 0x2021, 0xe678, 0x2019, 0xea60, 0x0d0c, 0x85c0, 0x7820, 0xd09c, + 0x1588, 0x080c, 0x7351, 0x0904, 0x0cf0, 0x7824, 0xd0ac, 0x1904, + 0x0d10, 0x080c, 0x7374, 0x1530, 0x0046, 0x2021, 0x0320, 0x8421, + 0x1df0, 0x004e, 0x7827, 0x1800, 0x080c, 0x2af6, 0x7824, 0x9084, + 0x1800, 0x1168, 0x9484, 0x0fff, 0x1140, 0x2001, 0x1810, 0x2004, + 0x9084, 0x9000, 0x0110, 0x080c, 0x0d31, 0x8421, 0x1158, 0x1d04, + 0x0ccb, 0x080c, 0x85c0, 0x080c, 0x7656, 0x080c, 0x764c, 0x7003, + 0x0001, 0x04f0, 0x8319, 0x1940, 0x1d04, 0x0cd8, 0x080c, 0x85c0, + 0x2009, 0x1977, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a, 0x1178, + 0x200b, 0x000a, 0x7827, 0x0048, 0x20a9, 0x0002, 0x080c, 0x2ad7, + 0x7924, 0x080c, 0x2af6, 0xd19c, 0x0110, 0x080c, 0x2a17, 0x00d8, + 0x080c, 0x7362, 0x1140, 0x94a2, 0x03e8, 0x1128, 0x080c, 0x7329, + 0x7003, 0x0001, 0x00a8, 0x7827, 0x1800, 0x080c, 0x2af6, 0x7824, + 0x080c, 0x736b, 0x0110, 0xd0ac, 0x1158, 0x9084, 0x1800, 0x0950, + 0x7003, 0x0001, 0x0028, 0x2001, 0x0001, 0x080c, 0x26b1, 0x0078, + 0x2009, 0x180c, 0x210c, 0xd19c, 0x1120, 0x7904, 0x918d, 0x0002, + 0x7906, 0x7827, 0x0048, 0x7828, 0x9085, 0x0028, 0x782a, 0x7850, + 0x9085, 0x0400, 0x7852, 0x2001, 0x1984, 0x2003, 0x0000, 0x9006, + 0x78f2, 0x015e, 0x003e, 0x000e, 0x012e, 0x00fe, 0x004e, 0x001e, + 0x0005, 0x0006, 0x0016, 0x0036, 0x0046, 0x00b6, 0x00c6, 0x00d6, + 0x00e6, 0x00f6, 0x0156, 0x0069, 0x0d0c, 0x85c0, 0x015e, 0x00fe, + 0x00ee, 0x00de, 0x00ce, 0x00be, 0x004e, 0x003e, 0x001e, 0x000e, + 0x0005, 0x00e6, 0x2071, 0x189f, 0x7004, 0x9086, 0x0001, 0x1110, + 0x080c, 0x338f, 0x00ee, 0x0005, 0x0005, 0x2a70, 0x2061, 0x1988, + 0x2063, 0x0003, 0x6007, 0x0003, 0x600b, 0x001a, 0x600f, 0x0117, + 0x2001, 0x1958, 0x900e, 0x2102, 0x7192, 0x2001, 0x0100, 0x2004, + 0x9082, 0x0002, 0x0218, 0x705b, 0xffff, 0x0008, 0x715a, 0x7063, + 0xffff, 0x717a, 0x717e, 0x080c, 0xc617, 0x70e7, 0x00c0, 0x2061, + 0x1948, 0x6003, 0x0909, 0x6106, 0x600b, 0x8800, 0x600f, 0x0200, + 0x6013, 0x00ff, 0x6017, 0x000f, 0x611a, 0x601f, 0x07d0, 0x2061, + 0x1950, 0x6003, 0x8000, 0x6106, 0x610a, 0x600f, 0x0200, 0x6013, + 0x00ff, 0x6116, 0x601b, 0x0001, 0x611e, 0x2061, 0x1965, 0x6003, + 0x514c, 0x6007, 0x4f47, 0x600b, 0x4943, 0x600f, 0x2020, 0x2001, + 0x182b, 0x2102, 0x0005, 0x9016, 0x080c, 0x64fc, 0x1178, 0xb804, + 0x90c4, 0x00ff, 0x98c6, 0x0006, 0x0128, 0x90c4, 0xff00, 0x98c6, + 0x0600, 0x1120, 0x9186, 0x0080, 0x0108, 0x8210, 0x8108, 0x9186, + 0x0800, 0x1d50, 0x2208, 0x0005, 0x2091, 0x8000, 0x2079, 0x0000, + 0x000e, 0x00f6, 0x0010, 0x2091, 0x8000, 0x0e04, 0x0dc5, 0x0006, + 0x0016, 0x2001, 0x8002, 0x0006, 0x2079, 0x0000, 0x000e, 0x7882, + 0x7836, 0x001e, 0x798e, 0x000e, 0x788a, 0x000e, 0x7886, 0x3900, + 0x789a, 0x00d6, 0x2069, 0x0300, 0x6818, 0x78ae, 0x681c, 0x78b2, + 0x2001, 0x19e5, 0x2004, 0x78b6, 0x2001, 0x1a61, 0x2004, 0x78ba, + 0x6808, 0x78be, 0x00de, 0x7833, 0x0012, 0x2091, 0x5000, 0x0156, + 0x00d6, 0x0036, 0x0026, 0x2079, 0x0300, 0x2069, 0x1a84, 0x7a08, + 0x226a, 0x2069, 0x1a85, 0x7a18, 0x226a, 0x8d68, 0x7a1c, 0x226a, + 0x782c, 0x2019, 0x1a92, 0x201a, 0x2019, 0x1a95, 0x9016, 0x7808, + 0xd09c, 0x0168, 0x7820, 0x201a, 0x8210, 0x8318, 0x9386, 0x1aaa, + 0x0108, 0x0ca8, 0x7808, 0xd09c, 0x0110, 0x2011, 0xdead, 0x2019, + 0x1a93, 0x782c, 0x201a, 0x8318, 0x221a, 0x7803, 0x0000, 0x2069, + 0x1a64, 0x901e, 0x20a9, 0x0020, 0x7b26, 0x7a28, 0x226a, 0x8d68, + 0x8318, 0x1f04, 0x0e24, 0x002e, 0x003e, 0x00de, 0x015e, 0x2079, + 0x1800, 0x7803, 0x0005, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, + 0xd084, 0x0188, 0x2001, 0x19f8, 0x2004, 0x9005, 0x0130, 0x2001, + 0x008b, 0x2004, 0x9084, 0x8004, 0x0dd0, 0x2001, 0x008a, 0x2003, + 0x0002, 0x2003, 0x1001, 0x080c, 0x5673, 0x1108, 0x0099, 0x0cd8, + 0x0005, 0x918c, 0x03ff, 0x2001, 0x0003, 0x2004, 0x9084, 0x0600, + 0x1118, 0x918d, 0x2800, 0x0010, 0x918d, 0x2000, 0x2001, 0x017f, + 0x2102, 0x0005, 0x0026, 0x0126, 0x2011, 0x0080, 0x080c, 0x0eed, + 0x20a9, 0x0900, 0x080c, 0x0f0e, 0x2011, 0x0040, 0x080c, 0x0eed, + 0x20a9, 0x0900, 0x080c, 0x0f0e, 0x0c78, 0x0026, 0x080c, 0x0efa, + 0x1118, 0x2011, 0x0040, 0x0098, 0x2011, 0x010e, 0x2214, 0x9294, + 0x0007, 0x9296, 0x0007, 0x0118, 0x2011, 0xa880, 0x0010, 0x2011, + 0x6840, 0xd0e4, 0x70eb, 0x0000, 0x1120, 0x70eb, 0x0fa0, 0x080c, + 0x0eff, 0x002e, 0x0005, 0x0026, 0x080c, 0x0efa, 0x0128, 0xd0a4, + 0x1138, 0x2011, 0xcdd5, 0x0010, 0x2011, 0x0080, 0x080c, 0x0eff, + 0x002e, 0x0005, 0x0026, 0x70eb, 0x0000, 0x080c, 0x0efa, 0x1148, + 0x080c, 0x2aee, 0x1118, 0x2011, 0x8484, 0x0058, 0x2011, 0x8282, + 0x0040, 0x080c, 0x2aee, 0x1118, 0x2011, 0xcdc5, 0x0010, 0x2011, + 0xcac2, 0x080c, 0x0eff, 0x002e, 0x0005, 0x00e6, 0x0006, 0x2071, + 0x1800, 0xd0b4, 0x70e4, 0x1110, 0xc0e4, 0x0048, 0x0006, 0x3b00, + 0x9084, 0xff3f, 0x20d8, 0x000e, 0x70eb, 0x0000, 0xc0e5, 0x0079, + 0x000e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800, 0xd0e4, 0x70e4, + 0x1110, 0xc0dc, 0x0008, 0xc0dd, 0x0011, 0x00ee, 0x0005, 0x70e6, + 0x7000, 0x9084, 0x0007, 0x000b, 0x0005, 0x0ebc, 0x0e93, 0x0e93, + 0x0e75, 0x0ea2, 0x0e93, 0x0e93, 0x0ea2, 0x0016, 0x3b08, 0x3a00, + 0x9104, 0x918d, 0x00c0, 0x21d8, 0x9084, 0xff3f, 0x9205, 0x20d0, + 0x001e, 0x0005, 0x2001, 0x1839, 0x2004, 0xd0dc, 0x0005, 0x9e86, + 0x1800, 0x190c, 0x0dc3, 0x70e4, 0xd0e4, 0x0108, 0xc2e5, 0x72e6, + 0xd0e4, 0x1118, 0x9294, 0x00c0, 0x0c01, 0x0005, 0x1d04, 0x0f0e, + 0x2091, 0x6000, 0x1f04, 0x0f0e, 0x0005, 0x890e, 0x810e, 0x810f, + 0x9194, 0x003f, 0x918c, 0xffc0, 0x0005, 0x0006, 0x2200, 0x914d, + 0x894f, 0x894d, 0x894d, 0x000e, 0x0005, 0x01d6, 0x0146, 0x0036, + 0x0096, 0x2061, 0x188e, 0x600b, 0x0000, 0x600f, 0x0000, 0x6003, + 0x0000, 0x6007, 0x0000, 0x2009, 0xffc0, 0x2105, 0x0006, 0x2001, + 0xaaaa, 0x200f, 0x2019, 0x5555, 0x9016, 0x2049, 0x0bff, 0xab02, + 0xa001, 0xa001, 0xa800, 0x9306, 0x1138, 0x2105, 0x9306, 0x0120, + 0x8210, 0x99c8, 0x0400, 0x0c98, 0x000e, 0x200f, 0x2001, 0x189e, + 0x928a, 0x000e, 0x1638, 0x928a, 0x0006, 0x2011, 0x0006, 0x1210, + 0x2011, 0x0000, 0x2202, 0x9006, 0x2008, 0x82ff, 0x01b0, 0x8200, + 0x600a, 0x600f, 0xffff, 0x6003, 0x0002, 0x6007, 0x0000, 0x0026, + 0x2019, 0x0010, 0x9280, 0x0001, 0x20e8, 0x21a0, 0x21a8, 0x4104, + 0x8319, 0x1de0, 0x8211, 0x1da0, 0x002e, 0x009e, 0x003e, 0x014e, + 0x01de, 0x0005, 0x2011, 0x000e, 0x08e8, 0x0016, 0x0026, 0x0096, + 0x3348, 0x080c, 0x0f15, 0x2100, 0x9300, 0x2098, 0x22e0, 0x009e, + 0x002e, 0x001e, 0x0036, 0x3518, 0x20a9, 0x0001, 0x4002, 0x8007, + 0x4004, 0x8319, 0x1dd8, 0x003e, 0x0005, 0x20e9, 0x0001, 0x71b4, + 0x81ff, 0x11c0, 0x9006, 0x2009, 0x0200, 0x20a9, 0x0002, 0x9298, + 0x0018, 0x23a0, 0x4001, 0x2009, 0x0700, 0x20a9, 0x0002, 0x9298, + 0x0008, 0x23a0, 0x4001, 0x7078, 0x8007, 0x717c, 0x810f, 0x20a9, + 0x0002, 0x4001, 0x9298, 0x000c, 0x23a0, 0x900e, 0x080c, 0x0da3, + 0x2001, 0x0000, 0x810f, 0x20a9, 0x0002, 0x4001, 0x0005, 0x89ff, + 0x0140, 0xa804, 0xa807, 0x0000, 0x0006, 0x080c, 0x103f, 0x009e, + 0x0cb0, 0x0005, 0x00e6, 0x2071, 0x1800, 0x080c, 0x10b8, 0x090c, + 0x0dc3, 0x00ee, 0x0005, 0x0086, 0x00e6, 0x0006, 0x0026, 0x0036, + 0x0126, 0x2091, 0x8000, 0x00c9, 0x2071, 0x1800, 0x73bc, 0x702c, + 0x9016, 0x9045, 0x0158, 0x8210, 0x9906, 0x090c, 0x0dc3, 0x2300, + 0x9202, 0x0120, 0x1a0c, 0x0dc3, 0xa000, 0x0c98, 0x012e, 0x003e, + 0x002e, 0x000e, 0x00ee, 0x008e, 0x0005, 0x0086, 0x00e6, 0x0006, + 0x0126, 0x2091, 0x8000, 0x2071, 0x1911, 0x7010, 0x9005, 0x0140, + 0x7018, 0x9045, 0x0128, 0x9906, 0x090c, 0x0dc3, 0xa000, 0x0cc8, + 0x012e, 0x000e, 0x00ee, 0x008e, 0x0005, 0x00e6, 0x2071, 0x1800, + 0x0126, 0x2091, 0x8000, 0x70bc, 0x8001, 0x0270, 0x70be, 0x702c, + 0x2048, 0x9085, 0x0001, 0xa800, 0x702e, 0xa803, 0x0000, 0xa807, + 0x0000, 0x012e, 0x00ee, 0x0005, 0x904e, 0x0cd8, 0x00e6, 0x0126, + 0x2091, 0x8000, 0x2071, 0x1800, 0x70bc, 0x90ca, 0x0040, 0x0268, + 0x8001, 0x70be, 0x702c, 0x2048, 0xa800, 0x702e, 0xa803, 0x0000, + 0xa807, 0x0000, 0x012e, 0x00ee, 0x0005, 0x904e, 0x0cd8, 0x00e6, + 0x0126, 0x2091, 0x8000, 0x0016, 0x890e, 0x810e, 0x810f, 0x9184, + 0x003f, 0xa862, 0x9184, 0xffc0, 0xa85e, 0x001e, 0x0020, 0x00e6, + 0x0126, 0x2091, 0x8000, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, + 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x83a7, 0x012e, 0x00ee, + 0x0005, 0x2071, 0x1800, 0x9026, 0x2009, 0x0000, 0x2049, 0x0400, + 0x2900, 0x702e, 0x8940, 0x2800, 0xa802, 0xa95e, 0xa863, 0x0001, + 0x8420, 0x9886, 0x0440, 0x0120, 0x2848, 0x9188, 0x0040, 0x0c90, + 0x2071, 0x188e, 0x7000, 0x9005, 0x11a0, 0x2001, 0x0534, 0xa802, + 0x2048, 0x2009, 0x4d00, 0x8940, 0x2800, 0xa802, 0xa95e, 0xa863, + 0x0001, 0x8420, 0x9886, 0x0800, 0x0120, 0x2848, 0x9188, 0x0040, + 0x0c90, 0x2071, 0x188e, 0x7104, 0x7200, 0x82ff, 0x01d0, 0x7308, + 0x8318, 0x831f, 0x831b, 0x831b, 0x7312, 0x8319, 0x2001, 0x0800, + 0xa802, 0x2048, 0x8900, 0xa802, 0x2040, 0xa95e, 0xaa62, 0x8420, + 0x2300, 0x9906, 0x0130, 0x2848, 0x9188, 0x0040, 0x9291, 0x0000, + 0x0c88, 0xa803, 0x0000, 0x2071, 0x1800, 0x74ba, 0x74be, 0x0005, + 0x00e6, 0x0016, 0x9984, 0xfc00, 0x01e8, 0x908c, 0xf800, 0x1168, + 0x9982, 0x0400, 0x02b8, 0x9982, 0x0440, 0x0278, 0x9982, 0x0534, + 0x0288, 0x9982, 0x0800, 0x1270, 0x0040, 0x9982, 0x0800, 0x0250, + 0x2071, 0x188e, 0x7010, 0x9902, 0x1228, 0x9085, 0x0001, 0x001e, + 0x00ee, 0x0005, 0x9006, 0x0cd8, 0x00e6, 0x2071, 0x19f7, 0x7007, + 0x0000, 0x9006, 0x701e, 0x7022, 0x7002, 0x2071, 0x0000, 0x7010, + 0x9085, 0x8044, 0x7012, 0x2071, 0x0080, 0x9006, 0x20a9, 0x0040, + 0x7022, 0x1f04, 0x10f0, 0x702b, 0x0020, 0x00ee, 0x0005, 0x0126, + 0x2091, 0x8000, 0x00e6, 0xa073, 0x0000, 0x2071, 0x19f7, 0x701c, + 0x9088, 0x1a01, 0x280a, 0x8000, 0x9084, 0x003f, 0x701e, 0x7120, + 0x9106, 0x090c, 0x0dc3, 0x7004, 0x9005, 0x1128, 0x00f6, 0x2079, + 0x0080, 0x00a9, 0x00fe, 0x00ee, 0x012e, 0x0005, 0x0126, 0x2091, + 0x8000, 0x00e6, 0x2071, 0x19f7, 0x7004, 0x9005, 0x1128, 0x00f6, + 0x2079, 0x0080, 0x0021, 0x00fe, 0x00ee, 0x012e, 0x0005, 0x7004, + 0x9086, 0x0000, 0x1110, 0x7007, 0x0006, 0x7000, 0x0002, 0x1139, + 0x1137, 0x1137, 0x1137, 0x12b3, 0x12b3, 0x12b3, 0x12b3, 0x080c, + 0x0dc3, 0x701c, 0x7120, 0x9106, 0x1148, 0x792c, 0x9184, 0x0001, + 0x1120, 0xd1fc, 0x1110, 0x7007, 0x0000, 0x0005, 0x0096, 0x9180, + 0x1a01, 0x2004, 0x700a, 0x2048, 0x8108, 0x918c, 0x003f, 0x7122, + 0x782b, 0x0026, 0xa890, 0x7802, 0xa894, 0x7806, 0xa898, 0x780a, + 0xa89c, 0x780e, 0xa87c, 0x700e, 0xa874, 0x7016, 0xa878, 0x701a, + 0xa86c, 0x009e, 0xd084, 0x0120, 0x7007, 0x0001, 0x0029, 0x0005, + 0x7007, 0x0002, 0x00b1, 0x0005, 0x0016, 0x0026, 0x710c, 0x2011, + 0x0040, 0x9182, 0x0040, 0x1210, 0x2110, 0x9006, 0x700e, 0x7212, + 0x8203, 0x7812, 0x782b, 0x0020, 0x782b, 0x0041, 0x002e, 0x001e, + 0x0005, 0x0016, 0x0026, 0x0136, 0x0146, 0x0156, 0x7014, 0x20e0, + 0x7018, 0x2098, 0x20e9, 0x0000, 0x20a1, 0x0088, 0x782b, 0x0026, + 0x710c, 0x2011, 0x0040, 0x9182, 0x0040, 0x1210, 0x2110, 0x9006, + 0x700e, 0x22a8, 0x4006, 0x8203, 0x7812, 0x782b, 0x0020, 0x3300, + 0x701a, 0x782b, 0x0001, 0x015e, 0x014e, 0x013e, 0x002e, 0x001e, + 0x0005, 0x0016, 0x2009, 0x19f7, 0x2104, 0xc095, 0x200a, 0x080c, + 0x1116, 0x001e, 0x0005, 0x0016, 0x00e6, 0x2071, 0x19f7, 0x00f6, + 0x2079, 0x0080, 0x792c, 0xd1bc, 0x190c, 0x0dbc, 0x782b, 0x0002, + 0xd1fc, 0x0120, 0x918c, 0x0700, 0x7004, 0x0023, 0x00fe, 0x00ee, + 0x001e, 0x0005, 0x1127, 0x11d1, 0x1205, 0x0dc3, 0x0dc3, 0x12bf, + 0x0dc3, 0x918c, 0x0700, 0x1550, 0x0136, 0x0146, 0x0156, 0x7014, + 0x20e8, 0x7018, 0x20a0, 0x20e1, 0x0000, 0x2099, 0x0088, 0x782b, + 0x0040, 0x7010, 0x20a8, 0x4005, 0x3400, 0x701a, 0x015e, 0x014e, + 0x013e, 0x700c, 0x9005, 0x0578, 0x7800, 0x7802, 0x7804, 0x7806, + 0x080c, 0x116c, 0x0005, 0x7008, 0x0096, 0x2048, 0xa873, 0x0100, + 0x009e, 0x7007, 0x0000, 0x080c, 0x1127, 0x0005, 0x7008, 0x0096, + 0x2048, 0xa873, 0x0200, 0x009e, 0x0ca0, 0x918c, 0x0700, 0x1150, + 0x700c, 0x9005, 0x0180, 0x7800, 0x7802, 0x7804, 0x7806, 0x080c, + 0x1181, 0x0005, 0x7008, 0x0096, 0x2048, 0xa873, 0x0200, 0x009e, + 0x7007, 0x0000, 0x0080, 0x0096, 0x7008, 0x2048, 0x7800, 0xa892, + 0x7804, 0xa896, 0x7808, 0xa89a, 0x780c, 0xa89e, 0xa873, 0x0100, + 0x009e, 0x7007, 0x0000, 0x0096, 0x00d6, 0x7008, 0x2048, 0x2001, + 0x18ba, 0x2004, 0x9906, 0x1128, 0xa8a0, 0x080f, 0x00de, 0x009e, + 0x00a0, 0x00de, 0x009e, 0x0096, 0x00d6, 0x7008, 0x2048, 0x0081, + 0x0150, 0xa8a0, 0x0086, 0x2940, 0x080f, 0x008e, 0x00de, 0x009e, + 0x080c, 0x1116, 0x0005, 0x00de, 0x009e, 0x080c, 0x1116, 0x0005, + 0xa8ac, 0xd08c, 0x0005, 0x0096, 0xa0a4, 0x904d, 0x090c, 0x0dc3, + 0xa070, 0x908e, 0x0100, 0x0130, 0xa87f, 0x0030, 0xa887, 0x0000, + 0xa89b, 0x4002, 0xa898, 0x908e, 0x006b, 0x090c, 0x4740, 0x080c, + 0x6bf5, 0xa0a3, 0x0000, 0xa0a7, 0x0000, 0x2848, 0x080c, 0x103f, + 0x009e, 0x0005, 0x00a6, 0xa0a4, 0x904d, 0x090c, 0x0dc3, 0xa070, + 0x908e, 0x0100, 0x0128, 0xa87f, 0x0001, 0xa887, 0x0000, 0x00c0, + 0xa80c, 0x2050, 0xb004, 0x9005, 0x0198, 0xa80e, 0x2050, 0x8006, + 0x8006, 0x8007, 0x908c, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, + 0xa07a, 0xa176, 0xb000, 0xa07e, 0x2810, 0x080c, 0x10f7, 0x00c8, + 0xa980, 0xa898, 0x0016, 0x0006, 0x080c, 0x6bf5, 0x000e, 0x001e, + 0xd1a4, 0x0128, 0x00c6, 0x2060, 0x080c, 0xa39d, 0x00ce, 0x7008, + 0x2048, 0xa8a3, 0x0000, 0xa8a7, 0x0000, 0x080c, 0x103f, 0x080c, + 0x1116, 0x00ae, 0x0005, 0x0126, 0x2091, 0x8000, 0x782b, 0x1001, + 0x7007, 0x0005, 0x7000, 0xc094, 0x7002, 0x012e, 0x0005, 0x7007, + 0x0000, 0x080c, 0x1127, 0x0005, 0x0126, 0x2091, 0x2200, 0x2079, + 0x0300, 0x2071, 0x1a41, 0x7003, 0x0000, 0x78bf, 0x00f6, 0x781b, + 0x4800, 0x00c1, 0x7803, 0x0003, 0x780f, 0x0000, 0x20a9, 0x0266, + 0x2061, 0xe114, 0x2c0d, 0x7912, 0xe104, 0x9ce0, 0x0002, 0x7916, + 0x1f04, 0x12da, 0x7807, 0x0007, 0x7803, 0x0000, 0x7803, 0x0001, + 0x012e, 0x0005, 0x00c6, 0x7803, 0x0000, 0x7808, 0xd09c, 0x0110, + 0x7820, 0x0cd8, 0x2001, 0x1a42, 0x2003, 0x0000, 0x78ab, 0x0004, + 0x78ac, 0xd0ac, 0x1de8, 0x78ab, 0x0002, 0x7807, 0x0007, 0x7827, + 0x0030, 0x782b, 0x0400, 0x7827, 0x0031, 0x782b, 0x1a64, 0x781f, + 0xff00, 0x781b, 0xb700, 0x2001, 0x0200, 0x2004, 0xd0dc, 0x0110, + 0x781f, 0x0303, 0x2061, 0x1a64, 0x602f, 0x1cd0, 0x2001, 0x1819, + 0x2004, 0x9082, 0x1cd0, 0x6032, 0x603b, 0x1fb8, 0x2001, 0x3268, + 0xd0fc, 0x190c, 0x0dc3, 0x2001, 0x1810, 0x2004, 0xd0c4, 0x1128, + 0x2001, 0x0003, 0x2004, 0xd0d4, 0x1118, 0x783f, 0x3268, 0x0020, + 0x9084, 0xc000, 0x783f, 0xb268, 0x00ce, 0x0005, 0x0126, 0x2091, + 0x2200, 0x7908, 0x9184, 0x0030, 0x190c, 0x0dbc, 0xd19c, 0x0158, + 0x7820, 0x908c, 0xf000, 0x15f0, 0x908a, 0x0024, 0x1a0c, 0x0dc3, + 0x0023, 0x012e, 0x0005, 0x012e, 0x0005, 0x1372, 0x1372, 0x1389, + 0x138e, 0x1392, 0x1397, 0x13bf, 0x13c3, 0x13d1, 0x13d5, 0x1372, + 0x1467, 0x146b, 0x14db, 0x1372, 0x1372, 0x1372, 0x1372, 0x1372, + 0x1372, 0x1372, 0x1372, 0x1372, 0x1372, 0x1372, 0x1372, 0x1372, + 0x1399, 0x1372, 0x1372, 0x1372, 0x1372, 0x1372, 0x1372, 0x1376, + 0x1374, 0x1372, 0x080c, 0x0dc3, 0x080c, 0x0dbc, 0x080c, 0x14e2, + 0x2009, 0x1a59, 0x2104, 0x8000, 0x200a, 0x080c, 0x7dcd, 0x080c, + 0x19e3, 0x0005, 0x2009, 0x0048, 0x2060, 0x080c, 0xa419, 0x012e, + 0x0005, 0x7004, 0xc085, 0xc0b5, 0x7006, 0x0005, 0x7004, 0xc085, + 0x7006, 0x0005, 0x080c, 0x14e2, 0x080c, 0x164b, 0x0005, 0x080c, + 0x0dc3, 0x080c, 0x14e2, 0x2060, 0x6014, 0x0096, 0x2048, 0xa83b, + 0xffff, 0x009e, 0x2009, 0x0048, 0x080c, 0xa419, 0x2001, 0x015d, + 0x2003, 0x0000, 0x2009, 0x03e8, 0x8109, 0x0160, 0x2001, 0x0201, + 0x2004, 0x9005, 0x0dc8, 0x2001, 0x0218, 0x2004, 0xd0ec, 0x1110, + 0x080c, 0x14e7, 0x2001, 0x0307, 0x2003, 0x8000, 0x0005, 0x7004, + 0xc095, 0x7006, 0x0005, 0x080c, 0x14e2, 0x2060, 0x6014, 0x0096, + 0x2048, 0xa83b, 0xffff, 0x009e, 0x2009, 0x0048, 0x080c, 0xa419, + 0x0005, 0x080c, 0x14e2, 0x080c, 0x0dc3, 0x080c, 0x14e2, 0x080c, + 0x1452, 0x7827, 0x0018, 0x79ac, 0xd1dc, 0x0540, 0x7827, 0x0015, + 0x7828, 0x782b, 0x0000, 0x9065, 0x0138, 0x2001, 0x020d, 0x2003, + 0x0050, 0x2003, 0x0020, 0x0400, 0x7004, 0x9005, 0x1180, 0x78ab, + 0x0004, 0x7827, 0x0018, 0x782b, 0x0000, 0xd1bc, 0x090c, 0x0dc3, + 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x04c0, 0x78ab, + 0x0004, 0x7803, 0x0001, 0x080c, 0x146b, 0x0005, 0x7828, 0x782b, + 0x0000, 0x9065, 0x090c, 0x0dc3, 0x6014, 0x2048, 0x78ab, 0x0004, + 0x918c, 0x0700, 0x01d8, 0x080c, 0x7dcd, 0x080c, 0x19e3, 0x080c, + 0xc1cd, 0x0158, 0xa9b0, 0xa936, 0xa9b4, 0xa93a, 0xa83f, 0xffff, + 0xa843, 0xffff, 0xa884, 0xc0bd, 0xa886, 0xa984, 0x9184, 0x0020, + 0x1120, 0xc1ad, 0xa986, 0x080c, 0xbde5, 0x0005, 0x6010, 0x00b6, + 0x2058, 0xb800, 0x00be, 0xd0bc, 0x6024, 0x190c, 0xc5b0, 0x2029, + 0x00c8, 0x8529, 0x0128, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, + 0x7dbc, 0x080c, 0xe0a1, 0xd5a4, 0x1118, 0x080c, 0x14e7, 0x0005, + 0x080c, 0x7dcd, 0x080c, 0x19e3, 0x0005, 0x781f, 0x0300, 0x7803, + 0x0001, 0x0005, 0x0016, 0x0066, 0x0076, 0x00f6, 0x2079, 0x0300, + 0x7908, 0x918c, 0x0007, 0x9186, 0x0003, 0x0120, 0x2001, 0x0016, + 0x080c, 0x1568, 0x00fe, 0x007e, 0x006e, 0x001e, 0x0005, 0x7004, + 0xc09d, 0x7006, 0x0005, 0x7104, 0x9184, 0x0004, 0x190c, 0x0dc3, + 0xd184, 0x11b1, 0xd19c, 0x0180, 0xc19c, 0x7106, 0x0016, 0x080c, + 0x162e, 0x001e, 0x0148, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, + 0x0020, 0x080c, 0x14e7, 0x0005, 0x81ff, 0x190c, 0x0dc3, 0x0005, + 0x2100, 0xc184, 0xc1b4, 0x7106, 0xd0b4, 0x0016, 0x00e6, 0x1904, + 0x14d0, 0x2071, 0x0200, 0x080c, 0x1622, 0x080c, 0x162e, 0x05a8, + 0x6014, 0x9005, 0x05a8, 0x0096, 0x2048, 0xa868, 0x009e, 0x9084, + 0x00ff, 0x908e, 0x0029, 0x0160, 0x908e, 0x0048, 0x1548, 0x601c, + 0xd084, 0x11d8, 0x00f6, 0x2c78, 0x080c, 0x16c1, 0x00fe, 0x00a8, + 0x00f6, 0x2c78, 0x080c, 0x1805, 0x00fe, 0x2009, 0x01f4, 0x8109, + 0x0160, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001, 0x0218, + 0x2004, 0xd0ec, 0x1110, 0x0419, 0x0040, 0x2001, 0x020d, 0x2003, + 0x0020, 0x080c, 0x12ea, 0x7803, 0x0001, 0x00ee, 0x001e, 0x0005, + 0x080c, 0x162e, 0x0dd0, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, + 0x0020, 0x0069, 0x0c90, 0x0031, 0x2060, 0x2009, 0x0053, 0x080c, + 0xa419, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820, 0x0005, 0x080c, + 0x1452, 0x00d6, 0x2069, 0x0200, 0x2009, 0x01f4, 0x8109, 0x0520, + 0x6804, 0x9005, 0x0dd8, 0x2001, 0x015d, 0x2003, 0x0000, 0x79bc, + 0xd1a4, 0x1578, 0x79b8, 0x918c, 0x0fff, 0x0180, 0x9182, 0x0841, + 0x1268, 0x9188, 0x0007, 0x918c, 0x0ff8, 0x810c, 0x810c, 0x810c, + 0x080c, 0x1554, 0x6827, 0x0001, 0x8109, 0x1dd0, 0x080c, 0x1554, + 0x6827, 0x0002, 0x080c, 0x1554, 0x6804, 0x9005, 0x1170, 0x682c, + 0xd0e4, 0x1540, 0x691c, 0x9184, 0x0014, 0x0120, 0x6830, 0x9084, + 0x9554, 0x15b9, 0x6804, 0x9005, 0x0da8, 0x79b8, 0xd1ec, 0x1130, + 0x0870, 0x080c, 0x7dcd, 0x080c, 0x19e3, 0x0090, 0x7827, 0x0015, + 0x782b, 0x0000, 0x7827, 0x0018, 0x782b, 0x0000, 0x2001, 0x020d, + 0x2003, 0x0020, 0x2001, 0x0307, 0x2003, 0x0300, 0x7803, 0x0001, + 0x00de, 0x0005, 0x682c, 0x9084, 0x5400, 0x9086, 0x5400, 0x0d30, + 0x7827, 0x0015, 0x782b, 0x0000, 0x7803, 0x0001, 0x6800, 0x9085, + 0x1800, 0x6802, 0x00de, 0x0005, 0x6824, 0x9084, 0x0003, 0x1de0, + 0x0005, 0x2079, 0x0001, 0x000e, 0x00f6, 0x0804, 0x0dc5, 0x2001, + 0x0030, 0x2c08, 0x621c, 0x0021, 0x7830, 0x9086, 0x0041, 0x0005, + 0x00f6, 0x2079, 0x0300, 0x0006, 0x7808, 0xd09c, 0x0140, 0x0016, + 0x0026, 0x00c6, 0x080c, 0x1336, 0x00ce, 0x002e, 0x001e, 0x000e, + 0x0006, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x0059, 0x1118, + 0x000e, 0x00fe, 0x0005, 0x000e, 0x792c, 0x3900, 0x8000, 0x2004, + 0x080c, 0x0dc3, 0x2009, 0x180c, 0x2104, 0xc0f4, 0x200a, 0x2009, + 0xff00, 0x8109, 0x0904, 0x15e6, 0x7a18, 0x9284, 0x0030, 0x0904, + 0x15e1, 0x9284, 0x0048, 0x9086, 0x0008, 0x1904, 0x15e1, 0x2001, + 0x0109, 0x2004, 0xd08c, 0x01f0, 0x0006, 0x01c6, 0x01d6, 0x0136, + 0x0146, 0x0156, 0x0126, 0x2091, 0x2800, 0x00f6, 0x0026, 0x0016, + 0x2009, 0x1a5c, 0x2104, 0x8000, 0x0208, 0x200a, 0x080c, 0x885a, + 0x001e, 0x002e, 0x00fe, 0x012e, 0x015e, 0x014e, 0x013e, 0x01de, + 0x01ce, 0x000e, 0x2001, 0x009b, 0x2004, 0xd0fc, 0x01d0, 0x0006, + 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x00f6, 0x0016, + 0x2009, 0x1a5d, 0x2104, 0x8000, 0x0208, 0x200a, 0x080c, 0x1ddc, + 0x001e, 0x00fe, 0x015e, 0x014e, 0x013e, 0x01de, 0x01ce, 0x012e, + 0x000e, 0x7818, 0xd0bc, 0x1904, 0x1591, 0x0005, 0x2001, 0x180c, + 0x2004, 0xd0f4, 0x1528, 0x7a18, 0x9284, 0x0030, 0x0508, 0x9284, + 0x0048, 0x9086, 0x0008, 0x11e0, 0x2001, 0x19d3, 0x2004, 0x9005, + 0x01b8, 0x2001, 0x1a44, 0x2004, 0x9086, 0x0000, 0x0188, 0x2009, + 0x1a5b, 0x2104, 0x8000, 0x0208, 0x200a, 0x080c, 0x994f, 0x2009, + 0x180c, 0x2104, 0xc0f5, 0x200a, 0x2009, 0xff00, 0x0804, 0x1591, + 0x9085, 0x0001, 0x0005, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, + 0x080c, 0x158a, 0x1108, 0x0005, 0x792c, 0x3900, 0x8000, 0x2004, + 0x080c, 0x0dc3, 0x7037, 0x0001, 0x7150, 0x7037, 0x0002, 0x7050, + 0x2060, 0xd1bc, 0x1110, 0x7054, 0x2060, 0x0005, 0x0006, 0x0046, + 0x00e6, 0x2071, 0x0200, 0x7037, 0x0002, 0x7058, 0x9084, 0xff00, + 0x8007, 0x9086, 0x00bc, 0x1158, 0x2021, 0x1a5a, 0x2404, 0x8000, + 0x0208, 0x2022, 0x080c, 0x7dcd, 0x080c, 0x19e3, 0x9006, 0x00ee, + 0x004e, 0x000e, 0x0005, 0x0c11, 0x1108, 0x0005, 0x00e6, 0x0016, + 0x2071, 0x0200, 0x0879, 0x6120, 0x9186, 0x0000, 0x0904, 0x16b6, + 0x9186, 0x0002, 0x0904, 0x16b6, 0x6124, 0xd1dc, 0x01f8, 0x701c, + 0xd08c, 0x0904, 0x16b6, 0x7017, 0x0000, 0x2001, 0x0264, 0x2004, + 0xd0bc, 0x0904, 0x16b6, 0x2001, 0x0268, 0x00c6, 0x2064, 0x6104, + 0x6038, 0x00ce, 0x918e, 0x0039, 0x1904, 0x16b6, 0x9c06, 0x15f0, + 0x0126, 0x2091, 0x2600, 0x080c, 0x7d14, 0x012e, 0x7358, 0x745c, + 0x6014, 0x905d, 0x0598, 0x2b48, 0x6010, 0x00b6, 0x2058, 0xb800, + 0x00be, 0xd0bc, 0x190c, 0xc58b, 0xab42, 0xac3e, 0x2001, 0x1880, + 0x2004, 0xd0b4, 0x1170, 0x601c, 0xd0e4, 0x1158, 0x6010, 0x00b6, + 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1120, 0xa83b, 0x7fff, 0xa837, + 0xffff, 0x080c, 0x1fd8, 0x1190, 0x080c, 0x1862, 0x2a00, 0xa816, 0x0130, 0x2800, 0xa80e, 0x2c05, 0xa80a, 0x2c00, 0xa812, 0x7037, 0x0020, 0x781f, 0x0300, 0x001e, 0x00ee, 0x0005, 0x7037, 0x0050, - 0x7037, 0x0020, 0x001e, 0x00ee, 0x080c, 0x14d2, 0x0005, 0x080c, - 0x0dc4, 0x2001, 0x180d, 0x2004, 0xd08c, 0x190c, 0x6818, 0x2ff0, + 0x7037, 0x0020, 0x001e, 0x00ee, 0x080c, 0x14e7, 0x0005, 0x080c, + 0x0dc3, 0x2001, 0x180d, 0x2004, 0xd08c, 0x190c, 0x693f, 0x2ff0, 0x0126, 0x2091, 0x2200, 0x0016, 0x00c6, 0x3e60, 0x6014, 0x2048, 0x2940, 0x903e, 0x2730, 0xa868, 0x2068, 0xa81a, 0x9d84, 0x000f, - 0x9088, 0x1f70, 0x2165, 0x0002, 0x16ab, 0x16f8, 0x16ab, 0x16ab, - 0x16ab, 0x16da, 0x16ab, 0x16af, 0x16a4, 0x16ef, 0x16ab, 0x16ab, - 0x16ab, 0x17b5, 0x16c3, 0x16b9, 0xa968, 0x918c, 0x00ff, 0x918e, - 0x0048, 0x0904, 0x16ef, 0x9085, 0x0001, 0x0804, 0x17ab, 0xa880, + 0x9088, 0x1fb8, 0x2165, 0x0002, 0x16f3, 0x1740, 0x16f3, 0x16f3, + 0x16f3, 0x1722, 0x16f3, 0x16f7, 0x16ec, 0x1737, 0x16f3, 0x16f3, + 0x16f3, 0x17fd, 0x170b, 0x1701, 0xa968, 0x918c, 0x00ff, 0x918e, + 0x0048, 0x0904, 0x1737, 0x9085, 0x0001, 0x0804, 0x17f3, 0xa880, 0xd0bc, 0x0dc8, 0xa894, 0xa842, 0xa890, 0xa83e, 0xa88c, 0x0804, - 0x16ff, 0xa880, 0xd0bc, 0x0d78, 0xa894, 0xa842, 0xa890, 0xa83e, - 0xa88c, 0x0804, 0x174e, 0xa880, 0xd0bc, 0x0d28, 0xa894, 0xa842, - 0xa890, 0xa83e, 0xa804, 0x9045, 0x090c, 0x0dc4, 0xa168, 0xa91a, - 0x91ec, 0x000f, 0x9d80, 0x1f70, 0x2065, 0xa88c, 0xd19c, 0x1904, - 0x174e, 0x0428, 0xa880, 0xd0ac, 0x0970, 0xa804, 0x9045, 0x090c, - 0x0dc4, 0xa168, 0xa91a, 0x91ec, 0x000f, 0x9d80, 0x1f70, 0x2065, - 0x9006, 0xa842, 0xa83e, 0xd19c, 0x1904, 0x174e, 0x0080, 0xa880, - 0xd0ac, 0x0904, 0x16ab, 0x9006, 0xa842, 0xa83e, 0x0804, 0x174e, - 0xa880, 0xd0ac, 0x0904, 0x16ab, 0x9006, 0xa842, 0xa83e, 0x2c05, - 0x908a, 0x0037, 0x1a0c, 0x0dc4, 0x9082, 0x001c, 0x0002, 0x1722, - 0x1722, 0x1724, 0x1722, 0x1722, 0x1722, 0x172a, 0x1722, 0x1722, - 0x1722, 0x1730, 0x1722, 0x1722, 0x1722, 0x1736, 0x1722, 0x1722, - 0x1722, 0x173c, 0x1722, 0x1722, 0x1722, 0x1742, 0x1722, 0x1722, - 0x1722, 0x1748, 0x080c, 0x0dc4, 0xa578, 0xa47c, 0xa380, 0xa284, - 0x0804, 0x1793, 0xa588, 0xa48c, 0xa390, 0xa294, 0x0804, 0x1793, - 0xa598, 0xa49c, 0xa3a0, 0xa2a4, 0x0804, 0x1793, 0xa5a8, 0xa4ac, - 0xa3b0, 0xa2b4, 0x0804, 0x1793, 0xa5b8, 0xa4bc, 0xa3c0, 0xa2c4, - 0x0804, 0x1793, 0xa5c8, 0xa4cc, 0xa3d0, 0xa2d4, 0x0804, 0x1793, - 0xa5d8, 0xa4dc, 0xa3e0, 0xa2e4, 0x0804, 0x1793, 0x2c05, 0x908a, - 0x0035, 0x1a0c, 0x0dc4, 0x9082, 0x001c, 0x0002, 0x1771, 0x176f, - 0x176f, 0x176f, 0x176f, 0x176f, 0x1778, 0x176f, 0x176f, 0x176f, - 0x176f, 0x176f, 0x177f, 0x176f, 0x176f, 0x176f, 0x176f, 0x176f, - 0x1786, 0x176f, 0x176f, 0x176f, 0x176f, 0x176f, 0x178d, 0x080c, - 0x0dc4, 0xa570, 0xa474, 0xa778, 0xa67c, 0xa380, 0xa284, 0x00d8, + 0x1747, 0xa880, 0xd0bc, 0x0d78, 0xa894, 0xa842, 0xa890, 0xa83e, + 0xa88c, 0x0804, 0x1796, 0xa880, 0xd0bc, 0x0d28, 0xa894, 0xa842, + 0xa890, 0xa83e, 0xa804, 0x9045, 0x090c, 0x0dc3, 0xa168, 0xa91a, + 0x91ec, 0x000f, 0x9d80, 0x1fb8, 0x2065, 0xa88c, 0xd19c, 0x1904, + 0x1796, 0x0428, 0xa880, 0xd0ac, 0x0970, 0xa804, 0x9045, 0x090c, + 0x0dc3, 0xa168, 0xa91a, 0x91ec, 0x000f, 0x9d80, 0x1fb8, 0x2065, + 0x9006, 0xa842, 0xa83e, 0xd19c, 0x1904, 0x1796, 0x0080, 0xa880, + 0xd0ac, 0x0904, 0x16f3, 0x9006, 0xa842, 0xa83e, 0x0804, 0x1796, + 0xa880, 0xd0ac, 0x0904, 0x16f3, 0x9006, 0xa842, 0xa83e, 0x2c05, + 0x908a, 0x0037, 0x1a0c, 0x0dc3, 0x9082, 0x001c, 0x0002, 0x176a, + 0x176a, 0x176c, 0x176a, 0x176a, 0x176a, 0x1772, 0x176a, 0x176a, + 0x176a, 0x1778, 0x176a, 0x176a, 0x176a, 0x177e, 0x176a, 0x176a, + 0x176a, 0x1784, 0x176a, 0x176a, 0x176a, 0x178a, 0x176a, 0x176a, + 0x176a, 0x1790, 0x080c, 0x0dc3, 0xa578, 0xa47c, 0xa380, 0xa284, + 0x0804, 0x17db, 0xa588, 0xa48c, 0xa390, 0xa294, 0x0804, 0x17db, + 0xa598, 0xa49c, 0xa3a0, 0xa2a4, 0x0804, 0x17db, 0xa5a8, 0xa4ac, + 0xa3b0, 0xa2b4, 0x0804, 0x17db, 0xa5b8, 0xa4bc, 0xa3c0, 0xa2c4, + 0x0804, 0x17db, 0xa5c8, 0xa4cc, 0xa3d0, 0xa2d4, 0x0804, 0x17db, + 0xa5d8, 0xa4dc, 0xa3e0, 0xa2e4, 0x0804, 0x17db, 0x2c05, 0x908a, + 0x0035, 0x1a0c, 0x0dc3, 0x9082, 0x001c, 0x0002, 0x17b9, 0x17b7, + 0x17b7, 0x17b7, 0x17b7, 0x17b7, 0x17c0, 0x17b7, 0x17b7, 0x17b7, + 0x17b7, 0x17b7, 0x17c7, 0x17b7, 0x17b7, 0x17b7, 0x17b7, 0x17b7, + 0x17ce, 0x17b7, 0x17b7, 0x17b7, 0x17b7, 0x17b7, 0x17d5, 0x080c, + 0x0dc3, 0xa570, 0xa474, 0xa778, 0xa67c, 0xa380, 0xa284, 0x00d8, 0xa588, 0xa48c, 0xa790, 0xa694, 0xa398, 0xa29c, 0x00a0, 0xa5a0, 0xa4a4, 0xa7a8, 0xa6ac, 0xa3b0, 0xa2b4, 0x0068, 0xa5b8, 0xa4bc, 0xa7c0, 0xa6c4, 0xa3c8, 0xa2cc, 0x0030, 0xa5d0, 0xa4d4, 0xa7d8, @@ -538,120 +547,120 @@ static const uint16_t isp_2300_risc_code 0xae2a, 0xa98c, 0x8c60, 0x2c1d, 0xa8b0, 0xaab4, 0xa836, 0xaa3a, 0x8109, 0xa916, 0x1160, 0x3e60, 0x601c, 0xc085, 0x601e, 0xa880, 0xc0dd, 0xa882, 0x9006, 0x00ce, 0x001e, 0x012e, 0x0005, 0x2800, - 0xa80e, 0xab0a, 0x2c00, 0xa812, 0x0c70, 0x0804, 0x16ab, 0x2001, - 0x180d, 0x2004, 0xd08c, 0x190c, 0x6818, 0x2ff0, 0x0126, 0x2091, + 0xa80e, 0xab0a, 0x2c00, 0xa812, 0x0c70, 0x0804, 0x16f3, 0x2001, + 0x180d, 0x2004, 0xd08c, 0x190c, 0x693f, 0x2ff0, 0x0126, 0x2091, 0x2200, 0x0016, 0x00c6, 0x3e60, 0x6014, 0x2048, 0x2940, 0xa80e, - 0x2061, 0x1f6b, 0xa813, 0x1f6b, 0x2c05, 0xa80a, 0xa968, 0xa91a, - 0xa880, 0xd0ac, 0x090c, 0x0dc4, 0x9006, 0xa842, 0xa83e, 0x2c05, - 0x908a, 0x0035, 0x1a0c, 0x0dc4, 0xadd0, 0xacd4, 0xafd8, 0xaedc, + 0x2061, 0x1fb3, 0xa813, 0x1fb3, 0x2c05, 0xa80a, 0xa968, 0xa91a, + 0xa880, 0xd0ac, 0x090c, 0x0dc3, 0x9006, 0xa842, 0xa83e, 0x2c05, + 0x908a, 0x0035, 0x1a0c, 0x0dc3, 0xadd0, 0xacd4, 0xafd8, 0xaedc, 0xabe0, 0xaae4, 0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26, 0xae2a, 0xa8b0, 0xaab4, 0xa836, 0xaa3a, 0xa98c, 0xa868, 0x9084, 0x00ff, 0x9086, 0x0008, 0x1120, 0x8109, 0xa916, 0x0128, 0x0080, 0x918a, 0x0002, 0xa916, 0x1160, 0x3e60, 0x601c, 0xc085, 0x601e, 0xa880, 0xc0dd, 0xa882, 0x9006, 0x00ce, 0x001e, 0x012e, 0x0005, 0xa804, - 0x9045, 0x090c, 0x0dc4, 0xa80e, 0xa068, 0xa81a, 0x9084, 0x000f, - 0x9080, 0x1f70, 0x2015, 0x82ff, 0x090c, 0x0dc4, 0xaa12, 0x2205, + 0x9045, 0x090c, 0x0dc3, 0xa80e, 0xa068, 0xa81a, 0x9084, 0x000f, + 0x9080, 0x1fb8, 0x2015, 0x82ff, 0x090c, 0x0dc3, 0xaa12, 0x2205, 0xa80a, 0x0c08, 0x903e, 0x2730, 0xa884, 0xd0fc, 0x1190, 0x2d00, - 0x0002, 0x190f, 0x1871, 0x1871, 0x190f, 0x190f, 0x1909, 0x190f, - 0x1871, 0x18c0, 0x18c0, 0x18c0, 0x190f, 0x190f, 0x190f, 0x1906, - 0x18c0, 0xc0fc, 0xa886, 0xab2c, 0xaa30, 0xad1c, 0xac20, 0xdd9c, - 0x0904, 0x1911, 0x2c05, 0x908a, 0x0035, 0x1a0c, 0x0dc4, 0x9082, - 0x001c, 0x0002, 0x185d, 0x185b, 0x185b, 0x185b, 0x185b, 0x185b, - 0x1861, 0x185b, 0x185b, 0x185b, 0x185b, 0x185b, 0x1865, 0x185b, - 0x185b, 0x185b, 0x185b, 0x185b, 0x1869, 0x185b, 0x185b, 0x185b, - 0x185b, 0x185b, 0x186d, 0x080c, 0x0dc4, 0xa778, 0xa67c, 0x0804, - 0x1911, 0xa790, 0xa694, 0x0804, 0x1911, 0xa7a8, 0xa6ac, 0x0804, - 0x1911, 0xa7c0, 0xa6c4, 0x0804, 0x1911, 0xa7d8, 0xa6dc, 0x0804, - 0x1911, 0x2c05, 0x908a, 0x0037, 0x1a0c, 0x0dc4, 0x9082, 0x001c, - 0x0002, 0x1894, 0x1894, 0x1896, 0x1894, 0x1894, 0x1894, 0x189c, - 0x1894, 0x1894, 0x1894, 0x18a2, 0x1894, 0x1894, 0x1894, 0x18a8, - 0x1894, 0x1894, 0x1894, 0x18ae, 0x1894, 0x1894, 0x1894, 0x18b4, - 0x1894, 0x1894, 0x1894, 0x18ba, 0x080c, 0x0dc4, 0xa578, 0xa47c, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 14:46:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AB213106564A; Thu, 26 Jul 2012 14:46:20 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95B648FC0A; Thu, 26 Jul 2012 14:46:20 +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 q6QEkKW2094815; Thu, 26 Jul 2012 14:46:20 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6QEkKcb094813; Thu, 26 Jul 2012 14:46:20 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201207261446.q6QEkKcb094813@svn.freebsd.org> From: Joel Dahl Date: Thu, 26 Jul 2012 14:46:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238808 - head/lib/libc/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 14:46:20 -0000 Author: joel (doc committer) Date: Thu Jul 26 14:46:19 2012 New Revision: 238808 URL: http://svn.freebsd.org/changeset/base/238808 Log: Start manpage with Dd macro and also remove a trailing whitespace while here. Modified: head/lib/libc/locale/iswalnum_l.3 Modified: head/lib/libc/locale/iswalnum_l.3 ============================================================================== --- head/lib/libc/locale/iswalnum_l.3 Thu Jul 26 14:03:29 2012 (r238807) +++ head/lib/libc/locale/iswalnum_l.3 Thu Jul 26 14:46:19 2012 (r238808) @@ -24,8 +24,8 @@ .\" .\" $FreeBSD$ .\" -.Dt ISWALNUM_L 3 .Dd July 25, 2012 +.Dt ISWALNUM_L 3 .Os .Sh NAME .Nm iswalnum_l , @@ -161,7 +161,7 @@ except for .Fn iswphonogram_l , .Fn iswrune_l , .Fn iswspecial_l -and +and .Fn nextwctype_l which are .Fx From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 15:38:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B72E8106564A; Thu, 26 Jul 2012 15:38:22 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5204B8FC08; Thu, 26 Jul 2012 15:38:22 +0000 (UTC) Received: by obbun3 with SMTP id un3so3684875obb.13 for ; Thu, 26 Jul 2012 08:38:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=aVNfZdAG29x9ONEewrBbxCelVKFtdkCwULKhYCKARL0=; b=oR+gpUTBWCaHdTbHtiQ+HZjAu4CQrpMNvD6uP00vvFqMq6paAdyL+oSzRJIqT3rZFQ tAfeUcwfClV97qYtKjPb/IbaTBzMUyy74jTc+jPQ0gE0vQAlm8MqkXT3FU7zY+DkJxRt 3JRB9gANqn4UoQK7VjKkgBGMmZm4AU1Fh1SKgmfAJq1hgEbMwa7+HGFDPqVVQ3xPdDx4 iNJkexDQMWKhYJVxETkTDbmOj8krWbeo9w9pFUHokLBwlpopxTZkXuPglIqDHgwgt4nN tz3nS9TlifxP0c0xU2ja5/oGtWdfkSPvwT6RbxsGA8rGGrLJd/GdUG3Aoq1nkaFZZKTb Jxwg== MIME-Version: 1.0 Received: by 10.182.39.39 with SMTP id m7mr42457437obk.20.1343317101674; Thu, 26 Jul 2012 08:38:21 -0700 (PDT) Received: by 10.76.84.7 with HTTP; Thu, 26 Jul 2012 08:38:21 -0700 (PDT) In-Reply-To: <20120726101305.GA61029@vniz.net> References: <201207241603.q6OG3Sex048054@svn.freebsd.org> <0FB11763-EC8E-4396-BC4B-1FD2FC516A8C@gmail.com> <20120726101305.GA61029@vniz.net> Date: Thu, 26 Jul 2012 08:38:21 -0700 Message-ID: From: Garrett Cooper To: Andrey Chernov , Garrett Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: Re: svn commit: r238741 - head/lib/libelf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 15:38:22 -0000 On Thu, Jul 26, 2012 at 3:13 AM, Andrey Chernov wrote: > On Wed, Jul 25, 2012 at 04:26:29PM -0700, Garrett Cooper wrote: >> >> A bunch of the sys/boot directories probably need this too.. > > Two of them (ficl and zfs) just fixed in r238795. If I miss some others, > point me to. Pretty sure ficl was the big one, but I'll keep my eyes peeled for the others. Basically, if you update your source tree and something gets touched under /sys/boot and you run make buildworld -DNO_CLEAN, 9 times out of 10 you have to cd into the directories and run `make obj depend all` because the loader files are `missing`. -Garrett From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 15:48:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 15A811065672; Thu, 26 Jul 2012 15:48:08 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB7028FC2D; Thu, 26 Jul 2012 15:48:07 +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 q6QFm79s099873; Thu, 26 Jul 2012 15:48:07 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6QFm71u099869; Thu, 26 Jul 2012 15:48:07 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201207261548.q6QFm71u099869@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 26 Jul 2012 15:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238810 - head/lib/libedit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 15:48:08 -0000 Author: pfg Date: Thu Jul 26 15:48:07 2012 New Revision: 238810 URL: http://svn.freebsd.org/changeset/base/238810 Log: Drop non-portable libedit's el_data_set() and el_data_get() for private data. We can set/get private data with the documented el_get() and el_set() so there's no need for our local extensions, which never received much use anyway. While here, also re-arrange the call to term_init_arrow. This was left over from r89735 but is not required anymore. This changes reduce differences against NetBSD's libedit. MFC after: 2 months Modified: head/lib/libedit/el.c head/lib/libedit/histedit.h head/lib/libedit/term.c Modified: head/lib/libedit/el.c ============================================================================== --- head/lib/libedit/el.c Thu Jul 26 15:29:08 2012 (r238809) +++ head/lib/libedit/el.c Thu Jul 26 15:48:07 2012 (r238810) @@ -473,30 +473,6 @@ el_get(EditLine *el, int op, ...) return (rv); } -/* el_data_get(): - * Set user private data. - */ -public void -el_data_set (el, data) - EditLine *el; - void *data; -{ - el->el_data = data; - - return; -} - -/* el_data_get(): - * Return user private data. - */ -public void * -el_data_get (el) - EditLine *el; -{ - if (el->el_data) - return (el->el_data); - return (NULL); -} /* el_line(): * Return editing info Modified: head/lib/libedit/histedit.h ============================================================================== --- head/lib/libedit/histedit.h Thu Jul 26 15:29:08 2012 (r238809) +++ head/lib/libedit/histedit.h Thu Jul 26 15:48:07 2012 (r238810) @@ -154,13 +154,6 @@ int el_source(EditLine *, const char *) */ void el_resize(EditLine *); - -/* - * Set user private data. - */ -void el_data_set(EditLine *, void *); -void * el_data_get(EditLine *); - /* * User-defined function interface. */ Modified: head/lib/libedit/term.c ============================================================================== --- head/lib/libedit/term.c Thu Jul 26 15:29:08 2012 (r238809) +++ head/lib/libedit/term.c Thu Jul 26 15:48:07 2012 (r238810) @@ -340,8 +340,8 @@ term_init(EditLine *el) if (el->el_term.t_val == NULL) return (-1); (void) memset(el->el_term.t_val, 0, T_val * sizeof(int)); - term_init_arrow(el); (void) term_set(el, NULL); + term_init_arrow(el); return (0); } From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 16:34:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47C13106582C; Thu, 26 Jul 2012 16:34:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3224A8FC1C; Thu, 26 Jul 2012 16:34:22 +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 q6QGYMms003701; Thu, 26 Jul 2012 16:34:22 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6QGYLIZ003699; Thu, 26 Jul 2012 16:34:21 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207261634.q6QGYLIZ003699@svn.freebsd.org> From: Warner Losh Date: Thu, 26 Jul 2012 16:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238811 - head/sys/arm/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 16:34:22 -0000 Author: imp Date: Thu Jul 26 16:34:21 2012 New Revision: 238811 URL: http://svn.freebsd.org/changeset/base/238811 Log: Trim read/write sizes to 128 bytes. Pages are only 128 bytes in size. Writes larger than this will wrap to the same page. Reads larger than this are permitted, but why take chances. Modified: head/sys/arm/conf/SAM9260EK.hints Modified: head/sys/arm/conf/SAM9260EK.hints ============================================================================== --- head/sys/arm/conf/SAM9260EK.hints Thu Jul 26 15:48:07 2012 (r238810) +++ head/sys/arm/conf/SAM9260EK.hints Thu Jul 26 16:34:21 2012 (r238811) @@ -39,11 +39,10 @@ hint.map.4.end=0x0083ffff hint.map.4.name="fs" #hint.map.4.readonly=1 -# EEPROM +# EEPROM at24c512 - 512kbit 65,536x8 memory hint.icee.0.at="iicbus0" hint.icee.0.addr=0xa0 hint.icee.0.type=16 hint.icee.0.size=65536 -hint.icee.0.rd_sz=256 -hint.icee.0.wr_sz=256 - +hint.icee.0.rd_sz=128 +hint.icee.0.wr_sz=128 From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 16:45:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0D667106564A; Thu, 26 Jul 2012 16:45:29 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9DB08FC0A; Thu, 26 Jul 2012 16:45:28 +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 q6QGjSUD004569; Thu, 26 Jul 2012 16:45:28 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6QGjShF004565; Thu, 26 Jul 2012 16:45:28 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201207261645.q6QGjShF004565@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 26 Jul 2012 16:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238812 - head/sys/dev/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 16:45:29 -0000 Author: luigi Date: Thu Jul 26 16:45:28 2012 New Revision: 238812 URL: http://svn.freebsd.org/changeset/base/238812 Log: Add support for VALE bridges to the netmap core, see http://info.iet.unipi.it/~luigi/vale/ VALE lets you dynamically instantiate multiple software bridges that talk the netmap API (and are *extremely* fast), so you can test netmap applications without the need for high end hardware. This is particularly useful as I am completing a netmap-aware version of ipfw, and VALE provides an excellent testing platform. Also, I also have netmap backends for qemu mostly ready for commit to the port, and this too will let you interconnect virtual machines at high speed without fiddling with bridges, tap or other slow solutions. The API for applications is unchanged, so you can use the code in tools/tools/netmap (which i will update soon) on the VALE ports. This commit also syncs the code with the one in my internal repository, so you will see some conditional code for other platforms. The code should run mostly unmodified on stable/9 so people interested in trying it can just copy sys/dev/netmap/ and sys/net/netmap*.h from HEAD VALE is joint work with my colleague Giuseppe Lettieri, and is partly supported by the EU Projects CHANGE and OPENLAB Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_mem2.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Thu Jul 26 16:34:21 2012 (r238811) +++ head/sys/dev/netmap/netmap.c Thu Jul 26 16:45:28 2012 (r238812) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Matteo Landi, Luigi Rizzo. All rights reserved. + * Copyright (C) 2011-2012 Matteo Landi, Luigi Rizzo. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,6 +23,8 @@ * SUCH DAMAGE. */ +#define NM_BRIDGE + /* * This module supports memory mapped access to network devices, * see netmap(4). @@ -52,6 +54,14 @@ * transmit or receive queues (or all queues for a given interface). */ +#ifdef linux +#include "bsd_glue.h" +static netdev_tx_t netmap_start_linux(struct sk_buff *skb, struct net_device *dev); +#endif /* linux */ +#ifdef __APPLE__ +#include "osx_glue.h" +#endif +#ifdef __FreeBSD__ #include /* prerequisite */ __FBSDID("$FreeBSD$"); @@ -83,6 +93,7 @@ __FBSDID("$FreeBSD$"); #include /* bus_dmamap_* */ MALLOC_DEFINE(M_NETMAP, "netmap", "Network memory map"); +#endif /* __FreeBSD__ */ /* * lock and unlock for the netmap memory allocator @@ -115,6 +126,173 @@ int netmap_no_pendintr = 1; SYSCTL_INT(_dev_netmap, OID_AUTO, no_pendintr, CTLFLAG_RW, &netmap_no_pendintr, 0, "Always look for new received packets."); +int netmap_drop = 0; /* debugging */ +int netmap_flags = 0; /* debug flags */ +int netmap_copy = 0; /* debugging, copy content */ + +SYSCTL_INT(_dev_netmap, OID_AUTO, drop, CTLFLAG_RW, &netmap_drop, 0 , ""); +SYSCTL_INT(_dev_netmap, OID_AUTO, flags, CTLFLAG_RW, &netmap_flags, 0 , ""); +SYSCTL_INT(_dev_netmap, OID_AUTO, copy, CTLFLAG_RW, &netmap_copy, 0 , ""); + +#ifdef NM_BRIDGE /* support for netmap bridge */ + +/* + * system parameters. + * + * All switched ports have prefix NM_NAME. + * The switch has a max of NM_BDG_MAXPORTS ports (often stored in a bitmap, + * so a practical upper bound is 64). + * Each tx ring is read-write, whereas rx rings are readonly (XXX not done yet). + * The virtual interfaces use per-queue lock instead of core lock. + * In the tx loop, we aggregate traffic in batches to make all operations + * faster. The batch size is NM_BDG_BATCH + */ +#define NM_NAME "vale" /* prefix for the interface */ +#define NM_BDG_MAXPORTS 16 /* up to 64 ? */ +#define NM_BRIDGE_RINGSIZE 1024 /* in the device */ +#define NM_BDG_HASH 1024 /* forwarding table entries */ +#define NM_BDG_BATCH 1024 /* entries in the forwarding buffer */ +#define NM_BRIDGES 4 /* number of bridges */ +int netmap_bridge = NM_BDG_BATCH; /* bridge batch size */ +SYSCTL_INT(_dev_netmap, OID_AUTO, bridge, CTLFLAG_RW, &netmap_bridge, 0 , ""); +#ifdef linux +#define ADD_BDG_REF(ifp) (NA(ifp)->if_refcount++) +#define DROP_BDG_REF(ifp) (NA(ifp)->if_refcount-- <= 1) +#else /* !linux */ +#define ADD_BDG_REF(ifp) (ifp)->if_refcount++ +#define DROP_BDG_REF(ifp) refcount_release(&(ifp)->if_refcount) +#ifdef __FreeBSD__ +#include +#include +#endif /* __FreeBSD__ */ +#endif /* !linux */ + +static void bdg_netmap_attach(struct ifnet *ifp); +static int bdg_netmap_reg(struct ifnet *ifp, int onoff); +/* per-tx-queue entry */ +struct nm_bdg_fwd { /* forwarding entry for a bridge */ + void *buf; + uint64_t dst; /* dst mask */ + uint32_t src; /* src index ? */ + uint16_t len; /* src len */ +#if 0 + uint64_t src_mac; /* ignore 2 MSBytes */ + uint64_t dst_mac; /* ignore 2 MSBytes */ + uint32_t dst_idx; /* dst index in fwd table */ + uint32_t dst_buf; /* where we copy to */ +#endif +}; + +struct nm_hash_ent { + uint64_t mac; /* the top 2 bytes are the epoch */ + uint64_t ports; +}; + +/* + * Interfaces for a bridge are all in ports[]. + * The array has fixed size, an empty entry does not terminate + * the search. + */ +struct nm_bridge { + struct ifnet *bdg_ports[NM_BDG_MAXPORTS]; + int n_ports; + uint64_t act_ports; + int freelist; /* first buffer index */ + NM_SELINFO_T si; /* poll/select wait queue */ + NM_LOCK_T bdg_lock; /* protect the selinfo ? */ + + /* the forwarding table, MAC+ports */ + struct nm_hash_ent ht[NM_BDG_HASH]; + + int namelen; /* 0 means free */ + char basename[IFNAMSIZ]; +}; + +struct nm_bridge nm_bridges[NM_BRIDGES]; + +#define BDG_LOCK(b) mtx_lock(&(b)->bdg_lock) +#define BDG_UNLOCK(b) mtx_unlock(&(b)->bdg_lock) + +/* + * NA(ifp)->bdg_port port index + */ + +#ifndef linux +static inline void prefetch (const void *x) +{ + __asm volatile("prefetcht0 %0" :: "m" (*(const unsigned long *)x)); +} +#endif /* !linux */ + +// XXX only for multiples of 64 bytes, non overlapped. +static inline void +pkt_copy(void *_src, void *_dst, int l) +{ + uint64_t *src = _src; + uint64_t *dst = _dst; + if (unlikely(l >= 1024)) { + bcopy(src, dst, l); + return; + } + for (; likely(l > 0); l-=64) { + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + } +} + +/* + * locate a bridge among the existing ones. + * a ':' in the name terminates the bridge name. Otherwise, just NM_NAME. + * We assume that this is called with a name of at least NM_NAME chars. + */ +static struct nm_bridge * +nm_find_bridge(const char *name) +{ + int i, l, namelen, e; + struct nm_bridge *b = NULL; + + namelen = strlen(NM_NAME); /* base length */ + l = strlen(name); /* actual length */ + for (i = namelen + 1; i < l; i++) { + if (name[i] == ':') { + namelen = i; + break; + } + } + if (namelen >= IFNAMSIZ) + namelen = IFNAMSIZ; + ND("--- prefix is '%.*s' ---", namelen, name); + + /* use the first entry for locking */ + BDG_LOCK(nm_bridges); // XXX do better + for (e = -1, i = 1; i < NM_BRIDGES; i++) { + b = nm_bridges + i; + if (b->namelen == 0) + e = i; /* record empty slot */ + else if (strncmp(name, b->basename, namelen) == 0) { + ND("found '%.*s' at %d", namelen, name, i); + break; + } + } + if (i == NM_BRIDGES) { /* all full */ + if (e == -1) { /* no empty slot */ + b = NULL; + } else { + b = nm_bridges + e; + strncpy(b->basename, name, namelen); + b->namelen = namelen; + } + } + BDG_UNLOCK(nm_bridges); + return b; +} +#endif /* NM_BRIDGE */ /*------------- memory allocator -----------------*/ #ifdef NETMAP_MEM2 @@ -200,6 +378,46 @@ netmap_dtor_locked(void *data) netmap_if_free(nifp); } +static void +nm_if_rele(struct ifnet *ifp) +{ +#ifndef NM_BRIDGE + if_rele(ifp); +#else /* NM_BRIDGE */ + int i, full; + struct nm_bridge *b; + + if (strncmp(ifp->if_xname, NM_NAME, sizeof(NM_NAME) - 1)) { + if_rele(ifp); + return; + } + if (!DROP_BDG_REF(ifp)) + return; + b = ifp->if_bridge; + BDG_LOCK(nm_bridges); + BDG_LOCK(b); + ND("want to disconnect %s from the bridge", ifp->if_xname); + full = 0; + for (i = 0; i < NM_BDG_MAXPORTS; i++) { + if (b->bdg_ports[i] == ifp) { + b->bdg_ports[i] = NULL; + bzero(ifp, sizeof(*ifp)); + free(ifp, M_DEVBUF); + break; + } + else if (b->bdg_ports[i] != NULL) + full = 1; + } + BDG_UNLOCK(b); + if (full == 0) { + ND("freeing bridge %d", b - nm_bridges); + b->namelen = 0; + } + BDG_UNLOCK(nm_bridges); + if (i == NM_BDG_MAXPORTS) + D("ouch, cannot find ifp to remove"); +#endif /* NM_BRIDGE */ +} static void netmap_dtor(void *data) @@ -212,7 +430,7 @@ netmap_dtor(void *data) netmap_dtor_locked(data); na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); - if_rele(ifp); + nm_if_rele(ifp); bzero(priv, sizeof(*priv)); /* XXX for safety */ free(priv, M_DEVBUF); } @@ -228,6 +446,7 @@ netmap_dtor(void *data) * Return 0 on success, -1 otherwise. */ +#ifdef __FreeBSD__ static int netmap_mmap(__unused struct cdev *dev, #if __FreeBSD_version < 900000 @@ -246,6 +465,7 @@ netmap_mmap(__unused struct cdev *dev, return (0); } +#endif /* __FreeBSD__ */ /* @@ -363,6 +583,64 @@ netmap_sync_from_host(struct netmap_adap static int get_ifp(const char *name, struct ifnet **ifp) { +#ifdef NM_BRIDGE + struct ifnet *iter = NULL; + + do { + struct nm_bridge *b; + int i, l, cand = -1; + + if (strncmp(name, NM_NAME, sizeof(NM_NAME) - 1)) + break; + b = nm_find_bridge(name); + if (b == NULL) { + D("no bridges available for '%s'", name); + return (ENXIO); + } + /* XXX locking */ + BDG_LOCK(b); + /* lookup in the local list of ports */ + for (i = 0; i < NM_BDG_MAXPORTS; i++) { + iter = b->bdg_ports[i]; + if (iter == NULL) { + if (cand == -1) + cand = i; /* potential insert point */ + continue; + } + if (!strcmp(iter->if_xname, name)) { + ADD_BDG_REF(iter); + ND("found existing interface"); + BDG_UNLOCK(b); + break; + } + } + if (i < NM_BDG_MAXPORTS) /* already unlocked */ + break; + if (cand == -1) { + D("bridge full, cannot create new port"); +no_port: + BDG_UNLOCK(b); + *ifp = NULL; + return EINVAL; + } + ND("create new bridge port %s", name); + /* space for forwarding list after the ifnet */ + l = sizeof(*iter) + + sizeof(struct nm_bdg_fwd)*NM_BDG_BATCH ; + iter = malloc(l, M_DEVBUF, M_NOWAIT | M_ZERO); + if (!iter) + goto no_port; + strcpy(iter->if_xname, name); + bdg_netmap_attach(iter); + b->bdg_ports[cand] = iter; + iter->if_bridge = b; + ADD_BDG_REF(iter); + BDG_UNLOCK(b); + ND("attaching virtual bridge %p", b); + } while (0); + *ifp = iter; + if (! *ifp) +#endif /* NM_BRIDGE */ *ifp = ifunit_ref(name); if (*ifp == NULL) return (ENXIO); @@ -371,7 +649,7 @@ get_ifp(const char *name, struct ifnet * */ if ((*ifp)->if_capabilities & IFCAP_NETMAP && NA(*ifp)) return 0; /* valid pointer, we hold the refcount */ - if_rele(*ifp); + nm_if_rele(*ifp); return EINVAL; // not NETMAP capable } @@ -502,6 +780,21 @@ netmap_ioctl(__unused struct cdev *dev, u_int i, lim; struct netmap_if *nifp; +#ifdef linux +#define devfs_get_cdevpriv(pp) \ + ({ *(struct netmap_priv_d **)pp = ((struct file *)td)->private_data; \ + (*pp ? 0 : ENOENT); }) + +/* devfs_set_cdevpriv cannot fail on linux */ +#define devfs_set_cdevpriv(p, fn) \ + ({ ((struct file *)td)->private_data = p; (p ? 0 : EINVAL); }) + + +#define devfs_clear_cdevpriv() do { \ + netmap_dtor(priv); ((struct file *)td)->private_data = 0; \ + } while (0) +#endif /* linux */ + CURVNET_SET(TD_TO_VNET(td)); error = devfs_get_cdevpriv((void **)&priv); @@ -511,6 +804,7 @@ netmap_ioctl(__unused struct cdev *dev, } error = 0; /* Could be ENOENT */ + nmr->nr_name[sizeof(nmr->nr_name) - 1] = '\0'; /* truncate name */ switch (cmd) { case NIOCGINFO: /* return capabilities etc */ /* memsize is always valid */ @@ -535,7 +829,7 @@ netmap_ioctl(__unused struct cdev *dev, nmr->nr_tx_rings = na->num_tx_rings; nmr->nr_rx_slots = na->num_rx_desc; nmr->nr_tx_slots = na->num_tx_desc; - if_rele(ifp); /* return the refcount */ + nm_if_rele(ifp); /* return the refcount */ break; case NIOCREGIF: @@ -561,7 +855,7 @@ netmap_ioctl(__unused struct cdev *dev, M_NOWAIT | M_ZERO); if (priv == NULL) { error = ENOMEM; - if_rele(ifp); /* return the refcount */ + nm_if_rele(ifp); /* return the refcount */ break; } @@ -576,7 +870,7 @@ netmap_ioctl(__unused struct cdev *dev, D("too many NIOCREGIF attempts, give up"); error = EINVAL; free(priv, M_DEVBUF); - if_rele(ifp); /* return the refcount */ + nm_if_rele(ifp); /* return the refcount */ break; } @@ -593,6 +887,11 @@ netmap_ioctl(__unused struct cdev *dev, /* Otherwise set the card in netmap mode * and make it use the shared buffers. */ + for (i = 0 ; i < na->num_tx_rings + 1; i++) + mtx_init(&na->tx_rings[i].q_lock, "nm_txq_lock", MTX_NETWORK_LOCK, MTX_DEF); + for (i = 0 ; i < na->num_rx_rings + 1; i++) { + mtx_init(&na->rx_rings[i].q_lock, "nm_rxq_lock", MTX_NETWORK_LOCK, MTX_DEF); + } error = na->nm_register(ifp, 1); /* mode on */ if (error) netmap_dtor_locked(priv); @@ -601,7 +900,7 @@ netmap_ioctl(__unused struct cdev *dev, if (error) { /* reg. failed, release priv and ref */ error: na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); - if_rele(ifp); /* return the refcount */ + nm_if_rele(ifp); /* return the refcount */ bzero(priv, sizeof(*priv)); free(priv, M_DEVBUF); break; @@ -679,6 +978,7 @@ error: break; +#ifdef __FreeBSD__ case BIOCIMMEDIATE: case BIOCGHDRCMPLT: case BIOCSHDRCMPLT: @@ -696,9 +996,14 @@ error: so.so_vnet = ifp->if_vnet; // so->so_proto not null. error = ifioctl(&so, cmd, data, td); - if_rele(ifp); + nm_if_rele(ifp); break; } + +#else /* linux */ + default: + error = EOPNOTSUPP; +#endif /* linux */ } CURVNET_RESTORE(); @@ -715,6 +1020,11 @@ error: * selfd or on the global one. * Device-dependent parts (locking and sync of tx/rx rings) * are done through callbacks. + * + * On linux, pwait is the poll table. + * If pwait == NULL someone else already woke up before. We can report + * events but they are filtered upstream. + * If pwait != NULL, then pwait->key contains the list of events. */ static int netmap_poll(__unused struct cdev *dev, int events, struct thread *td) @@ -801,6 +1111,13 @@ netmap_poll(__unused struct cdev *dev, i * LOCKED_CL core lock is set, so we need to release it. */ core_lock = (check_all || !na->separate_locks) ? NEED_CL : NO_CL; +#ifdef NM_BRIDGE + /* the bridge uses separate locks */ + if (na->nm_register == bdg_netmap_reg) { + ND("not using core lock for %s", ifp->if_xname); + core_lock = NO_CL; + } +#endif /* NM_BRIDGE */ if (priv->np_qlast != NETMAP_HW_RING) { lim_tx = lim_rx = priv->np_qlast; } @@ -970,7 +1287,7 @@ netmap_lock_wrapper(struct ifnet *dev, i int netmap_attach(struct netmap_adapter *na, int num_queues) { - int i, n, size; + int n, size; void *buf; struct ifnet *ifp = na->ifp; @@ -999,18 +1316,21 @@ netmap_attach(struct netmap_adapter *na, ifp->if_capabilities |= IFCAP_NETMAP; na = buf; - if (na->nm_lock == NULL) + if (na->nm_lock == NULL) { + ND("using default locks for %s", ifp->if_xname); na->nm_lock = netmap_lock_wrapper; - mtx_init(&na->core_lock, "netmap core lock", NULL, MTX_DEF); - for (i = 0 ; i < na->num_tx_rings + 1; i++) - mtx_init(&na->tx_rings[i].q_lock, "netmap txq lock", NULL, MTX_DEF); - for (i = 0 ; i < na->num_rx_rings + 1; i++) - mtx_init(&na->rx_rings[i].q_lock, "netmap rxq lock", NULL, MTX_DEF); + /* core lock initialized here. + * others initialized after netmap_if_new + */ + mtx_init(&na->core_lock, "netmap core lock", MTX_NETWORK_LOCK, MTX_DEF); + } } #ifdef linux - D("netdev_ops %p", ifp->netdev_ops); - /* prepare a clone of the netdev ops */ - na->nm_ndo = *ifp->netdev_ops; + if (ifp->netdev_ops) { + D("netdev_ops %p", ifp->netdev_ops); + /* prepare a clone of the netdev ops */ + na->nm_ndo = *ifp->netdev_ops; + } na->nm_ndo.ndo_start_xmit = netmap_start_linux; #endif D("%s for %s", buf ? "ok" : "failed", ifp->if_xname); @@ -1137,6 +1457,16 @@ netmap_reset(struct netmap_adapter *na, kring->nkr_hwofs, na->ifp->if_xname, tx == NR_TX ? "TX" : "RX", n); +#if 0 // def linux + /* XXX check that the mappings are correct */ + /* need ring_nr, adapter->pdev, direction */ + buffer_info->dma = dma_map_single(&pdev->dev, addr, adapter->rx_buffer_len, DMA_FROM_DEVICE); + if (dma_mapping_error(&adapter->pdev->dev, buffer_info->dma)) { + D("error mapping rx netmap buffer %d", i); + // XXX fix error handling + } + +#endif /* linux */ /* * Wakeup on the individual and global lock * We do the wakeup here, but the ring is not yet reconfigured. @@ -1209,6 +1539,343 @@ static struct cdevsw netmap_cdevsw = { .d_poll = netmap_poll, }; +#ifdef NM_BRIDGE +/* + *---- support for virtual bridge ----- + */ + +/* ----- FreeBSD if_bridge hash function ------- */ + +/* + * The following hash function is adapted from "Hash Functions" by Bob Jenkins + * ("Algorithm Alley", Dr. Dobbs Journal, September 1997). + * + * http://www.burtleburtle.net/bob/hash/spooky.html + */ +#define mix(a, b, c) \ +do { \ + a -= b; a -= c; a ^= (c >> 13); \ + b -= c; b -= a; b ^= (a << 8); \ + c -= a; c -= b; c ^= (b >> 13); \ + a -= b; a -= c; a ^= (c >> 12); \ + b -= c; b -= a; b ^= (a << 16); \ + c -= a; c -= b; c ^= (b >> 5); \ + a -= b; a -= c; a ^= (c >> 3); \ + b -= c; b -= a; b ^= (a << 10); \ + c -= a; c -= b; c ^= (b >> 15); \ +} while (/*CONSTCOND*/0) + +static __inline uint32_t +nm_bridge_rthash(const uint8_t *addr) +{ + uint32_t a = 0x9e3779b9, b = 0x9e3779b9, c = 0; // hask key + + b += addr[5] << 8; + b += addr[4]; + a += addr[3] << 24; + a += addr[2] << 16; + a += addr[1] << 8; + a += addr[0]; + + mix(a, b, c); +#define BRIDGE_RTHASH_MASK (NM_BDG_HASH-1) + return (c & BRIDGE_RTHASH_MASK); +} + +#undef mix + + +static int +bdg_netmap_reg(struct ifnet *ifp, int onoff) +{ + int i, err = 0; + struct nm_bridge *b = ifp->if_bridge; + + BDG_LOCK(b); + if (onoff) { + /* the interface must be already in the list. + * only need to mark the port as active + */ + ND("should attach %s to the bridge", ifp->if_xname); + for (i=0; i < NM_BDG_MAXPORTS; i++) + if (b->bdg_ports[i] == ifp) + break; + if (i == NM_BDG_MAXPORTS) { + D("no more ports available"); + err = EINVAL; + goto done; + } + ND("setting %s in netmap mode", ifp->if_xname); + ifp->if_capenable |= IFCAP_NETMAP; + NA(ifp)->bdg_port = i; + b->act_ports |= (1<bdg_ports[i] = ifp; + } else { + /* should be in the list, too -- remove from the mask */ + ND("removing %s from netmap mode", ifp->if_xname); + ifp->if_capenable &= ~IFCAP_NETMAP; + i = NA(ifp)->bdg_port; + b->act_ports &= ~(1<bdg_port; + uint64_t smac, dmac; + struct netmap_slot *slot; + struct nm_bridge *b = ifp->if_bridge; + + ND("prepare to send %d packets, act_ports 0x%x", n, b->act_ports); + /* only consider valid destinations */ + all_dst = (b->act_ports & ~mysrc); + /* first pass: hash and find destinations */ + for (i = 0; likely(i < n); i++) { + uint8_t *buf = ft[i].buf; + dmac = le64toh(*(uint64_t *)(buf)) & 0xffffffffffff; + smac = le64toh(*(uint64_t *)(buf + 4)); + smac >>= 16; + if (unlikely(netmap_verbose)) { + uint8_t *s = buf+6, *d = buf; + D("%d len %4d %02x:%02x:%02x:%02x:%02x:%02x -> %02x:%02x:%02x:%02x:%02x:%02x", + i, + ft[i].len, + s[0], s[1], s[2], s[3], s[4], s[5], + d[0], d[1], d[2], d[3], d[4], d[5]); + } + /* + * The hash is somewhat expensive, there might be some + * worthwhile optimizations here. + */ + if ((buf[6] & 1) == 0) { /* valid src */ + uint8_t *s = buf+6; + sh = nm_bridge_rthash(buf+6); // XXX hash of source + /* update source port forwarding entry */ + b->ht[sh].mac = smac; /* XXX expire ? */ + b->ht[sh].ports = mysrc; + if (netmap_verbose) + D("src %02x:%02x:%02x:%02x:%02x:%02x on port %d", + s[0], s[1], s[2], s[3], s[4], s[5], NA(ifp)->bdg_port); + } + dst = 0; + if ( (buf[0] & 1) == 0) { /* unicast */ + uint8_t *d = buf; + dh = nm_bridge_rthash(buf); // XXX hash of dst + if (b->ht[dh].mac == dmac) { /* found dst */ + dst = b->ht[dh].ports; + if (netmap_verbose) + D("dst %02x:%02x:%02x:%02x:%02x:%02x to port %x", + d[0], d[1], d[2], d[3], d[4], d[5], (uint32_t)(dst >> 16)); + } + } + if (dst == 0) + dst = all_dst; + dst &= all_dst; /* only consider valid ports */ + if (unlikely(netmap_verbose)) + D("pkt goes to ports 0x%x", (uint32_t)dst); + ft[i].dst = dst; + } + + /* second pass, scan interfaces and forward */ + all_dst = (b->act_ports & ~mysrc); + for (ifn = 0; all_dst; ifn++) { + struct ifnet *dst_ifp = b->bdg_ports[ifn]; + struct netmap_adapter *na; + struct netmap_kring *kring; + struct netmap_ring *ring; + int j, lim, sent, locked; + + if (!dst_ifp) + continue; + ND("scan port %d %s", ifn, dst_ifp->if_xname); + dst = 1 << ifn; + if ((dst & all_dst) == 0) /* skip if not set */ + continue; + all_dst &= ~dst; /* clear current node */ + na = NA(dst_ifp); + + ring = NULL; + kring = NULL; + lim = sent = locked = 0; + /* inside, scan slots */ + for (i = 0; likely(i < n); i++) { + if ((ft[i].dst & dst) == 0) + continue; /* not here */ + if (!locked) { + kring = &na->rx_rings[0]; + ring = kring->ring; + lim = kring->nkr_num_slots - 1; + na->nm_lock(dst_ifp, NETMAP_RX_LOCK, 0); + locked = 1; + } + if (unlikely(kring->nr_hwavail >= lim)) { + if (netmap_verbose) + D("rx ring full on %s", ifp->if_xname); + break; + } + j = kring->nr_hwcur + kring->nr_hwavail; + if (j > lim) + j -= kring->nkr_num_slots; + slot = &ring->slot[j]; + ND("send %d %d bytes at %s:%d", i, ft[i].len, dst_ifp->if_xname, j); + pkt_copy(ft[i].buf, NMB(slot), ft[i].len); + slot->len = ft[i].len; + kring->nr_hwavail++; + sent++; + } + if (locked) { + ND("sent %d on %s", sent, dst_ifp->if_xname); + if (sent) + selwakeuppri(&kring->si, PI_NET); + na->nm_lock(dst_ifp, NETMAP_RX_UNLOCK, 0); + } + } + return 0; +} + +/* + * main dispatch routine + */ +static int +bdg_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int do_lock) +{ + struct netmap_adapter *na = NA(ifp); + struct netmap_kring *kring = &na->tx_rings[ring_nr]; + struct netmap_ring *ring = kring->ring; + int i, j, k, lim = kring->nkr_num_slots - 1; + struct nm_bdg_fwd *ft = (struct nm_bdg_fwd *)(ifp + 1); + int ft_i; /* position in the forwarding table */ + + k = ring->cur; + if (k > lim) + return netmap_ring_reinit(kring); + if (do_lock) + na->nm_lock(ifp, NETMAP_TX_LOCK, ring_nr); + + if (netmap_bridge <= 0) { /* testing only */ + j = k; // used all + goto done; + } + if (netmap_bridge > NM_BDG_BATCH) + netmap_bridge = NM_BDG_BATCH; + + ft_i = 0; /* start from 0 */ + for (j = kring->nr_hwcur; likely(j != k); j = unlikely(j == lim) ? 0 : j+1) { + struct netmap_slot *slot = &ring->slot[j]; + int len = ft[ft_i].len = slot->len; + char *buf = ft[ft_i].buf = NMB(slot); + + prefetch(buf); + if (unlikely(len < 14)) + continue; + if (unlikely(++ft_i == netmap_bridge)) + ft_i = nm_bdg_flush(ft, ft_i, ifp); + } + if (ft_i) + ft_i = nm_bdg_flush(ft, ft_i, ifp); + /* count how many packets we sent */ + i = k - j; + if (i < 0) + i += kring->nkr_num_slots; + kring->nr_hwavail = kring->nkr_num_slots - 1 - i; + if (j != k) + D("early break at %d/ %d, avail %d", j, k, kring->nr_hwavail); + +done: + kring->nr_hwcur = j; + ring->avail = kring->nr_hwavail; + if (do_lock) + na->nm_lock(ifp, NETMAP_TX_UNLOCK, ring_nr); + + if (netmap_verbose) + D("%s ring %d lock %d", ifp->if_xname, ring_nr, do_lock); + return 0; +} + +static int +bdg_netmap_rxsync(struct ifnet *ifp, u_int ring_nr, int do_lock) +{ + struct netmap_adapter *na = NA(ifp); + struct netmap_kring *kring = &na->rx_rings[ring_nr]; + struct netmap_ring *ring = kring->ring; + int j, n, lim = kring->nkr_num_slots - 1; + u_int k = ring->cur, resvd = ring->reserved; + + ND("%s ring %d lock %d avail %d", + ifp->if_xname, ring_nr, do_lock, kring->nr_hwavail); + + if (k > lim) + return netmap_ring_reinit(kring); + if (do_lock) + na->nm_lock(ifp, NETMAP_RX_LOCK, ring_nr); + + /* skip past packets that userspace has released */ + j = kring->nr_hwcur; /* netmap ring index */ + if (resvd > 0) { + if (resvd + ring->avail >= lim + 1) { + D("XXX invalid reserve/avail %d %d", resvd, ring->avail); + ring->reserved = resvd = 0; // XXX panic... + } + k = (k >= resvd) ? k - resvd : k + lim + 1 - resvd; + } + + if (j != k) { /* userspace has released some packets. */ + n = k - j; + if (n < 0) + n += kring->nkr_num_slots; + ND("userspace releases %d packets", n); + for (n = 0; likely(j != k); n++) { + struct netmap_slot *slot = &ring->slot[j]; + void *addr = NMB(slot); + + if (addr == netmap_buffer_base) { /* bad buf */ + if (do_lock) + na->nm_lock(ifp, NETMAP_RX_UNLOCK, ring_nr); + return netmap_ring_reinit(kring); + } + /* decrease refcount for buffer */ + + slot->flags &= ~NS_BUF_CHANGED; + j = unlikely(j == lim) ? 0 : j + 1; + } + kring->nr_hwavail -= n; + kring->nr_hwcur = k; + } + /* tell userspace that there are new packets */ + ring->avail = kring->nr_hwavail - resvd; + + if (do_lock) + na->nm_lock(ifp, NETMAP_RX_UNLOCK, ring_nr); + return 0; +} + +static void +bdg_netmap_attach(struct ifnet *ifp) +{ + struct netmap_adapter na; + + ND("attaching virtual bridge"); + bzero(&na, sizeof(na)); + + na.ifp = ifp; + na.separate_locks = 1; + na.num_tx_desc = NM_BRIDGE_RINGSIZE; + na.num_rx_desc = NM_BRIDGE_RINGSIZE; + na.nm_txsync = bdg_netmap_txsync; + na.nm_rxsync = bdg_netmap_rxsync; + na.nm_register = bdg_netmap_reg; + netmap_attach(&na, 1); +} + +#endif /* NM_BRIDGE */ static struct cdev *netmap_dev; /* /dev/netmap character device. */ @@ -1235,6 +1902,14 @@ netmap_init(void) (int)(nm_mem->nm_totalsize >> 20)); netmap_dev = make_dev(&netmap_cdevsw, 0, UID_ROOT, GID_WHEEL, 0660, "netmap"); + +#ifdef NM_BRIDGE + { + int i; + for (i = 0; i < NM_BRIDGES; i++) + mtx_init(&nm_bridges[i].bdg_lock, "bdg lock", "bdg_lock", MTX_DEF); + } +#endif return (error); } @@ -1253,6 +1928,7 @@ netmap_fini(void) } +#ifdef __FreeBSD__ /* * Kernel entry point. * @@ -1284,3 +1960,4 @@ netmap_loader(__unused struct module *mo DEV_MODULE(netmap, netmap_loader, NULL); +#endif /* __FreeBSD__ */ Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Thu Jul 26 16:34:21 2012 (r238811) +++ head/sys/dev/netmap/netmap_kern.h Thu Jul 26 16:45:28 2012 (r238812) @@ -25,7 +25,7 @@ /* * $FreeBSD$ - * $Id: netmap_kern.h 10602 2012-02-21 16:47:55Z luigi $ + * $Id: netmap_kern.h 11343 2012-07-03 09:08:38Z luigi $ * * The header contains the definitions of constants and function * prototypes used only in kernelspace. @@ -37,6 +37,9 @@ #define NETMAP_MEM2 // use the new memory allocator #if defined(__FreeBSD__) +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(!!(x), 0) + #define NM_LOCK_T struct mtx #define NM_SELINFO_T struct selinfo #define MBUF_LEN(m) ((m)->m_pkthdr.len) @@ -46,6 +49,33 @@ #define NM_SELINFO_T wait_queue_head_t #define MBUF_LEN(m) ((m)->len) #define NM_SEND_UP(ifp, m) netif_rx(m) + +#ifndef DEV_NETMAP +#define DEV_NETMAP +#endif + +/* + * IFCAP_NETMAP goes into net_device's flags (if_capabilities) + * and priv_flags (if_capenable). The latter used to be 16 bits + * up to linux 2.6.36, so we need to use a 16 bit value on older + * platforms and tolerate the clash with IFF_DYNAMIC and IFF_BRIDGE_PORT. + * For the 32-bit value, 0x100000 (bit 20) has no clashes up to 3.3.1 + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) +#define IFCAP_NETMAP 0x8000 +#else +#define IFCAP_NETMAP 0x100000 +#endif + +#elif defined (__APPLE__) +#warning apple support is experimental +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(!!(x), 0) +#define NM_LOCK_T IOLock * +#define NM_SELINFO_T struct selinfo +#define MBUF_LEN(m) ((m)->m_pkthdr.len) +#define NM_SEND_UP(ifp, m) ((ifp)->if_input)(ifp, m) + #else #error unsupported platform #endif @@ -64,6 +94,9 @@ MALLOC_DECLARE(M_NETMAP); __FUNCTION__, __LINE__, ##__VA_ARGS__); \ } while (0) +#ifndef IFF_NETMAP /* XXX is it really needed ? */ +#define IFF_NETMAP 0x20000 +#endif struct netmap_adapter; /* @@ -150,8 +183,11 @@ struct netmap_adapter { void (*nm_lock)(struct ifnet *, int what, u_int ringid); int (*nm_txsync)(struct ifnet *, u_int ring, int lock); int (*nm_rxsync)(struct ifnet *, u_int ring, int lock); + + int bdg_port; #ifdef linux struct net_device_ops nm_ndo; + int if_refcount; // XXX additions for bridge #endif /* linux */ }; @@ -240,6 +276,7 @@ enum { #define NA(_ifp) ((struct netmap_adapter *)WNA(_ifp)) +#ifdef __FreeBSD__ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 17:30:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DADC106566B; Thu, 26 Jul 2012 17:30:35 +0000 (UTC) (envelope-from issyl0@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A2808FC14; Thu, 26 Jul 2012 17:30:35 +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 q6QHUYP2008170; Thu, 26 Jul 2012 17:30:34 GMT (envelope-from issyl0@svn.freebsd.org) Received: (from issyl0@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6QHUY3b008168; Thu, 26 Jul 2012 17:30:34 GMT (envelope-from issyl0@svn.freebsd.org) Message-Id: <201207261730.q6QHUY3b008168@svn.freebsd.org> From: Isabell Long Date: Thu, 26 Jul 2012 17:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238813 - head/sbin/geom/class/sched X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 17:30:35 -0000 Author: issyl0 (doc committer) Date: Thu Jul 26 17:30:34 2012 New Revision: 238813 URL: http://svn.freebsd.org/changeset/base/238813 Log: The ad(4) driver no longer exists in FreeBSD CURRENT or 9, so change the references to it in gsched(8) to the existing ada(4) driver. PR: docs/170085 Submitted by: olgeni Approved by: gavin MFC after: 5 days Modified: head/sbin/geom/class/sched/gsched.8 Modified: head/sbin/geom/class/sched/gsched.8 ============================================================================== --- head/sbin/geom/class/sched/gsched.8 Thu Jul 26 16:45:28 2012 (r238812) +++ head/sbin/geom/class/sched/gsched.8 Thu Jul 26 17:30:34 2012 (r238813) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 29, 2010 +.Dd July 26, 2012 .Dt GSCHED 8 .Os .Sh NAME @@ -135,19 +135,19 @@ maximum amount of debug information is p Exit status is 0 on success, and 1 if the command fails. .Sh EXAMPLES The following example shows how to create a scheduling provider for disk -.Pa /dev/ad0 , +.Pa /dev/ada0 , and how to destroy it. .Bd -literal -offset indent # Load the geom_sched module: kldload geom_sched # Load some scheduler classes used by geom_sched: kldload gsched_rr -# Configure device ad0 to use scheduler "rr": -geom sched insert -a rr ad0 -# Now provider ad0 uses the "rr" algorithm; -# the new geom is ad0.sched. +# Configure device ada0 to use scheduler "rr": +geom sched insert -a rr ada0 +# Now provider ada0 uses the "rr" algorithm; +# the new geom is ada0.sched. # Remove the scheduler on the device: -geom sched destroy -v ad0.sched. +geom sched destroy -v ada0.sched. .Ed .Sh SEE ALSO .Xr geom 4 , From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 17:59:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21222106566C; Thu, 26 Jul 2012 17:59:58 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 7CF858FC16; Thu, 26 Jul 2012 17:59:57 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6QI00Q1078733; Thu, 26 Jul 2012 21:00:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6QHxlUd098685; Thu, 26 Jul 2012 20:59:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6QHxlOB098684; Thu, 26 Jul 2012 20:59:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 26 Jul 2012 20:59:47 +0300 From: Konstantin Belousov To: Bruce Evans Message-ID: <20120726175947.GZ2676@deviant.kiev.zoral.com.ua> References: <500F9E22.4080608@FreeBSD.org> <20120725102130.GH2676@deviant.kiev.zoral.com.ua> <500FE6AE.8070706@FreeBSD.org> <20120726001659.M5406@besplex.bde.org> <50102C94.9030706@FreeBSD.org> <20120725180537.GO2676@deviant.kiev.zoral.com.ua> <50103C61.8040904@FreeBSD.org> <20120726170837.Q2536@besplex.bde.org> <20120726104918.GW2676@deviant.kiev.zoral.com.ua> <20120726213001.K3621@besplex.bde.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="A5JfamB56Xzo2P18" Content-Disposition: inline In-Reply-To: <20120726213001.K3621@besplex.bde.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Jim Harris , src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , svn-src-head@freebsd.org, Jung-uk Kim Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 17:59:58 -0000 --A5JfamB56Xzo2P18 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 26, 2012 at 10:30:51PM +1000, Bruce Evans wrote: > On Thu, 26 Jul 2012, Konstantin Belousov wrote: >=20 > >On Thu, Jul 26, 2012 at 05:35:23PM +1000, Bruce Evans wrote: > >>In fact, there is always a full documented serialization instruction > >>for syscalls, except maybe in FreeBSD-1 compat code on i386, at > >>least on Athlon64. i386 syscalls use int 0x80 (except in FreeBSD-1 > >>compat code they use lcalls, and the iret necessary to return from > >>this is serializing on at least Athlon64. amd64 syscalls use > >>sysenter/sysret. sysret isn't serializing (like far returns), at least > >>on Athlon64, but at least in FreeBSD, the syscall implementation uses > >>at least 2 swapgs's (one on entry and one just before the sysret), and > >>swapgs is serializing, at least on Athlon64. > >Yes, SWAPGS is not documented as serializing on Intels. I reviewed >=20 > Isn't that too incompatible? After the SYSRETQ story, we should not be surprised. I believe I saw the difference between SWAPGS specifications earlier. >=20 > >the whole syscall sequence for e.g. gettimeofday(2), and there is no > >serialization point for fast path. E.g. ast would add locking and thus > >serialization, as well as return by IRET, but fast path on amd64 has > >no such things. >=20 > >>>This function was moved around from time to time and now it sits here: > >>> > >>>http://git.kernel.org/?p=3Dlinux/kernel/git/torvalds/linux.git;a=3Dblo= b_plain;f=3Darch/x86/vdso/vclock_gettime.c > >>> > >>>It still carries one barrier before rdtsc. Please see the comments. > >> > >>For safety, you probably need to use the slowest (cpuid) method. Linux > >>seems to be just using fences that are observed to work. > >No, there is explicit mention of the recommended barriers in the vendor > >documentation, which is LFENCE for Intels, and MFENCE for AMDs. My patch > >just follows what is suggested in documentation. >=20 > But you say later theat CPUID is needed (instead of just lock?). The > original Athlon64 manual doesn't seem to mention MFENCE for RTDSC. > Maybe later manuals clarify that MFENCE works on old CPUs too. >=20 > >[Replying to other mail in-place, the thread goes wild] >=20 > Too much quoting :-). >=20 > >On Thu, Jul 26, 2012 at 04:25:01PM +1000, Bruce Evans wrote: > >>... > >>For the threaded case, there has to something for the accesses to be > >>provably ordered. It is hard to see how the something can be strong > >>enough unless it serializes all thread state in A and B. The rdtsc > >>state is not part of the thread state as know to APIs, but it is hard > >>to see how threads can serialize themselves without also serializing > >>the TSC. > >TSC timer read is not synchronized, and I found the Linux test for the > >thing I described above. Adopted version is available at > >http://people.freebsd.org/~kib/misc/time-warp-test.c. > >It shall be compiled in 32bit mode only. >=20 > My point is that it will normally be synchronized by whatever the threads > do to provide synchronization for themself. Only the case of a single > thread doing sequential timer reads should expect the reads to be > monotonic without any explicit synchronization. I hope this case doesn't > require stalling everything in low-level code. >=20 > >On my Nehalem workstation, I get enormous amount of wraps reported for > >RDTSC without CPUID. Adding CPUID back fixes the issue. So at least on > >Nehalems (and probably Westmere, I will test later today) RDTSC can even > >pass LOCKed instructions. >=20 > Oh, you mean with the test program, that it needs CPUID because it only > has locks and no fences and its CPUID is commented out. Yes, CPUID or LFENCE is enough to fix the failure. >=20 > >Curiously enough, SandyBridge is sane and reports zero wraps, it seems > >Intel fixed the bug. >=20 > The original Athlon64 manual doesn't seem to mention locks being sufficie= nt > any more than it mentions fences. >=20 > >>I care about timestamps being ordered more than most people, and tried > >>to kill the get*time() APIs because they are weakly ordered relative > >>to the non-get variants (they return times in the past, and there is > >>no way to round down to get consistent times). I tried to fix them > >>by adding locking and updating them to the latest time whenever a > >>non-get variant gives a later time (by being used). This was too slow, > >>and breaks the design criteria that timecounter calls should not use > >>any explicit locking. However, if you want slowness, then you can get > >>it similarly by fixing the monotonicity of rdtsc in software. I think > >>I just figured out how to do this with the same slowness as serializati= on, > >>if a locked instruction serialzes; maybe less otherwise: > >> > >>spin: > >> ptsc =3D prev_tsc; /* memory -> local (intentionally !atomic) */ > >> tsc =3D rdtsc(); /* only 32 bits for timecounters */ > >> if (tsc <=3D ptsc) { /* I forgot about wrap at first -- see below > >> */ > >> /* > >> * It went backwards, or stopped. Could handle more > >> * completely, starting with panic() to see if this > >> * happens at all. > >> */ > >> return (ptsc); /* stopped is better than backwards */ > >> } > >> /* Usual case; update (32 bits). */ > >> if (atomic_cmpset_int(&prev_tsc, ptsc, tsc)) > >> return (tsc); > >> goto spin; > >I do not understand this. Algorithm is clear, but what you propose is > >very heavy-weight comparing with adding just LFENCE or MFENCE before rdt= sc. > >First, the cache-line for prev_tsc becomes heavy-contended. Second, CAS > >is expensive. LFENCE is fully local to the core it executes on. >=20 > I expect the contention to be rare, but then optimization isn't important > either. >=20 > But if the problem is fully local, as it apparently is for fences to > fix it, then prev_tsc can be per-CPU with a non-atomic cmpset to access > it. We don't care if rdtsc gives an old value due to some delay in > copying the result to EDX:EAX any more than we care about an old value > due to being interrupted. The case where we are interrupted, and > context-switched, and come back on a different CPU, is especially > interesting. Then we may have an old tsc value from another CPU. > Sometimes we detect that it is old for the new CPU, sometimes not. > There is a problem in theory but I think none in practice. The switch > could set a flag to tell us to loop (set prev_tsc to a sentinel value), > and it accidentally already does, except with serious our of orderness: > switches happen to always call the TSC if the TSC is usable, to maintain > the the pcpu switchtime variable. The call for this will give a tsc > value for the new CPU that is in advance of the old one, provided there > all the TSC are in sync and there is sufficient monotonicity across > CPUs. Then the loop will see that its tsc is old, and repeat. >=20 > I am only half serious in proposing the above. If you want to be slow > then you can do useful work like ensuring monotonicity across all CPUs > in much the same time that is wasted by stalling the hardware until > everything is serialized. But monotonicity across all cores (at least for single-package systems) is exactly what the patch ensures. --A5JfamB56Xzo2P18 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlARhZMACgkQC3+MBN1Mb4jkIgCgsBCOqyfjUOHE+c3s5tSlUOOs pykAn3RM8kQDvBuxCSMaRqMS0fzL6dq2 =2hGT -----END PGP SIGNATURE----- --A5JfamB56Xzo2P18-- From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 18:44:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3D7E0106566C; Thu, 26 Jul 2012 18:44:57 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id DD1DE8FC14; Thu, 26 Jul 2012 18:44:56 +0000 (UTC) Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57]) by alto.onthenet.com.au (Postfix) with ESMTPS id 26E9312264; Fri, 27 Jul 2012 04:44:50 +1000 (EST) Received: from Peter-Grehans-MacBook-Pro.local (c-75-70-33-234.hsd1.co.comcast.net [75.70.33.234]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with ESMTP id BFJ02743 (AUTH peterg@ptree32.com.au); Fri, 27 Jul 2012 04:44:46 +1000 Message-ID: <5011901B.1060008@freebsd.org> Date: Thu, 26 Jul 2012 12:44:43 -0600 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20 MIME-Version: 1.0 To: Konstantin Belousov References: <500F9E22.4080608@FreeBSD.org> <20120725102130.GH2676@deviant.kiev.zoral.com.ua> <500FE6AE.8070706@FreeBSD.org> <20120726001659.M5406@besplex.bde.org> <50102C94.9030706@FreeBSD.org> <20120725180537.GO2676@deviant.kiev.zoral.com.ua> <50103C61.8040904@FreeBSD.org> <20120726170837.Q2536@besplex.bde.org> <20120726104918.GW2676@deviant.kiev.zoral.com.ua> <20120726213001.K3621@besplex.bde.org> <20120726175947.GZ2676@deviant.kiev.zoral.com.ua> In-Reply-To: <20120726175947.GZ2676@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Info: RCVD_IN_PBL,RCVD_IN_SORBS_DUL,RDNS_DYNAMIC,SPF_SOFTFAIL X-Junkmail-Status: score=29/51, host=dommail.onthenet.com.au Cc: Jim Harris , src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , Bruce Evans , svn-src-head@freebsd.org, Jung-uk Kim Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 18:44:57 -0000 > Yes, CPUID or LFENCE is enough to fix the failure. CPUID causes an unconditional exit in VT-x/SVM so it would be best to avoid that if possible. later, Peter. From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 19:18:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B791C106564A; Thu, 26 Jul 2012 19:18:26 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FEF68FC08; Thu, 26 Jul 2012 19:18: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 q6QJIQct017224; Thu, 26 Jul 2012 19:18:26 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6QJIQSu017218; Thu, 26 Jul 2012 19:18:26 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201207261918.q6QJIQSu017218@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 26 Jul 2012 19:18:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238816 - in stable/9: contrib/groff/tmac gnu/usr.bin/groff/tmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 19:18:26 -0000 Author: ru Date: Thu Jul 26 19:18:26 2012 New Revision: 238816 URL: http://svn.freebsd.org/changeset/base/238816 Log: Synced mdoc(7) with head. Approved by: re (kib) Modified: stable/9/contrib/groff/tmac/doc-common stable/9/contrib/groff/tmac/doc-syms stable/9/contrib/groff/tmac/doc.tmac stable/9/contrib/groff/tmac/groff_mdoc.man stable/9/gnu/usr.bin/groff/tmac/mdoc.local Directory Properties: stable/9/contrib/groff/ (props changed) stable/9/gnu/usr.bin/groff/ (props changed) Modified: stable/9/contrib/groff/tmac/doc-common ============================================================================== --- stable/9/contrib/groff/tmac/doc-common Thu Jul 26 18:15:48 2012 (r238815) +++ stable/9/contrib/groff/tmac/doc-common Thu Jul 26 19:18:26 2012 (r238816) @@ -264,50 +264,72 @@ .ds doc-volume-as-algor algor .ds doc-volume-as-amd64 amd64 .ds doc-volume-as-amiga amiga +.ds doc-volume-as-amigappc amigappc .ds doc-volume-as-arc arc +.ds doc-volume-as-arm arm .ds doc-volume-as-arm26 arm26 .ds doc-volume-as-arm32 arm32 +.ds doc-volume-as-armish armish .ds doc-volume-as-atari atari +.ds doc-volume-as-aviion aviion +.ds doc-volume-as-beagle beagle .ds doc-volume-as-bebox bebox .ds doc-volume-as-cats cats .ds doc-volume-as-cesfic cesfic .ds doc-volume-as-cobalt cobalt .ds doc-volume-as-dreamcast dreamcast +.ds doc-volume-as-emips emips .ds doc-volume-as-evbarm evbarm .ds doc-volume-as-evbmips evbmips .ds doc-volume-as-evbppc evbppc .ds doc-volume-as-evbsh3 evbsh3 +.ds doc-volume-as-ews4800mips ews4800mips .ds doc-volume-as-hp300 hp300 .ds doc-volume-as-hp700 hp700 .ds doc-volume-as-hpcarm hpcarm .ds doc-volume-as-hpcmips hpcmips .ds doc-volume-as-hpcsh hpcsh +.ds doc-volume-as-hppa hppa +.ds doc-volume-as-hppa64 hppa64 .ds doc-volume-as-i386 i386 +.ds doc-volume-as-ia64 ia64 +.ds doc-volume-as-ibmnws ibmnws +.ds doc-volume-as-iyonix iyonix +.ds doc-volume-as-landisk landisk +.ds doc-volume-as-loongson loongson .ds doc-volume-as-luna68k luna68k +.ds doc-volume-as-luna88k luna88k .ds doc-volume-as-m68k m68k .ds doc-volume-as-mac68k mac68k .ds doc-volume-as-macppc macppc .ds doc-volume-as-mips mips +.ds doc-volume-as-mips64 mips64 .ds doc-volume-as-mipsco mipsco .ds doc-volume-as-mmeye mmeye .ds doc-volume-as-mvme68k mvme68k +.ds doc-volume-as-mvme88k mvme88k .ds doc-volume-as-mvmeppc mvmeppc .ds doc-volume-as-netwinder netwinder .ds doc-volume-as-news68k news68k .ds doc-volume-as-newsmips newsmips .ds doc-volume-as-next68k next68k .ds doc-volume-as-ofppc ofppc +.ds doc-volume-as-palm palm .ds doc-volume-as-pc532 pc532 .ds doc-volume-as-playstation2 playstation2 .ds doc-volume-as-pmax pmax .ds doc-volume-as-pmppc pmppc .ds doc-volume-as-powerpc powerpc .ds doc-volume-as-prep prep +.ds doc-volume-as-rs6000 rs6000 .ds doc-volume-as-sandpoint sandpoint .ds doc-volume-as-sbmips sbmips +.ds doc-volume-as-sgi sgi .ds doc-volume-as-sgimips sgimips .ds doc-volume-as-sh3 sh3 .ds doc-volume-as-shark shark +.ds doc-volume-as-socppc socppc +.ds doc-volume-as-solbourne solbourne .ds doc-volume-as-sparc sparc .ds doc-volume-as-sparc64 sparc64 .ds doc-volume-as-sun2 sun2 @@ -316,6 +338,8 @@ .ds doc-volume-as-vax vax .ds doc-volume-as-x68k x68k .ds doc-volume-as-x86_64 x86_64 +.ds doc-volume-as-xen xen +.ds doc-volume-as-zaurus zaurus . .de Dt . \" reset default arguments @@ -451,12 +475,16 @@ .ds doc-operating-system-NetBSD-3.0 3.0 .ds doc-operating-system-NetBSD-3.0.1 3.0.1 .ds doc-operating-system-NetBSD-3.0.2 3.0.2 +.ds doc-operating-system-NetBSD-3.0.3 3.0.3 .ds doc-operating-system-NetBSD-3.1 3.1 +.ds doc-operating-system-NetBSD-3.1.1 3.1.1 .ds doc-operating-system-NetBSD-4.0 4.0 .ds doc-operating-system-NetBSD-4.0.1 4.0.1 .ds doc-operating-system-NetBSD-5.0 5.0 .ds doc-operating-system-NetBSD-5.0.1 5.0.1 .ds doc-operating-system-NetBSD-5.0.2 5.0.2 +.ds doc-operating-system-NetBSD-5.1 5.1 +.ds doc-operating-system-NetBSD-6.0 6.0 . .ds doc-operating-system-OpenBSD-2.0 2.0 .ds doc-operating-system-OpenBSD-2.1 2.1 @@ -487,6 +515,8 @@ .ds doc-operating-system-OpenBSD-4.6 4.6 .ds doc-operating-system-OpenBSD-4.7 4.7 .ds doc-operating-system-OpenBSD-4.8 4.8 +.ds doc-operating-system-OpenBSD-4.9 4.9 +.ds doc-operating-system-OpenBSD-5.0 5.0 . .ds doc-operating-system-FreeBSD-1.0 1.0 .ds doc-operating-system-FreeBSD-1.1 1.1 @@ -544,6 +574,7 @@ .ds doc-operating-system-FreeBSD-8.0 8.0 .ds doc-operating-system-FreeBSD-8.1 8.1 .ds doc-operating-system-FreeBSD-8.2 8.2 +.ds doc-operating-system-FreeBSD-9.0 9.0 . .ds doc-operating-system-Darwin-8.0.0 8.0.0 .ds doc-operating-system-Darwin-8.1.0 8.1.0 @@ -566,7 +597,6 @@ .ds doc-operating-system-Darwin-9.6.0 9.6.0 .ds doc-operating-system-Darwin-9.7.0 9.7.0 .ds doc-operating-system-Darwin-9.8.0 9.8.0 -.ds doc-operating-system-Darwin-10.6.0 10.6.0 .ds doc-operating-system-Darwin-10.1.0 10.1.0 .ds doc-operating-system-Darwin-10.2.0 10.2.0 .ds doc-operating-system-Darwin-10.3.0 10.3.0 @@ -593,6 +623,11 @@ .ds doc-operating-system-DragonFly-2.4 2.4 .ds doc-operating-system-DragonFly-2.6 2.6 .ds doc-operating-system-DragonFly-2.8 2.8 +.ds doc-operating-system-DragonFly-2.9 2.9 +.ds doc-operating-system-DragonFly-2.9.1 2.9.1 +.ds doc-operating-system-DragonFly-2.10 2.10 +.ds doc-operating-system-DragonFly-2.10.1 2.10.1 +.ds doc-operating-system-DragonFly-2.11 2.11 . .de Os . ds doc-command-name Modified: stable/9/contrib/groff/tmac/doc-syms ============================================================================== --- stable/9/contrib/groff/tmac/doc-syms Thu Jul 26 18:15:48 2012 (r238815) +++ stable/9/contrib/groff/tmac/doc-syms Thu Jul 26 19:18:26 2012 (r238816) @@ -605,6 +605,8 @@ .ds doc-str-St--isoC \*[doc-Tn-font-size]ISO/IEC\*[doc-str-St] 9899:1990 .as doc-str-St--isoC " (\*[Lq]\*[doc-Tn-font-size]ISO\~C\^90\*[doc-str-St]\*[Rq]) .als doc-str-St--isoC-90 doc-str-St--isoC +.ds doc-str-St--isoC-2011 \*[doc-Tn-font-size]ISO/IEC\*[doc-str-St] 9899:2011 +.as doc-str-St--isoC-2011 " (\*[Lq]\*[doc-Tn-font-size]ISO\~C\^11\*[doc-str-St]\*[Rq]) .ds doc-str-St--isoC-99 \*[doc-Tn-font-size]ISO/IEC\*[doc-str-St] 9899:1999 .as doc-str-St--isoC-99 " (\*[Lq]\*[doc-Tn-font-size]ISO\~C\^99\*[doc-str-St]\*[Rq]) .ds doc-str-St--isoC-amd1 \*[doc-Tn-font-size]ISO/IEC\*[doc-str-St] 9899/AMD1:1995 @@ -659,7 +661,7 @@ .as doc-str-St--susv3 " (\*[Lq]\*[doc-Tn-font-size]SUSv3\*[doc-str-St]\*[Rq]) .ds doc-str-St--svid4 System\~V Interface Definition, Fourth Edition .as doc-str-St--svid4 " (\*[Lq]\*[doc-Tn-font-size]SVID\*[doc-str-St]\^4\*[Rq]) -.ds doc-str-St--xbd5 \*[doc-Tn-font-size]X/Open\*[doc-str-St] System Interface Definitions Issue\~5 +.ds doc-str-St--xbd5 \*[doc-Tn-font-size]X/Open\*[doc-str-St] Base Definitions Issue\~5 .as doc-str-St--xbd5 " (\*[Lq]\*[doc-Tn-font-size]XBD\*[doc-str-St]\^5\*[Rq]) .ds doc-str-St--xcu5 \*[doc-Tn-font-size]X/Open\*[doc-str-St] Commands and Utilities Issue\~5 .as doc-str-St--xcu5 " (\*[Lq]\*[doc-Tn-font-size]XCU\*[doc-str-St]\^5\*[Rq]) @@ -754,38 +756,74 @@ .\" NS .\" NS width register `Lb' defined in doc-common . +.ds doc-str-Lb-libarchive Reading and Writing Streaming Archives Library (libarchive, \-larchive) .ds doc-str-Lb-libarm ARM Architecture Library (libarm, \-larm) .ds doc-str-Lb-libarm32 ARM32 Architecture Library (libarm32, \-larm32) +.ds doc-str-Lb-libbluetooth Bluetooth Library (libbluetooth, \-lbluetooth) .ds doc-str-Lb-libbsm Basic Security Module Library (libbsm, \-lbsm) .ds doc-str-Lb-libc Standard C\~Library (libc, \-lc) +.ds doc-str-Lb-libc_r Reentrant C\~Library (libc_r, \-lc_r) +.ds doc-str-Lb-libcalendar Calendar Arithmetic Library (libcalendar, \-lcalendar) +.ds doc-str-Lb-libcam Common Access Method User Library (libcam, \-lcam) .ds doc-str-Lb-libcdk Curses Development Kit Library (libcdk, \-lcdk) +.ds doc-str-Lb-libcipher FreeSec Crypt Library (libcipher, \-lcipher) .ds doc-str-Lb-libcompat Compatibility Library (libcompat, \-lcompat) .ds doc-str-Lb-libcrypt Crypt Library (libcrypt, \-lcrypt) .ds doc-str-Lb-libcurses Curses Library (libcurses, \-lcurses) +.ds doc-str-Lb-libdevinfo Device and Resource Information Utility Library (libdevinfo, \-ldevinfo) +.ds doc-str-Lb-libdevstat Device Statistics Library (libdevstat, \-ldevstat) +.ds doc-str-Lb-libdisk Interface to Slice and Partition Labels Library (libdisk, \-ldisk) +.ds doc-str-Lb-libdwarf DWARF Access Library (libdwarf, \-ldwarf) .ds doc-str-Lb-libedit Command Line Editor Library (libedit, \-ledit) +.ds doc-str-Lb-libelf ELF Access Library (libelf, \-lelf) .ds doc-str-Lb-libevent Event Notification Library (libevent, \-levent) +.ds doc-str-Lb-libfetch File Transfer Library for URLs (libfetch, \-lfetch) .ds doc-str-Lb-libform Curses Form Library (libform, \-lform) +.ds doc-str-Lb-libgeom Userland API Library for kernel GEOM subsystem (libgeom, \-lgeom) +.ds doc-str-Lb-libgpib General-Purpose Instrument Bus (GPIB) library (libgpib, \-lgpib) .ds doc-str-Lb-libi386 i386 Architecture Library (libi386, \-li386) .ds doc-str-Lb-libintl Internationalized Message Handling Library (libintl, \-lintl) .ds doc-str-Lb-libipsec IPsec Policy Control Library (libipsec, \-lipsec) +.ds doc-str-Lb-libipx IPX Address Conversion Support Library (libipx, \-lipx) +.ds doc-str-Lb-libiscsi iSCSI protocol library (libiscsi, \-liscsi) +.ds doc-str-Lb-libjail Jail Library (libjail, \-ljail) +.ds doc-str-Lb-libkiconv Kernel side iconv library (libkiconv, \-lkiconv) +.ds doc-str-Lb-libkse N:M Threading Library (libkse, \-lkse) .ds doc-str-Lb-libkvm Kernel Data Access Library (libkvm, \-lkvm) .ds doc-str-Lb-libm Math Library (libm, \-lm) .ds doc-str-Lb-libm68k m68k Architecture Library (libm68k, \-lm68k) .ds doc-str-Lb-libmagic Magic Number Recognition Library (libmagic, \-lmagic) +.ds doc-str-Lb-libmd Message Digest (MD4, MD5, etc.) Support Library (libmd, \-lmd) +.ds doc-str-Lb-libmemstat Kernel Memory Allocator Statistics Library (libmemstat, \-lmemstat) .ds doc-str-Lb-libmenu Curses Menu Library (libmenu, \-lmenu) +.ds doc-str-Lb-libnetgraph Netgraph User Library (libnetgraph, \-lnetgraph) +.ds doc-str-Lb-libnetpgp Netpgp signing, verification, encryption and decryption (libnetpgp, \-lnetpgp) .ds doc-str-Lb-libossaudio OSS Audio Emulation Library (libossaudio, \-lossaudio) .ds doc-str-Lb-libpam Pluggable Authentication Module Library (libpam, \-lpam) .ds doc-str-Lb-libpcap Packet Capture Library (libpcap, \-lpcap) .ds doc-str-Lb-libpci PCI Bus Access Library (libpci, \-lpci) .ds doc-str-Lb-libpmc Performance Counters Library (libpmc, \-lpmc) .ds doc-str-Lb-libposix \*[Px] \*[doc-str-Lb]Compatibility Library (libposix, \-lposix) +.ds doc-str-Lb-libprop Property Container Object Library (libprop, \-lprop) .ds doc-str-Lb-libpthread \*[Px] \*[doc-str-Lb]Threads Library (libpthread, \-lpthread) +.ds doc-str-Lb-libpuffs puffs Convenience Library (libpuffs, \-lpuffs) +.ds doc-str-Lb-librefuse File System in Userspace Convenience Library (librefuse, \-lrefuse) .ds doc-str-Lb-libresolv DNS Resolver Library (libresolv, \-lresolv) +.ds doc-str-Lb-librpcsec_gss RPC GSS-API Authentication Library (librpcsec_gss, \-lrpcsec_gss) +.ds doc-str-Lb-librpcsvc RPC Service Library (librpcsvc, \-lrpcsvc) .ds doc-str-Lb-librt \*[Px] \*[doc-str-Lb]Real-time Library (librt, \-lrt) +.ds doc-str-Lb-libsdp Bluetooth Service Discovery Protocol User Library (libsdp, \-lsdp) +.ds doc-str-Lb-libssp Buffer Overflow Protection Library (libssp, \-lssp) .ds doc-str-Lb-libSystem System Library (libSystem, \-lSystem) .ds doc-str-Lb-libtermcap Termcap Access Library (libtermcap, \-ltermcap) +.ds doc-str-Lb-libterminfo Terminal Information Library (libterminfo, \-lterminfo) +.ds doc-str-Lb-libthr 1:1 Threading Library (libthr, \-lthr) +.ds doc-str-Lb-libufs UFS File System Access Library (libufs, \-lufs) +.ds doc-str-Lb-libugidfw File System Firewall Interface Library (libugidfw, \-lugidfw) +.ds doc-str-Lb-libulog User Login Record Library (libulog, \-lulog) .ds doc-str-Lb-libusbhid USB Human Interface Devices Library (libusbhid, \-lusbhid) .ds doc-str-Lb-libutil System Utilities Library (libutil, \-lutil) +.ds doc-str-Lb-libvgl Video Graphics Library (libvgl, \-lvgl) .ds doc-str-Lb-libx86_64 x86_64 Architecture Library (libx86_64, \-lx86_64) .ds doc-str-Lb-libz Compression Library (libz, \-lz) . Modified: stable/9/contrib/groff/tmac/doc.tmac ============================================================================== --- stable/9/contrib/groff/tmac/doc.tmac Thu Jul 26 18:15:48 2012 (r238815) +++ stable/9/contrib/groff/tmac/doc.tmac Thu Jul 26 19:18:26 2012 (r238816) @@ -438,7 +438,7 @@ . \" last argument . if (\n[doc-reg-dfr1] == 4) \ . nop \|\-\c -. nop \f[]\s[0]\c +. nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c . doc-print-and-reset . \} . el \{\ @@ -4268,7 +4268,7 @@ . if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\ . nr doc-reg-Xr (\n[doc-arg-ptr] + 1) . \" modify second argument if it is a string and -. \" remove space inbetween +. \" remove space in between . if (\n[doc-type\n[doc-reg-Xr]] == 2) \{\ . ds doc-arg\n[doc-reg-Xr] \*[lp]\*[doc-arg\n[doc-reg-Xr]]\*[rp] . ds doc-space\n[doc-arg-ptr] @@ -5091,7 +5091,7 @@ . . .\" NS doc-build-func-string macro -.\" NS collect function arguments and set hard spaces inbetween +.\" NS collect function arguments and set hard spaces in between .\" NS .\" NS modifies: .\" NS doc-func-arg Modified: stable/9/contrib/groff/tmac/groff_mdoc.man ============================================================================== --- stable/9/contrib/groff/tmac/groff_mdoc.man Thu Jul 26 18:15:48 2012 (r238815) +++ stable/9/contrib/groff/tmac/groff_mdoc.man Thu Jul 26 19:18:26 2012 (r238816) @@ -769,13 +769,18 @@ By default, the following architecture k . \# we use `No' to avoid hyphenation .Bd -ragged -offset indent -.No alpha , acorn26 , acorn32 , algor , amd64 , amiga , arc , arm26 , -.No arm32 , atari , bebox , cats , cesfic , cobalt , dreamcast , evbarm , -.No evbmips , evbppc , evbsh3 , hp300 , hp700 , hpcmips , i386 , luna68k , -.No m68k , mac68k , macppc , mips , mmeye , mvme68k , mvmeppc , netwinder , -.No news68k , newsmips , next68k , ofppc , pc532 , pmax , pmppc , powerpc , -.No prep , sandpoint , sgimips , sh3 , shark , sparc , sparc64 , sun3 , -.No tahoe , vax , x68k , x86_64 +.No acorn26 , acorn32 , algor , alpha , amd64 , amiga , amigappc , +.No arc , arm , arm26 , arm32 , armish , atari , aviion , +.No beagle , bebox , cats , cesfic , cobalt , dreamcast , +.No emips , evbarm , evbmips , evbppc , evbsh3 , ews4800mips , +.No hp300 , hp700 , hpcarm , hpcmips , hpcsh , hppa , hppa64 , +.No i386 , ia64 , ibmnws , iyonix , landisk , loongson , luna68k , luna88k , +.No m68k , mac68k , macppc , mips , mips64 , mipsco , mmeye , +.No mvme68k , mvme88k , mvmeppc , netwinder , news68k , newsmips , next68k , +.No ofppc , palm , pc532 , playstation2 , pmax , pmppc , powerpc , prep , +.No rs6000 , sandpoint , sbmips , sgi , sgimips , sh3 , shark , +.No socppc , solbourne , sparc , sparc64 , sun2 , sun3 , +.No tahoe , vax , x68k , x86_64 , xen , zaurus .Ed .Pp . @@ -864,23 +869,25 @@ the release ID. .It NetBSD 0.8, 0.8a, 0.9, 0.9a, 1.0, 1.0a, 1.1, 1.2, 1.2a, 1.2b, 1.2c, 1.2d, 1.2e, 1.3, 1.3a, 1.4, 1.4.1, 1.4.2, 1.4.3, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.6, 1.6.1, -1.6.2, 1.6.3, 2.0, 2.0.1, 2.0.2, 2.0.3, 2.1, 3.0, 3.0.1, 3.0.2, 3.1, 4.0, -4.0.1, 5.0, 5.0.1, 5.0.2 +1.6.2, 1.6.3, 2.0, 2.0.1, 2.0.2, 2.0.3, 2.1, 3.0, 3.0.1, 3.0.2, 3.0.3, +3.1, 3.1.1, 4.0, 4.0.1, 5.0, 5.0.1, 5.0.2, 5.1, 6.0 .It FreeBSD 1.0, 1.1, 1.1.5, 1.1.5.1, 2.0, 2.0.5, 2.1, 2.1.5, 2.1.6, 2.1.7, 2.2, 2.2.1, 2.2.2, 2.2.5, 2.2.6, 2.2.7, 2.2.8, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 4.0, 4.1, 4.1.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.6.2, 4.7, 4.8, 4.9, 4.10, 4.11, 5.0, 5.1, 5.2, 5.2.1, 5.3, 5.4, 5.5, 6.0, 6.1, 6.2, 6.3, 6.4, 7.0, 7.1, 7.2, 7.3, 8.0, -8.1 +8.1, 8.2, 9.0 .It OpenBSD 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, -3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8 +3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9, +5.0 .It DragonFly 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.8, 1.8.1, 1.10, 1.12, 1.12.2, 2.0, 2.2, -2.4, 2.6, 2.8 +2.4, 2.6, 2.8, 2.9, 2.9.1, 2.10, 2.10.1, 2.11 .It Darwin 8.0.0, 8.1.0, 8.2.0, 8.3.0, 8.4.0, 8.5.0, 8.6.0, 8.7.0, 8.8.0, 8.9.0, -8.10.0, 8.11.0, 9.0.0, 9.1.0, 9.2.0, 9.3.0, 9.4.0, 9.5.0, 9.6.0 +8.10.0, 8.11.0, 9.0.0, 9.1.0, 9.2.0, 9.3.0, 9.4.0, 9.5.0, 9.6.0, 9.7.0, +9.8.0, 10.1.0, 10.2.0, 10.3.0, 10.4.0, 10.5.0, 10.6.0, 10.7.0, 11.0.0 .El .Ed .Pp @@ -1673,33 +1680,73 @@ Available arguments to and their results are: . .Pp -.Bl -tag -width ".Li libossaudio" -compact -offset indent +.Bl -tag -width ".Li librpcsec_gss" -compact -offset indent +.It Li libarchive +.Lb libarchive .It Li libarm .Lb libarm .It Li libarm32 .Lb libarm32 +.It Li libbluetooth +.Lb libbluetooth +.It Li libbsm +.Lb libbsm .It Li libc .Lb libc +.It Li libc_r +.Lb libc_r +.It Li libcalendar +.Lb libcalendar +.It Li libcam +.Lb libcam .It Li libcdk .Lb libcdk +.It Li libcipher +.Lb libcipher .It Li libcompat .Lb libcompat .It Li libcrypt .Lb libcrypt .It Li libcurses .Lb libcurses +.It Li libdevinfo +.Lb libdevinfo +.It Li libdevstat +.Lb libdevstat +.It Li libdisk +.Lb libdisk +.It Li libdwarf +.Lb libdwarf .It Li libedit .Lb libedit +.It Li libelf +.Lb libelf .It Li libevent .Lb libevent +.It Li libfetch +.Lb libfetch .It Li libform .Lb libform +.It Li libgeom +.Lb libgeom +.It Li libgpib +.Lb libgpib .It Li libi386 .Lb libi386 .It Li libintl .Lb libintl .It Li libipsec .Lb libipsec +.It Li libipx +.Lb libipx +.It Li libiscsi +.Lb libiscsi +.It Li libjail +.Lb libjail +.It Li libkiconv +.Lb libkiconv +.It Li libkse +.Lb libkse .It Li libkvm .Lb libkvm .It Li libm @@ -1708,8 +1755,16 @@ and their results are: .Lb libm68k .It Li libmagic .Lb libmagic +.It Li libmd +.Lb libmd +.It Li libmemstat +.Lb libmemstat .It Li libmenu .Lb libmenu +.It Li libnetgraph +.Lb libnetgraph +.It Li libnetpgp +.Lb libnetpgp .It Li libossaudio .Lb libossaudio .It Li libpam @@ -1722,18 +1777,46 @@ and their results are: .Lb libpmc .It Li libposix .Lb libposix +.It Li libprop +.Lb libprop .It Li libpthread .Lb libpthread +.It Li libpuffs +.Lb libpuffs +.It Li librefuse +.Lb librefuse .It Li libresolv .Lb libresolv +.It Li librpcsec_gss +.Lb librpcsec_gss +.It Li librpcsvc +.Lb librpcsvc .It Li librt .Lb librt +.It Li libsdp +.Lb libsdp +.It Li libssp +.Lb libssp +.It Li libSystem +.Lb libSystem .It Li libtermcap .Lb libtermcap +.It Li libterminfo +.Lb libterminfo +.It Li libthr +.Lb libthr +.It Li libufs +.Lb libufs +.It Li libugidfw +.Lb libugidfw +.It Li libulog +.Lb libulog .It Li libusbhid .Lb libusbhid .It Li libutil .Lb libutil +.It Li libvgl +.Lb libvgl .It Li libx86_64 .Lb libx86_64 .It Li libz @@ -1953,6 +2036,8 @@ are: .St -isoC-90 .It Li \-isoC\-99 .St -isoC-99 +.It Li \-isoC\-2011 +.St -isoC-2011 .El .Pp . Modified: stable/9/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- stable/9/gnu/usr.bin/groff/tmac/mdoc.local Thu Jul 26 18:15:48 2012 (r238815) +++ stable/9/gnu/usr.bin/groff/tmac/mdoc.local Thu Jul 26 19:18:26 2012 (r238816) @@ -34,41 +34,14 @@ .\" FreeBSD .Lb values .ds doc-str-Lb-libarchive Streaming Archive Library (libarchive, \-larchive) .ds doc-str-Lb-libbluetooth Bluetooth User Library (libbluetooth, \-lbluetooth) -.ds doc-str-Lb-libc_r Reentrant C\~Library (libc_r, \-lc_r) -.ds doc-str-Lb-libcalendar Calendar Arithmetic Library (libcalendar, \-lcalendar) -.ds doc-str-Lb-libcam Common Access Method User Library (libcam, \-lcam) -.ds doc-str-Lb-libcipher FreeSec Crypt Library (libcipher, \-lcipher) -.ds doc-str-Lb-libdevinfo Device and Resource Information Utility Library (libdevinfo, \-ldevinfo) -.ds doc-str-Lb-libdevstat Device Statistics Library (libdevstat, \-ldevstat) -.ds doc-str-Lb-libdisk Interface to Slice and Partition Labels Library (libdisk, \-ldisk) .ds doc-str-Lb-libedit Line Editor and History Library (libedit, \-ledit) .ds doc-str-Lb-libefi EFI Runtime Services Library (libefi, \-lefi) .ds doc-str-Lb-libelf ELF Parsing Library (libelf, \-lelf) .ds doc-str-Lb-libfetch File Transfer Library (libfetch, \-lfetch) -.ds doc-str-Lb-libgeom Userland API Library for kernel GEOM subsystem (libgeom, \-lgeom) -.ds doc-str-Lb-libgpib General-Purpose Instrument Bus (GPIB) library (libgpib, \-lgpib) -.ds doc-str-Lb-libipx IPX Address Conversion Support Library (libipx, \-lipx) -.ds doc-str-Lb-libjail Jail Library (libjail, \-ljail) -.ds doc-str-Lb-libkiconv Kernel side iconv library (libkiconv, \-lkiconv) -.ds doc-str-Lb-libkse N:M Threading Library (libkse, \-lkse) -.ds doc-str-Lb-libmd Message Digest (MD4, MD5, etc.) Support Library (libmd, \-lmd) -.ds doc-str-Lb-libmemstat Kernel Memory Allocator Statistics Library (libmemstat, \-lmemstat) -.ds doc-str-Lb-libnetgraph Netgraph User Library (libnetgraph, \-lnetgraph) .ds doc-str-Lb-libpmc Performance Monitoring Counters Interface Library (libpmc, \-lpmc) .ds doc-str-Lb-libproc Processor Monitoring and Analysis Library (libproc, \-lproc) .ds doc-str-Lb-libprocstat Process and Files Information Retrieval (libprocstat, \-lprocstat) -.ds doc-str-Lb-librpcsec_gss RPC GSS-API Authentication Library (librpcsec_gss, \-lrpcsec_gss) -.ds doc-str-Lb-librpcsvc RPC Service Library (librpcsvc, \-lrpcsvc) .ds doc-str-Lb-librtld_db Run-time Linker Debugging Library (librtld_db, \-lrtld_db) -.ds doc-str-Lb-libsdp Bluetooth Service Discovery Protocol User Library (libsdp, \-lsdp) -.ds doc-str-Lb-libthr 1:1 Threading Library (libthr, \-lthr) -.ds doc-str-Lb-libufs UFS File System Access Library (libufs, \-lufs) -.ds doc-str-Lb-libugidfw File System Firewall Interface Library (libugidfw, \-lugidfw) -.ds doc-str-Lb-libulog User Login Record Library (libulog, \-lulog) -.ds doc-str-Lb-libvgl Video Graphics Library (libvgl, \-lvgl) -. -.\" FreeBSD architectures not found in doc-common -.ds doc-volume-as-arm arm . .\" Default .Os value .ds doc-default-operating-system FreeBSD\~9.1 @@ -76,8 +49,8 @@ .\" FreeBSD releases not found in doc-common .ds doc-operating-system-FreeBSD-7.4 7.4 .ds doc-operating-system-FreeBSD-8.3 8.3 -.ds doc-operating-system-FreeBSD-9.0 9.0 .ds doc-operating-system-FreeBSD-9.1 9.1 +.ds doc-operating-system-FreeBSD-10.0 10.0 . .\" Definitions not (yet) in doc-syms . From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 20:41:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 78B501065674; Thu, 26 Jul 2012 20:41:37 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 636C08FC12; Thu, 26 Jul 2012 20:41: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 q6QKfbD7023835; Thu, 26 Jul 2012 20:41:37 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6QKfbFu023832; Thu, 26 Jul 2012 20:41:37 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201207262041.q6QKfbFu023832@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 26 Jul 2012 20:41:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238817 - head/usr.bin/du X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 20:41:37 -0000 Author: pluknet Date: Thu Jul 26 20:41:36 2012 New Revision: 238817 URL: http://svn.freebsd.org/changeset/base/238817 Log: Document -g option in the usage string. Modified: head/usr.bin/du/du.c Modified: head/usr.bin/du/du.c ============================================================================== --- head/usr.bin/du/du.c Thu Jul 26 19:18:26 2012 (r238816) +++ head/usr.bin/du/du.c Thu Jul 26 20:41:36 2012 (r238817) @@ -493,7 +493,7 @@ static void usage(void) { (void)fprintf(stderr, - "usage: du [-Aclnx] [-H | -L | -P] [-h | -k | -m ] " + "usage: du [-Aclnx] [-H | -L | -P] [-g | -h | -k | -m] " "[-a | -s | -d depth] [-B blocksize] [-I mask] " "[-t threshold] [file ...]\n"); exit(EX_USAGE); From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 21:37:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BED01065675; Thu, 26 Jul 2012 21:37:59 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 279D98FC0C; Thu, 26 Jul 2012 21:37: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 q6QLbxmP028135; Thu, 26 Jul 2012 21:37:59 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6QLbwGi028133; Thu, 26 Jul 2012 21:37:58 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201207262137.q6QLbwGi028133@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 26 Jul 2012 21:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238818 - head/sys/dev/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 21:37:59 -0000 Author: luigi Date: Thu Jul 26 21:37:58 2012 New Revision: 238818 URL: http://svn.freebsd.org/changeset/base/238818 Log: define prefetch as a noop on !x86 Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Thu Jul 26 20:41:36 2012 (r238817) +++ head/sys/dev/netmap/netmap.c Thu Jul 26 21:37:58 2012 (r238818) @@ -220,7 +220,11 @@ struct nm_bridge nm_bridges[NM_BRIDGES]; #ifndef linux static inline void prefetch (const void *x) { +#if defined(__i386__) || defined(__amd64__) __asm volatile("prefetcht0 %0" :: "m" (*(const unsigned long *)x)); +#else + (void)x; +#endif } #endif /* !linux */ From owner-svn-src-all@FreeBSD.ORG Thu Jul 26 21:49:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B7AA1065670; Thu, 26 Jul 2012 21:49:28 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: from vlakno.cz (vlakno.cz [46.28.110.116]) by mx1.freebsd.org (Postfix) with ESMTP id ECF0F8FC12; Thu, 26 Jul 2012 21:49:27 +0000 (UTC) Received: by vlakno.cz (Postfix, from userid 1002) id 5FBE07F3D67; Thu, 26 Jul 2012 23:39:59 +0200 (CEST) Date: Thu, 26 Jul 2012 23:39:59 +0200 From: Roman Divacky To: Luigi Rizzo Message-ID: <20120726213959.GA12908@freebsd.org> References: <201207262137.q6QLbwGi028133@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201207262137.q6QLbwGi028133@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238818 - head/sys/dev/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 21:49:28 -0000 Why dont you use __builtin_prefetch() ? On Thu, Jul 26, 2012 at 09:37:58PM +0000, Luigi Rizzo wrote: > Author: luigi > Date: Thu Jul 26 21:37:58 2012 > New Revision: 238818 > URL: http://svn.freebsd.org/changeset/base/238818 > > Log: > define prefetch as a noop on !x86 > > Modified: > head/sys/dev/netmap/netmap.c > > Modified: head/sys/dev/netmap/netmap.c > ============================================================================== > --- head/sys/dev/netmap/netmap.c Thu Jul 26 20:41:36 2012 (r238817) > +++ head/sys/dev/netmap/netmap.c Thu Jul 26 21:37:58 2012 (r238818) > @@ -220,7 +220,11 @@ struct nm_bridge nm_bridges[NM_BRIDGES]; > #ifndef linux > static inline void prefetch (const void *x) > { > +#if defined(__i386__) || defined(__amd64__) > __asm volatile("prefetcht0 %0" :: "m" (*(const unsigned long *)x)); > +#else > + (void)x; > +#endif > } > #endif /* !linux */ > From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 05:24:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74094106564A; Fri, 27 Jul 2012 05:24:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 601C28FC0C; Fri, 27 Jul 2012 05:24:10 +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 q6R5OAYI068089; Fri, 27 Jul 2012 05:24:10 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6R5OAGv068087; Fri, 27 Jul 2012 05:24:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207270524.q6R5OAGv068087@svn.freebsd.org> From: Warner Losh Date: Fri, 27 Jul 2012 05:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238819 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 05:24:10 -0000 Author: imp Date: Fri Jul 27 05:24:09 2012 New Revision: 238819 URL: http://svn.freebsd.org/changeset/base/238819 Log: Minor style(9) nit. Modified: head/sys/dev/usb/controller/ohci_atmelarm.c Modified: head/sys/dev/usb/controller/ohci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/ohci_atmelarm.c Thu Jul 26 21:37:58 2012 (r238818) +++ head/sys/dev/usb/controller/ohci_atmelarm.c Fri Jul 27 05:24:09 2012 (r238819) @@ -76,6 +76,7 @@ struct at91_ohci_softc { static int ohci_atmelarm_probe(device_t dev) { + device_set_desc(dev, "AT91 integrated OHCI controller"); return (BUS_PROBE_DEFAULT); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 05:28:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 07149106564A; Fri, 27 Jul 2012 05:28:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E64BB8FC0C; Fri, 27 Jul 2012 05:28:02 +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 q6R5S2xN068432; Fri, 27 Jul 2012 05:28:02 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6R5S2Te068430; Fri, 27 Jul 2012 05:28:02 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207270528.q6R5S2Te068430@svn.freebsd.org> From: Warner Losh Date: Fri, 27 Jul 2012 05:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238820 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 05:28:03 -0000 Author: imp Date: Fri Jul 27 05:28:02 2012 New Revision: 238820 URL: http://svn.freebsd.org/changeset/base/238820 Log: Add (back?) ohci atmel attachment. Modified: head/sys/arm/at91/files.at91 Modified: head/sys/arm/at91/files.at91 ============================================================================== --- head/sys/arm/at91/files.at91 Fri Jul 27 05:24:09 2012 (r238819) +++ head/sys/arm/at91/files.at91 Fri Jul 27 05:28:02 2012 (r238820) @@ -48,3 +48,7 @@ arm/at91/board_sam9g20ek.c optional at91 arm/at91/board_sam9x25ek.c optional at91_board_sam9x25ek arm/at91/board_sn9g45.c optional at91_board_sn9g45 arm/at91/board_tsc4370.c optional at91_board_tsc4370 +# +# usb +# +dev/usb/controller/ohci_atmelarm.c optional ohci From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 05:33:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC2C8106566B; Fri, 27 Jul 2012 05:33:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C70518FC15; Fri, 27 Jul 2012 05:33: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 q6R5XtlU068915; Fri, 27 Jul 2012 05:33:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6R5Xtbn068913; Fri, 27 Jul 2012 05:33:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207270533.q6R5Xtbn068913@svn.freebsd.org> From: Warner Losh Date: Fri, 27 Jul 2012 05:33:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238821 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 05:33:56 -0000 Author: imp Date: Fri Jul 27 05:33:55 2012 New Revision: 238821 URL: http://svn.freebsd.org/changeset/base/238821 Log: Turns out the ETHERNUT5 isn't anything like the SAM9260-EK. Make this board init match better: UART1 instead of UART2, No RMMI, no SPI0, SPI1 comments. Modified: head/sys/arm/at91/board_sam9260ek.c Modified: head/sys/arm/at91/board_sam9260ek.c ============================================================================== --- head/sys/arm/at91/board_sam9260ek.c Fri Jul 27 05:28:02 2012 (r238820) +++ head/sys/arm/at91/board_sam9260ek.c Fri Jul 27 05:33:55 2012 (r238821) @@ -74,37 +74,55 @@ board_init(void) at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA20, 0); /* EMDIO */ at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA21, 0); + /* Not RMII */ + /* ETX2 */ + at91_pio_use_periph_b(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA10, 0); + /* ETX3 */ + at91_pio_use_periph_b(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA11, 0); + /* ETXER */ + at91_pio_use_periph_b(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA22, 0); + /* ERX2 */ + at91_pio_use_periph_b(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA25, 0); + /* ERX3 */ + at91_pio_use_periph_b(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA26, 0); + /* ERXCK */ + at91_pio_use_periph_b(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA27, 0); + /* ECRS */ + at91_pio_use_periph_b(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA28, 0); + /* ECOL */ + at91_pio_use_periph_b(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA29, 0); + /* - * MMC + * MMC, wired to socket B. */ - /* MCDA0 */ - at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA6, 1); - /* MCCDA */ - at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA7, 1); + /* MCDB0 */ + at91_pio_use_periph_b(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA0, 1); + /* MCCDB */ + at91_pio_use_periph_b(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA1, 1); + /* MCDB3 */ + at91_pio_use_periph_b(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA3, 1); + /* MCDB2 */ + at91_pio_use_periph_b(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA4, 1); + /* MCDB1 */ + at91_pio_use_periph_b(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA5, 1); /* MCCK */ at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA8, 1); - /* MCDA1 */ - at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA9, 1); - /* MCDA2 */ - at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA10, 1); - /* MCDA3 */ - at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA11, 1); - - /* - * SPI0 - */ - /* MISO */ - at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA0, 0); - /* MOSI */ - at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA1, 0); - /* SPCK */ - at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA2, 0); - /* NPCS0 */ - at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA3, 0); /* - * TWI + * SPI0 and MMC are wired together, since we don't support sharing + * don't support the dataflash. But if you did, you'd have to + * use CS0 and CS1. + */ + + /* + * SPI1 is wired to a audio CODEC that we don't support, so + * give it a pass. + */ + + /* + * TWI. Only one child on the iic bus, which we take care of + * via hints. */ /* TWD */ at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA23, 1); @@ -132,16 +150,18 @@ board_init(void) at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB27, 0); /* - * USART2 + * USART1 */ - /* RTS2 */ - at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA4, 1); - /* CTS2 */ - at91_pio_use_periph_a(AT91SAM9260_PIOA_BASE, AT91C_PIO_PA5, 0); - /* TXD2 */ - at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB8, 1); - /* RXD2 */ - at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB9, 0); + /* RTS1 */ + at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB28, 1); + /* CTS1 */ + at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB29, 0); + /* TXD1 */ + at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB6, 1); + /* RXD1 */ + at91_pio_use_periph_a(AT91SAM9260_PIOB_BASE, AT91C_PIO_PB7, 0); + + /* USART2 - USART5 aren't wired up, except via PIO pins, ignore them. */ return (at91_ramsize()); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 05:34:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63FB61065740; Fri, 27 Jul 2012 05:34:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 045B68FC15; Fri, 27 Jul 2012 05:34: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 q6R5Yj3v069020; Fri, 27 Jul 2012 05:34:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6R5Yj7J069017; Fri, 27 Jul 2012 05:34:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207270534.q6R5Yj7J069017@svn.freebsd.org> From: Adrian Chadd Date: Fri, 27 Jul 2012 05:34:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238822 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 05:34:46 -0000 Author: adrian Date: Fri Jul 27 05:34:45 2012 New Revision: 238822 URL: http://svn.freebsd.org/changeset/base/238822 Log: Refactor out the descriptor allocation code from the buffer allocation code. The TX EDMA completion path is going to need descriptors allocated but not any buffers. This code will form the basis for that. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Jul 27 05:33:55 2012 (r238821) +++ head/sys/dev/ath/if_ath.c Fri Jul 27 05:34:45 2012 (r238822) @@ -2764,8 +2764,14 @@ ath_load_cb(void *arg, bus_dma_segment_t *paddr = segs->ds_addr; } +/* + * Allocate the descriptors and appropriate DMA tag/setup. + * + * For some situations (eg EDMA TX completion), there isn't a requirement + * for the ath_buf entries to be allocated. + */ int -ath_descdma_setup(struct ath_softc *sc, +ath_descdma_alloc_desc(struct ath_softc *sc, struct ath_descdma *dd, ath_bufhead *head, const char *name, int ds_size, int nbuf, int ndesc) { @@ -2774,9 +2780,7 @@ ath_descdma_setup(struct ath_softc *sc, #define ATH_DESC_4KB_BOUND_CHECK(_daddr, _len) \ ((((u_int32_t)(_daddr) & 0xFFF) > (0x1000 - (_len))) ? 1 : 0) struct ifnet *ifp = sc->sc_ifp; - uint8_t *ds; - struct ath_buf *bf; - int i, bsize, error; + int error; dd->dd_descsize = ds_size; @@ -2844,10 +2848,49 @@ ath_descdma_setup(struct ath_softc *sc, goto fail2; } - ds = (uint8_t *) dd->dd_desc; DPRINTF(sc, ATH_DEBUG_RESET, "%s: %s DMA map: %p (%lu) -> %p (%lu)\n", - __func__, dd->dd_name, ds, (u_long) dd->dd_desc_len, - (caddr_t) dd->dd_desc_paddr, /*XXX*/ (u_long) dd->dd_desc_len); + __func__, dd->dd_name, (uint8_t *) dd->dd_desc, + (u_long) dd->dd_desc_len, (caddr_t) dd->dd_desc_paddr, + /*XXX*/ (u_long) dd->dd_desc_len); + + return (0); + +fail2: + bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); +fail1: + bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); +fail0: + bus_dma_tag_destroy(dd->dd_dmat); + memset(dd, 0, sizeof(*dd)); + return error; +#undef DS2PHYS +#undef ATH_DESC_4KB_BOUND_CHECK +} + +int +ath_descdma_setup(struct ath_softc *sc, + struct ath_descdma *dd, ath_bufhead *head, + const char *name, int ds_size, int nbuf, int ndesc) +{ +#define DS2PHYS(_dd, _ds) \ + ((_dd)->dd_desc_paddr + ((caddr_t)(_ds) - (caddr_t)(_dd)->dd_desc)) +#define ATH_DESC_4KB_BOUND_CHECK(_daddr, _len) \ + ((((u_int32_t)(_daddr) & 0xFFF) > (0x1000 - (_len))) ? 1 : 0) + struct ifnet *ifp = sc->sc_ifp; + uint8_t *ds; + struct ath_buf *bf; + int i, bsize, error; + + /* Allocate descriptors */ + error = ath_descdma_alloc_desc(sc, dd, head, name, ds_size, + nbuf, ndesc); + + /* Assume any errors during allocation were dealt with */ + if (error != 0) { + return (error); + } + + ds = (uint8_t *) dd->dd_desc; /* allocate rx buffers */ bsize = sizeof(struct ath_buf) * nbuf; @@ -2889,13 +2932,11 @@ ath_descdma_setup(struct ath_softc *sc, TAILQ_INSERT_TAIL(head, bf, bf_list); } return 0; + /* XXX this should likely just call ath_descdma_cleanup() */ fail3: bus_dmamap_unload(dd->dd_dmat, dd->dd_dmamap); -fail2: bus_dmamem_free(dd->dd_dmat, dd->dd_desc, dd->dd_dmamap); -fail1: bus_dmamap_destroy(dd->dd_dmat, dd->dd_dmamap); -fail0: bus_dma_tag_destroy(dd->dd_dmat); memset(dd, 0, sizeof(*dd)); return error; Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Fri Jul 27 05:33:55 2012 (r238821) +++ head/sys/dev/ath/if_ath_misc.h Fri Jul 27 05:34:45 2012 (r238822) @@ -84,6 +84,9 @@ extern void ath_setdefantenna(struct ath extern void ath_setslottime(struct ath_softc *sc); +extern int ath_descdma_alloc_desc(struct ath_softc *sc, + struct ath_descdma *dd, ath_bufhead *head, const char *name, + int ds_size, int nbuf, int ndesc); extern int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd, ath_bufhead *head, const char *name, int ds_size, int nbuf, int ndesc); From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 05:37:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D8231065688; Fri, 27 Jul 2012 05:37:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0900C8FC0A; Fri, 27 Jul 2012 05:37:02 +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 q6R5b1bx069245; Fri, 27 Jul 2012 05:37:01 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6R5b1CB069243; Fri, 27 Jul 2012 05:37:01 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207270537.q6R5b1CB069243@svn.freebsd.org> From: Warner Losh Date: Fri, 27 Jul 2012 05:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238823 - head/sys/arm/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 05:37:02 -0000 Author: imp Date: Fri Jul 27 05:37:01 2012 New Revision: 238823 URL: http://svn.freebsd.org/changeset/base/238823 Log: Document the dataflash/mmc-sd issue. Add umass driver and usb. Boot off da0s1a instead of ate0. Note that MMC/SD is slot B. Until I switch over to NAND boot, dataflash booting will preclude having SD cards inserted at boot, so this last bit is untested. My SAM9260-EK not boots to multi-user prompt. Modified: head/sys/arm/conf/SAM9260EK Modified: head/sys/arm/conf/SAM9260EK ============================================================================== --- head/sys/arm/conf/SAM9260EK Fri Jul 27 05:34:45 2012 (r238822) +++ head/sys/arm/conf/SAM9260EK Fri Jul 27 05:37:01 2012 (r238823) @@ -66,14 +66,17 @@ options PRINTF_BUFR_SIZE=128 # Prevent #options INCLUDE_CONFIG_FILE # Include this file in kernel # required for netbooting -options BOOTP -options BOOTP_COMPAT -options BOOTP_NFSROOT -options BOOTP_NFSV3 -options BOOTP_WIRED_TO=ate0 +#options BOOTP +#options BOOTP_COMPAT +#options BOOTP_NFSROOT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ate0 # alternatively, boot from a MMC/SD memory card -#options ROOTDEVNAME=\"ufs:/dev/mmcsd0a\" +#options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" + +# Alternatively, boot from a USB card. +options ROOTDEVNAME=\"ufs:/dev/da0s1a\" # kernel/memory size reduction options MUTEX_NOINLINE @@ -112,16 +115,21 @@ device iicbus # I2C bus system device icee # I2C eeprom # MMC/SD +# See comment for DataFlash below device at91_mci # Atmel AT91 Multimedia Card Interface -options AT91_MCI_HAS_4WIRE +options AT91_MCI_HAS_4WIRE # 4 wires +options AT91_MCI_SLOT_B # Wired to slot B device mmc # MMC/SD bus device mmcsd # MMC/SD memory card # DataFlash -device at91_spi # Atmel AT91 Serial Peripheral Interface -device spibus # SPI bus -device at45d # Atmel AT45D -device geom_map # GEOM partition mapping +# The DataFlash and MMC card are wired together, so we must pick one or the +# other. This is due to pin mux, and also due to the design of the +# SAM9260EK board. SLOT A wouldn't have this issue. +#device at91_spi # Atmel AT91 Serial Peripheral Interface +#device spibus # SPI bus +#device at45d # Atmel AT45D +#device geom_map # GEOM partition mapping # Pseudo devices. device loop # Network loopback @@ -135,13 +143,13 @@ device ether # Ethernet support #device firmware # firmware assist module # SCSI peripherals -#device scbus # SCSI bus (required for ATA/SCSI) +device scbus # SCSI bus (required for ATA/SCSI) #device ch # SCSI media changers -#device da # Direct Access (disks) +device da # Direct Access (disks) #device sa # Sequential Access (tape etc) -#device cd # CD -#device pass # Passthrough device (direct ATA/SCSI access) -#device ses # Enclosure Services (SES and SAF-TE) +device cd # CD/DVD +device pass # Passthrough device (direct ATA/SCSI access) +device ses # Enclosure Services (SES and SAF-TE) #device ctl # CAM Target Layer # Serial (COM) ports @@ -150,9 +158,9 @@ options ALT_BREAK_TO_DEBUGGER # USB support #options USB_DEBUG # enable debug msgs -device ohci # OHCI PCI->USB interface +device ohci # OHCI USB interface device usb # USB Bus (required) -#device umass # Disks/Mass storage - Requires scbus and da +device umass # Disks/Mass storage - Requires scbus and da # watchdog device at91_wdt # Atmel AT91 Watchdog Timer From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 05:48:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD5B61065670; Fri, 27 Jul 2012 05:48:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A838E8FC0A; Fri, 27 Jul 2012 05:48: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 q6R5mg8d070139; Fri, 27 Jul 2012 05:48:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6R5mgiS070136; Fri, 27 Jul 2012 05:48:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207270548.q6R5mgiS070136@svn.freebsd.org> From: Adrian Chadd Date: Fri, 27 Jul 2012 05:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238824 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 05:48:43 -0000 Author: adrian Date: Fri Jul 27 05:48:42 2012 New Revision: 238824 URL: http://svn.freebsd.org/changeset/base/238824 Log: Migrate the descriptor allocation function to not care about the number of buffers, only the number of descriptors. This involves: * Change the allocation function to not use nbuf at all; * When calling it, pass in "nbuf * ndesc" to correctly update how many descriptors are being allocated. Whilst here, fix the descriptor allocation code to correctly allocate a larger buffer size if the Merlin 4KB WAR is required. It overallocates descriptors when allocating a block that doesn't ever have a 4KB boundary being crossed, but that can be fixed at a later stage. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Jul 27 05:37:01 2012 (r238823) +++ head/sys/dev/ath/if_ath.c Fri Jul 27 05:48:42 2012 (r238824) @@ -2773,7 +2773,7 @@ ath_load_cb(void *arg, bus_dma_segment_t int ath_descdma_alloc_desc(struct ath_softc *sc, struct ath_descdma *dd, ath_bufhead *head, - const char *name, int ds_size, int nbuf, int ndesc) + const char *name, int ds_size, int ndesc) { #define DS2PHYS(_dd, _ds) \ ((_dd)->dd_desc_paddr + ((caddr_t)(_ds) - (caddr_t)(_dd)->dd_desc)) @@ -2785,11 +2785,11 @@ ath_descdma_alloc_desc(struct ath_softc dd->dd_descsize = ds_size; DPRINTF(sc, ATH_DEBUG_RESET, - "%s: %s DMA: %u buffers %u desc/buf, %d bytes per descriptor\n", - __func__, name, nbuf, ndesc, dd->dd_descsize); + "%s: %s DMA: %u desc, %d bytes per descriptor\n", + __func__, name, ndesc, dd->dd_descsize); dd->dd_name = name; - dd->dd_desc_len = dd->dd_descsize * nbuf * ndesc; + dd->dd_desc_len = dd->dd_descsize * ndesc; /* * Merlin work-around: @@ -2797,8 +2797,8 @@ ath_descdma_alloc_desc(struct ath_softc * Assume one skipped descriptor per 4KB page. */ if (! ath_hal_split4ktrans(sc->sc_ah)) { - int numdescpage = 4096 / (dd->dd_descsize * ndesc); - dd->dd_desc_len = (nbuf / numdescpage + 1) * 4096; + int numpages = dd->dd_desc_len / 4096; + dd->dd_desc_len += ds_size * numpages; } /* @@ -2834,7 +2834,7 @@ ath_descdma_alloc_desc(struct ath_softc &dd->dd_dmamap); if (error != 0) { if_printf(ifp, "unable to alloc memory for %u %s descriptors, " - "error %u\n", nbuf * ndesc, dd->dd_name, error); + "error %u\n", ndesc, dd->dd_name, error); goto fail1; } @@ -2883,7 +2883,7 @@ ath_descdma_setup(struct ath_softc *sc, /* Allocate descriptors */ error = ath_descdma_alloc_desc(sc, dd, head, name, ds_size, - nbuf, ndesc); + nbuf * ndesc); /* Assume any errors during allocation were dealt with */ if (error != 0) { Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Fri Jul 27 05:37:01 2012 (r238823) +++ head/sys/dev/ath/if_ath_misc.h Fri Jul 27 05:48:42 2012 (r238824) @@ -86,7 +86,7 @@ extern void ath_setslottime(struct ath_s extern int ath_descdma_alloc_desc(struct ath_softc *sc, struct ath_descdma *dd, ath_bufhead *head, const char *name, - int ds_size, int nbuf, int ndesc); + int ds_size, int ndesc); extern int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd, ath_bufhead *head, const char *name, int ds_size, int nbuf, int ndesc); From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 06:18:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DBB4B106564A; Fri, 27 Jul 2012 06:18:14 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 953868FC0A; Fri, 27 Jul 2012 06:18:14 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id C73AA7300A; Fri, 27 Jul 2012 08:38:13 +0200 (CEST) Date: Fri, 27 Jul 2012 08:38:13 +0200 From: Luigi Rizzo To: Roman Divacky Message-ID: <20120727063813.GB49988@onelab2.iet.unipi.it> References: <201207262137.q6QLbwGi028133@svn.freebsd.org> <20120726213959.GA12908@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120726213959.GA12908@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r238818 - head/sys/dev/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 06:18:15 -0000 On Thu, Jul 26, 2012 at 11:39:59PM +0200, Roman Divacky wrote: > Why dont you use __builtin_prefetch() ? ignorance :) thanks for the pointer, i'll look at it. i suppose it works for clang too ? cheers luigi From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 07:36:28 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6736D106564A; Fri, 27 Jul 2012 07:36:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id D849F8FC16; Fri, 27 Jul 2012 07:36:27 +0000 (UTC) Received: from c122-106-171-246.carlnfd1.nsw.optusnet.com.au (c122-106-171-246.carlnfd1.nsw.optusnet.com.au [122.106.171.246]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q6R7aJiD012252 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Jul 2012 17:36:20 +1000 Date: Fri, 27 Jul 2012 17:36:19 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Luigi Rizzo In-Reply-To: <20120727063813.GB49988@onelab2.iet.unipi.it> Message-ID: <20120727173155.A5046@besplex.bde.org> References: <201207262137.q6QLbwGi028133@svn.freebsd.org> <20120726213959.GA12908@freebsd.org> <20120727063813.GB49988@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, Roman Divacky , src-committers@FreeBSD.org, Luigi Rizzo , svn-src-all@FreeBSD.org Subject: Re: svn commit: r238818 - head/sys/dev/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 07:36:28 -0000 On Fri, 27 Jul 2012, Luigi Rizzo wrote: > On Thu, Jul 26, 2012 at 11:39:59PM +0200, Roman Divacky wrote: >> Why dont you use __builtin_prefetch() ? > > ignorance :) > > thanks for the pointer, i'll look at it. > i suppose it works for clang too ? Even gcc-3.3.1 has it (I expected it not to). And it works quite well (defaults to nothing from -mi386, and gives prefetcht0 for -march=athlon-xp and later). Other builtins that I have tried didn't work so well (IIRC, many generate a call to a library function instead of nothing, when the CPU or compiler doesn't really support them). Bruce From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 08:24:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50176106566C; Fri, 27 Jul 2012 08:24:13 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37EA88FC08; Fri, 27 Jul 2012 08:24:13 +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 q6R8ODU8082584; Fri, 27 Jul 2012 08:24:13 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6R8OCh3082572; Fri, 27 Jul 2012 08:24:12 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207270824.q6R8OCh3082572@svn.freebsd.org> From: Martin Matuska Date: Fri, 27 Jul 2012 08:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238825 - in vendor/libarchive/dist: . build build/cmake build/utils cpio cpio/test doc libarchive libarchive/test libarchive_fe tar tar/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 08:24:13 -0000 Author: mm Date: Fri Jul 27 08:24:12 2012 New Revision: 238825 URL: http://svn.freebsd.org/changeset/base/238825 Log: Update libarchive's vendor dist to version 3.0.4 from release branch. Git branch: release Git commit: 8076b31490c90aaf0edccecf760004c30bd95edc Obtained from: https://github.com/libarchive/libarchive.git Added: vendor/libarchive/dist/libarchive/archive_getdate.c vendor/libarchive/dist/libarchive/archive_match.c vendor/libarchive/dist/libarchive/archive_pathmatch.c vendor/libarchive/dist/libarchive/archive_pathmatch.h vendor/libarchive/dist/libarchive/archive_write_add_filter.c vendor/libarchive/dist/libarchive/test/test_archive_getdate.c vendor/libarchive/dist/libarchive/test/test_archive_match_owner.c vendor/libarchive/dist/libarchive/test/test_archive_match_path.c vendor/libarchive/dist/libarchive/test/test_archive_match_time.c vendor/libarchive/dist/libarchive/test/test_archive_pathmatch.c vendor/libarchive/dist/tar/test/test_format_newc.c vendor/libarchive/dist/tar/test/test_option_nodump.c Deleted: vendor/libarchive/dist/cpio/test/test_pathmatch.c vendor/libarchive/dist/libarchive_fe/matching.c vendor/libarchive/dist/libarchive_fe/matching.h vendor/libarchive/dist/libarchive_fe/pathmatch.c vendor/libarchive/dist/libarchive_fe/pathmatch.h vendor/libarchive/dist/tar/getdate.c vendor/libarchive/dist/tar/test/test_getdate.c vendor/libarchive/dist/tar/tree.c vendor/libarchive/dist/tar/tree.h Modified: vendor/libarchive/dist/CMakeLists.txt vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/NEWS vendor/libarchive/dist/README vendor/libarchive/dist/build/cmake/CheckFileOffsetBits.cmake vendor/libarchive/dist/build/cmake/config.h.in vendor/libarchive/dist/build/utils/gen_archive_string_composition_h.sh vendor/libarchive/dist/build/version vendor/libarchive/dist/configure.ac vendor/libarchive/dist/cpio/CMakeLists.txt vendor/libarchive/dist/cpio/bsdcpio.1 vendor/libarchive/dist/cpio/cmdline.c vendor/libarchive/dist/cpio/cpio.c vendor/libarchive/dist/cpio/cpio.h vendor/libarchive/dist/cpio/cpio_windows.c vendor/libarchive/dist/cpio/test/CMakeLists.txt vendor/libarchive/dist/cpio/test/main.c vendor/libarchive/dist/cpio/test/test.h vendor/libarchive/dist/doc/mdoc2man.awk vendor/libarchive/dist/doc/mdoc2wiki.awk vendor/libarchive/dist/doc/update.sh vendor/libarchive/dist/libarchive/CMakeLists.txt vendor/libarchive/dist/libarchive/archive.h vendor/libarchive/dist/libarchive/archive_acl.c vendor/libarchive/dist/libarchive/archive_check_magic.c vendor/libarchive/dist/libarchive/archive_endian.h vendor/libarchive/dist/libarchive/archive_entry.3 vendor/libarchive/dist/libarchive/archive_entry.c vendor/libarchive/dist/libarchive/archive_entry.h vendor/libarchive/dist/libarchive/archive_entry_acl.3 vendor/libarchive/dist/libarchive/archive_entry_copy_bhfi.c vendor/libarchive/dist/libarchive/archive_entry_link_resolver.c vendor/libarchive/dist/libarchive/archive_entry_linkify.3 vendor/libarchive/dist/libarchive/archive_entry_paths.3 vendor/libarchive/dist/libarchive/archive_entry_perms.3 vendor/libarchive/dist/libarchive/archive_entry_stat.3 vendor/libarchive/dist/libarchive/archive_entry_stat.c vendor/libarchive/dist/libarchive/archive_entry_time.3 vendor/libarchive/dist/libarchive/archive_ppmd7.c vendor/libarchive/dist/libarchive/archive_private.h vendor/libarchive/dist/libarchive/archive_read.3 vendor/libarchive/dist/libarchive/archive_read.c vendor/libarchive/dist/libarchive/archive_read_data.3 vendor/libarchive/dist/libarchive/archive_read_disk.3 vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c vendor/libarchive/dist/libarchive/archive_read_disk_posix.c vendor/libarchive/dist/libarchive/archive_read_disk_private.h vendor/libarchive/dist/libarchive/archive_read_disk_windows.c vendor/libarchive/dist/libarchive/archive_read_extract.3 vendor/libarchive/dist/libarchive/archive_read_filter.3 vendor/libarchive/dist/libarchive/archive_read_format.3 vendor/libarchive/dist/libarchive/archive_read_free.3 vendor/libarchive/dist/libarchive/archive_read_header.3 vendor/libarchive/dist/libarchive/archive_read_new.3 vendor/libarchive/dist/libarchive/archive_read_open.3 vendor/libarchive/dist/libarchive/archive_read_open_fd.c vendor/libarchive/dist/libarchive/archive_read_open_filename.c vendor/libarchive/dist/libarchive/archive_read_private.h vendor/libarchive/dist/libarchive/archive_read_set_options.3 vendor/libarchive/dist/libarchive/archive_read_support_filter_rpm.c vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c vendor/libarchive/dist/libarchive/archive_read_support_format_cab.c vendor/libarchive/dist/libarchive/archive_read_support_format_cpio.c vendor/libarchive/dist/libarchive/archive_read_support_format_iso9660.c vendor/libarchive/dist/libarchive/archive_read_support_format_lha.c vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c vendor/libarchive/dist/libarchive/archive_read_support_format_xar.c vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c vendor/libarchive/dist/libarchive/archive_string.c vendor/libarchive/dist/libarchive/archive_string.h vendor/libarchive/dist/libarchive/archive_string_composition.h vendor/libarchive/dist/libarchive/archive_string_sprintf.c vendor/libarchive/dist/libarchive/archive_util.3 vendor/libarchive/dist/libarchive/archive_util.c vendor/libarchive/dist/libarchive/archive_windows.c vendor/libarchive/dist/libarchive/archive_windows.h vendor/libarchive/dist/libarchive/archive_write.3 vendor/libarchive/dist/libarchive/archive_write.c vendor/libarchive/dist/libarchive/archive_write_add_filter_bzip2.c vendor/libarchive/dist/libarchive/archive_write_add_filter_compress.c vendor/libarchive/dist/libarchive/archive_write_add_filter_gzip.c vendor/libarchive/dist/libarchive/archive_write_add_filter_program.c vendor/libarchive/dist/libarchive/archive_write_add_filter_xz.c vendor/libarchive/dist/libarchive/archive_write_blocksize.3 vendor/libarchive/dist/libarchive/archive_write_data.3 vendor/libarchive/dist/libarchive/archive_write_disk.3 vendor/libarchive/dist/libarchive/archive_write_disk_posix.c vendor/libarchive/dist/libarchive/archive_write_disk_set_standard_lookup.c vendor/libarchive/dist/libarchive/archive_write_disk_windows.c vendor/libarchive/dist/libarchive/archive_write_filter.3 vendor/libarchive/dist/libarchive/archive_write_finish_entry.3 vendor/libarchive/dist/libarchive/archive_write_format.3 vendor/libarchive/dist/libarchive/archive_write_free.3 vendor/libarchive/dist/libarchive/archive_write_header.3 vendor/libarchive/dist/libarchive/archive_write_new.3 vendor/libarchive/dist/libarchive/archive_write_open.3 vendor/libarchive/dist/libarchive/archive_write_open_filename.c vendor/libarchive/dist/libarchive/archive_write_private.h vendor/libarchive/dist/libarchive/archive_write_set_format_7zip.c vendor/libarchive/dist/libarchive/archive_write_set_format_ar.c vendor/libarchive/dist/libarchive/archive_write_set_format_cpio.c vendor/libarchive/dist/libarchive/archive_write_set_format_cpio_newc.c vendor/libarchive/dist/libarchive/archive_write_set_format_gnutar.c vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c vendor/libarchive/dist/libarchive/archive_write_set_format_mtree.c vendor/libarchive/dist/libarchive/archive_write_set_format_pax.c vendor/libarchive/dist/libarchive/archive_write_set_format_ustar.c vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c vendor/libarchive/dist/libarchive/archive_write_set_format_zip.c vendor/libarchive/dist/libarchive/archive_write_set_options.3 vendor/libarchive/dist/libarchive/cpio.5 vendor/libarchive/dist/libarchive/libarchive-formats.5 vendor/libarchive/dist/libarchive/libarchive.3 vendor/libarchive/dist/libarchive/libarchive_changes.3 vendor/libarchive/dist/libarchive/libarchive_internals.3 vendor/libarchive/dist/libarchive/mtree.5 vendor/libarchive/dist/libarchive/tar.5 vendor/libarchive/dist/libarchive/test/CMakeLists.txt vendor/libarchive/dist/libarchive/test/main.c vendor/libarchive/dist/libarchive/test/read_open_memory.c vendor/libarchive/dist/libarchive/test/test.h vendor/libarchive/dist/libarchive/test/test_archive_string_conversion.c vendor/libarchive/dist/libarchive/test/test_compat_zip.c vendor/libarchive/dist/libarchive/test/test_read_disk_directory_traversals.c vendor/libarchive/dist/libarchive/test/test_read_format_7zip.c vendor/libarchive/dist/libarchive/test/test_read_format_cab.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c vendor/libarchive/dist/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c vendor/libarchive/dist/libarchive/test/test_read_format_rar.c vendor/libarchive/dist/libarchive/test/test_read_format_rar_unicode.rar.uu vendor/libarchive/dist/libarchive/test/test_read_format_tar_filename.c vendor/libarchive/dist/libarchive/test/test_read_pax_truncated.c vendor/libarchive/dist/libarchive/test/test_read_position.c vendor/libarchive/dist/libarchive/test/test_sparse_basic.c vendor/libarchive/dist/libarchive/test/test_write_format_zip.c vendor/libarchive/dist/libarchive_fe/err.c vendor/libarchive/dist/libarchive_fe/err.h vendor/libarchive/dist/tar/CMakeLists.txt vendor/libarchive/dist/tar/bsdtar.1 vendor/libarchive/dist/tar/bsdtar.c vendor/libarchive/dist/tar/bsdtar.h vendor/libarchive/dist/tar/bsdtar_windows.c vendor/libarchive/dist/tar/read.c vendor/libarchive/dist/tar/test/CMakeLists.txt vendor/libarchive/dist/tar/test/main.c vendor/libarchive/dist/tar/test/test.h vendor/libarchive/dist/tar/write.c Modified: vendor/libarchive/dist/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/CMakeLists.txt Fri Jul 27 05:48:42 2012 (r238824) +++ vendor/libarchive/dist/CMakeLists.txt Fri Jul 27 08:24:12 2012 (r238825) @@ -1,13 +1,36 @@ # +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.6 FATAL_ERROR) # PROJECT(libarchive C) # -CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake") if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin) endif() -SET(CMAKE_BUILD_TYPE "Release") +# +# Set the Build type for make based generators. +# You can choose following types: +# Debug : Debug build +# Release : Release build +# RelWithDebInfo : Release build with Debug Info +# MinSizeRel : Release Min Size build +IF(NOT CMAKE_BUILD_TYPE) + SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type" FORCE) +ENDIF(NOT CMAKE_BUILD_TYPE) +# Set a value type to properly display CMAKE_BUILD_TYPE on GUI if the +# value type is "UNINITIALIZED". +GET_PROPERTY(cached_type CACHE CMAKE_BUILD_TYPE PROPERTY TYPE) +IF("${cached_type}" STREQUAL "UNINITIALIZED") + SET(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "Build Type" FORCE) +ENDIF("${cached_type}" STREQUAL "UNINITIALIZED") +# Check the Build Type. +IF(NOT "${CMAKE_BUILD_TYPE}" + MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)\$") + MESSAGE(FATAL_ERROR + "Unknown keyword for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}\n" + "Acceptable keywords: Debug,Release,RelWithDebInfo,MinSizeRel") +ENDIF(NOT "${CMAKE_BUILD_TYPE}" + MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)\$") # On MacOS, prefer MacPorts libraries to system libraries. # I haven't come up with a compelling argument for this to be conditional. @@ -47,13 +70,73 @@ math(EXPR INTERFACE_VERSION "12 + ${_mi # ?? Should there be more here ?? SET(SOVERSION "${INTERFACE_VERSION}") +# Enalbe CMAKE_PUSH_CHECK_STATE() and CMAKE_POP_CHECK_STATE() macros +# saving and restoring the state of the variables. +INCLUDE(CMakePushCheckState) + +# Initialize the state of the variables. This initialization is not +# necessary but this shows you what value the variables initially have. +SET(CMAKE_REQUIRED_DEFINITIONS) +SET(CMAKE_REQUIRED_INCLUDES) +SET(CMAKE_REQUIRED_LIBRARIES) +SET(CMAKE_REQUIRED_FLAGS) + # Especially for early development, we want to be a little # aggressive about diagnosing build problems; this can get # relaxed somewhat in final shipping versions. IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") - ADD_DEFINITIONS(-Wall) - SET(CMAKE_REQUIRED_FLAGS "-Wall") + SET(CMAKE_REQUIRED_FLAGS "-Wall -Wformat -Wformat-security") + ################################################################# + # Set compile flags for all build types. + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wformat -Wformat-security") + ################################################################# + # Set compile flags for debug build. + # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Werror -Wextra -Wunused") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wshadow") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wmissing-prototypes") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wcast-qual") ENDIF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") +IF (MSVC) + ################################################################# + # Set compile flags for debug build. + # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" + # Enable level 4 C4061: The enumerate has no associated handler in a switch + # statement. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4061") + # Enable level 4 C4254: A larger bit field was assigned to a smaller bit + # field. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4254") + # Enable level 4 C4295: An array was initialized but the last character in + # the array is not a null; accessing the array may + # produce unexpected results. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4295") + # Enable level 4 C4296: An unsigned variable was used in a comparison + # operation with zero. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4296") + # Enable level 4 C4389: An operation involved signed and unsigned variables. + # This could result in a loss of data. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4389") + # Enable level 4 C4505: The given function is local and not referenced in + # the body of the module; therefore, the function is + # dead code. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4505") + # Enable level 4 C4514: The optimizer removed an inline function that is not + # called. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4514") + # Enable level 4 C4702: Unreachable code. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4702") + # Enable level 4 C4706: The test value in a conditional expression was the + # result of an assignment. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4706") + # /WX option is the same as gcc's -Werror option. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /WX") + # /Oi option enables built-in functions. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Oi") + ################################################################# + # Set compile flags for release build. + SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Oi") +ENDIF (MSVC) # Enable CTest/CDash support include(CTest) @@ -74,10 +157,18 @@ IF(ENABLE_TEST) ENDIF(ENABLE_TEST) IF(WIN32) - SET(_WIN32_WINNT 0x0500 CACHE INTERNAL "Setting _WIN32_WINNT to 0x0500 for Windows 2000 APIs") - SET(WINVER 0x0500 CACHE INTERNAL "Setting WINVER to 0x0500 for Windows 2000 APIs") + IF(MSVC60) + SET(WINVER 0x0400) + ELSE() + SET(WINVER 0x0500) + ENDIF() + SET(_WIN32_WINNT ${WINVER}) ENDIF(WIN32) +IF("${CMAKE_C_PLATFORM_ID}" MATCHES "^(HP-UX)$") + ADD_DEFINITIONS(-D_XOPEN_SOURCE=500) # Ask wchar.h for mbstate_t +ENDIF() + # INCLUDE(CheckCSourceCompiles) INCLUDE(CheckCSourceRuns) @@ -125,7 +216,38 @@ MACRO (INSTALL_MAN __mans) INSTALL(FILES ${_man} DESTINATION "share/man/man${_mansect}") ENDFOREACH (_man) ENDMACRO (INSTALL_MAN __mans) - +# +# Find out what macro is needed to use libraries on Windows. +# +MACRO (TRY_MACRO_FOR_LIBRARY INCLUDES LIBRARIES + TRY_TYPE SAMPLE_SOURCE MACRO_LIST) + IF(WIN32 AND NOT CYGWIN) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables + SET(CMAKE_REQUIRED_INCLUDES ${INCLUDES}) + SET(CMAKE_REQUIRED_LIBRARIES ${LIBRARIES}) + FOREACH(VAR ${MACRO_LIST}) + # Clear ${VAR} from CACHE If the libraries which ${VAR} was + # checked with are changed. + SET(VAR_WITH_LIB "${VAR}_WITH_LIB") + GET_PROPERTY(PREV_VAR_WITH_LIB VARIABLE PROPERTY ${VAR_WITH_LIB}) + IF(NOT "${PREV_VAR_WITH_LIB}" STREQUAL "${LIBRARIES}") + UNSET(${VAR} CACHE) + ENDIF(NOT "${PREV_VAR_WITH_LIB}" STREQUAL "${LIBRARIES}") + # Check if the library can be used with the macro. + IF("${TRY_TYPE}" MATCHES "COMPILES") + CHECK_C_SOURCE_COMPILES("${SAMPLE_SOURCE}" ${VAR}) + ELSEIF("${TRY_TYPE}" MATCHES "RUNS") + CHECK_C_SOURCE_RUNS("${SAMPLE_SOURCE}" ${VAR}) + ELSE("${TRY_TYPE}" MATCHES "COMPILES") + MESSAGE(FATAL_ERROR "UNKNOWN KEYWORD \"${TRY_TYPE}\" FOR TRY_TYPE") + ENDIF("${TRY_TYPE}" MATCHES "COMPILES") + # Save the libraries which ${VAR} is checked with. + SET(${VAR_WITH_LIB} "${LIBRARIES}" CACHE INTERNAL + "Macro ${VAR} is checked with") + ENDFOREACH(VAR) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + ENDIF(WIN32 AND NOT CYGWIN) +ENDMACRO (TRY_MACRO_FOR_LIBRARY) # # Check compress/decompress libraries # @@ -172,11 +294,27 @@ IF(ZLIB_FOUND) INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) IF(WIN32 AND NOT CYGWIN) - SET(CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIR}) - SET(CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES}) - CHECK_C_SOURCE_Runs( - "#ifndef ZLIB_WINAPI\n#define ZLIB_WINAPI\n#endif\n#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" + # + # Test if ZLIB_WINAPI macro is needed to use. + # + TRY_MACRO_FOR_LIBRARY( + "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" + RUNS + "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" ZLIB_WINAPI) + IF(ZLIB_WINAPI) + ADD_DEFINITIONS(-DZLIB_WINAPI) + ELSE(ZLIB_WINAPI) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" + COMPILES + "#include \nint main() {return zlibVersion()?1:0; }" + "ZLIB_DLL;WITHOUT_ZLIB_DLL") + IF(ZLIB_DLL) + ADD_DEFINITIONS(-DZLIB_DLL) + ENDIF(ZLIB_DLL) + ENDIF(ZLIB_WINAPI) ENDIF(WIN32 AND NOT CYGWIN) ENDIF(ZLIB_FOUND) MARK_AS_ADVANCED(CLEAR ZLIB_INCLUDE_DIR) @@ -190,9 +328,20 @@ IF(BZIP2_FOUND) SET(HAVE_BZLIB_H 1) INCLUDE_DIRECTORIES(${BZIP2_INCLUDE_DIR}) LIST(APPEND ADDITIONAL_LIBS ${BZIP2_LIBRARIES}) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${BZIP2_INCLUDE_DIR}" "${BZIP2_LIBRARIES}" + COMPILES + "#include \nint main() {return BZ2_bzlibVersion()?1:0; }" + "USE_BZIP2_DLL;USE_BZIP2_STATIC") + IF(USE_BZIP2_DLL) + ADD_DEFINITIONS(-DUSE_BZIP2_DLL) + ELSEIF(USE_BZIP2_STATIC) + ADD_DEFINITIONS(-DUSE_BZIP2_STATIC) + ENDIF(USE_BZIP2_DLL) ENDIF(BZIP2_FOUND) MARK_AS_ADVANCED(CLEAR BZIP2_INCLUDE_DIR) -MARK_AS_ADVANCED(CLEAR BZIP2_LIBRARY) +MARK_AS_ADVANCED(CLEAR BZIP2_LIBRARIES) # # Find LZMA # @@ -202,6 +351,15 @@ IF(LZMA_FOUND) SET(HAVE_LZMA_H 1) INCLUDE_DIRECTORIES(${LZMA_INCLUDE_DIR}) LIST(APPEND ADDITIONAL_LIBS ${LZMA_LIBRARIES}) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${LZMA_INCLUDE_DIR}" "${LZMA_LIBRARIES}" + COMPILES + "#include \nint main() {return (int)lzma_version_number(); }" + "WITHOUT_LZMA_API_STATIC;LZMA_API_STATIC") + IF(NOT WITHOUT_LZMA_API_STATIC AND LZMA_API_STATIC) + ADD_DEFINITIONS(-DLZMA_API_STATIC) + ENDIF(NOT WITHOUT_LZMA_API_STATIC AND LZMA_API_STATIC) ELSEIF(LZMADEC_FOUND) SET(HAVE_LIBLZMADEC 1) SET(HAVE_LZMADEC_H 1) @@ -244,6 +402,7 @@ LA_CHECK_INCLUDE_FILE("inttypes.h" HAVE_ LA_CHECK_INCLUDE_FILE("io.h" HAVE_IO_H) LA_CHECK_INCLUDE_FILE("langinfo.h" HAVE_LANGINFO_H) LA_CHECK_INCLUDE_FILE("limits.h" HAVE_LIMITS_H) +LA_CHECK_INCLUDE_FILE("linux/types.h" HAVE_LINUX_TYPES_H) LA_CHECK_INCLUDE_FILE("linux/fiemap.h" HAVE_LINUX_FIEMAP_H) LA_CHECK_INCLUDE_FILE("linux/fs.h" HAVE_LINUX_FS_H) LA_CHECK_INCLUDE_FILE("linux/magic.h" HAVE_LINUX_MAGIC_H) @@ -307,9 +466,11 @@ CHECK_C_SOURCE_COMPILES( IF(ENABLE_NETTLE) CHECK_LIBRARY_EXISTS(nettle "nettle_sha1_digest" "" NETTLE_FOUND) IF(NETTLE_FOUND) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables SET(CMAKE_REQUIRED_LIBRARIES "nettle") FIND_LIBRARY(NETTLE_LIBRARY NAMES nettle) LIST(APPEND ADDITIONAL_LIBS ${NETTLE_LIBRARY}) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables ELSE(NETTLE_FOUND) SET(ENABLE_NETTLE OFF) ENDIF(NETTLE_FOUND) @@ -328,9 +489,11 @@ ENDIF() # FreeBSD libmd CHECK_LIBRARY_EXISTS(md "MD5Init" "" LIBMD_FOUND) IF(LIBMD_FOUND) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables SET(CMAKE_REQUIRED_LIBRARIES "md") FIND_LIBRARY(LIBMD_LIBRARY NAMES md) LIST(APPEND ADDITIONAL_LIBS ${LIBMD_LIBRARY}) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables ENDIF(LIBMD_FOUND) # @@ -386,10 +549,10 @@ ${ARCHIVE_CRYPTO_C} int main(int argc, char **argv) { - archive_${lower_crypto}_ctx ctx; - archive_${lower_crypto}_init(&ctx); - archive_${lower_crypto}_update(&ctx, *argv, argc); - archive_${lower_crypto}_final(&ctx, NULL); + archive_${lower_algorithm}_ctx ctx; + archive_${lower_algorithm}_init(&ctx); + archive_${lower_algorithm}_update(&ctx, *argv, argc); + archive_${lower_algorithm}_final(&ctx, NULL); return 0; } ") @@ -511,6 +674,20 @@ ENDMACRO(CHECK_CRYPTO_WIN CRYPTO_LIST) # MACRO(CHECK_ICONV LIB TRY_ICONV_CONST) IF(NOT HAVE_ICONV) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables + IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") + # + # During checking iconv proto type, we should use -Werror to avoid the + # success of iconv detection with a warnig which success is a miss + # detection. So this needs for all build mode(even it's a release mode). + # + SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror") + ENDIF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") + IF (MSVC) + # NOTE: /WX option is the same as gcc's -Werror option. + SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} /WX") + ENDIF (MSVC) + # CHECK_C_SOURCE_COMPILES( "#include #include @@ -526,10 +703,12 @@ MACRO(CHECK_ICONV LIB TRY_ICONV_CONST) SET(HAVE_ICONV true) SET(ICONV_CONST ${TRY_ICONV_CONST}) ENDIF(HAVE_ICONV_${LIB}_${TRY_ICONV_CONST}) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables ENDIF(NOT HAVE_ICONV) ENDMACRO(CHECK_ICONV TRY_ICONV_CONST) IF(ENABLE_ICONV) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables FIND_PATH(ICONV_INCLUDE_DIR iconv.h) IF(ICONV_INCLUDE_DIR) #SET(INCLUDES ${INCLUDES} "iconv.h") @@ -540,9 +719,30 @@ IF(ENABLE_ICONV) CHECK_ICONV("libc" "") # If iconv isn't in libc and we have a libiconv, try that. - FIND_LIBRARY(LIBICONV_PATH iconv) + FIND_LIBRARY(LIBICONV_PATH NAMES iconv libiconv) IF(NOT HAVE_ICONV AND LIBICONV_PATH) LIST(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBICONV_PATH}) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${ICONV_INCLUDE_DIR}" "${LIBICONV_PATH}" + COMPILES + "#include \nint main() {return iconv_close((iconv_t)0);}" + "WITHOUT_LIBICONV_STATIC;LIBICONV_STATIC") + IF(NOT WITHOUT_LIBICONV_STATIC AND LIBICONV_STATIC) + ADD_DEFINITIONS(-DLIBICONV_STATIC) + ENDIF(NOT WITHOUT_LIBICONV_STATIC AND LIBICONV_STATIC) + # + # Set up CMAKE_REQUIRED_* for CHECK_ICONV + # + SET(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) + SET(CMAKE_REQUIRED_LIBRARIES ${LIBICONV_PATH}) + IF(LIBICONV_STATIC) + # LIBICONV_STATIC is necessary for the success of CHECK_ICONV + # on Windows. + SET(CMAKE_REQUIRED_DEFINITIONS "-DLIBICONV_STATIC") + ELSE(LIBICONV_STATIC) + SET(CMAKE_REQUIRED_DEFINITIONS) + ENDIF(LIBICONV_STATIC) CHECK_ICONV("libiconv" "const") CHECK_ICONV("libiconv" "") IF (HAVE_ICONV) @@ -554,19 +754,36 @@ IF(ENABLE_ICONV) # Find locale_charset() for libiconv. # IF(LIBICONV_PATH) + SET(CMAKE_REQUIRED_DEFINITIONS) + SET(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR}) + SET(CMAKE_REQUIRED_LIBRARIES) CHECK_INCLUDE_FILES("localcharset.h" HAVE_LOCALCHARSET_H) - CHECK_FUNCTION_EXISTS_GLIBC(locale_charset HAVE_LOCALE_CHARSET) - IF(NOT HAVE_LOCALE_CHARSET) - FIND_LIBRARY(LIBCHARSET_PATH charset) - IF(LIBCHARSET_PATH) - SET(CMAKE_REQUIRED_LIBRARIES ${LIBCHARSET_PATH}) + FIND_LIBRARY(LIBCHARSET_PATH NAMES charset libcharset) + IF(LIBCHARSET_PATH) + SET(CMAKE_REQUIRED_LIBRARIES ${LIBCHARSET_PATH}) + IF(WIN32 AND NOT CYGWIN) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${ICONV_INCLUDE_DIR}" "${LIBCHARSET_PATH}" + COMPILES + "#include \nint main() {return locale_charset()?1:0;}" + "WITHOUT_LIBCHARSET_STATIC;LIBCHARSET_STATIC") + IF(NOT WITHOUT_LIBCHARSET_STATIC AND LIBCHARSET_STATIC) + ADD_DEFINITIONS(-DLIBCHARSET_STATIC) + ENDIF(NOT WITHOUT_LIBCHARSET_STATIC AND LIBCHARSET_STATIC) + IF(WITHOUT_LIBCHARSET_STATIC OR LIBCHARSET_STATIC) + SET(HAVE_LOCALE_CHARSET ON CACHE INTERNAL + "Have function locale_charset") + ENDIF(WITHOUT_LIBCHARSET_STATIC OR LIBCHARSET_STATIC) + ELSE(WIN32 AND NOT CYGWIN) CHECK_FUNCTION_EXISTS_GLIBC(locale_charset HAVE_LOCALE_CHARSET) - IF(HAVE_LOCALE_CHARSET) - LIST(APPEND ADDITIONAL_LIBS ${LIBCHARSET_PATH}) - ENDIF(HAVE_LOCALE_CHARSET) - ENDIF(LIBCHARSET_PATH) - ENDIF(NOT HAVE_LOCALE_CHARSET) + ENDIF(WIN32 AND NOT CYGWIN) + IF(HAVE_LOCALE_CHARSET) + LIST(APPEND ADDITIONAL_LIBS ${LIBCHARSET_PATH}) + ENDIF(HAVE_LOCALE_CHARSET) + ENDIF(LIBCHARSET_PATH) ENDIF(LIBICONV_PATH) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables ELSE(ENABLE_ICONV) # Make sure ICONV variables are not in CACHE after ENABLE_ICONV disabled # (once enabled). @@ -578,6 +795,10 @@ ELSE(ENABLE_ICONV) UNSET(HAVE_ICONV_libiconv_const CACHE) UNSET(ICONV_INCLUDE_DIR CACHE) UNSET(LIBICONV_PATH CACHE) + UNSET(LIBICONV_DLL CACHE) + UNSET(LIBICONV_STATIC CACHE) + UNSET(LIBCHARSET_DLL CACHE) + UNSET(LIBCHARSET_STATIC CACHE) ENDIF(ENABLE_ICONV) # @@ -585,6 +806,7 @@ ENDIF(ENABLE_ICONV) # FIND_PACKAGE(LibXml2) IF(LIBXML2_FOUND) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) LIST(APPEND ADDITIONAL_LIBS ${LIBXML2_LIBRARIES}) SET(HAVE_LIBXML2 1) @@ -592,20 +814,33 @@ IF(LIBXML2_FOUND) SET(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR}) CHECK_INCLUDE_FILES("libxml/xmlreader.h" HAVE_LIBXML_XMLREADER_H) CHECK_INCLUDE_FILES("libxml/xmlwriter.h" HAVE_LIBXML_XMLWRITER_H) - SET(CMAKE_REQUIRED_INCLUDES "") + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${ICONV_INCLUDE_DIR};${LIBXML2_INCLUDE_DIR}" + "ws2_32.lib;${ZLIB_LIBRARIES};${LIBICONV_PATH};${LIBXML2_LIBRARIES}" + COMPILES + "#include \n#include \nint main() {return xmlTextReaderRead((xmlTextReaderPtr)(void *)0);}" + "WITHOUT_LIBXML_STATIC;LIBXML_STATIC") + IF(NOT WITHOUT_LIBXML_STATIC AND LIBXML_STATIC) + ADD_DEFINITIONS(-DLIBXML_STATIC) + ENDIF(NOT WITHOUT_LIBXML_STATIC AND LIBXML_STATIC) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables ELSE(LIBXML2_FOUND) # # Find Expat # FIND_PACKAGE(EXPAT) IF(EXPAT_FOUND) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIR}) LIST(APPEND ADDITIONAL_LIBS ${EXPAT_LIBRARIES}) SET(HAVE_LIBEXPAT 1) LA_CHECK_INCLUDE_FILE("expat.h" HAVE_EXPAT_H) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables ENDIF(EXPAT_FOUND) ENDIF(LIBXML2_FOUND) - +MARK_AS_ADVANCED(CLEAR LIBXML2_INCLUDE_DIR) +MARK_AS_ADVANCED(CLEAR LIBXML2_LIBRARIES) # # Find Libregex # @@ -616,6 +851,7 @@ IF(REGEX_INCLUDE_DIR) # If libc does not provide regex, find libregex. # IF(NOT HAVE_REGCOMP_LIBC) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables FIND_LIBRARY(REGEX_LIBRARY regex) IF(REGEX_LIBRARY) SET(CMAKE_REQUIRED_LIBRARIES ${REGEX_LIBRARY}) @@ -632,21 +868,33 @@ IF(REGEX_INCLUDE_DIR) SET(CMAKE_REQUIRED_INCLUDES ${REGEX_INCLUDE_DIR}) LA_CHECK_INCLUDE_FILE("regex.h" HAVE_REGEX_H) ENDIF(NOT HAVE_REGEX_H) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${REGEX_INCLUDE_DIR}" "${REGEX_LIBRARY}" + COMPILES + "#include \n#include \nint main() {regex_t r;return regcomp(&r, \"\", 0);}" + "USE_REGEX_DLL;USE_REGEX_STATIC") + IF(USE_REGEX_DLL) + ADD_DEFINITIONS(-DUSE_REGEX_DLL) + ELSEIF(USE_REGEX_STATIC) + ADD_DEFINITIONS(-DUSE_REGEX_STATIC) + ENDIF(USE_REGEX_DLL) ENDIF(HAVE_REGCOMP_LIBREGEX) ENDIF(REGEX_LIBRARY) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables ENDIF(NOT HAVE_REGCOMP_LIBC) ENDIF(REGEX_INCLUDE_DIR) # # Check functions # +CMAKE_PUSH_CHECK_STATE() # Save the state of the variables IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") # # During checking functions, we should use -fno-builtin to avoid the # failure of function detection which failure is an error "conflicting # types for built-in function" caused by using -Werror option. # - SET(SAVE_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-builtin") ENDIF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") CHECK_SYMBOL_EXISTS(_CrtSetReportMode "crtdbg.h" HAVE__CrtSetReportMode) @@ -685,7 +933,6 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) -CHECK_FUNCTION_EXISTS_GLIBC(mbsnrtowcs HAVE_MBSNRTOWCS) CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) @@ -719,7 +966,6 @@ CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) -CHECK_FUNCTION_EXISTS_GLIBC(wcsnrtombs HAVE_WCSNRTOMBS) CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S) CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) @@ -736,10 +982,7 @@ CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRIN CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) -# Restore CMAKE_REQUIRED_FLAGS -IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") - SET(CMAKE_REQUIRED_FLAGS ${SAVE_CMAKE_REQUIRED_FLAGS}) -ENDIF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") +CMAKE_POP_CHECK_STATE() # Restore the state of the variables # Make sure we have the POSIX version of readdir_r, not the # older 2-argument version. @@ -826,6 +1069,12 @@ CHECK_STRUCT_MEMBER("struct stat" st_blk # Check for st_flags in struct stat (BSD fflags) CHECK_STRUCT_MEMBER("struct stat" st_flags "sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_FLAGS) + +IF(HAVE_SYS_STATVFS_H) + CHECK_STRUCT_MEMBER("struct statvfs" f_iosize + "sys/types.h;sys/statvfs.h" HAVE_STRUCT_STATVFS_F_IOSIZE) +ENDIF() + # # CHECK_STRUCT_MEMBER("struct tm" tm_sec @@ -1120,11 +1369,6 @@ IF(MSVC) ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) ENDIF(MSVC) -# We need CoreServices on Mac OS. -IF(APPLE) - LIST(APPEND ADDITIONAL_LIBS "-framework CoreServices") -ENDIF(APPLE) - IF(ENABLE_TEST) ADD_CUSTOM_TARGET(run_all_tests) ENDIF(ENABLE_TEST) Modified: vendor/libarchive/dist/Makefile.am ============================================================================== --- vendor/libarchive/dist/Makefile.am Fri Jul 27 05:48:42 2012 (r238824) +++ vendor/libarchive/dist/Makefile.am Fri Jul 27 08:24:12 2012 (r238825) @@ -21,7 +21,11 @@ TESTS= libarchive_test $(bsdtar_test_pro TESTS_ENVIRONMENT= $(libarchive_TESTS_ENVIRONMENT) $(bsdtar_TESTS_ENVIRONMENT) $(bsdcpio_TESTS_ENVIRONMENT) # Always build and test both bsdtar and bsdcpio as part of 'distcheck' DISTCHECK_CONFIGURE_FLAGS = --enable-bsdtar --enable-bsdcpio -AM_CFLAGS=-Wall +COMMON_CFLAGS=-Wall -Wformat -Wformat-security +# The next line is commented out by default in shipping libarchive releases. +# It is uncommented by default in trunk. +# DEV_CFLAGS=-Werror -Wextra -Wunused -Wshadow -Wmissing-prototypes -Wcast-qual +AM_CFLAGS=$(COMMON_CFLAGS) $(DEV_CFLAGS) PLATFORMCPPFLAGS = @PLATFORMCPPFLAGS@ AM_CPPFLAGS=$(PLATFORMCPPFLAGS) @@ -100,8 +104,12 @@ libarchive_la_SOURCES= \ libarchive/archive_entry_stat.c \ libarchive/archive_entry_strmode.c \ libarchive/archive_entry_xattr.c \ + libarchive/archive_getdate.c \ + libarchive/archive_match.c \ libarchive/archive_options.c \ libarchive/archive_options_private.h \ + libarchive/archive_pathmatch.c \ + libarchive/archive_pathmatch.h \ libarchive/archive_platform.h \ libarchive/archive_ppmd_private.h \ libarchive/archive_ppmd7.c \ @@ -161,6 +169,7 @@ libarchive_la_SOURCES= \ libarchive/archive_write_open_filename.c \ libarchive/archive_write_open_memory.c \ libarchive/archive_write_private.h \ + libarchive/archive_write_add_filter.c \ libarchive/archive_write_add_filter_bzip2.c \ libarchive/archive_write_add_filter_compress.c \ libarchive/archive_write_add_filter_gzip.c \ @@ -253,6 +262,11 @@ libarchive_test_SOURCES= \ libarchive/test/test_archive_api_feature.c \ libarchive/test/test_archive_clear_error.c \ libarchive/test/test_archive_crypto.c \ + libarchive/test/test_archive_getdate.c \ + libarchive/test/test_archive_match_owner.c \ + libarchive/test/test_archive_match_path.c \ + libarchive/test/test_archive_match_time.c \ + libarchive/test/test_archive_pathmatch.c \ libarchive/test/test_archive_read_close_twice.c \ libarchive/test/test_archive_read_close_twice_open_fd.c \ libarchive/test/test_archive_read_close_twice_open_filename.c \ @@ -572,12 +586,9 @@ libarchive_fe_la_SOURCES= \ libarchive_fe/err.h \ libarchive_fe/lafe_platform.h \ libarchive_fe/line_reader.c \ - libarchive_fe/line_reader.h \ - libarchive_fe/matching.c \ - libarchive_fe/matching.h \ - libarchive_fe/pathmatch.c \ - libarchive_fe/pathmatch.h + libarchive_fe/line_reader.h +libarchive_fe_la_CPPFLAGS= -I$(top_srcdir)/libarchive # # # bsdtar source, docs, etc. @@ -589,11 +600,8 @@ bsdtar_SOURCES= \ tar/bsdtar.h \ tar/bsdtar_platform.h \ tar/cmdline.c \ - tar/getdate.c \ tar/read.c \ tar/subst.c \ - tar/tree.c \ - tar/tree.h \ tar/util.c \ tar/write.c @@ -638,14 +646,13 @@ endif # bsdtar_test_SOURCES= \ - tar/getdate.c \ tar/test/main.c \ tar/test/test.h \ tar/test/test_0.c \ tar/test/test_basic.c \ tar/test/test_copy.c \ tar/test/test_empty_mtree.c \ - tar/test/test_getdate.c \ + tar/test/test_format_newc.c \ tar/test/test_help.c \ tar/test/test_option_C_upper.c \ tar/test/test_option_H_upper.c \ @@ -661,6 +668,7 @@ bsdtar_test_SOURCES= \ tar/test/test_option_keep_newer_files.c \ tar/test/test_option_n.c \ tar/test/test_option_newer_than.c \ + tar/test/test_option_nodump.c \ tar/test/test_option_q.c \ tar/test/test_option_r.c \ tar/test/test_option_s.c \ @@ -784,8 +792,7 @@ bsdcpio_test_SOURCES= \ cpio/test/test_option_z.c \ cpio/test/test_owner_parse.c \ cpio/test/test_passthrough_dotdot.c \ - cpio/test/test_passthrough_reverse.c \ - cpio/test/test_pathmatch.c + cpio/test/test_passthrough_reverse.c bsdcpio_test_CPPFLAGS= \ -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \ Modified: vendor/libarchive/dist/NEWS ============================================================================== --- vendor/libarchive/dist/NEWS Fri Jul 27 05:48:42 2012 (r238824) +++ vendor/libarchive/dist/NEWS Fri Jul 27 08:24:12 2012 (r238825) @@ -1,14 +1,10 @@ -Jan 10, 2012: Issue 223: Skip atime tests if atime not supported -Jan 09, 2012: Issue 222: Errors saving sparse files to pax archives -Jan 09, 2012: Issue 221: allow archive_*_free(NULL) -Dec 31, 2011: Issue 212: configure script on Solaris -Dec 30, 2011: Issue 218: empty contents extracting Zip files with bsdcpio -Dec 30, 2011: Issue 217: fix compile warning -Dec 30, 2011: Issue 216: truncated filenames in listings -Dec 28, 2011: Issue 210: memory leak on Windows -Dec 28, 2011: Issue 206: fix hardlink tests on Windows 2000 -Dec 27, 2011: Issue 208: Don't hang when using external compression - program on Windows +Mar 27, 2012: libarchive 3.0.4 released + +Feb 05, 2012: libarchive development now hosted at GitHub. + http://libarchive.github.com/ +Feb 05, 2012: libarchive's issue tracker remains at Google Code. + http://code.google.com/p/libarchive/issues/list +Feb 05, 2012: libarchive's mailing lists remain at Google Groups. Dec 24, 2011: libarchive 3.0.2 released Dec 23, 2011: Various fixes merged from FreeBSD Modified: vendor/libarchive/dist/README ============================================================================== --- vendor/libarchive/dist/README Fri Jul 27 05:48:42 2012 (r238824) +++ vendor/libarchive/dist/README Fri Jul 27 08:24:12 2012 (r238825) @@ -1,9 +1,14 @@ README for libarchive bundle. Questions? Issues? - * http://libarchive.googlecode.com/ is the home for ongoing - libarchive development, including issue tracker, additional - documentation, and links to the libarchive mailing lists. + * http://libarchive.github.com/ is the home for ongoing + libarchive development, including documentation, and + links to the libarchive mailing lists. + * To report an issue, use the issue tracker at + http://code.google.com/p/libarchive/issues/list + * To submit an enhancement to libarchive, please submit + a pull request via GitHub. + https://github.com/libarchive/libarchive/pulls This distribution bundle includes the following components: * libarchive: a library for reading and writing streaming archives @@ -66,6 +71,7 @@ Currently, the library automatically det * ZIP archives (with uncompressed or "deflate" compressed entries) * GNU and BSD 'ar' archives * 'mtree' format + * 7-Zip archives * Microsoft CAB format * LHA and LZH archives * RAR archives @@ -92,6 +98,7 @@ The library can create archives in any o * GNU and BSD 'ar' archives * 'mtree' format * ISO9660 format + * 7-Zip archives * XAR archives When creating archives, the result can be filtered with any of the following: Modified: vendor/libarchive/dist/build/cmake/CheckFileOffsetBits.cmake ============================================================================== --- vendor/libarchive/dist/build/cmake/CheckFileOffsetBits.cmake Fri Jul 27 05:48:42 2012 (r238824) +++ vendor/libarchive/dist/build/cmake/CheckFileOffsetBits.cmake Fri Jul 27 08:24:12 2012 (r238825) @@ -19,7 +19,7 @@ GET_FILENAME_COMPONENT(_selfdir_CheckFil MACRO (CHECK_FILE_OFFSET_BITS) IF(NOT DEFINED _FILE_OFFSET_BITS) - MESSAGE(STATUS "Cheking _FILE_OFFSET_BITS for large files") + MESSAGE(STATUS "Checking _FILE_OFFSET_BITS for large files") TRY_COMPILE(__WITHOUT_FILE_OFFSET_BITS_64 ${CMAKE_CURRENT_BINARY_DIR} ${_selfdir_CheckFileOffsetBits}/CheckFileOffsetBits.c @@ -33,10 +33,10 @@ MACRO (CHECK_FILE_OFFSET_BITS) IF(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64) SET(_FILE_OFFSET_BITS 64 CACHE INTERNAL "_FILE_OFFSET_BITS macro needed for large files") - MESSAGE(STATUS "Cheking _FILE_OFFSET_BITS for large files - needed") + MESSAGE(STATUS "Checking _FILE_OFFSET_BITS for large files - needed") ELSE(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64) SET(_FILE_OFFSET_BITS "" CACHE INTERNAL "_FILE_OFFSET_BITS macro needed for large files") - MESSAGE(STATUS "Cheking _FILE_OFFSET_BITS for large files - not needed") + MESSAGE(STATUS "Checking _FILE_OFFSET_BITS for large files - not needed") ENDIF(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64) ENDIF(NOT DEFINED _FILE_OFFSET_BITS) Modified: vendor/libarchive/dist/build/cmake/config.h.in ============================================================================== --- vendor/libarchive/dist/build/cmake/config.h.in Fri Jul 27 05:48:42 2012 (r238824) +++ vendor/libarchive/dist/build/cmake/config.h.in Fri Jul 27 08:24:12 2012 (r238825) @@ -609,6 +609,9 @@ typedef uint64_t uintmax_t; /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LINUX_MAGIC_H 1 +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_LINUX_TYPES_H 1 + /* Define to 1 if you have the `listea' function. */ #cmakedefine HAVE_LISTEA 1 @@ -661,9 +664,6 @@ typedef uint64_t uintmax_t; /* Define to 1 if you have the `mbrtowc' function. */ #cmakedefine HAVE_MBRTOWC 1 -/* Define to 1 if you have the `mbsnrtowcs' function. */ -#cmakedefine HAVE_MBSNRTOWCS 1 - /* Define to 1 if you have the `memmove' function. */ #cmakedefine HAVE_MEMMOVE 1 @@ -782,6 +782,9 @@ typedef uint64_t uintmax_t; /* Define to 1 if `f_namemax' is a member of `struct statfs'. */ #cmakedefine HAVE_STRUCT_STATFS_F_NAMEMAX 1 +/* Define to 1 if `f_iosize' is a member of `struct statvfs'. */ +#cmakedefine HAVE_STRUCT_STATVFS_F_IOSIZE 1 + /* Define to 1 if `st_birthtime' is a member of `struct stat'. */ #cmakedefine HAVE_STRUCT_STAT_ST_BIRTHTIME 1 @@ -943,9 +946,6 @@ typedef uint64_t uintmax_t; /* Define to 1 if you have the `wcslen' function. */ #cmakedefine HAVE_WCSLEN 1 -/* Define to 1 if you have the `wcsnrtombs' function. */ -#cmakedefine HAVE_WCSNRTOMBS 1 - /* Define to 1 if you have the `wctomb' function. */ #cmakedefine HAVE_WCTOMB 1 Modified: vendor/libarchive/dist/build/utils/gen_archive_string_composition_h.sh ============================================================================== --- vendor/libarchive/dist/build/utils/gen_archive_string_composition_h.sh Fri Jul 27 05:48:42 2012 (r238824) +++ vendor/libarchive/dist/build/utils/gen_archive_string_composition_h.sh Fri Jul 27 08:24:12 2012 (r238825) @@ -1,10 +1,13 @@ #!/bin/sh # -# This needs http://unicode.org/Public/UNIDATA/UnicodeData.txt +# This needs http://unicode.org/Public/6.0.0/ucd/UnicodeData.txt # inputfile="$1" # Expect UnicodeData.txt outfile=archive_string_composition.h pickout=/tmp/mk_unicode_composition_tbl$$.awk +pickout2=/tmp/mk_unicode_composition_tbl2$$.awk +#nfdtmp=/tmp/mk_unicode_decomposition_tmp$$.txt +nfdtmp="nfdtmpx" ################################################################################# # # Append the file header of "archive_string_composition.h" @@ -14,7 +17,7 @@ append_copyright() { cat > ${outfile} < ${outfile} < NFD table. + if (length(\$1) == 4) + print "0"\$1, "0"cp[1], "0"cp[2] >>nfdtbl + else + print \$1, cp[1], cp[2] >>nfdtbl +} +AWK_END +################################################################################# +# awk script +# +################################################################################# +cat > ${pickout2} <> ${outfile} +awk -f ${pickout2} ${nfdtmp} >> ${outfile} +echo "#endif /* ARCHIVE_STRING_COMPOSITION_H_INCLUDED */" >> ${outfile} +echo "" >> ${outfile} # # Remove awk the script. rm ${pickout} +rm ${pickout2} +rm ${nfdtmp} Modified: vendor/libarchive/dist/build/version ============================================================================== --- vendor/libarchive/dist/build/version Fri Jul 27 05:48:42 2012 (r238824) +++ vendor/libarchive/dist/build/version Fri Jul 27 08:24:12 2012 (r238825) @@ -1 +1 @@ -3000003 +3000004 Modified: vendor/libarchive/dist/configure.ac ============================================================================== --- vendor/libarchive/dist/configure.ac Fri Jul 27 05:48:42 2012 (r238824) +++ vendor/libarchive/dist/configure.ac Fri Jul 27 08:24:12 2012 (r238825) @@ -4,8 +4,8 @@ dnl First, define all of the version num dnl In particular, this allows the version macro to be used in AC_INIT dnl These first two version numbers are updated automatically on each release. -m4_define([LIBARCHIVE_VERSION_S],[3.0.3]) -m4_define([LIBARCHIVE_VERSION_N],[3000003]) +m4_define([LIBARCHIVE_VERSION_S],[3.0.4]) +m4_define([LIBARCHIVE_VERSION_N],[3000004]) dnl bsdtar and bsdcpio versioning tracks libarchive m4_define([BSDTAR_VERSION_S],LIBARCHIVE_VERSION_S()) @@ -17,7 +17,7 @@ AC_PREREQ(2.65) # Now starts the "real" configure script. # -AC_INIT([libarchive],LIBARCHIVE_VERSION_S(),[kientzle@FreeBSD.org]) +AC_INIT([libarchive],LIBARCHIVE_VERSION_S(),[libarchive-discuss@googlegroups.com]) # Make sure the srcdir contains "libarchive" directory AC_CONFIG_SRCDIR([libarchive]) # Use auxiliary subscripts from this subdirectory (cleans up root) @@ -197,13 +197,6 @@ case $host in ;; esac -# We need CoreServices on Mac OS. -case $host in - *darwin* ) - LIBS="${LIBS} -framework CoreServices" - ;; -esac - # Checks for header files. AC_HEADER_DIRENT AC_HEADER_SYS_WAIT @@ -223,7 +216,7 @@ AS_VAR_IF([ac_cv_have_decl_EXT2_IOC_GETF [Define to 1 if you have a working EXT2_IOC_GETFLAGS])]) AC_CHECK_HEADERS([inttypes.h io.h langinfo.h limits.h]) -AC_CHECK_HEADERS([linux/fiemap.h linux/fs.h linux/magic.h]) +AC_CHECK_HEADERS([linux/fiemap.h linux/fs.h linux/magic.h linux/types.h]) AC_CHECK_HEADERS([locale.h paths.h poll.h pwd.h regex.h signal.h stdarg.h]) AC_CHECK_HEADERS([stdint.h stdlib.h string.h]) AC_CHECK_HEADERS([sys/acl.h sys/cdefs.h sys/extattr.h sys/ioctl.h]) @@ -268,8 +261,8 @@ AC_ARG_WITH([iconv], AS_HELP_STRING([--without-iconv], [Don't try to link against iconv])) if test "x$with_iconv" != "xno"; then - AC_CHECK_HEADERS([iconv.h],[],[],[#include ]) AM_ICONV + AC_CHECK_HEADERS([iconv.h],[],[],[#include ]) if test "x$am_cv_func_iconv" = "xyes"; then AC_CHECK_HEADERS([localcharset.h]) am_save_LIBS="$LIBS" @@ -364,6 +357,12 @@ AC_CHECK_MEMBERS([struct statfs.f_namema #include ]) +# Check for f_iosize in struct statvfs +AC_CHECK_MEMBERS([struct statvfs.f_iosize],,, +[ +#include +]) + # Check for birthtime in struct stat AC_CHECK_MEMBERS([struct stat.st_birthtime]) @@ -440,13 +439,13 @@ AC_CHECK_FUNCS([futimens futimes futimes AC_CHECK_FUNCS([geteuid getpid getgrgid_r getgrnam_r]) AC_CHECK_FUNCS([getpwnam_r getpwuid_r getvfsbyname gmtime_r]) AC_CHECK_FUNCS([lchflags lchmod lchown link localtime_r lstat lutimes]) -AC_CHECK_FUNCS([mbrtowc mbsnrtowcs memmove memset]) +AC_CHECK_FUNCS([mbrtowc memmove memset]) AC_CHECK_FUNCS([mkdir mkfifo mknod mkstemp]) AC_CHECK_FUNCS([nl_langinfo openat pipe poll readlink readlinkat]) AC_CHECK_FUNCS([select setenv setlocale sigaction statfs statvfs]) AC_CHECK_FUNCS([strchr strdup strerror strncpy_s strrchr symlink timegm]) AC_CHECK_FUNCS([tzset unsetenv utime utimensat utimes vfork]) -AC_CHECK_FUNCS([wcrtomb wcscmp wcscpy wcslen wcsnrtombs wctomb wmemcmp wmemcpy]) +AC_CHECK_FUNCS([wcrtomb wcscmp wcscpy wcslen wctomb wmemcmp wmemcpy]) AC_CHECK_FUNCS([_ctime64_s _fseeki64]) AC_CHECK_FUNCS([_get_timezone _localtime64_s _mkgmtime64]) # detects cygwin-1.7, as opposed to older versions Modified: vendor/libarchive/dist/cpio/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/cpio/CMakeLists.txt Fri Jul 27 05:48:42 2012 (r238824) +++ vendor/libarchive/dist/cpio/CMakeLists.txt Fri Jul 27 08:24:12 2012 (r238825) @@ -15,10 +15,6 @@ IF(ENABLE_CPIO) ../libarchive_fe/lafe_platform.h ../libarchive_fe/line_reader.c ../libarchive_fe/line_reader.h - ../libarchive_fe/matching.c - ../libarchive_fe/matching.h - ../libarchive_fe/pathmatch.c *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 08:28:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 83C62106564A; Fri, 27 Jul 2012 08:28:45 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E8CD8FC17; Fri, 27 Jul 2012 08:28: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 q6R8SjZ0082983; Fri, 27 Jul 2012 08:28:45 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6R8Sjbw082980; Fri, 27 Jul 2012 08:28:45 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207270828.q6R8Sjbw082980@svn.freebsd.org> From: Martin Matuska Date: Fri, 27 Jul 2012 08:28:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238827 - head/contrib/libarchive X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 08:28:45 -0000 Author: mm Date: Fri Jul 27 08:28:44 2012 New Revision: 238827 URL: http://svn.freebsd.org/changeset/base/238827 Log: Update information on obtaining libarchive sources and FreeBSD-Xlist Modified: head/contrib/libarchive/FREEBSD-Xlist (contents, props changed) head/contrib/libarchive/FREEBSD-upgrade Modified: head/contrib/libarchive/FREEBSD-Xlist ============================================================================== --- head/contrib/libarchive/FREEBSD-Xlist Fri Jul 27 08:25:37 2012 (r238826) +++ head/contrib/libarchive/FREEBSD-Xlist Fri Jul 27 08:28:44 2012 (r238827) @@ -1,4 +1,6 @@ -$FreeBSD$ +.git +.gitattributes +.gitignore CMakeLists.txt CTestConfig.cmake INSTALL Modified: head/contrib/libarchive/FREEBSD-upgrade ============================================================================== --- head/contrib/libarchive/FREEBSD-upgrade Fri Jul 27 08:25:37 2012 (r238826) +++ head/contrib/libarchive/FREEBSD-upgrade Fri Jul 27 08:28:44 2012 (r238827) @@ -2,9 +2,9 @@ $FreeBSD$ libarchive -The source code is pulled with svn: +The source code is pulled with git: - svn checkout http://libarchive.googlecode.com/svn/release/2.8 + git clone -b release git://github.com/libarchive/libarchive.git For the contrib directory files and directories were pruned by: @@ -21,4 +21,4 @@ To make local changes to libarchive, sim branch (aka HEAD). Never make local changes on the vendor branch. mm@FreeBSD.org -21-December-2011 +27-July-2012 From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 08:35:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B8257106566B; Fri, 27 Jul 2012 08:35:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 111618FC0A; Fri, 27 Jul 2012 08:35:54 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6R8Zfvp054808; Fri, 27 Jul 2012 11:35:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6R8ZTCD003550; Fri, 27 Jul 2012 11:35:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6R8ZTxl003549; Fri, 27 Jul 2012 11:35:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 27 Jul 2012 11:35:29 +0300 From: Konstantin Belousov To: Peter Grehan Message-ID: <20120727083529.GA2676@deviant.kiev.zoral.com.ua> References: <500FE6AE.8070706@FreeBSD.org> <20120726001659.M5406@besplex.bde.org> <50102C94.9030706@FreeBSD.org> <20120725180537.GO2676@deviant.kiev.zoral.com.ua> <50103C61.8040904@FreeBSD.org> <20120726170837.Q2536@besplex.bde.org> <20120726104918.GW2676@deviant.kiev.zoral.com.ua> <20120726213001.K3621@besplex.bde.org> <20120726175947.GZ2676@deviant.kiev.zoral.com.ua> <5011901B.1060008@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2A9w/LA8eksItR+6" Content-Disposition: inline In-Reply-To: <5011901B.1060008@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Jim Harris , src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , Bruce Evans , svn-src-head@freebsd.org, Jung-uk Kim Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 08:35:55 -0000 --2A9w/LA8eksItR+6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 26, 2012 at 12:44:43PM -0600, Peter Grehan wrote: > >Yes, CPUID or LFENCE is enough to fix the failure. >=20 > CPUID causes an unconditional exit in VT-x/SVM so it would be best to=20 > avoid that if possible. The only place where the use of CPUID in tsc patch seems to be reasonable is at the SMP test, since it is too much burden to check SSE2/Intel/AMD nuances at the boot time, to be redone later anyway. Would it be a serious issue for monitors to get several thousands of CPUID traps at boot only ? --2A9w/LA8eksItR+6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlASUtAACgkQC3+MBN1Mb4ht5ACgzge7DMx6jbg6iSoflK/yARnf SfAAn15zcRoGLf9N3c4mf4jdl2gGwnHt =rxY/ -----END PGP SIGNATURE----- --2A9w/LA8eksItR+6-- From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 09:16:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 279C0106566B; Fri, 27 Jul 2012 09:16:49 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12B2D8FC0A; Fri, 27 Jul 2012 09:16:49 +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 q6R9GmOI086650; Fri, 27 Jul 2012 09:16:48 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6R9Gm23086648; Fri, 27 Jul 2012 09:16:48 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201207270916.q6R9Gm23086648@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 27 Jul 2012 09:16:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238828 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 09:16:49 -0000 Author: glebius Date: Fri Jul 27 09:16:48 2012 New Revision: 238828 URL: http://svn.freebsd.org/changeset/base/238828 Log: Add assertion for refcount overflow. Submitted by: Andrey Zonov Reviewed by: kib Modified: head/sys/sys/refcount.h Modified: head/sys/sys/refcount.h ============================================================================== --- head/sys/sys/refcount.h Fri Jul 27 08:28:44 2012 (r238827) +++ head/sys/sys/refcount.h Fri Jul 27 09:16:48 2012 (r238828) @@ -32,6 +32,7 @@ #ifndef __SYS_REFCOUNT_H__ #define __SYS_REFCOUNT_H__ +#include #include #ifdef _KERNEL @@ -51,6 +52,7 @@ static __inline void refcount_acquire(volatile u_int *count) { + KASSERT(*count < UINT_MAX, ("refcount %p overflowed", count)); atomic_add_acq_int(count, 1); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 09:35:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1DBA3106566B; Fri, 27 Jul 2012 09:35:07 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0679D8FC1A; Fri, 27 Jul 2012 09:35:07 +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 q6R9Z6wa088182; Fri, 27 Jul 2012 09:35:06 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6R9Z6ZP088180; Fri, 27 Jul 2012 09:35:06 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201207270935.q6R9Z6ZP088180@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 27 Jul 2012 09:35:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238829 - stable/9/usr.sbin/pkg X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 09:35:07 -0000 Author: bapt Date: Fri Jul 27 09:35:06 2012 New Revision: 238829 URL: http://svn.freebsd.org/changeset/base/238829 Log: MFC: r238461 Make pkg bootstrap program ask for confirmation before proceeding. The previous behaviour was to silently download and install the pkg package, without ever telling user about what it was doing and why. Approved by: re, des (mentor) Modified: stable/9/usr.sbin/pkg/pkg.c Directory Properties: stable/9/usr.sbin/pkg/ (props changed) Modified: stable/9/usr.sbin/pkg/pkg.c ============================================================================== --- stable/9/usr.sbin/pkg/pkg.c Fri Jul 27 09:16:48 2012 (r238828) +++ stable/9/usr.sbin/pkg/pkg.c Fri Jul 27 09:35:06 2012 (r238829) @@ -389,6 +389,28 @@ cleanup: return (ret); } +static const char confirmation_message[] = +"The package management tool is not yet installed on your system.\n" +"Do you want to fetch and install it now? [y/N]: "; + +static int +pkg_query_yes_no(void) +{ + int ret, c; + + c = getchar(); + + if (c == 'y' || c == 'Y') + ret = 1; + else + ret = 0; + + while (c != '\n' && c != EOF) + c = getchar(); + + return (ret); +} + int main(__unused int argc, char *argv[]) { @@ -397,9 +419,21 @@ main(__unused int argc, char *argv[]) snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg", getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE); - if (access(pkgpath, X_OK) == -1) + if (access(pkgpath, X_OK) == -1) { + /* + * Do not ask for confirmation if either of stdin or stdout is + * not tty. Check the environment to see if user has answer + * tucked in there already. + */ + if (getenv("ALWAYS_ASSUME_YES") == NULL && + isatty(fileno(stdin))) { + printf("%s", confirmation_message); + if (pkg_query_yes_no() == 0) + exit(EXIT_FAILURE); + } if (bootstrap_pkg() != 0) exit(EXIT_FAILURE); + } execv(pkgpath, argv); From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 10:31:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B3ED1065673; Fri, 27 Jul 2012 10:31:27 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E11C18FC14; Fri, 27 Jul 2012 10:31: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 q6RAVQQN094740; Fri, 27 Jul 2012 10:31:26 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RAVQ0W094737; Fri, 27 Jul 2012 10:31:26 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201207271031.q6RAVQ0W094737@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 27 Jul 2012 10:31:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238831 - head/sys/dev/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 10:31:27 -0000 Author: luigi Date: Fri Jul 27 10:31:26 2012 New Revision: 238831 URL: http://svn.freebsd.org/changeset/base/238831 Log: remove unused definition, whitespace cleanup Modified: head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Fri Jul 27 10:06:47 2012 (r238830) +++ head/sys/dev/netmap/netmap_kern.h Fri Jul 27 10:31:26 2012 (r238831) @@ -62,9 +62,9 @@ * For the 32-bit value, 0x100000 (bit 20) has no clashes up to 3.3.1 */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) -#define IFCAP_NETMAP 0x8000 +#define IFCAP_NETMAP 0x8000 #else -#define IFCAP_NETMAP 0x100000 +#define IFCAP_NETMAP 0x100000 #endif #elif defined (__APPLE__) @@ -94,9 +94,6 @@ MALLOC_DECLARE(M_NETMAP); __FUNCTION__, __LINE__, ##__VA_ARGS__); \ } while (0) -#ifndef IFF_NETMAP /* XXX is it really needed ? */ -#define IFF_NETMAP 0x20000 -#endif struct netmap_adapter; /* @@ -310,8 +307,8 @@ netmap_reload_map(bus_dma_tag_t tag, bus * XXX How do we redefine these functions: * * on linux we need - * dma_map_single(&pdev->dev, virt_addr, len, direction) - * dma_unmap_single(&adapter->pdev->dev, phys_addr, len, direction + * dma_map_single(&pdev->dev, virt_addr, len, direction) + * dma_unmap_single(&adapter->pdev->dev, phys_addr, len, direction * The len can be implicit (on netmap it is NETMAP_BUF_SIZE) * unfortunately the direction is not, so we need to change * something to have a cross API @@ -327,9 +324,9 @@ netmap_reload_map(bus_dma_tag_t tag, bus //buffer_info->next_to_watch = l; /* reload dma map */ dma_unmap_single(&adapter->pdev->dev, buffer_info->dma, - NETMAP_BUF_SIZE, DMA_TO_DEVICE); + NETMAP_BUF_SIZE, DMA_TO_DEVICE); buffer_info->dma = dma_map_single(&adapter->pdev->dev, - addr, NETMAP_BUF_SIZE, DMA_TO_DEVICE); + addr, NETMAP_BUF_SIZE, DMA_TO_DEVICE); if (dma_mapping_error(&adapter->pdev->dev, buffer_info->dma)) { D("dma mapping error"); From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 10:38:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E291B106566B; Fri, 27 Jul 2012 10:38:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD4B58FC16; Fri, 27 Jul 2012 10:38: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 q6RAcHlX095364; Fri, 27 Jul 2012 10:38:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RAcHjv095362; Fri, 27 Jul 2012 10:38:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207271038.q6RAcHjv095362@svn.freebsd.org> From: Adrian Chadd Date: Fri, 27 Jul 2012 10:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238832 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 10:38:18 -0000 Author: adrian Date: Fri Jul 27 10:38:17 2012 New Revision: 238832 URL: http://svn.freebsd.org/changeset/base/238832 Log: Modify ath_descdma_cleanup() to handle ath_descdma instances with no buffers. ath_descdma is now being used for things other than the classical combination of ath_buf + ath_desc allocations. In this particular case, don't try to free and blank out the ath_buf list if it's not passed in. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Jul 27 10:31:26 2012 (r238831) +++ head/sys/dev/ath/if_ath.c Fri Jul 27 10:38:17 2012 (r238832) @@ -3021,27 +3021,32 @@ ath_descdma_cleanup(struct ath_softc *sc bus_dma_tag_destroy(dd->dd_dmat); } - TAILQ_FOREACH(bf, head, bf_list) { - if (bf->bf_m) { - m_freem(bf->bf_m); - bf->bf_m = NULL; - } - if (bf->bf_dmamap != NULL) { - bus_dmamap_destroy(sc->sc_dmat, bf->bf_dmamap); - bf->bf_dmamap = NULL; - } - ni = bf->bf_node; - bf->bf_node = NULL; - if (ni != NULL) { - /* - * Reclaim node reference. - */ - ieee80211_free_node(ni); + if (head != NULL) { + TAILQ_FOREACH(bf, head, bf_list) { + if (bf->bf_m) { + m_freem(bf->bf_m); + bf->bf_m = NULL; + } + if (bf->bf_dmamap != NULL) { + bus_dmamap_destroy(sc->sc_dmat, bf->bf_dmamap); + bf->bf_dmamap = NULL; + } + ni = bf->bf_node; + bf->bf_node = NULL; + if (ni != NULL) { + /* + * Reclaim node reference. + */ + ieee80211_free_node(ni); + } } } - TAILQ_INIT(head); - free(dd->dd_bufptr, M_ATHDEV); + if (head != NULL) + TAILQ_INIT(head); + + if (dd->dd_bufptr != NULL) + free(dd->dd_bufptr, M_ATHDEV); memset(dd, 0, sizeof(*dd)); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 10:39:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B04C01065673; Fri, 27 Jul 2012 10:39:30 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82C188FC08; Fri, 27 Jul 2012 10:39:30 +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 q6RAdU3q095491; Fri, 27 Jul 2012 10:39:30 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RAdUwU095490; Fri, 27 Jul 2012 10:39:30 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207271039.q6RAdUwU095490@svn.freebsd.org> From: Martin Matuska Date: Fri, 27 Jul 2012 10:39:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238833 - vendor/libarchive/3.0.4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 10:39:30 -0000 Author: mm Date: Fri Jul 27 10:39:30 2012 New Revision: 238833 URL: http://svn.freebsd.org/changeset/base/238833 Log: Tag vendor/libarchive/dist as 3.0.4 Added: vendor/libarchive/3.0.4/ - copied from r238825, vendor/libarchive/dist/ From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 10:41:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DA92106566C; Fri, 27 Jul 2012 10:41:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 180638FC14; Fri, 27 Jul 2012 10:41: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 q6RAfAuD095655; Fri, 27 Jul 2012 10:41:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RAfA2k095652; Fri, 27 Jul 2012 10:41:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207271041.q6RAfA2k095652@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 27 Jul 2012 10:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238834 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 10:41:11 -0000 Author: kib Date: Fri Jul 27 10:41:10 2012 New Revision: 238834 URL: http://svn.freebsd.org/changeset/base/238834 Log: Add F_DUP2FD_CLOEXEC. Apparently Solaris 11 already did this. Submitted by: Jukka A. Ukkonen PR: standards/169962 MFC after: 1 week Modified: head/sys/kern/kern_descrip.c head/sys/sys/fcntl.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Jul 27 10:39:30 2012 (r238833) +++ head/sys/kern/kern_descrip.c Fri Jul 27 10:41:10 2012 (r238834) @@ -491,6 +491,12 @@ kern_fcntl(struct thread *td, int fd, in error = do_dup(td, DUP_FIXED, fd, tmp, td->td_retval); break; + case F_DUP2FD_CLOEXEC: + tmp = arg; + error = do_dup(td, DUP_FIXED | DUP_CLOEXEC, fd, tmp, + td->td_retval); + break; + case F_GETFD: FILEDESC_SLOCK(fdp); if ((fp = fget_locked(fdp, fd)) == NULL) { @@ -849,6 +855,8 @@ do_dup(struct thread *td, int flags, int } if (flags & DUP_FIXED && old == new) { *retval = new; + if (flags & DUP_CLOEXEC) + fdp->fd_ofileflags[new] |= UF_EXCLOSE; FILEDESC_XUNLOCK(fdp); return (0); } Modified: head/sys/sys/fcntl.h ============================================================================== --- head/sys/sys/fcntl.h Fri Jul 27 10:39:30 2012 (r238833) +++ head/sys/sys/fcntl.h Fri Jul 27 10:41:10 2012 (r238834) @@ -232,6 +232,9 @@ typedef __pid_t pid_t; #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 #define F_DUPFD_CLOEXEC 17 /* Like F_DUPFD, but FD_CLOEXEC is set */ #endif +#if __BSD_VISIBLE +#define F_DUP2FD_CLOEXEC 18 /* Like F_DUP2FD, but FD_CLOEXEC is set */ +#endif /* file descriptor flags (F_GETFD, F_SETFD) */ #define FD_CLOEXEC 1 /* close-on-exec flag */ From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 10:41:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F27EF106566B; Fri, 27 Jul 2012 10:41:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD3748FC0A; Fri, 27 Jul 2012 10:41: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 q6RAfrJv095740; Fri, 27 Jul 2012 10:41:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RAfrmR095738; Fri, 27 Jul 2012 10:41:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201207271041.q6RAfrmR095738@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 27 Jul 2012 10:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238835 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 10:41:54 -0000 Author: kib Date: Fri Jul 27 10:41:53 2012 New Revision: 238835 URL: http://svn.freebsd.org/changeset/base/238835 Log: Document F_DUP2FD_CLOEXEC. MFC after: 1 week Modified: head/lib/libc/sys/fcntl.2 Modified: head/lib/libc/sys/fcntl.2 ============================================================================== --- head/lib/libc/sys/fcntl.2 Fri Jul 27 10:41:10 2012 (r238834) +++ head/lib/libc/sys/fcntl.2 Fri Jul 27 10:41:53 2012 (r238835) @@ -28,7 +28,7 @@ .\" @(#)fcntl.2 8.2 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd July 18, 2012 +.Dd July 27, 2012 .Dt FCNTL 2 .Os .Sh NAME @@ -54,7 +54,7 @@ Depending on the value of .Fn fcntl can take an additional third argument .Fa "int arg" . -.Bl -tag -width F_DUPFD_CLOEXEC +.Bl -tag -width F_DUP2FD_CLOEXEC .It Dv F_DUPFD Return a new descriptor as follows: .Pp @@ -94,13 +94,23 @@ It is functionally equivalent to .Bd -literal -offset indent dup2(fd, arg) .Ed +.It Dv F_DU2PFD_CLOEXEC +Like +.Dv F_DUP2FD , +but the +.Dv FD_CLOEXEC +flag associated with the new file descriptor is set. .Pp The .Dv F_DUP2FD -constant is not portable, so it should not be used if portability is needed. +and +.Dv F_DUP2DF_CLOEXEC +constants are not portable, so they should not be used if +portability is needed. Use .Fn dup2 -instead. +instead of +.Dv F_DUP2FD . .It Dv F_GETFD Get the close-on-exec flag associated with the file descriptor .Fa fd From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 10:41:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51572106564A; Fri, 27 Jul 2012 10:41:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22EF08FC12; Fri, 27 Jul 2012 10:41: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 q6RAfsFh095774; Fri, 27 Jul 2012 10:41:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RAfs81095771; Fri, 27 Jul 2012 10:41:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207271041.q6RAfs81095771@svn.freebsd.org> From: Adrian Chadd Date: Fri, 27 Jul 2012 10:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238836 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 10:41:55 -0000 Author: adrian Date: Fri Jul 27 10:41:54 2012 New Revision: 238836 URL: http://svn.freebsd.org/changeset/base/238836 Log: Allocate a descriptor ring for EDMA TX completion status. Configure the hardware with said ring physical address and size. Modified: head/sys/dev/ath/if_ath_tx_edma.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Fri Jul 27 10:41:53 2012 (r238835) +++ head/sys/dev/ath/if_ath_tx_edma.c Fri Jul 27 10:41:54 2012 (r238836) @@ -119,17 +119,33 @@ __FBSDID("$FreeBSD$"); /* * some general macros - */ + */ #define INCR(_l, _sz) (_l) ++; (_l) &= ((_sz) - 1) #define DECR(_l, _sz) (_l) --; (_l) &= ((_sz) - 1) +/* + * XXX doesn't belong here, and should be tunable + */ +#define ATH_TXSTATUS_RING_SIZE 512 + MALLOC_DECLARE(M_ATHDEV); static int ath_edma_dma_txsetup(struct ath_softc *sc) { + int error; + + error = ath_descdma_alloc_desc(sc, &sc->sc_txsdma, + NULL, "txcomp", sc->sc_tx_statuslen, ATH_TXSTATUS_RING_SIZE); + if (error != 0) + return (error); + + ath_hal_setuptxstatusring(sc->sc_ah, + (void *) sc->sc_txsdma.dd_desc, + sc->sc_txsdma.dd_desc_paddr, + ATH_TXSTATUS_RING_SIZE); + - /* XXX placeholder */ return (0); } @@ -137,7 +153,7 @@ static int ath_edma_dma_txteardown(struct ath_softc *sc) { - /* XXX placeholder */ + ath_descdma_cleanup(sc, &sc->sc_txsdma, NULL); return (0); } Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Fri Jul 27 10:41:53 2012 (r238835) +++ head/sys/dev/ath/if_athvar.h Fri Jul 27 10:41:54 2012 (r238836) @@ -557,6 +557,7 @@ struct ath_softc { int sc_txbuf_cnt; /* how many buffers avail */ struct ath_descdma sc_txdma_mgmt; /* mgmt TX descriptors */ ath_bufhead sc_txbuf_mgmt; /* mgmt transmit buffer */ + struct ath_descdma sc_txsdma; /* EDMA TX status desc's */ struct mtx sc_txbuflock; /* txbuf lock */ char sc_txname[12]; /* e.g. "ath0_buf" */ u_int sc_txqsetup; /* h/w queues setup */ From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 10:52:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE826106564A; Fri, 27 Jul 2012 10:52:21 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C89FC8FC0C; Fri, 27 Jul 2012 10:52:21 +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 q6RAqLe2096610; Fri, 27 Jul 2012 10:52:21 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RAqLxV096608; Fri, 27 Jul 2012 10:52:21 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201207271052.q6RAqLxV096608@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 27 Jul 2012 10:52:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238837 - head/sys/dev/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 10:52:22 -0000 Author: luigi Date: Fri Jul 27 10:52:21 2012 New Revision: 238837 URL: http://svn.freebsd.org/changeset/base/238837 Log: use __builtin_prefetch() for prefetch. merge in the remaining part of the linux-specific glue so i do not need to maintain two different distributions. Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Fri Jul 27 10:41:54 2012 (r238836) +++ head/sys/dev/netmap/netmap.c Fri Jul 27 10:52:21 2012 (r238837) @@ -58,9 +58,11 @@ #include "bsd_glue.h" static netdev_tx_t netmap_start_linux(struct sk_buff *skb, struct net_device *dev); #endif /* linux */ + #ifdef __APPLE__ #include "osx_glue.h" -#endif +#endif /* __APPLE__ */ + #ifdef __FreeBSD__ #include /* prerequisite */ __FBSDID("$FreeBSD$"); @@ -155,6 +157,7 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, copy, #define NM_BRIDGES 4 /* number of bridges */ int netmap_bridge = NM_BDG_BATCH; /* bridge batch size */ SYSCTL_INT(_dev_netmap, OID_AUTO, bridge, CTLFLAG_RW, &netmap_bridge, 0 , ""); + #ifdef linux #define ADD_BDG_REF(ifp) (NA(ifp)->if_refcount++) #define DROP_BDG_REF(ifp) (NA(ifp)->if_refcount-- <= 1) @@ -165,6 +168,7 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, bridge #include #include #endif /* __FreeBSD__ */ +#define prefetch(x) __builtin_prefetch(x) #endif /* !linux */ static void bdg_netmap_attach(struct ifnet *ifp); @@ -175,12 +179,6 @@ struct nm_bdg_fwd { /* forwarding entry uint64_t dst; /* dst mask */ uint32_t src; /* src index ? */ uint16_t len; /* src len */ -#if 0 - uint64_t src_mac; /* ignore 2 MSBytes */ - uint64_t dst_mac; /* ignore 2 MSBytes */ - uint32_t dst_idx; /* dst index in fwd table */ - uint32_t dst_buf; /* where we copy to */ -#endif }; struct nm_hash_ent { @@ -217,17 +215,6 @@ struct nm_bridge nm_bridges[NM_BRIDGES]; * NA(ifp)->bdg_port port index */ -#ifndef linux -static inline void prefetch (const void *x) -{ -#if defined(__i386__) || defined(__amd64__) - __asm volatile("prefetcht0 %0" :: "m" (*(const unsigned long *)x)); -#else - (void)x; -#endif -} -#endif /* !linux */ - // XXX only for multiples of 64 bytes, non overlapped. static inline void pkt_copy(void *_src, void *_dst, int l) @@ -540,15 +527,19 @@ netmap_sync_to_host(struct netmap_adapte * * This routine also does the selrecord if called from the poll handler * (we know because td != NULL). + * + * NOTE: on linux, selrecord() is defined as a macro and uses pwait + * as an additional hidden argument. */ static void -netmap_sync_from_host(struct netmap_adapter *na, struct thread *td) +netmap_sync_from_host(struct netmap_adapter *na, struct thread *td, void *pwait) { struct netmap_kring *kring = &na->rx_rings[na->num_rx_rings]; struct netmap_ring *ring = kring->ring; u_int j, n, lim = kring->nkr_num_slots; u_int k = ring->cur, resvd = ring->reserved; + (void)pwait; /* disable unused warnings */ na->nm_lock(na->ifp, NETMAP_CORE_LOCK, 0); if (k >= lim) { netmap_ring_reinit(kring); @@ -953,7 +944,7 @@ error: if (cmd == NIOCTXSYNC) netmap_sync_to_host(na); else - netmap_sync_from_host(na, NULL); + netmap_sync_from_host(na, NULL, NULL); break; } /* find the last ring to scan */ @@ -1025,13 +1016,12 @@ error: * Device-dependent parts (locking and sync of tx/rx rings) * are done through callbacks. * - * On linux, pwait is the poll table. - * If pwait == NULL someone else already woke up before. We can report - * events but they are filtered upstream. - * If pwait != NULL, then pwait->key contains the list of events. + * On linux, arguments are really pwait, the poll table, and 'td' is struct file * + * The first one is remapped to pwait as selrecord() uses the name as an + * hidden argument. */ static int -netmap_poll(__unused struct cdev *dev, int events, struct thread *td) +netmap_poll(struct cdev *dev, int events, struct thread *td) { struct netmap_priv_d *priv = NULL; struct netmap_adapter *na; @@ -1040,6 +1030,9 @@ netmap_poll(__unused struct cdev *dev, i u_int core_lock, i, check_all, want_tx, want_rx, revents = 0; u_int lim_tx, lim_rx; enum {NO_CL, NEED_CL, LOCKED_CL }; /* see below */ + void *pwait = dev; /* linux compatibility */ + + (void)pwait; if (devfs_get_cdevpriv((void **)&priv) != 0 || priv == NULL) return POLLERR; @@ -1069,7 +1062,7 @@ netmap_poll(__unused struct cdev *dev, i if (want_rx) { kring = &na->rx_rings[lim_rx]; if (kring->ring->avail == 0) - netmap_sync_from_host(na, td); + netmap_sync_from_host(na, td, dev); if (kring->ring->avail > 0) { revents |= want_rx; } @@ -1535,6 +1528,146 @@ netmap_rx_irq(struct ifnet *ifp, int q, } +#ifdef linux /* linux-specific routines */ + +/* + * Remap linux arguments into the FreeBSD call. + * - pwait is the poll table, passed as 'dev'; + * If pwait == NULL someone else already woke up before. We can report + * events but they are filtered upstream. + * If pwait != NULL, then pwait->key contains the list of events. + * - events is computed from pwait as above. + * - file is passed as 'td'; + */ +static u_int +linux_netmap_poll(struct file * file, struct poll_table_struct *pwait) +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0) + int events = pwait ? pwait->key : POLLIN | POLLOUT; +#else /* in 3.4.0 field 'key' was renamed to '_key' */ + int events = pwait ? pwait->_key : POLLIN | POLLOUT; +#endif + return netmap_poll((void *)pwait, events, (void *)file); +} + +static int +netmap_mmap(__unused struct file *f, struct vm_area_struct *vma) +{ + int lut_skip, i, j; + int user_skip = 0; + struct lut_entry *l_entry; + const struct netmap_obj_pool *p[] = { + nm_mem->nm_if_pool, + nm_mem->nm_ring_pool, + nm_mem->nm_buf_pool }; + /* + * vma->vm_start: start of mapping user address space + * vma->vm_end: end of the mapping user address space + */ + + // XXX security checks + + for (i = 0; i < 3; i++) { /* loop through obj_pools */ + /* + * In each pool memory is allocated in clusters + * of size _clustsize , each containing clustentries + * entries. For each object k we already store the + * vtophys malling in lut[k] so we use that, scanning + * the lut[] array in steps of clustentries, + * and we map each cluster (not individual pages, + * it would be overkill). + */ + for (lut_skip = 0, j = 0; j < p[i]->_numclusters; j++) { + l_entry = &p[i]->lut[lut_skip]; + if (remap_pfn_range(vma, vma->vm_start + user_skip, + l_entry->paddr >> PAGE_SHIFT, p[i]->_clustsize, + vma->vm_page_prot)) + return -EAGAIN; // XXX check return value + lut_skip += p[i]->clustentries; + user_skip += p[i]->_clustsize; + } + } + + return 0; +} + +static netdev_tx_t +netmap_start_linux(struct sk_buff *skb, struct net_device *dev) +{ + netmap_start(dev, skb); + return (NETDEV_TX_OK); +} + + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) +#define LIN_IOCTL_NAME .ioctl +int +linux_netmap_ioctl(struct inode *inode, struct file *file, u_int cmd, u_long data /* arg */) +#else +#define LIN_IOCTL_NAME .unlocked_ioctl +long +linux_netmap_ioctl(struct file *file, u_int cmd, u_long data /* arg */) +#endif +{ + int ret; + struct nmreq nmr; + bzero(&nmr, sizeof(nmr)); + + if (data && copy_from_user(&nmr, (void *)data, sizeof(nmr) ) != 0) + return -EFAULT; + ret = netmap_ioctl(NULL, cmd, (caddr_t)&nmr, 0, (void *)file); + if (data && copy_to_user((void*)data, &nmr, sizeof(nmr) ) != 0) + return -EFAULT; + return -ret; +} + + +static int +netmap_release(__unused struct inode *inode, struct file *file) +{ + if (file->private_data) + netmap_dtor(file->private_data); + return (0); +} + + +static struct file_operations netmap_fops = { + .mmap = netmap_mmap, + LIN_IOCTL_NAME = linux_netmap_ioctl, + .poll = linux_netmap_poll, + .release = netmap_release, +}; + +static struct miscdevice netmap_cdevsw = { /* same name as FreeBSD */ + MISC_DYNAMIC_MINOR, + "netmap", + &netmap_fops, +}; + +static int netmap_init(void); +static void netmap_fini(void); + +module_init(netmap_init); +module_exit(netmap_fini); +/* export certain symbols to other modules */ +EXPORT_SYMBOL(netmap_attach); // driver attach routines +EXPORT_SYMBOL(netmap_detach); // driver detach routines +EXPORT_SYMBOL(netmap_ring_reinit); // ring init on error +EXPORT_SYMBOL(netmap_buffer_lut); +EXPORT_SYMBOL(netmap_total_buffers); // index check +EXPORT_SYMBOL(netmap_buffer_base); +EXPORT_SYMBOL(netmap_reset); // ring init routines +EXPORT_SYMBOL(netmap_buf_size); +EXPORT_SYMBOL(netmap_rx_irq); // default irq handler +EXPORT_SYMBOL(netmap_no_pendintr); // XXX mitigation - should go away + + +MODULE_AUTHOR("http://info.iet.unipi.it/~luigi/netmap/"); +MODULE_DESCRIPTION("The netmap packet I/O framework"); +MODULE_LICENSE("Dual BSD/GPL"); /* the code here is all BSD. */ + +#else /* __FreeBSD__ */ + static struct cdevsw netmap_cdevsw = { .d_version = D_VERSION, .d_name = "netmap", @@ -1542,6 +1675,7 @@ static struct cdevsw netmap_cdevsw = { .d_ioctl = netmap_ioctl, .d_poll = netmap_poll, }; +#endif /* __FreeBSD__ */ #ifdef NM_BRIDGE /* From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 10:57:16 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21059106566C; Fri, 27 Jul 2012 10:57:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id AD2DD8FC08; Fri, 27 Jul 2012 10:57:15 +0000 (UTC) Received: from c122-106-171-246.carlnfd1.nsw.optusnet.com.au (c122-106-171-246.carlnfd1.nsw.optusnet.com.au [122.106.171.246]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q6RAvC6Z031169 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Jul 2012 20:57:13 +1000 Date: Fri, 27 Jul 2012 20:57:12 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Gleb Smirnoff In-Reply-To: <201207270916.q6R9Gm23086648@svn.freebsd.org> Message-ID: <20120727201736.O6703@besplex.bde.org> References: <201207270916.q6R9Gm23086648@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238828 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 10:57:16 -0000 On Fri, 27 Jul 2012, Gleb Smirnoff wrote: > Log: > Add assertion for refcount overflow. > > Submitted by: Andrey Zonov > Reviewed by: kib > > Modified: > head/sys/sys/refcount.h > > Modified: head/sys/sys/refcount.h > ============================================================================== > --- head/sys/sys/refcount.h Fri Jul 27 08:28:44 2012 (r238827) > +++ head/sys/sys/refcount.h Fri Jul 27 09:16:48 2012 (r238828) > @@ -32,6 +32,7 @@ > #ifndef __SYS_REFCOUNT_H__ > #define __SYS_REFCOUNT_H__ > > +#include New namespace pollution. > #include Old namespace pollution. Worse than the above, since machine/atomic.h is standard pollution in sys/systm.h. > > #ifdef _KERNEL > @@ -51,6 +52,7 @@ static __inline void > refcount_acquire(volatile u_int *count) Despite the old namespace pollution, this file still has prerequisites, to get u_int declared, and even more prerequisites to get all the prerequisites for the pollution declated. These prerequisites may consist of only sys/types.h, or sys/param.h and all of its standard pollution. However, this file is apparently supposed to be useable in userland, and some of the pollution is sort of needed there. The includes are nonsense for the kernel case. > { > > + KASSERT(*count < UINT_MAX, ("refcount %p overflowed", count)); Spell UINT_MAX as (uint_t)-1 to avoid the new pollution. > atomic_add_acq_int(count, 1); > } The patch doesn't show quite enough detail to untangle the pollution. Here is more: % #include This is misplacted. In the kernel, it is a standard part of sys/systm.h, which is included later. % % #ifdef _KERNEL % #include Yet more pollution, yet not enough to actually compile standalone. This is needed mainly for KASSERT(). All though it has massive internal pollution, with the machine/cpufunc.h and machine/atomic.h parts very standard and useful, its still needs its includer to include sys/types.h before it. Kernel source files must almost always include both include sys/param.h and sys/param.h first, since not all kernel headers are as polluted as this one and include sys/systm.h when they use KASSERT, and since future ones should not be polluted with thus include but might grow a use of KASSERT. There are just a few kernel source files that try to be too smart about this and include only sys/types.h and not sys/param.h, or sort the includes with sys/systm.h after other headers that use it. These tend to break when KASSERTs and other magic are added. The following headers in now use KASSERT: buf.h, eventhandler.h, lock.h, mbuf.h, mount.h, mutex.h, osd.h, proc.h, refcount.h. Only the following include sys/systm.h: libkern.h, mbuf.h, pmckern.h, refcount.h. libkern.h is where the standard pollution of machine/atomic.h comes from. This is especially bogus in libkern.h -- libkern.h includes systm.h, and systm.h includes libkern.h. The latter is just because a few C source files, mainly in sys/libkern/, try to be too smart about minimal includes. Some include just libkern.h instead of the usual param.h and systm.h. libkern.h has complete pollution needed to compile stand-alone, including types.h, unlike the above. % #else % #define KASSERT(exp, msg) /* */ Stub for userland. Your new code is just useless in userland. % #endif % % static __inline void % refcount_init(volatile u_int *count, u_int value) The kernel case shouldn't include anything here. Require systm.h as a prerequisite instead of types.h. The user case doesn't need limits.h, but unfortunately needs atomic.h to avoid expanding its current bogus prerequisites. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 11:12:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00A1F1065672; Fri, 27 Jul 2012 11:12:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 70A5E8FC08; Fri, 27 Jul 2012 11:12:47 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6RBCo0w074916; Fri, 27 Jul 2012 14:12:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6RBCblK005524; Fri, 27 Jul 2012 14:12:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6RBCbCp005523; Fri, 27 Jul 2012 14:12:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 27 Jul 2012 14:12:37 +0300 From: Konstantin Belousov To: Gleb Smirnoff Message-ID: <20120727111237.GC2676@deviant.kiev.zoral.com.ua> References: <201207270916.q6R9Gm23086648@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yx93Kc6BzsIU1RZq" Content-Disposition: inline In-Reply-To: <201207270916.q6R9Gm23086648@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238828 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 11:12:48 -0000 --yx93Kc6BzsIU1RZq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 27, 2012 at 09:16:48AM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Fri Jul 27 09:16:48 2012 > New Revision: 238828 > URL: http://svn.freebsd.org/changeset/base/238828 >=20 > Log: > Add assertion for refcount overflow. > =20 > Submitted by: Andrey Zonov > Reviewed by: kib It was discussed rather then reviewed. I suggest that the assert may be expressed as a check after the increment, which verifies that counter is !=3D 0. This allows to avoid namespace pollution due to limits.h. >=20 > Modified: > head/sys/sys/refcount.h >=20 > Modified: head/sys/sys/refcount.h > =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 > --- head/sys/sys/refcount.h Fri Jul 27 08:28:44 2012 (r238827) > +++ head/sys/sys/refcount.h Fri Jul 27 09:16:48 2012 (r238828) > @@ -32,6 +32,7 @@ > #ifndef __SYS_REFCOUNT_H__ > #define __SYS_REFCOUNT_H__ > =20 > +#include > #include > =20 > #ifdef _KERNEL > @@ -51,6 +52,7 @@ static __inline void > refcount_acquire(volatile u_int *count) > { > =20 > + KASSERT(*count < UINT_MAX, ("refcount %p overflowed", count)); > atomic_add_acq_int(count, 1);=09 > } > =20 --yx93Kc6BzsIU1RZq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlASd6UACgkQC3+MBN1Mb4j1ywCg4F5Qe2TLuK3WR4fhxIcMSNF1 eW8AnimtZVUxhTV2VQueX0rto3E5D8aI =fOjQ -----END PGP SIGNATURE----- --yx93Kc6BzsIU1RZq-- From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 11:20:29 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DA4C106566B; Fri, 27 Jul 2012 11:20:29 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id A36B28FC16; Fri, 27 Jul 2012 11:20:28 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q6RBJ4d0035365; Fri, 27 Jul 2012 15:19:04 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q6RBJ4K3035364; Fri, 27 Jul 2012 15:19:04 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 27 Jul 2012 15:19:04 +0400 From: Gleb Smirnoff To: Konstantin Belousov Message-ID: <20120727111904.GQ14135@FreeBSD.org> References: <201207270916.q6R9Gm23086648@svn.freebsd.org> <20120727111237.GC2676@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20120727111237.GC2676@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238828 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 11:20:29 -0000 On Fri, Jul 27, 2012 at 02:12:37PM +0300, Konstantin Belousov wrote: K> On Fri, Jul 27, 2012 at 09:16:48AM +0000, Gleb Smirnoff wrote: K> > Author: glebius K> > Date: Fri Jul 27 09:16:48 2012 K> > New Revision: 238828 K> > URL: http://svn.freebsd.org/changeset/base/238828 K> > K> > Log: K> > Add assertion for refcount overflow. K> > K> > Submitted by: Andrey Zonov K> > Reviewed by: kib K> It was discussed rather then reviewed. K> K> I suggest that the assert may be expressed as a check after the increment, K> which verifies that counter is != 0. This allows to avoid namespace K> pollution due to limits.h. Hmm, overflowing unsigned is a defined behavior in C. If Bruce agrees, then I'm happy with KASSERT after increment. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 11:23:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2AFBA106564A; Fri, 27 Jul 2012 11:23:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B23E8FC0A; Fri, 27 Jul 2012 11:23:25 +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 q6RBNOpR099504; Fri, 27 Jul 2012 11:23:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RBNOul099499; Fri, 27 Jul 2012 11:23:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207271123.q6RBNOul099499@svn.freebsd.org> From: Adrian Chadd Date: Fri, 27 Jul 2012 11:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238838 - in head/sys/dev/ath: . ath_hal ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 11:23:25 -0000 Author: adrian Date: Fri Jul 27 11:23:24 2012 New Revision: 238838 URL: http://svn.freebsd.org/changeset/base/238838 Log: Bring this API in line with what the reference driver and Linux ath9k was doing. Obtained from: Qualcomm Atheros, Linux ath9k Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Fri Jul 27 10:52:21 2012 (r238837) +++ head/sys/dev/ath/ath_hal/ah.h Fri Jul 27 11:23:24 2012 (r238838) @@ -1233,7 +1233,7 @@ struct ath_hal { struct ath_desc *, u_int, u_int, HAL_11N_RATE_SERIES [], u_int, u_int); void __ahdecl(*ah_set11nAggrFirst)(struct ath_hal *, - struct ath_desc *, u_int, u_int); + struct ath_desc *, u_int); void __ahdecl(*ah_set11nAggrMiddle)(struct ath_hal *, struct ath_desc *, u_int); void __ahdecl(*ah_set11nAggrLast)(struct ath_hal *, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Fri Jul 27 10:52:21 2012 (r238837) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Fri Jul 27 11:23:24 2012 (r238838) @@ -387,7 +387,7 @@ extern void ar5416Set11nRateScenario(str u_int nseries, u_int flags); extern void ar5416Set11nAggrFirst(struct ath_hal *ah, struct ath_desc *ds, - u_int aggrLen, u_int numDelims); + u_int aggrLen); extern void ar5416Set11nAggrMiddle(struct ath_hal *ah, struct ath_desc *ds, u_int numDelims); extern void ar5416Set11nAggrLast(struct ath_hal *ah, struct ath_desc *ds); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Fri Jul 27 10:52:21 2012 (r238837) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Fri Jul 27 11:23:24 2012 (r238838) @@ -727,16 +727,14 @@ ar5416Set11nRateScenario(struct ath_hal } void -ar5416Set11nAggrFirst(struct ath_hal *ah, struct ath_desc *ds, - u_int aggrLen, u_int numDelims) +ar5416Set11nAggrFirst(struct ath_hal *ah, struct ath_desc *ds, u_int aggrLen) { struct ar5416_desc *ads = AR5416DESC(ds); ads->ds_ctl1 |= (AR_IsAggr | AR_MoreAggr); ads->ds_ctl6 &= ~(AR_AggrLen | AR_PadDelim); - ads->ds_ctl6 |= SM(aggrLen, AR_AggrLen) | - SM(numDelims, AR_PadDelim); + ads->ds_ctl6 |= SM(aggrLen, AR_AggrLen); } void Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Fri Jul 27 10:52:21 2012 (r238837) +++ head/sys/dev/ath/if_athvar.h Fri Jul 27 11:23:24 2012 (r238838) @@ -1121,7 +1121,7 @@ void ath_intr(void *); (_series), (_ns), (_flags))) #define ath_hal_set11n_aggr_first(_ah, _ds, _len, _num) \ - ((*(_ah)->ah_set11nAggrFirst)((_ah), (_ds), (_len), (_num))) + ((*(_ah)->ah_set11nAggrFirst)((_ah), (_ds), (_len))) #define ath_hal_set11naggrmiddle(_ah, _ds, _num) \ ((*(_ah)->ah_set11nAggrMiddle)((_ah), (_ds), (_num))) #define ath_hal_set11n_aggr_last(_ah, _ds) \ From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 11:43:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDA51106566B; Fri, 27 Jul 2012 11:43:10 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C89098FC12; Fri, 27 Jul 2012 11:43:10 +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 q6RBhA4A001297; Fri, 27 Jul 2012 11:43:10 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RBhA6w001294; Fri, 27 Jul 2012 11:43:10 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207271143.q6RBhA6w001294@svn.freebsd.org> From: Adrian Chadd Date: Fri, 27 Jul 2012 11:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238839 - in head/sys/dev/ath: . ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 11:43:11 -0000 Author: adrian Date: Fri Jul 27 11:43:10 2012 New Revision: 238839 URL: http://svn.freebsd.org/changeset/base/238839 Log: Introduce a couple more fields in the rate scenario setup as part of (future) TPC support in the AR9300 HAL. This is effectively a no-op for the moment as (a) TPC isn't really supported, (b) the AR9300 HAL isn't yet public, and (c) the existing HAL code doesn't use these fields. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Fri Jul 27 11:23:24 2012 (r238838) +++ head/sys/dev/ath/ath_hal/ah.h Fri Jul 27 11:43:10 2012 (r238839) @@ -587,6 +587,8 @@ typedef struct { #define HAL_RATESERIES_RTS_CTS 0x0001 /* use rts/cts w/this series */ #define HAL_RATESERIES_2040 0x0002 /* use ext channel for series */ #define HAL_RATESERIES_HALFGI 0x0004 /* use half-gi for series */ + u_int RateIndex; + u_int tx_power_cap; } HAL_11N_RATE_SERIES; typedef enum { Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Fri Jul 27 11:23:24 2012 (r238838) +++ head/sys/dev/ath/if_ath_tx_ht.c Fri Jul 27 11:43:10 2012 (r238839) @@ -511,6 +511,8 @@ ath_rateseries_setup(struct ath_softc *s series[i].RateFlags |= HAL_RATESERIES_HALFGI; series[i].Rate = rt->info[rc[i].rix].rateCode; + series[i].RateIndex = rc[i].rix; + series[i].tx_power_cap = 0x3f; /* XXX for now */ /* * PktDuration doesn't include slot, ACK, RTS, etc timing - From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 11:44:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3844B106566B; Fri, 27 Jul 2012 11:44:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23B198FC14; Fri, 27 Jul 2012 11:44:49 +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 q6RBimVg001471; Fri, 27 Jul 2012 11:44:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RBim6K001469; Fri, 27 Jul 2012 11:44:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207271144.q6RBim6K001469@svn.freebsd.org> From: Adrian Chadd Date: Fri, 27 Jul 2012 11:44:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238840 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 11:44:49 -0000 Author: adrian Date: Fri Jul 27 11:44:48 2012 New Revision: 238840 URL: http://svn.freebsd.org/changeset/base/238840 Log: Add some comments about what the two fields mean. Modified: head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Fri Jul 27 11:43:10 2012 (r238839) +++ head/sys/dev/ath/ath_hal/ah.h Fri Jul 27 11:44:48 2012 (r238840) @@ -580,14 +580,14 @@ typedef enum { typedef struct { u_int Tries; - u_int Rate; + u_int Rate; /* hardware rate code */ + u_int RateIndex; /* rate series table index */ u_int PktDuration; u_int ChSel; u_int RateFlags; #define HAL_RATESERIES_RTS_CTS 0x0001 /* use rts/cts w/this series */ #define HAL_RATESERIES_2040 0x0002 /* use ext channel for series */ #define HAL_RATESERIES_HALFGI 0x0004 /* use half-gi for series */ - u_int RateIndex; u_int tx_power_cap; } HAL_11N_RATE_SERIES; From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 11:45:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E752106566C; Fri, 27 Jul 2012 11:45:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79CAB8FC1F; Fri, 27 Jul 2012 11:45: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 q6RBjwJL001613; Fri, 27 Jul 2012 11:45:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RBjwHr001611; Fri, 27 Jul 2012 11:45:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207271145.q6RBjwHr001611@svn.freebsd.org> From: Adrian Chadd Date: Fri, 27 Jul 2012 11:45:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238841 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 11:45:58 -0000 Author: adrian Date: Fri Jul 27 11:45:57 2012 New Revision: 238841 URL: http://svn.freebsd.org/changeset/base/238841 Log: Add a STBC TX flag. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Fri Jul 27 11:44:48 2012 (r238840) +++ head/sys/dev/ath/ath_hal/ah.h Fri Jul 27 11:45:57 2012 (r238841) @@ -588,6 +588,7 @@ typedef struct { #define HAL_RATESERIES_RTS_CTS 0x0001 /* use rts/cts w/this series */ #define HAL_RATESERIES_2040 0x0002 /* use ext channel for series */ #define HAL_RATESERIES_HALFGI 0x0004 /* use half-gi for series */ +#define HAL_RATESERIES_STBC 0x0008 /* use STBC for series */ u_int tx_power_cap; } HAL_11N_RATE_SERIES; From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 11:54:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EEA9106564A; Fri, 27 Jul 2012 11:54:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A0108FC12; Fri, 27 Jul 2012 11:54:06 +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 q6RBs6FL002249; Fri, 27 Jul 2012 11:54:06 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RBs6uO002247; Fri, 27 Jul 2012 11:54:06 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207271154.q6RBs6uO002247@svn.freebsd.org> From: Adrian Chadd Date: Fri, 27 Jul 2012 11:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238842 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 11:54:06 -0000 Author: adrian Date: Fri Jul 27 11:54:05 2012 New Revision: 238842 URL: http://svn.freebsd.org/changeset/base/238842 Log: Add STBC TX support for AR5416 HAL chips. Specifically, however: * AR9280 and later support 1-stream STBC RX; * AR9280 and AR9287 support 1-stream STBC TX. The STBC support isn't announced (yet) via net80211 and it isn't at all chosen by the rate control code, so there's no real consumer of this yet. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Fri Jul 27 11:45:57 2012 (r238841) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Fri Jul 27 11:54:05 2012 (r238842) @@ -135,6 +135,7 @@ ar5416StopTxDma(struct ath_hal *ah, u_in #define set11nRateFlags(_series, _index) \ ((_series)[_index].RateFlags & HAL_RATESERIES_2040 ? AR_2040_##_index : 0) \ |((_series)[_index].RateFlags & HAL_RATESERIES_HALFGI ? AR_GI##_index : 0) \ + |((_series)[_index].RateFlags & HAL_RATESERIES_STBC ? AR_STBC##_index : 0) \ |SM((_series)[_index].ChSel, AR_ChainSel##_index) /* From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 12:08:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 59D7B106566C; Fri, 27 Jul 2012 12:08:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B3E58FC19; Fri, 27 Jul 2012 12:08: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 q6RC8ora003514; Fri, 27 Jul 2012 12:08:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RC8n3h003512; Fri, 27 Jul 2012 12:08:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207271208.q6RC8n3h003512@svn.freebsd.org> From: Adrian Chadd Date: Fri, 27 Jul 2012 12:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238843 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 12:08:50 -0000 Author: adrian Date: Fri Jul 27 12:08:49 2012 New Revision: 238843 URL: http://svn.freebsd.org/changeset/base/238843 Log: Tidy up the TX status fields a little and add a couple new flags. * shuffle things around so things fall on natural padding boundaries; * add a couple of new flags to specify LDPC and whether to switch to the low power RX chain configuration after this TX has completed. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah_desc.h Modified: head/sys/dev/ath/ath_hal/ah_desc.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_desc.h Fri Jul 27 11:54:05 2012 (r238842) +++ head/sys/dev/ath/ath_hal/ah_desc.h Fri Jul 27 12:08:49 2012 (r238843) @@ -57,16 +57,19 @@ struct ath_tx_status { uint8_t ts_finaltsi; /* final transmit series index */ #ifdef AH_SUPPORT_AR5416 /* 802.11n status */ - uint8_t ts_flags; /* misc flags */ - int8_t ts_rssi_ctl[3]; /* tx ack RSSI [ctl, chain 0-2] */ - int8_t ts_rssi_ext[3]; /* tx ack RSSI [ext, chain 0-2] */ -/* #define ts_rssi ts_rssi_combined */ - uint32_t ts_ba_low; /* blockack bitmap low */ - uint32_t ts_ba_high; /* blockack bitmap high */ + uint8_t ts_flags; /* misc flags */ + uint8_t ts_queue_id; /* AR9300: TX queue id */ + uint8_t ts_desc_id; /* AR9300: TX descriptor id */ uint8_t ts_tid; /* TID */ - uint32_t ts_evm0; /* evm bytes */ - uint32_t ts_evm1; - uint32_t ts_evm2; +/* #define ts_rssi ts_rssi_combined */ + uint32_t ts_ba_low; /* blockack bitmap low */ + uint32_t ts_ba_high; /* blockack bitmap high */ + uint32_t ts_evm0; /* evm bytes */ + uint32_t ts_evm1; + uint32_t ts_evm2; + int8_t ts_rssi_ctl[3]; /* tx ack RSSI [ctl, chain 0-2] */ + int8_t ts_rssi_ext[3]; /* tx ack RSSI [ext, chain 0-2] */ + uint8_t ts_pad[2]; #endif /* AH_SUPPORT_AR5416 */ }; @@ -243,6 +246,8 @@ struct ath_desc_status { #define HAL_TXDESC_EXT_ONLY 0x0080 /* send on ext channel only (11n) */ #define HAL_TXDESC_EXT_AND_CTL 0x0100 /* send on ext + ctl channels (11n) */ #define HAL_TXDESC_VMF 0x0200 /* virtual more frag */ +#define HAL_TXDESC_LOWRXCHAIN 0x0400 /* switch to low RX chain */ +#define HAL_TXDESC_LDPC 0x1000 /* flags passed to rx descriptor setup methods */ #define HAL_RXDESC_INTREQ 0x0020 /* enable per-descriptor interrupt */ From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 12:33:04 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 691E8106566C; Fri, 27 Jul 2012 12:33:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail27.syd.optusnet.com.au (mail27.syd.optusnet.com.au [211.29.133.168]) by mx1.freebsd.org (Postfix) with ESMTP id E6DBC8FC15; Fri, 27 Jul 2012 12:33:03 +0000 (UTC) Received: from c122-106-171-246.carlnfd1.nsw.optusnet.com.au (c122-106-171-246.carlnfd1.nsw.optusnet.com.au [122.106.171.246]) by mail27.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q6RCWtFP017590 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Jul 2012 22:32:56 +1000 Date: Fri, 27 Jul 2012 22:32:55 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Gleb Smirnoff In-Reply-To: <20120727111904.GQ14135@FreeBSD.org> Message-ID: <20120727221529.K7360@besplex.bde.org> References: <201207270916.q6R9Gm23086648@svn.freebsd.org> <20120727111237.GC2676@deviant.kiev.zoral.com.ua> <20120727111904.GQ14135@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Konstantin Belousov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238828 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 12:33:04 -0000 On Fri, 27 Jul 2012, Gleb Smirnoff wrote: > On Fri, Jul 27, 2012 at 02:12:37PM +0300, Konstantin Belousov wrote: > K> On Fri, Jul 27, 2012 at 09:16:48AM +0000, Gleb Smirnoff wrote: > K> > ... > K> > Log: > K> > Add assertion for refcount overflow. > K> > > K> > Submitted by: Andrey Zonov > K> > Reviewed by: kib > K> It was discussed rather then reviewed. > K> > K> I suggest that the assert may be expressed as a check after the increment, > K> which verifies that counter is != 0. This allows to avoid namespace > K> pollution due to limits.h. > > Hmm, overflowing unsigned is a defined behavior in C. If Bruce agrees, > then I'm happy with KASSERT after increment. Comparing with (uint_t)-1 before is equivalent. You can even omit the cast (depend on the default promotion). I just noticed that there is a technical problem -- the count is read unlocked in the KASSERT. And since the comparision is for equality, if you lose the race reading the count when it reaches the overflow threshold, then you won't see it overflow unless it wraps again and you win the race next time (or later). atomic_cmpset could be used to clamp the value at the max, but that is too much for an assertion. Simple locked reads of the count also don't prevent it wrapping and going a bit higher than 0 with increments by other CPUs before the CPU that notices the overflow can panic. So the patch in the PR may have been better than the one committed (IIRC, it paniced some time before wrapping, and people didn't like this). I prefer to use signed types, even for, or especially for counters. Then if the counter overflows you have a long time to notice this, and may notice without explicit testing because negative counts are printed somewhere. Integer overflow gives undefined behaviour immediately, and there is a compiler flag to generate tests for it. No one ever uses this, and it wouldn't work for variables that need atomic accesses anyway. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 12:45:37 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06133106566C; Fri, 27 Jul 2012 12:45:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 79DE28FC12; Fri, 27 Jul 2012 12:45:36 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q6RCjYOs035964; Fri, 27 Jul 2012 16:45:34 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q6RCjYeH035963; Fri, 27 Jul 2012 16:45:34 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 27 Jul 2012 16:45:34 +0400 From: Gleb Smirnoff To: Bruce Evans Message-ID: <20120727124534.GT14135@FreeBSD.org> References: <201207270916.q6R9Gm23086648@svn.freebsd.org> <20120727111237.GC2676@deviant.kiev.zoral.com.ua> <20120727111904.GQ14135@FreeBSD.org> <20120727221529.K7360@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20120727221529.K7360@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Konstantin Belousov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238828 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 12:45:37 -0000 On Fri, Jul 27, 2012 at 10:32:55PM +1000, Bruce Evans wrote: B> > On Fri, Jul 27, 2012 at 02:12:37PM +0300, Konstantin Belousov wrote: B> > K> On Fri, Jul 27, 2012 at 09:16:48AM +0000, Gleb Smirnoff wrote: B> > K> > ... B> > K> > Log: B> > K> > Add assertion for refcount overflow. B> > K> > B> > K> > Submitted by: Andrey Zonov B> > K> > Reviewed by: kib B> > K> It was discussed rather then reviewed. B> > K> B> > K> I suggest that the assert may be expressed as a check after the increment, B> > K> which verifies that counter is != 0. This allows to avoid namespace B> > K> pollution due to limits.h. B> > B> > Hmm, overflowing unsigned is a defined behavior in C. If Bruce agrees, B> > then I'm happy with KASSERT after increment. B> B> Comparing with (uint_t)-1 before is equivalent. You can even omit the B> cast (depend on the default promotion). B> B> I just noticed that there is a technical problem -- the count is read B> unlocked in the KASSERT. And since the comparision is for equality, B> if you lose the race reading the count when it reaches the overflow B> threshold, then you won't see it overflow unless it wraps again and B> you win the race next time (or later). atomic_cmpset could be used B> to clamp the value at the max, but that is too much for an assertion. We have discussed that. As alternative I proposed: @@ -50,8 +51,14 @@ static __inline void refcount_acquire(volatile u_int *count) { +#ifdef INVARIANTS + u_int old; + old = atomic_fetchadd_int(count, 1); + KASSERT(old < UINT_MAX, ("refcount %p overflowed", count)); +#else atomic_add_acq_int(count, 1); +#endif } Konstantin didn't like that production code differs from INVARIANTS. So we ended with what I committed, advocating to the fact that although assertion is racy and bad panics still can occur, the "good panics" would occur much more often, and a single "good panic" is enough to show what's going on. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 12:46:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C7B0106564A; Fri, 27 Jul 2012 12:46:04 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id E98CC8FC08; Fri, 27 Jul 2012 12:46:03 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6RCk8Dd090614; Fri, 27 Jul 2012 15:46:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6RCjtik006029; Fri, 27 Jul 2012 15:45:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6RCjtNv006028; Fri, 27 Jul 2012 15:45:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 27 Jul 2012 15:45:55 +0300 From: Konstantin Belousov To: Bruce Evans Message-ID: <20120727124555.GE2676@deviant.kiev.zoral.com.ua> References: <201207270916.q6R9Gm23086648@svn.freebsd.org> <20120727111237.GC2676@deviant.kiev.zoral.com.ua> <20120727111904.GQ14135@FreeBSD.org> <20120727221529.K7360@besplex.bde.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mNseXQyS8ZYhN/HW" Content-Disposition: inline In-Reply-To: <20120727221529.K7360@besplex.bde.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org Subject: Re: svn commit: r238828 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 12:46:04 -0000 --mNseXQyS8ZYhN/HW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 27, 2012 at 10:32:55PM +1000, Bruce Evans wrote: > On Fri, 27 Jul 2012, Gleb Smirnoff wrote: >=20 > >On Fri, Jul 27, 2012 at 02:12:37PM +0300, Konstantin Belousov wrote: > >K> On Fri, Jul 27, 2012 at 09:16:48AM +0000, Gleb Smirnoff wrote: > >K> > ... > >K> > Log: > >K> > Add assertion for refcount overflow. > >K> > > >K> > Submitted by: Andrey Zonov > >K> > Reviewed by: kib > >K> It was discussed rather then reviewed. > >K> > >K> I suggest that the assert may be expressed as a check after the=20 > >increment, > >K> which verifies that counter is !=3D 0. This allows to avoid namespace > >K> pollution due to limits.h. > > > >Hmm, overflowing unsigned is a defined behavior in C. If Bruce agrees, > >then I'm happy with KASSERT after increment. >=20 > Comparing with (uint_t)-1 before is equivalent. You can even omit the > cast (depend on the default promotion). >=20 > I just noticed that there is a technical problem -- the count is read > unlocked in the KASSERT. And since the comparision is for equality, > if you lose the race reading the count when it reaches the overflow > threshold, then you won't see it overflow unless it wraps again and > you win the race next time (or later). atomic_cmpset could be used > to clamp the value at the max, but that is too much for an assertion. Yes, we discussed this with Gleb, and I do not see this as a problem. To make assert bullet-proof, either fetchadd() shall be used, as Gleb proposed, or some even more drastic measures applied. I did not liked fetchadd() proposal because it causes INVARIANTS code to use different function (and processor instruction in the end) comparing with !INVARIANTS case. >=20 > Simple locked reads of the count also don't prevent it wrapping and > going a bit higher than 0 with increments by other CPUs before the > CPU that notices the overflow can panic. So the patch in the PR may > have been better than the one committed (IIRC, it paniced some > time before wrapping, and people didn't like this). >=20 > I prefer to use signed types, even for, or especially for counters. > Then if the counter overflows you have a long time to notice this, > and may notice without explicit testing because negative counts are > printed somewhere. Integer overflow gives undefined behaviour > immediately, and there is a compiler flag to generate tests for it. > No one ever uses this, and it wouldn't work for variables that need > atomic accesses anyway. And there, people complain about loosing half of the counter capacity. --mNseXQyS8ZYhN/HW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAlASjYMACgkQC3+MBN1Mb4gI8gCeOAx9Ma/v2ElrE/OoueY0y+J2 hwEAoORRDL+TIXuO+8q/aDzvU0g/pzkX =ZC+z -----END PGP SIGNATURE----- --mNseXQyS8ZYhN/HW-- From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 13:31:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76554106566B; Fri, 27 Jul 2012 13:31:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail14.syd.optusnet.com.au (mail14.syd.optusnet.com.au [211.29.132.195]) by mx1.freebsd.org (Postfix) with ESMTP id 0C0C98FC18; Fri, 27 Jul 2012 13:31:08 +0000 (UTC) Received: from c122-106-171-246.carlnfd1.nsw.optusnet.com.au (c122-106-171-246.carlnfd1.nsw.optusnet.com.au [122.106.171.246]) by mail14.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q6RDUwbF026719 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Jul 2012 23:31:01 +1000 Date: Fri, 27 Jul 2012 23:30:58 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Gleb Smirnoff In-Reply-To: <20120727124534.GT14135@FreeBSD.org> Message-ID: <20120727232757.X7759@besplex.bde.org> References: <201207270916.q6R9Gm23086648@svn.freebsd.org> <20120727111237.GC2676@deviant.kiev.zoral.com.ua> <20120727111904.GQ14135@FreeBSD.org> <20120727221529.K7360@besplex.bde.org> <20120727124534.GT14135@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r238828 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 13:31:09 -0000 On Fri, 27 Jul 2012, Gleb Smirnoff wrote: > On Fri, Jul 27, 2012 at 10:32:55PM +1000, Bruce Evans wrote: > B> I just noticed that there is a technical problem -- the count is read > B> unlocked in the KASSERT. And since the comparision is for equality, > B> if you lose the race reading the count when it reaches the overflow > B> threshold, then you won't see it overflow unless it wraps again and > B> you win the race next time (or later). atomic_cmpset could be used > B> to clamp the value at the max, but that is too much for an assertion. > > We have discussed that. As alternative I proposed: > > @@ -50,8 +51,14 @@ > static __inline void > refcount_acquire(volatile u_int *count) > { > +#ifdef INVARIANTS > + u_int old; > + old = atomic_fetchadd_int(count, 1); > + KASSERT(old < UINT_MAX, ("refcount %p overflowed", count)); > +#else > atomic_add_acq_int(count, 1); > +#endif > } > > Konstantin didn't like that production code differs from INVARIANTS. > > So we ended with what I committed, advocating to the fact that although > assertion is racy and bad panics still can occur, the "good panics" > would occur much more often, and a single "good panic" is enough to > show what's going on. Yes, it is excessive. So why do people even care about this particular overflow? There are many integers that can overflow in the kernel. Some binary wraparounds are even intentional. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 13:57:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 37FE0106566C; Fri, 27 Jul 2012 13:57:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FF638FC1B; Fri, 27 Jul 2012 13:57:29 +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 q6RDvS7E012521; Fri, 27 Jul 2012 13:57:28 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RDvSUi012519; Fri, 27 Jul 2012 13:57:28 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201207271357.q6RDvSUi012519@svn.freebsd.org> From: Ed Maste Date: Fri, 27 Jul 2012 13:57:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238844 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 13:57:29 -0000 Author: emaste Date: Fri Jul 27 13:57:28 2012 New Revision: 238844 URL: http://svn.freebsd.org/changeset/base/238844 Log: Add version so others can depend on this module Modified: head/sys/netgraph/ng_ether.c Modified: head/sys/netgraph/ng_ether.c ============================================================================== --- head/sys/netgraph/ng_ether.c Fri Jul 27 12:08:49 2012 (r238843) +++ head/sys/netgraph/ng_ether.c Fri Jul 27 13:57:28 2012 (r238844) @@ -71,6 +71,8 @@ #include #include +MODULE_VERSION(ng_ether, 1); + #define IFP2NG(ifp) (IFP2AC((ifp))->ac_netgraph) /* Per-node private data */ From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 14:11:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C61AC1065672; Fri, 27 Jul 2012 14:11:09 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 90DCE8FC08; Fri, 27 Jul 2012 14:11:09 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6REB2mk057079; Fri, 27 Jul 2012 14:11:06 GMT (envelope-from listlog2011@gmail.com) Message-ID: <5012A173.9090105@gmail.com> Date: Fri, 27 Jul 2012 22:10:59 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Bruce Evans References: <201207270916.q6R9Gm23086648@svn.freebsd.org> <20120727111237.GC2676@deviant.kiev.zoral.com.ua> <20120727111904.GQ14135@FreeBSD.org> <20120727221529.K7360@besplex.bde.org> <20120727124534.GT14135@FreeBSD.org> <20120727232757.X7759@besplex.bde.org> In-Reply-To: <20120727232757.X7759@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org Subject: Re: svn commit: r238828 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 14:11:10 -0000 On 2012/7/27 21:30, Bruce Evans wrote: > On Fri, 27 Jul 2012, Gleb Smirnoff wrote: > >> On Fri, Jul 27, 2012 at 10:32:55PM +1000, Bruce Evans wrote: >> B> I just noticed that there is a technical problem -- the count is read >> B> unlocked in the KASSERT. And since the comparision is for equality, >> B> if you lose the race reading the count when it reaches the overflow >> B> threshold, then you won't see it overflow unless it wraps again and >> B> you win the race next time (or later). atomic_cmpset could be used >> B> to clamp the value at the max, but that is too much for an assertion. >> >> We have discussed that. As alternative I proposed: >> >> @@ -50,8 +51,14 @@ >> static __inline void >> refcount_acquire(volatile u_int *count) >> { >> +#ifdef INVARIANTS >> + u_int old; >> + old = atomic_fetchadd_int(count, 1); >> + KASSERT(old < UINT_MAX, ("refcount %p overflowed", count)); >> +#else >> atomic_add_acq_int(count, 1); >> +#endif >> } >> >> Konstantin didn't like that production code differs from INVARIANTS. >> >> So we ended with what I committed, advocating to the fact that although >> assertion is racy and bad panics still can occur, the "good panics" >> would occur much more often, and a single "good panic" is enough to >> show what's going on. > > Yes, it is excessive. > > So why do people even care about this particular overflow? There are > many integers that can overflow in the kernel. Some binary wraparounds > are even intentional. > > Bruce > The overflow might not be important. if it is important, all code which use 32-bit generation number could also be a problem, how about if it is wrapped around to same value another thread has just read and waiting for a CPU to run. :D From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 14:49:20 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 621A1106566C; Fri, 27 Jul 2012 14:49:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id CFAE08FC0A; Fri, 27 Jul 2012 14:49:19 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q6REnIRr036734; Fri, 27 Jul 2012 18:49:18 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q6REnIIK036733; Fri, 27 Jul 2012 18:49:18 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 27 Jul 2012 18:49:18 +0400 From: Gleb Smirnoff To: Bruce Evans Message-ID: <20120727144918.GV14135@FreeBSD.org> References: <201207270916.q6R9Gm23086648@svn.freebsd.org> <20120727111237.GC2676@deviant.kiev.zoral.com.ua> <20120727111904.GQ14135@FreeBSD.org> <20120727221529.K7360@besplex.bde.org> <20120727124534.GT14135@FreeBSD.org> <20120727232757.X7759@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20120727232757.X7759@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Konstantin Belousov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r238828 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 14:49:20 -0000 On Fri, Jul 27, 2012 at 11:30:58PM +1000, Bruce Evans wrote: B> > On Fri, Jul 27, 2012 at 10:32:55PM +1000, Bruce Evans wrote: B> > B> I just noticed that there is a technical problem -- the count is read B> > B> unlocked in the KASSERT. And since the comparision is for equality, B> > B> if you lose the race reading the count when it reaches the overflow B> > B> threshold, then you won't see it overflow unless it wraps again and B> > B> you win the race next time (or later). atomic_cmpset could be used B> > B> to clamp the value at the max, but that is too much for an assertion. B> > B> > We have discussed that. As alternative I proposed: B> > B> > @@ -50,8 +51,14 @@ B> > static __inline void B> > refcount_acquire(volatile u_int *count) B> > { B> > +#ifdef INVARIANTS B> > + u_int old; B> > + old = atomic_fetchadd_int(count, 1); B> > + KASSERT(old < UINT_MAX, ("refcount %p overflowed", count)); B> > +#else B> > atomic_add_acq_int(count, 1); B> > +#endif B> > } B> > B> > Konstantin didn't like that production code differs from INVARIANTS. B> > B> > So we ended with what I committed, advocating to the fact that although B> > assertion is racy and bad panics still can occur, the "good panics" B> > would occur much more often, and a single "good panic" is enough to B> > show what's going on. B> B> Yes, it is excessive. B> B> So why do people even care about this particular overflow? There are B> many integers that can overflow in the kernel. Some binary wraparounds B> are even intentional. Because "negative refcount" panic is very confusing in the case when one got overflow. http://lists.freebsd.org/pipermail/freebsd-net/2012-July/032822.html -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 15:21:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 35250106566C; Fri, 27 Jul 2012 15:21:34 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id D38418FC08; Fri, 27 Jul 2012 15:21:33 +0000 (UTC) Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57]) by alto.onthenet.com.au (Postfix) with ESMTPS id 3220211B3C; Sat, 28 Jul 2012 01:21:32 +1000 (EST) Received: from Peter-Grehans-MacBook-Pro.local (c-75-70-33-234.hsd1.co.comcast.net [75.70.33.234]) by dommail.onthenet.com.au (MOS 4.2.4-GA) with ESMTP id BFJ53540 (AUTH peterg@ptree32.com.au); Sat, 28 Jul 2012 01:21:28 +1000 Message-ID: <5012B1F5.6030403@freebsd.org> Date: Fri, 27 Jul 2012 09:21:25 -0600 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20 MIME-Version: 1.0 To: Konstantin Belousov References: <500FE6AE.8070706@FreeBSD.org> <20120726001659.M5406@besplex.bde.org> <50102C94.9030706@FreeBSD.org> <20120725180537.GO2676@deviant.kiev.zoral.com.ua> <50103C61.8040904@FreeBSD.org> <20120726170837.Q2536@besplex.bde.org> <20120726104918.GW2676@deviant.kiev.zoral.com.ua> <20120726213001.K3621@besplex.bde.org> <20120726175947.GZ2676@deviant.kiev.zoral.com.ua> <5011901B.1060008@freebsd.org> <20120727083529.GA2676@deviant.kiev.zoral.com.ua> In-Reply-To: <20120727083529.GA2676@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Info: RCVD_IN_PBL,RCVD_IN_SORBS_DUL,RDNS_DYNAMIC,SPF_SOFTFAIL X-Junkmail-Status: score=29/51, host=dommail.onthenet.com.au Cc: Jim Harris , src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , Bruce Evans , svn-src-head@freebsd.org, Jung-uk Kim Subject: Re: svn commit: r238755 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 15:21:34 -0000 >> CPUID causes an unconditional exit in VT-x/SVM so it would be best to >> avoid that if possible. > > The only place where the use of CPUID in tsc patch seems to be reasonable > is at the SMP test, since it is too much burden to check SSE2/Intel/AMD > nuances at the boot time, to be redone later anyway. Would it be a serious > issue for monitors to get several thousands of CPUID traps at boot only ? The SMP tsc test is skipped for VM guests so it should be fine there. later, Peter. From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 16:38:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1439B1065781; Fri, 27 Jul 2012 16:38:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F33F28FC0C; Fri, 27 Jul 2012 16:38:02 +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 q6RGc2bt025396; Fri, 27 Jul 2012 16:38:02 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RGc2cS025392; Fri, 27 Jul 2012 16:38:02 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207271638.q6RGc2cS025392@svn.freebsd.org> From: Warner Losh Date: Fri, 27 Jul 2012 16:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238846 - in head/sys/arm: at91 conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 16:38:03 -0000 Author: imp Date: Fri Jul 27 16:38:02 2012 New Revision: 238846 URL: http://svn.freebsd.org/changeset/base/238846 Log: Add new at91sam9g45 support and sn9g45 board to the ATMEL kernel. Adapt SN9G45 board support to cope with multi-board. Modified: head/sys/arm/at91/board_sn9g45.c head/sys/arm/at91/std.atmel head/sys/arm/conf/ATMEL Modified: head/sys/arm/at91/board_sn9g45.c ============================================================================== --- head/sys/arm/at91/board_sn9g45.c Fri Jul 27 14:48:41 2012 (r238845) +++ head/sys/arm/at91/board_sn9g45.c Fri Jul 27 16:38:02 2012 (r238846) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include -long +BOARD_INIT long board_init(void) { Modified: head/sys/arm/at91/std.atmel ============================================================================== --- head/sys/arm/at91/std.atmel Fri Jul 27 14:48:41 2012 (r238845) +++ head/sys/arm/at91/std.atmel Fri Jul 27 16:38:02 2012 (r238846) @@ -9,6 +9,7 @@ options PHYSADDR=0x20000000 device at91rm9200 device at91sam9260 device at91sam9g20 +device at91sam9g45 device at91sam9x25 # bring in the sam specific timers and such Modified: head/sys/arm/conf/ATMEL ============================================================================== --- head/sys/arm/conf/ATMEL Fri Jul 27 14:48:41 2012 (r238845) +++ head/sys/arm/conf/ATMEL Fri Jul 27 16:38:02 2012 (r238846) @@ -28,6 +28,7 @@ device at91_board_qila9g20 device at91_board_sam9260ek device at91_board_sam9g20ek device at91_board_sam9x25ek +device at91_board_sn9g45 device at91_board_tsc4370 #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 17:07:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B99E01065670; Fri, 27 Jul 2012 17:07:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3F8E8FC0C; Fri, 27 Jul 2012 17:07:54 +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 q6RH7sFD028354; Fri, 27 Jul 2012 17:07:54 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RH7sHU028351; Fri, 27 Jul 2012 17:07:54 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207271707.q6RH7sHU028351@svn.freebsd.org> From: Warner Losh Date: Fri, 27 Jul 2012 17:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238847 - head/sys/arm/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 17:07:54 -0000 Author: imp Date: Fri Jul 27 17:07:54 2012 New Revision: 238847 URL: http://svn.freebsd.org/changeset/base/238847 Log: Neither of these systems has PCI, but they do have ohci interface, so fix comments. Modified: head/sys/arm/conf/ATMEL head/sys/arm/conf/ETHERNUT5 Modified: head/sys/arm/conf/ATMEL ============================================================================== --- head/sys/arm/conf/ATMEL Fri Jul 27 16:38:02 2012 (r238846) +++ head/sys/arm/conf/ATMEL Fri Jul 27 17:07:54 2012 (r238847) @@ -157,7 +157,7 @@ options ALT_BREAK_TO_DEBUGGER # USB support options USB_DEBUG # enable debug msgs -device ohci # OHCI PCI->USB interface +device ohci # OHCI USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da Modified: head/sys/arm/conf/ETHERNUT5 ============================================================================== --- head/sys/arm/conf/ETHERNUT5 Fri Jul 27 16:38:02 2012 (r238846) +++ head/sys/arm/conf/ETHERNUT5 Fri Jul 27 17:07:54 2012 (r238847) @@ -150,7 +150,7 @@ options ALT_BREAK_TO_DEBUGGER # USB support #options USB_DEBUG # enable debug msgs -device ohci # OHCI PCI->USB interface +device ohci # OHCI USB interface device usb # USB Bus (required) #device umass # Disks/Mass storage - Requires scbus and da From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 17:28:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14B421065670; Fri, 27 Jul 2012 17:28:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F33CC8FC19; Fri, 27 Jul 2012 17:28: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 q6RHSBmb029891; Fri, 27 Jul 2012 17:28:11 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RHSBbV029889; Fri, 27 Jul 2012 17:28:11 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207271728.q6RHSBbV029889@svn.freebsd.org> From: Warner Losh Date: Fri, 27 Jul 2012 17:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238848 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 17:28:12 -0000 Author: imp Date: Fri Jul 27 17:28:11 2012 New Revision: 238848 URL: http://svn.freebsd.org/changeset/base/238848 Log: Make this compile again. Also note that it is AT91RM9200+KB9202B specific still and needs some love to make it work on anything else. Modified: head/sys/dev/usb/controller/at91dci_atmelarm.c Modified: head/sys/dev/usb/controller/at91dci_atmelarm.c ============================================================================== --- head/sys/dev/usb/controller/at91dci_atmelarm.c Fri Jul 27 17:07:54 2012 (r238847) +++ head/sys/dev/usb/controller/at91dci_atmelarm.c Fri Jul 27 17:28:11 2012 (r238848) @@ -61,12 +61,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #define MEM_RID 0 -/* Pin Definitions - do they belong here or somewhere else ? */ +/* Pin Definitions - do they belong here or somewhere else ? -- YES! */ #define VBUS_MASK AT91C_PIO_PB24 #define VBUS_BASE AT91RM92_PIOB_BASE From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 17:31:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AEC4F106564A; Fri, 27 Jul 2012 17:31:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A4C88FC0C; Fri, 27 Jul 2012 17:31:19 +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 q6RHVJ3r030174; Fri, 27 Jul 2012 17:31:19 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RHVJeT030172; Fri, 27 Jul 2012 17:31:19 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207271731.q6RHVJeT030172@svn.freebsd.org> From: Warner Losh Date: Fri, 27 Jul 2012 17:31:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238849 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 17:31:19 -0000 Author: imp Date: Fri Jul 27 17:31:19 2012 New Revision: 238849 URL: http://svn.freebsd.org/changeset/base/238849 Log: Add the usb device (gadget) side of things. Also add ehci bindings while I'm here in anticipation of usb2 support for newer SoCs. Requested by: Hans Petter Selasky Modified: head/sys/arm/at91/files.at91 Modified: head/sys/arm/at91/files.at91 ============================================================================== --- head/sys/arm/at91/files.at91 Fri Jul 27 17:28:11 2012 (r238848) +++ head/sys/arm/at91/files.at91 Fri Jul 27 17:31:19 2012 (r238849) @@ -51,4 +51,7 @@ arm/at91/board_tsc4370.c optional at91_b # # usb # -dev/usb/controller/ohci_atmelarm.c optional ohci +dev/usb/controller/at91dci.c optional at91_dci +dev/usb/controller/at91dci_atmelarm.c optional at91_dci +dev/usb/controller/ohci_atmelarm.c optional ohci +dev/usb/controller/ehci_atmelarm.c optional ehci From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 17:32:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C06F1065680; Fri, 27 Jul 2012 17:32:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 074E48FC08; Fri, 27 Jul 2012 17:32:02 +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 q6RHW1kt030264; Fri, 27 Jul 2012 17:32:01 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RHW1e9030262; Fri, 27 Jul 2012 17:32:01 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201207271732.q6RHW1e9030262@svn.freebsd.org> From: Warner Losh Date: Fri, 27 Jul 2012 17:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238850 - head/sys/arm/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 17:32:02 -0000 Author: imp Date: Fri Jul 27 17:32:01 2012 New Revision: 238850 URL: http://svn.freebsd.org/changeset/base/238850 Log: Add gadget devices. Not yet added to the child lists, but here to keep things from bit-rotting. Modified: head/sys/arm/conf/ATMEL Modified: head/sys/arm/conf/ATMEL ============================================================================== --- head/sys/arm/conf/ATMEL Fri Jul 27 17:31:19 2012 (r238849) +++ head/sys/arm/conf/ATMEL Fri Jul 27 17:32:01 2012 (r238850) @@ -161,6 +161,11 @@ device ohci # OHCI USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da +# USB device (gadget) support +device at91_dci # Atmel's usb device +device usfs # emulate a flash +device cdce # emulate an ethernet + # watchdog device at91_wdt # Atmel AT91 Watchdog Timer From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 18:23:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AF08B106564A; Fri, 27 Jul 2012 18:23:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99AE68FC0C; Fri, 27 Jul 2012 18:23:12 +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 q6RINC7w034186; Fri, 27 Jul 2012 18:23:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RINCra034183; Fri, 27 Jul 2012 18:23:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201207271823.q6RINCra034183@svn.freebsd.org> From: Marius Strobl Date: Fri, 27 Jul 2012 18:23:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238851 - in head: . sys/boot/sparc64/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 18:23:12 -0000 Author: marius Date: Fri Jul 27 18:23:11 2012 New Revision: 238851 URL: http://svn.freebsd.org/changeset/base/238851 Log: Pull the tier-2 card and change the sparc64 ZFS loader to no longer probe all diskN aliases for providers (which more or less corresponds to how the x86 version behaves) but instead probe only those listed in the boot-device OFW environment variable. This has the following advantages: - avoids otherwise unavoidable OFW warnings about failures to open disks for which aliases exist but no actual hardware is connected - avoids issues due to different diskN naming schemes - aligns us with Solaris MFC after: 3 days Modified: head/UPDATING head/sys/boot/sparc64/loader/main.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Jul 27 17:32:01 2012 (r238850) +++ head/UPDATING Fri Jul 27 18:23:11 2012 (r238851) @@ -24,6 +24,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20120727: + The sparc64 ZFS loader has been changed to no longer try to auto- + detect ZFS providers based on diskN aliases but now requires these + to be explicitly listed in the OFW boot-device environment variable. + 20120712: The OpenSSL has been upgraded to 1.0.1c. Any binaries requiring libcrypto.so.6 or libssl.so.6 must be recompiled. Also, there are Modified: head/sys/boot/sparc64/loader/main.c ============================================================================== --- head/sys/boot/sparc64/loader/main.c Fri Jul 27 17:32:01 2012 (r238850) +++ head/sys/boot/sparc64/loader/main.c Fri Jul 27 18:23:11 2012 (r238851) @@ -7,7 +7,7 @@ * unchanged, you can do what ever you want with this file. */ /*- - * Copyright (c) 2008 Marius Strobl + * Copyright (c) 2008 - 2012 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -75,8 +75,6 @@ __FBSDID("$FreeBSD$"); #include "libofw.h" #include "dev_net.h" -#define MAXDEV 31 - extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[]; enum { @@ -735,18 +733,52 @@ sparc64_zfs_probe(void) { struct vtoc8 vtoc; struct zfs_devdesc zfs_currdev; - char devname[32]; + char alias[64], devname[sizeof(alias) + sizeof(":x") - 1]; + char type[sizeof("device_type")]; + char *bdev, *dev, *odev; uint64_t guid; - int fd, part, unit; + int fd, len, part; + phandle_t aliases, options; /* Get the GUID of the ZFS pool on the boot device. */ guid = 0; zfs_probe_dev(bootpath, &guid); - for (unit = 0; unit < MAXDEV; unit++) { + /* + * Get the GUIDs of the ZFS pools on any additional disks listed in + * the boot-device environment variable. + */ + if ((aliases = OF_finddevice("/aliases")) == -1) + goto out; + options = OF_finddevice("/options"); + len = OF_getproplen(options, "boot-device"); + if (len <= 0) + goto out; + bdev = odev = malloc(len + 1); + if (bdev == NULL) + goto out; + if (OF_getprop(options, "boot-device", bdev, len) <= 0) + goto out; + bdev[len] = '\0'; + while ((dev = strsep(&bdev, " ")) != NULL) { + if (*dev == '\0') + continue; + strcpy(alias, dev); + (void)OF_getprop(aliases, dev, alias, sizeof(alias)); + /* + * Don't probe the boot disk twice. Note that bootpath + * includes the partition specifier. + */ + if (strncmp(alias, bootpath, strlen(alias)) == 0) + continue; + if (OF_getprop(OF_finddevice(alias), "device_type", type, + sizeof(type)) == -1) + continue; + if (strcmp(type, "block") != 0) + continue; + /* Find freebsd-zfs slices in the VTOC. */ - sprintf(devname, "disk%d:", unit); - fd = open(devname, O_RDONLY); + fd = open(alias, O_RDONLY); if (fd == -1) continue; lseek(fd, 0, SEEK_SET); @@ -760,12 +792,14 @@ sparc64_zfs_probe(void) if (part == 2 || vtoc.part[part].tag != VTOC_TAG_FREEBSD_ZFS) continue; - sprintf(devname, "disk%d:%c", unit, part + 'a'); + (void)sprintf(devname, "%s:%c", alias, part + 'a'); if (zfs_probe_dev(devname, NULL) == ENXIO) break; } } + free(odev); + out: if (guid != 0) { zfs_currdev.pool_guid = guid; zfs_currdev.root_guid = 0; From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 19:32:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3ADA0106564A; Fri, 27 Jul 2012 19:32:57 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe06.c2i.net [212.247.154.162]) by mx1.freebsd.org (Postfix) with ESMTP id 3CCC28FC15; Fri, 27 Jul 2012 19:32:56 +0000 (UTC) X-T2-Spam-Status: No, hits=-1.0 required=5.0 tests=ALL_TRUSTED Received: from [176.74.212.201] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe06.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 300818855; Fri, 27 Jul 2012 21:32:46 +0200 From: Hans Petter Selasky To: Warner Losh Date: Fri, 27 Jul 2012 21:33:03 +0200 User-Agent: KMail/1.13.7 (FreeBSD/9.0-STABLE; KDE/4.7.4; amd64; ; ) References: <201207271732.q6RHW1e9030262@svn.freebsd.org> In-Reply-To: <201207271732.q6RHW1e9030262@svn.freebsd.org> X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@d2+AyewRX}mAm; Yp |U[@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y>Y}k1C4TfysrsUI -%GU9V5]iUZF&nRn9mJ'?&>O MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201207272133.03147.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r238850 - head/sys/arm/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 19:32:57 -0000 On Friday 27 July 2012 19:32:01 Warner Losh wrote: > Author: imp > Date: Fri Jul 27 17:32:01 2012 > New Revision: 238850 > URL: http://svn.freebsd.org/changeset/base/238850 > > Log: > Add gadget devices. Not yet added to the child lists, but here to > keep things from bit-rotting. > > Modified: > head/sys/arm/conf/ATMEL > > Modified: head/sys/arm/conf/ATMEL > =========================================================================== > === --- head/sys/arm/conf/ATMEL Fri Jul 27 17:31:19 2012 (r238849) > +++ head/sys/arm/conf/ATMEL Fri Jul 27 17:32:01 2012 (r238850) > @@ -161,6 +161,11 @@ device ohci # OHCI USB interface > device usb # USB Bus (required) > device umass # Disks/Mass storage - Requires scbus and da > > +# USB device (gadget) support > +device at91_dci # Atmel's usb device > +device usfs # emulate a flash > +device cdce # emulate an ethernet > + > # watchdog > device at91_wdt # Atmel AT91 Watchdog Timer Hi, You also need: device usb_template For gadget mode. The configuration shown to the host is selected using: sysctl hw.usb.template=0,1,2,3, ... --HPS From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 19:56:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7802A1065672; Fri, 27 Jul 2012 19:56:37 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61AAF8FC18; Fri, 27 Jul 2012 19:56: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 q6RJub56041272; Fri, 27 Jul 2012 19:56:37 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RJubBP041270; Fri, 27 Jul 2012 19:56:37 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201207271956.q6RJubBP041270@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 27 Jul 2012 19:56:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238852 - stable/9/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 19:56:37 -0000 Author: trociny Date: Fri Jul 27 19:56:36 2012 New Revision: 238852 URL: http://svn.freebsd.org/changeset/base/238852 Log: MFC r238753: Align the header with output. Approved by: re (kib) Modified: stable/9/usr.bin/procstat/procstat_vm.c Directory Properties: stable/9/usr.bin/procstat/ (props changed) Modified: stable/9/usr.bin/procstat/procstat_vm.c ============================================================================== --- stable/9/usr.bin/procstat/procstat_vm.c Fri Jul 27 18:23:11 2012 (r238851) +++ stable/9/usr.bin/procstat/procstat_vm.c Fri Jul 27 19:56:36 2012 (r238852) @@ -50,7 +50,7 @@ procstat_vm(struct kinfo_proc *kipp) ptrwidth = 2*sizeof(void *) + 2; if (!hflag) - printf("%5s %*s %*s %3s %4s %4s %3s %3s %3s %-2s %-s\n", + printf("%5s %*s %*s %3s %4s %4s %3s %3s %4s %-2s %-s\n", "PID", ptrwidth, "START", ptrwidth, "END", "PRT", "RES", "PRES", "REF", "SHD", "FL", "TP", "PATH"); From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 21:38:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37B2F106564A; Fri, 27 Jul 2012 21:38:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22F2A8FC12; Fri, 27 Jul 2012 21:38: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 q6RLcElQ049242; Fri, 27 Jul 2012 21:38:14 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6RLcEHZ049239; Fri, 27 Jul 2012 21:38:14 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201207272138.q6RLcEHZ049239@svn.freebsd.org> From: Ed Maste Date: Fri, 27 Jul 2012 21:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238853 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 21:38:15 -0000 Author: emaste Date: Fri Jul 27 21:38:14 2012 New Revision: 238853 URL: http://svn.freebsd.org/changeset/base/238853 Log: Correct BUGS description of static buffer use Since r142667 strerror has unconditionally returned a pointer to a static buffer. MFC after: 1 week Modified: head/lib/libc/string/strerror.3 Modified: head/lib/libc/string/strerror.3 ============================================================================== --- head/lib/libc/string/strerror.3 Fri Jul 27 19:56:36 2012 (r238852) +++ head/lib/libc/string/strerror.3 Fri Jul 27 21:38:14 2012 (r238853) @@ -174,10 +174,10 @@ function was implemented in by .An Wes Peters Aq wes@FreeBSD.org . .Sh BUGS -For unknown error numbers, the +The .Fn strerror -function will return its result in a static buffer which -may be overwritten by subsequent calls. +function returns its result in a static buffer which +will be overwritten by subsequent calls. .Pp The return type for .Fn strerror From owner-svn-src-all@FreeBSD.ORG Fri Jul 27 22:09:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8ACBB106564A; Fri, 27 Jul 2012 22:09:33 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4BF658FC0A; Fri, 27 Jul 2012 22:09:33 +0000 (UTC) Received: by pbbro2 with SMTP id ro2so6083350pbb.13 for ; Fri, 27 Jul 2012 15:09:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=RuM62h0GMblbQBeeRBpedCvuK6ROybpDJWCMesubM6Q=; b=WPIGyXji9HcHI5EfizXFxpoNKGzyHcm66bFeMTwe4rMRW1gOPkbDdDQCYO3gj+QArX aSNchz9/ZbM6d1kx5+6uKJpPN9rNjbGIvXYMXHq2UvDKxS4qGwk4KBzaoSOaA7QMXlE1 GpUffZoC/1WQkFgJMtj2v7bwTyAbvdC7SQ2/eJinYrbdleqBq6bi6o7S+M7ZCXBgR3gb 5MXV8LNug/WBN2Ng92jTkceae1qyvH9xMCHIHovfS8U2DnyqdF8VZhKbBkYQMBDkvGz7 NO58ROojpferGoie9nrBU19ggLyZFrJIPhvbV0ENYnBBCrIAEFLBSivkYw2HryIqz61r LQzg== MIME-Version: 1.0 Received: by 10.68.212.138 with SMTP id nk10mr17288337pbc.93.1343426972926; Fri, 27 Jul 2012 15:09:32 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.66.136 with HTTP; Fri, 27 Jul 2012 15:09:32 -0700 (PDT) In-Reply-To: <201207251128.q6PBSFlt052575@svn.freebsd.org> References: <201207251128.q6PBSFlt052575@svn.freebsd.org> Date: Fri, 27 Jul 2012 15:09:32 -0700 X-Google-Sender-Auth: 1BD2FoV5caki-pBbAzT8ChBB7qo Message-ID: From: Adrian Chadd To: Luigi Rizzo Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238765 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 22:09:33 -0000 Hi, Can you please revert this commit for now? * it has some netmap stuff in it that isn't related to the commit; * it's causing panics due to lock recursion; * it likely has other issues you haven't yet found. :) Adrian On 25 July 2012 04:28, Luigi Rizzo wrote: > Author: luigi > Date: Wed Jul 25 11:28:15 2012 > New Revision: 238765 > URL: http://svn.freebsd.org/changeset/base/238765 > > Log: > Use legacy interrupts as a default. This gives up to 10% speedup > when used in qemu (and this driver is for non-PCIe cards, > so probably its largest use is in virtualized environments). > > Approved by: Jack Vogel > MFC after: 3 days > > Modified: > head/sys/dev/e1000/if_lem.c > > Modified: head/sys/dev/e1000/if_lem.c > ============================================================================== > --- head/sys/dev/e1000/if_lem.c Wed Jul 25 10:55:14 2012 (r238764) > +++ head/sys/dev/e1000/if_lem.c Wed Jul 25 11:28:15 2012 (r238765) > @@ -239,6 +239,7 @@ static void lem_enable_wakeup(device > static int lem_enable_phy_wakeup(struct adapter *); > static void lem_led_func(void *, int); > > +#define EM_LEGACY_IRQ /* slightly faster, at least in qemu */ > #ifdef EM_LEGACY_IRQ > static void lem_intr(void *); > #else /* FAST IRQ */ > @@ -1549,6 +1550,13 @@ lem_xmit(struct adapter *adapter, struct > u32 txd_upper, txd_lower, txd_used, txd_saved; > int error, nsegs, i, j, first, last = 0; > > +extern int netmap_drop; > + if (netmap_drop == 95) { > +dropme: > + m_freem(*m_headp); > + *m_headp = NULL; > + return (ENOBUFS); > + } > m_head = *m_headp; > txd_upper = txd_lower = txd_used = txd_saved = 0; > > @@ -1688,6 +1696,9 @@ lem_xmit(struct adapter *adapter, struct > } > } > > + if (netmap_drop == 96) > + goto dropme; > + > adapter->next_avail_tx_desc = i; > > if (adapter->pcix_82544) > @@ -1715,6 +1726,16 @@ lem_xmit(struct adapter *adapter, struct > */ > ctxd->lower.data |= > htole32(E1000_TXD_CMD_EOP | E1000_TXD_CMD_RS); > + > +if (netmap_drop == 97) { > + static int count=0; > + if (count++ & 63 != 0) > + ctxd->lower.data &= > + ~htole32(E1000_TXD_CMD_RS); > + else > + D("preserve RS"); > + > +} > /* > * Keep track in the first buffer which > * descriptor will be written back > @@ -1733,6 +1754,12 @@ lem_xmit(struct adapter *adapter, struct > adapter->link_duplex == HALF_DUPLEX) > lem_82547_move_tail(adapter); > else { > +extern int netmap_repeat; > + if (netmap_repeat) { > + int x; > + for (x = 0; x < netmap_repeat; x++) > + E1000_WRITE_REG(&adapter->hw, E1000_TDT(0), i); > + } > E1000_WRITE_REG(&adapter->hw, E1000_TDT(0), i); > if (adapter->hw.mac.type == e1000_82547) > lem_82547_update_fifo_head(adapter, > @@ -2986,6 +3013,13 @@ lem_txeof(struct adapter *adapter) > return; > } > #endif /* DEV_NETMAP */ > +{ > + static int drops = 0; > + if (netmap_copy && drops++ < netmap_copy) > + return; > + drops = 0; > +} > + > if (adapter->num_tx_desc_avail == adapter->num_tx_desc) > return; > From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 04:40:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 13ED9106566B; Sat, 28 Jul 2012 04:40:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F27928FC0A; Sat, 28 Jul 2012 04:40:52 +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 q6S4eq8w084246; Sat, 28 Jul 2012 04:40:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6S4eqqc084244; Sat, 28 Jul 2012 04:40:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207280440.q6S4eqqc084244@svn.freebsd.org> From: Adrian Chadd Date: Sat, 28 Jul 2012 04:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238854 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 04:40:53 -0000 Author: adrian Date: Sat Jul 28 04:40:52 2012 New Revision: 238854 URL: http://svn.freebsd.org/changeset/base/238854 Log: Add a missing call to ath_txdma_teardown(). Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Jul 27 21:38:14 2012 (r238853) +++ head/sys/dev/ath/if_ath.c Sat Jul 28 04:40:52 2012 (r238854) @@ -916,6 +916,7 @@ ath_detach(struct ath_softc *sc) ath_dfs_detach(sc); ath_desc_free(sc); + ath_txdma_teardown(sc); ath_rxdma_teardown(sc); ath_tx_cleanup(sc); ath_hal_detach(sc->sc_ah); /* NB: sets chip in full sleep */ From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 04:42:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A2C661065674; Sat, 28 Jul 2012 04:42:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 745AC8FC19; Sat, 28 Jul 2012 04:42:06 +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 q6S4g6EL084377; Sat, 28 Jul 2012 04:42:06 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6S4g66H084373; Sat, 28 Jul 2012 04:42:06 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207280442.q6S4g66H084373@svn.freebsd.org> From: Adrian Chadd Date: Sat, 28 Jul 2012 04:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238855 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 04:42:06 -0000 Author: adrian Date: Sat Jul 28 04:42:05 2012 New Revision: 238855 URL: http://svn.freebsd.org/changeset/base/238855 Log: Flesh out the initial TX FIFO storage for each hardware TX queue. Modified: head/sys/dev/ath/if_ath_tx_edma.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Sat Jul 28 04:40:52 2012 (r238854) +++ head/sys/dev/ath/if_ath_tx_edma.c Sat Jul 28 04:42:05 2012 (r238855) @@ -131,9 +131,42 @@ __FBSDID("$FreeBSD$"); MALLOC_DECLARE(M_ATHDEV); static int +ath_edma_setup_txfifo(struct ath_softc *sc, int qnum) +{ + struct ath_tx_edma_fifo *te = &sc->sc_txedma[qnum]; + + te->m_fifo = malloc(sizeof(struct ath_buf *) * HAL_TXFIFO_DEPTH, + M_ATHDEV, + M_NOWAIT | M_ZERO); + if (te->m_fifo == NULL) { + device_printf(sc->sc_dev, "%s: malloc failed\n", + __func__); + return (-ENOMEM); + } + + /* + * Set initial "empty" state. + */ + te->m_fifo_head = te->m_fifo_tail = te->m_fifo_depth = 0; + + return (0); +} + +static int +ath_edma_free_txfifo(struct ath_softc *sc, int qnum) +{ + struct ath_tx_edma_fifo *te = &sc->sc_txedma[qnum]; + + /* XXX TODO: actually deref the ath_buf entries? */ + free(te->m_fifo, M_ATHDEV); + return (0); +} + +static int ath_edma_dma_txsetup(struct ath_softc *sc) { int error; + int i; error = ath_descdma_alloc_desc(sc, &sc->sc_txsdma, NULL, "txcomp", sc->sc_tx_statuslen, ATH_TXSTATUS_RING_SIZE); @@ -145,6 +178,10 @@ ath_edma_dma_txsetup(struct ath_softc *s sc->sc_txsdma.dd_desc_paddr, ATH_TXSTATUS_RING_SIZE); + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { + ath_edma_setup_txfifo(sc, i); + } + return (0); } @@ -152,6 +189,11 @@ ath_edma_dma_txsetup(struct ath_softc *s static int ath_edma_dma_txteardown(struct ath_softc *sc) { + int i; + + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { + ath_edma_free_txfifo(sc, i); + } ath_descdma_cleanup(sc, &sc->sc_txsdma, NULL); return (0); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sat Jul 28 04:40:52 2012 (r238854) +++ head/sys/dev/ath/if_athvar.h Sat Jul 28 04:42:05 2012 (r238855) @@ -397,6 +397,14 @@ struct ath_rx_edma { struct mbuf *m_rxpending; }; +struct ath_tx_edma_fifo { + struct ath_buf **m_fifo; + int m_fifolen; + int m_fifo_head; + int m_fifo_tail; + int m_fifo_depth; +}; + struct ath_tx_methods { int (*xmit_setup)(struct ath_softc *sc); int (*xmit_teardown)(struct ath_softc *sc); @@ -418,6 +426,7 @@ struct ath_softc { struct ath_rx_methods sc_rx; struct ath_rx_edma sc_rxedma[HAL_NUM_RX_QUEUES]; /* HP/LP queues */ struct ath_tx_methods sc_tx; + struct ath_tx_edma_fifo sc_txedma[HAL_NUM_TX_QUEUES]; int sc_rx_statuslen; int sc_tx_desclen; From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 06:38:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CADD1065673; Sat, 28 Jul 2012 06:38:45 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02CF18FC1C; Sat, 28 Jul 2012 06:38: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 q6S6ciQB093508; Sat, 28 Jul 2012 06:38:44 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6S6ciQj093496; Sat, 28 Jul 2012 06:38:44 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201207280638.q6S6ciQj093496@svn.freebsd.org> From: Martin Matuska Date: Sat, 28 Jul 2012 06:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238856 - in head: contrib/libarchive contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/libarchive... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 06:38:45 -0000 Author: mm Date: Sat Jul 28 06:38:44 2012 New Revision: 238856 URL: http://svn.freebsd.org/changeset/base/238856 Log: Update libarchive to 3.0.4 Added: head/contrib/libarchive/libarchive/archive_getdate.c - copied unchanged from r238825, vendor/libarchive/dist/libarchive/archive_getdate.c head/contrib/libarchive/libarchive/archive_match.c - copied unchanged from r238825, vendor/libarchive/dist/libarchive/archive_match.c head/contrib/libarchive/libarchive/archive_pathmatch.c - copied unchanged from r238825, vendor/libarchive/dist/libarchive/archive_pathmatch.c head/contrib/libarchive/libarchive/archive_pathmatch.h - copied unchanged from r238825, vendor/libarchive/dist/libarchive/archive_pathmatch.h head/contrib/libarchive/libarchive/archive_write_add_filter.c - copied unchanged from r238825, vendor/libarchive/dist/libarchive/archive_write_add_filter.c head/contrib/libarchive/libarchive/test/test_archive_getdate.c - copied unchanged from r238825, vendor/libarchive/dist/libarchive/test/test_archive_getdate.c head/contrib/libarchive/libarchive/test/test_archive_match_owner.c - copied unchanged from r238825, vendor/libarchive/dist/libarchive/test/test_archive_match_owner.c head/contrib/libarchive/libarchive/test/test_archive_match_path.c - copied unchanged from r238825, vendor/libarchive/dist/libarchive/test/test_archive_match_path.c head/contrib/libarchive/libarchive/test/test_archive_match_time.c - copied unchanged from r238825, vendor/libarchive/dist/libarchive/test/test_archive_match_time.c head/contrib/libarchive/libarchive/test/test_archive_pathmatch.c - copied unchanged from r238825, vendor/libarchive/dist/libarchive/test/test_archive_pathmatch.c head/contrib/libarchive/tar/test/test_format_newc.c - copied unchanged from r238825, vendor/libarchive/dist/tar/test/test_format_newc.c head/contrib/libarchive/tar/test/test_option_nodump.c - copied unchanged from r238825, vendor/libarchive/dist/tar/test/test_option_nodump.c Deleted: head/contrib/libarchive/cpio/test/test_pathmatch.c head/contrib/libarchive/libarchive_fe/matching.c head/contrib/libarchive/libarchive_fe/matching.h head/contrib/libarchive/libarchive_fe/pathmatch.c head/contrib/libarchive/libarchive_fe/pathmatch.h head/contrib/libarchive/tar/getdate.c head/contrib/libarchive/tar/test/test_getdate.c head/contrib/libarchive/tar/tree.c head/contrib/libarchive/tar/tree.h Modified: head/contrib/libarchive/NEWS head/contrib/libarchive/README head/contrib/libarchive/cpio/bsdcpio.1 head/contrib/libarchive/cpio/cmdline.c head/contrib/libarchive/cpio/cpio.c head/contrib/libarchive/cpio/cpio.h head/contrib/libarchive/cpio/test/main.c head/contrib/libarchive/cpio/test/test.h head/contrib/libarchive/libarchive/archive.h head/contrib/libarchive/libarchive/archive_acl.c head/contrib/libarchive/libarchive/archive_check_magic.c head/contrib/libarchive/libarchive/archive_endian.h head/contrib/libarchive/libarchive/archive_entry.3 head/contrib/libarchive/libarchive/archive_entry.c head/contrib/libarchive/libarchive/archive_entry.h head/contrib/libarchive/libarchive/archive_entry_acl.3 head/contrib/libarchive/libarchive/archive_entry_link_resolver.c head/contrib/libarchive/libarchive/archive_entry_linkify.3 head/contrib/libarchive/libarchive/archive_entry_paths.3 head/contrib/libarchive/libarchive/archive_entry_perms.3 head/contrib/libarchive/libarchive/archive_entry_stat.3 head/contrib/libarchive/libarchive/archive_entry_stat.c head/contrib/libarchive/libarchive/archive_entry_time.3 head/contrib/libarchive/libarchive/archive_ppmd7.c head/contrib/libarchive/libarchive/archive_private.h head/contrib/libarchive/libarchive/archive_read.3 head/contrib/libarchive/libarchive/archive_read.c head/contrib/libarchive/libarchive/archive_read_data.3 head/contrib/libarchive/libarchive/archive_read_disk.3 head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c head/contrib/libarchive/libarchive/archive_read_disk_posix.c head/contrib/libarchive/libarchive/archive_read_disk_private.h head/contrib/libarchive/libarchive/archive_read_extract.3 head/contrib/libarchive/libarchive/archive_read_filter.3 head/contrib/libarchive/libarchive/archive_read_format.3 head/contrib/libarchive/libarchive/archive_read_free.3 head/contrib/libarchive/libarchive/archive_read_header.3 head/contrib/libarchive/libarchive/archive_read_new.3 head/contrib/libarchive/libarchive/archive_read_open.3 head/contrib/libarchive/libarchive/archive_read_open_fd.c head/contrib/libarchive/libarchive/archive_read_open_filename.c head/contrib/libarchive/libarchive/archive_read_private.h head/contrib/libarchive/libarchive/archive_read_set_options.3 head/contrib/libarchive/libarchive/archive_read_support_filter_rpm.c head/contrib/libarchive/libarchive/archive_read_support_format_7zip.c head/contrib/libarchive/libarchive/archive_read_support_format_cab.c head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c head/contrib/libarchive/libarchive/archive_read_support_format_lha.c head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c head/contrib/libarchive/libarchive/archive_read_support_format_rar.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/libarchive/archive_read_support_format_xar.c head/contrib/libarchive/libarchive/archive_read_support_format_zip.c head/contrib/libarchive/libarchive/archive_string.c head/contrib/libarchive/libarchive/archive_string.h head/contrib/libarchive/libarchive/archive_string_composition.h head/contrib/libarchive/libarchive/archive_string_sprintf.c head/contrib/libarchive/libarchive/archive_util.3 head/contrib/libarchive/libarchive/archive_util.c head/contrib/libarchive/libarchive/archive_write.3 head/contrib/libarchive/libarchive/archive_write.c head/contrib/libarchive/libarchive/archive_write_add_filter_bzip2.c head/contrib/libarchive/libarchive/archive_write_add_filter_compress.c head/contrib/libarchive/libarchive/archive_write_add_filter_gzip.c head/contrib/libarchive/libarchive/archive_write_add_filter_program.c head/contrib/libarchive/libarchive/archive_write_add_filter_xz.c head/contrib/libarchive/libarchive/archive_write_blocksize.3 head/contrib/libarchive/libarchive/archive_write_data.3 head/contrib/libarchive/libarchive/archive_write_disk.3 head/contrib/libarchive/libarchive/archive_write_disk_posix.c head/contrib/libarchive/libarchive/archive_write_disk_set_standard_lookup.c head/contrib/libarchive/libarchive/archive_write_filter.3 head/contrib/libarchive/libarchive/archive_write_finish_entry.3 head/contrib/libarchive/libarchive/archive_write_format.3 head/contrib/libarchive/libarchive/archive_write_free.3 head/contrib/libarchive/libarchive/archive_write_header.3 head/contrib/libarchive/libarchive/archive_write_new.3 head/contrib/libarchive/libarchive/archive_write_open.3 head/contrib/libarchive/libarchive/archive_write_open_filename.c head/contrib/libarchive/libarchive/archive_write_private.h head/contrib/libarchive/libarchive/archive_write_set_format_7zip.c head/contrib/libarchive/libarchive/archive_write_set_format_ar.c head/contrib/libarchive/libarchive/archive_write_set_format_cpio.c head/contrib/libarchive/libarchive/archive_write_set_format_cpio_newc.c head/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c head/contrib/libarchive/libarchive/archive_write_set_format_mtree.c head/contrib/libarchive/libarchive/archive_write_set_format_pax.c head/contrib/libarchive/libarchive/archive_write_set_format_ustar.c head/contrib/libarchive/libarchive/archive_write_set_format_xar.c head/contrib/libarchive/libarchive/archive_write_set_format_zip.c head/contrib/libarchive/libarchive/archive_write_set_options.3 head/contrib/libarchive/libarchive/cpio.5 head/contrib/libarchive/libarchive/libarchive-formats.5 head/contrib/libarchive/libarchive/libarchive.3 head/contrib/libarchive/libarchive/libarchive_changes.3 head/contrib/libarchive/libarchive/libarchive_internals.3 head/contrib/libarchive/libarchive/tar.5 head/contrib/libarchive/libarchive/test/main.c head/contrib/libarchive/libarchive/test/read_open_memory.c head/contrib/libarchive/libarchive/test/test.h head/contrib/libarchive/libarchive/test/test_archive_string_conversion.c head/contrib/libarchive/libarchive/test/test_compat_zip.c head/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c head/contrib/libarchive/libarchive/test/test_read_format_7zip.c head/contrib/libarchive/libarchive/test/test_read_format_cab.c head/contrib/libarchive/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c head/contrib/libarchive/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c head/contrib/libarchive/libarchive/test/test_read_format_rar.c head/contrib/libarchive/libarchive/test/test_read_format_rar_unicode.rar.uu head/contrib/libarchive/libarchive/test/test_read_format_tar_filename.c head/contrib/libarchive/libarchive/test/test_read_pax_truncated.c head/contrib/libarchive/libarchive/test/test_read_position.c head/contrib/libarchive/libarchive/test/test_sparse_basic.c head/contrib/libarchive/libarchive/test/test_write_format_zip.c head/contrib/libarchive/libarchive_fe/err.c head/contrib/libarchive/libarchive_fe/err.h head/contrib/libarchive/tar/bsdtar.1 head/contrib/libarchive/tar/bsdtar.c head/contrib/libarchive/tar/bsdtar.h head/contrib/libarchive/tar/read.c head/contrib/libarchive/tar/test/main.c head/contrib/libarchive/tar/test/test.h head/contrib/libarchive/tar/write.c head/lib/libarchive/Makefile head/lib/libarchive/test/Makefile head/usr.bin/cpio/Makefile head/usr.bin/cpio/test/Makefile head/usr.bin/tar/Makefile head/usr.bin/tar/test/Makefile Directory Properties: head/contrib/libarchive/ (props changed) head/contrib/libarchive/cpio/ (props changed) head/contrib/libarchive/libarchive/ (props changed) head/contrib/libarchive/libarchive_fe/ (props changed) head/contrib/libarchive/tar/ (props changed) Modified: head/contrib/libarchive/NEWS ============================================================================== --- head/contrib/libarchive/NEWS Sat Jul 28 04:42:05 2012 (r238855) +++ head/contrib/libarchive/NEWS Sat Jul 28 06:38:44 2012 (r238856) @@ -1,14 +1,10 @@ -Jan 10, 2012: Issue 223: Skip atime tests if atime not supported -Jan 09, 2012: Issue 222: Errors saving sparse files to pax archives -Jan 09, 2012: Issue 221: allow archive_*_free(NULL) -Dec 31, 2011: Issue 212: configure script on Solaris -Dec 30, 2011: Issue 218: empty contents extracting Zip files with bsdcpio -Dec 30, 2011: Issue 217: fix compile warning -Dec 30, 2011: Issue 216: truncated filenames in listings -Dec 28, 2011: Issue 210: memory leak on Windows -Dec 28, 2011: Issue 206: fix hardlink tests on Windows 2000 -Dec 27, 2011: Issue 208: Don't hang when using external compression - program on Windows +Mar 27, 2012: libarchive 3.0.4 released + +Feb 05, 2012: libarchive development now hosted at GitHub. + http://libarchive.github.com/ +Feb 05, 2012: libarchive's issue tracker remains at Google Code. + http://code.google.com/p/libarchive/issues/list +Feb 05, 2012: libarchive's mailing lists remain at Google Groups. Dec 24, 2011: libarchive 3.0.2 released Dec 23, 2011: Various fixes merged from FreeBSD Modified: head/contrib/libarchive/README ============================================================================== --- head/contrib/libarchive/README Sat Jul 28 04:42:05 2012 (r238855) +++ head/contrib/libarchive/README Sat Jul 28 06:38:44 2012 (r238856) @@ -1,9 +1,14 @@ README for libarchive bundle. Questions? Issues? - * http://libarchive.googlecode.com/ is the home for ongoing - libarchive development, including issue tracker, additional - documentation, and links to the libarchive mailing lists. + * http://libarchive.github.com/ is the home for ongoing + libarchive development, including documentation, and + links to the libarchive mailing lists. + * To report an issue, use the issue tracker at + http://code.google.com/p/libarchive/issues/list + * To submit an enhancement to libarchive, please submit + a pull request via GitHub. + https://github.com/libarchive/libarchive/pulls This distribution bundle includes the following components: * libarchive: a library for reading and writing streaming archives @@ -66,6 +71,7 @@ Currently, the library automatically det * ZIP archives (with uncompressed or "deflate" compressed entries) * GNU and BSD 'ar' archives * 'mtree' format + * 7-Zip archives * Microsoft CAB format * LHA and LZH archives * RAR archives @@ -92,6 +98,7 @@ The library can create archives in any o * GNU and BSD 'ar' archives * 'mtree' format * ISO9660 format + * 7-Zip archives * XAR archives When creating archives, the result can be filtered with any of the following: Modified: head/contrib/libarchive/cpio/bsdcpio.1 ============================================================================== --- head/contrib/libarchive/cpio/bsdcpio.1 Sat Jul 28 04:42:05 2012 (r238855) +++ head/contrib/libarchive/cpio/bsdcpio.1 Sat Jul 28 06:38:44 2012 (r238856) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 21, 2007 +.Dd December 24, 2011 .Dt CPIO 1 .Os .Sh NAME Modified: head/contrib/libarchive/cpio/cmdline.c ============================================================================== --- head/contrib/libarchive/cpio/cmdline.c Sat Jul 28 04:42:05 2012 (r238855) +++ head/contrib/libarchive/cpio/cmdline.c Sat Jul 28 06:38:44 2012 (r238856) @@ -346,6 +346,7 @@ owner_parse(const char *spec, int *uid, snprintf(errbuff, sizeof(errbuff), "Couldn't lookup user ``%s''", user); errbuff[sizeof(errbuff) - 1] = '\0'; + free(user); return (errbuff); } } Modified: head/contrib/libarchive/cpio/cpio.c ============================================================================== --- head/contrib/libarchive/cpio/cpio.c Sat Jul 28 04:42:05 2012 (r238855) +++ head/contrib/libarchive/cpio/cpio.c Sat Jul 28 06:38:44 2012 (r238856) @@ -82,7 +82,6 @@ __FBSDID("$FreeBSD$"); #include "cpio.h" #include "err.h" #include "line_reader.h" -#include "matching.h" /* Fixed size of uname/gname caches. */ #define name_cache_size 101 @@ -190,6 +189,10 @@ main(int argc, char *argv[]) cpio->bytes_per_block = 512; cpio->filename = NULL; + cpio->matching = archive_match_new(); + if (cpio->matching == NULL) + lafe_errc(1, 0, "Out of memory"); + while ((opt = cpio_getopt(cpio)) != -1) { switch (opt) { case '0': /* GNU convention: --null, -0 */ @@ -216,14 +219,20 @@ main(int argc, char *argv[]) cpio->extract_flags &= ~ARCHIVE_EXTRACT_NO_AUTODIR; break; case 'E': /* NetBSD/OpenBSD */ - lafe_include_from_file(&cpio->matching, - cpio->argument, cpio->option_null); + if (archive_match_include_pattern_from_file( + cpio->matching, cpio->argument, + cpio->option_null) != ARCHIVE_OK) + lafe_errc(1, 0, "Error : %s", + archive_error_string(cpio->matching)); break; case 'F': /* NetBSD/OpenBSD/GNU cpio */ cpio->filename = cpio->argument; break; case 'f': /* POSIX 1997 */ - lafe_exclude(&cpio->matching, cpio->argument); + if (archive_match_exclude_pattern(cpio->matching, + cpio->argument) != ARCHIVE_OK) + lafe_errc(1, 0, "Error : %s", + archive_error_string(cpio->matching)); break; case 'H': /* GNU cpio (also --format) */ cpio->format = cpio->argument; @@ -369,9 +378,6 @@ main(int argc, char *argv[]) /* -v overrides -V */ if (cpio->dot && cpio->verbose) cpio->dot = 0; - /* -v overrides -V */ - if (cpio->dot && cpio->verbose) - cpio->dot = 0; /* TODO: Flag other nonsensical combinations. */ switch (cpio->mode) { @@ -385,7 +391,10 @@ main(int argc, char *argv[]) break; case 'i': while (*cpio->argv != NULL) { - lafe_include(&cpio->matching, *cpio->argv); + if (archive_match_include_pattern(cpio->matching, + *cpio->argv) != ARCHIVE_OK) + lafe_errc(1, 0, "Error : %s", + archive_error_string(cpio->matching)); --cpio->argc; ++cpio->argv; } @@ -405,6 +414,7 @@ main(int argc, char *argv[]) "Must specify at least one of -i, -o, or -p"); } + archive_match_free(cpio->matching); free_cache(cpio->gname_cache); free_cache(cpio->uname_cache); return (cpio->return_value); @@ -909,7 +919,7 @@ mode_in(struct cpio *cpio) lafe_errc(1, archive_errno(a), "%s", archive_error_string(a)); } - if (lafe_excluded(cpio->matching, archive_entry_pathname(entry))) + if (archive_match_path_excluded(cpio->matching, entry)) continue; if (cpio->option_rename) { destpath = cpio_rename(archive_entry_pathname(entry)); @@ -1011,7 +1021,7 @@ mode_list(struct cpio *cpio) lafe_errc(1, archive_errno(a), "%s", archive_error_string(a)); } - if (lafe_excluded(cpio->matching, archive_entry_pathname(entry))) + if (archive_match_path_excluded(cpio->matching, entry)) continue; if (cpio->verbose) list_item_verbose(cpio, entry); @@ -1306,7 +1316,8 @@ lookup_uname_helper(struct cpio *cpio, c if (pwent == NULL) { *name = NULL; if (errno != 0 && errno != ENOENT) - lafe_warnc(errno, "getpwuid(%d) failed", id); + lafe_warnc(errno, "getpwuid(%s) failed", + cpio_i64toa((int64_t)id)); return (errno); } @@ -1333,7 +1344,8 @@ lookup_gname_helper(struct cpio *cpio, c if (grent == NULL) { *name = NULL; if (errno != 0) - lafe_warnc(errno, "getgrgid(%d) failed", id); + lafe_warnc(errno, "getgrgid(%s) failed", + cpio_i64toa((int64_t)id)); return (errno); } Modified: head/contrib/libarchive/cpio/cpio.h ============================================================================== --- head/contrib/libarchive/cpio/cpio.h Sat Jul 28 04:42:05 2012 (r238855) +++ head/contrib/libarchive/cpio/cpio.h Sat Jul 28 06:38:44 2012 (r238856) @@ -31,8 +31,6 @@ #include "cpio_platform.h" #include -#include "matching.h" - /* * The internal state for the "cpio" program. * @@ -88,7 +86,7 @@ struct cpio { struct name_cache *gname_cache; /* Work data. */ - struct lafe_matching *matching; + struct archive *matching; char *buff; size_t buff_size; }; Modified: head/contrib/libarchive/cpio/test/main.c ============================================================================== --- head/contrib/libarchive/cpio/test/main.c Sat Jul 28 04:42:05 2012 (r238855) +++ head/contrib/libarchive/cpio/test/main.c Sat Jul 28 06:38:44 2012 (r238856) @@ -24,6 +24,9 @@ */ #include "test.h" +#ifdef HAVE_SYS_IOCTL_H +#include +#endif #ifdef HAVE_SYS_TIME_H #include #endif @@ -31,6 +34,16 @@ #ifdef HAVE_ICONV_H #include #endif +/* + * Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h. + * As the include guards don't agree, the order of include is important. + */ +#ifdef HAVE_LINUX_EXT2_FS_H +#include /* for Linux file flags */ +#endif +#if defined(HAVE_EXT2FS_EXT2_FS_H) && !defined(__CYGWIN__) +#include /* Linux file flags, broken on Cygwin */ +#endif #include #include #ifdef HAVE_SIGNAL_H @@ -116,7 +129,14 @@ __FBSDID("$FreeBSD$"); #endif #if defined(_WIN32) && !defined(__CYGWIN__) -void *GetFunctionKernel32(const char *name) +static void *GetFunctionKernel32(const char *); +static int my_CreateSymbolicLinkA(const char *, const char *, int); +static int my_CreateHardLinkA(const char *, const char *); +static int my_GetFileInformationByName(const char *, + BY_HANDLE_FILE_INFORMATION *); + +static void * +GetFunctionKernel32(const char *name) { static HINSTANCE lib; static int set; @@ -155,7 +175,7 @@ my_CreateHardLinkA(const char *linkname, return f == NULL ? 0 : (*f)(linkname, target, NULL); } -int +static int my_GetFileInformationByName(const char *path, BY_HANDLE_FILE_INFORMATION *bhfi) { HANDLE h; @@ -1507,7 +1527,7 @@ assertion_make_dir(const char *file, int /* Create a file with the specified contents and report any failures. */ int assertion_make_file(const char *file, int line, - const char *path, int mode, const char *contents) + const char *path, int mode, int csize, const void *contents) { #if defined(_WIN32) && !defined(__CYGWIN__) /* TODO: Rework this to set file mode as well. */ @@ -1521,8 +1541,13 @@ assertion_make_file(const char *file, in return (0); } if (contents != NULL) { - if (strlen(contents) - != fwrite(contents, 1, strlen(contents), f)) { + size_t wsize; + + if (csize < 0) + wsize = strlen(contents); + else + wsize = (size_t)csize; + if (wsize != fwrite(contents, 1, wsize, f)) { fclose(f); failure_start(file, line, "Could not write file %s", path); @@ -1542,10 +1567,16 @@ assertion_make_file(const char *file, in return (0); } if (contents != NULL) { - if ((ssize_t)strlen(contents) - != write(fd, contents, strlen(contents))) { + ssize_t wsize; + + if (csize < 0) + wsize = (ssize_t)strlen(contents); + else + wsize = (ssize_t)csize; + if (wsize != write(fd, contents, wsize)) { close(fd); - failure_start(file, line, "Could not write to %s", path); + failure_start(file, line, + "Could not write to %s", path); failure_finish(NULL); return (0); } @@ -1716,6 +1747,52 @@ assertion_utimes(const char *file, int l #endif /* defined(_WIN32) && !defined(__CYGWIN__) */ } +/* Set nodump, report failures. */ +int +assertion_nodump(const char *file, int line, const char *pathname) +{ +#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP) + int r; + + assertion_count(file, line); + r = chflags(pathname, UF_NODUMP); + if (r < 0) { + failure_start(file, line, "Can't set nodump %s\n", pathname); + failure_finish(NULL); + return (0); + } +#elif defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS)\ + && defined(EXT2_NODUMP_FL) + int fd, r, flags; + + assertion_count(file, line); + fd = open(pathname, O_RDONLY | O_NONBLOCK); + if (fd < 0) { + failure_start(file, line, "Can't open %s\n", pathname); + failure_finish(NULL); + return (0); + } + r = ioctl(fd, EXT2_IOC_GETFLAGS, &flags); + if (r < 0) { + failure_start(file, line, "Can't get flags %s\n", pathname); + failure_finish(NULL); + return (0); + } + flags |= EXT2_NODUMP_FL; + r = ioctl(fd, EXT2_IOC_SETFLAGS, &flags); + if (r < 0) { + failure_start(file, line, "Can't set nodump %s\n", pathname); + failure_finish(NULL); + return (0); + } + close(fd); +#else + (void)pathname; /* UNUSED */ + assertion_count(file, line); +#endif + return (1); +} + /* * * UTILITIES for use by tests. @@ -1744,7 +1821,7 @@ canSymlink(void) return (value); ++tested; - assertion_make_file(__FILE__, __LINE__, "canSymlink.0", 0644, "a"); + assertion_make_file(__FILE__, __LINE__, "canSymlink.0", 0644, 1, "a"); /* Note: Cygwin has its own symlink() emulation that does not * use the Win32 CreateSymbolicLink() function. */ #if defined(_WIN32) && !defined(__CYGWIN__) @@ -1794,6 +1871,70 @@ canGunzip(void) } /* + * Can this filesystem handle nodump flags. + */ +#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP) + +int +canNodump(void) +{ + const char *path = "cannodumptest"; + struct stat sb; + + assertion_make_file(__FILE__, __LINE__, path, 0644, 0, NULL); + if (chflags(path, UF_NODUMP) < 0) + return (0); + if (stat(path, &sb) < 0) + return (0); + if (sb.st_flags & UF_NODUMP) + return (1); + return (0); +} + +#elif defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS)\ + && defined(EXT2_NODUMP_FL) + +int +canNodump(void) +{ + const char *path = "cannodumptest"; + int fd, r, flags; + + assertion_make_file(__FILE__, __LINE__, path, 0644, 0, NULL); + fd = open(path, O_RDONLY | O_NONBLOCK); + if (fd < 0) + return (0); + r = ioctl(fd, EXT2_IOC_GETFLAGS, &flags); + if (r < 0) + return (0); + flags |= EXT2_NODUMP_FL; + r = ioctl(fd, EXT2_IOC_SETFLAGS, &flags); + if (r < 0) + return (0); + close(fd); + fd = open(path, O_RDONLY | O_NONBLOCK); + if (fd < 0) + return (0); + r = ioctl(fd, EXT2_IOC_GETFLAGS, &flags); + if (r < 0) + return (0); + close(fd); + if (flags & EXT2_NODUMP_FL) + return (1); + return (0); +} + +#else + +int +canNodump() +{ + return (0); +} + +#endif + +/* * Sleep as needed; useful for verifying disk timestamp changes by * ensuring that the wall-clock time has actually changed before we * go back to re-read something from disk. @@ -2236,17 +2377,77 @@ success: return strdup(buff); } +static int +get_test_set(int *test_set, int limit, const char *test) +{ + int start, end; + int idx = 0; + + if (test == NULL) { + /* Default: Run all tests. */ + for (;idx < limit; idx++) + test_set[idx] = idx; + return (limit); + } + if (*test >= '0' && *test <= '9') { + const char *vp = test; + start = 0; + while (*vp >= '0' && *vp <= '9') { + start *= 10; + start += *vp - '0'; + ++vp; + } + if (*vp == '\0') { + end = start; + } else if (*vp == '-') { + ++vp; + if (*vp == '\0') { + end = limit - 1; + } else { + end = 0; + while (*vp >= '0' && *vp <= '9') { + end *= 10; + end += *vp - '0'; + ++vp; + } + } + } else + return (-1); + if (start < 0 || end >= limit || start > end) + return (-1); + while (start <= end) + test_set[idx++] = start++; + } else { + size_t len = strlen(test); + for (start = 0; start < limit; ++start) { + const char *name = tests[start].name; + const char *p; + + while ((p = strchr(name, test[0])) != NULL) { + if (strncmp(p, test, len) == 0) { + test_set[idx++] = start; + break; + } else + name = p + 1; + } + + } + } + return ((idx == 0)?-1:idx); +} + int main(int argc, char **argv) { static const int limit = sizeof(tests) / sizeof(tests[0]); - int i = 0, j = 0, start, end, tests_run = 0, tests_failed = 0, option; + int test_set[sizeof(tests) / sizeof(tests[0])]; + int i = 0, j = 0, tests_run = 0, tests_failed = 0, option; time_t now; char *refdir_alloc = NULL; const char *progname; char **saved_argv; const char *tmp, *option_arg, *p; - char tmpdir[256], *pwd, *testprogdir, *tmp2 = NULL; + char tmpdir[256], *pwd, *testprogdir, *tmp2 = NULL, *vlevel = NULL; char tmpdir_timestamp[256]; (void)argc; /* UNUSED */ @@ -2332,6 +2533,19 @@ main(int argc, char **argv) if (getenv(ENVBASE "_DEBUG") != NULL) dump_on_failure = 1; + /* Allow -v to be controlled through the environment. */ + if (getenv("_VERBOSITY_LEVEL") != NULL) + { + vlevel = getenv("_VERBOSITY_LEVEL"); + verbosity = atoi(vlevel); + if (verbosity < VERBOSITY_SUMMARY_ONLY || verbosity > VERBOSITY_FULL) + { + /* Unsupported verbosity levels are silently ignored */ + vlevel = NULL; + verbosity = VERBOSITY_PASSFAIL; + } + } + /* Get the directory holding test files from environment. */ refdir = getenv(ENVBASE "_TEST_FILES"); @@ -2379,7 +2593,8 @@ main(int argc, char **argv) #endif break; case 'q': - verbosity--; + if (!vlevel) + verbosity--; break; case 'r': refdir = option_arg; @@ -2388,7 +2603,8 @@ main(int argc, char **argv) until_failure++; break; case 'v': - verbosity++; + if (!vlevel) + verbosity++; break; default: fprintf(stderr, "Unrecognized option '%c'\n", @@ -2501,78 +2717,27 @@ main(int argc, char **argv) saved_argv = argv; do { argv = saved_argv; - if (*argv == NULL) { - /* Default: Run all tests. */ - for (i = 0; i < limit; i++) { + do { + int test_num; + + test_num = get_test_set(test_set, limit, *argv); + if (test_num < 0) { + printf("*** INVALID Test %s\n", *argv); + free(refdir_alloc); + usage(progname); + return (1); + } + for (i = 0; i < test_num; i++) { tests_run++; - if (test_run(i, tmpdir)) { + if (test_run(test_set[i], tmpdir)) { tests_failed++; if (until_failure) goto finish; } } - } else { - while (*(argv) != NULL) { - if (**argv >= '0' && **argv <= '9') { - char *vp = *argv; - start = 0; - while (*vp >= '0' && *vp <= '9') { - start *= 10; - start += *vp - '0'; - ++vp; - } - if (*vp == '\0') { - end = start; - } else if (*vp == '-') { - ++vp; - if (*vp == '\0') { - end = limit - 1; - } else { - end = 0; - while (*vp >= '0' && *vp <= '9') { - end *= 10; - end += *vp - '0'; - ++vp; - } - } - } else { - printf("*** INVALID Test %s\n", *argv); - free(refdir_alloc); - usage(progname); - return (1); - } - if (start < 0 || end >= limit || start > end) { - printf("*** INVALID Test %s\n", *argv); - free(refdir_alloc); - usage(progname); - return (1); - } - } else { - for (start = 0; start < limit; ++start) { - if (strcmp(*argv, tests[start].name) == 0) - break; - } - end = start; - if (start >= limit) { - printf("*** INVALID Test ``%s''\n", - *argv); - free(refdir_alloc); - usage(progname); - /* usage() never returns */ - } - } - while (start <= end) { - tests_run++; - if (test_run(start, tmpdir)) { - tests_failed++; - if (until_failure) - goto finish; - } - ++start; - } + if (*argv != NULL) argv++; - } - } + } while (*argv != NULL); } while (until_failure); finish: Modified: head/contrib/libarchive/cpio/test/test.h ============================================================================== --- head/contrib/libarchive/cpio/test/test.h Sat Jul 28 04:42:05 2012 (r238855) +++ head/contrib/libarchive/cpio/test/test.h Sat Jul 28 06:38:44 2012 (r238856) @@ -194,11 +194,15 @@ #define assertMakeDir(dirname, mode) \ assertion_make_dir(__FILE__, __LINE__, dirname, mode) #define assertMakeFile(path, mode, contents) \ - assertion_make_file(__FILE__, __LINE__, path, mode, contents) + assertion_make_file(__FILE__, __LINE__, path, mode, -1, contents) +#define assertMakeBinFile(path, mode, csize, contents) \ + assertion_make_file(__FILE__, __LINE__, path, mode, csize, contents) #define assertMakeHardlink(newfile, oldfile) \ assertion_make_hardlink(__FILE__, __LINE__, newfile, oldfile) #define assertMakeSymlink(newfile, linkto) \ assertion_make_symlink(__FILE__, __LINE__, newfile, linkto) +#define assertNodump(path) \ + assertion_nodump(__FILE__, __LINE__, path) #define assertUmask(mask) \ assertion_umask(__FILE__, __LINE__, mask) #define assertUtimes(pathname, atime, atime_nsec, mtime, mtime_nsec) \ @@ -241,9 +245,10 @@ int assertion_is_not_hardlink(const char int assertion_is_reg(const char *, int, const char *, int); int assertion_is_symlink(const char *, int, const char *, const char *); int assertion_make_dir(const char *, int, const char *, int); -int assertion_make_file(const char *, int, const char *, int, const char *); +int assertion_make_file(const char *, int, const char *, int, int, const void *); int assertion_make_hardlink(const char *, int, const char *newpath, const char *); int assertion_make_symlink(const char *, int, const char *newpath, const char *); +int assertion_nodump(const char *, int, const char *); int assertion_non_empty_file(const char *, int, const char *); int assertion_text_file_contents(const char *, int, const char *buff, const char *f); int assertion_umask(const char *, int, int); @@ -267,6 +272,9 @@ int canGzip(void); /* Return true if this platform can run the "gunzip" program. */ int canGunzip(void); +/* Return true if this filesystem can handle nodump flags. */ +int canNodump(void); + /* Return true if the file has large i-node number(>0xffffffff). */ int is_LargeInode(const char *); Modified: head/contrib/libarchive/libarchive/archive.h ============================================================================== --- head/contrib/libarchive/libarchive/archive.h Sat Jul 28 04:42:05 2012 (r238855) +++ head/contrib/libarchive/libarchive/archive.h Sat Jul 28 06:38:44 2012 (r238856) @@ -56,23 +56,14 @@ # else # define __LA_SSIZE_T long # endif -# if defined(__BORLANDC__) -# define __LA_UID_T uid_t -# define __LA_GID_T gid_t -# else -# define __LA_UID_T short -# define __LA_GID_T short -# endif #else -# include /* ssize_t, uid_t, and gid_t */ +# include /* ssize_t */ # if defined(_SCO_DS) # define __LA_INT64_T long long # else # define __LA_INT64_T int64_t # endif # define __LA_SSIZE_T ssize_t -# define __LA_UID_T uid_t -# define __LA_GID_T gid_t #endif /* @@ -127,13 +118,13 @@ extern "C" { * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3000003 +#define ARCHIVE_VERSION_NUMBER 3000004 __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_STRING "libarchive 3.0.3" +#define ARCHIVE_VERSION_STRING "libarchive 3.0.4" __LA_DECL const char * archive_version_string(void); /* Declare our basic types. */ @@ -567,6 +558,8 @@ __LA_DECL int archive_write_set_compress __LA_DECL int archive_write_set_compression_xz(struct archive *); #endif +/* A convenience function to set the filter based on the code. */ +__LA_DECL int archive_write_add_filter(struct archive *, int filter_code); __LA_DECL int archive_write_add_filter_bzip2(struct archive *); __LA_DECL int archive_write_add_filter_compress(struct archive *); __LA_DECL int archive_write_add_filter_gzip(struct archive *); @@ -758,11 +751,42 @@ __LA_DECL int archive_read_disk_open_w(s * traversal. */ __LA_DECL int archive_read_disk_descend(struct archive *); +__LA_DECL int archive_read_disk_can_descend(struct archive *); __LA_DECL int archive_read_disk_current_filesystem(struct archive *); __LA_DECL int archive_read_disk_current_filesystem_is_synthetic(struct archive *); __LA_DECL int archive_read_disk_current_filesystem_is_remote(struct archive *); /* Request that the access time of the entry visited by travesal be restored. */ __LA_DECL int archive_read_disk_set_atime_restored(struct archive *); +/* + * Set behavior. The "flags" argument selects optional behavior. + */ +/* Request that the access time of the entry visited by travesal be restored. + * This is the same as archive_read_disk_set_atime_restored. */ +#define ARCHIVE_READDISK_RESTORE_ATIME (0x0001) +/* Default: Do not skip an entry which has nodump flags. */ +#define ARCHIVE_READDISK_HONOR_NODUMP (0x0002) +/* Default: Skip a mac resource fork file whose prefix is "._" because of + * using copyfile. */ +#define ARCHIVE_READDISK_MAC_COPYFILE (0x0004) +/* Default: Do not traverse mount points. */ +#define ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS (0x0008) + +__LA_DECL int archive_read_disk_set_behavior(struct archive *, + int flags); + +/* + * Set archive_match object that will be used in archive_read_disk to + * know whether an entry should be skipped. The callback function + * _excluded_func will be invoked when an entry is skipped by the result + * of archive_match. + */ +__LA_DECL int archive_read_disk_set_matching(struct archive *, + struct archive *_matching, void (*_excluded_func) + (struct archive *, void *, struct archive_entry *), + void *_client_data); +__LA_DECL int archive_read_disk_set_metadata_filter_callback(struct archive *, + int (*_metadata_filter_func)(struct archive *, void *, + struct archive_entry *), void *_client_data); /* * Accessor functions to read/set various information in @@ -802,14 +826,116 @@ __LA_DECL void archive_copy_error(stru struct archive *src); __LA_DECL int archive_file_count(struct archive *); +/* + * ARCHIVE_MATCH API + */ +__LA_DECL struct archive *archive_match_new(void); +__LA_DECL int archive_match_free(struct archive *); + +/* + * Test if archive_entry is excluded. + * This is a convenience function. This is the same as calling all + * archive_match_path_excluded, archive_match_time_excluded + * and archive_match_owner_excluded. + */ +__LA_DECL int archive_match_excluded(struct archive *, + struct archive_entry *); + +/* + * Test if pathname is excluded. The conditions are set by following functions. + */ +__LA_DECL int archive_match_path_excluded(struct archive *, + struct archive_entry *); +/* Add exclusion pathname pattern. */ +__LA_DECL int archive_match_exclude_pattern(struct archive *, const char *); +__LA_DECL int archive_match_exclude_pattern_w(struct archive *, + const wchar_t *); +/* Add exclusion pathname pattern from file. */ +__LA_DECL int archive_match_exclude_pattern_from_file(struct archive *, + const char *, int _nullSeparator); +__LA_DECL int archive_match_exclude_pattern_from_file_w(struct archive *, + const wchar_t *, int _nullSeparator); +/* Add inclusion pathname pattern. */ +__LA_DECL int archive_match_include_pattern(struct archive *, const char *); +__LA_DECL int archive_match_include_pattern_w(struct archive *, + const wchar_t *); +/* Add inclusion pathname pattern from file. */ +__LA_DECL int archive_match_include_pattern_from_file(struct archive *, + const char *, int _nullSeparator); +__LA_DECL int archive_match_include_pattern_from_file_w(struct archive *, + const wchar_t *, int _nullSeparator); +/* + * How to get statistic information for inclusion patterns. + */ +/* Return the amount number of unmatched inclusion patterns. */ +__LA_DECL int archive_match_path_unmatched_inclusions(struct archive *); +/* Return the pattern of unmatched inclusion with ARCHIVE_OK. + * Return ARCHIVE_EOF if there is no inclusion pattern. */ +__LA_DECL int archive_match_path_unmatched_inclusions_next( + struct archive *, const char **); +__LA_DECL int archive_match_path_unmatched_inclusions_next_w( + struct archive *, const wchar_t **); + +/* + * Test if a file is excluded by its time stamp. + * The conditions are set by following functions. + */ +__LA_DECL int archive_match_time_excluded(struct archive *, + struct archive_entry *); + +/* + * Flags to tell a matching type of time stamps. These are used for + * following functinos. + */ +/* Time flag: mtime to be tested. */ +#define ARCHIVE_MATCH_MTIME (0x0100) +/* Time flag: ctime to be tested. */ +#define ARCHIVE_MATCH_CTIME (0x0200) +/* Comparison flag: Match the time if it is newer than. */ +#define ARCHIVE_MATCH_NEWER (0x0001) +/* Comparison flag: Match the time if it is older than. */ +#define ARCHIVE_MATCH_OLDER (0x0002) +/* Comparison flag: Match the time if it is equal to. */ +#define ARCHIVE_MATCH_EQUAL (0x0010) +/* Set inclusion time. */ +__LA_DECL int archive_match_include_time(struct archive *, int _flag, + time_t _sec, long _nsec); +/* Set inclusion time by a date string. */ +__LA_DECL int archive_match_include_date(struct archive *, int _flag, + const char *_datestr); +__LA_DECL int archive_match_include_date_w(struct archive *, int _flag, + const wchar_t *_datestr); +/* Set inclusion time by a particluar file. */ +__LA_DECL int archive_match_include_file_time(struct archive *, + int _flag, const char *_pathname); +__LA_DECL int archive_match_include_file_time_w(struct archive *, + int _flag, const wchar_t *_pathname); +/* Add exclusion entry. */ +__LA_DECL int archive_match_exclude_entry(struct archive *, + int _flag, struct archive_entry *); + +/* + * Test if a file is excluded by its uid ,gid, uname or gname. + * The conditions are set by following functions. + */ +__LA_DECL int archive_match_owner_excluded(struct archive *, + struct archive_entry *); +/* Add inclusion uid, gid, uname and gname. */ +__LA_DECL int archive_match_include_uid(struct archive *, __LA_INT64_T); +__LA_DECL int archive_match_include_gid(struct archive *, __LA_INT64_T); +__LA_DECL int archive_match_include_uname(struct archive *, const char *); +__LA_DECL int archive_match_include_uname_w(struct archive *, + const wchar_t *); +__LA_DECL int archive_match_include_gname(struct archive *, const char *); +__LA_DECL int archive_match_include_gname_w(struct archive *, + const wchar_t *); + #ifdef __cplusplus } #endif /* These are meaningless outside of this header. */ #undef __LA_DECL -#undef __LA_GID_T -#undef __LA_UID_T /* These need to remain defined because they're used in the * callback type definitions. XXX Fix this. This is ugly. XXX */ Modified: head/contrib/libarchive/libarchive/archive_acl.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_acl.c Sat Jul 28 04:42:05 2012 (r238855) +++ head/contrib/libarchive/libarchive/archive_acl.c Sat Jul 28 06:38:44 2012 (r238856) @@ -422,8 +422,11 @@ archive_acl_next(struct archive *a, stru *permset = acl->acl_p->permset; *tag = acl->acl_p->tag; *id = acl->acl_p->id; - if (archive_mstring_get_mbs(a, &acl->acl_p->name, name) != 0) + if (archive_mstring_get_mbs(a, &acl->acl_p->name, name) != 0) { + if (errno == ENOMEM) + return (ARCHIVE_FATAL); *name = NULL; + } acl->acl_p = acl->acl_p->next; return (ARCHIVE_OK); } @@ -441,7 +444,7 @@ archive_acl_text_w(struct archive *a, st const wchar_t *prefix; wchar_t separator; struct archive_acl_entry *ap; - int id; + int id, r; wchar_t *wp; if (acl->acl_text_w != NULL) { @@ -461,9 +464,11 @@ archive_acl_text_w(struct archive *a, st length += 8; /* "default:" */ length += 5; /* tag name */ length += 1; /* colon */ - if (archive_mstring_get_wcs(a, &ap->name, &wname) == 0 && - wname != NULL) + r = archive_mstring_get_wcs(a, &ap->name, &wname); + if (r == 0 && wname != NULL) length += wcslen(wname); + else if (r < 0 && errno == ENOMEM) + return (NULL); else length += sizeof(uid_t) * 3 + 1; length ++; /* colon */ @@ -487,7 +492,7 @@ archive_acl_text_w(struct archive *a, st /* Now, allocate the string and actually populate it. */ wp = acl->acl_text_w = (wchar_t *)malloc(length * sizeof(wchar_t)); if (wp == NULL) - __archive_errx(1, "No memory to generate the text version of the ACL"); + return (NULL); count = 0; if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_USER_OBJ, NULL, @@ -502,16 +507,19 @@ archive_acl_text_w(struct archive *a, st ap = acl->acl_head; while (ap != NULL) { - if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0 && - archive_mstring_get_wcs(a, &ap->name, &wname) == 0) { - *wp++ = separator; - if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) - id = ap->id; - else - id = -1; - append_entry_w(&wp, NULL, ap->tag, wname, - ap->permset, id); - count++; + if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) { + r = archive_mstring_get_wcs(a, &ap->name, &wname); + if (r == 0) { + *wp++ = separator; + if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) + id = ap->id; + else + id = -1; + append_entry_w(&wp, NULL, ap->tag, wname, + ap->permset, id); + count++; + } else if (r < 0 && errno == ENOMEM) + return (NULL); } ap = ap->next; } @@ -526,17 +534,20 @@ archive_acl_text_w(struct archive *a, st ap = acl->acl_head; count = 0; while (ap != NULL) { - if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0 && - archive_mstring_get_wcs(a, &ap->name, &wname) == 0) { - if (count > 0) - *wp++ = separator; - if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 07:25:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08E2D106566C; Sat, 28 Jul 2012 07:25:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2FD98FC12; Sat, 28 Jul 2012 07:25:00 +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 q6S7P0XL097049; Sat, 28 Jul 2012 07:25:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6S7P0Ku097047; Sat, 28 Jul 2012 07:25:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207280725.q6S7P0Ku097047@svn.freebsd.org> From: Adrian Chadd Date: Sat, 28 Jul 2012 07:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238857 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 07:25:01 -0000 Author: adrian Date: Sat Jul 28 07:25:00 2012 New Revision: 238857 URL: http://svn.freebsd.org/changeset/base/238857 Log: Commit missing #define from a previous check-in. The AR9300 and later have an 8-deep TX FIFO for each hardware queue. Modified: head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Sat Jul 28 06:38:44 2012 (r238856) +++ head/sys/dev/ath/ath_hal/ah.h Sat Jul 28 07:25:00 2012 (r238857) @@ -220,6 +220,8 @@ typedef enum { #define HAL_NUM_RX_QUEUES 2 /* max possible # of queues */ +#define HAL_TXFIFO_DEPTH 8 /* transmit fifo depth */ + /* * Transmit queue subtype. These map directly to * WME Access Categories (except for UPSD). Refer From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 07:28:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 979EB106564A; Sat, 28 Jul 2012 07:28:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 816F38FC08; Sat, 28 Jul 2012 07:28:09 +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 q6S7S93u097320; Sat, 28 Jul 2012 07:28:09 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6S7S9Gj097313; Sat, 28 Jul 2012 07:28:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207280728.q6S7S9Gj097313@svn.freebsd.org> From: Adrian Chadd Date: Sat, 28 Jul 2012 07:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238858 - in head/sys/dev/ath/ath_hal: . ar5210 ar5211 ar5212 ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 07:28:09 -0000 Author: adrian Date: Sat Jul 28 07:28:08 2012 New Revision: 238858 URL: http://svn.freebsd.org/changeset/base/238858 Log: Flesh out the multi-rate retry capability. The existing method for testing for MRR is to call the "SetupXTXDesc" HAL method and see if it returns AH_TRUE or AH_FALSE. This capability explicitly lists what number of multi-rate attempts are possible. "1" means "one rate attempt supported". Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Sat Jul 28 07:25:00 2012 (r238857) +++ head/sys/dev/ath/ath_hal/ah.c Sat Jul 28 07:28:08 2012 (r238858) @@ -657,7 +657,8 @@ ath_hal_getcapability(struct ath_hal *ah } case HAL_CAP_RXBUFSIZE: case HAL_CAP_NUM_MR_RETRIES: - return HAL_EINVAL; /* XXX not yet */ + *result = pCap->halNumMRRetries; + return HAL_OK; case HAL_CAP_BT_COEX: return pCap->halBtCoexSupport ? HAL_OK : HAL_ENOTSUPP; case HAL_CAP_HT20_SGI: Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Sat Jul 28 07:25:00 2012 (r238857) +++ head/sys/dev/ath/ath_hal/ah_internal.h Sat Jul 28 07:28:08 2012 (r238858) @@ -252,6 +252,7 @@ typedef struct { int halRxStatusLen; int halRxHpFifoDepth; int halRxLpFifoDepth; + int halNumMRRetries; } HAL_CAPABILITIES; struct regDomain; Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Sat Jul 28 07:25:00 2012 (r238857) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Sat Jul 28 07:28:08 2012 (r238858) @@ -361,6 +361,7 @@ ar5210FillCapabilityInfo(struct ath_hal pCap->halSleepAfterBeaconBroken = AH_TRUE; pCap->halPSPollBroken = AH_FALSE; + pCap->halNumMRRetries = 1; /* No hardware MRR support */ pCap->halTotalQueues = HAL_NUM_TX_QUEUES; pCap->halKeyCacheSize = 64; Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Sat Jul 28 07:25:00 2012 (r238857) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Sat Jul 28 07:28:08 2012 (r238858) @@ -496,6 +496,7 @@ ar5211FillCapabilityInfo(struct ath_hal pCap->halSleepAfterBeaconBroken = AH_TRUE; pCap->halPSPollBroken = AH_TRUE; pCap->halVEOLSupport = AH_TRUE; + pCap->halNumMRRetries = 1; /* No hardware MRR support */ pCap->halTotalQueues = HAL_NUM_TX_QUEUES; pCap->halKeyCacheSize = 128; Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Sat Jul 28 07:25:00 2012 (r238857) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Sat Jul 28 07:28:08 2012 (r238858) @@ -824,6 +824,7 @@ ar5212FillCapabilityInfo(struct ath_hal pCap->halTurboGSupport = pCap->halWirelessModes & HAL_MODE_108G; pCap->halPSPollBroken = AH_TRUE; /* XXX fixed in later revs? */ + pCap->halNumMRRetries = 4; /* Hardware supports 4 MRR */ pCap->halVEOLSupport = AH_TRUE; pCap->halBssIdMaskSupport = AH_TRUE; pCap->halMcastKeySrchSupport = AH_TRUE; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sat Jul 28 07:25:00 2012 (r238857) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sat Jul 28 07:28:08 2012 (r238858) @@ -892,6 +892,7 @@ ar5416FillCapabilityInfo(struct ath_hal pCap->halTurboGSupport = pCap->halWirelessModes & HAL_MODE_108G; pCap->halPSPollBroken = AH_TRUE; /* XXX fixed in later revs? */ + pCap->halNumMRRetries = 4; /* Hardware supports 4 MRR */ pCap->halVEOLSupport = AH_TRUE; pCap->halBssIdMaskSupport = AH_TRUE; pCap->halMcastKeySrchSupport = AH_TRUE; /* Works on AR5416 and later */ From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 10:21:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6588B106566B; Sat, 28 Jul 2012 10:21:38 +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 34B3C8FC0C; Sat, 28 Jul 2012 10:21:38 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id BB41D46B17; Sat, 28 Jul 2012 06:21:37 -0400 (EDT) Date: Sat, 28 Jul 2012 11:21:37 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Warner Losh In-Reply-To: <523C5041-527B-4DBC-85E1-4AE846B014E6@bsdimp.com> Message-ID: References: <201207211407.q6LE7h9P042318@svn.freebsd.org> <20120721153026.GA8640@FreeBSD.org> <20120723071227.GE85230@FreeBSD.org> <523C5041-527B-4DBC-85E1-4AE846B014E6@bsdimp.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Alexey Dokuchaev , src-committers@freebsd.org, Garrett Cooper , svn-src-all@freebsd.org, Gleb Smirnoff , svn-src-head@freebsd.org Subject: Re: svn commit: r238672 - head/sys/dev/sdhci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 10:21:38 -0000 On Mon, 23 Jul 2012, Warner Losh wrote: >>> Never heard about this rule. Sorry. >> >> Actually, English spacing is discouraged in more recent texts; it was >> encouraged during the late 19th century up until the late 20th century >> according to ye great wikipedia [1], but I've read several other articles >> in the past decade that suggest that the English spacing convention be >> completely abolished. >> FWIW, I'd just follow surrounding style like style(9) suggests. No >> reason for fighting over an extra byte per sentence in a source file >> (unless you consider how much added bandwidth / disk space those precious >> bytes can consume :)...). Thanks, -Garrett > > Double spacing is the one true way I learned how to type in school. Since > the 1980's though, things have changed and many advocate single spaces. > However, that's for folks with fancy variable pitch font and such. For > fixed-witdh fonts, 2 is still preferred in some circles, including ours. Source code and terminal windows are probably the last bastions of fixed-width fonts, and given the overt use of white space in code styling, I think we can expect it to remain that way for the forseeable future. Maintaining the two-space separation helps in a number of ways, not least making it more clear when a period (full stop) is used for non-sentence ending punctuation, it's not ending a sentence -- e.g., in numbers lists, and even the "E.g.," earlier in this sentence. :-) Perhaps we should add a bit more information on comment formatting to style(9) and include this point. Robert From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 10:26:08 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF4E9106564A; Sat, 28 Jul 2012 10:26:08 +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 A0EDB8FC0A; Sat, 28 Jul 2012 10:26:08 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 4AB1246B17; Sat, 28 Jul 2012 06:26:08 -0400 (EDT) Date: Sat, 28 Jul 2012 11:26:08 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: David Schultz In-Reply-To: <20120724123721.GA65519@zim.MIT.EDU> Message-ID: References: <201207041951.q64JpPXu029310@svn.freebsd.org> <20120704200220.GM2337@deviant.kiev.zoral.com.ua> <20120704203239.GA42326@vniz.net> <4FF4AC3D.9070109@FreeBSD.org> <20120724123721.GA65519@zim.MIT.EDU> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Doug Barton , Pawel Jakub Dawidek , svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG, src-committers@FreeBSD.ORG, Konstantin Belousov , Andrey Chernov , markm@FreeBSD.ORG Subject: Re: svn commit: r238118 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 10:26:09 -0000 On Tue, 24 Jul 2012, David Schultz wrote: > On Wed, Jul 04, 2012, Doug Barton wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA256 >> >> On 07/04/2012 13:32, Andrey Chernov wrote: >>> 1) /dev/urandom may not exist in jails/sandboxes >> >> That would be a pretty serious configuration error. > > Yes -- but the scary part is that arc4random() is not fail-safe at all. If > /dev/random isn't there, you just silently get predictable "randomness". > If you needed that randomness for cryptographic purposes you're out of luck; > you might as well have used rot13. Using the sysctl doesn't fix the failure > mode (in fact, as I recall the sysctl dubiously never reports failure even > if there is no entropy), but there's a narrower set of circumstances under > which the sysctl can fail. Probably the most important thing for us to do is to make it clear which sources of randomness are appropriate for use in cryptography, and then propagate information to the downstream APIs as needed. Given its chequered past, it's clear that srandomdev() on FreeBSD is not appropriate for use in generating keys -- programmers should prefer the OpenSSL APIs. Currently, programmers are directed to arc4random(3) by random(3), but I'm actually not sure that is the right advice. I'm of the (possibly debateable) view that no randomness initialisation routine that can't return a failure is appropriate for cryptographic purposes -- if generating a key and /dev/random can't be found, or only the kernel arc4random bits are available but they aren't known to be good for key generation, then key generation should fail. Robert From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 11:09:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C8823106564A; Sat, 28 Jul 2012 11:09:03 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 995168FC0C; Sat, 28 Jul 2012 11:09:03 +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 q6SB93O1019080; Sat, 28 Jul 2012 11:09:03 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6SB93Qv019078; Sat, 28 Jul 2012 11:09:03 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201207281109.q6SB93Qv019078@svn.freebsd.org> From: Robert Watson Date: Sat, 28 Jul 2012 11:09:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238861 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 11:09:03 -0000 Author: rwatson Date: Sat Jul 28 11:09:03 2012 New Revision: 238861 URL: http://svn.freebsd.org/changeset/base/238861 Log: Merge FreeBSD/beri Perforce change @211945 to head: Modify MIPS page table entry (PTE) initialisation so that cachability bits are set only once, using is_cacheable_mem() to determine what caching properties are required, rather than also unconditionally setting PTE_C_CACHE in init_pte_prot(). As PTE_C_CACHE | PTE_C_UNCACHED == PTE_C_CACHE, this meant that all userspace memory mappings of device memory (incorrectly) used caching TLB entries. This is arguably not quite what we want, even though it is (more) consistent with the MIPS pmap design: PTE caching properties should be derived from machine-independent page table attributes, but this is a substantially more complex change as the MIPS pmap doesn't yet know about page attributes, causing it to ignore requests by device drivers that want uncached userspace memory mappings as they describe memory-mapped FIFOs or shared memory with a device not participating in the cache coherence scheme. This fixes cacheability issues (specifically, undesired and unrequested caching) seen in userspace memory mappings of Avalon SoC bus device memory on BERI MIPS. Discussed with: jmallett, alc Sponsored by: DARPA, AFRL MFC after: 3 days Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Sat Jul 28 07:56:23 2012 (r238860) +++ head/sys/mips/mips/pmap.c Sat Jul 28 11:09:03 2012 (r238861) @@ -3146,16 +3146,16 @@ init_pte_prot(vm_offset_t va, vm_page_t pt_entry_t rw; if (!(prot & VM_PROT_WRITE)) - rw = PTE_V | PTE_RO | PTE_C_CACHE; + rw = PTE_V | PTE_RO; else if ((m->oflags & VPO_UNMANAGED) == 0) { if ((m->md.pv_flags & PV_TABLE_MOD) != 0) - rw = PTE_V | PTE_D | PTE_C_CACHE; + rw = PTE_V | PTE_D; else - rw = PTE_V | PTE_C_CACHE; + rw = PTE_V; vm_page_aflag_set(m, PGA_WRITEABLE); } else /* Needn't emulate a modified bit for unmanaged pages. */ - rw = PTE_V | PTE_D | PTE_C_CACHE; + rw = PTE_V | PTE_D; return (rw); } From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 11:28:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7554106566B; Sat, 28 Jul 2012 11:28:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 783568FC16; Sat, 28 Jul 2012 11:28:01 +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 q6SBS1Mr020663; Sat, 28 Jul 2012 11:28:01 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6SBS11W020661; Sat, 28 Jul 2012 11:28:01 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201207281128.q6SBS11W020661@svn.freebsd.org> From: Dimitry Andric Date: Sat, 28 Jul 2012 11:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238862 - stable/9/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 11:28:01 -0000 Author: dim Date: Sat Jul 28 11:28:00 2012 New Revision: 238862 URL: http://svn.freebsd.org/changeset/base/238862 Log: MFC r238721: When WITHOUT_CLANG is being used, also clean out the clang 3.1 headers in OptionalObsoleteFiles.inc. PR: misc/169902 Submitted by: Thomas Eberhardt Approved by: re (kib) Modified: stable/9/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/9/tools/ (props changed) stable/9/tools/build/ (props changed) Modified: stable/9/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/9/tools/build/mk/OptionalObsoleteFiles.inc Sat Jul 28 11:09:03 2012 (r238861) +++ stable/9/tools/build/mk/OptionalObsoleteFiles.inc Sat Jul 28 11:28:00 2012 (r238862) @@ -659,6 +659,30 @@ OLD_FILES+=usr/include/clang/3.0/wmmintr OLD_FILES+=usr/include/clang/3.0/x86intrin.h OLD_FILES+=usr/include/clang/3.0/xmmintrin.h OLD_DIRS+=usr/include/clang/3.0 +OLD_FILES+=usr/include/clang/3.1/altivec.h +OLD_FILES+=usr/include/clang/3.1/avx2intrin.h +OLD_FILES+=usr/include/clang/3.1/avxintrin.h +OLD_FILES+=usr/include/clang/3.1/bmi2intrin.h +OLD_FILES+=usr/include/clang/3.1/bmiintrin.h +OLD_FILES+=usr/include/clang/3.1/cpuid.h +OLD_FILES+=usr/include/clang/3.1/emmintrin.h +OLD_FILES+=usr/include/clang/3.1/fma4intrin.h +OLD_FILES+=usr/include/clang/3.1/immintrin.h +OLD_FILES+=usr/include/clang/3.1/lzcntintrin.h +OLD_FILES+=usr/include/clang/3.1/mm3dnow.h +OLD_FILES+=usr/include/clang/3.1/mm_malloc.h +OLD_FILES+=usr/include/clang/3.1/mmintrin.h +OLD_FILES+=usr/include/clang/3.1/module.map +OLD_FILES+=usr/include/clang/3.1/nmmintrin.h +OLD_FILES+=usr/include/clang/3.1/pmmintrin.h +OLD_FILES+=usr/include/clang/3.1/popcntintrin.h +OLD_FILES+=usr/include/clang/3.1/smmintrin.h +OLD_FILES+=usr/include/clang/3.1/tmmintrin.h +OLD_FILES+=usr/include/clang/3.1/unwind.h +OLD_FILES+=usr/include/clang/3.1/wmmintrin.h +OLD_FILES+=usr/include/clang/3.1/x86intrin.h +OLD_FILES+=usr/include/clang/3.1/xmmintrin.h +OLD_DIRS+=usr/include/clang/3.1 OLD_DIRS+=usr/include/clang OLD_FILES+=usr/share/doc/llvm/clang/LICENSE.TXT OLD_DIRS+=usr/share/doc/llvm/clang From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 12:50:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F31C106566C; Sat, 28 Jul 2012 12:50:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3994D8FC0A; Sat, 28 Jul 2012 12:50: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 q6SCoQBG027519; Sat, 28 Jul 2012 12:50:26 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6SCoQfS027517; Sat, 28 Jul 2012 12:50:26 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201207281250.q6SCoQfS027517@svn.freebsd.org> From: Dimitry Andric Date: Sat, 28 Jul 2012 12:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238863 - head/contrib/llvm/tools/clang/lib/Driver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 12:50:26 -0000 Author: dim Date: Sat Jul 28 12:50:25 2012 New Revision: 238863 URL: http://svn.freebsd.org/changeset/base/238863 Log: Similar to r238472, let clang pass --enable-new-dtags to the linker invocation by default. Also make sure --hash-style=both is passed for the same arches as gcc, e.g. arm, sparc and x86. X-MFC-with: r238472 Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sat Jul 28 11:28:00 2012 (r238862) +++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sat Jul 28 12:50:25 2012 (r238863) @@ -4761,8 +4761,10 @@ void freebsd::Link::ConstructJob(Compila CmdArgs.push_back("/libexec/ld-elf.so.1"); } llvm::Triple::ArchType Arch = getToolChain().getArch(); - if (Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64) + if (Arch == llvm::Triple::arm || Arch == llvm::Triple::sparc || + Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64) CmdArgs.push_back("--hash-style=both"); + CmdArgs.push_back("--enable-new-dtags"); } // When building 32-bit code on FreeBSD/amd64, we have to explicitly From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 13:12:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 965E0106564A; Sat, 28 Jul 2012 13:12:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8077E8FC0A; Sat, 28 Jul 2012 13:12: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 q6SDCwJR029342; Sat, 28 Jul 2012 13:12:58 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6SDCweE029339; Sat, 28 Jul 2012 13:12:58 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201207281312.q6SDCweE029339@svn.freebsd.org> From: Dimitry Andric Date: Sat, 28 Jul 2012 13:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238864 - head/contrib/llvm/tools/clang/lib/Driver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 13:12:58 -0000 Author: dim Date: Sat Jul 28 13:12:57 2012 New Revision: 238864 URL: http://svn.freebsd.org/changeset/base/238864 Log: Similar to what is already done for Linux, make clang not complain about unused -g, -emit-llvm or -w arguments when doing linking. E.g. invoking "clang -g foo.o -o foo" will now be silent. Reported by: Jakub Lach MFC after: 1 week Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sat Jul 28 12:50:25 2012 (r238863) +++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sat Jul 28 13:12:57 2012 (r238864) @@ -4745,6 +4745,14 @@ void freebsd::Link::ConstructJob(Compila const Driver &D = getToolChain().getDriver(); ArgStringList CmdArgs; + // Silence warning for "clang -g foo.o -o foo" + Args.ClaimAllArgs(options::OPT_g_Group); + // and "clang -emit-llvm foo.o -o foo" + Args.ClaimAllArgs(options::OPT_emit_llvm); + // and for "clang -w foo.o -o foo". Other warning options are already + // handled somewhere else. + Args.ClaimAllArgs(options::OPT_w); + if (!D.SysRoot.empty()) CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot)); From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 14:32:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4970A106564A; Sat, 28 Jul 2012 14:32:56 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33F508FC08; Sat, 28 Jul 2012 14:32:56 +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 q6SEWuDH035736; Sat, 28 Jul 2012 14:32:56 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6SEWtnq035734; Sat, 28 Jul 2012 14:32:55 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201207281432.q6SEWtnq035734@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 28 Jul 2012 14:32:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238865 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 14:32:56 -0000 Author: jilles Date: Sat Jul 28 14:32:55 2012 New Revision: 238865 URL: http://svn.freebsd.org/changeset/base/238865 Log: sh: Track continued jobs (even if not continued by bg or fg). This uses wait3's WCONTINUED flag. There is no message for this. The change is visible in "jobs" or if the job stops again. Modified: head/bin/sh/jobs.c Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sat Jul 28 13:12:57 2012 (r238864) +++ head/bin/sh/jobs.c Sat Jul 28 14:32:55 2012 (r238865) @@ -1027,7 +1027,8 @@ dowait(int block, struct job *job) pid = waitproc(block, &status); TRACE(("wait returns %d, status=%d\n", (int)pid, status)); } while ((pid == -1 && errno == EINTR && breakwaitcmd == 0) || - (pid > 0 && WIFSTOPPED(status) && !iflag)); + (pid > 0 && (WIFSTOPPED(status) || WIFCONTINUED(status)) && + !iflag)); if (pid == -1 && errno == ECHILD && job != NULL) job->state = JOBDONE; if (breakwaitcmd != 0) { @@ -1050,7 +1051,11 @@ dowait(int block, struct job *job) TRACE(("Changing status of proc %d from 0x%x to 0x%x\n", (int)pid, sp->status, status)); - sp->status = status; + if (WIFCONTINUED(status)) { + sp->status = -1; + jp->state = 0; + } else + sp->status = status; thisjob = jp; } if (sp->status == -1) @@ -1118,7 +1123,7 @@ waitproc(int block, int *status) int flags; #if JOBS - flags = WUNTRACED; + flags = WUNTRACED | WCONTINUED; #else flags = 0; #endif From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 14:56:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BD0391065670; Sat, 28 Jul 2012 14:56:50 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A81C88FC08; Sat, 28 Jul 2012 14:56: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 q6SEuoEG037640; Sat, 28 Jul 2012 14:56:50 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6SEuofL037638; Sat, 28 Jul 2012 14:56:50 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201207281456.q6SEuofL037638@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 28 Jul 2012 14:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238866 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 14:56:50 -0000 Author: jilles Date: Sat Jul 28 14:56:50 2012 New Revision: 238866 URL: http://svn.freebsd.org/changeset/base/238866 Log: sh: Inline waitproc() into its only caller. Modified: head/bin/sh/jobs.c Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sat Jul 28 14:32:55 2012 (r238865) +++ head/bin/sh/jobs.c Sat Jul 28 14:56:50 2012 (r238866) @@ -94,7 +94,6 @@ static void freejob(struct job *); static struct job *getjob(char *); pid_t getjobpgrp(char *); static pid_t dowait(int, struct job *); -static pid_t waitproc(int, int *); static void checkzombies(void); static void cmdtxt(union node *); static void cmdputs(const char *); @@ -1021,10 +1020,18 @@ dowait(int block, struct job *job) int stopped; int sig; int coredump; + int wflags; TRACE(("dowait(%d) called\n", block)); do { - pid = waitproc(block, &status); +#if JOBS + wflags = WUNTRACED | WCONTINUED; +#else + wflags = 0; +#endif + if (block == 0) + wflags |= WNOHANG; + pid = wait3(&status, wflags, (struct rusage *)NULL); TRACE(("wait returns %d, status=%d\n", (int)pid, status)); } while ((pid == -1 && errno == EINTR && breakwaitcmd == 0) || (pid > 0 && (WIFSTOPPED(status) || WIFCONTINUED(status)) && @@ -1113,26 +1120,6 @@ dowait(int block, struct job *job) /* - * Do a wait system call. If job control is compiled in, we accept - * stopped processes. If block is zero, we return a value of zero - * rather than blocking. - */ -static pid_t -waitproc(int block, int *status) -{ - int flags; - -#if JOBS - flags = WUNTRACED | WCONTINUED; -#else - flags = 0; -#endif - if (block == 0) - flags |= WNOHANG; - return wait3(status, flags, (struct rusage *)NULL); -} - -/* * return 1 if there are stopped jobs, otherwise 0 */ int job_warning = 0; From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 15:13:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AD56106566B; Sat, 28 Jul 2012 15:13:49 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E98028FC15; Sat, 28 Jul 2012 15:13:48 +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 q6SFDmbj038979; Sat, 28 Jul 2012 15:13:48 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6SFDm8A038977; Sat, 28 Jul 2012 15:13:48 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201207281513.q6SFDm8A038977@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 28 Jul 2012 15:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238867 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 15:13:49 -0000 Author: jilles Date: Sat Jul 28 15:13:48 2012 New Revision: 238867 URL: http://svn.freebsd.org/changeset/base/238867 Log: sh: Do not ask for stopped/continued processes if we do not need them rather than retrying wait3 if they happen. Modified: head/bin/sh/jobs.c Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sat Jul 28 14:56:50 2012 (r238866) +++ head/bin/sh/jobs.c Sat Jul 28 15:13:48 2012 (r238867) @@ -1025,17 +1025,16 @@ dowait(int block, struct job *job) TRACE(("dowait(%d) called\n", block)); do { #if JOBS - wflags = WUNTRACED | WCONTINUED; -#else - wflags = 0; + if (iflag) + wflags = WUNTRACED | WCONTINUED; + else #endif + wflags = 0; if (block == 0) wflags |= WNOHANG; pid = wait3(&status, wflags, (struct rusage *)NULL); TRACE(("wait returns %d, status=%d\n", (int)pid, status)); - } while ((pid == -1 && errno == EINTR && breakwaitcmd == 0) || - (pid > 0 && (WIFSTOPPED(status) || WIFCONTINUED(status)) && - !iflag)); + } while (pid == -1 && errno == EINTR && breakwaitcmd == 0); if (pid == -1 && errno == ECHILD && job != NULL) job->state = JOBDONE; if (breakwaitcmd != 0) { From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 16:30:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E888D106566C; Sat, 28 Jul 2012 16:30:50 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8D6F8FC0C; Sat, 28 Jul 2012 16: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 q6SGUoxV046203; Sat, 28 Jul 2012 16:30:50 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6SGUosQ046201; Sat, 28 Jul 2012 16:30:50 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201207281630.q6SGUosQ046201@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 28 Jul 2012 16:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238868 - head/sys/geom/gate X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 16:30:51 -0000 Author: trociny Date: Sat Jul 28 16:30:50 2012 New Revision: 238868 URL: http://svn.freebsd.org/changeset/base/238868 Log: Reorder things in g_gate_create() so at the moment when g_new_geomf() is called name is properly initialized. Discussed with: pjd MFC after: 2 weeks Modified: head/sys/geom/gate/g_gate.c Modified: head/sys/geom/gate/g_gate.c ============================================================================== --- head/sys/geom/gate/g_gate.c Sat Jul 28 15:13:48 2012 (r238867) +++ head/sys/geom/gate/g_gate.c Sat Jul 28 16:30:50 2012 (r238868) @@ -470,6 +470,44 @@ g_gate_create(struct g_gate_ctl_create * return (EINVAL); } + sc = malloc(sizeof(*sc), M_GATE, M_WAITOK | M_ZERO); + sc->sc_flags = (ggio->gctl_flags & G_GATE_USERFLAGS); + strlcpy(sc->sc_info, ggio->gctl_info, sizeof(sc->sc_info)); + sc->sc_seq = 1; + bioq_init(&sc->sc_inqueue); + bioq_init(&sc->sc_outqueue); + mtx_init(&sc->sc_queue_mtx, "gg:queue", NULL, MTX_DEF); + sc->sc_queue_count = 0; + sc->sc_queue_size = ggio->gctl_maxcount; + if (sc->sc_queue_size > G_GATE_MAX_QUEUE_SIZE) + sc->sc_queue_size = G_GATE_MAX_QUEUE_SIZE; + sc->sc_timeout = ggio->gctl_timeout; + callout_init(&sc->sc_callout, CALLOUT_MPSAFE); + + mtx_lock(&g_gate_units_lock); + sc->sc_unit = g_gate_getunit(ggio->gctl_unit, &error); + if (sc->sc_unit < 0) + goto fail1; + if (ggio->gctl_unit == G_GATE_NAME_GIVEN) + snprintf(name, sizeof(name), "%s", ggio->gctl_name); + else { + snprintf(name, sizeof(name), "%s%d", G_GATE_PROVIDER_NAME, + sc->sc_unit); + } + /* Check for name collision. */ + for (unit = 0; unit < g_gate_maxunits; unit++) { + if (g_gate_units[unit] == NULL) + continue; + if (strcmp(name, g_gate_units[unit]->sc_name) != 0) + continue; + error = EEXIST; + goto fail1; + } + sc->sc_name = name; + g_gate_units[sc->sc_unit] = sc; + g_gate_nunits++; + mtx_unlock(&g_gate_units_lock); + g_topology_lock(); if (ggio->gctl_readprov[0] == '\0') { @@ -477,38 +515,24 @@ g_gate_create(struct g_gate_ctl_create * } else { ropp = g_provider_by_name(ggio->gctl_readprov); if (ropp == NULL) { - g_topology_unlock(); G_GATE_DEBUG(1, "Provider %s doesn't exist.", ggio->gctl_readprov); - return (EINVAL); + error = EINVAL; + goto fail2; } if ((ggio->gctl_readoffset % ggio->gctl_sectorsize) != 0) { - g_topology_unlock(); G_GATE_DEBUG(1, "Invalid read offset."); - return (EINVAL); + error = EINVAL; + goto fail2; } if (ggio->gctl_mediasize + ggio->gctl_readoffset > ropp->mediasize) { - g_topology_unlock(); G_GATE_DEBUG(1, "Invalid read offset or media size."); - return (EINVAL); + error = EINVAL; + goto fail2; } } - sc = malloc(sizeof(*sc), M_GATE, M_WAITOK | M_ZERO); - sc->sc_flags = (ggio->gctl_flags & G_GATE_USERFLAGS); - strlcpy(sc->sc_info, ggio->gctl_info, sizeof(sc->sc_info)); - sc->sc_seq = 1; - bioq_init(&sc->sc_inqueue); - bioq_init(&sc->sc_outqueue); - mtx_init(&sc->sc_queue_mtx, "gg:queue", NULL, MTX_DEF); - sc->sc_queue_count = 0; - sc->sc_queue_size = ggio->gctl_maxcount; - if (sc->sc_queue_size > G_GATE_MAX_QUEUE_SIZE) - sc->sc_queue_size = G_GATE_MAX_QUEUE_SIZE; - sc->sc_timeout = ggio->gctl_timeout; - callout_init(&sc->sc_callout, CALLOUT_MPSAFE); - gp = g_new_geomf(&g_gate_class, "%s", name); gp->start = g_gate_start; gp->access = g_gate_access; @@ -521,70 +545,18 @@ g_gate_create(struct g_gate_ctl_create * error = g_attach(cp, ropp); if (error != 0) { G_GATE_DEBUG(1, "Unable to attach to %s.", ropp->name); - } else { - error = g_access(cp, 1, 0, 0); - if (error != 0) { - G_GATE_DEBUG(1, "Unable to access %s.", - ropp->name); - g_detach(cp); - } + goto fail3; } + error = g_access(cp, 1, 0, 0); if (error != 0) { - g_destroy_consumer(cp); - g_destroy_geom(gp); - g_topology_unlock(); - mtx_destroy(&sc->sc_queue_mtx); - free(sc, M_GATE); - return (error); + G_GATE_DEBUG(1, "Unable to access %s.", ropp->name); + g_detach(cp); + goto fail3; } sc->sc_readcons = cp; sc->sc_readoffset = ggio->gctl_readoffset; } - mtx_lock(&g_gate_units_lock); - sc->sc_unit = g_gate_getunit(ggio->gctl_unit, &error); - if (sc->sc_unit < 0) { - mtx_unlock(&g_gate_units_lock); - if (sc->sc_readcons != NULL) { - (void)g_access(sc->sc_readcons, -1, 0, 0); - g_detach(sc->sc_readcons); - g_destroy_consumer(sc->sc_readcons); - } - g_destroy_geom(gp); - g_topology_unlock(); - mtx_destroy(&sc->sc_queue_mtx); - free(sc, M_GATE); - return (error); - } - if (ggio->gctl_unit == G_GATE_NAME_GIVEN) - snprintf(name, sizeof(name), "%s", ggio->gctl_name); - else { - snprintf(name, sizeof(name), "%s%d", G_GATE_PROVIDER_NAME, - sc->sc_unit); - } - /* Check for name collision. */ - for (unit = 0; unit < g_gate_maxunits; unit++) { - if (g_gate_units[unit] == NULL) - continue; - if (strcmp(name, g_gate_units[unit]->sc_name) != 0) - continue; - mtx_unlock(&g_gate_units_lock); - if (sc->sc_readcons != NULL) { - (void)g_access(sc->sc_readcons, -1, 0, 0); - g_detach(sc->sc_readcons); - g_destroy_consumer(sc->sc_readcons); - } - g_destroy_geom(gp); - g_topology_unlock(); - mtx_destroy(&sc->sc_queue_mtx); - free(sc, M_GATE); - return (EEXIST); - } - sc->sc_name = name; - g_gate_units[sc->sc_unit] = sc; - g_gate_nunits++; - mtx_unlock(&g_gate_units_lock); - ggio->gctl_unit = sc->sc_unit; pp = g_new_providerf(gp, "%s", name); @@ -604,6 +576,20 @@ g_gate_create(struct g_gate_ctl_create * g_gate_guard, sc); } return (0); +fail3: + g_destroy_consumer(cp); + g_destroy_geom(gp); +fail2: + g_topology_unlock(); + mtx_lock(&g_gate_units_lock); + g_gate_units[sc->sc_unit] = NULL; + KASSERT(g_gate_nunits > 0, ("negative g_gate_nunits?")); + g_gate_nunits--; +fail1: + mtx_unlock(&g_gate_units_lock); + mtx_destroy(&sc->sc_queue_mtx); + free(sc, M_GATE); + return (error); } static int From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 18:01:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 41BFF1065673; Sat, 28 Jul 2012 18:01:45 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [46.28.110.116]) by mx1.freebsd.org (Postfix) with ESMTP id ED2DA8FC19; Sat, 28 Jul 2012 18:01:44 +0000 (UTC) Received: by vlakno.cz (Postfix, from userid 1002) id DD0B87F3A0C; Sat, 28 Jul 2012 20:01:37 +0200 (CEST) Date: Sat, 28 Jul 2012 20:01:37 +0200 From: Roman Divacky To: Dimitry Andric Message-ID: <20120728180137.GA55575@freebsd.org> References: <201207281250.q6SCoQfS027517@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201207281250.q6SCoQfS027517@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238863 - head/contrib/llvm/tools/clang/lib/Driver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 18:01:45 -0000 It would be great to stay in sync with upstream. http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?r1=160103&r2=160231 On Sat, Jul 28, 2012 at 12:50:26PM +0000, Dimitry Andric wrote: > Author: dim > Date: Sat Jul 28 12:50:25 2012 > New Revision: 238863 > URL: http://svn.freebsd.org/changeset/base/238863 > > Log: > Similar to r238472, let clang pass --enable-new-dtags to the linker > invocation by default. Also make sure --hash-style=both is passed for > the same arches as gcc, e.g. arm, sparc and x86. > > X-MFC-with: r238472 > > Modified: > head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp > > Modified: head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp > ============================================================================== > --- head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sat Jul 28 11:28:00 2012 (r238862) > +++ head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp Sat Jul 28 12:50:25 2012 (r238863) > @@ -4761,8 +4761,10 @@ void freebsd::Link::ConstructJob(Compila > CmdArgs.push_back("/libexec/ld-elf.so.1"); > } > llvm::Triple::ArchType Arch = getToolChain().getArch(); > - if (Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64) > + if (Arch == llvm::Triple::arm || Arch == llvm::Triple::sparc || > + Arch == llvm::Triple::x86 || Arch == llvm::Triple::x86_64) > CmdArgs.push_back("--hash-style=both"); > + CmdArgs.push_back("--enable-new-dtags"); > } > > // When building 32-bit code on FreeBSD/amd64, we have to explicitly From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 20:06:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1931106566B; Sat, 28 Jul 2012 20:06:29 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB7538FC0A; Sat, 28 Jul 2012 20:06:29 +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 q6SK6TKv063063; Sat, 28 Jul 2012 20:06:29 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6SK6TAI063060; Sat, 28 Jul 2012 20:06:29 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201207282006.q6SK6TAI063060@svn.freebsd.org> From: Matt Jacob Date: Sat, 28 Jul 2012 20:06:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238869 - head/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 20:06:30 -0000 Author: mjacob Date: Sat Jul 28 20:06:29 2012 New Revision: 238869 URL: http://svn.freebsd.org/changeset/base/238869 Log: ----------- MISC CHANGES Add a new async event- ISP_TARGET_NOTIFY_ACK, that will guarantee eventual delivery of a NOTIFY ACK. This is tons better than just ignoring the return from isp_notify_ack and hoping for the best. Clean up the lower level lun enable code to be a bit more sensible. Fix a botch in isp_endcmd which was messing up the sense data. Fix notify ack for SRR to use a sensible error code in the case of a reject. Clean up and make clear what kind of firmware we've loaded and what capabilities it has. ----------- FULL (252 byte) SENSE DATA In CTIOs for the ISP, there's only a limimted amount of space to load SENSE DATA for associated CHECK CONDITIONS (24 or 26 bytes). This makes it difficult to send full SENSE DATA that can be up to 252 bytes. Implement MODE 2 responses which have us build the FCP Response in system memory which the ISP will put onto the wire directly. On the initiator side, the same problem occurs in that a command status response only has a limited amount of space for SENSE DATA. This data is supplemented by status continuation responses that the ISP pushes onto the response queue after the status response. We now pull them all together so that full sense data can be returned to the periph driver. This is supported on 23XX, 24XX and 25XX cards. This is also preparation for doing >16 byte CDBs. ----------- FC TAPE Implement full FC-TAPE on both initiator and target mode side. This capability is driven by firmware loaded, board type, board NVRAM settings, or hint configuration options to enable or disable. This is supported for 23XX, 24XX and 25XX cards. On the initiator side, we pretty much just have to generate a command reference number for each command we send out. This is FCP-4 compliant in that we do this per ITL nexus to generate the allowed 1 thru 255 CRN. In order to support the target side of FC-TAPE, we now pay attention to more of the PRLI word 3 parameters which will tell us whether an initiator wants confirmed responses. While we're at it, we'll pay attention to the initiator view too and report it. On sending back CTIOs, we will notice whether the initiator wants confirmed responses and we'll set up flags to do so. If a response or data frame is lost the initiator sends us an SRR (Sequence Retransmit Request) ELS which shows up as an SRR notify and all outstanding CTIOs are nuked with SRR Received status. The SRR notify contains the offset that the initiator wants us to restart the data transfer from or to retransmit the response frame. If the ISP driver still has the CCB around for which the data segment or response applies, it will retransmit. However, we typically don't know about a lost data frame until we send the FCP Response and the initiator totes up counters for data moved and notices missing segments. In this case we've already completed the data CCBs already and sent themn back up to the periph driver. Because there's no really clean mechanism yet in CAM to handle this, a hack has been put into place to complete the CTIO CCB with the CAM_MESSAGE_RECV status which will have a MODIFY DATA POINTER extended message in it. The internal ISP target groks this and ctl(8) will be modified to deal with this as well. At any rate, the data is retransmitted and an an FCP response is sent. The whole point here is to successfully complete a command so that you don't have to depend on ULP (SCSI) to have to recover, which in the case of tape is not really possible (hence the name FC-TAPE). Sponsored by: Spectralogic MFC after: 1 month Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_freebsd.h head/sys/dev/isp/isp_library.c head/sys/dev/isp/isp_library.h head/sys/dev/isp/isp_pci.c head/sys/dev/isp/isp_stds.h head/sys/dev/isp/isp_target.c head/sys/dev/isp/isp_target.h head/sys/dev/isp/ispmbox.h head/sys/dev/isp/ispvar.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sat Jul 28 16:30:50 2012 (r238868) +++ head/sys/dev/isp/isp.c Sat Jul 28 20:06:29 2012 (r238869) @@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$"); */ #define MBOX_DELAY_COUNT 1000000 / 100 #define ISP_MARK_PORTDB(a, b, c) \ - isp_prt(isp, ISP_LOGSANCFG, \ + isp_prt(isp, ISP_LOG_SANCFG, \ "Chan %d ISP_MARK_PORTDB@LINE %d", b, __LINE__); \ isp_mark_portdb(a, b, c) @@ -670,8 +670,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d ISP_DELAY(100); if (--loops < 0) { ISP_RESET0(isp); - isp_prt(isp, ISP_LOGERR, - "MBOX_BUSY never cleared on reset"); + isp_prt(isp, ISP_LOGERR, "MBOX_BUSY never cleared on reset"); return; } } @@ -1715,6 +1714,25 @@ isp_fibre_init(ispsoftc_t *isp) icbp->icb_xfwoptions = fcp->isp_xfwoptions; + if (ISP_CAP_FCTAPE(isp)) { + if (isp->isp_confopts & ISP_CFG_NOFCTAPE) + icbp->icb_xfwoptions &= ~ICBXOPT_FCTAPE; + + if (isp->isp_confopts & ISP_CFG_FCTAPE) + icbp->icb_xfwoptions |= ICBXOPT_FCTAPE; + + if (icbp->icb_xfwoptions & ICBXOPT_FCTAPE) { + icbp->icb_fwoptions &= ~ICBOPT_FULL_LOGIN; /* per documents */ + icbp->icb_xfwoptions |= ICBXOPT_FCTAPE_CCQ|ICBXOPT_FCTAPE_CONFIRM; + FCPARAM(isp, 0)->fctape_enabled = 1; + } else { + FCPARAM(isp, 0)->fctape_enabled = 0; + } + } else { + icbp->icb_xfwoptions &= ~ICBXOPT_FCTAPE; + FCPARAM(isp, 0)->fctape_enabled = 0; + } + /* * Prefer or force Point-To-Point instead Loop? */ @@ -1804,6 +1822,9 @@ isp_fibre_init(ispsoftc_t *isp) if (ISP_FW_NEWER_THAN(isp, 3, 16, 0)) { mbs.param[1] |= IFCOPT1_EQFQASYNC|IFCOPT1_CTIO_RETRY; if (fcp->role & ISP_ROLE_TARGET) { + if (ISP_FW_NEWER_THAN(isp, 3, 25, 0)) { + mbs.param[1] |= IFCOPT1_ENAPURE; + } mbs.param[3] = IFCOPT3_NOPRLI; } } @@ -1813,8 +1834,15 @@ isp_fibre_init(ispsoftc_t *isp) } } icbp->icb_logintime = ICB_LOGIN_TOV; - icbp->icb_lunetimeout = ICB_LUN_ENABLE_TOV; +#ifdef ISP_TARGET_MODE + if (ISP_FW_NEWER_THAN(isp, 3, 25, 0) && (icbp->icb_fwoptions & ICBOPT_TGT_ENABLE)) { + icbp->icb_lunenables = 0xffff; + icbp->icb_ccnt = DFLT_CMND_CNT; + icbp->icb_icnt = DFLT_INOT_CNT; + icbp->icb_lunetimeout = ICB_LUN_ENABLE_TOV; + } +#endif if (fcp->isp_wwnn && fcp->isp_wwpn && (fcp->isp_wwnn >> 60) != 2) { icbp->icb_fwoptions |= ICBOPT_BOTH_WWNS; MAKE_NODE_NAME_FROM_WWN(icbp->icb_nodename, fcp->isp_wwnn); @@ -1910,7 +1938,7 @@ isp_fibre_init_2400(ispsoftc_t *isp) } } if (chan == isp->isp_nchan) { - isp_prt(isp, ISP_LOGDEBUG0, "all %d channels with role 'none'", chan); + isp_prt(isp, ISP_LOG_WARN1, "all %d channels with role 'none'", chan); isp->isp_state = ISP_INITSTATE; return; } @@ -1978,6 +2006,19 @@ isp_fibre_init_2400(ispsoftc_t *isp) icbp->icb_fwoptions1 |= ICB2400_OPT1_HARD_ADDRESS; icbp->icb_fwoptions2 = fcp->isp_xfwoptions; + if (isp->isp_confopts & ISP_CFG_NOFCTAPE) { + icbp->icb_fwoptions2 &= ~ICB2400_OPT2_FCTAPE; + } + if (isp->isp_confopts & ISP_CFG_FCTAPE) { + icbp->icb_fwoptions2 |= ICB2400_OPT2_FCTAPE; + } + + if (icbp->icb_fwoptions2 & ICB2400_OPT2_FCTAPE) { + FCPARAM(isp, chan)->fctape_enabled = 1; + } else { + FCPARAM(isp, chan)->fctape_enabled = 0; + } + switch (isp->isp_confopts & ISP_CFG_PORT_PREF) { case ISP_CFG_NPORT_ONLY: icbp->icb_fwoptions2 &= ~ICB2400_OPT2_TOPO_MASK; @@ -2336,13 +2377,13 @@ isp_plogx(ispsoftc_t *isp, int chan, uin msg = buf; break; case PLOGX_IOCBERR_PORTUSED: - lev = ISP_LOGSANCFG|ISP_LOGDEBUG0; + lev = ISP_LOG_SANCFG|ISP_LOG_WARN1; ISP_SNPRINTF(buf, sizeof (buf), "already logged in with N-Port handle 0x%x", parm1); msg = buf; rval = MBOX_PORT_ID_USED | (parm1 << 16); break; case PLOGX_IOCBERR_HNDLUSED: - lev = ISP_LOGSANCFG|ISP_LOGDEBUG0; + lev = ISP_LOG_SANCFG|ISP_LOG_WARN1; ISP_SNPRINTF(buf, sizeof (buf), "handle already used for PortID 0x%06x", parm1); msg = buf; rval = MBOX_LOOP_ID_USED; @@ -2388,35 +2429,26 @@ isp_port_login(ispsoftc_t *isp, uint16_t switch (mbs.param[0]) { case MBOX_PORT_ID_USED: - isp_prt(isp, ISP_LOGDEBUG0, - "isp_port_login: portid 0x%06x already logged in as %u", - portid, mbs.param[1]); + isp_prt(isp, ISP_LOG_SANCFG|ISP_LOG_WARN1, "isp_port_login: portid 0x%06x already logged in as %u", portid, mbs.param[1]); return (MBOX_PORT_ID_USED | (mbs.param[1] << 16)); case MBOX_LOOP_ID_USED: - isp_prt(isp, ISP_LOGDEBUG0, - "isp_port_login: handle 0x%04x in use for port id 0x%02xXXXX", - handle, mbs.param[1] & 0xff); + isp_prt(isp, ISP_LOG_SANCFG|ISP_LOG_WARN1, "isp_port_login: handle 0x%04x in use for port id 0x%02xXXXX", handle, mbs.param[1] & 0xff); return (MBOX_LOOP_ID_USED); case MBOX_COMMAND_COMPLETE: return (0); case MBOX_COMMAND_ERROR: - isp_prt(isp, ISP_LOGINFO, - "isp_port_login: error 0x%x in PLOGI to port 0x%06x", - mbs.param[1], portid); + isp_prt(isp, ISP_LOG_SANCFG|ISP_LOG_WARN1, "isp_port_login: error 0x%x in PLOGI to port 0x%06x", mbs.param[1], portid); return (MBOX_COMMAND_ERROR); case MBOX_ALL_IDS_USED: - isp_prt(isp, ISP_LOGINFO, - "isp_port_login: all IDs used for fabric login"); + isp_prt(isp, ISP_LOG_SANCFG|ISP_LOG_WARN1, "isp_port_login: all IDs used for fabric login"); return (MBOX_ALL_IDS_USED); default: - isp_prt(isp, ISP_LOGINFO, - "isp_port_login: error 0x%x on port login of 0x%06x@0x%0x", - mbs.param[0], portid, handle); + isp_prt(isp, ISP_LOG_SANCFG, "isp_port_login: error 0x%x on port login of 0x%06x@0x%0x", mbs.param[0], portid, handle); return (mbs.param[0]); } } @@ -2483,16 +2515,12 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui if (IS_24XX(isp)) { isp_get_pdb_24xx(isp, fcp->isp_scratch, &un.bill); pdb->handle = un.bill.pdb_handle; - pdb->s3_role = un.bill.pdb_prli_svc3; + pdb->prli_word3 = un.bill.pdb_prli_svc3; pdb->portid = BITS2WORD_24XX(un.bill.pdb_portid_bits); ISP_MEMCPY(pdb->portname, un.bill.pdb_portname, 8); ISP_MEMCPY(pdb->nodename, un.bill.pdb_nodename, 8); - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d Port 0x%06x flags 0x%x curstate %x", - chan, pdb->portid, un.bill.pdb_flags, - un.bill.pdb_curstate); - if (un.bill.pdb_curstate < PDB2400_STATE_PLOGI_DONE || - un.bill.pdb_curstate > PDB2400_STATE_LOGGED_IN) { + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d Port 0x%06x flags 0x%x curstate %x", chan, pdb->portid, un.bill.pdb_flags, un.bill.pdb_curstate); + if (un.bill.pdb_curstate < PDB2400_STATE_PLOGI_DONE || un.bill.pdb_curstate > PDB2400_STATE_LOGGED_IN) { mbs.param[0] = MBOX_NOT_LOGGED_IN; if (dolock) { FC_SCRATCH_RELEASE(isp, chan); @@ -2502,7 +2530,7 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui } else { isp_get_pdb_21xx(isp, fcp->isp_scratch, &un.fred); pdb->handle = un.fred.pdb_loopid; - pdb->s3_role = un.fred.pdb_prli_svc3; + pdb->prli_word3 = un.fred.pdb_prli_svc3; pdb->portid = BITS2WORD(un.fred.pdb_portid_bits); ISP_MEMCPY(pdb->portname, un.fred.pdb_portname, 8); ISP_MEMCPY(pdb->nodename, un.fred.pdb_nodename, 8); @@ -2528,7 +2556,7 @@ isp_dump_chip_portdb(ispsoftc_t *isp, in if (isp_getpdb(isp, chan, loopid, &pdb, dolock)) { continue; } - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGINFO, "Chan %d Loopid 0x%04x " + isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGINFO, "Chan %d Loopid 0x%04x " "PortID 0x%06x WWPN 0x%02x%02x%02x%02x%02x%02x%02x%02x", chan, loopid, pdb.portid, pdb.portname[0], pdb.portname[1], pdb.portname[2], pdb.portname[3], pdb.portname[4], @@ -2606,7 +2634,7 @@ isp_fclink_test(ispsoftc_t *isp, int cha fcp = FCPARAM(isp, chan); - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d FC Link Test Entry", chan); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC Link Test Entry", chan); ISP_MARK_PORTDB(isp, chan, 1); /* @@ -2622,7 +2650,7 @@ isp_fclink_test(ispsoftc_t *isp, int cha GET_NANOTIME(&hra); isp_fw_state(isp, chan); if (lwfs != fcp->isp_fwstate) { - isp_prt(isp, ISP_LOGCONFIG|ISP_LOGSANCFG, "Chan %d Firmware State <%s->%s>", chan, isp_fc_fw_statename((int)lwfs), isp_fc_fw_statename((int)fcp->isp_fwstate)); + isp_prt(isp, ISP_LOGCONFIG|ISP_LOG_SANCFG, "Chan %d Firmware State <%s->%s>", chan, isp_fc_fw_statename((int)lwfs), isp_fc_fw_statename((int)fcp->isp_fwstate)); lwfs = fcp->isp_fwstate; } if (fcp->isp_fwstate == FW_READY) { @@ -2673,7 +2701,7 @@ isp_fclink_test(ispsoftc_t *isp, int cha * If we haven't gone to 'ready' state, return. */ if (fcp->isp_fwstate != FW_READY) { - isp_prt(isp, ISP_LOGSANCFG, "%s: chan %d not at FW_READY state", __func__, chan); + isp_prt(isp, ISP_LOG_SANCFG, "%s: chan %d not at FW_READY state", __func__, chan); return (-1); } @@ -2738,7 +2766,9 @@ isp_fclink_test(ispsoftc_t *isp, int cha } } if (alpa_map[i] && fcp->isp_loopid != i) { - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d deriving loopid %d from AL_PA map (AL_PA 0x%x) and ignoring returned value %d (AL_PA 0x%x)", chan, i, alpa_map[i], fcp->isp_loopid, alpa); + isp_prt(isp, ISP_LOG_SANCFG, + "Chan %d deriving loopid %d from AL_PA map (AL_PA 0x%x) and ignoring returned value %d (AL_PA 0x%x)", + chan, i, alpa_map[i], fcp->isp_loopid, alpa); fcp->isp_loopid = i; } } @@ -2778,18 +2808,17 @@ isp_fclink_test(ispsoftc_t *isp, int cha lp->state = FC_PORTDB_STATE_PENDING_VALID; MAKE_WWN_FROM_NODE_NAME(lp->node_wwn, pdb.nodename); MAKE_WWN_FROM_NODE_NAME(lp->port_wwn, pdb.portname); - lp->roles = (pdb.s3_role & SVC3_ROLE_MASK) >> SVC3_ROLE_SHIFT; + lp->prli_word3 = pdb.prli_word3; lp->portid = pdb.portid; lp->handle = pdb.handle; lp->new_portid = lp->portid; - lp->new_roles = lp->roles; + lp->new_prli_word3 = lp->prli_word3; if (IS_24XX(isp)) { if (check_for_fabric) { /* * The mbs is still hanging out from the MBOX_GET_LOOP_ID above. */ fcp->isp_fabric_params = mbs.param[7]; - isp_prt(isp, ISP_LOGCONFIG, "fabric params 0x%x", mbs.param[7]); } else { fcp->isp_fabric_params = 0; } @@ -2809,7 +2838,7 @@ isp_fclink_test(ispsoftc_t *isp, int cha r = isp_register_fc4_type(isp, chan); } if (r) { - isp_prt(isp, ISP_LOGWARN|ISP_LOGSANCFG, "%s: register fc4 type failed", __func__); + isp_prt(isp, ISP_LOGWARN|ISP_LOG_SANCFG, "%s: register fc4 type failed", __func__); return (-1); } } else { @@ -2843,8 +2872,8 @@ not_on_fabric: /* * Announce ourselves, too. */ - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGCONFIG, topology, chan, (uint32_t) (fcp->isp_wwpn >> 32), (uint32_t) fcp->isp_wwpn, fcp->isp_portid, fcp->isp_loopid, isp_fc_toponame(fcp)); - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d FC Link Test Complete", chan); + isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGCONFIG, topology, chan, (uint32_t) (fcp->isp_wwpn >> 32), (uint32_t) fcp->isp_wwpn, fcp->isp_portid, fcp->isp_loopid, isp_fc_toponame(fcp)); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC Link Test Complete", chan); return (0); } @@ -2912,8 +2941,7 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) } } - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d Synchronizing PDBs", chan); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d Synchronizing PDBs", chan); fcp->isp_loopstate = LOOP_SYNCING_PDB; @@ -2950,7 +2978,7 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) } else { lp->autologin = 0; } - lp->new_roles = 0; + lp->new_prli_word3 = 0; lp->new_portid = 0; /* * Note that we might come out of this with our state @@ -2963,13 +2991,12 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) * target id in isp_dev_map (if any). */ lp->portid = lp->new_portid; - lp->roles = lp->new_roles; + lp->prli_word3 = lp->new_prli_word3; lp->state = FC_PORTDB_STATE_VALID; isp_async(isp, ISPASYNC_DEV_ARRIVED, chan, lp); - lp->new_roles = 0; + lp->new_prli_word3 = 0; lp->new_portid = 0; - lp->reserved = 0; - lp->new_reserved = 0; + lp->announced = 0; break; case FC_PORTDB_STATE_CHANGED: /* @@ -2977,14 +3004,13 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) */ lp->state = FC_PORTDB_STATE_VALID; isp_async(isp, ISPASYNC_DEV_CHANGED, chan, lp); - lp->new_roles = 0; + lp->new_prli_word3 = 0; lp->new_portid = 0; - lp->reserved = 0; - lp->new_reserved = 0; + lp->announced = 0; break; case FC_PORTDB_STATE_PENDING_VALID: lp->portid = lp->new_portid; - lp->roles = lp->new_roles; + lp->prli_word3 = lp->new_prli_word3; if (lp->dev_map_idx) { int t = lp->dev_map_idx - 1; fcp->isp_dev_map[t] = dbidx + 1; @@ -2992,11 +3018,10 @@ isp_pdb_sync(ispsoftc_t *isp, int chan) lp->state = FC_PORTDB_STATE_VALID; isp_async(isp, ISPASYNC_DEV_STAYED, chan, lp); if (dbidx != FL_ID) { - lp->new_roles = 0; + lp->new_prli_word3 = 0; lp->new_portid = 0; } - lp->reserved = 0; - lp->new_reserved = 0; + lp->announced = 0; break; case FC_PORTDB_STATE_ZOMBIE: break; @@ -3054,8 +3079,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan) break; case TOPO_FL_PORT: if (IS_24XX(isp) && isp->isp_nchan > 1) { - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d Skipping Local Loop Scan", chan); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d Skipping Local Loop Scan", chan); fcp->isp_loopstate = LOOP_LSCAN_DONE; return (0); } @@ -3065,16 +3089,14 @@ isp_scan_loop(ispsoftc_t *isp, int chan) lim = 2; break; default: - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d no loop topology to scan", chan); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d no loop topology to scan", chan); fcp->isp_loopstate = LOOP_LSCAN_DONE; return (0); } fcp->isp_loopstate = LOOP_SCANNING_LOOP; - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d FC scan loop 0..%d", chan, lim-1); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC scan loop 0..%d", chan, lim-1); /* @@ -3100,8 +3122,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan) if (IS_2100(isp) || IS_2200(isp)) { uint64_t node_wwn = isp_get_wwn(isp, chan, handle, 1); if (fcp->isp_loopstate < LOOP_SCANNING_LOOP) { - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d FC scan loop DONE (bad)", chan); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC scan loop DONE (bad)", chan); return (-1); } if (node_wwn == INI_NONE) { @@ -3119,8 +3140,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan) chan, handle, r); if (fcp->isp_loopstate < LOOP_SCANNING_LOOP) { ISP_MARK_PORTDB(isp, chan, 1); - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d FC scan loop DONE (bad)", chan); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC scan loop DONE (bad)", chan); return (-1); } continue; @@ -3128,8 +3148,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan) if (fcp->isp_loopstate < LOOP_SCANNING_LOOP) { ISP_MARK_PORTDB(isp, chan, 1); - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d FC scan loop DONE (bad)", chan); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC scan loop DONE (bad)", chan); return (-1); } @@ -3143,8 +3162,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan) isp_prt(isp, ISP_LOGWARN, "Chan %d cannot synchronize port database", chan); ISP_MARK_PORTDB(isp, chan, 1); - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d FC scan loop DONE (bad)", chan); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC scan loop DONE (bad)", chan); return (-1); } @@ -3153,7 +3171,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan) */ MAKE_WWN_FROM_NODE_NAME(tmp.node_wwn, pdb.nodename); MAKE_WWN_FROM_NODE_NAME(tmp.port_wwn, pdb.portname); - tmp.roles = (pdb.s3_role & SVC3_ROLE_MASK) >> SVC3_ROLE_SHIFT; + tmp.prli_word3 = pdb.prli_word3; tmp.portid = pdb.portid; tmp.handle = pdb.handle; @@ -3192,8 +3210,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan) for (i = 0; i < MAX_FC_TARG; i++) { lp = &fcp->portdb[i]; - if (lp->state == FC_PORTDB_STATE_NIL || - lp->target_mode) { + if (lp->state == FC_PORTDB_STATE_NIL || lp->target_mode) { continue; } if (lp->node_wwn != tmp.node_wwn) { @@ -3214,8 +3231,7 @@ isp_scan_loop(ispsoftc_t *isp, int chan) chan, i, lp->state); isp_dump_portdb(isp, chan); ISP_MARK_PORTDB(isp, chan, 1); - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d FC scan loop DONE (bad)", chan); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC scan loop DONE (bad)", chan); return (-1); } @@ -3229,15 +3245,11 @@ isp_scan_loop(ispsoftc_t *isp, int chan) * Check to make see if really still the same * device. If it is, we mark it pending valid. */ - if (lp->portid == tmp.portid && - lp->handle == tmp.handle && - lp->roles == tmp.roles) { + if (lp->portid == tmp.portid && lp->handle == tmp.handle && lp->prli_word3 == tmp.prli_word3) { lp->new_portid = tmp.portid; - lp->new_roles = tmp.roles; + lp->new_prli_word3 = tmp.prli_word3; lp->state = FC_PORTDB_STATE_PENDING_VALID; - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d Loop Port 0x%06x@0x%04x Pending " - "Valid", chan, tmp.portid, tmp.handle); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d Loop Port 0x%06x@0x%04x Pending Valid", chan, tmp.portid, tmp.handle); break; } @@ -3251,12 +3263,10 @@ isp_scan_loop(ispsoftc_t *isp, int chan) * Claim that this has changed and let somebody else * decide what to do. */ - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d Loop Port 0x%06x@0x%04x changed", - chan, tmp.portid, tmp.handle); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d Loop Port 0x%06x@0x%04x changed", chan, tmp.portid, tmp.handle); lp->state = FC_PORTDB_STATE_CHANGED; lp->new_portid = tmp.portid; - lp->new_roles = tmp.roles; + lp->new_prli_word3 = tmp.prli_word3; break; } @@ -3290,17 +3300,14 @@ isp_scan_loop(ispsoftc_t *isp, int chan) lp->autologin = 1; lp->state = FC_PORTDB_STATE_NEW; lp->new_portid = tmp.portid; - lp->new_roles = tmp.roles; + lp->new_prli_word3 = tmp.prli_word3; lp->handle = tmp.handle; lp->port_wwn = tmp.port_wwn; lp->node_wwn = tmp.node_wwn; - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d Loop Port 0x%06x@0x%04x is New Entry", - chan, tmp.portid, tmp.handle); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d Loop Port 0x%06x@0x%04x is New Entry", chan, tmp.portid, tmp.handle); } fcp->isp_loopstate = LOOP_LSCAN_DONE; - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d FC scan loop DONE", chan); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC scan loop DONE", chan); return (0); } @@ -3343,8 +3350,7 @@ isp_gid_ft_sns(ispsoftc_t *isp, int chan sns_gid_ft_req_t *rq = &un._x; mbreg_t mbs; - isp_prt(isp, ISP_LOGDEBUG0, - "Chan %d scanning fabric (GID_FT) via SNS", chan); + isp_prt(isp, ISP_LOGDEBUG0, "Chan %d scanning fabric (GID_FT) via SNS", chan); ISP_MEMZERO(rq, SNS_GID_FT_REQ_SIZE); rq->snscb_rblen = GIDLEN >> 1; @@ -3393,8 +3399,7 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, uint32_t *rp; uint8_t *scp = fcp->isp_scratch; - isp_prt(isp, ISP_LOGDEBUG0, - "Chan %d scanning fabric (GID_FT) via CT", chan); + isp_prt(isp, ISP_LOGDEBUG0, "Chan %d scanning fabric (GID_FT) via CT", chan); if (!IS_24XX(isp)) { return (1); @@ -3488,10 +3493,8 @@ isp_scan_fabric(ispsoftc_t *isp, int cha int portidx, portlim, r; sns_gid_ft_rsp_t *rs0, *rs1; - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d FC Scan Fabric", chan); - if (fcp->isp_fwstate != FW_READY || - fcp->isp_loopstate < LOOP_LSCAN_DONE) { + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC Scan Fabric", chan); + if (fcp->isp_fwstate != FW_READY || fcp->isp_loopstate < LOOP_LSCAN_DONE) { return (-1); } if (fcp->isp_loopstate > LOOP_SCANNING_FABRIC) { @@ -3499,8 +3502,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha } if (fcp->isp_topo != TOPO_FL_PORT && fcp->isp_topo != TOPO_F_PORT) { fcp->isp_loopstate = LOOP_FSCAN_DONE; - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d FC Scan Fabric Done (no fabric)", chan); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC Scan Fabric Done (no fabric)", chan); return (0); } @@ -3568,9 +3570,8 @@ isp_scan_fabric(ispsoftc_t *isp, int cha } if (rs1->snscb_cthdr.ct_cmd_resp != LS_ACC) { int level; - if (rs1->snscb_cthdr.ct_reason == 9 && - rs1->snscb_cthdr.ct_explanation == 7) { - level = ISP_LOGSANCFG|ISP_LOGDEBUG0; + if (rs1->snscb_cthdr.ct_reason == 9 && rs1->snscb_cthdr.ct_explanation == 7) { + level = ISP_LOG_SANCFG; } else { level = ISP_LOGWARN; } @@ -3614,7 +3615,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha "fabric too big for scratch area: increase ISP_FC_SCRLEN"); } portlim = portidx + 1; - isp_prt(isp, ISP_LOGSANCFG, + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d got %d ports back from name server", chan, portlim); for (portidx = 0; portidx < portlim; portidx++) { @@ -3639,9 +3640,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha rs1->snscb_ports[npidx].portid[0] = 0; rs1->snscb_ports[npidx].portid[1] = 0; rs1->snscb_ports[npidx].portid[2] = 0; - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d removing duplicate PortID 0x%06x" - " entry from list", chan, portid); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d removing duplicate PortID 0x%06x entry from list", chan, portid); } } @@ -3671,7 +3670,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha ((rs1->snscb_ports[portidx].portid[2])); if (portid == 0) { - isp_prt(isp, ISP_LOGSANCFG, + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d skipping null PortID at idx %d", chan, portidx); continue; @@ -3687,19 +3686,19 @@ isp_scan_fabric(ispsoftc_t *isp, int cha */ if (ISP_CAP_MULTI_ID(isp)) { if ((portid >> 8) == (fcp->isp_portid >> 8)) { - isp_prt(isp, ISP_LOGSANCFG, + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d skip PortID 0x%06x", chan, portid); continue; } } else if (portid == fcp->isp_portid) { - isp_prt(isp, ISP_LOGSANCFG, + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d skip ourselves on @ PortID 0x%06x", chan, portid); continue; } - isp_prt(isp, ISP_LOGSANCFG, + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d Checking Fabric Port 0x%06x", chan, portid); /* @@ -3711,8 +3710,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha for (dbidx = 0; dbidx < MAX_FC_TARG; dbidx++) { lp = &fcp->portdb[dbidx]; - if (lp->state != FC_PORTDB_STATE_PROBATIONAL || - lp->target_mode) { + if (lp->state != FC_PORTDB_STATE_PROBATIONAL || lp->target_mode) { continue; } if (lp->portid == portid) { @@ -3754,9 +3752,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha if (r != 0) { lp->new_portid = portid; lp->state = FC_PORTDB_STATE_DEAD; - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d Fabric Port 0x%06x is dead", - chan, portid); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d Fabric Port 0x%06x is dead", chan, portid); continue; } @@ -3773,7 +3769,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha pdb.portid != portid || wwpn != lp->port_wwn || wwnn != lp->node_wwn) { - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, + isp_prt(isp, ISP_LOG_SANCFG, fconf, chan, dbidx, pdb.handle, pdb.portid, (uint32_t) (wwnn >> 32), (uint32_t) wwnn, (uint32_t) (wwpn >> 32), (uint32_t) wwpn, @@ -3824,7 +3820,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha handle_changed++; } - nr = (pdb.s3_role & SVC3_ROLE_MASK) >> SVC3_ROLE_SHIFT; + nr = pdb.prli_word3; /* * Check to see whether the portid and roles have @@ -3839,17 +3835,12 @@ isp_scan_fabric(ispsoftc_t *isp, int cha */ lp->new_portid = portid; - lp->new_roles = nr; - if (pdb.portid != lp->portid || nr != lp->roles || - handle_changed) { - isp_prt(isp, ISP_LOGSANCFG, - "Chan %d Fabric Port 0x%06x changed", - chan, portid); + lp->new_prli_word3 = nr; + if (pdb.portid != lp->portid || nr != lp->prli_word3 || handle_changed) { + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d Fabric Port 0x%06x changed", chan, portid); lp->state = FC_PORTDB_STATE_CHANGED; } else { - isp_prt(isp, ISP_LOGSANCFG, - "Chan %d Fabric Port 0x%06x " - "Now Pending Valid", chan, portid); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d Fabric Port 0x%06x Now Pending Valid", chan, portid); lp->state = FC_PORTDB_STATE_PENDING_VALID; } continue; @@ -3935,7 +3926,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha handle = pdb.handle; MAKE_WWN_FROM_NODE_NAME(wwnn, pdb.nodename); MAKE_WWN_FROM_NODE_NAME(wwpn, pdb.portname); - nr = (pdb.s3_role & SVC3_ROLE_MASK) >> SVC3_ROLE_SHIFT; + nr = pdb.prli_word3; /* * And go through the database *one* more time to make sure @@ -3949,8 +3940,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha if (fcp->portdb[dbidx].target_mode) { continue; } - if (fcp->portdb[dbidx].node_wwn == wwnn && - fcp->portdb[dbidx].port_wwn == wwpn) { + if (fcp->portdb[dbidx].node_wwn == wwnn && fcp->portdb[dbidx].port_wwn == wwpn) { break; } } @@ -3961,11 +3951,9 @@ isp_scan_fabric(ispsoftc_t *isp, int cha lp->node_wwn = wwnn; lp->port_wwn = wwpn; lp->new_portid = portid; - lp->new_roles = nr; + lp->new_prli_word3 = nr; lp->state = FC_PORTDB_STATE_NEW; - isp_prt(isp, ISP_LOGSANCFG, - "Chan %d Fabric Port 0x%06x is a New Entry", - chan, portid); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d Fabric Port 0x%06x is a New Entry", chan, portid); continue; } @@ -3991,16 +3979,12 @@ isp_scan_fabric(ispsoftc_t *isp, int cha lp = &fcp->portdb[dbidx]; lp->handle = handle; lp->new_portid = portid; - lp->new_roles = nr; - if (lp->portid != portid || lp->roles != nr) { - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d Zombie Fabric Port 0x%06x Now Changed", - chan, portid); + lp->new_prli_word3 = nr; + if (lp->portid != portid || lp->prli_word3 != nr) { + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d Zombie Fabric Port 0x%06x Now Changed", chan, portid); lp->state = FC_PORTDB_STATE_CHANGED; } else { - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d Zombie Fabric Port 0x%06x " - "Now Pending Valid", chan, portid); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d Zombie Fabric Port 0x%06x Now Pending Valid", chan, portid); lp->state = FC_PORTDB_STATE_PENDING_VALID; } } @@ -4011,8 +3995,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha return (-1); } fcp->isp_loopstate = LOOP_FSCAN_DONE; - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d FC Scan Fabric Done", chan); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d FC Scan Fabric Done", chan); return (0); } @@ -4261,17 +4244,13 @@ isp_register_fc4_type_24xx(ispsoftc_t *i FC_SCRATCH_RELEASE(isp, chan); if (ct->ct_cmd_resp == LS_RJT) { - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d Register FC4 Type rejected", chan); + isp_prt(isp, ISP_LOG_SANCFG|ISP_LOG_WARN1, "Chan %d Register FC4 Type rejected", chan); return (-1); } else if (ct->ct_cmd_resp == LS_ACC) { - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, - "Chan %d Register FC4 Type accepted", chan); + isp_prt(isp, ISP_LOG_SANCFG, "Chan %d Register FC4 Type accepted", chan); return (0); } else { - isp_prt(isp, ISP_LOGWARN, - "Chan %d Register FC4 Type: 0x%x", - chan, ct->ct_cmd_resp); + isp_prt(isp, ISP_LOGWARN, "Chan %d Register FC4 Type: 0x%x", chan, ct->ct_cmd_resp); return (-1); } } @@ -4369,6 +4348,7 @@ isp_start(XS_T *xs) fcparam *fcp = FCPARAM(isp, XS_CHANNEL(xs)); if ((fcp->role & ISP_ROLE_INITIATOR) == 0) { + isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%d I am not an initiator", XS_CHANNEL(xs), target, XS_LUN(xs)); XS_SETERR(xs, HBA_SELTIMEOUT); return (CMD_COMPLETE); } @@ -4381,6 +4361,7 @@ isp_start(XS_T *xs) } if (XS_TGT(xs) >= MAX_FC_TARG) { + isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%d target too big", XS_CHANNEL(xs), target, XS_LUN(xs)); XS_SETERR(xs, HBA_SELTIMEOUT); return (CMD_COMPLETE); } @@ -4392,9 +4373,11 @@ isp_start(XS_T *xs) return (CMD_COMPLETE); } if (fcp->portdb[hdlidx].state == FC_PORTDB_STATE_ZOMBIE) { + isp_prt(isp, ISP_LOGDEBUG1, "%d.%d.%d target zombie", XS_CHANNEL(xs), target, XS_LUN(xs)); return (CMD_RQLATER); } if (fcp->portdb[hdlidx].state != FC_PORTDB_STATE_VALID) { + isp_prt(isp, ISP_LOGDEBUG1, "%d.%d.%d bad db port state 0x%x", XS_CHANNEL(xs), target, XS_LUN(xs), fcp->portdb[hdlidx].state); XS_SETERR(xs, HBA_SELTIMEOUT); return (CMD_COMPLETE); } @@ -4403,6 +4386,7 @@ isp_start(XS_T *xs) } else { sdparam *sdp = SDPARAM(isp, XS_CHANNEL(xs)); if ((sdp->role & ISP_ROLE_INITIATOR) == 0) { + isp_prt(isp, ISP_LOGDEBUG1, "%d.%d.%d I am not an initiator", XS_CHANNEL(xs), target, XS_LUN(xs)); XS_SETERR(xs, HBA_SELTIMEOUT); return (CMD_COMPLETE); } @@ -4415,7 +4399,7 @@ isp_start(XS_T *xs) qep = isp_getrqentry(isp); if (qep == NULL) { - isp_prt(isp, ISP_LOGDEBUG0, "Request Queue Overflow"); + isp_prt(isp, ISP_LOG_WARN1, "Request Queue Overflow"); XS_SETERR(xs, HBA_BOTCH); return (CMD_EAGAIN); } @@ -4449,6 +4433,14 @@ isp_start(XS_T *xs) } reqp->req_header.rqs_entry_count = 1; + + /* + * Select and install Header Code. + * Note that it might be overridden before going out + * if we're on a 64 bit platform. The lower level + * code (isp_send_cmd) will select the appropriate + * 64 bit variant if it needs to. + */ if (IS_24XX(isp)) { reqp->req_header.rqs_entry_type = RQSTYPE_T7RQS; } else if (IS_FC(isp)) { @@ -4461,6 +4453,9 @@ isp_start(XS_T *xs) } } + /* + * Set task attributes + */ if (IS_24XX(isp)) { int ttype; if (XS_TAG_P(xs)) { @@ -4513,20 +4508,30 @@ isp_start(XS_T *xs) tptr = &reqp->req_time; /* - * NB: we do not support long CDBs + * NB: we do not support long CDBs (yet) */ cdblen = XS_CDBLEN(xs); if (IS_SCSI(isp)) { + if (cdblen > sizeof (reqp->req_cdb)) { + isp_prt(isp, ISP_LOGERR, "Command Length %u too long for this chip", cdblen); + XS_SETERR(xs, HBA_BOTCH); + return (CMD_COMPLETE); + } reqp->req_target = target | (XS_CHANNEL(xs) << 7); reqp->req_lun_trn = XS_LUN(xs); - cdblen = ISP_MIN(cdblen, sizeof (reqp->req_cdb)); cdbp = reqp->req_cdb; reqp->req_cdblen = cdblen; } else if (IS_24XX(isp)) { ispreqt7_t *t7 = (ispreqt7_t *)local; fcportdb_t *lp; + if (cdblen > sizeof (t7->req_cdb)) { + isp_prt(isp, ISP_LOGERR, "Command Length %u too long for this chip", cdblen); + XS_SETERR(xs, HBA_BOTCH); + return (CMD_COMPLETE); + } + lp = &FCPARAM(isp, XS_CHANNEL(xs))->portdb[hdlidx]; t7->req_nphdl = target; t7->req_tidlo = lp->portid; @@ -4537,28 +4542,47 @@ isp_start(XS_T *xs) t7->req_lun[0] |= 0x40; } t7->req_lun[1] = XS_LUN(xs); - FCP_NEXT_CRN(isp, xs, t7->req_crn, XS_CHANNEL(xs), XS_TGT(xs), XS_LUN(xs)); + if (FCPARAM(isp, XS_CHANNEL(xs))->fctape_enabled && (lp->prli_word3 & PRLI_WD3_RETRY)) { + if (FCP_NEXT_CRN(isp, &t7->req_crn, xs)) { + isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%d cannot generate next CRN", XS_CHANNEL(xs), target, XS_LUN(xs)); + XS_SETERR(xs, HBA_BOTCH); + return (CMD_EAGAIN); + } + } tptr = &t7->req_time; cdbp = t7->req_cdb; - cdblen = ISP_MIN(cdblen, sizeof (t7->req_cdb)); - } else if (ISP_CAP_2KLOGIN(isp)) { - ispreqt2e_t *t2e = (ispreqt2e_t *)local; - t2e->req_target = target; - t2e->req_scclun = XS_LUN(xs); - cdbp = t2e->req_cdb; - cdblen = ISP_MIN(cdblen, sizeof (t2e->req_cdb)); - } else if (ISP_CAP_SCCFW(isp)) { - ispreqt2_t *t2 = (ispreqt2_t *)local; - t2->req_target = target; - t2->req_scclun = XS_LUN(xs); - cdbp = t2->req_cdb; - cdblen = ISP_MIN(cdblen, sizeof (t2->req_cdb)); } else { ispreqt2_t *t2 = (ispreqt2_t *)local; - t2->req_target = target; - t2->req_lun_trn = XS_LUN(xs); - cdbp = t2->req_cdb; - cdblen = ISP_MIN(cdblen, sizeof (t2->req_cdb)); + fcportdb_t *lp; + + if (cdblen > sizeof t2->req_cdb) { + isp_prt(isp, ISP_LOGERR, "Command Length %u too long for this chip", cdblen); + XS_SETERR(xs, HBA_BOTCH); + return (CMD_COMPLETE); + } + lp = &FCPARAM(isp, XS_CHANNEL(xs))->portdb[hdlidx]; + if (FCPARAM(isp, XS_CHANNEL(xs))->fctape_enabled && (lp->prli_word3 & PRLI_WD3_RETRY)) { + if (FCP_NEXT_CRN(isp, &t2->req_crn, xs)) { + isp_prt(isp, ISP_LOG_WARN1, "%d.%d.%d cannot generate next CRN", XS_CHANNEL(xs), target, XS_LUN(xs)); + XS_SETERR(xs, HBA_BOTCH); + return (CMD_EAGAIN); + } + } + if (ISP_CAP_2KLOGIN(isp)) { + ispreqt2e_t *t2e = (ispreqt2e_t *)local; + t2e->req_target = target; + t2e->req_scclun = XS_LUN(xs); + cdbp = t2e->req_cdb; + } else if (ISP_CAP_SCCFW(isp)) { + ispreqt2_t *t2 = (ispreqt2_t *)local; + t2->req_target = target; + t2->req_scclun = XS_LUN(xs); + cdbp = t2->req_cdb; + } else { + t2->req_target = target; + t2->req_lun_trn = XS_LUN(xs); + cdbp = t2->req_cdb; + } } ISP_MEMCPY(cdbp, XS_CDBP(xs), cdblen); @@ -4571,7 +4595,7 @@ isp_start(XS_T *xs) } if (isp_allocate_xs(isp, xs, &handle)) { - isp_prt(isp, ISP_LOGDEBUG0, "out of xflist pointers"); + isp_prt(isp, ISP_LOG_WARN1, "out of xflist pointers"); XS_SETERR(xs, HBA_BOTCH); return (CMD_EAGAIN); } @@ -4618,7 +4642,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ct * Issue a bus reset. */ if (IS_24XX(isp)) { - isp_prt(isp, ISP_LOGWARN, "RESET BUS NOT IMPLEMENTED"); + isp_prt(isp, ISP_LOGERR, "BUS RESET NOT IMPLEMENTED"); break; } else if (IS_FC(isp)) { mbs.param[1] = 10; @@ -4639,8 +4663,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ct if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { break; } - isp_prt(isp, ISP_LOGINFO, - "driver initiated bus reset of bus %d", chan); + isp_prt(isp, ISP_LOGINFO, "driver initiated bus reset of bus %d", chan); return (0); case ISPCTL_RESET_DEV: @@ -4658,17 +4681,12 @@ isp_control(ispsoftc_t *isp, ispctl_t ct hdlidx = fcp->isp_dev_map[tgt] - 1; if (hdlidx < 0 || hdlidx >= MAX_FC_TARG) { - isp_prt(isp, ISP_LOGWARN, - "Chan %d bad handle %d trying to reset" - "target %d", chan, hdlidx, tgt); + isp_prt(isp, ISP_LOGWARN, "Chan %d bad handle %d trying to reset target %d", chan, hdlidx, tgt); break; } lp = &fcp->portdb[hdlidx]; if (lp->state != FC_PORTDB_STATE_VALID) { - isp_prt(isp, ISP_LOGWARN, - "Chan %d handle %d for abort of target %d " - "no longer valid", chan, - hdlidx, tgt); + isp_prt(isp, ISP_LOGWARN, "Chan %d handle %d for abort of target %d no longer valid", chan, hdlidx, tgt); break; } @@ -4703,18 +4721,14 @@ isp_control(ispsoftc_t *isp, ispctl_t ct FC_SCRATCH_RELEASE(isp, chan); break; } - MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, - QENTRY_LEN, chan); + MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan); sp = (isp24xx_statusreq_t *) local; - isp_get_24xx_response(isp, - &((isp24xx_statusreq_t *)fcp->isp_scratch)[1], sp); + isp_get_24xx_response(isp, &((isp24xx_statusreq_t *)fcp->isp_scratch)[1], sp); FC_SCRATCH_RELEASE(isp, chan); if (sp->req_completion_status == 0) { return (0); } - isp_prt(isp, ISP_LOGWARN, - "Chan %d reset of target %d returned 0x%x", - chan, tgt, sp->req_completion_status); + isp_prt(isp, ISP_LOGWARN, "Chan %d reset of target %d returned 0x%x", chan, tgt, sp->req_completion_status); break; } else if (IS_FC(isp)) { if (ISP_CAP_2KLOGIN(isp)) { @@ -4732,8 +4746,7 @@ isp_control(ispsoftc_t *isp, ispctl_t ct if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { break; } - isp_prt(isp, ISP_LOGINFO, - "Target %d on Bus %d Reset Succeeded", tgt, chan); + isp_prt(isp, ISP_LOGINFO, "Target %d on Bus %d Reset Succeeded", tgt, chan); ISP_SET_SENDMARKER(isp, chan, 1); return (0); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 20:08:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 768F3106566C; Sat, 28 Jul 2012 20:08:15 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56A4D8FC0C; Sat, 28 Jul 2012 20:08: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 q6SK8Fx4063233; Sat, 28 Jul 2012 20:08:15 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6SK8FFk063231; Sat, 28 Jul 2012 20:08:15 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201207282008.q6SK8FFk063231@svn.freebsd.org> From: Matt Jacob Date: Sat, 28 Jul 2012 20:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238870 - head/sys/cam/ctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 20:08:15 -0000 Author: mjacob Date: Sat Jul 28 20:08:14 2012 New Revision: 238870 URL: http://svn.freebsd.org/changeset/base/238870 Log: Handle a case where we had an SRR that pushed back the data pointer. This is a temp fix that resubmits the command, adjusted, so that the backend can fetch the data again. Sponsored by: Spectralogic MFC after: 1 month Modified: head/sys/cam/ctl/scsi_ctl.c Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Sat Jul 28 20:06:29 2012 (r238869) +++ head/sys/cam/ctl/scsi_ctl.c Sat Jul 28 20:08:14 2012 (r238870) @@ -1081,11 +1081,81 @@ ctlfe_free_ccb(struct cam_periph *periph } } +static int +ctlfe_adjust_cdb(struct ccb_accept_tio *atio, uint32_t offset) +{ + uint64_t lba; + uint32_t num_blocks, nbc; + uint8_t *cmdbyt = (atio->ccb_h.flags & CAM_CDB_POINTER)? + atio->cdb_io.cdb_ptr : atio->cdb_io.cdb_bytes; + + nbc = offset >> 9; /* ASSUMING 512 BYTE BLOCKS */ + + switch (cmdbyt[0]) { + case READ_6: + case WRITE_6: + { + struct scsi_rw_6 *cdb = (struct scsi_rw_6 *)cmdbyt; + lba = scsi_3btoul(cdb->addr); + lba &= 0x1fffff; + num_blocks = cdb->length; + if (num_blocks == 0) + num_blocks = 256; + lba += nbc; + num_blocks -= nbc; + scsi_ulto3b(lba, cdb->addr); + cdb->length = num_blocks; + break; + } + case READ_10: + case WRITE_10: + { + struct scsi_rw_10 *cdb = (struct scsi_rw_10 *)cmdbyt; + lba = scsi_4btoul(cdb->addr); + num_blocks = scsi_2btoul(cdb->length); + lba += nbc; + num_blocks -= nbc; + scsi_ulto4b(lba, cdb->addr); + scsi_ulto2b(num_blocks, cdb->length); + break; + } + case READ_12: + case WRITE_12: + { + struct scsi_rw_12 *cdb = (struct scsi_rw_12 *)cmdbyt; + lba = scsi_4btoul(cdb->addr); + num_blocks = scsi_4btoul(cdb->length); + lba += nbc; + num_blocks -= nbc; + scsi_ulto4b(lba, cdb->addr); + scsi_ulto4b(num_blocks, cdb->length); + break; + } + case READ_16: + case WRITE_16: + { + struct scsi_rw_16 *cdb = (struct scsi_rw_16 *)cmdbyt; + lba = scsi_8btou64(cdb->addr); + num_blocks = scsi_4btoul(cdb->length); + lba += nbc; + num_blocks -= nbc; + scsi_u64to8b(lba, cdb->addr); + scsi_ulto4b(num_blocks, cdb->length); + break; + } + default: + return -1; + } + return (0); +} + static void ctlfedone(struct cam_periph *periph, union ccb *done_ccb) { struct ctlfe_lun_softc *softc; struct ctlfe_softc *bus_softc; + struct ccb_accept_tio *atio = NULL; + union ctl_io *io = NULL; #ifdef CTLFE_DEBUG printf("%s: entered, func_code = %#x, type = %#lx\n", __func__, @@ -1123,13 +1193,12 @@ ctlfedone(struct cam_periph *periph, uni } switch (done_ccb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: { - union ctl_io *io; - struct ccb_accept_tio *atio; atio = &done_ccb->atio; softc->atios_returned++; + resubmit: /* * Allocate a ctl_io, pass it to CTL, and wait for the * datamove or done. @@ -1213,8 +1282,8 @@ ctlfedone(struct cam_periph *periph, uni break; } case XPT_CONT_TARGET_IO: { - struct ccb_accept_tio *atio; - union ctl_io *io; + int srr = 0; + uint32_t srr_off = 0; atio = (struct ccb_accept_tio *)done_ccb->ccb_h.ccb_atio; io = (union ctl_io *)atio->ccb_h.io_ptr; @@ -1225,6 +1294,57 @@ ctlfedone(struct cam_periph *periph, uni __func__, atio->tag_id, done_ccb->ccb_h.flags); #endif /* + * Handle SRR case were the data pointer is pushed back hack + */ + if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_MESSAGE_RECV + && done_ccb->csio.msg_ptr != NULL + && done_ccb->csio.msg_ptr[0] == MSG_EXTENDED + && done_ccb->csio.msg_ptr[1] == 5 + && done_ccb->csio.msg_ptr[2] == 0) { + srr = 1; + srr_off = + (done_ccb->csio.msg_ptr[3] << 24) + | (done_ccb->csio.msg_ptr[4] << 16) + | (done_ccb->csio.msg_ptr[5] << 8) + | (done_ccb->csio.msg_ptr[6]); + } + + if (srr && (done_ccb->ccb_h.flags & CAM_SEND_STATUS)) { + /* + * If status was being sent, the back end data is now + * history. Hack it up and resubmit a new command with + * the CDB adjusted. If the SIM does the right thing, + * all of the resid math should work. + */ + softc->ccbs_freed++; + xpt_release_ccb(done_ccb); + ctl_free_io(io); + if (ctlfe_adjust_cdb(atio, srr_off) == 0) { + done_ccb = (union ccb *)atio; + goto resubmit; + } + /* + * Fall through to doom.... + */ + } else if (srr) { + /* + * If we have an srr and we're still sending data, we + * should be able to adjust offsets and cycle again. + */ + io->scsiio.kern_rel_offset = + io->scsiio.ext_data_filled = srr_off; + io->scsiio.ext_data_len = io->scsiio.kern_total_len - + io->scsiio.kern_rel_offset; + softc->ccbs_freed++; + io->scsiio.io_hdr.status = CTL_STATUS_NONE; + xpt_release_ccb(done_ccb); + TAILQ_INSERT_HEAD(&softc->work_queue, &atio->ccb_h, + periph_links.tqe); + xpt_schedule(periph, /*priority*/ 1); + return; + } + + /* * If we were sending status back to the initiator, free up * resources. If we were doing a datamove, call the * datamove done routine. From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 20:31:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3ABA8106564A; Sat, 28 Jul 2012 20:31:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C4CC8FC08; Sat, 28 Jul 2012 20:31:40 +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 q6SKVdk6065022; Sat, 28 Jul 2012 20:31:39 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6SKVd6H065020; Sat, 28 Jul 2012 20:31:39 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207282031.q6SKVd6H065020@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 28 Jul 2012 20:31:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238871 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 20:31:40 -0000 Author: bz Date: Sat Jul 28 20:31:39 2012 New Revision: 238871 URL: http://svn.freebsd.org/changeset/base/238871 Log: Hardcode the loopback rx/tx checkum options for IPv6 to on without checking. This allows the FreeBSD 9.1 release process to move forward. Work around the problem that loopback connections to local addresses not on loopback interfaces and not on interfaces w/ IPv6 checksum offloading enabled would not work. A proper fix to allow us to disable the "checksum offload" on loopback for testing, measurements, ... as we allow for IPv4 needs to put in place later. Reported by: tuexen, Matthew Seaman (m.seaman infracaninophile.co.uk) Reported by: Mike Andrews (mandrews bit0.com), kib, ... PR: kern/170070 MFC after: 1 day X-MFC after: re approval Modified: head/sys/net/if_loop.c Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Sat Jul 28 20:08:14 2012 (r238870) +++ head/sys/net/if_loop.c Sat Jul 28 20:31:39 2012 (r238871) @@ -257,10 +257,20 @@ looutput(struct ifnet *ifp, struct mbuf m->m_pkthdr.csum_flags &= ~LO_CSUM_FEATURES; break; case AF_INET6: +#if 0 + /* + * XXX-BZ for now always claim the checksum is good despite + * any interface flags. This is a workaround for 9.1-R and + * a proper solution ought to be sought later. + */ if (ifp->if_capenable & IFCAP_RXCSUM_IPV6) { m->m_pkthdr.csum_data = 0xffff; m->m_pkthdr.csum_flags = LO_CSUM_SET; } +#else + m->m_pkthdr.csum_data = 0xffff; + m->m_pkthdr.csum_flags = LO_CSUM_SET; +#endif m->m_pkthdr.csum_flags &= ~LO_CSUM_FEATURES6; break; case AF_IPX: @@ -446,15 +456,29 @@ loioctl(struct ifnet *ifp, u_long cmd, c ifp->if_capenable ^= IFCAP_RXCSUM; if ((mask & IFCAP_TXCSUM) != 0) ifp->if_capenable ^= IFCAP_TXCSUM; - if ((mask & IFCAP_RXCSUM_IPV6) != 0) + if ((mask & IFCAP_RXCSUM_IPV6) != 0) { +#if 0 ifp->if_capenable ^= IFCAP_RXCSUM_IPV6; - if ((mask & IFCAP_TXCSUM_IPV6) != 0) +#else + error = EOPNOTSUPP; + break; +#endif + } + if ((mask & IFCAP_TXCSUM_IPV6) != 0) { +#if 0 ifp->if_capenable ^= IFCAP_TXCSUM_IPV6; +#else + error = EOPNOTSUPP; + break; +#endif + } ifp->if_hwassist = 0; if (ifp->if_capenable & IFCAP_TXCSUM) ifp->if_hwassist = LO_CSUM_FEATURES; +#if 0 if (ifp->if_capenable & IFCAP_TXCSUM_IPV6) ifp->if_hwassist |= LO_CSUM_FEATURES6; +#endif break; default: From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 21:43:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FD08106566C; Sat, 28 Jul 2012 21:43:30 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A30B8FC16; Sat, 28 Jul 2012 21:43:30 +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 q6SLhUMn070835; Sat, 28 Jul 2012 21:43:30 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6SLhTi7070833; Sat, 28 Jul 2012 21:43:29 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201207282143.q6SLhTi7070833@svn.freebsd.org> From: Hiroki Sato Date: Sat, 28 Jul 2012 21:43:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238872 - stable/9/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 21:43:30 -0000 Author: hrs Date: Sat Jul 28 21:43:29 2012 New Revision: 238872 URL: http://svn.freebsd.org/changeset/base/238872 Log: MFC r235285: Skip nd6 line with no warning message when the system does not support INET6. Spotted by: flo Approved by: re (kib) Modified: stable/9/sbin/ifconfig/af_nd6.c Directory Properties: stable/9/sbin/ifconfig/ (props changed) Modified: stable/9/sbin/ifconfig/af_nd6.c ============================================================================== --- stable/9/sbin/ifconfig/af_nd6.c Sat Jul 28 20:31:39 2012 (r238871) +++ stable/9/sbin/ifconfig/af_nd6.c Sat Jul 28 21:43:29 2012 (r238872) @@ -148,12 +148,14 @@ nd6_status(int s) memset(&nd, 0, sizeof(nd)); strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); if ((s6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { - warn("socket(AF_INET6, SOCK_DGRAM)"); + if (errno != EPROTONOSUPPORT) + warn("socket(AF_INET6, SOCK_DGRAM)"); return; } error = ioctl(s6, SIOCGIFINFO_IN6, &nd); if (error) { - warn("ioctl(SIOCGIFINFO_IN6)"); + if (errno != EPFNOSUPPORT) + warn("ioctl(SIOCGIFINFO_IN6)"); close(s6); return; } From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 21:56:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D160106564A; Sat, 28 Jul 2012 21:56:25 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C8588FC16; Sat, 28 Jul 2012 21:56:25 +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 q6SLuPXd072348; Sat, 28 Jul 2012 21:56:25 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6SLuPHY072337; Sat, 28 Jul 2012 21:56:25 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201207282156.q6SLuPHY072337@svn.freebsd.org> From: Hiroki Sato Date: Sat, 28 Jul 2012 21:56:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238873 - in head/sys: arm/mv arm/mv/kirkwood dev/cesa dev/mge dev/mvs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 21:56:25 -0000 Author: hrs Date: Sat Jul 28 21:56:24 2012 New Revision: 238873 URL: http://svn.freebsd.org/changeset/base/238873 Log: Add support for Marvell 88F6282. Sponsored by: Plat'Home, Co.,Ltd. Modified: head/sys/arm/mv/common.c head/sys/arm/mv/gpio.c head/sys/arm/mv/ic.c head/sys/arm/mv/kirkwood/kirkwood.c head/sys/arm/mv/mv_sata.c head/sys/arm/mv/mvreg.h head/sys/dev/cesa/cesa.c head/sys/dev/mge/if_mge.c head/sys/dev/mvs/mvs_soc.c Modified: head/sys/arm/mv/common.c ============================================================================== --- head/sys/arm/mv/common.c Sat Jul 28 21:43:29 2012 (r238872) +++ head/sys/arm/mv/common.c Sat Jul 28 21:56:24 2012 (r238873) @@ -251,7 +251,9 @@ cpu_extra_feat(void) uint32_t ef = 0; soc_id(&dev, &rev); - if (dev == MV_DEV_88F6281 || dev == MV_DEV_MV78100_Z0 || + if (dev == MV_DEV_88F6281 || + dev == MV_DEV_88F6282 || + dev == MV_DEV_MV78100_Z0 || dev == MV_DEV_MV78100) __asm __volatile("mrc p15, 1, %0, c15, c1, 0" : "=r" (ef)); else if (dev == MV_DEV_88F5182 || dev == MV_DEV_88F5281) @@ -351,6 +353,13 @@ soc_identify(void) else if (r == 3) rev = "A1"; break; + case MV_DEV_88F6282: + dev = "Marvell 88F6282"; + if (r == 0) + rev = "A0"; + else if (r == 1) + rev = "A1"; + break; case MV_DEV_MV78100_Z0: dev = "Marvell MV78100 Z0"; break; @@ -536,6 +545,7 @@ 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_88F6282 && i < 4) || (dev == MV_DEV_MV78100 && i < 8) || (dev == MV_DEV_MV78100_Z0 && i < 8)) return (1); @@ -1320,7 +1330,8 @@ xor_max_eng(void) uint32_t dev, rev; soc_id(&dev, &rev); - if (dev == MV_DEV_88F6281) + if (dev == MV_DEV_88F6281 || + dev == MV_DEV_88F6282) return (2); else if ((dev == MV_DEV_MV78100) || (dev == MV_DEV_MV78100_Z0)) return (1); Modified: head/sys/arm/mv/gpio.c ============================================================================== --- head/sys/arm/mv/gpio.c Sat Jul 28 21:43:29 2012 (r238872) +++ head/sys/arm/mv/gpio.c Sat Jul 28 21:56:24 2012 (r238873) @@ -155,7 +155,8 @@ mv_gpio_attach(device_t dev) sc->pin_num = 32; sc->irq_num = 4; - } else if (dev_id == MV_DEV_88F6281) { + } else if (dev_id == MV_DEV_88F6281 || + dev_id == MV_DEV_88F6282) { sc->pin_num = 50; sc->irq_num = 7; Modified: head/sys/arm/mv/ic.c ============================================================================== --- head/sys/arm/mv/ic.c Sat Jul 28 21:43:29 2012 (r238872) +++ head/sys/arm/mv/ic.c Sat Jul 28 21:56:24 2012 (r238873) @@ -105,7 +105,9 @@ mv_ic_attach(device_t dev) sc->ic_high_regs = 0; sc->ic_error_regs = 0; - if (dev_id == MV_DEV_88F6281 || dev_id == MV_DEV_MV78100 || + if (dev_id == MV_DEV_88F6281 || + dev_id == MV_DEV_88F6282 || + dev_id == MV_DEV_MV78100 || dev_id == MV_DEV_MV78100_Z0) sc->ic_high_regs = 1; Modified: head/sys/arm/mv/kirkwood/kirkwood.c ============================================================================== --- head/sys/arm/mv/kirkwood/kirkwood.c Sat Jul 28 21:43:29 2012 (r238872) +++ head/sys/arm/mv/kirkwood/kirkwood.c Sat Jul 28 21:56:24 2012 (r238873) @@ -74,6 +74,8 @@ get_tclk(void) soc_id(&dev, &rev); if (dev == MV_DEV_88F6281 && (rev == 2 || rev == 3)) return (TCLK_200MHZ); + if (dev == MV_DEV_88F6282) + return (TCLK_200MHZ); return (TCLK_166MHZ); } Modified: head/sys/arm/mv/mv_sata.c ============================================================================== --- head/sys/arm/mv/mv_sata.c Sat Jul 28 21:43:29 2012 (r238872) +++ head/sys/arm/mv/mv_sata.c Sat Jul 28 21:56:24 2012 (r238873) @@ -197,6 +197,7 @@ sata_probe(device_t dev) sc->sc_edma_qlen = 128; break; case MV_DEV_88F6281: + case MV_DEV_88F6282: case MV_DEV_MV78100: case MV_DEV_MV78100_Z0: sc->sc_version = 2; Modified: head/sys/arm/mv/mvreg.h ============================================================================== --- head/sys/arm/mv/mvreg.h Sat Jul 28 21:43:29 2012 (r238872) +++ head/sys/arm/mv/mvreg.h Sat Jul 28 21:56:24 2012 (r238873) @@ -326,6 +326,7 @@ #define MV_DEV_88F5182 0x5182 #define MV_DEV_88F5281 0x5281 #define MV_DEV_88F6281 0x6281 +#define MV_DEV_88F6282 0x6282 #define MV_DEV_MV78100_Z0 0x6381 #define MV_DEV_MV78100 0x7810 Modified: head/sys/dev/cesa/cesa.c ============================================================================== --- head/sys/dev/cesa/cesa.c Sat Jul 28 21:43:29 2012 (r238872) +++ head/sys/dev/cesa/cesa.c Sat Jul 28 21:56:24 2012 (r238873) @@ -1005,6 +1005,7 @@ cesa_attach(device_t dev) switch (d) { case MV_DEV_88F6281: + case MV_DEV_88F6282: sc->sc_tperr = 0; break; case MV_DEV_MV78100: Modified: head/sys/dev/mge/if_mge.c ============================================================================== --- head/sys/dev/mge/if_mge.c Sat Jul 28 21:43:29 2012 (r238872) +++ head/sys/dev/mge/if_mge.c Sat Jul 28 21:56:24 2012 (r238873) @@ -258,7 +258,9 @@ mge_ver_params(struct mge_softc *sc) uint32_t d, r; soc_id(&d, &r); - if (d == MV_DEV_88F6281 || d == MV_DEV_MV78100 || + if (d == MV_DEV_88F6281 || + d == MV_DEV_88F6282 || + d == MV_DEV_MV78100 || d == MV_DEV_MV78100_Z0) { sc->mge_ver = 2; sc->mge_mtu = 0x4e8; Modified: head/sys/dev/mvs/mvs_soc.c ============================================================================== --- head/sys/dev/mvs/mvs_soc.c Sat Jul 28 21:43:29 2012 (r238872) +++ head/sys/dev/mvs/mvs_soc.c Sat Jul 28 21:56:24 2012 (r238873) @@ -63,6 +63,7 @@ static struct { } mvs_ids[] = { {MV_DEV_88F5182, 0x00, "Marvell 88F5182", 2, MVS_Q_GENIIE|MVS_Q_SOC}, {MV_DEV_88F6281, 0x00, "Marvell 88F6281", 2, MVS_Q_GENIIE|MVS_Q_SOC}, + {MV_DEV_88F6282, 0x00, "Marvell 88F6282", 2, MVS_Q_GENIIE|MVS_Q_SOC}, {MV_DEV_MV78100, 0x00, "Marvell MV78100", 2, MVS_Q_GENIIE|MVS_Q_SOC}, {MV_DEV_MV78100_Z0, 0x00,"Marvell MV78100", 2, MVS_Q_GENIIE|MVS_Q_SOC}, {0, 0x00, NULL, 0, 0} From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 21:59:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E136F106566B; Sat, 28 Jul 2012 21:59:12 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B33B48FC17; Sat, 28 Jul 2012 21:59:12 +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 q6SLxCO4072595; Sat, 28 Jul 2012 21:59:12 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6SLxC82072593; Sat, 28 Jul 2012 21:59:12 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201207282159.q6SLxC82072593@svn.freebsd.org> From: Hiroki Sato Date: Sat, 28 Jul 2012 21:59:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238874 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 21:59:13 -0000 Author: hrs Date: Sat Jul 28 21:59:12 2012 New Revision: 238874 URL: http://svn.freebsd.org/changeset/base/238874 Log: Add support for 88E1116R. Sponsored by: Plat'Home, Co.,Ltd. Modified: head/sys/dev/mii/e1000phy.c Modified: head/sys/dev/mii/e1000phy.c ============================================================================== --- head/sys/dev/mii/e1000phy.c Sat Jul 28 21:56:24 2012 (r238873) +++ head/sys/dev/mii/e1000phy.c Sat Jul 28 21:59:12 2012 (r238874) @@ -106,6 +106,7 @@ static const struct mii_phydesc e1000phy MII_PHY_DESC(xxMARVELL, E1111), MII_PHY_DESC(xxMARVELL, E1116), MII_PHY_DESC(xxMARVELL, E1116R), + MII_PHY_DESC(xxMARVELL, E1116R_29), MII_PHY_DESC(xxMARVELL, E1118), MII_PHY_DESC(xxMARVELL, E1149R), MII_PHY_DESC(xxMARVELL, E3016), @@ -208,6 +209,7 @@ e1000phy_reset(struct mii_softc *sc) case MII_MODEL_xxMARVELL_E1111: case MII_MODEL_xxMARVELL_E1112: case MII_MODEL_xxMARVELL_E1116: + case MII_MODEL_xxMARVELL_E1116R_29: case MII_MODEL_xxMARVELL_E1118: case MII_MODEL_xxMARVELL_E1149: case MII_MODEL_xxMARVELL_E1149R: @@ -215,7 +217,8 @@ e1000phy_reset(struct mii_softc *sc) /* Disable energy detect mode. */ reg &= ~E1000_SCR_EN_DETECT_MASK; reg |= E1000_SCR_AUTO_X_MODE; - if (sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1116) + if (sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1116 || + sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1116R_29) reg &= ~E1000_SCR_POWER_DOWN; reg |= E1000_SCR_ASSERT_CRS_ON_TX; break; @@ -243,6 +246,7 @@ e1000phy_reset(struct mii_softc *sc) PHY_WRITE(sc, E1000_SCR, reg); if (sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1116 || + sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1116R_29 || sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1149 || sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1149R) { PHY_WRITE(sc, E1000_EADR, 2); @@ -259,6 +263,7 @@ e1000phy_reset(struct mii_softc *sc) case MII_MODEL_xxMARVELL_E1118: break; case MII_MODEL_xxMARVELL_E1116: + case MII_MODEL_xxMARVELL_E1116R_29: page = PHY_READ(sc, E1000_EADR); /* Select page 3, LED control register. */ PHY_WRITE(sc, E1000_EADR, 3); From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 22:25:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDF41106564A; Sat, 28 Jul 2012 22:25:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 75C708FC0C; Sat, 28 Jul 2012 22:25:26 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:2ddc:c530:4913:4fc8] (unknown [IPv6:2001:7b8:3a7:0:2ddc:c530:4913:4fc8]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 784D35C37; Sun, 29 Jul 2012 00:25:19 +0200 (CEST) Message-ID: <501466D3.9020403@FreeBSD.org> Date: Sun, 29 Jul 2012 00:25:23 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Roman Divacky References: <201207281250.q6SCoQfS027517@svn.freebsd.org> <20120728180137.GA55575@freebsd.org> In-Reply-To: <20120728180137.GA55575@freebsd.org> X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238863 - head/contrib/llvm/tools/clang/lib/Driver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 22:25:26 -0000 On 2012-07-28 20:01, Roman Divacky wrote:> It would be great to stay in sync with upstream. > > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?r1=160103&r2=160231 Yeah, I have seen that commit, but it's not entirely correct: --hash-style=both should only be enabled for certain arches, and also --enable-new-dtags and that option should only be enabled when not linking statically. I have already sent a new patch upstream, to cfe-commits@cs.uiuc.edu. From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 22:42:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB739106566B; Sat, 28 Jul 2012 22:42:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D625D8FC0A; Sat, 28 Jul 2012 22:42:52 +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 q6SMgqnt077390; Sat, 28 Jul 2012 22:42:52 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6SMgqHd077388; Sat, 28 Jul 2012 22:42:52 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201207282242.q6SMgqHd077388@svn.freebsd.org> From: Michael Tuexen Date: Sat, 28 Jul 2012 22:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238875 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 22:42:53 -0000 Author: tuexen Date: Sat Jul 28 22:42:52 2012 New Revision: 238875 URL: http://svn.freebsd.org/changeset/base/238875 Log: MFC r238790: Fix the sctp_sockstore union such that userland programs don't depend on INET and/or INET6 to be defined and in-tune with how the kernel was compiled. Approved by: re (kib) Modified: stable/9/sys/netinet/sctp_uio.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_uio.h ============================================================================== --- stable/9/sys/netinet/sctp_uio.h Sat Jul 28 21:59:12 2012 (r238874) +++ stable/9/sys/netinet/sctp_uio.h Sat Jul 28 22:42:52 2012 (r238875) @@ -1124,12 +1124,8 @@ struct sctpstat { #define SCTP_STAT_DECR_GAUGE32(_x) SCTP_STAT_DECR(_x) union sctp_sockstore { -#if defined(INET) struct sockaddr_in sin; -#endif -#if defined(INET6) struct sockaddr_in6 sin6; -#endif struct sockaddr sa; }; From owner-svn-src-all@FreeBSD.ORG Sat Jul 28 23:11:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9CB4106566C; Sat, 28 Jul 2012 23:11:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA9D48FC1C; Sat, 28 Jul 2012 23:11:09 +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 q6SNB9Wo081070; Sat, 28 Jul 2012 23:11:09 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6SNB9P9081068; Sat, 28 Jul 2012 23:11:09 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201207282311.q6SNB9P9081068@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 28 Jul 2012 23:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238876 - stable/9/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jul 2012 23:11:10 -0000 Author: bz Date: Sat Jul 28 23:11:09 2012 New Revision: 238876 URL: http://svn.freebsd.org/changeset/base/238876 Log: MFC r238871: Hardcode the loopback rx/tx checkum options for IPv6 to on without checking. This allows the FreeBSD 9.1 release process to move forward. Work around the problem that loopback connections to local addresses not on loopback interfaces and not on interfaces w/ IPv6 checksum offloading enabled would not work. A proper fix to allow us to disable the "checksum offload" on loopback for testing, measurements, ... as we allow for IPv4 needs to put in place later. PR: kern/170070 Approved by: re (kib) Modified: stable/9/sys/net/if_loop.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net/if_loop.c ============================================================================== --- stable/9/sys/net/if_loop.c Sat Jul 28 22:42:52 2012 (r238875) +++ stable/9/sys/net/if_loop.c Sat Jul 28 23:11:09 2012 (r238876) @@ -257,10 +257,20 @@ looutput(struct ifnet *ifp, struct mbuf m->m_pkthdr.csum_flags &= ~LO_CSUM_FEATURES; break; case AF_INET6: +#if 0 + /* + * XXX-BZ for now always claim the checksum is good despite + * any interface flags. This is a workaround for 9.1-R and + * a proper solution ought to be sought later. + */ if (ifp->if_capenable & IFCAP_RXCSUM_IPV6) { m->m_pkthdr.csum_data = 0xffff; m->m_pkthdr.csum_flags = LO_CSUM_SET; } +#else + m->m_pkthdr.csum_data = 0xffff; + m->m_pkthdr.csum_flags = LO_CSUM_SET; +#endif m->m_pkthdr.csum_flags &= ~LO_CSUM_FEATURES6; break; case AF_IPX: @@ -446,15 +456,29 @@ loioctl(struct ifnet *ifp, u_long cmd, c ifp->if_capenable ^= IFCAP_RXCSUM; if ((mask & IFCAP_TXCSUM) != 0) ifp->if_capenable ^= IFCAP_TXCSUM; - if ((mask & IFCAP_RXCSUM_IPV6) != 0) + if ((mask & IFCAP_RXCSUM_IPV6) != 0) { +#if 0 ifp->if_capenable ^= IFCAP_RXCSUM_IPV6; - if ((mask & IFCAP_TXCSUM_IPV6) != 0) +#else + error = EOPNOTSUPP; + break; +#endif + } + if ((mask & IFCAP_TXCSUM_IPV6) != 0) { +#if 0 ifp->if_capenable ^= IFCAP_TXCSUM_IPV6; +#else + error = EOPNOTSUPP; + break; +#endif + } ifp->if_hwassist = 0; if (ifp->if_capenable & IFCAP_TXCSUM) ifp->if_hwassist = LO_CSUM_FEATURES; +#if 0 if (ifp->if_capenable & IFCAP_TXCSUM_IPV6) ifp->if_hwassist |= LO_CSUM_FEATURES6; +#endif break; default: