From owner-svn-src-head@FreeBSD.ORG Sun Oct 19 00:13:57 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 946EE1065690; Sun, 19 Oct 2008 00:13:57 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82B428FC1F; Sun, 19 Oct 2008 00:13:57 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9J0Dv6P029126; Sun, 19 Oct 2008 00:13:57 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9J0DvRj029125; Sun, 19 Oct 2008 00:13:57 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200810190013.m9J0DvRj029125@svn.freebsd.org> From: Tim Kientzle Date: Sun, 19 Oct 2008 00:13:57 +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: r184037 - head/lib/libarchive/test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 00:13:57 -0000 Author: kientzle Date: Sun Oct 19 00:13:57 2008 New Revision: 184037 URL: http://svn.freebsd.org/changeset/base/184037 Log: Style: Mark private data 'static', correct an old comment. MFC after: 3 days Modified: head/lib/libarchive/test/test_acl_basic.c Modified: head/lib/libarchive/test/test_acl_basic.c ============================================================================== --- head/lib/libarchive/test/test_acl_basic.c Sat Oct 18 22:59:39 2008 (r184036) +++ head/lib/libarchive/test/test_acl_basic.c Sun Oct 19 00:13:57 2008 (r184037) @@ -27,8 +27,7 @@ __FBSDID("$FreeBSD$"); /* * Exercise the system-independent portion of the ACL support. - * Check that archive_entry objects can save and restore ACL data - * and that pax archive can save and restore ACL data. + * Check that archive_entry objects can save and restore ACL data. * * This should work on all systems, regardless of whether local * filesystems support ACLs or not. @@ -42,7 +41,7 @@ struct acl_t { const char *name; /* Name of user/group, depending on tag. */ }; -struct acl_t acls0[] = { +static struct acl_t acls0[] = { { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE, ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" }, { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ, @@ -51,7 +50,7 @@ struct acl_t acls0[] = { ARCHIVE_ENTRY_ACL_OTHER, 0, "" }, }; -struct acl_t acls1[] = { +static struct acl_t acls1[] = { { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE, ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" }, { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ, @@ -62,7 +61,7 @@ struct acl_t acls1[] = { ARCHIVE_ENTRY_ACL_OTHER, -1, "" }, }; -struct acl_t acls2[] = { +static struct acl_t acls2[] = { { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE | ARCHIVE_ENTRY_ACL_READ, ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" }, { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ, From owner-svn-src-head@FreeBSD.ORG Sun Oct 19 00:18:45 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64D161065688; Sun, 19 Oct 2008 00:18:45 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5164D8FC19; Sun, 19 Oct 2008 00:18:45 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9J0IjpX029265; Sun, 19 Oct 2008 00:18:45 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9J0Ijst029262; Sun, 19 Oct 2008 00:18:45 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200810190018.m9J0Ijst029262@svn.freebsd.org> From: Tim Kientzle Date: Sun, 19 Oct 2008 00:18: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: r184038 - in head/lib/libarchive: . test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 00:18:45 -0000 Author: kientzle Date: Sun Oct 19 00:18:44 2008 New Revision: 184038 URL: http://svn.freebsd.org/changeset/base/184038 Log: Add test to verify ACL restores on FreeBSD, verify kern/128203 (mtime restore fails if ACL provided), apply patch from kern/128203, and verify fix. PR: kern/128203 Submitted by: Udo Schweigert MFC after: 3 days Added: head/lib/libarchive/test/test_acl_freebsd.c (contents, props changed) Modified: head/lib/libarchive/archive_write_disk.c head/lib/libarchive/test/Makefile Modified: head/lib/libarchive/archive_write_disk.c ============================================================================== --- head/lib/libarchive/archive_write_disk.c Sun Oct 19 00:13:57 2008 (r184037) +++ head/lib/libarchive/archive_write_disk.c Sun Oct 19 00:18:44 2008 (r184038) @@ -710,10 +710,6 @@ _archive_write_finish_entry(struct archi int r2 = set_mode(a, a->mode); if (r2 < ret) ret = r2; } - if (a->todo & TODO_TIMES) { - int r2 = set_times(a); - if (r2 < ret) ret = r2; - } if (a->todo & TODO_ACLS) { int r2 = set_acls(a); if (r2 < ret) ret = r2; @@ -726,6 +722,10 @@ _archive_write_finish_entry(struct archi int r2 = set_fflags(a); if (r2 < ret) ret = r2; } + if (a->todo & TODO_TIMES) { + int r2 = set_times(a); + if (r2 < ret) ret = r2; + } /* If there's an fd, we can close it now. */ if (a->fd >= 0) { Modified: head/lib/libarchive/test/Makefile ============================================================================== --- head/lib/libarchive/test/Makefile Sun Oct 19 00:13:57 2008 (r184037) +++ head/lib/libarchive/test/Makefile Sun Oct 19 00:18:44 2008 (r184038) @@ -9,6 +9,7 @@ LA_SRCS!=make -f ${LA_SRCDIR}/Makefile - TESTS= \ test_acl_basic.c \ + test_acl_freebsd.c \ test_acl_pax.c \ test_archive_api_feature.c \ test_bad_fd.c \ Added: head/lib/libarchive/test/test_acl_freebsd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libarchive/test/test_acl_freebsd.c Sun Oct 19 00:18:44 2008 (r184038) @@ -0,0 +1,243 @@ +/*- + * Copyright (c) 2003-2008 Tim Kientzle + * 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(S) ``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(S) 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 "test.h" +__FBSDID("$FreeBSD$"); + +#if defined(__FreeBSD__) && __FreeBSD__ > 4 +#include + +struct myacl_t { + int type; /* Type of ACL: "access" or "default" */ + int permset; /* Permissions for this class of users. */ + int tag; /* Owner, User, Owning group, group, other, etc. */ + int qual; /* GID or UID of user/group, depending on tag. */ + const char *name; /* Name of user/group, depending on tag. */ +}; + +static struct myacl_t acls2[] = { + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE | ARCHIVE_ENTRY_ACL_READ, + ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ, + ARCHIVE_ENTRY_ACL_USER, 77, "user77" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0, + ARCHIVE_ENTRY_ACL_USER, 78, "user78" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ, + ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0007, + ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_EXECUTE, + ARCHIVE_ENTRY_ACL_OTHER, -1, "" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_READ | ARCHIVE_ENTRY_ACL_EXECUTE, + ARCHIVE_ENTRY_ACL_MASK, -1, "" }, + { 0, 0, 0, 0, NULL } +}; + +static void +set_acls(struct archive_entry *ae, struct myacl_t *acls) +{ + int i; + + archive_entry_acl_clear(ae); + for (i = 0; acls[i].name != NULL; i++) { + archive_entry_acl_add_entry(ae, + acls[i].type, acls[i].permset, acls[i].tag, acls[i].qual, + acls[i].name); + } +} + +static int +acl_match(acl_entry_t aclent, struct myacl_t *myacl) +{ + acl_tag_t tag_type; + acl_permset_t opaque_ps; + int permset = 0; + + acl_get_tag_type(aclent, &tag_type); + + /* translate the silly opaque permset to a bitmap */ + acl_get_permset(aclent, &opaque_ps); + if (acl_get_perm_np(opaque_ps, ACL_EXECUTE)) + permset |= ARCHIVE_ENTRY_ACL_EXECUTE; + if (acl_get_perm_np(opaque_ps, ACL_WRITE)) + permset |= ARCHIVE_ENTRY_ACL_WRITE; + if (acl_get_perm_np(opaque_ps, ACL_READ)) + permset |= ARCHIVE_ENTRY_ACL_READ; + + if (permset != myacl->permset) + return (0); + + switch (tag_type) { + case ACL_USER_OBJ: + if (myacl->tag != ARCHIVE_ENTRY_ACL_USER_OBJ) return (0); + break; + case ACL_USER: + if (myacl->tag != ARCHIVE_ENTRY_ACL_USER) + return (0); + if ((uid_t)myacl->qual != *(uid_t *)acl_get_qualifier(aclent)) + return (0); + break; + case ACL_GROUP_OBJ: + if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP_OBJ) return (0); + break; + case ACL_GROUP: + if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP) + return (0); + if ((gid_t)myacl->qual != *(gid_t *)acl_get_qualifier(aclent)) + return (0); + break; + case ACL_MASK: + if (myacl->tag != ARCHIVE_ENTRY_ACL_MASK) return (0); + break; + case ACL_OTHER: + if (myacl->tag != ARCHIVE_ENTRY_ACL_OTHER) return (0); + break; + } + return (1); +} + +static void +compare_acls(acl_t acl, struct myacl_t *myacls) +{ + int *marker; + int entry_id = ACL_FIRST_ENTRY; + int matched; + int i, n; + acl_entry_t acl_entry; + + /* Count ACL entries in myacls array and allocate an indirect array. */ + for (n = 0; myacls[n].name != NULL; ++n) + continue; + marker = malloc(sizeof(marker[0]) * n); + for (i = 0; i < n; i++) + marker[i] = i; + + /* + * Iterate over acls in system acl object, try to match each + * one with an item in the myacls array. + */ + while (1 == acl_get_entry(acl, entry_id, &acl_entry)) { + /* After the first time... */ + entry_id = ACL_NEXT_ENTRY; + + /* Search for a matching entry (tag and qualifier) */ + for (i = 0, matched = 0; i < n && !matched; i++) { + if (acl_match(acl_entry, &myacls[marker[i]])) { + /* We found a match; remove it. */ + marker[i] = marker[n - 1]; + n--; + matched = 1; + } + } + + /* TODO: Print out more details in this case. */ + failure("ACL entry on file that shouldn't be there"); + assert(matched == 1); + } + + /* Dump entries in the myacls array that weren't in the system acl. */ + for (i = 0; i < n; ++i) { + failure(" ACL entry missing from file: " + "type=%d,permset=%d,tag=%d,qual=%d,name=``%s''\n", + myacls[marker[i]].type, myacls[marker[i]].permset, + myacls[marker[i]].tag, myacls[marker[i]].qual, + myacls[marker[i]].name); + assert(0); /* Record this as a failure. */ + } + free(marker); +} + +#endif + + +/* + * Verify ACL restore-to-disk. This test is FreeBSD-specific. + */ + +DEFINE_TEST(test_acl_freebsd) +{ +#if !defined(__FreeBSD__) + skipping("FreeBSD-specific ACL restore test"); +#elif __FreeBSD__ < 5 + skipping("ACL restore supported only on FreeBSD 5.0 and later"); +#else + struct stat st; + struct archive *a; + struct archive_entry *ae; + int n, fd; + acl_t acl; + + /* + * First, do a quick manual set/read of ACL data to + * verify that the local filesystem does support ACLs. + * If it doesn't, we'll simply skip the remaining tests. + */ + acl = acl_from_text("u::rwx,u:1:rw,g::rwx,g:15:rx,o::rwx,m::rwx"); + assert((void *)acl != NULL); + /* Create a test file and try to set an ACL on it. */ + fd = open("pretest", O_WRONLY | O_CREAT | O_EXCL, 0777); + failure("Could not create test file?!"); + n = -1; + if (assert(fd >= 0)) { + n = acl_set_fd(fd, acl); + failure("acl_set_fd(): errno = %d (%s)", + errno, strerror(errno)); + assertEqualInt(0, n); + close(fd); + } + + if (fd < 0 || n != 0) { + skipping("ACL tests require that ACL support be enabled on the filesystem"); + return; + } + + /* Create a write-to-disk object. */ + assert(NULL != (a = archive_write_disk_new())); + archive_write_disk_set_options(a, + ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_ACL); + + /* Populate an archive entry with some metadata, including ACL info */ + ae = archive_entry_new(); + assert(ae != NULL); + archive_entry_set_pathname(ae, "test0"); + archive_entry_set_mtime(ae, 123456, 7890); + archive_entry_set_size(ae, 0); + set_acls(ae, acls2); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Close the archive. */ + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_finish(a)); + + /* Verify the data on disk. */ + assertEqualInt(0, stat("test0", &st)); + assertEqualInt(st.st_mtime, 123456); + acl = acl_get_file("test0", ACL_TYPE_ACCESS); + assert(acl != (acl_t)NULL); + compare_acls(acl, acls2); +#endif +} From owner-svn-src-head@FreeBSD.ORG Sun Oct 19 01:23:30 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C76F91065677; Sun, 19 Oct 2008 01:23:30 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5D6B8FC0A; Sun, 19 Oct 2008 01:23:30 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9J1NUJI030430; Sun, 19 Oct 2008 01:23:30 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9J1NUZm030428; Sun, 19 Oct 2008 01:23:30 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200810190123.m9J1NUZm030428@svn.freebsd.org> From: Kip Macy Date: Sun, 19 Oct 2008 01:23: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: r184039 - in head/sys/i386: include xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 01:23:30 -0000 Author: kmacy Date: Sun Oct 19 01:23:30 2008 New Revision: 184039 URL: http://svn.freebsd.org/changeset/base/184039 Log: GC unused values Modified: head/sys/i386/include/trap.h head/sys/i386/xen/locore.s Modified: head/sys/i386/include/trap.h ============================================================================== --- head/sys/i386/include/trap.h Sun Oct 19 00:18:44 2008 (r184038) +++ head/sys/i386/include/trap.h Sun Oct 19 01:23:30 2008 (r184039) @@ -49,9 +49,6 @@ #define T_PAGEFLT 12 /* page fault */ #define T_ALIGNFLT 14 /* alignment fault */ -#ifdef XEN -#define T_HYPCALLBACK 17 /* hypervisor upcall */ -#endif #define T_DIVIDE 18 /* integer divide fault */ #define T_NMI 19 /* non-maskable trap */ #define T_OFLOW 20 /* overflow trap */ Modified: head/sys/i386/xen/locore.s ============================================================================== --- head/sys/i386/xen/locore.s Sun Oct 19 00:18:44 2008 (r184038) +++ head/sys/i386/xen/locore.s Sun Oct 19 01:23:30 2008 (r184039) @@ -136,16 +136,6 @@ KERNend: .long 0 /* phys addr end of ke .globl physfree physfree: .long 0 /* phys addr of next free page */ -#ifdef SMP - .globl cpu0prvpage -cpu0pp: .long 0 /* phys addr cpu0 private pg */ -cpu0prvpage: .long 0 /* relocated version */ - - .globl SMPpt -SMPptpa: .long 0 /* phys addr SMP page table */ -SMPpt: .long 0 /* relocated version */ -#endif /* SMP */ - .globl IdlePTD IdlePTD: .long 0 /* phys addr of kernel PTD */ From owner-svn-src-head@FreeBSD.ORG Sun Oct 19 01:27:41 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 292181065689; Sun, 19 Oct 2008 01:27:41 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16BD18FC08; Sun, 19 Oct 2008 01:27:41 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9J1ReE7030528; Sun, 19 Oct 2008 01:27:40 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9J1ReEj030526; Sun, 19 Oct 2008 01:27:40 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200810190127.m9J1ReEj030526@svn.freebsd.org> From: Kip Macy Date: Sun, 19 Oct 2008 01:27: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: r184040 - in head/sys/i386: include xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 01:27:41 -0000 Author: kmacy Date: Sun Oct 19 01:27:40 2008 New Revision: 184040 URL: http://svn.freebsd.org/changeset/base/184040 Log: - move gdt, ldt allocation to before KPT allocation - fix bugs where we would: - try to map the hypervisors address space - accidentally kick out an existing kernel mapping for some domain creation memory allocation sizes - accidentally skip a 2MB kernel mapping for some domain creation memory allocation sizes - don't rely on trapping in to xen to read rcr2, reference through vcpu - whitespace cleanups Modified: head/sys/i386/include/cpufunc.h head/sys/i386/xen/xen_machdep.c Modified: head/sys/i386/include/cpufunc.h ============================================================================== --- head/sys/i386/include/cpufunc.h Sun Oct 19 01:23:30 2008 (r184039) +++ head/sys/i386/include/cpufunc.h Sun Oct 19 01:27:40 2008 (r184040) @@ -45,6 +45,7 @@ #ifdef XEN extern void xen_cli(void); extern void xen_sti(void); +extern u_int xen_rcr2(void); extern void xen_load_cr3(u_int data); extern void xen_tlb_flush(void); extern void xen_invlpg(u_int addr); @@ -94,7 +95,7 @@ disable_intr(void) #ifdef XEN xen_cli(); #else - __asm __volatile("cli" : : : "memory"); + __asm __volatile("cli" : : : "memory"); #endif } @@ -119,7 +120,7 @@ enable_intr(void) { #ifdef XEN xen_sti(); -#else +#else __asm __volatile("sti"); #endif } @@ -423,6 +424,9 @@ rcr2(void) { u_int data; +#ifdef XEN + return (xen_rcr2()); +#endif __asm __volatile("movl %%cr2,%0" : "=r" (data)); return (data); } Modified: head/sys/i386/xen/xen_machdep.c ============================================================================== --- head/sys/i386/xen/xen_machdep.c Sun Oct 19 01:23:30 2008 (r184039) +++ head/sys/i386/xen/xen_machdep.c Sun Oct 19 01:27:40 2008 (r184040) @@ -202,21 +202,20 @@ static struct mmu_log xpq_queue_log[MAX_ static int xpq_idx[MAX_VIRT_CPUS]; static mmu_update_t xpq_queue[MAX_VIRT_CPUS][XPQUEUE_SIZE]; -#define XPQ_QUEUE xpq_queue[vcpu] -#define XPQ_IDX xpq_idx[vcpu] -#define SET_VCPU() int vcpu = smp_processor_id() - - -#define XPQ_QUEUE_LOG xpq_queue_log[vcpu] +#define XPQ_QUEUE_LOG xpq_queue_log[vcpu] +#define XPQ_QUEUE xpq_queue[vcpu] +#define XPQ_IDX xpq_idx[vcpu] +#define SET_VCPU() int vcpu = smp_processor_id() #else static mmu_update_t xpq_queue[XPQUEUE_SIZE]; static struct mmu_log xpq_queue_log[XPQUEUE_SIZE]; static int xpq_idx = 0; -#define XPQ_QUEUE xpq_queue -#define XPQ_IDX xpq_idx -#define SET_VCPU() +#define XPQ_QUEUE_LOG xpq_queue_log +#define XPQ_QUEUE xpq_queue +#define XPQ_IDX xpq_idx +#define SET_VCPU() #endif /* !SMP */ #define XPQ_IDX_INC atomic_add_int(&XPQ_IDX, 1); @@ -371,6 +370,13 @@ xen_sti(void) __sti(); } +u_int +xen_rcr2(void) +{ + + return (HYPERVISOR_shared_info->vcpu_info[curcpu].arch.cr2); +} + void _xen_machphys_update(vm_paddr_t mfn, vm_paddr_t pfn, char *file, int line) { @@ -810,7 +816,7 @@ void initvalues(start_info_t *startinfo) { int l3_pages, l2_pages, l1_pages, offset; - vm_offset_t cur_space; + vm_offset_t cur_space, cur_space_pt; struct physdev_set_iopl set_iopl; vm_paddr_t KPTphys, IdlePTDma; @@ -825,15 +831,13 @@ initvalues(start_info_t *startinfo) vm_paddr_t pdir_shadow_ma; #endif unsigned long i; - int ncpus; + int ncpus = MAXCPU; - nkpt = min(max((startinfo->nr_pages >> NPGPTD_SHIFT), nkpt), - NPGPTD*NPDEPG - KPTDI); -#ifdef SMP - ncpus = MAXCPU; -#else - ncpus = 1; -#endif + nkpt = min( + min( + max((startinfo->nr_pages >> NPGPTD_SHIFT), nkpt), + NPGPTD*NPDEPG - KPTDI), + (HYPERVISOR_VIRT_START - KERNBASE) >> PDRSHIFT); HYPERVISOR_vm_assist(VMASST_CMD_enable, VMASST_TYPE_4gb_segments); #ifdef notyet @@ -859,7 +863,24 @@ initvalues(start_info_t *startinfo) bootmem_start = bootmem_current = (char *)cur_space; cur_space += (4 * PAGE_SIZE); bootmem_end = (char *)cur_space; + + /* allocate page for gdt */ + gdt = (union descriptor *)cur_space; + cur_space += PAGE_SIZE*ncpus; + + /* allocate page for ldt */ + ldt = (union descriptor *)cur_space; cur_space += PAGE_SIZE; + cur_space += PAGE_SIZE; + HYPERVISOR_shared_info = (shared_info_t *)cur_space; + cur_space += PAGE_SIZE; + + xen_store = (struct ringbuf_head *)cur_space; + cur_space += PAGE_SIZE; + + console_page = (char *)cur_space; + cur_space += PAGE_SIZE; + #ifdef ADD_ISA_HOLE shift_phys_machine(xen_phys_machine, xen_start_info->nr_pages); #endif @@ -936,6 +957,16 @@ initvalues(start_info_t *startinfo) * Unpin the current PDPT */ xen_pt_unpin(IdlePDPTma); + + for (i = 0; i < 20; i++) { + int startidx = ((KERNBASE >> 18) & PAGE_MASK) >> 3; + + if (IdlePTD[startidx + i] == 0) { + l1_pages = i; + break; + } + } + #endif /* PAE */ /* unmap remaining pages from initial 4MB chunk @@ -947,7 +978,7 @@ initvalues(start_info_t *startinfo) } PT_UPDATES_FLUSH(); - + memcpy(((uint8_t *)IdlePTDnew) + ((unsigned int)(KERNBASE >> 18)), ((uint8_t *)IdlePTD) + ((KERNBASE >> 18) & PAGE_MASK), l1_pages*sizeof(pt_entry_t)); @@ -960,18 +991,22 @@ initvalues(start_info_t *startinfo) xen_pgdpt_pin(xpmap_ptom(VTOP(IdlePDPTnew))); /* allocate remainder of nkpt pages */ - for (offset = (KERNBASE >> PDRSHIFT), i = l1_pages - 1; i < nkpt; + cur_space_pt = cur_space; + for (offset = (KERNBASE >> PDRSHIFT), i = l1_pages; i < nkpt; i++, cur_space += PAGE_SIZE) { pdir = (offset + i) / NPDEPG; curoffset = ((offset + i) % NPDEPG); - + if (((offset + i) << PDRSHIFT) == VM_MAX_KERNEL_ADDRESS) + break; + /* * make sure that all the initial page table pages * have been zeroed */ - PT_SET_MA(cur_space, xpmap_ptom(VTOP(cur_space)) | PG_V | PG_RW); - bzero((char *)cur_space, PAGE_SIZE); - PT_SET_MA(cur_space, (vm_paddr_t)0); + PT_SET_MA(cur_space_pt, + xpmap_ptom(VTOP(cur_space)) | PG_V | PG_RW); + bzero((char *)cur_space_pt, PAGE_SIZE); + PT_SET_MA(cur_space_pt, (vm_paddr_t)0); xen_pt_pin(xpmap_ptom(VTOP(cur_space))); xen_queue_pt_update((vm_paddr_t)(IdlePTDnewma[pdir] + curoffset*sizeof(vm_paddr_t)), @@ -994,17 +1029,6 @@ initvalues(start_info_t *startinfo) IdlePDPT = IdlePDPTnew; IdlePDPTma = IdlePDPTnewma; - /* allocate page for gdt */ - gdt = (union descriptor *)cur_space; - cur_space += PAGE_SIZE*ncpus; - - /* allocate page for ldt */ - ldt = (union descriptor *)cur_space; cur_space += PAGE_SIZE; - cur_space += PAGE_SIZE; - - HYPERVISOR_shared_info = (shared_info_t *)cur_space; - cur_space += PAGE_SIZE; - /* * shared_info is an unsigned long so this will randomly break if * it is allocated above 4GB - I guess people are used to that @@ -1015,13 +1039,8 @@ initvalues(start_info_t *startinfo) printk("#4\n"); - xen_store = (struct ringbuf_head *)cur_space; - cur_space += PAGE_SIZE; - xen_store_ma = (((vm_paddr_t)xen_start_info->store_mfn) << PAGE_SHIFT); PT_SET_MA(xen_store, xen_store_ma | PG_KERNEL); - console_page = (char *)cur_space; - cur_space += PAGE_SIZE; console_page_ma = (((vm_paddr_t)xen_start_info->console.domU.mfn) << PAGE_SHIFT); PT_SET_MA(console_page, console_page_ma | PG_KERNEL); From owner-svn-src-head@FreeBSD.ORG Sun Oct 19 01:33:58 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAE771065686; Sun, 19 Oct 2008 01:33:58 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9C538FC22; Sun, 19 Oct 2008 01:33:58 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9J1XwbA030683; Sun, 19 Oct 2008 01:33:58 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9J1Xwq2030682; Sun, 19 Oct 2008 01:33:58 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200810190133.m9J1Xwq2030682@svn.freebsd.org> From: Kip Macy Date: Sun, 19 Oct 2008 01:33: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: r184041 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 01:33:58 -0000 Author: kmacy Date: Sun Oct 19 01:33:58 2008 New Revision: 184041 URL: http://svn.freebsd.org/changeset/base/184041 Log: GC gratuitous XEN defines Modified: head/sys/i386/i386/trap.c Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Sun Oct 19 01:27:40 2008 (r184040) +++ head/sys/i386/i386/trap.c Sun Oct 19 01:33:58 2008 (r184041) @@ -159,11 +159,7 @@ static char *trap_msg[] = { "alignment fault", /* 14 T_ALIGNFLT */ "", /* 15 unused */ "", /* 16 unused */ -#ifdef XEN - "hypervisor callback", /* 17 T_HYPCALLBACK*/ -#else "", /* 17 unused */ -#endif "integer divide fault", /* 18 T_DIVIDE */ "non-maskable interrupt trap", /* 19 T_NMI */ "overflow trap", /* 20 T_OFLOW */ @@ -270,7 +266,6 @@ trap(struct trapframe *frame) goto out; #endif -#ifndef XEN if ((frame->tf_eflags & PSL_I) == 0) { /* * Buggy application or kernel code has disabled @@ -301,7 +296,6 @@ trap(struct trapframe *frame) enable_intr(); } } -#endif /* !XEN */ eva = 0; code = frame->tf_err; if (type == T_PAGEFLT) { From owner-svn-src-head@FreeBSD.ORG Sun Oct 19 01:35:27 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98C7E1065686; Sun, 19 Oct 2008 01:35:27 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87B8E8FC16; Sun, 19 Oct 2008 01:35:27 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9J1ZRAV030747; Sun, 19 Oct 2008 01:35:27 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9J1ZRl3030744; Sun, 19 Oct 2008 01:35:27 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200810190135.m9J1ZRl3030744@svn.freebsd.org> From: Kip Macy Date: Sun, 19 Oct 2008 01:35: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: r184042 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 01:35:27 -0000 Author: kmacy Date: Sun Oct 19 01:35:27 2008 New Revision: 184042 URL: http://svn.freebsd.org/changeset/base/184042 Log: - Forward port flush of page table updates on context switch or userret - Forward port vfork XEN hack Modified: head/sys/kern/kern_fork.c head/sys/kern/kern_synch.c head/sys/kern/subr_trap.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Sun Oct 19 01:33:58 2008 (r184041) +++ head/sys/kern/kern_fork.c Sun Oct 19 01:35:27 2008 (r184042) @@ -117,10 +117,15 @@ vfork(td, uap) struct thread *td; struct vfork_args *uap; { - int error; + int error, flags; struct proc *p2; - error = fork1(td, RFFDG | RFPROC | RFPPWAIT | RFMEM, 0, &p2); +#ifdef XEN + flags = RFFDG | RFPROC; /* validate that this is still an issue */ +#else + flags = RFFDG | RFPROC | RFPPWAIT | RFMEM; +#endif + error = fork1(td, flags, 0, &p2); if (error == 0) { td->td_retval[0] = p2->p_pid; td->td_retval[1] = 0; Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Sun Oct 19 01:33:58 2008 (r184041) +++ head/sys/kern/kern_synch.c Sun Oct 19 01:35:27 2008 (r184042) @@ -65,6 +65,12 @@ __FBSDID("$FreeBSD$"); #include +#ifdef XEN +#include +#include +#include +#endif + static void synch_setup(void *dummy); SYSINIT(synch_setup, SI_SUB_KICK_SCHEDULER, SI_ORDER_FIRST, synch_setup, NULL); @@ -432,6 +438,9 @@ mi_switch(int flags, struct thread *newt td, td->td_name, td->td_priority, td->td_inhibitors, td->td_wmesg, td->td_lockname); #endif +#ifdef XEN + PT_UPDATES_FLUSH(); +#endif sched_switch(td, newtd, flags); CTR3(KTR_SCHED, "mi_switch: running %p(%s) prio %d", td, td->td_name, td->td_priority); Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Sun Oct 19 01:33:58 2008 (r184041) +++ head/sys/kern/subr_trap.c Sun Oct 19 01:35:27 2008 (r184042) @@ -73,6 +73,12 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef XEN +#include +#include +#include +#endif + #include /* @@ -118,6 +124,9 @@ userret(struct thread *td, struct trapfr sched_userret(td); KASSERT(td->td_locks == 0, ("userret: Returning with %d locks held.", td->td_locks)); +#ifdef XEN + PT_UPDATES_FLUSH(); +#endif } /* From owner-svn-src-head@FreeBSD.ORG Sun Oct 19 06:58:31 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E24301065686; Sun, 19 Oct 2008 06:58:31 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D14458FC08; Sun, 19 Oct 2008 06:58:31 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9J6wVu5036545; Sun, 19 Oct 2008 06:58:31 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9J6wVvB036544; Sun, 19 Oct 2008 06:58:31 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200810190658.m9J6wVvB036544@svn.freebsd.org> From: Sam Leffler Date: Sun, 19 Oct 2008 06:58: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: r184048 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 06:58:32 -0000 Author: sam Date: Sun Oct 19 06:58:31 2008 New Revision: 184048 URL: http://svn.freebsd.org/changeset/base/184048 Log: add -n option to suppress clearing the build tree and add -DNO_CLEAN to buildworld and/or buildkernel Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Sun Oct 19 06:55:08 2008 (r184047) +++ head/tools/tools/nanobsd/nanobsd.sh Sun Oct 19 06:58:31 2008 (r184048) @@ -665,6 +665,7 @@ usage () { echo " -b suppress builds (both kernel and world)" echo " -i suppress disk image build" echo " -k suppress buildkernel" + echo " -n add -DNO_CLEAN to buildworld, buildkernel, etc" echo " -q make output more quite" echo " -v make output more verbose" echo " -w suppress buildworld" @@ -676,12 +677,13 @@ usage () { ####################################################################### # Parse arguments +do_clean=true do_kernel=true do_world=true do_image=true set +e -args=`getopt bc:hikqvw $*` +args=`getopt bc:hiknqvw $*` if [ $? -ne 0 ] ; then usage exit 2 @@ -714,6 +716,10 @@ do do_image=false shift ;; + -n) + do_clean=false + shift + ;; -q) PPLEVEL=$(($PPLEVEL - 1)) shift @@ -763,6 +769,12 @@ else exit 1 fi +if $do_clean ; then + true +else + NANO_PMAKE="${NANO_PMAKE} -DNO_CLEAN" +fi + export MAKEOBJDIRPREFIX export NANO_ARCH @@ -793,7 +805,11 @@ export NANO_BOOTLOADER pprint 1 "NanoBSD image ${NANO_NAME} build starting" if $do_world ; then - clean_build + if $do_clean ; then + clean_build + else + pprint 2 "Using existing build tree (as instructed)" + fi make_conf_build build_world else From owner-svn-src-head@FreeBSD.ORG Sun Oct 19 08:31:33 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40110106569F; Sun, 19 Oct 2008 08:31:33 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 9F7E78FC16; Sun, 19 Oct 2008 08:31:32 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from kobe.laptop (adsl19-226.kln.forthnet.gr [77.49.146.226]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-5) with ESMTP id m9J8DuAk025143 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 19 Oct 2008 11:14:02 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id m9J8Dule049881; Sun, 19 Oct 2008 11:13:56 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id m9J8DuhR049880; Sun, 19 Oct 2008 11:13:56 +0300 (EEST) (envelope-from keramida@freebsd.org) From: Giorgos Keramidas To: Ed Schouten References: <200810180623.m9I6N8Wn008930@svn.freebsd.org> Date: Sun, 19 Oct 2008 11:13:56 +0300 In-Reply-To: <200810180623.m9I6N8Wn008930@svn.freebsd.org> (Ed Schouten's message of "Sat, 18 Oct 2008 06:23:08 +0000 (UTC)") Message-ID: <87myh19f3v.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-ID: m9J8DuAk025143 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-4.303, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.10, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@freebsd.org X-Spam-Status: No Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184018 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 08:31:33 -0000 On Sat, 18 Oct 2008 06:23:08 +0000 (UTC), Ed Schouten wrote: > Author: ed > Date: Sat Oct 18 06:23:08 2008 > New Revision: 184018 > URL: http://svn.freebsd.org/changeset/base/184018 > > Log: > Increase the date in the manual page, which should have been done in > r183922. > > In r183922 I introduced a new DDB command, documented it, but forgot > to bump the date in the manual page. > > Pointed out by: bz Hi Ed, Everyone writing manpage patches eventually learns what ``bump .Dd'' means, so if you find yourself bumping manpage dates in the future, you can save a bit of typing by using a shorter commit log like: Bump .Dd for change 183922 Pointed out by: bz Thanks to you and Bjoern for the extra care about the quality of our manpages :) From owner-svn-src-head@FreeBSD.ORG Sun Oct 19 09:10:45 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B4D9106568A; Sun, 19 Oct 2008 09:10:45 +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 298158FC16; Sun, 19 Oct 2008 09:10:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9J9AjV5039000; Sun, 19 Oct 2008 09:10:45 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9J9Ajmj038999; Sun, 19 Oct 2008 09:10:45 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200810190910.m9J9Ajmj038999@svn.freebsd.org> From: Xin LI Date: Sun, 19 Oct 2008 09:10: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: r184055 - head/lib/libc/string X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 09:10:45 -0000 Author: delphij Date: Sun Oct 19 09:10:44 2008 New Revision: 184055 URL: http://svn.freebsd.org/changeset/base/184055 Log: Further simplify the code. Submitted by: Christoph Mallon Modified: head/lib/libc/string/strxfrm.c Modified: head/lib/libc/string/strxfrm.c ============================================================================== --- head/lib/libc/string/strxfrm.c Sun Oct 19 09:08:59 2008 (r184054) +++ head/lib/libc/string/strxfrm.c Sun Oct 19 09:10:44 2008 (r184055) @@ -45,17 +45,8 @@ strxfrm(char * __restrict dest, const ch return 0; } - if (__collate_load_error) { - slen = strlen(src); - if (len > 0) { - if (slen < len) - strcpy(dest, src); - else { - strlcpy(dest, src, len); - } - } - return slen; - } + if (__collate_load_error) + return strlcpy(dest, src, len); slen = 0; prim = sec = 0; From owner-svn-src-head@FreeBSD.ORG Sun Oct 19 09:45:30 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3575B10656A0; Sun, 19 Oct 2008 09:45:30 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 240538FC15; Sun, 19 Oct 2008 09:45:30 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9J9jTJT039657; Sun, 19 Oct 2008 09:45:29 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9J9jT9c039656; Sun, 19 Oct 2008 09:45:29 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200810190945.m9J9jT9c039656@svn.freebsd.org> From: Giorgos Keramidas Date: Sun, 19 Oct 2008 09:45: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: r184057 - head/sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 09:45:30 -0000 Author: keramida (doc committer) Date: Sun Oct 19 09:45:29 2008 New Revision: 184057 URL: http://svn.freebsd.org/changeset/base/184057 Log: Tiny wording nits. MFC after: 1 week Modified: head/sbin/ifconfig/ifconfig.8 Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Sun Oct 19 09:42:09 2008 (r184056) +++ head/sbin/ifconfig/ifconfig.8 Sun Oct 19 09:45:29 2008 (r184057) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd September 5, 2008 +.Dd October 19, 2008 .Dt IFCONFIG 8 .Os .Sh NAME @@ -106,7 +106,7 @@ slash notation) to include the netmask. That is, one can specify an address like .Li 192.168.0.1/16 . .Pp -For +For the .Dq inet6 family, it is also possible to specify the prefix length using the slash notation, like @@ -1249,11 +1249,12 @@ If the .Fl v flag is used all the information elements and their contents will be shown. -Specifying The +Specifying the .Fl v flag also enables display of long SSIDs. +The .Cm list ap -is another way of requesting this information. +command is another way of requesting this information. .It Cm list sta When operating as an access point display the stations that are currently associated. From owner-svn-src-head@FreeBSD.ORG Sun Oct 19 10:02:27 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 220B21065688; Sun, 19 Oct 2008 10:02:27 +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 0F79B8FC0A; Sun, 19 Oct 2008 10:02:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9JA2QPc040022; Sun, 19 Oct 2008 10:02:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9JA2Q5N040016; Sun, 19 Oct 2008 10:02:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200810191002.m9JA2Q5N040016@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 19 Oct 2008 10:02: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: r184058 - in head/sys: amd64/linux32 compat/linux i386/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 10:02:27 -0000 Author: kib Date: Sun Oct 19 10:02:26 2008 New Revision: 184058 URL: http://svn.freebsd.org/changeset/base/184058 Log: Correctly fill siginfo for the signals delivered by linux tkill/tgkill. It is required for async cancellation to work. Fix PROC_LOCK leak in linux_tgkill when signal delivery attempt is made to not linux process. Do not call em_find(p, ...) with p unlocked. Move common code for linux_tkill() and linux_tgkill() into linux_do_tkill(). Change linux siginfo_t definition to match actual linux one. Extend uid fields to 4 bytes from 2. The extension does not change structure layout and is binary compatible with previous definition, because i386 is little endian, and each uid field has 2 byte padding after it. Reported by: Nicolas Joly Submitted by: dchangin MFC after: 1 month Modified: head/sys/amd64/linux32/linux.h head/sys/amd64/linux32/linux32_sysvec.c head/sys/compat/linux/linux_signal.c head/sys/compat/linux/linux_signal.h head/sys/i386/linux/linux.h head/sys/i386/linux/linux_sysvec.c Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Sun Oct 19 09:45:29 2008 (r184057) +++ head/sys/amd64/linux32/linux.h Sun Oct 19 10:02:26 2008 (r184058) @@ -86,6 +86,8 @@ typedef l_long l_suseconds_t; typedef l_long l_time_t; typedef l_uint l_uid_t; typedef l_ushort l_uid16_t; +typedef l_int l_timer_t; +typedef l_int l_mqd_t; typedef struct { l_int val[2]; @@ -399,10 +401,10 @@ struct l_ucontext { #define LINUX_SI_MAX_SIZE 128 #define LINUX_SI_PAD_SIZE ((LINUX_SI_MAX_SIZE/sizeof(l_int)) - 3) -union l_sigval { +typedef union l_sigval { l_int sival_int; l_uintptr_t sival_ptr; -}; +} l_sigval_t; typedef struct l_siginfo { l_int lsi_signo; @@ -413,23 +415,26 @@ typedef struct l_siginfo { struct { l_pid_t _pid; - l_uid16_t _uid; + l_uid_t _uid; } __packed _kill; struct { - l_uint _timer1; - l_uint _timer2; + l_timer_t _tid; + l_int _overrun; + char _pad[sizeof(l_uid_t) - sizeof(l_int)]; + l_sigval_t _sigval; + l_int _sys_private; } __packed _timer; struct { l_pid_t _pid; /* sender's pid */ - l_uid16_t _uid; /* sender's uid */ - union l_sigval _sigval; + l_uid_t _uid; /* sender's uid */ + l_sigval_t _sigval; } __packed _rt; struct { l_pid_t _pid; /* which child */ - l_uid16_t _uid; /* sender's uid */ + l_uid_t _uid; /* sender's uid */ l_int _status; /* exit code */ l_clock_t _utime; l_clock_t _stime; @@ -440,7 +445,7 @@ typedef struct l_siginfo { } __packed _sigfault; struct { - l_int _band; /* POLL_IN,POLL_OUT,POLL_MSG */ + l_long _band; /* POLL_IN,POLL_OUT,POLL_MSG */ l_int _fd; } __packed _sigpoll; } _sifields; @@ -448,6 +453,9 @@ typedef struct l_siginfo { #define lsi_pid _sifields._kill._pid #define lsi_uid _sifields._kill._uid +#define lsi_tid _sifields._timer._tid +#define lsi_overrun _sifields._timer._overrun +#define lsi_sys_private _sifields._timer._sys_private #define lsi_status _sifields._sigchld._status #define lsi_utime _sifields._sigchld._utime #define lsi_stime _sifields._sigchld._stime @@ -860,9 +868,6 @@ struct l_user_desc { #define LINUX_CLOCK_REALTIME_HR 4 #define LINUX_CLOCK_MONOTONIC_HR 5 -typedef int l_timer_t; -typedef int l_mqd_t; - #define LINUX_CLONE_VM 0x00000100 #define LINUX_CLONE_FS 0x00000200 #define LINUX_CLONE_FILES 0x00000400 Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Sun Oct 19 09:45:29 2008 (r184057) +++ head/sys/amd64/linux32/linux32_sysvec.c Sun Oct 19 10:02:26 2008 (r184058) @@ -334,9 +334,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo frame.sf_ucontext = PTROUT(&fp->sf_sc); /* Fill in POSIX parts */ - frame.sf_si.lsi_signo = sig; - frame.sf_si.lsi_code = code; - frame.sf_si.lsi_addr = PTROUT(ksi->ksi_addr); + ksiginfo_to_lsiginfo(ksi, &frame.sf_si, sig); /* * Build the signal context to be used by sigreturn. Modified: head/sys/compat/linux/linux_signal.c ============================================================================== --- head/sys/compat/linux/linux_signal.c Sun Oct 19 09:45:29 2008 (r184057) +++ head/sys/compat/linux/linux_signal.c Sun Oct 19 10:02:26 2008 (r184058) @@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "opt_compat.h" #ifdef COMPAT_LINUX32 @@ -535,45 +537,75 @@ linux_kill(struct thread *td, struct lin return (kill(td, &tmp)); } -int -linux_tgkill(struct thread *td, struct linux_tgkill_args *args) +static int +linux_do_tkill(struct thread *td, l_int tgid, l_int pid, l_int signum) { - struct linux_emuldata *em; - struct linux_kill_args ka; + struct proc *proc = td->td_proc; + struct linux_emuldata *em; struct proc *p; + ksiginfo_t ksi; + int error; -#ifdef DEBUG - if (ldebug(tgkill)) - printf(ARGS(tgkill, "%d, %d, %d"), args->tgid, args->pid, args->sig); -#endif - - ka.pid = args->pid; - ka.signum = args->sig; + AUDIT_ARG(signum, signum); + AUDIT_ARG(pid, pid); - if (args->tgid == -1) - return linux_kill(td, &ka); + /* + * Allow signal 0 as a means to check for privileges + */ + if (!LINUX_SIG_VALID(signum) && signum != 0) + return (EINVAL); - if ((p = pfind(args->pid)) == NULL) - return ESRCH; + if (signum > 0 && signum <= LINUX_SIGTBLSZ) + signum = linux_to_bsd_signal[_SIG_IDX(signum)]; - if (p->p_sysent != &elf_linux_sysvec) - return ESRCH; + if ((p = pfind(pid)) == NULL) { + if ((p = zpfind(pid)) == NULL) + return (ESRCH); + } - PROC_UNLOCK(p); + AUDIT_ARG(process, p); + error = p_cansignal(td, p, signum); + if (error) + goto out; + error = ESRCH; em = em_find(p, EMUL_DONTLOCK); if (em == NULL) { #ifdef DEBUG - printf("emuldata not found in tgkill.\n"); + printf("emuldata not found in do_tkill.\n"); #endif - return ESRCH; + goto out; } + if (tgid > 0 && em->shared->group_pid != tgid) + goto out; + + ksiginfo_init(&ksi); + ksi.ksi_signo = signum; + ksi.ksi_code = LINUX_SI_TKILL; + ksi.ksi_errno = 0; + ksi.ksi_pid = proc->p_pid; + ksi.ksi_uid = proc->p_ucred->cr_ruid; - if (em->shared->group_pid != args->tgid) - return ESRCH; + error = tdsignal(p, NULL, ksi.ksi_signo, &ksi); - return linux_kill(td, &ka); +out: + PROC_UNLOCK(p); + return (error); +} + +int +linux_tgkill(struct thread *td, struct linux_tgkill_args *args) +{ + +#ifdef DEBUG + if (ldebug(tgkill)) + printf(ARGS(tgkill, "%d, %d, %d"), args->tgid, args->pid, args->sig); +#endif + if (args->pid <= 0 || args->tgid <=0) + return (EINVAL); + + return (linux_do_tkill(td, args->tgid, args->pid, args->sig)); } int @@ -583,6 +615,39 @@ linux_tkill(struct thread *td, struct li if (ldebug(tkill)) printf(ARGS(tkill, "%i, %i"), args->tid, args->sig); #endif + if (args->tid <= 0) + return (EINVAL); + + return (linux_do_tkill(td, 0, args->tid, args->sig)); +} + +void +ksiginfo_to_lsiginfo(ksiginfo_t *ksi, l_siginfo_t *lsi, l_int sig) +{ + + lsi->lsi_signo = sig; + lsi->lsi_code = ksi->ksi_code; - return (linux_kill(td, (struct linux_kill_args *) args)); + switch (sig) { + case LINUX_SIGPOLL: + /* XXX si_fd? */ + lsi->lsi_band = ksi->ksi_band; + break; + case LINUX_SIGCHLD: + lsi->lsi_pid = ksi->ksi_pid; + lsi->lsi_uid = ksi->ksi_uid; + lsi->lsi_status = ksi->ksi_status; + break; + case LINUX_SIGBUS: + case LINUX_SIGILL: + case LINUX_SIGFPE: + case LINUX_SIGSEGV: + lsi->lsi_addr = PTROUT(ksi->ksi_addr); + break; + default: + /* XXX SI_TIMER etc... */ + lsi->lsi_pid = ksi->ksi_pid; + lsi->lsi_uid = ksi->ksi_uid; + break; + } } Modified: head/sys/compat/linux/linux_signal.h ============================================================================== --- head/sys/compat/linux/linux_signal.h Sun Oct 19 09:45:29 2008 (r184057) +++ head/sys/compat/linux/linux_signal.h Sun Oct 19 10:02:26 2008 (r184058) @@ -31,9 +31,12 @@ #ifndef _LINUX_SIGNAL_H_ #define _LINUX_SIGNAL_H_ +#define LINUX_SI_TKILL -6; + void linux_to_bsd_sigset(l_sigset_t *, sigset_t *); void bsd_to_linux_sigset(sigset_t *, l_sigset_t *); int linux_do_sigaction(struct thread *, int, l_sigaction_t *, l_sigaction_t *); +void ksiginfo_to_lsiginfo(ksiginfo_t *ksi, l_siginfo_t *lsi, l_int sig); #define LINUX_SIG_VALID(sig) ((sig) <= LINUX_NSIG && (sig) > 0) Modified: head/sys/i386/linux/linux.h ============================================================================== --- head/sys/i386/linux/linux.h Sun Oct 19 09:45:29 2008 (r184057) +++ head/sys/i386/linux/linux.h Sun Oct 19 10:02:26 2008 (r184058) @@ -80,6 +80,8 @@ typedef l_long l_suseconds_t; typedef l_long l_time_t; typedef l_uint l_uid_t; typedef l_ushort l_uid16_t; +typedef l_int l_timer_t; +typedef l_int l_mqd_t; typedef struct { l_int val[2]; @@ -374,6 +376,11 @@ struct l_ucontext { #define LINUX_SI_MAX_SIZE 128 #define LINUX_SI_PAD_SIZE ((LINUX_SI_MAX_SIZE/sizeof(l_int)) - 3) +typedef union l_sigval { + l_int sival_int; + l_uintptr_t sival_ptr; +} l_sigval_t; + typedef struct l_siginfo { l_int lsi_signo; l_int lsi_errno; @@ -383,34 +390,37 @@ typedef struct l_siginfo { struct { l_pid_t _pid; - l_uid16_t _uid; + l_uid_t _uid; } _kill; struct { - l_uint _timer1; - l_uint _timer2; + l_timer_t _tid; + l_int _overrun; + char _pad[sizeof(l_uid_t) - sizeof(l_int)]; + l_sigval_t _sigval; + l_int _sys_private; } _timer; struct { l_pid_t _pid; /* sender's pid */ - l_uid16_t _uid; /* sender's uid */ - union sigval _sigval; + l_uid_t _uid; /* sender's uid */ + l_sigval_t _sigval; } _rt; struct { l_pid_t _pid; /* which child */ - l_uid16_t _uid; /* sender's uid */ + l_uid_t _uid; /* sender's uid */ l_int _status; /* exit code */ l_clock_t _utime; l_clock_t _stime; } _sigchld; struct { - void *_addr; /* Faulting insn/memory ref. */ + l_uintptr_t _addr; /* Faulting insn/memory ref. */ } _sigfault; struct { - l_int _band; /* POLL_IN,POLL_OUT,POLL_MSG */ + l_long _band; /* POLL_IN,POLL_OUT,POLL_MSG */ l_int _fd; } _sigpoll; } _sifields; @@ -418,6 +428,9 @@ typedef struct l_siginfo { #define lsi_pid _sifields._kill._pid #define lsi_uid _sifields._kill._uid +#define lsi_tid _sifields._timer._tid +#define lsi_overrun _sifields._timer._overrun +#define lsi_sys_private _sifields._timer._sys_private #define lsi_status _sifields._sigchld._status #define lsi_utime _sifields._sigchld._utime #define lsi_stime _sifields._sigchld._stime @@ -825,9 +838,6 @@ struct l_desc_struct { #define LINUX_CLOCK_REALTIME_HR 4 #define LINUX_CLOCK_MONOTONIC_HR 5 -typedef int l_timer_t; -typedef int l_mqd_t; - #define LINUX_CLONE_VM 0x00000100 #define LINUX_CLONE_FS 0x00000200 #define LINUX_CLONE_FILES 0x00000400 Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Sun Oct 19 09:45:29 2008 (r184057) +++ head/sys/i386/linux/linux_sysvec.c Sun Oct 19 10:02:26 2008 (r184058) @@ -323,9 +323,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo frame.sf_ucontext = &fp->sf_sc; /* Fill in POSIX parts */ - frame.sf_si.lsi_signo = sig; - frame.sf_si.lsi_code = code; - frame.sf_si.lsi_addr = ksi->ksi_addr; + ksiginfo_to_lsiginfo(ksi, &frame.sf_si, sig); /* * Build the signal context to be used by sigreturn. From owner-svn-src-head@FreeBSD.ORG Sun Oct 19 10:11:35 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DCE81065688; Sun, 19 Oct 2008 10:11:35 +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 8C5558FC15; Sun, 19 Oct 2008 10:11:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9JABZii040211; Sun, 19 Oct 2008 10:11:35 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9JABZgJ040210; Sun, 19 Oct 2008 10:11:35 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200810191011.m9JABZgJ040210@svn.freebsd.org> From: Xin LI Date: Sun, 19 Oct 2008 10:11:35 +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: r184059 - head/lib/libc/string X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 10:11:35 -0000 Author: delphij Date: Sun Oct 19 10:11:35 2008 New Revision: 184059 URL: http://svn.freebsd.org/changeset/base/184059 Log: - License change to a less restrictive one; - ANSIfy; - Convert do {} while loop -> while {} for clarity; - Sync RCS ID with OpenBSD; Obtained from: OpenBSD Modified: head/lib/libc/string/strlcpy.c Modified: head/lib/libc/string/strlcpy.c ============================================================================== --- head/lib/libc/string/strlcpy.c Sun Oct 19 10:02:26 2008 (r184058) +++ head/lib/libc/string/strlcpy.c Sun Oct 19 10:11:35 2008 (r184059) @@ -1,35 +1,21 @@ -/* $OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $ */ +/* $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 millert Exp $ */ /* * Copyright (c) 1998 Todd C. Miller - * 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. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * THIS SOFTWARE IS PROVIDED ``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. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $"; -#endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); @@ -42,21 +28,18 @@ __FBSDID("$FreeBSD$"); * Returns strlen(src); if retval >= siz, truncation occurred. */ size_t -strlcpy(dst, src, siz) - char *dst; - const char *src; - size_t siz; +strlcpy(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; size_t n = siz; /* Copy as many bytes as will fit */ - if (n != 0 && --n != 0) { - do { - if ((*d++ = *s++) == 0) + if (n != 0) { + while (--n != 0) { + if ((*d++ = *s++) == '\0') break; - } while (--n != 0); + } } /* Not enough room in dst, add NUL and traverse rest of src */ From owner-svn-src-head@FreeBSD.ORG Sun Oct 19 11:13:49 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94C6F106568A; Sun, 19 Oct 2008 11:13: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 657A58FC1A; Sun, 19 Oct 2008 11:13:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9JBDnTj042467; Sun, 19 Oct 2008 11:13:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9JBDnDM042466; Sun, 19 Oct 2008 11:13:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200810191113.m9JBDnDM042466@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 19 Oct 2008 11:13: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: r184060 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 11:13:49 -0000 Author: kib Date: Sun Oct 19 11:13:49 2008 New Revision: 184060 URL: http://svn.freebsd.org/changeset/base/184060 Log: Ktr(9) stores format string and arguments in the event circular buffer, not the string formatted at the time of CTRX() call. Stack_ktr(9) uses an on-stack buffer for the symbol name, that is supplied as an argument to ktr. As result, stack_ktr() traces show garbage or cause page faults. Fix stack_ktr() by using pointer to module symbol table that is supposed to have a longer lifetime. Tested by: pho MFC after: 1 week Modified: head/sys/kern/subr_stack.c Modified: head/sys/kern/subr_stack.c ============================================================================== --- head/sys/kern/subr_stack.c Sun Oct 19 10:11:35 2008 (r184059) +++ head/sys/kern/subr_stack.c Sun Oct 19 11:13:49 2008 (r184060) @@ -45,8 +45,7 @@ static MALLOC_DEFINE(M_STACK, "stack", " static void stack_symbol(vm_offset_t pc, char *namebuf, u_int buflen, long *offset); #ifdef DDB -static void stack_symbol_ddb(vm_offset_t pc, char *namebuf, u_int buflen, - long *offset); +static void stack_symbol_ddb(vm_offset_t pc, const char **name, long *offset); #endif struct stack * @@ -109,16 +108,15 @@ stack_print(struct stack *st) void stack_print_ddb(struct stack *st) { - char namebuf[64]; + const char *name; long offset; int i; KASSERT(st->depth <= STACK_MAX, ("bogus stack")); for (i = 0; i < st->depth; i++) { - stack_symbol_ddb(st->pcs[i], namebuf, sizeof(namebuf), - &offset); + stack_symbol_ddb(st->pcs[i], &name, &offset); printf("#%d %p at %s+%#lx\n", i, (void *)st->pcs[i], - namebuf, offset); + name, offset); } } #endif @@ -146,16 +144,15 @@ stack_sbuf_print(struct sbuf *sb, struct void stack_sbuf_print_ddb(struct sbuf *sb, struct stack *st) { - char namebuf[64]; + const char *name; long offset; int i; KASSERT(st->depth <= STACK_MAX, ("bogus stack")); for (i = 0; i < st->depth; i++) { - stack_symbol_ddb(st->pcs[i], namebuf, sizeof(namebuf), - &offset); + stack_symbol_ddb(st->pcs[i], &name, &offset); sbuf_printf(sb, "#%d %p at %s+%#lx\n", i, (void *)st->pcs[i], - namebuf, offset); + name, offset); } } @@ -164,7 +161,7 @@ void stack_ktr(u_int mask, const char *file, int line, struct stack *st, u_int depth, int cheap) { - char namebuf[64]; + const char *name; long offset; int i; @@ -187,10 +184,9 @@ stack_ktr(u_int mask, const char *file, if (depth == 0 || st->depth < depth) depth = st->depth; for (i = 0; i < depth; i++) { - stack_symbol_ddb(st->pcs[i], namebuf, - sizeof(namebuf), &offset); + stack_symbol_ddb(st->pcs[i], &name, &offset); ktr_tracepoint(mask, file, line, "#%d %p at %s+%#lx", - i, st->pcs[i], (u_long)namebuf, offset, 0, 0); + i, st->pcs[i], (u_long)name, offset, 0, 0); } } } @@ -214,13 +210,21 @@ stack_symbol(vm_offset_t pc, char *nameb #ifdef DDB static void -stack_symbol_ddb(vm_offset_t pc, char *namebuf, u_int buflen, long *offset) +stack_symbol_ddb(vm_offset_t pc, const char **name, long *offset) { + linker_symval_t symval; + c_linker_sym_t sym; - if (linker_ddb_search_symbol_name((caddr_t)pc, namebuf, buflen, - offset) != 0) { - *offset = 0; - strlcpy(namebuf, "??", buflen); - }; + if (linker_ddb_search_symbol((caddr_t)pc, &sym, offset) != 0) + goto out; + if (linker_ddb_symbol_values(sym, &symval) != 0) + goto out; + if (symval.name != NULL) { + *name = symval.name; + return; + } + out: + *offset = 0; + *name = "??"; } #endif From owner-svn-src-head@FreeBSD.ORG Sun Oct 19 12:56:54 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 701BE1065691 for ; Sun, 19 Oct 2008 12:56:54 +0000 (UTC) (envelope-from rdivacky@lev.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 2BE598FC17 for ; Sun, 19 Oct 2008 12:56:54 +0000 (UTC) (envelope-from rdivacky@lev.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 8CB0F9CB1CA; Sun, 19 Oct 2008 14:40:57 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AexsAyWiQIiG; Sun, 19 Oct 2008 14:40:54 +0200 (CEST) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 8758E9CB528; Sun, 19 Oct 2008 14:40:54 +0200 (CEST) Received: (from rdivacky@localhost) by lev.vlakno.cz (8.14.2/8.14.2/Submit) id m9JCesq0026889; Sun, 19 Oct 2008 14:40:54 +0200 (CEST) (envelope-from rdivacky) Date: Sun, 19 Oct 2008 14:40:54 +0200 From: Roman Divacky To: Konstantin Belousov Message-ID: <20081019124054.GA25779@freebsd.org> References: <200810191002.m9JA2Q5N040016@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200810191002.m9JA2Q5N040016@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: r184058 - in head/sys: amd64/linux32 compat/linux i386/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 12:56:54 -0000 On Sun, Oct 19, 2008 at 10:02:26AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Sun Oct 19 10:02:26 2008 > New Revision: 184058 > URL: http://svn.freebsd.org/changeset/base/184058 > > Log: > Correctly fill siginfo for the signals delivered by linux tkill/tgkill. > It is required for async cancellation to work. > > Fix PROC_LOCK leak in linux_tgkill when signal delivery attempt is made > to not linux process. > > Do not call em_find(p, ...) with p unlocked. > > Move common code for linux_tkill() and linux_tgkill() into > linux_do_tkill(). > > Change linux siginfo_t definition to match actual linux one. Extend > uid fields to 4 bytes from 2. The extension does not change structure > layout and is binary compatible with previous definition, because i386 > is little endian, and each uid field has 2 byte padding after it. does it fix the test case Nicolas provided? It didnt for me when I tried this patch... > Reported by: Nicolas Joly might be of some interest for someone... njoly of netbsd :) From owner-svn-src-head@FreeBSD.ORG Sun Oct 19 13:13:20 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6645D106568A for ; Sun, 19 Oct 2008 13:13:20 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 097D48FC16 for ; Sun, 19 Oct 2008 13:13:19 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1KrXgh-000MpU-An; Sun, 19 Oct 2008 15:47:15 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m9JClCfO075660 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 19 Oct 2008 15:47:12 +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.3/8.14.3) with ESMTP id m9JClC30018964; Sun, 19 Oct 2008 15:47:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id m9JClCLA018962; Sun, 19 Oct 2008 15:47: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: Sun, 19 Oct 2008 15:47:12 +0300 From: Kostik Belousov To: Roman Divacky Message-ID: <20081019124711.GR7782@deviant.kiev.zoral.com.ua> References: <200810191002.m9JA2Q5N040016@svn.freebsd.org> <20081019124054.GA25779@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tHTlq+1i+J693gRP" Content-Disposition: inline In-Reply-To: <20081019124054.GA25779@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 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 X-Virus-Scanned: mail.terabit.net.ua 1KrXgh-000MpU-An c75109500eb0bfdafc272536aeee085c X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184058 - in head/sys: amd64/linux32 compat/linux i386/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 13:13:20 -0000 --tHTlq+1i+J693gRP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Oct 19, 2008 at 02:40:54PM +0200, Roman Divacky wrote: > On Sun, Oct 19, 2008 at 10:02:26AM +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Sun Oct 19 10:02:26 2008 > > New Revision: 184058 > > URL: http://svn.freebsd.org/changeset/base/184058 > >=20 > > Log: > > Correctly fill siginfo for the signals delivered by linux tkill/tgkil= l. > > It is required for async cancellation to work. > > =20 > > Fix PROC_LOCK leak in linux_tgkill when signal delivery attempt is ma= de > > to not linux process. > > =20 > > Do not call em_find(p, ...) with p unlocked. > > =20 > > Move common code for linux_tkill() and linux_tgkill() into > > linux_do_tkill(). > > =20 > > Change linux siginfo_t definition to match actual linux one. Extend > > uid fields to 4 bytes from 2. The extension does not change structure > > layout and is binary compatible with previous definition, because i386 > > is little endian, and each uid field has 2 byte padding after it. > =20 > does it fix the test case Nicolas provided? It didnt for me when I tried > this patch... As far as I got it from conversation with Dmitry, cancellation still does not work. This patch is a required cleanup anyway. >=20 > > Reported by: Nicolas Joly >=20 > might be of some interest for someone... njoly of netbsd :) Point taken. --tHTlq+1i+J693gRP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkj7LE8ACgkQC3+MBN1Mb4g6+gCfUZxLcpHfhZmWzsUvrJksEccF 8koAoIZm6EXhtnLY5LnvHx7kG6b9l1Eb =6MrZ -----END PGP SIGNATURE----- --tHTlq+1i+J693gRP-- From owner-svn-src-head@FreeBSD.ORG Sun Oct 19 17:19:42 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA7A4106566C; Sun, 19 Oct 2008 17:19:42 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FC9C8FC12; Sun, 19 Oct 2008 17:19:42 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9JHJgOB048675; Sun, 19 Oct 2008 17:19:42 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9JHJglD048674; Sun, 19 Oct 2008 17:19:42 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <200810191719.m9JHJglD048674@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sun, 19 Oct 2008 17:19: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: r184061 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 17:19:42 -0000 Author: simon Date: Sun Oct 19 17:19:42 2008 New Revision: 184061 URL: http://svn.freebsd.org/changeset/base/184061 Log: Remove trailing comma in SEE ALSO section. Modified: head/share/man/man4/u3g.4 Modified: head/share/man/man4/u3g.4 ============================================================================== --- head/share/man/man4/u3g.4 Sun Oct 19 11:13:49 2008 (r184060) +++ head/share/man/man4/u3g.4 Sun Oct 19 17:19:42 2008 (r184061) @@ -91,7 +91,7 @@ hidden, unless the machine was booted in .Sh SEE ALSO .Xr tty 4 , .Xr ucom 4 , -.Xr usb 4 , +.Xr usb 4 .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Sun Oct 19 20:14:49 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F22A1065676; Sun, 19 Oct 2008 20:14:49 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D6A88FC18; Sun, 19 Oct 2008 20:14:49 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9JKEnDJ051659; Sun, 19 Oct 2008 20:14:49 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9JKEnCo051658; Sun, 19 Oct 2008 20:14:49 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200810192014.m9JKEnCo051658@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 19 Oct 2008 20:14: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: r184062 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 20:14:49 -0000 Author: marcel Date: Sun Oct 19 20:14:48 2008 New Revision: 184062 URL: http://svn.freebsd.org/changeset/base/184062 Log: Atomically increment the number of awoken APs as all APs will be unleashed here. Pointed out by: christian.kandeler@hob.de Modified: head/sys/ia64/ia64/mp_machdep.c Modified: head/sys/ia64/ia64/mp_machdep.c ============================================================================== --- head/sys/ia64/ia64/mp_machdep.c Sun Oct 19 17:19:42 2008 (r184061) +++ head/sys/ia64/ia64/mp_machdep.c Sun Oct 19 20:14:48 2008 (r184062) @@ -125,7 +125,7 @@ ia64_ap_startup(void) ia64_mca_save_state(SAL_INFO_MCA); ia64_mca_save_state(SAL_INFO_CMC); - ap_awake++; + atomic_add_int(&ap_awake, 1); while (!smp_started) cpu_spinwait(); From owner-svn-src-head@FreeBSD.ORG Sun Oct 19 21:34:49 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E705106567D; Sun, 19 Oct 2008 21:34:49 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D45E8FC24; Sun, 19 Oct 2008 21:34:49 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9JLYnqO052990; Sun, 19 Oct 2008 21:34:49 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9JLYnxd052988; Sun, 19 Oct 2008 21:34:49 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200810192134.m9JLYnxd052988@svn.freebsd.org> From: Sam Leffler Date: Sun, 19 Oct 2008 21:34: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: r184063 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2008 21:34:49 -0000 Author: sam Date: Sun Oct 19 21:34:49 2008 New Revision: 184063 URL: http://svn.freebsd.org/changeset/base/184063 Log: fix static key wep; r183248 caused drivers to be called for keys to be assigned to slots in the global key table but ath_key_alloc was not updated to handle that Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Oct 19 20:14:48 2008 (r184062) +++ head/sys/dev/ath/if_ath.c Sun Oct 19 21:34:49 2008 (r184063) @@ -2403,7 +2403,8 @@ ath_key_alloc(struct ieee80211vap *vap, * it permits us to support multiple users for adhoc and/or * multi-station operation. */ - if ((k->wk_flags & IEEE80211_KEY_GROUP) && !sc->sc_mcastkey) { + if (k->wk_keyix != IEEE80211_KEYIX_NONE || /* global key */ + ((k->wk_flags & IEEE80211_KEY_GROUP) && !sc->sc_mcastkey)) { if (!(&vap->iv_nw_keys[0] <= k && k < &vap->iv_nw_keys[IEEE80211_WEP_NKID])) { /* should not happen */ From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 02:37:54 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BAE6106566C; Mon, 20 Oct 2008 02:37: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 1A1E68FC1E; Mon, 20 Oct 2008 02:37:54 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9K2brsN058087; Mon, 20 Oct 2008 02:37:53 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9K2brwF058086; Mon, 20 Oct 2008 02:37:53 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <200810200237.m9K2brwF058086@svn.freebsd.org> From: David Xu Date: Mon, 20 Oct 2008 02:37: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: r184067 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 02:37:54 -0000 Author: davidxu Date: Mon Oct 20 02:37:53 2008 New Revision: 184067 URL: http://svn.freebsd.org/changeset/base/184067 Log: In realtimer_delete(), clear timer's value and interval to tell realtimer_expire() to not rearm the timer, otherwise there is a chance that a callout will be left there and be tiggered in future unexpectly. Bug reported by: tegge@ Modified: head/sys/kern/kern_time.c Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Mon Oct 20 01:46:54 2008 (r184066) +++ head/sys/kern/kern_time.c Mon Oct 20 02:37:53 2008 (r184067) @@ -1242,6 +1242,12 @@ realtimer_delete(struct itimer *it) { mtx_assert(&it->it_mtx, MA_OWNED); + /* + * clear timer's value and interval to tell realtimer_expire + * to not rearm the timer. + */ + timespecclear(&it->it_time.it_value); + timespecclear(&it->it_time.it_interval); ITIMER_UNLOCK(it); callout_drain(&it->it_callout); ITIMER_LOCK(it); @@ -1391,9 +1397,11 @@ realtimer_expire(void *arg) callout_reset(&it->it_callout, tvtohz(&tv), realtimer_expire, it); } + itimer_enter(it); ITIMER_UNLOCK(it); itimer_fire(it); ITIMER_LOCK(it); + itimer_leave(it); } else if (timespecisset(&it->it_time.it_value)) { ts = it->it_time.it_value; timespecsub(&ts, &cts); From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 04:50:48 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25A8C106569D; Mon, 20 Oct 2008 04:50:48 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13B0B8FC12; Mon, 20 Oct 2008 04:50:48 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9K4olGp060621; Mon, 20 Oct 2008 04:50:47 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9K4olDY060620; Mon, 20 Oct 2008 04:50:47 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200810200450.m9K4olDY060620@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 20 Oct 2008 04:50:47 +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: r184069 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 04:50:48 -0000 Author: marcel Date: Mon Oct 20 04:50:47 2008 New Revision: 184069 URL: http://svn.freebsd.org/changeset/base/184069 Log: The active and bootable flags are not part of the type. Export the active and bootable flags as attributes in the configuration XML and allow them to be manipulated with the set/unset commands. Since libdisk treats the flags as part of the partition type, preserve behavior by keeping them included in the configuration text. Modified: head/sys/geom/part/g_part_pc98.c Modified: head/sys/geom/part/g_part_pc98.c ============================================================================== --- head/sys/geom/part/g_part_pc98.c Mon Oct 20 04:50:06 2008 (r184068) +++ head/sys/geom/part/g_part_pc98.c Mon Oct 20 04:50:47 2008 (r184069) @@ -45,6 +45,14 @@ __FBSDID("$FreeBSD$"); #include "g_part_if.h" +#define PC98_MID_BOOTABLE 0x80 +#define PC98_MID_MASK 0x7f +#define PC98_MID_386BSD 0x14 + +#define PC98_SID_ACTIVE 0x80 +#define PC98_SID_MASK 0x7f +#define PC98_SID_386BSD 0x44 + #define SECSIZE 512 struct g_part_pc98_table { @@ -72,8 +80,10 @@ static char *g_part_pc98_name(struct g_p char *, size_t); static int g_part_pc98_probe(struct g_part_table *, struct g_consumer *); static int g_part_pc98_read(struct g_part_table *, struct g_consumer *); -static const char *g_part_pc98_type(struct g_part_table *, struct g_part_entry *, - char *, size_t); +static int g_part_pc98_setunset(struct g_part_table *, struct g_part_entry *, + const char *, unsigned int); +static const char *g_part_pc98_type(struct g_part_table *, + struct g_part_entry *, char *, size_t); static int g_part_pc98_write(struct g_part_table *, struct g_consumer *); static kobj_method_t g_part_pc98_methods[] = { @@ -87,6 +97,7 @@ static kobj_method_t g_part_pc98_methods KOBJMETHOD(g_part_name, g_part_pc98_name), KOBJMETHOD(g_part_probe, g_part_pc98_probe), KOBJMETHOD(g_part_read, g_part_pc98_read), + KOBJMETHOD(g_part_setunset, g_part_pc98_setunset), KOBJMETHOD(g_part_type, g_part_pc98_type), KOBJMETHOD(g_part_write, g_part_pc98_write), { 0, 0 } @@ -115,14 +126,17 @@ pc98_parse_type(const char *type, u_char if (type[1] == '\0' || *endp != '\0' || lt <= 0 || lt >= 65536) return (EINVAL); - *dp_mid = (u_char)lt; - *dp_sid = (u_char)(lt >> 8); + /* Make sure the active and bootable flags aren't set. */ + if (lt & ((PC98_SID_ACTIVE << 8) | PC98_MID_BOOTABLE)) + return (ENOATTR); + *dp_mid = (*dp_mid & PC98_MID_BOOTABLE) | (u_char)lt; + *dp_sid = (*dp_sid & PC98_SID_ACTIVE) | (u_char)(lt >> 8); return (0); } alias = g_part_alias_name(G_PART_ALIAS_FREEBSD); if (!strcasecmp(type, alias)) { - *dp_mid = (u_char)DOSMID_386BSD; - *dp_sid = (u_char)DOSSID_386BSD; + *dp_mid = (*dp_mid & PC98_MID_BOOTABLE) | PC98_MID_386BSD; + *dp_sid = (*dp_sid & PC98_SID_ACTIVE) | PC98_SID_386BSD; return (0); } return (EINVAL); @@ -176,6 +190,8 @@ g_part_pc98_add(struct g_part_table *bas if (baseentry->gpe_deleted) bzero(&entry->ent, sizeof(entry->ent)); + else + entry->ent.dp_mid = entry->ent.dp_sid = 0; KASSERT(baseentry->gpe_start <= start, (__func__)); KASSERT(baseentry->gpe_end >= start + size - 1, (__func__)); @@ -259,7 +275,13 @@ g_part_pc98_dumpconf(struct g_part_table } else { /* confxml: partition entry information */ sbuf_printf(sb, "%s\n", indent, name); - sbuf_printf(sb, "%s%u\n", indent, type); + if (entry->ent.dp_mid & PC98_MID_BOOTABLE) + sbuf_printf(sb, "%sbootable\n", + indent); + if (entry->ent.dp_sid & PC98_SID_ACTIVE) + sbuf_printf(sb, "%sactive\n", indent); + sbuf_printf(sb, "%s%u\n", indent, + type & 0x7f7f); } return (0); } @@ -271,8 +293,8 @@ g_part_pc98_dumpto(struct g_part_table * /* Allow dumping to a FreeBSD partition only. */ entry = (struct g_part_pc98_entry *)baseentry; - return ((entry->ent.dp_mid == DOSMID_386BSD && - entry->ent.dp_sid == DOSSID_386BSD) ? 1 : 0); + return (((entry->ent.dp_mid & PC98_MID_MASK) == PC98_MID_386BSD && + (entry->ent.dp_sid & PC98_SID_MASK) == PC98_SID_386BSD) ? 1 : 0); } static int @@ -412,6 +434,54 @@ g_part_pc98_read(struct g_part_table *ba return (0); } +static int +g_part_pc98_setunset(struct g_part_table *table, struct g_part_entry *baseentry, + const char *attrib, unsigned int set) +{ + struct g_part_entry *iter; + struct g_part_pc98_entry *entry; + int changed, mid, sid; + + mid = sid = 0; + if (strcasecmp(attrib, "active") == 0) + sid = 1; + else if (strcasecmp(attrib, "bootable") == 0) + mid = 1; + if (mid == 0 && sid == 0) + return (EINVAL); + + LIST_FOREACH(iter, &table->gpt_entry, gpe_entry) { + if (iter->gpe_deleted) + continue; + if (iter != baseentry) + continue; + changed = 0; + entry = (struct g_part_pc98_entry *)iter; + if (set) { + if (mid && !(entry->ent.dp_mid & PC98_MID_BOOTABLE)) { + entry->ent.dp_mid |= PC98_MID_BOOTABLE; + changed = 1; + } + if (sid && !(entry->ent.dp_sid & PC98_SID_ACTIVE)) { + entry->ent.dp_sid |= PC98_SID_ACTIVE; + changed = 1; + } + } else { + if (mid && (entry->ent.dp_mid & PC98_MID_BOOTABLE)) { + entry->ent.dp_mid &= ~PC98_MID_BOOTABLE; + changed = 1; + } + if (sid && (entry->ent.dp_sid & PC98_SID_ACTIVE)) { + entry->ent.dp_sid &= ~PC98_SID_ACTIVE; + changed = 1; + } + } + if (changed && !iter->gpe_created) + iter->gpe_modified = 1; + } + return (0); +} + static const char * g_part_pc98_type(struct g_part_table *basetable, struct g_part_entry *baseentry, char *buf, size_t bufsz) @@ -420,8 +490,9 @@ g_part_pc98_type(struct g_part_table *ba u_int type; entry = (struct g_part_pc98_entry *)baseentry; - type = entry->ent.dp_mid + (entry->ent.dp_sid << 8); - if (type == DOSPTYP_386BSD) + type = (entry->ent.dp_mid & PC98_MID_MASK) | + ((entry->ent.dp_sid & PC98_SID_MASK) << 8); + if (type == (PC98_MID_386BSD | (PC98_SID_386BSD << 8))) return (g_part_alias_name(G_PART_ALIAS_FREEBSD)); snprintf(buf, bufsz, "!%d", type); return (buf); From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 05:12:50 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6355106566C; Mon, 20 Oct 2008 05:12:50 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4CB88FC16; Mon, 20 Oct 2008 05:12:50 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9K5Co2p061025; Mon, 20 Oct 2008 05:12:50 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9K5CoPv061024; Mon, 20 Oct 2008 05:12:50 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200810200512.m9K5CoPv061024@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 20 Oct 2008 05:12: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: r184070 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 05:12:51 -0000 Author: marcel Date: Mon Oct 20 05:12:50 2008 New Revision: 184070 URL: http://svn.freebsd.org/changeset/base/184070 Log: Add support for multiple attributes. This is required for the PC98 scheme. Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Mon Oct 20 04:50:47 2008 (r184069) +++ head/sbin/geom/class/part/geom_part.c Mon Oct 20 05:12:50 2008 (r184070) @@ -223,13 +223,20 @@ fmtsize(long double rawsz) static const char * fmtattrib(struct gprovider *pp) { - static char buf[64]; - const char *val; - - val = find_provcfg(pp, "attrib"); - if (val == NULL) - return (""); - snprintf(buf, sizeof(buf), " [%s] ", val); + static char buf[128]; + struct gconfig *gc; + u_int idx; + + buf[0] = '\0'; + idx = 0; + LIST_FOREACH(gc, &pp->lg_config, lg_config) { + if (strcmp(gc->lg_name, "attrib") != 0) + continue; + idx += snprintf(buf + idx, sizeof(buf) - idx, "%s%s", + (idx == 0) ? " [" : ",", gc->lg_val); + } + if (idx > 0) + snprintf(buf + idx, sizeof(buf) - idx, "] "); return (buf); } From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 05:42:38 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5B891065670; Mon, 20 Oct 2008 05:42:38 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C49218FC28; Mon, 20 Oct 2008 05:42:38 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9K5gcCN061545; Mon, 20 Oct 2008 05:42:38 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9K5gc7k061544; Mon, 20 Oct 2008 05:42:38 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200810200542.m9K5gc7k061544@svn.freebsd.org> From: Kip Macy Date: Mon, 20 Oct 2008 05:42: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: r184071 - head/sys/i386/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 05:42:38 -0000 Author: kmacy Date: Mon Oct 20 05:42:38 2008 New Revision: 184071 URL: http://svn.freebsd.org/changeset/base/184071 Log: Import interrupt management defines from latest xenlinux Modified: head/sys/i386/xen/exception.s Modified: head/sys/i386/xen/exception.s ============================================================================== --- head/sys/i386/xen/exception.s Mon Oct 20 05:12:50 2008 (r184070) +++ head/sys/i386/xen/exception.s Mon Oct 20 05:42:38 2008 (r184071) @@ -37,18 +37,37 @@ #include #include - #include "assym.s" #define SEL_RPL_MASK 0x0002 #define __HYPERVISOR_iret 23 /* Offsets into shared_info_t. */ + #define evtchn_upcall_pending /* 0 */ #define evtchn_upcall_mask 1 -#define XEN_BLOCK_EVENTS(reg) movb $1,evtchn_upcall_mask(reg) -#define XEN_UNBLOCK_EVENTS(reg) movb $0,evtchn_upcall_mask(reg) -#define XEN_TEST_PENDING(reg) testb $0x1,evtchn_upcall_pending(reg) + +#define sizeof_vcpu_shift 6 + + +#ifdef SMP +#ifdef notyet +#define GET_VCPU_INFO movl TI_cpu(%ebp),reg ; \ + shl $sizeof_vcpu_shift,reg ; \ + addl HYPERVISOR_shared_info,reg +#else +#endif + +#define GET_VCPU_INFO(reg) movl HYPERVISOR_shared_info,reg +#endif + +#define __DISABLE_INTERRUPTS(reg) movb $1,evtchn_upcall_mask(reg) +#define __ENABLE_INTERRUPTS(reg) movb $0,evtchn_upcall_mask(reg) +#define DISABLE_INTERRUPTS(reg) GET_VCPU_INFO(reg) ; \ + __DISABLE_INTERRUPTS(reg) +#define ENABLE_INTERRUPTS(reg) GET_VCPU_INFO(reg) ; \ + __ENABLE_INTERRUPTS(reg) +#define __TEST_PENDING(reg) testb $0xFF,evtchn_upcall_pending(reg) #define POPA \ popl %edi; \ @@ -163,8 +182,7 @@ call_evtchn_upcall: hypervisor_callback_pending: - movl HYPERVISOR_shared_info,%esi - XEN_BLOCK_EVENTS(%esi) /* cli */ + DISABLE_INTERRUPTS(%esi) /* cli */ jmp 10b /* @@ -338,12 +356,11 @@ doreti_ast: * interrupts provides sufficient locking even in the SMP case, * since we will be informed of any new ASTs by an IPI. */ - movl HYPERVISOR_shared_info,%esi - XEN_BLOCK_EVENTS(%esi) /* cli */ + DISABLE_INTERRUPTS(%esi) /* cli */ movl PCPU(CURTHREAD),%eax testl $TDF_ASTPENDING | TDF_NEEDRESCHED,TD_FLAGS(%eax) je doreti_exit - XEN_UNBLOCK_EVENTS(%esi) /* sti */ + ENABLE_INTERRUPTS(%esi) /* sti */ pushl %esp /* pass a pointer to the trapframe */ call ast add $4,%esp @@ -357,12 +374,11 @@ doreti_ast: * registers. The fault is handled in trap.c. */ doreti_exit: - movl HYPERVISOR_shared_info,%esi - XEN_UNBLOCK_EVENTS(%esi) # reenable event callbacks (sti) + ENABLE_INTERRUPTS(%esi) # reenable event callbacks (sti) .globl scrit scrit: - XEN_TEST_PENDING(%esi) + __TEST_PENDING(%esi) jnz hypervisor_callback_pending /* More to go */ MEXITCOUNT From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 08:44:14 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9D341065674; Mon, 20 Oct 2008 08:44:14 +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 C86E08FC1F; Mon, 20 Oct 2008 08:44:14 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9K8iEMe064709; Mon, 20 Oct 2008 08:44:14 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9K8iEle064707; Mon, 20 Oct 2008 08:44:14 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200810200844.m9K8iEle064707@svn.freebsd.org> From: Ruslan Ermilov Date: Mon, 20 Oct 2008 08:44: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: r184072 - head/contrib/tcsh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 08:44:15 -0000 Author: ru Date: Mon Oct 20 08:44:14 2008 New Revision: 184072 URL: http://svn.freebsd.org/changeset/base/184072 Log: Actually fix pty detection for autologout setting. (The fix has been submitted upstream.) Modified: head/contrib/tcsh/sh.c head/contrib/tcsh/tc.const.c Modified: head/contrib/tcsh/sh.c ============================================================================== --- head/contrib/tcsh/sh.c Mon Oct 20 05:42:38 2008 (r184071) +++ head/contrib/tcsh/sh.c Mon Oct 20 08:44:14 2008 (r184072) @@ -462,7 +462,7 @@ main(int argc, char **argv) else cp2 = cp; if (!(((Strncmp(cp2, STRtty, 3) == 0) && Isalpha(cp2[3])) || - Strstr(cp, STRslptssl) != NULL)) { + Strstr(cp, STRptssl) != NULL)) { if (getenv("DISPLAY") == NULL) { /* NOT on X window shells */ setcopy(STRautologout, STRdefautologout, VAR_READWRITE); Modified: head/contrib/tcsh/tc.const.c ============================================================================== --- head/contrib/tcsh/tc.const.c Mon Oct 20 05:42:38 2008 (r184071) +++ head/contrib/tcsh/tc.const.c Mon Oct 20 08:44:14 2008 (r184072) @@ -46,7 +46,7 @@ Char STRautomatic[] = { 'a', 'u', 't', ' Char STRhangup[] = { 'h', 'a', 'n', 'g', 'u', 'p', '\0' }; Char STRaout[] = { 'a', '.', 'o', 'u', 't', '\0' }; Char STRtty[] = { 't', 't', 'y', '\0' }; -Char STRslptssl[] = { '/', 'p', 't', 's', '/', '\0' }; +Char STRptssl[] = { 'p', 't', 's', '/', '\0' }; Char STRany[] = { 'a', 'n', 'y', '\0' }; Char STRstatus[] = { 's', 't', 'a', 't', 'u', 's', '\0' }; Char STR0[] = { '0', '\0' }; From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 10:07:29 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2122F1065670; Mon, 20 Oct 2008 10:07:29 +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 1013E8FC1E; Mon, 20 Oct 2008 10:07:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KA7Ssc066156; Mon, 20 Oct 2008 10:07:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KA7SJQ066155; Mon, 20 Oct 2008 10:07:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200810201007.m9KA7SJQ066155@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 20 Oct 2008 10:07: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: r184073 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 10:07:29 -0000 Author: kib Date: Mon Oct 20 10:07:28 2008 New Revision: 184073 URL: http://svn.freebsd.org/changeset/base/184073 Log: In vfs_busy(), lockmgr() cannot legitimately sleep, because code checked MNTK_UNMOUNT before, and mnt_mtx is used as interlock. vfs_busy() always tries to obtain a shared lock on mnt_lock, the other user is unmount who tries to drain it, setting MNTK_UNMOUNT before. Reviewed by: tegge, attilio Tested by: pho MFC after: 2 weeks Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Oct 20 08:44:14 2008 (r184072) +++ head/sys/kern/vfs_subr.c Mon Oct 20 10:07:28 2008 (r184073) @@ -368,7 +368,7 @@ vfs_busy(struct mount *mp, int flags, st } if (interlkp) mtx_unlock(interlkp); - lkflags = LK_SHARED | LK_INTERLOCK; + lkflags = LK_SHARED | LK_INTERLOCK | LK_NOWAIT; if (lockmgr(&mp->mnt_lock, lkflags, MNT_MTX(mp))) panic("vfs_busy: unexpected lock failure"); return (0); From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 10:11:33 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6DE31065674; Mon, 20 Oct 2008 10:11:33 +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 B56138FC13; Mon, 20 Oct 2008 10:11:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KABXXC066269; Mon, 20 Oct 2008 10:11:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KABXLf066267; Mon, 20 Oct 2008 10:11:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200810201011.m9KABXLf066267@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 20 Oct 2008 10:11: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: r184074 - in head/sys: kern ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 10:11:33 -0000 Author: kib Date: Mon Oct 20 10:11:33 2008 New Revision: 184074 URL: http://svn.freebsd.org/changeset/base/184074 Log: Assert that v_holdcnt is non-zero before entering lockmgr in vn_lock and ffs_lock. This cannot catch situations where holdcnt is incremented not by curthread, but I think it is useful. Reviewed by: tegge, attilio Tested by: pho MFC after: 2 weeks Modified: head/sys/kern/vfs_vnops.c head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Mon Oct 20 10:07:28 2008 (r184073) +++ head/sys/kern/vfs_vnops.c Mon Oct 20 10:11:33 2008 (r184074) @@ -873,6 +873,10 @@ _vn_lock(struct vnode *vp, int flags, ch VNASSERT((flags & LK_TYPE_MASK) != 0, vp, ("vn_lock called with no locktype.")); do { +#ifdef DEBUG_VFS_LOCKS + KASSERT(vp->v_holdcnt != 0, + ("vn_lock %p: zero hold count", vp)); +#endif error = VOP_LOCK1(vp, flags, file, line); flags &= ~LK_INTERLOCK; /* Interlock is always dropped. */ KASSERT((flags & LK_RETRY) == 0 || error == 0, Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Mon Oct 20 10:07:28 2008 (r184073) +++ head/sys/ufs/ffs/ffs_vnops.c Mon Oct 20 10:11:33 2008 (r184074) @@ -361,6 +361,10 @@ ffs_lock(ap) vp = ap->a_vp; flags = ap->a_flags; for (;;) { +#ifdef DEBUG_VFS_LOCKS + KASSERT(vp->v_holdcnt != 0, + ("ffs_lock %p: zero hold count", vp)); +#endif lkp = vp->v_vnlock; result = _lockmgr_args(lkp, flags, VI_MTX(vp), LK_WMESG_DEFAULT, LK_PRIO_DEFAULT, LK_TIMO_DEFAULT, From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 11:22:30 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 845741065680; Mon, 20 Oct 2008 11:22:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 766608FC1C; Mon, 20 Oct 2008 11:22:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1KrsqC-0002Pl-Kt; Mon, 20 Oct 2008 14:22:28 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m9KBMPps065120 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 20 Oct 2008 14:22:26 +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.3/8.14.3) with ESMTP id m9KBMPED086495; Mon, 20 Oct 2008 14:22:25 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id m9KBMPME086493; Mon, 20 Oct 2008 14:22:25 +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: Mon, 20 Oct 2008 14:22:25 +0300 From: Kostik Belousov To: David Xu Message-ID: <20081020112225.GX7782@deviant.kiev.zoral.com.ua> References: <200810200237.m9K2brwF058086@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FfxfUH0DniL7RjES" Content-Disposition: inline In-Reply-To: <200810200237.m9K2brwF058086@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 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 X-Virus-Scanned: mail.terabit.net.ua 1KrsqC-0002Pl-Kt 773babb967a64e0da1a697d18b540931 X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184067 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 11:22:30 -0000 --FfxfUH0DniL7RjES Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 20, 2008 at 02:37:53AM +0000, David Xu wrote: > Author: davidxu > Date: Mon Oct 20 02:37:53 2008 > New Revision: 184067 > URL: http://svn.freebsd.org/changeset/base/184067 >=20 > Log: > In realtimer_delete(), clear timer's value and interval to tell > realtimer_expire() to not rearm the timer, otherwise there is a chance > that a callout will be left there and be tiggered in future unexpectly. > =20 > Bug reported by: tegge@ >=20 > Modified: > head/sys/kern/kern_time.c Do you plan to MFC this to RELENG_7 ? This seems as a nice fix to have in upcoming 7.1. --FfxfUH0DniL7RjES Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkj8afEACgkQC3+MBN1Mb4hvigCdF/smRj4dNvo0jYW7slo6coaM ntEAoPVuSmjcysjprhHd0NLw3ZPpN88J =uvbk -----END PGP SIGNATURE----- --FfxfUH0DniL7RjES-- From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 16:10:25 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 293C81065683; Mon, 20 Oct 2008 16:10:25 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id D89728FC18; Mon, 20 Oct 2008 16:10:24 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id C87376D434; Mon, 20 Oct 2008 16:10:23 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id AD0B3844A8; Mon, 20 Oct 2008 18:10:23 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Xin LI References: <200810172121.m9HLLETA098194@svn.freebsd.org> Date: Mon, 20 Oct 2008 18:10:23 +0200 In-Reply-To: <200810172121.m9HLLETA098194@svn.freebsd.org> (Xin LI's message of "Fri, 17 Oct 2008 21:21:14 +0000 (UTC)") Message-ID: <86wsg3gscw.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r183989 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 16:10:25 -0000 Xin LI writes: > Modified: head/lib/libutil/login_times.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libutil/login_times.c Fri Oct 17 21:14:50 2008 (r183988) > +++ head/lib/libutil/login_times.c Fri Oct 17 21:21:14 2008 (r183989) > @@ -72,8 +72,7 @@ parse_lt(const char * str) > char buf[64]; >=20=20 > /* Make local copy and force lowercase to simplify parsing */ > - p =3D strncpy(buf, str, sizeof buf); > - buf[sizeof buf - 1] =3D '\0'; > + p =3D strlcpy(buf, str, sizeof buf); > for (i =3D 0; buf[i]; i++) > buf[i] =3D (char)tolower(buf[i]); This makes absolutely no sense: strncpy() and strlcpy() have different return types. The existing code was safe and worked just fine; why break it? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 16:17:47 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94C5A1065671; Mon, 20 Oct 2008 16:17:47 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 70A688FC1C; Mon, 20 Oct 2008 16:17:46 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id A2CDD6D447; Mon, 20 Oct 2008 16:17:45 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 85823844A8; Mon, 20 Oct 2008 18:17:45 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Xin LI References: <200810080131.m981V0HR016984@svn.freebsd.org> Date: Mon, 20 Oct 2008 18:17:45 +0200 In-Reply-To: <200810080131.m981V0HR016984@svn.freebsd.org> (Xin LI's message of "Wed, 8 Oct 2008 01:31:00 +0000 (UTC)") Message-ID: <86skqrgs0m.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r183679 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 16:17:47 -0000 Xin LI writes: > Modified: head/UPDATING > =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/UPDATING Tue Oct 7 23:55:32 2008 (r183678) > +++ head/UPDATING Wed Oct 8 01:31:00 2008 (r183679) > @@ -59,6 +59,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. > option to "ssh-dss,ssh-rsa" in ~/.ssh/config or on the ssh > command line. >=20=20 > + Please note that the sequence of keys offered for > + authentication has been changed as well. You may want to > + specify IdentityFile in a different order to revert this > + behavior. > + > 20080713: > The sio(4) driver has been removed from the i386 and amd64 > kernel configuration files. This means uart(4) is now the You should have asked me before committing this - and you should have mentioned and justified the addition it in the commit message. As it is now, the entry gives the impression that this change was an unfortunate side effect which needs to be worked around by the user, when in fact it was a conscious and deliberate choice intended to benefit users. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 16:48:18 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D054B10656A3; Mon, 20 Oct 2008 16:48:18 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE6938FC1B; Mon, 20 Oct 2008 16:48:18 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KGmIQL075557; Mon, 20 Oct 2008 16:48:18 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KGmIVs075556; Mon, 20 Oct 2008 16:48:18 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810201648.m9KGmIVs075556@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 20 Oct 2008 16:48: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: r184081 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 16:48:18 -0000 Author: des Date: Mon Oct 20 16:48:18 2008 New Revision: 184081 URL: http://svn.freebsd.org/changeset/base/184081 Log: include and whitespace cleanup. Modified: head/lib/libutil/login_class.c Modified: head/lib/libutil/login_class.c ============================================================================== --- head/lib/libutil/login_class.c Mon Oct 20 16:44:59 2008 (r184080) +++ head/lib/libutil/login_class.c Mon Oct 20 16:48:18 2008 (r184081) @@ -25,14 +25,16 @@ #include __FBSDID("$FreeBSD$"); -#include #include -#include -#include -#include #include #include +#include #include +#include +#include + +#include +#include #include #include #include @@ -92,7 +94,7 @@ setclassresources(login_cap_t *lc) if (getrlimit(lr->why, &rlim) != 0) syslog(LOG_ERR, "getting %s resource limit: %m", lr->what); else { - char name_cur[40]; + char name_cur[40]; char name_max[40]; rlim_t rcur = rlim.rlim_cur; rlim_t rmax = rlim.rlim_max; @@ -104,7 +106,7 @@ setclassresources(login_cap_t *lc) rmax = (*lr->who)(lc, lr->what, rmax, rmax); rlim.rlim_cur = (*lr->who)(lc, name_cur, rcur, rcur); rlim.rlim_max = (*lr->who)(lc, name_max, rmax, rmax); - + if (setrlimit(lr->why, &rlim) == -1) syslog(LOG_WARNING, "set class '%s' resource limit %s: %m", lc->lc_class, lr->what); } @@ -534,4 +536,3 @@ setusercontext(login_cap_t *lc, const st return 0; } - From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 16:51:43 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 901961065674; Mon, 20 Oct 2008 16:51:43 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E3538FC1A; Mon, 20 Oct 2008 16:51:43 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KGphul075646; Mon, 20 Oct 2008 16:51:43 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KGphlW075645; Mon, 20 Oct 2008 16:51:43 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810201651.m9KGphlW075645@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 20 Oct 2008 16:51: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: r184082 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 16:51:43 -0000 Author: des Date: Mon Oct 20 16:51:43 2008 New Revision: 184082 URL: http://svn.freebsd.org/changeset/base/184082 Log: Parenthesize return values. Modified: head/lib/libutil/login_class.c Modified: head/lib/libutil/login_class.c ============================================================================== --- head/lib/libutil/login_class.c Mon Oct 20 16:48:18 2008 (r184081) +++ head/lib/libutil/login_class.c Mon Oct 20 16:51:43 2008 (r184082) @@ -187,7 +187,7 @@ substvar(const char * var, const struct } } - return np; + return (np); } @@ -311,7 +311,7 @@ list2cpuset(const char *list, cpuset_t * case DASH: return (0); } - return 1; + return (1); } @@ -370,7 +370,7 @@ setclasscontext(const char *classname, u rc = lc ? setusercontext(lc, NULL, 0, flags) : -1; login_close(lc); - return rc; + return (rc); } @@ -400,7 +400,7 @@ setlogincontext(login_cap_t *lc, const s if (flags & LOGIN_SETCPUMASK) setclasscpumask(lc); } - return mymask; + return (mymask); } @@ -470,13 +470,13 @@ setusercontext(login_cap_t *lc, const st if (setgid(pwd->pw_gid) != 0) { syslog(LOG_ERR, "setgid(%lu): %m", (u_long)pwd->pw_gid); login_close(llc); - return -1; + return (-1); } if (initgroups(pwd->pw_name, pwd->pw_gid) == -1) { syslog(LOG_ERR, "initgroups(%s,%lu): %m", pwd->pw_name, (u_long)pwd->pw_gid); login_close(llc); - return -1; + return (-1); } } @@ -490,7 +490,7 @@ setusercontext(login_cap_t *lc, const st if (mac_from_text(&label, label_string) == -1) { syslog(LOG_ERR, "mac_from_text('%s') for %s: %m", pwd->pw_name, label_string); - return -1; + return (-1); } if (mac_set_proc(label) == -1) error = errno; @@ -500,7 +500,7 @@ setusercontext(login_cap_t *lc, const st if (error != 0) { syslog(LOG_ERR, "mac_set_proc('%s') for %s: %s", label_string, pwd->pw_name, strerror(error)); - return -1; + return (-1); } } } @@ -509,7 +509,7 @@ setusercontext(login_cap_t *lc, const st if ((flags & LOGIN_SETLOGIN) && setlogin(pwd->pw_name) != 0) { syslog(LOG_ERR, "setlogin(%s): %m", pwd->pw_name); login_close(llc); - return -1; + return (-1); } mymask = (flags & LOGIN_SETUMASK) ? umask(LOGIN_DEFUMASK) : 0; @@ -519,7 +519,7 @@ setusercontext(login_cap_t *lc, const st /* This needs to be done after anything that needs root privs */ if ((flags & LOGIN_SETUSER) && setuid(uid) != 0) { syslog(LOG_ERR, "setuid(%lu): %m", (u_long)uid); - return -1; /* Paranoia again */ + return (-1); /* Paranoia again */ } /* @@ -534,5 +534,5 @@ setusercontext(login_cap_t *lc, const st if (flags & LOGIN_SETUMASK) umask(mymask); - return 0; + return (0); } From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 16:54:53 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5C2C1065680; Mon, 20 Oct 2008 16:54:53 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3D618FC28; Mon, 20 Oct 2008 16:54:53 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KGsrjp075744; Mon, 20 Oct 2008 16:54:53 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KGsr7g075743; Mon, 20 Oct 2008 16:54:53 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810201654.m9KGsr7g075743@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 20 Oct 2008 16:54: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: r184083 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 16:54:54 -0000 Author: des Date: Mon Oct 20 16:54:53 2008 New Revision: 184083 URL: http://svn.freebsd.org/changeset/base/184083 Log: Style and whitespace. Modified: head/lib/libutil/login_cap.h Modified: head/lib/libutil/login_cap.h ============================================================================== --- head/lib/libutil/login_cap.h Mon Oct 20 16:51:43 2008 (r184082) +++ head/lib/libutil/login_cap.h Mon Oct 20 16:54:53 2008 (r184083) @@ -81,7 +81,7 @@ typedef struct login_time { #define LTM_NONE 0x00 #define LTM_SUN 0x01 #define LTM_MON 0x02 -#define LTM_TUE 0x04 +#define LTM_TUE 0x04 #define LTM_WED 0x08 #define LTM_THU 0x10 #define LTM_FRI 0x20 @@ -104,7 +104,8 @@ login_cap_t *login_getclass(const char * login_cap_t *login_getpwclass(const struct passwd *); login_cap_t *login_getuserclass(const struct passwd *); -const char *login_getcapstr(login_cap_t*, const char *, const char *, const char *); +const char *login_getcapstr(login_cap_t *, const char *, const char *, + const char *); const char **login_getcaplist(login_cap_t *, const char *, const char *); const char *login_getstyle(login_cap_t *, const char *, const char *); rlim_t login_getcaptime(login_cap_t *, const char *, rlim_t, rlim_t); @@ -114,31 +115,32 @@ const char *login_getpath(login_cap_t *, int login_getcapbool(login_cap_t *, const char *, int); const char *login_setcryptfmt(login_cap_t *, const char *, const char *); -int setclasscontext(const char*, unsigned int); -int setusercontext(login_cap_t*, const struct passwd*, uid_t, unsigned int); +int setclasscontext(const char *, unsigned int); +int setusercontext(login_cap_t *, const struct passwd *, uid_t, unsigned int); void setclassresources(login_cap_t *); void setclassenvironment(login_cap_t *, const struct passwd *, int); /* Most of these functions are deprecated */ -int auth_approve(login_cap_t*, const char*, const char*); +int auth_approve(login_cap_t *, const char *, const char *); int auth_check(const char *, const char *, const char *, const char *, int *); void auth_env(void); -char *auth_mkvalue(const char *n); -int auth_response(const char *, const char *, const char *, const char *, int *, const char *, const char *); +char *auth_mkvalue(const char *); +int auth_response(const char *, const char *, const char *, const char *, int *, + const char *, const char *); void auth_rmfiles(void); int auth_scan(int); -int auth_script(const char*, ...); +int auth_script(const char *, ...); int auth_script_data(const char *, int, const char *, ...); char *auth_valud(const char *); int auth_setopt(const char *, const char *); void auth_clropts(void); -void auth_checknologin(login_cap_t*); -int auth_cat(const char*); +void auth_checknologin(login_cap_t *); +int auth_cat(const char *); -int auth_ttyok(login_cap_t*, const char *); -int auth_hostok(login_cap_t*, const char *, char const *); -int auth_timeok(login_cap_t*, time_t); +int auth_ttyok(login_cap_t *, const char *); +int auth_hostok(login_cap_t *, const char *, char const *); +int auth_timeok(login_cap_t *, time_t); struct tm; @@ -150,9 +152,11 @@ int in_ltms(const login_time_t *, struct int login_strinlist(const char **, char const *, int); int login_str2inlist(const char **, const char *, const char *, int); -login_time_t * login_timelist(login_cap_t *, char const *, int *, login_time_t **); +login_time_t * login_timelist(login_cap_t *, char const *, int *, + login_time_t **); int login_ttyok(login_cap_t *, const char *, const char *, const char *); -int login_hostok(login_cap_t *, const char *, const char *, const char *, const char *); +int login_hostok(login_cap_t *, const char *, const char *, const char *, + const char *); __END_DECLS From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 17:03:06 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6466F1065675; Mon, 20 Oct 2008 17:03:06 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38E008FC1D; Mon, 20 Oct 2008 17:03:06 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KH36Vg075949; Mon, 20 Oct 2008 17:03:06 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KH36IJ075947; Mon, 20 Oct 2008 17:03:06 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810201703.m9KH36IJ075947@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 20 Oct 2008 17:03: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: r184084 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 17:03:06 -0000 Author: des Date: Mon Oct 20 17:03:05 2008 New Revision: 184084 URL: http://svn.freebsd.org/changeset/base/184084 Log: Since setclasscpumask() is not static, assume that it is intended to be part of the public API. Accordingly, add a prototype and document it. Modified: head/lib/libutil/login_cap.h head/lib/libutil/login_class.3 Modified: head/lib/libutil/login_cap.h ============================================================================== --- head/lib/libutil/login_cap.h Mon Oct 20 16:54:53 2008 (r184083) +++ head/lib/libutil/login_cap.h Mon Oct 20 17:03:05 2008 (r184084) @@ -116,6 +116,7 @@ int login_getcapbool(login_cap_t *, cons const char *login_setcryptfmt(login_cap_t *, const char *, const char *); int setclasscontext(const char *, unsigned int); +void setclasscpumask(login_cap_t *); int setusercontext(login_cap_t *, const struct passwd *, uid_t, unsigned int); void setclassresources(login_cap_t *); void setclassenvironment(login_cap_t *, const struct passwd *, int); Modified: head/lib/libutil/login_class.3 ============================================================================== --- head/lib/libutil/login_class.3 Mon Oct 20 16:54:53 2008 (r184083) +++ head/lib/libutil/login_class.3 Mon Oct 20 17:03:05 2008 (r184084) @@ -19,11 +19,12 @@ .\" .\" $FreeBSD$ .\" -.Dd December 28, 1996 +.Dd October 20, 2008 .Os .Dt LOGIN_CLASS 3 .Sh NAME .Nm setclasscontext , +.Nm setclasscpumask , .Nm setclassenvironment , .Nm setclassresources , .Nm setusercontext @@ -35,12 +36,14 @@ .In login_cap.h .Ft int .Fn setclasscontext "const char *classname" "unsigned int flags" -.Ft int -.Fn setusercontext "login_cap_t *lc" "const struct passwd *pwd" "uid_t uid" "unsigned int flags" .Ft void -.Fn setclassresources "login_cap_t *lc" +.Fn setclasscpumask "login_cap_t *lc" .Ft void .Fn setclassenvironment "login_cap_t *lc" "const struct passwd *pwd" "int paths" +.Ft void +.Fn setclassresources "login_cap_t *lc" +.Ft int +.Fn setusercontext "login_cap_t *lc" "const struct passwd *pwd" "uid_t uid" "unsigned int flags" .Sh DESCRIPTION These functions provide a higher level interface to the login class database than those documented in @@ -162,7 +165,7 @@ and set the cpu affinity to the specifie The string may contain a comma separated list of numbers and/or number ranges as handled by the .Xr cpuset 1 -utility or the case-insensitive string +utility or the case-insensitive string .Ql default . If the string is .Ql default @@ -182,6 +185,7 @@ are substituted for the user's home dire respectively. .Pp The +.Fn setclasscpumask , .Fn setclassresources and .Fn setclassenvironment From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 17:04:57 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73A35106566C; Mon, 20 Oct 2008 17:04:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 621A38FC24; Mon, 20 Oct 2008 17:04:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KH4vMP076018; Mon, 20 Oct 2008 17:04:57 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KH4vfj076017; Mon, 20 Oct 2008 17:04:57 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810201704.m9KH4vfj076017@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 20 Oct 2008 17:04:57 +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: r184085 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 17:04:57 -0000 Author: des Date: Mon Oct 20 17:04:57 2008 New Revision: 184085 URL: http://svn.freebsd.org/changeset/base/184085 Log: Unbreak Modified: head/lib/libutil/login_times.c Modified: head/lib/libutil/login_times.c ============================================================================== --- head/lib/libutil/login_times.c Mon Oct 20 17:03:05 2008 (r184084) +++ head/lib/libutil/login_times.c Mon Oct 20 17:04:57 2008 (r184085) @@ -40,7 +40,7 @@ static struct { { "su", 2, LTM_SUN }, { "mo", 2, LTM_MON }, { "tu", 2, LTM_TUE }, { "we", 2, LTM_WED }, { "th", 2, LTM_THU }, { "fr", 2, LTM_FRI }, - { "sa", 2, LTM_SAT }, { "any",3, LTM_ANY }, { "all",3, LTM_ANY }, + { "sa", 2, LTM_SAT }, { "any",3, LTM_ANY }, { "all",3, LTM_ANY }, { "wk", 2, LTM_WK }, { "wd", 2, LTM_WD }, { NULL, 0, 0 } }; @@ -72,9 +72,10 @@ parse_lt(const char * str) char buf[64]; /* Make local copy and force lowercase to simplify parsing */ - p = strlcpy(buf, str, sizeof buf); + strlcpy(buf, str, sizeof buf); for (i = 0; buf[i]; i++) buf[i] = (char)tolower(buf[i]); + p = buf; while (isalpha(*p)) { @@ -157,4 +158,3 @@ in_lts(const login_time_t * ltm, time_t { return in_ltms(ltm, localtime(t), t); } - From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 17:07:50 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9C691065670; Mon, 20 Oct 2008 17:07:50 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A77CB8FC1E; Mon, 20 Oct 2008 17:07:50 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KH7oUZ076101; Mon, 20 Oct 2008 17:07:50 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KH7onr076100; Mon, 20 Oct 2008 17:07:50 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810201707.m9KH7onr076100@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 20 Oct 2008 17:07: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: r184086 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 17:07:50 -0000 Author: des Date: Mon Oct 20 17:07:50 2008 New Revision: 184086 URL: http://svn.freebsd.org/changeset/base/184086 Log: Style and whitespace Modified: head/lib/libutil/login_times.c Modified: head/lib/libutil/login_times.c ============================================================================== --- head/lib/libutil/login_times.c Mon Oct 20 17:04:57 2008 (r184085) +++ head/lib/libutil/login_times.c Mon Oct 20 17:07:50 2008 (r184086) @@ -34,8 +34,8 @@ __FBSDID("$FreeBSD$"); static struct { const char *dw; - u_char cn; - u_char fl; + u_char cn; + u_char fl; } dws[] = { { "su", 2, LTM_SUN }, { "mo", 2, LTM_MON }, { "tu", 2, LTM_TUE }, @@ -54,22 +54,22 @@ parse_time(char * ptr, u_short * t) *t = (u_short)((val / 100) * 60 + (val % 100)); - return ptr; + return (ptr); } login_time_t -parse_lt(const char * str) +parse_lt(const char *str) { login_time_t t; memset(&t, 0, sizeof t); t.lt_dow = LTM_NONE; if (str && *str && strcmp(str, "Never") != 0 && strcmp(str, "None") != 0) { - int i; - login_time_t m = t; + int i; + login_time_t m = t; char *p; - char buf[64]; + char buf[64]; /* Make local copy and force lowercase to simplify parsing */ strlcpy(buf, str, sizeof buf); @@ -102,12 +102,12 @@ parse_lt(const char * str) t = m; } - return t; + return (t); } int -in_ltm(const login_time_t * ltm, struct tm * tt, time_t * ends) +in_ltm(const login_time_t *ltm, struct tm *tt, time_t *ends) { int rc = 0; @@ -130,31 +130,31 @@ in_ltm(const login_time_t * ltm, struct } } } - return rc; + return (rc); } int -in_lt(const login_time_t * ltm, time_t * t) +in_lt(const login_time_t *ltm, time_t *t) { - return in_ltm(ltm, localtime(t), t); + return (in_ltm(ltm, localtime(t), t)); } int -in_ltms(const login_time_t * ltm, struct tm * tm, time_t * t) +in_ltms(const login_time_t *ltm, struct tm * tm, time_t *t) { int i = 0; while (i < LC_MAXTIMES && ltm[i].lt_dow != LTM_NONE) { if (in_ltm(ltm + i, tm, t)) - return i; + return (i); i++; } - return -1; + return (-1); } int -in_lts(const login_time_t * ltm, time_t * t) +in_lts(const login_time_t *ltm, time_t *t) { - return in_ltms(ltm, localtime(t), t); + return (in_ltms(ltm, localtime(t), t)); } From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 17:09:51 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F928106566C; Mon, 20 Oct 2008 17:09:51 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1A7E8FC3A; Mon, 20 Oct 2008 17:09:50 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KH9omD076172; Mon, 20 Oct 2008 17:09:50 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KH9ow1076171; Mon, 20 Oct 2008 17:09:50 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810201709.m9KH9ow1076171@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 20 Oct 2008 17:09: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: r184087 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 17:09:51 -0000 Author: des Date: Mon Oct 20 17:09:50 2008 New Revision: 184087 URL: http://svn.freebsd.org/changeset/base/184087 Log: Additional style and whitespace fixes. Modified: head/lib/libutil/login_times.c Modified: head/lib/libutil/login_times.c ============================================================================== --- head/lib/libutil/login_times.c Mon Oct 20 17:07:50 2008 (r184086) +++ head/lib/libutil/login_times.c Mon Oct 20 17:09:50 2008 (r184087) @@ -137,11 +137,12 @@ in_ltm(const login_time_t *ltm, struct t int in_lt(const login_time_t *ltm, time_t *t) { + return (in_ltm(ltm, localtime(t), t)); } int -in_ltms(const login_time_t *ltm, struct tm * tm, time_t *t) +in_ltms(const login_time_t *ltm, struct tm *tm, time_t *t) { int i = 0; @@ -156,5 +157,6 @@ in_ltms(const login_time_t *ltm, struct int in_lts(const login_time_t *ltm, time_t *t) { + return (in_ltms(ltm, localtime(t), t)); } From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 17:17:58 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E48061065670; Mon, 20 Oct 2008 17:17:58 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D28BF8FC2B; Mon, 20 Oct 2008 17:17:58 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KHHwc3076354; Mon, 20 Oct 2008 17:17:58 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KHHw4T076352; Mon, 20 Oct 2008 17:17:58 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810201717.m9KHHw4T076352@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 20 Oct 2008 17:17: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: r184088 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 17:17:59 -0000 Author: des Date: Mon Oct 20 17:17:58 2008 New Revision: 184088 URL: http://svn.freebsd.org/changeset/base/184088 Log: Since in_lt() and in_lts() are not static, assume that they are intended to be part of the public API. Accordingly, add prototypes and document them. Modified: head/lib/libutil/login_cap.h head/lib/libutil/login_times.3 Modified: head/lib/libutil/login_cap.h ============================================================================== --- head/lib/libutil/login_cap.h Mon Oct 20 17:09:50 2008 (r184087) +++ head/lib/libutil/login_cap.h Mon Oct 20 17:17:58 2008 (r184088) @@ -146,8 +146,10 @@ int auth_timeok(login_cap_t *, time_t); struct tm; login_time_t parse_lt(const char *); +int in_lt(const login_time_t *, time_t *); int in_ltm(const login_time_t *, struct tm *, time_t *); int in_ltms(const login_time_t *, struct tm *, time_t *); +int in_lts(const login_time_t *, time_t *); /* helper functions */ Modified: head/lib/libutil/login_times.3 ============================================================================== --- head/lib/libutil/login_times.3 Mon Oct 20 17:09:50 2008 (r184087) +++ head/lib/libutil/login_times.3 Mon Oct 20 17:17:58 2008 (r184088) @@ -19,13 +19,15 @@ .\" .\" $FreeBSD$ .\" -.Dd January 2, 1997 +.Dd October 20, 2008 .Os .Dt LOGIN_TIMES 3 .Sh NAME .Nm parse_lt , +.Nm in_lt , .Nm in_ltm , -.Nm in_ltms +.Nm in_ltms , +.Nm in_lts .Nd functions for parsing and checking login time periods .Sh LIBRARY .Lb libutil @@ -36,9 +38,13 @@ .Ft login_time_t .Fn parse_lt "const char *str" .Ft int +.Fn in_lt "const login_time_t *lt" "time_t *ends" +.Ft int .Fn in_ltm "const login_time_t *lt" "struct tm *t" "time_t *ends" .Ft int .Fn in_ltms "const login_time_t *lt" "struct tm *t" "time_t *ends" +.Ft int +.Fn in_lts "const login_time_t *lt" "time_t *ends" .Sh DESCRIPTION This set of functions may be used for parsing and checking login and session times against a predefined list of allowed login times as @@ -135,6 +141,18 @@ elements in length, and terminated by an .Ar lt_dow field set to .Em LTM_NONE . +.Pp +The +.Fn in_lt +and +.Fn in_lts +functions are equivalent to +.Fn in_ltm +and +.Fn in_ltms , +respectively, with the second argument set to the current time as +returned by +.Xr localtime 3 . .Sh RETURN VALUES The .Fn parse_lt From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 17:24:25 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94D1E10656A5; Mon, 20 Oct 2008 17:24:25 +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 82BEB8FC2C; Mon, 20 Oct 2008 17:24:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KHOPec076510; Mon, 20 Oct 2008 17:24:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KHOP8Y076509; Mon, 20 Oct 2008 17:24:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810201724.m9KHOP8Y076509@svn.freebsd.org> From: Alexander Motin Date: Mon, 20 Oct 2008 17:24: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: r184089 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 17:24:25 -0000 Author: mav Date: Mon Oct 20 17:24:25 2008 New Revision: 184089 URL: http://svn.freebsd.org/changeset/base/184089 Log: Tune boot messages a bit. Use <> brackets only at device name line. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Mon Oct 20 17:17:58 2008 (r184088) +++ head/sys/dev/sound/pci/hda/hdac.c Mon Oct 20 17:24:25 2008 (r184089) @@ -1854,7 +1854,7 @@ hdac_probe_codec(struct hdac_codec *code nid_t cad = codec->cad; HDA_BOOTVERBOSE( - device_printf(sc->dev, "Probing codec %d...\n", cad); + device_printf(sc->dev, "Probing codec #%d...\n", cad); ); vendorid = hdac_command(sc, HDA_CMD_GET_PARAMETER(cad, 0x0, HDA_PARAM_VENDOR_ID), @@ -1873,10 +1873,10 @@ hdac_probe_codec(struct hdac_codec *code return; } - device_printf(sc->dev, "\n", + device_printf(sc->dev, "HDA Codec #%d: %s\n", cad, hdac_codec_name(codec)); HDA_BOOTVERBOSE( - device_printf(sc->dev, "\n", + device_printf(sc->dev, " HDA Codec ID: 0x%08x\n", hdac_codec_id(codec)); device_printf(sc->dev, " Vendor: 0x%04x\n", codec->vendor_id); @@ -3826,7 +3826,7 @@ hdac_attach(device_t dev) uint16_t vendor; uint8_t v; - device_printf(dev, "\n", HDA_DRV_TEST_REV); + device_printf(dev, "HDA Driver Revision: %s\n", HDA_DRV_TEST_REV); sc = device_get_softc(dev); sc->lock = snd_mtxcreate(device_get_nameunit(dev), HDAC_MTX_NAME); From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 17:26:30 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEEAE106574B; Mon, 20 Oct 2008 17:26:30 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACD488FC14; Mon, 20 Oct 2008 17:26:30 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KHQUlO076590; Mon, 20 Oct 2008 17:26:30 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KHQUgb076589; Mon, 20 Oct 2008 17:26:30 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810201726.m9KHQUgb076589@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 20 Oct 2008 17:26: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: r184090 - head/tools/regression/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 17:26:30 -0000 Author: des Date: Mon Oct 20 17:26:30 2008 New Revision: 184090 URL: http://svn.freebsd.org/changeset/base/184090 Log: #ifdef out the lock-against-self test. I'm not sure it makes sense, and it relies on non-portable flock(2) semantics. Not only is flock(2) not portable, but on some OSes that do have it, it is implemented in terms of fcntl(2) locks, which are per-process rather than per-descriptor. Modified: head/tools/regression/lib/libutil/test-flopen.c Modified: head/tools/regression/lib/libutil/test-flopen.c ============================================================================== --- head/tools/regression/lib/libutil/test-flopen.c Mon Oct 20 17:24:25 2008 (r184089) +++ head/tools/regression/lib/libutil/test-flopen.c Mon Oct 20 17:26:30 2008 (r184090) @@ -89,6 +89,7 @@ test_flopen_open(void) return (result); } +#if FLOPEN_CAN_LOCK_AGAINST_SELF /* * Test that flopen() can lock against itself */ @@ -114,6 +115,7 @@ test_flopen_lock_self(void) unlink(fn); return (result); } +#endif /* * Test that flopen() can lock against other processes @@ -152,7 +154,9 @@ static struct test { } t[] = { { "flopen_create", test_flopen_create }, { "flopen_open", test_flopen_open }, +#if FLOPEN_CAN_LOCK_AGAINST_SELF { "flopen_lock_self", test_flopen_lock_self }, +#endif { "flopen_lock_other", test_flopen_lock_other }, }; From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 17:41:09 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CACB1065704; Mon, 20 Oct 2008 17:41:09 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AC818FC08; Mon, 20 Oct 2008 17:41:09 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KHf9GJ076907; Mon, 20 Oct 2008 17:41:09 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KHf9G3076906; Mon, 20 Oct 2008 17:41:09 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810201741.m9KHf9G3076906@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 20 Oct 2008 17:41: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: r184091 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 17:41:09 -0000 Author: des Date: Mon Oct 20 17:41:08 2008 New Revision: 184091 URL: http://svn.freebsd.org/changeset/base/184091 Log: There is no point in releasing a lock on a file which we've unlinked and are about to close, so don't. As a bonus, pidfile_remove(3) will now work with an fcntl(2)-based flopen(3). Modified: head/lib/libutil/pidfile.c Modified: head/lib/libutil/pidfile.c ============================================================================== --- head/lib/libutil/pidfile.c Mon Oct 20 17:26:30 2008 (r184090) +++ head/lib/libutil/pidfile.c Mon Oct 20 17:41:08 2008 (r184091) @@ -231,10 +231,6 @@ _pidfile_remove(struct pidfh *pfh, int f if (unlink(pfh->pf_path) == -1) error = errno; - if (flock(pfh->pf_fd, LOCK_UN) == -1) { - if (error == 0) - error = errno; - } if (close(pfh->pf_fd) == -1) { if (error == 0) error = errno; From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 18:00:11 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FFBE1065671; Mon, 20 Oct 2008 18:00:11 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DDAE8FC14; Mon, 20 Oct 2008 18:00:11 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KI0BFh077295; Mon, 20 Oct 2008 18:00:11 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KI0BQG077294; Mon, 20 Oct 2008 18:00:11 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810201800.m9KI0BQG077294@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 20 Oct 2008 18:00: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: r184092 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 18:00:11 -0000 Author: des Date: Mon Oct 20 18:00:11 2008 New Revision: 184092 URL: http://svn.freebsd.org/changeset/base/184092 Log: pidfile(3) uses flopen(3) - don't make any assumptions about how the latter is implemented. Modified: head/lib/libutil/pidfile.3 Modified: head/lib/libutil/pidfile.3 ============================================================================== --- head/lib/libutil/pidfile.3 Mon Oct 20 17:41:08 2008 (r184091) +++ head/lib/libutil/pidfile.3 Mon Oct 20 18:00:11 2008 (r184092) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 22, 2005 +.Dd October 20, 2008 .Dt PIDFILE 3 .Os .Sh NAME @@ -51,16 +51,14 @@ The .Nm pidfile family of functions allows daemons to handle PID files. It uses -.Xr flock 2 +.Xr flopen 3 to lock a pidfile and detect already running daemons. .Pp The .Fn pidfile_open function opens (or creates) a file specified by the .Fa path -argument and locks it with the -.Xr flock 2 -system call. +argument and locks it. If a file can not be locked, a PID of an already running daemon is returned in the .Fa pidptr @@ -233,16 +231,17 @@ function may also fail and set .Va errno for any errors specified for the .Xr close 2 , -.Xr flock 2 , .Xr fstat 2 , .Xr write 2 , and .Xr unlink 2 -calls. +system calls and the +.Xr flopen 3 +library function. .Sh SEE ALSO -.Xr flock 2 , .Xr open 2 , -.Xr daemon 3 +.Xr daemon 3 , +.Xr flopen 3 .Sh AUTHORS .An -nosplit The From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 18:02:17 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20A3C1065670; Mon, 20 Oct 2008 18:02:17 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EC0A8FC19; Mon, 20 Oct 2008 18:02:17 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KI2Gr0077365; Mon, 20 Oct 2008 18:02:16 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KI2GrQ077363; Mon, 20 Oct 2008 18:02:16 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810201802.m9KI2GrQ077363@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 20 Oct 2008 18:02:16 +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: r184093 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 18:02:17 -0000 Author: des Date: Mon Oct 20 18:02:16 2008 New Revision: 184093 URL: http://svn.freebsd.org/changeset/base/184093 Log: Reimplement flopen(3) using fcntl(2) locks instead of flock(2) locks. Modified: head/lib/libutil/flopen.3 head/lib/libutil/flopen.c Modified: head/lib/libutil/flopen.3 ============================================================================== --- head/lib/libutil/flopen.3 Mon Oct 20 18:00:11 2008 (r184092) +++ head/lib/libutil/flopen.3 Mon Oct 20 18:02:16 2008 (r184093) @@ -46,12 +46,13 @@ The function opens or creates a file and acquires an exclusive lock on it. It is essentially equivalent with calling .Fn open -with the same parameters followed by -.Fn flock -with an -.Va operation -argument of -.Dv LOCK_EX , +with the same parameters followed by an +.Fn fcntl +.Dv F_SETLK +or +.Dv F_SETLKW +operation with lock type +.Dv F_WRLCK , except that .Fn flopen will attempt to detect and handle races that may occur between opening @@ -86,12 +87,12 @@ returns a valid file descriptor. Otherwise, it returns -1, and sets .Va errno as described in -.Xr flock 2 +.Xr fcntl 2 and .Xr open 2 . .Sh SEE ALSO .Xr errno 2 , -.Xr flock 2 , +.Xr fcntl 2 , .Xr open 2 .Sh HISTORY The Modified: head/lib/libutil/flopen.c ============================================================================== --- head/lib/libutil/flopen.c Mon Oct 20 18:00:11 2008 (r184092) +++ head/lib/libutil/flopen.c Mon Oct 20 18:02:16 2008 (r184093) @@ -28,12 +28,12 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include #include +#include #include #include @@ -42,6 +42,7 @@ int flopen(const char *path, int flags, ...) { int fd, operation, serrno, trunc; + struct flock flock; struct stat sb, fsb; mode_t mode; @@ -58,9 +59,10 @@ flopen(const char *path, int flags, ...) va_end(ap); } - operation = LOCK_EX; - if (flags & O_NONBLOCK) - operation |= LOCK_NB; + memset(&flock, 0, sizeof flock); + flock.l_type = F_WRLCK; + flock.l_whence = SEEK_SET; + operation = (flags & O_NONBLOCK) ? F_SETLK : F_SETLKW; trunc = (flags & O_TRUNC); flags &= ~O_TRUNC; @@ -69,7 +71,7 @@ flopen(const char *path, int flags, ...) if ((fd = open(path, flags, mode)) == -1) /* non-existent or no access */ return (-1); - if (flock(fd, operation) == -1) { + if (fcntl(fd, operation, &flock) == -1) { /* unsupported or interrupted */ serrno = errno; close(fd); From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 18:11:30 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A29911065672; Mon, 20 Oct 2008 18:11:30 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 905208FC21; Mon, 20 Oct 2008 18:11:30 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KIBUW0077568; Mon, 20 Oct 2008 18:11:30 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KIBUdK077567; Mon, 20 Oct 2008 18:11:30 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810201811.m9KIBUdK077567@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 20 Oct 2008 18:11: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: r184094 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 18:11:30 -0000 Author: des Date: Mon Oct 20 18:11:30 2008 New Revision: 184094 URL: http://svn.freebsd.org/changeset/base/184094 Log: Diff reduction against Varnish, including one important fix: use a shared lock if the file is opened with O_RDONLY. Modified: head/lib/libutil/flopen.c Modified: head/lib/libutil/flopen.c ============================================================================== --- head/lib/libutil/flopen.c Mon Oct 20 18:02:16 2008 (r184093) +++ head/lib/libutil/flopen.c Mon Oct 20 18:11:30 2008 (r184094) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007 Dag-Erling Coïdan Smørgrav + * Copyright (c) 2007 Dag-Erling Coïdan Smørgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,7 @@ int flopen(const char *path, int flags, ...) { int fd, operation, serrno, trunc; - struct flock flock; + struct flock lock; struct stat sb, fsb; mode_t mode; @@ -55,13 +55,13 @@ flopen(const char *path, int flags, ...) va_list ap; va_start(ap, flags); - mode = va_arg(ap, int); /* mode_t promoted to int */ + mode = (mode_t)va_arg(ap, int); /* mode_t promoted to int */ va_end(ap); } - memset(&flock, 0, sizeof flock); - flock.l_type = F_WRLCK; - flock.l_whence = SEEK_SET; + memset(&lock, 0, sizeof lock); + lock.l_type = ((flags & O_ACCMODE) == O_RDONLY) ? F_RDLCK : F_WRLCK; + lock.l_whence = SEEK_SET; operation = (flags & O_NONBLOCK) ? F_SETLK : F_SETLKW; trunc = (flags & O_TRUNC); @@ -71,35 +71,35 @@ flopen(const char *path, int flags, ...) if ((fd = open(path, flags, mode)) == -1) /* non-existent or no access */ return (-1); - if (fcntl(fd, operation, &flock) == -1) { + if (fcntl(fd, operation, &lock) == -1) { /* unsupported or interrupted */ serrno = errno; - close(fd); + (void)close(fd); errno = serrno; return (-1); } if (stat(path, &sb) == -1) { /* disappeared from under our feet */ - close(fd); + (void)close(fd); continue; } if (fstat(fd, &fsb) == -1) { /* can't happen [tm] */ serrno = errno; - close(fd); + (void)close(fd); errno = serrno; return (-1); } if (sb.st_dev != fsb.st_dev || sb.st_ino != fsb.st_ino) { /* changed under our feet */ - close(fd); + (void)close(fd); continue; } if (trunc && ftruncate(fd, 0) != 0) { /* can't happen [tm] */ serrno = errno; - close(fd); + (void)close(fd); errno = serrno; return (-1); } From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 18:23:44 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9B7C1065682; Mon, 20 Oct 2008 18:23:44 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 7DC9A8FC24; Mon, 20 Oct 2008 18:23:44 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 9B1F328454; Tue, 21 Oct 2008 02:23:43 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 62626EB3396; Tue, 21 Oct 2008 02:23:43 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id PjEkOD08Lzq8; Tue, 21 Oct 2008 02:23:37 +0800 (CST) Received: from charlie.delphij.net (adsl-76-237-33-62.dsl.pltn13.sbcglobal.net [76.237.33.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id AEBB8EB3392; Tue, 21 Oct 2008 02:23:35 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=UUDPCArRpVxlhH4A7nBp81F3HrUgsGZk/41YtixBttTkzolnBnTym5klDNFuq+3mQ aILdfbGL4ZPlRpa+8OUqg== Message-ID: <48FCCCA4.1000703@delphij.net> Date: Mon, 20 Oct 2008 11:23:32 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.17 (X11/20080928) MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <200810080131.m981V0HR016984@svn.freebsd.org> <86skqrgs0m.fsf@ds4.des.no> In-Reply-To: <86skqrgs0m.fsf@ds4.des.no> X-Enigmail-Version: 0.95.7 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Xin LI Subject: Re: svn commit: r183679 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 18:23:45 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dag-Erling Smørgrav wrote: > Xin LI writes: >> Modified: head/UPDATING >> ============================================================================== >> --- head/UPDATING Tue Oct 7 23:55:32 2008 (r183678) >> +++ head/UPDATING Wed Oct 8 01:31:00 2008 (r183679) >> @@ -59,6 +59,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. >> option to "ssh-dss,ssh-rsa" in ~/.ssh/config or on the ssh >> command line. >> >> + Please note that the sequence of keys offered for >> + authentication has been changed as well. You may want to >> + specify IdentityFile in a different order to revert this >> + behavior. >> + >> 20080713: >> The sio(4) driver has been removed from the i386 and amd64 >> kernel configuration files. This means uart(4) is now the > > You should have asked me before committing this - and you should have > mentioned and justified the addition it in the commit message. As it > is now, the entry gives the impression that this change was an > unfortunate side effect which needs to be worked around by the user, > when in fact it was a conscious and deliberate choice intended to > benefit users. Sorry for that, I should have double-checked the diff before commit. Do you want me to revert this part? Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkj8zKQACgkQi+vbBBjt66BxwQCgtxJvkggHpghb48yHfM60MGKe J7gAn2c8ryI9JKFRneuveHZuF1K6FdVo =mUYM -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 18:37:11 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 599EE106567D; Mon, 20 Oct 2008 18:37:11 +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 474BB8FC1A; Mon, 20 Oct 2008 18:37:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KIbBA6078106; Mon, 20 Oct 2008 18:37:11 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KIbBr7078105; Mon, 20 Oct 2008 18:37:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810201837.m9KIbBr7078105@svn.freebsd.org> From: Alexander Motin Date: Mon, 20 Oct 2008 18:37: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: r184095 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 18:37:11 -0000 Author: mav Date: Mon Oct 20 18:37:10 2008 New Revision: 184095 URL: http://svn.freebsd.org/changeset/base/184095 Log: Make HDA PCM device boot and sndstat messages more alike to PCI device ones. Move codec # out of the device name as it is a device address and not part of device type name. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Mon Oct 20 18:11:30 2008 (r184094) +++ head/sys/dev/sound/pci/hda/hdac.c Mon Oct 20 18:37:10 2008 (r184095) @@ -7552,6 +7552,21 @@ hdac_detach(device_t dev) return (0); } +static int +hdac_print_child(device_t dev, device_t child) +{ + struct hdac_pcm_devinfo *pdevinfo = + (struct hdac_pcm_devinfo *)device_get_ivars(child); + int retval; + + retval = bus_print_child_header(dev, child); + retval += printf(" at cad %d nid %d", + pdevinfo->devinfo->codec->cad, pdevinfo->devinfo->nid); + retval += bus_print_child_footer(dev, child); + + return (retval); +} + static device_method_t hdac_methods[] = { /* device interface */ DEVMETHOD(device_probe, hdac_probe), @@ -7559,6 +7574,8 @@ static device_method_t hdac_methods[] = DEVMETHOD(device_detach, hdac_detach), DEVMETHOD(device_suspend, hdac_suspend), DEVMETHOD(device_resume, hdac_resume), + /* Bus interface */ + DEVMETHOD(bus_print_child, hdac_print_child), { 0, 0 } }; @@ -7581,8 +7598,7 @@ hdac_pcm_probe(device_t dev) (struct hdac_pcm_devinfo *)device_get_ivars(dev); char buf[128]; - snprintf(buf, sizeof(buf), "HDA codec #%d %s PCM #%d", - pdevinfo->devinfo->codec->cad, + snprintf(buf, sizeof(buf), "HDA %s PCM #%d", hdac_codec_name(pdevinfo->devinfo->codec), pdevinfo->index); device_set_desc_copy(dev, buf); @@ -7673,9 +7689,9 @@ hdac_pcm_attach(device_t dev) if (pdevinfo->rec >= 0) pcm_addchan(dev, PCMDIR_REC, &hdac_channel_class, pdevinfo); - snprintf(status, SND_STATUSLEN, "at %s cad %d %s [%s]", - device_get_nameunit(sc->dev), pdevinfo->devinfo->codec->cad, - PCM_KLDSTRING(snd_hda), HDA_DRV_TEST_REV); + snprintf(status, SND_STATUSLEN, "at cad %d nid %d on %s %s", + pdevinfo->devinfo->codec->cad, pdevinfo->devinfo->nid, + device_get_nameunit(sc->dev), PCM_KLDSTRING(snd_hda)); pcm_setstatus(dev, status); return (0); From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 18:44:00 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 235291065679; Mon, 20 Oct 2008 18:44:00 +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 115BB8FC0A; Mon, 20 Oct 2008 18:44:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KIhxwZ078262; Mon, 20 Oct 2008 18:43:59 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KIhxxe078260; Mon, 20 Oct 2008 18:43:59 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200810201843.m9KIhxxe078260@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 20 Oct 2008 18:43:59 +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: r184096 - in head/sys: netinet netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 18:44:00 -0000 Author: bz Date: Mon Oct 20 18:43:59 2008 New Revision: 184096 URL: http://svn.freebsd.org/changeset/base/184096 Log: Bring over the change switching from using sequential to random ephemeral port allocation as implemented in netinet/in_pcb.c rev. 1.143 (initially from OpenBSD) and follow-up commits during the last four and a half years including rev. 1.157, 1.162 and 1.199. This now is relying on the same infrastructure as has been implemented in in_pcb.c since rev. 1.199. Reviewed by: silby, rpaulo, mlaier MFC after: 2 months Modified: head/sys/netinet/in_pcb.h head/sys/netinet6/in6_src.c Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Mon Oct 20 18:37:10 2008 (r184095) +++ head/sys/netinet/in_pcb.h Mon Oct 20 18:43:59 2008 (r184096) @@ -449,6 +449,9 @@ extern int ipport_firstauto; extern int ipport_lastauto; extern int ipport_hifirstauto; extern int ipport_hilastauto; +extern int ipport_randomized; +extern int ipport_stoprandom; +extern int ipport_tcpallocs; extern struct callout ipport_tick_callout; void in_pcbpurgeif0(struct inpcbinfo *, struct ifnet *); Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Mon Oct 20 18:37:10 2008 (r184095) +++ head/sys/netinet6/in6_src.c Mon Oct 20 18:43:59 2008 (r184096) @@ -95,6 +95,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include #include #include @@ -774,7 +777,7 @@ in6_pcbsetport(struct in6_addr *laddr, s INIT_VNET_INET(curvnet); struct socket *so = inp->inp_socket; u_int16_t lport = 0, first, last, *lastport; - int count, error = 0, wild = 0; + int count, error = 0, wild = 0, dorandom; struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; INP_INFO_WLOCK_ASSERT(pcbinfo); @@ -802,56 +805,58 @@ in6_pcbsetport(struct in6_addr *laddr, s last = V_ipport_lastauto; lastport = &pcbinfo->ipi_lastport; } + /* - * Simple check to ensure all ports are not used up causing - * a deadlock here. - * - * We split the two cases (up and down) so that the direction - * is not being tested on each round of the loop. + * For UDP, use random port allocation as long as the user + * allows it. For TCP (and as of yet unknown) connections, + * use random port allocation only if the user allows it AND + * ipport_tick() allows it. */ - if (first > last) { - /* - * counting down - */ - count = first - last; + if (V_ipport_randomized && + (!V_ipport_stoprandom || pcbinfo == &V_udbinfo)) + dorandom = 1; + else + dorandom = 0; + /* + * It makes no sense to do random port allocation if + * we have the only port available. + */ + if (first == last) + dorandom = 0; + /* Make sure to not include UDP packets in the count. */ + if (pcbinfo != &V_udbinfo) + V_ipport_tcpallocs++; - do { - if (count-- < 0) { /* completely used? */ - /* - * Undo any address bind that may have - * occurred above. - */ - inp->in6p_laddr = in6addr_any; - return (EAGAIN); - } - --*lastport; - if (*lastport > first || *lastport < last) - *lastport = first; - lport = htons(*lastport); - } while (in6_pcblookup_local(pcbinfo, &inp->in6p_laddr, - lport, wild, cred)); - } else { - /* - * counting up - */ - count = last - first; + /* + * Instead of having two loops further down counting up or down + * make sure that first is always <= last and go with only one + * code path implementing all logic. + */ + if (first > last) { + u_int16_t aux; - do { - if (count-- < 0) { /* completely used? */ - /* - * Undo any address bind that may have - * occurred above. - */ - inp->in6p_laddr = in6addr_any; - return (EAGAIN); - } - ++*lastport; - if (*lastport < first || *lastport > last) - *lastport = first; - lport = htons(*lastport); - } while (in6_pcblookup_local(pcbinfo, &inp->in6p_laddr, - lport, wild, cred)); - } + aux = first; + first = last; + last = aux; + } + + if (dorandom) + *lastport = first + (arc4random() % (last - first)); + + count = last - first; + + do { + if (count-- < 0) { /* completely used? */ + /* Undo an address bind that may have occurred. */ + inp->in6p_laddr = in6addr_any; + return (EADDRNOTAVAIL); + } + ++*lastport; + if (*lastport < first || *lastport > last) + *lastport = first; + lport = htons(*lastport); + } while (in6_pcblookup_local(pcbinfo, &inp->in6p_laddr, + lport, wild, cred)); inp->inp_lport = lport; if (in_pcbinshash(inp) != 0) { From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 18:56:01 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D8C51065676; Mon, 20 Oct 2008 18:56:01 +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 2BDA68FC1E; Mon, 20 Oct 2008 18:56:01 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KIu0Oq078530; Mon, 20 Oct 2008 18:56:00 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KIu0JT078529; Mon, 20 Oct 2008 18:56:00 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200810201856.m9KIu0JT078529@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 20 Oct 2008 18:56: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: r184097 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 18:56:01 -0000 Author: bz Date: Mon Oct 20 18:56:00 2008 New Revision: 184097 URL: http://svn.freebsd.org/changeset/base/184097 Log: Update a comment which to my reading had been misplaced in rev. 1.12 already (but probably had been way above as the code was there twice) and describe what was last changed in rev. 1.199 there (which now is in sync with in6_src.c r184096). Pointed at by: mlaier MFC after: 2 mmonths Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Mon Oct 20 18:43:59 2008 (r184096) +++ head/sys/netinet/in_pcb.c Mon Oct 20 18:56:00 2008 (r184097) @@ -458,8 +458,9 @@ in_pcbbind_setup(struct inpcb *inp, stru if (pcbinfo != &V_udbinfo) V_ipport_tcpallocs++; /* - * Simple check to ensure all ports are not used up causing - * a deadlock here. + * Instead of having two loops further down counting up or down + * make sure that first is always <= last and go with only one + * code path implementing all logic. */ if (first > last) { aux = first; From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 19:22:16 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D179106566B; Mon, 20 Oct 2008 19:22:16 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B5B88FC18; Mon, 20 Oct 2008 19:22:16 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KJMG0r079018; Mon, 20 Oct 2008 19:22:16 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KJMGnr079017; Mon, 20 Oct 2008 19:22:16 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200810201922.m9KJMGnr079017@svn.freebsd.org> From: Attilio Rao Date: Mon, 20 Oct 2008 19:22:16 +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: r184098 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 19:22:16 -0000 Author: attilio Date: Mon Oct 20 19:22:16 2008 New Revision: 184098 URL: http://svn.freebsd.org/changeset/base/184098 Log: In the actual code for witness_warn: - If there aren't spinlocks held, but there are problems with old sleeplocks, they are not reported. - If the spinlock found is not the only one, problems are not reported. Fix these 2 problems. Reported by: tegge Modified: head/sys/kern/subr_witness.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Mon Oct 20 18:56:00 2008 (r184097) +++ head/sys/kern/subr_witness.c Mon Oct 20 19:22:16 2008 (r184098) @@ -1628,13 +1628,7 @@ witness_warn(int flags, struct lock_obje */ sched_pin(); lock_list = PCPU_GET(spinlocks); - if (lock_list != NULL) { - - /* Empty list? */ - if (lock_list->ll_count == 0) { - sched_unpin(); - return (n); - } + if (lock_list != NULL && lock_list->ll_count != 0) { sched_unpin(); /* @@ -1644,18 +1638,17 @@ witness_warn(int flags, struct lock_obje * should hold. */ lock1 = &lock_list->ll_children[lock_list->ll_count - 1]; - if (lock1->li_lock == lock) - return (n); - - if (n == 0) { - va_start(ap, fmt); - vprintf(fmt, ap); - va_end(ap); - printf(" with the following"); - if (flags & WARN_SLEEPOK) - printf(" non-sleepable"); - printf(" locks held:\n"); - } + if (lock_list->ll_count == 1 && lock_list->ll_next == NULL && + lock1->li_lock == lock && n == 0) + return (0); + + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); + printf(" with the following"); + if (flags & WARN_SLEEPOK) + printf(" non-sleepable"); + printf(" locks held:\n"); n += witness_list_locks(&lock_list); } else sched_unpin(); From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 19:56:59 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBAF61065671; Mon, 20 Oct 2008 19:56:59 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA7478FC28; Mon, 20 Oct 2008 19:56:59 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KJux1J079634; Mon, 20 Oct 2008 19:56:59 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KJuxZG079633; Mon, 20 Oct 2008 19:56:59 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200810201956.m9KJuxZG079633@svn.freebsd.org> From: Attilio Rao Date: Mon, 20 Oct 2008 19:56:59 +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: r184099 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 19:57:00 -0000 Author: attilio Date: Mon Oct 20 19:56:59 2008 New Revision: 184099 URL: http://svn.freebsd.org/changeset/base/184099 Log: Bump __FreeBSD_version in order to reflect prototipes changes for these following functions: - bufobj_invalbuf() - bufsync() - vinvalbuf() - g_vfs_close and virtual function BO_SYNC(). Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Oct 20 19:22:16 2008 (r184098) +++ head/sys/sys/param.h Mon Oct 20 19:56:59 2008 (r184099) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 800049 /* Master, propagated to newvers */ +#define __FreeBSD_version 800050 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 20:00:34 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C69841065673; Mon, 20 Oct 2008 20:00:34 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B51418FC0C; Mon, 20 Oct 2008 20:00:34 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KK0YDa079753; Mon, 20 Oct 2008 20:00:34 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KK0Y7A079752; Mon, 20 Oct 2008 20:00:34 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200810202000.m9KK0Y7A079752@svn.freebsd.org> From: Attilio Rao Date: Mon, 20 Oct 2008 20:00: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: r184100 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 20:00:34 -0000 Author: attilio Date: Mon Oct 20 20:00:34 2008 New Revision: 184100 URL: http://svn.freebsd.org/changeset/base/184100 Log: Reflect changes into vinvalbuf(9) prototype. Modified: head/share/man/man9/vinvalbuf.9 Modified: head/share/man/man9/vinvalbuf.9 ============================================================================== --- head/share/man/man9/vinvalbuf.9 Mon Oct 20 19:56:59 2008 (r184099) +++ head/share/man/man9/vinvalbuf.9 Mon Oct 20 20:00:34 2008 (r184100) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 7, 2001 +.Dd October 20, 2008 .Dt VINVALBUF 9 .Os .Sh NAME @@ -36,7 +36,7 @@ .In sys/param.h .In sys/vnode.h .Ft int -.Fn vinvalbuf "struct vnode *vp" "int flags" "struct ucred *cred" "struct thread *td" "int slpflag" "int slptimeo" +.Fn vinvalbuf "struct vnode *vp" "int flags" "struct ucred *cred" "int slpflag" "int slptimeo" .Sh DESCRIPTION The .Fn vinvalbuf @@ -62,8 +62,6 @@ The user credentials that are used to buffers if .Dv V_SAVE is set. -.It Fa td -The thread responsible for this call. .It Fa slpflag The slp flag that will be used in the priority of any sleeps in the function. .It Fa slptimeo @@ -78,9 +76,9 @@ must be held by prior to the call and re A 0 value is returned on success. .Sh PSEUDOCODE .Bd -literal -offset indent -vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); -error = vinvalbuf(devvp, V_SAVE, cred, td, 0, 0); -VOP_UNLOCK(devvp, 0, td); +vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); +error = vinvalbuf(devvp, V_SAVE, cred, 0, 0); +VOP_UNLOCK(devvp, 0); if (error) return (error); .Ed From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 00:17:56 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9200D106566B; Tue, 21 Oct 2008 00:17:56 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F7788FC08; Tue, 21 Oct 2008 00:17:56 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9L0HuDG084150; Tue, 21 Oct 2008 00:17:56 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9L0HumB084142; Tue, 21 Oct 2008 00:17:56 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200810210017.m9L0HumB084142@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 21 Oct 2008 00:17: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: r184101 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 00:17:56 -0000 Author: jkim Date: Tue Oct 21 00:17:55 2008 New Revision: 184101 URL: http://svn.freebsd.org/changeset/base/184101 Log: Detect Advanced Power Management Information for AMD CPUs. Modified: head/sys/amd64/amd64/identcpu.c head/sys/amd64/amd64/initcpu.c head/sys/amd64/include/md_var.h head/sys/amd64/include/specialreg.h head/sys/i386/i386/identcpu.c head/sys/i386/i386/initcpu.c head/sys/i386/include/md_var.h head/sys/i386/include/specialreg.h Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Mon Oct 20 20:00:34 2008 (r184100) +++ head/sys/amd64/amd64/identcpu.c Tue Oct 21 00:17:55 2008 (r184101) @@ -451,6 +451,10 @@ identify_cpu(void) amd_feature = regs[3] & ~(cpu_feature & 0x0183f3ff); amd_feature2 = regs[2]; } + if (cpu_exthigh >= 0x80000007) { + do_cpuid(0x80000007, regs); + amd_pminfo = regs[3]; + } if (cpu_exthigh >= 0x80000008) { do_cpuid(0x80000008, regs); cpu_procinfo2 = regs[2]; Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Mon Oct 20 20:00:34 2008 (r184100) +++ head/sys/amd64/amd64/initcpu.c Tue Oct 21 00:17:55 2008 (r184101) @@ -53,6 +53,7 @@ u_int cpu_feature; /* Feature flags */ u_int cpu_feature2; /* Feature flags */ u_int amd_feature; /* AMD feature flags */ u_int amd_feature2; /* AMD feature flags */ +u_int amd_pminfo; /* AMD advanced power management info */ u_int cpu_high; /* Highest arg to CPUID */ u_int cpu_exthigh; /* Highest arg to extended CPUID */ u_int cpu_id; /* Stepping ID */ Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Mon Oct 20 20:00:34 2008 (r184100) +++ head/sys/amd64/include/md_var.h Tue Oct 21 00:17:55 2008 (r184101) @@ -44,6 +44,7 @@ extern u_int cpu_feature; extern u_int cpu_feature2; extern u_int amd_feature; extern u_int amd_feature2; +extern u_int amd_pminfo; extern u_int cpu_fxsr; extern u_int cpu_high; extern u_int cpu_id; Modified: head/sys/amd64/include/specialreg.h ============================================================================== --- head/sys/amd64/include/specialreg.h Mon Oct 20 20:00:34 2008 (r184100) +++ head/sys/amd64/include/specialreg.h Tue Oct 21 00:17:55 2008 (r184101) @@ -161,6 +161,19 @@ #define CPUID_LOCAL_APIC_ID 0xff000000 /* + * AMD extended function 8000_0007h edx info + */ +#define AMDPM_TS 0x00000001 +#define AMDPM_FID 0x00000002 +#define AMDPM_VID 0x00000004 +#define AMDPM_TTP 0x00000008 +#define AMDPM_TM 0x00000010 +#define AMDPM_STC 0x00000020 +#define AMDPM_100MHZ_STEPS 0x00000040 +#define AMDPM_HW_PSTATE 0x00000080 +#define AMDPM_TSC_INVARIANT 0x00000100 + +/* * AMD extended function 8000_0008h ecx info */ #define AMDID_CMP_CORES 0x000000ff Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Mon Oct 20 20:00:34 2008 (r184100) +++ head/sys/i386/i386/identcpu.c Tue Oct 21 00:17:55 2008 (r184101) @@ -1089,6 +1089,10 @@ finishidentcpu(void) amd_feature = regs[3] & ~(cpu_feature & 0x0183f3ff); amd_feature2 = regs[2]; } + if (cpu_exthigh >= 0x80000007) { + do_cpuid(0x80000007, regs); + amd_pminfo = regs[3]; + } if (cpu_exthigh >= 0x80000008) { do_cpuid(0x80000008, regs); cpu_procinfo2 = regs[2]; Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Mon Oct 20 20:00:34 2008 (r184100) +++ head/sys/i386/i386/initcpu.c Tue Oct 21 00:17:55 2008 (r184101) @@ -82,6 +82,7 @@ u_int cpu_feature = 0; /* Feature flags u_int cpu_feature2 = 0; /* Feature flags */ u_int amd_feature = 0; /* AMD feature flags */ u_int amd_feature2 = 0; /* AMD feature flags */ +u_int amd_pminfo = 0; /* AMD advanced power management info */ u_int via_feature_rng = 0; /* VIA RNG features */ u_int via_feature_xcrypt = 0; /* VIA ACE features */ u_int cpu_high = 0; /* Highest arg to CPUID */ Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Mon Oct 20 20:00:34 2008 (r184100) +++ head/sys/i386/include/md_var.h Tue Oct 21 00:17:55 2008 (r184101) @@ -49,6 +49,7 @@ extern u_int cpu_feature; extern u_int cpu_feature2; extern u_int amd_feature; extern u_int amd_feature2; +extern u_int amd_pminfo; extern u_int via_feature_rng; extern u_int via_feature_xcrypt; extern u_int cpu_fxsr; Modified: head/sys/i386/include/specialreg.h ============================================================================== --- head/sys/i386/include/specialreg.h Mon Oct 20 20:00:34 2008 (r184100) +++ head/sys/i386/include/specialreg.h Tue Oct 21 00:17:55 2008 (r184101) @@ -158,6 +158,19 @@ #define CPUID_LOCAL_APIC_ID 0xff000000 /* + * AMD extended function 8000_0007h edx info + */ +#define AMDPM_TS 0x00000001 +#define AMDPM_FID 0x00000002 +#define AMDPM_VID 0x00000004 +#define AMDPM_TTP 0x00000008 +#define AMDPM_TM 0x00000010 +#define AMDPM_STC 0x00000020 +#define AMDPM_100MHZ_STEPS 0x00000040 +#define AMDPM_HW_PSTATE 0x00000080 +#define AMDPM_TSC_INVARIANT 0x00000100 + +/* * AMD extended function 8000_0008h ecx info */ #define AMDID_CMP_CORES 0x000000ff From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 00:38:00 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D97201065672; Tue, 21 Oct 2008 00:38:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5B948FC0C; Tue, 21 Oct 2008 00:38:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9L0c0Nx084570; Tue, 21 Oct 2008 00:38:00 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9L0c0w1084560; Tue, 21 Oct 2008 00:38:00 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200810210038.m9L0c0w1084560@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 21 Oct 2008 00:38: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: r184102 - in head/sys: amd64/amd64 amd64/include contrib/altq/altq i386/i386 i386/include i386/isa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 00:38:01 -0000 Author: jkim Date: Tue Oct 21 00:38:00 2008 New Revision: 184102 URL: http://svn.freebsd.org/changeset/base/184102 Log: Turn off CPU frequency change notifiers when the TSC is P-state invariant or it is forced by setting 'kern.timecounter.invariant_tsc' tunable to non-zero. Modified: head/sys/amd64/amd64/identcpu.c head/sys/amd64/amd64/prof_machdep.c head/sys/amd64/amd64/tsc.c head/sys/amd64/include/clock.h head/sys/contrib/altq/altq/altq_subr.c head/sys/i386/i386/identcpu.c head/sys/i386/i386/tsc.c head/sys/i386/include/clock.h head/sys/i386/isa/prof_machdep.c Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Tue Oct 21 00:17:55 2008 (r184101) +++ head/sys/amd64/amd64/identcpu.c Tue Oct 21 00:38:00 2008 (r184102) @@ -347,6 +347,12 @@ printcpuinfo(void) "AuthenticAMD") == 0) cpu_feature &= ~CPUID_HTT; + if (!tsc_is_invariant && + (amd_pminfo & AMDPM_TSC_INVARIANT)) { + tsc_is_invariant = 1; + printf("\n P-state invariant TSC"); + } + /* * If this CPU supports HTT or CMP then mention the * number of physical/logical cores it contains. @@ -409,8 +415,11 @@ panicifcpuunsupported(void) static void tsc_freq_changed(void *arg, const struct cf_level *level, int status) { - /* If there was an error during the transition, don't do anything. */ - if (status != 0) + /* + * If there was an error during the transition or + * TSC is P-state invariant, don't do anything. + */ + if (status != 0 || tsc_is_invariant) return; /* Total setting for this level gives the new frequency in MHz. */ Modified: head/sys/amd64/amd64/prof_machdep.c ============================================================================== --- head/sys/amd64/amd64/prof_machdep.c Tue Oct 21 00:17:55 2008 (r184101) +++ head/sys/amd64/amd64/prof_machdep.c Tue Oct 21 00:38:00 2008 (r184102) @@ -383,8 +383,11 @@ static void tsc_freq_changed(void *arg, const struct cf_level *level, int status) { - /* If there was an error during the transition, don't do anything. */ - if (status != 0) + /* + * If there was an error during the transition or + * TSC is P-state invariant, don't do anything. + */ + if (status != 0 || tsc_is_invariant) return; if (cputime_prof_active && cputime_clock == CPUTIME_CLOCK_TSC) printf("warning: cpu freq changed while profiling active\n"); Modified: head/sys/amd64/amd64/tsc.c ============================================================================== --- head/sys/amd64/amd64/tsc.c Tue Oct 21 00:17:55 2008 (r184101) +++ head/sys/amd64/amd64/tsc.c Tue Oct 21 00:38:00 2008 (r184102) @@ -48,8 +48,13 @@ __FBSDID("$FreeBSD$"); uint64_t tsc_freq; int tsc_is_broken; +int tsc_is_invariant; static eventhandler_tag tsc_levels_tag, tsc_pre_tag, tsc_post_tag; +SYSCTL_INT(_kern_timecounter, OID_AUTO, invariant_tsc, CTLFLAG_RDTUN, + &tsc_is_invariant, 0, "Indicates whether the TSC is P-state invariant"); +TUNABLE_INT("kern.timecounter.invariant_tsc", &tsc_is_invariant); + #ifdef SMP static int smp_tsc; SYSCTL_INT(_kern_timecounter, OID_AUTO, smp_tsc, CTLFLAG_RDTUN, &smp_tsc, 0, @@ -174,11 +179,12 @@ static void tsc_freq_changing(void *arg, const struct cf_level *level, int *status) { - if (*status != 0 || timecounter != &tsc_timecounter) + if (*status != 0 || timecounter != &tsc_timecounter || + tsc_is_invariant) return; printf("timecounter TSC must not be in use when " - "changing frequencies; change denied\n"); + "changing frequencies; change denied\n"); *status = EBUSY; } @@ -186,8 +192,11 @@ tsc_freq_changing(void *arg, const struc static void tsc_freq_changed(void *arg, const struct cf_level *level, int status) { - /* If there was an error during the transition, don't do anything. */ - if (status != 0) + /* + * If there was an error during the transition or + * TSC is P-state invariant, don't do anything. + */ + if (status != 0 || tsc_is_invariant) return; /* Total setting for this level gives the new frequency in MHz. */ Modified: head/sys/amd64/include/clock.h ============================================================================== --- head/sys/amd64/include/clock.h Tue Oct 21 00:17:55 2008 (r184101) +++ head/sys/amd64/include/clock.h Tue Oct 21 00:38:00 2008 (r184102) @@ -20,6 +20,7 @@ extern u_int i8254_freq; extern int i8254_max_count; extern uint64_t tsc_freq; extern int tsc_is_broken; +extern int tsc_is_invariant; void i8254_init(void); Modified: head/sys/contrib/altq/altq/altq_subr.c ============================================================================== --- head/sys/contrib/altq/altq/altq_subr.c Tue Oct 21 00:17:55 2008 (r184101) +++ head/sys/contrib/altq/altq/altq_subr.c Tue Oct 21 00:38:00 2008 (r184102) @@ -909,6 +909,12 @@ tsc_freq_changed(void *arg, const struct if (status != 0) return; +#if (__FreeBSD_version >= 800050) && (defined(__amd64__) || defined(__i386__)) + /* If TSC is P-state invariant, don't do anything. */ + if (tsc_is_invariant) + return; +#endif + /* Total setting for this level gives the new frequency in MHz. */ init_machclk(); } Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Tue Oct 21 00:17:55 2008 (r184101) +++ head/sys/i386/i386/identcpu.c Tue Oct 21 00:38:00 2008 (r184102) @@ -841,6 +841,12 @@ printcpuinfo(void) "AuthenticAMD") == 0) cpu_feature &= ~CPUID_HTT; + if (!tsc_is_invariant && + (amd_pminfo & AMDPM_TSC_INVARIANT)) { + tsc_is_invariant = 1; + printf("\n P-state invariant TSC"); + } + /* * If this CPU supports HTT or CMP then mention the * number of physical/logical cores it contains. @@ -1059,8 +1065,11 @@ identifycyrix(void) static void tsc_freq_changed(void *arg, const struct cf_level *level, int status) { - /* If there was an error during the transition, don't do anything. */ - if (status != 0) + /* + * If there was an error during the transition or + * TSC is P-state invariant, don't do anything. + */ + if (status != 0 || tsc_is_invariant) return; /* Total setting for this level gives the new frequency in MHz. */ Modified: head/sys/i386/i386/tsc.c ============================================================================== --- head/sys/i386/i386/tsc.c Tue Oct 21 00:17:55 2008 (r184101) +++ head/sys/i386/i386/tsc.c Tue Oct 21 00:38:00 2008 (r184102) @@ -48,9 +48,13 @@ __FBSDID("$FreeBSD$"); uint64_t tsc_freq; int tsc_is_broken; +int tsc_is_invariant; u_int tsc_present; static eventhandler_tag tsc_levels_tag, tsc_pre_tag, tsc_post_tag; +SYSCTL_INT(_kern_timecounter, OID_AUTO, invariant_tsc, CTLFLAG_RDTUN, + &tsc_is_invariant, 0, "Indicates the TSC is P-state invariant"); + #ifdef SMP static int smp_tsc; SYSCTL_INT(_kern_timecounter, OID_AUTO, smp_tsc, CTLFLAG_RDTUN, &smp_tsc, 0, @@ -107,8 +111,9 @@ init_TSC(void) set_cputicker(rdtsc, tsc_freq, 1); /* Register to find out about changes in CPU frequency. */ - tsc_pre_tag = EVENTHANDLER_REGISTER(cpufreq_pre_change, - tsc_freq_changing, NULL, EVENTHANDLER_PRI_FIRST); + if (!tsc_is_invariant) + tsc_pre_tag = EVENTHANDLER_REGISTER(cpufreq_pre_change, + tsc_freq_changing, NULL, EVENTHANDLER_PRI_FIRST); tsc_post_tag = EVENTHANDLER_REGISTER(cpufreq_post_change, tsc_freq_changed, NULL, EVENTHANDLER_PRI_FIRST); tsc_levels_tag = EVENTHANDLER_REGISTER(cpufreq_levels_changed, @@ -198,11 +203,12 @@ static void tsc_freq_changing(void *arg, const struct cf_level *level, int *status) { - if (*status != 0 || timecounter != &tsc_timecounter) + if (*status != 0 || timecounter != &tsc_timecounter || + tsc_is_invariant) return; printf("timecounter TSC must not be in use when " - "changing frequencies; change denied\n"); + "changing frequencies; change denied\n"); *status = EBUSY; } @@ -210,8 +216,11 @@ tsc_freq_changing(void *arg, const struc static void tsc_freq_changed(void *arg, const struct cf_level *level, int status) { - /* If there was an error during the transition, don't do anything. */ - if (status != 0) + /* + * If there was an error during the transition or + * TSC is P-state invariant, don't do anything. + */ + if (status != 0 || tsc_is_invariant) return; /* Total setting for this level gives the new frequency in MHz. */ Modified: head/sys/i386/include/clock.h ============================================================================== --- head/sys/i386/include/clock.h Tue Oct 21 00:17:55 2008 (r184101) +++ head/sys/i386/include/clock.h Tue Oct 21 00:38:00 2008 (r184102) @@ -20,6 +20,7 @@ extern u_int i8254_freq; extern int i8254_max_count; extern uint64_t tsc_freq; extern int tsc_is_broken; +extern int tsc_is_invariant; void i8254_init(void); Modified: head/sys/i386/isa/prof_machdep.c ============================================================================== --- head/sys/i386/isa/prof_machdep.c Tue Oct 21 00:17:55 2008 (r184101) +++ head/sys/i386/isa/prof_machdep.c Tue Oct 21 00:38:00 2008 (r184102) @@ -353,8 +353,11 @@ static void tsc_freq_changed(void *arg, const struct cf_level *level, int status) { - /* If there was an error during the transition, don't do anything. */ - if (status != 0) + /* + * If there was an error during the transition or + * TSC is P-state invariant, don't do anything. + */ + if (status != 0 || tsc_is_invariant) return; if (cputime_prof_active && cputime_clock == CPUTIME_CLOCK_TSC) printf("warning: cpu freq changed while profiling active\n"); From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 00:44:06 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16C5910656AB; Tue, 21 Oct 2008 00:44:06 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 056EE8FC20; Tue, 21 Oct 2008 00:44:06 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9L0i58E084713; Tue, 21 Oct 2008 00:44:05 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9L0i58V084712; Tue, 21 Oct 2008 00:44:05 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200810210044.m9L0i58V084712@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 21 Oct 2008 00:44: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: r184103 - head/sys/i386/cpufreq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 00:44:06 -0000 Author: jkim Date: Tue Oct 21 00:44:05 2008 New Revision: 184103 URL: http://svn.freebsd.org/changeset/base/184103 Log: Use power management information for AMD CPUs from identcpu.c. Modified: head/sys/i386/cpufreq/powernow.c Modified: head/sys/i386/cpufreq/powernow.c ============================================================================== --- head/sys/i386/cpufreq/powernow.c Tue Oct 21 00:38:00 2008 (r184102) +++ head/sys/i386/cpufreq/powernow.c Tue Oct 21 00:44:05 2008 (r184103) @@ -758,22 +758,6 @@ pn_decode_pst(device_t dev) return (ENODEV); } -/* - * TODO: this should be done in sys/ARCH/ARCH/identcpu.c - */ -static int -cpu_is_powernow_capable(void) -{ - u_int regs[4]; - - if (strcmp(cpu_vendor, "AuthenticAMD") != 0 || - cpu_exthigh < 0x80000007) - return (FALSE); - - do_cpuid(0x80000007, regs); - return (regs[3] & 0x6); -} - static int pn_decode_acpi(device_t dev, device_t perf_dev) { @@ -883,7 +867,7 @@ pn_identify(driver_t *driver, device_t p { device_t child; - if (cpu_is_powernow_capable() == 0) + if ((amd_pminfo & (AMDPM_FID | AMDPM_VID)) == 0) return; switch (cpu_id & 0xf00) { case 0x600: From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 00:52:21 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57D59106566C; Tue, 21 Oct 2008 00:52:21 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 468A48FC1E; Tue, 21 Oct 2008 00:52:21 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9L0qKkS084871; Tue, 21 Oct 2008 00:52:20 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9L0qKlV084870; Tue, 21 Oct 2008 00:52:20 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200810210052.m9L0qKlV084870@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 21 Oct 2008 00:52: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: r184104 - head/sys/i386/cpufreq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 00:52:21 -0000 Author: jkim Date: Tue Oct 21 00:52:20 2008 New Revision: 184104 URL: http://svn.freebsd.org/changeset/base/184104 Log: Do not use PowerNow! if FID or VID is missing. Modified: head/sys/i386/cpufreq/powernow.c Modified: head/sys/i386/cpufreq/powernow.c ============================================================================== --- head/sys/i386/cpufreq/powernow.c Tue Oct 21 00:44:05 2008 (r184103) +++ head/sys/i386/cpufreq/powernow.c Tue Oct 21 00:52:20 2008 (r184104) @@ -867,7 +867,7 @@ pn_identify(driver_t *driver, device_t p { device_t child; - if ((amd_pminfo & (AMDPM_FID | AMDPM_VID)) == 0) + if ((amd_pminfo & AMDPM_FID) == 0 || (amd_pminfo & AMDPM_VID) == 0) return; switch (cpu_id & 0xf00) { case 0x600: From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 01:08:23 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 59AF41065671; Tue, 21 Oct 2008 01:08:22 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Mon, 20 Oct 2008 21:08:03 -0400 User-Agent: KMail/1.6.2 References: <200810210038.m9L0c0w1084560@svn.freebsd.org> In-Reply-To: <200810210038.m9L0c0w1084560@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200810202108.08496.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r184102 - in head/sys: amd64/amd64 amd64/include contrib/altq/altq i386/i386 i386/include i386/isa X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 01:08:23 -0000 On Monday 20 October 2008 08:38 pm, Jung-uk Kim wrote: > Author: jkim > Date: Tue Oct 21 00:38:00 2008 > New Revision: 184102 > URL: http://svn.freebsd.org/changeset/base/184102 > > Log: > Turn off CPU frequency change notifiers when the TSC is P-state > invariant or it is forced by setting > 'kern.timecounter.invariant_tsc' tunable to non-zero. I believe recent Intel CPUs also have P-state invariant TSCs and I saw some people reported issues with them as well. In fact, I bought a new AMD CPU and it has P-state invariant TSC. But the CPU ID wasn't set. I heard BIOS wouldn't set it if all cores are not synchronized. So, I had to force it with the tunable. :-( Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 01:31:36 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5238106566B; Tue, 21 Oct 2008 01:31:36 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D1E8B8FC08; Tue, 21 Oct 2008 01:31:36 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from apple.my.domain (root@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id m9L1VYxc058237; Tue, 21 Oct 2008 01:31:35 GMT (envelope-from davidxu@freebsd.org) Message-ID: <48FD3165.2040900@freebsd.org> Date: Tue, 21 Oct 2008 09:33:25 +0800 From: David Xu User-Agent: Thunderbird 2.0.0.9 (X11/20080612) MIME-Version: 1.0 To: Kostik Belousov References: <200810200237.m9K2brwF058086@svn.freebsd.org> <20081020112225.GX7782@deviant.kiev.zoral.com.ua> In-Reply-To: <20081020112225.GX7782@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184067 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 01:31:37 -0000 Kostik Belousov wrote: > On Mon, Oct 20, 2008 at 02:37:53AM +0000, David Xu wrote: >> Author: davidxu >> Date: Mon Oct 20 02:37:53 2008 >> New Revision: 184067 >> URL: http://svn.freebsd.org/changeset/base/184067 >> >> Log: >> In realtimer_delete(), clear timer's value and interval to tell >> realtimer_expire() to not rearm the timer, otherwise there is a chance >> that a callout will be left there and be tiggered in future unexpectly. >> >> Bug reported by: tegge@ >> >> Modified: >> head/sys/kern/kern_time.c > Do you plan to MFC this to RELENG_7 ? This seems as a nice fix to have > in upcoming 7.1. Yes, planned. From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 01:41:31 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CB971065670; Tue, 21 Oct 2008 01:41:31 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id C620E8FC0A; Tue, 21 Oct 2008 01:41:30 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id ECE5828454; Tue, 21 Oct 2008 09:41:29 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 820EDEB295A; Tue, 21 Oct 2008 09:41:29 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id 5FSrbRX+uf1L; Tue, 21 Oct 2008 09:41:24 +0800 (CST) Received: from charlie.delphij.net (adsl-76-237-33-62.dsl.pltn13.sbcglobal.net [76.237.33.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 433C0EB28F5; Tue, 21 Oct 2008 09:41:19 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=gNolUO8W+xtp6U1KohhykTz4usO1U26JssUL6LFFH+w1Q3kq+HRoabPdQSrYzQOtq 3C6Xbaa4O90tRbyh9raeA== Message-ID: <48FD333A.5040902@delphij.net> Date: Mon, 20 Oct 2008 18:41:14 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.17 (X11/20080928) MIME-Version: 1.0 To: Dag-Erling Smorgrav References: <200810201704.m9KH4vfj076017@svn.freebsd.org> In-Reply-To: <200810201704.m9KH4vfj076017@svn.freebsd.org> X-Enigmail-Version: 0.95.7 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc 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: r184085 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 01:41:31 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dag-Erling Smorgrav wrote: > Author: des > Date: Mon Oct 20 17:04:57 2008 > New Revision: 184085 > URL: http://svn.freebsd.org/changeset/base/184085 > > Log: > Unbreak > > Modified: > head/lib/libutil/login_times.c [...] > @@ -72,9 +72,10 @@ parse_lt(const char * str) > char buf[64]; > > /* Make local copy and force lowercase to simplify parsing */ > - p = strlcpy(buf, str, sizeof buf); > + strlcpy(buf, str, sizeof buf); > for (i = 0; buf[i]; i++) > buf[i] = (char)tolower(buf[i]); > + p = buf; > > while (isalpha(*p)) { > My pointyhat. Sorry for the breakage and thanks for fixing it! Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkj9MzkACgkQi+vbBBjt66CZ1wCfW2xEAA1kUm/nGYd3CE2Svr8k I1EAnjMwTemKOqgyYgY+uGarBd09kVm9 =rfcb -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 02:11:59 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2867D1065680 for ; Tue, 21 Oct 2008 02:11:59 +0000 (UTC) (envelope-from unixmania@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by mx1.freebsd.org (Postfix) with ESMTP id AAF5D8FC08 for ; Tue, 21 Oct 2008 02:11:58 +0000 (UTC) (envelope-from unixmania@gmail.com) Received: by ey-out-2122.google.com with SMTP id 6so653597eyi.7 for ; Mon, 20 Oct 2008 19:11:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=0evDHRfuZOVU9UZ6fpPEY0w4O81oimZuHs3/b0bHn9Y=; b=dX18z+xO5UP5z9fxWyIo0x7NsW9SAcD8SAkXUZ+G9FAvsUxgptTbVHFwdUqpwvaaCR 9I2l+Z/OAwCdKww6QVkuG+7WmqNOifmEU9/UL2Q8DuINgsJ2xlwkgRo29rgTygJiozll i1DSkn6QySZO5muo7Y1ZC2+kmjlVz5PUriRAI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=O7u63p4+nQ5Upgnvr630UGRbmY3cj+3m1gY3YFRhbutO5mNIltMPbQROY8e2rre1FN 1SWq4T1EbArTJKn1qme+XuwVrcHattVl9aO4cvg0cmqxYCgdN+woXothcG5CG/94WlZY W/GSouJmjKrisycVyuHw+4Jb6CQzEG5mI94kI= Received: by 10.103.192.2 with SMTP id u2mr847790mup.13.1224553485419; Mon, 20 Oct 2008 18:44:45 -0700 (PDT) Received: by 10.103.231.14 with HTTP; Mon, 20 Oct 2008 18:44:45 -0700 (PDT) Message-ID: Date: Mon, 20 Oct 2008 23:44:45 -0200 From: "Carlos A. M. dos Santos" To: "Jung-uk Kim" In-Reply-To: <200810210017.m9L0HumB084142@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200810210017.m9L0HumB084142@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184101 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 02:11:59 -0000 On Mon, Oct 20, 2008 at 10:17 PM, Jung-uk Kim wrote: > Author: jkim > Date: Tue Oct 21 00:17:55 2008 > New Revision: 184101 > URL: http://svn.freebsd.org/changeset/base/184101 > > Log: > Detect Advanced Power Management Information for AMD CPUs. Are there any plans to enable the APM API too? I ask because there is at least one port (xfce4-battery-plugin) in which it was necessary to disable APM support on AMD, relying on ACPI only. -- cd /usr/ports/sysutils/life make clean From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 03:16:50 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8D1B1065682; Tue, 21 Oct 2008 03:16:50 +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 C7D978FC16; Tue, 21 Oct 2008 03:16:50 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9L3Goh7087643; Tue, 21 Oct 2008 03:16:50 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9L3GoxB087642; Tue, 21 Oct 2008 03:16:50 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <200810210316.m9L3GoxB087642@svn.freebsd.org> From: Kevin Lo Date: Tue, 21 Oct 2008 03:16: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: r184106 - head/sys/dev/age X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 03:16:51 -0000 Author: kevlo Date: Tue Oct 21 03:16:50 2008 New Revision: 184106 URL: http://svn.freebsd.org/changeset/base/184106 Log: No need to sync descriptors twice in age_rxintr() Modified: head/sys/dev/age/if_age.c Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Tue Oct 21 02:47:59 2008 (r184105) +++ head/sys/dev/age/if_age.c Tue Oct 21 03:16:50 2008 (r184106) @@ -2478,9 +2478,6 @@ age_rxintr(struct age_softc *sc, int rr_ bus_dmamap_sync(sc->age_cdata.age_rr_ring_tag, sc->age_cdata.age_rr_ring_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - bus_dmamap_sync(sc->age_cdata.age_rx_ring_tag, - sc->age_cdata.age_rx_ring_map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); for (prog = 0; rr_cons != rr_prod; prog++) { if (count <= 0) @@ -2513,9 +2510,6 @@ age_rxintr(struct age_softc *sc, int rr_ sc->age_cdata.age_rr_cons = rr_cons; /* Sync descriptors. */ - bus_dmamap_sync(sc->age_cdata.age_rx_ring_tag, - sc->age_cdata.age_rx_ring_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); bus_dmamap_sync(sc->age_cdata.age_rr_ring_tag, sc->age_cdata.age_rr_ring_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 03:18:02 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8888A106567E; Tue, 21 Oct 2008 03:18:02 +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 5EA9C8FC0A; Tue, 21 Oct 2008 03:18:02 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9L3I2Qs087703; Tue, 21 Oct 2008 03:18:02 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9L3I2ar087702; Tue, 21 Oct 2008 03:18:02 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <200810210318.m9L3I2ar087702@svn.freebsd.org> From: Kevin Lo Date: Tue, 21 Oct 2008 03:18: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: r184107 - head/sys/dev/age X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 03:18:02 -0000 Author: kevlo Date: Tue Oct 21 03:18:02 2008 New Revision: 184107 URL: http://svn.freebsd.org/changeset/base/184107 Log: Remove unused age_txdq Modified: head/sys/dev/age/if_agevar.h Modified: head/sys/dev/age/if_agevar.h ============================================================================== --- head/sys/dev/age/if_agevar.h Tue Oct 21 03:16:50 2008 (r184106) +++ head/sys/dev/age/if_agevar.h Tue Oct 21 03:18:02 2008 (r184107) @@ -68,8 +68,6 @@ struct age_txdesc { struct tx_desc *tx_desc; }; -STAILQ_HEAD(age_txdq, age_txdesc); - struct age_rxdesc { struct mbuf *rx_m; bus_dmamap_t rx_dmamap; From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 04:31:08 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A985106567C; Tue, 21 Oct 2008 04:31:08 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 095198FC20; Tue, 21 Oct 2008 04:31:08 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9L4V77S088979; Tue, 21 Oct 2008 04:31:07 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9L4V7Pb088978; Tue, 21 Oct 2008 04:31:07 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200810210431.m9L4V7Pb088978@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 21 Oct 2008 04:31: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: r184108 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 04:31:08 -0000 Author: jkim Date: Tue Oct 21 04:31:07 2008 New Revision: 184108 URL: http://svn.freebsd.org/changeset/base/184108 Log: Fix 'kern.timeconter.invariant_tsc' tunable and back out a redundant hack. Somehow incomplete version was committed. :-( Modified: head/sys/i386/i386/tsc.c Modified: head/sys/i386/i386/tsc.c ============================================================================== --- head/sys/i386/i386/tsc.c Tue Oct 21 03:18:02 2008 (r184107) +++ head/sys/i386/i386/tsc.c Tue Oct 21 04:31:07 2008 (r184108) @@ -53,7 +53,8 @@ u_int tsc_present; static eventhandler_tag tsc_levels_tag, tsc_pre_tag, tsc_post_tag; SYSCTL_INT(_kern_timecounter, OID_AUTO, invariant_tsc, CTLFLAG_RDTUN, - &tsc_is_invariant, 0, "Indicates the TSC is P-state invariant"); + &tsc_is_invariant, 0, "Indicates whether the TSC is P-state invariant"); +TUNABLE_INT("kern.timecounter.invariant_tsc", &tsc_is_invariant); #ifdef SMP static int smp_tsc; @@ -111,9 +112,8 @@ init_TSC(void) set_cputicker(rdtsc, tsc_freq, 1); /* Register to find out about changes in CPU frequency. */ - if (!tsc_is_invariant) - tsc_pre_tag = EVENTHANDLER_REGISTER(cpufreq_pre_change, - tsc_freq_changing, NULL, EVENTHANDLER_PRI_FIRST); + tsc_pre_tag = EVENTHANDLER_REGISTER(cpufreq_pre_change, + tsc_freq_changing, NULL, EVENTHANDLER_PRI_FIRST); tsc_post_tag = EVENTHANDLER_REGISTER(cpufreq_post_change, tsc_freq_changed, NULL, EVENTHANDLER_PRI_FIRST); tsc_levels_tag = EVENTHANDLER_REGISTER(cpufreq_levels_changed, From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 05:08:35 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E102106567C; Tue, 21 Oct 2008 05:08:35 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BA4A8FC1B; Tue, 21 Oct 2008 05:08:35 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9L58ZLg089723; Tue, 21 Oct 2008 05:08:35 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9L58Z4W089720; Tue, 21 Oct 2008 05:08:35 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200810210508.m9L58Z4W089720@svn.freebsd.org> From: Tim Kientzle Date: Tue, 21 Oct 2008 05:08:35 +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: r184109 - in head/lib/libarchive: . test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 05:08:35 -0000 Author: kientzle Date: Tue Oct 21 05:08:35 2008 New Revision: 184109 URL: http://svn.freebsd.org/changeset/base/184109 Log: If we don't know the file size, leave the file size unset. If it's not a regular file, don't return any data, even if the size is unknown. Update the Zip test with a hand-tweaked Zip archive that has a directory (with length-at-end set), a regular file without length-at-end set, and a regular file with length-at-end set and a bad CRC. Update the test code to verify that the file size is unset for the regular file with length-at-end. MFC after: 7 days Modified: head/lib/libarchive/archive_read_support_format_zip.c head/lib/libarchive/test/test_read_format_zip.c head/lib/libarchive/test/test_read_format_zip.zip.uu Modified: head/lib/libarchive/archive_read_support_format_zip.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_zip.c Tue Oct 21 04:31:07 2008 (r184108) +++ head/lib/libarchive/archive_read_support_format_zip.c Tue Oct 21 05:08:35 2008 (r184109) @@ -444,7 +444,9 @@ zip_read_file_header(struct archive_read archive_entry_set_mtime(entry, zip->mtime, 0); archive_entry_set_ctime(entry, zip->ctime, 0); archive_entry_set_atime(entry, zip->atime, 0); - archive_entry_set_size(entry, zip->uncompressed_size); + /* Set the size only if it's meaningful. */ + if (0 == (zip->flags & ZIP_LENGTH_AT_END)) + archive_entry_set_size(entry, zip->uncompressed_size); zip->entry_bytes_remaining = zip->compressed_size; zip->entry_offset = 0; @@ -573,12 +575,16 @@ archive_read_format_zip_read_data(struct } break; } + if (r != ARCHIVE_OK) + return (r); /* Update checksum */ - if (r == ARCHIVE_OK && *size) { + if (*size) zip->entry_crc32 = crc32(zip->entry_crc32, *buff, *size); - } - return (r); + /* Return EOF immediately if this is a non-regular file. */ + if (AE_IFREG != (zip->mode & AE_IFMT)) + return (ARCHIVE_EOF); + return (ARCHIVE_OK); } /* Modified: head/lib/libarchive/test/test_read_format_zip.c ============================================================================== --- head/lib/libarchive/test/test_read_format_zip.c Tue Oct 21 04:31:07 2008 (r184108) +++ head/lib/libarchive/test/test_read_format_zip.c Tue Oct 21 05:08:35 2008 (r184109) @@ -25,6 +25,12 @@ #include "test.h" __FBSDID("$FreeBSD$"); +/* + * The reference file for this has been manually tweaked so that: + * * file2 has length-at-end but file1 does not + * * file2 has an invalid CRC + */ + DEFINE_TEST(test_read_format_zip) { const char *refname = "test_read_format_zip.zip"; @@ -57,7 +63,8 @@ DEFINE_TEST(test_read_format_zip) assertA(0 == archive_read_next_header(a, &ae)); assertEqualString("file2", archive_entry_pathname(ae)); assertEqualInt(1179605932, archive_entry_mtime(ae)); - assertEqualInt(18, archive_entry_size(ae)); + failure("file2 has length-at-end, so we shouldn't see a valid size"); + assertEqualInt(0, archive_entry_size_is_set(ae)); failure("file2 has a bad CRC, so reading to end should fail"); assertEqualInt(ARCHIVE_WARN, archive_read_data(a, buff, 19)); assert(0 == memcmp(buff, "hello\nhello\nhello\n", 18)); Modified: head/lib/libarchive/test/test_read_format_zip.zip.uu ============================================================================== --- head/lib/libarchive/test/test_read_format_zip.zip.uu Tue Oct 21 04:31:07 2008 (r184108) +++ head/lib/libarchive/test/test_read_format_zip.zip.uu Tue Oct 21 05:08:35 2008 (r184109) @@ -1,13 +1,14 @@ $FreeBSD$ begin 644 test_read_format_zip.zip -M4$L#!`H``````%EFLS8````````````````$`!4`9&ER+U54"0`#&55/1AE5 -M3T95>`0`Z`/H`U!+`P04````"`!O9K,V.C=F/0H````2````!0`5`&9I;&4Q -M550)``-!54]&K%M/1E5X!`#H`^@#RTC-R%8T$@H````2````!0`5`&9I;&4R550)``.L6T]&K%M/1E5X!`#H`^@#RTC- -MR%8T$@H````2````!0`-```````!````I(%Y```` -H9FEL93)55`4``ZQ;3T95>```4$L%!@`````#``,`OP```+L````````` +M4$L#!`H`"````%EFLS8````````````````$`!4`9&ER+U54"0`#&55/1M19 +M_4A5>`0`Z`/H`U!+!P@```````````````!02P,$%`````@`;V:S-CHW9CT* +M````$@````4`%0!F:6QE,554"0`#055/1L!9_4A5>`0`Z`/H`\M(S`0`Z`/H`\M(S```4$L!`A<#%``(``@`;V:S-CHW9CT*````$@````4`#0`` +M`````0```.V!1P```&9I;&4Q550%``-!54]&57@``%!+`0(7`Q0`"``(`%IJ +MLS8Z-V8]"@```!(````%``T```````$```#M@8D```!F:6QE,E54!0`#K%M/ +;1E5X``!02P4&``````,``P"_````VP`````` ` end From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 06:38:05 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 915E0106566C; Tue, 21 Oct 2008 06:38:05 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E6D08FC14; Tue, 21 Oct 2008 06:38:05 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9L6c5d7091258; Tue, 21 Oct 2008 06:38:05 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9L6c5wN091251; Tue, 21 Oct 2008 06:38:05 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200810210638.m9L6c5wN091251@svn.freebsd.org> From: Kip Macy Date: Tue, 21 Oct 2008 06:38: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: r184110 - in head/sys/i386/include: . xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 06:38:05 -0000 Author: kmacy Date: Tue Oct 21 06:38:05 2008 New Revision: 184110 URL: http://svn.freebsd.org/changeset/base/184110 Log: Header cleanups and addition of IPI declarations for xen Modified: head/sys/i386/include/apicvar.h head/sys/i386/include/smp.h head/sys/i386/include/xen/evtchn.h head/sys/i386/include/xen/xen-os.h head/sys/i386/include/xen/xen_intr.h head/sys/i386/include/xen/xenfunc.h Modified: head/sys/i386/include/apicvar.h ============================================================================== --- head/sys/i386/include/apicvar.h Tue Oct 21 05:08:35 2008 (r184109) +++ head/sys/i386/include/apicvar.h Tue Oct 21 06:38:05 2008 (r184110) @@ -113,6 +113,17 @@ #define APIC_THERMAL_INT (APIC_LOCAL_INTS + 1) #define APIC_IPI_INTS (APIC_LOCAL_INTS + 2) +#ifdef XEN +#define IPI_RENDEZVOUS (0) /* Inter-CPU rendezvous. */ +#define IPI_INVLTLB (1) /* TLB Shootdown IPIs */ +#define IPI_INVLPG (2) +#define IPI_INVLRNG (3) +#define IPI_INVLCACHE (4) +#define IPI_LAZYPMAP (5) /* Lazy pmap release. */ +/* Vector to handle bitmap based IPIs */ +#define IPI_BITMAP_VECTOR (6) + +#else #define IPI_RENDEZVOUS (APIC_IPI_INTS) /* Inter-CPU rendezvous. */ #define IPI_INVLTLB (APIC_IPI_INTS + 1) /* TLB Shootdown IPIs */ #define IPI_INVLPG (APIC_IPI_INTS + 2) @@ -121,6 +132,7 @@ #define IPI_LAZYPMAP (APIC_IPI_INTS + 5) /* Lazy pmap release. */ /* Vector to handle bitmap based IPIs */ #define IPI_BITMAP_VECTOR (APIC_IPI_INTS + 6) +#endif /* IPIs handled by IPI_BITMAPED_VECTOR (XXX ups is there a better place?) */ #define IPI_AST 0 /* Generate software trap. */ Modified: head/sys/i386/include/smp.h ============================================================================== --- head/sys/i386/include/smp.h Tue Oct 21 05:08:35 2008 (r184109) +++ head/sys/i386/include/smp.h Tue Oct 21 06:38:05 2008 (r184110) @@ -83,6 +83,11 @@ int ipi_nmi_handler(void); #endif #ifdef XEN void ipi_to_irq_init(void); + +#define RESCHEDULE_VECTOR 0 +#define CALL_FUNCTION_VECTOR 1 +#define NR_IPIS 2 + #endif #endif /* !LOCORE */ #endif /* SMP */ Modified: head/sys/i386/include/xen/evtchn.h ============================================================================== --- head/sys/i386/include/xen/evtchn.h Tue Oct 21 05:08:35 2008 (r184109) +++ head/sys/i386/include/xen/evtchn.h Tue Oct 21 06:38:05 2008 (r184110) @@ -37,13 +37,24 @@ void mask_evtchn(int port); void unmask_evtchn(int port); +#ifdef SMP +void rebind_evtchn_to_cpu(int port, unsigned int cpu); +#else +#define rebind_evtchn_to_cpu(port, cpu) ((void)0) +#endif +static inline +int test_and_set_evtchn_mask(int port) +{ + shared_info_t *s = HYPERVISOR_shared_info; + return synch_test_and_set_bit(port, s->evtchn_mask); +} static inline void clear_evtchn(int port) { - shared_info_t *s = HYPERVISOR_shared_info; - synch_clear_bit(port, &s->evtchn_pending[0]); + shared_info_t *s = HYPERVISOR_shared_info; + synch_clear_bit(port, &s->evtchn_pending[0]); } static inline void Modified: head/sys/i386/include/xen/xen-os.h ============================================================================== --- head/sys/i386/include/xen/xen-os.h Tue Oct 21 05:08:35 2008 (r184109) +++ head/sys/i386/include/xen/xen-os.h Tue Oct 21 06:38:05 2008 (r184110) @@ -98,12 +98,6 @@ void printk(const char *fmt, ...); /* some function prototypes */ void trap_init(void); -extern int preemptable; -#define preempt_disable() (preemptable = 0) -#define preempt_enable() (preemptable = 1) -#define preempt_enable_no_resched() (preemptable = 1) - - /* * STI/CLI equivalents. These basically set and clear the virtual * event_enable flag in teh shared_info structure. Note that when @@ -115,10 +109,8 @@ extern int preemptable; #define __cli() \ do { \ vcpu_info_t *_vcpu; \ - preempt_disable(); \ _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ _vcpu->evtchn_upcall_mask = 1; \ - preempt_enable_no_resched(); \ barrier(); \ } while (0) @@ -126,36 +118,23 @@ do { do { \ vcpu_info_t *_vcpu; \ barrier(); \ - preempt_disable(); \ _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ _vcpu->evtchn_upcall_mask = 0; \ barrier(); /* unmask then check (avoid races) */ \ if ( unlikely(_vcpu->evtchn_upcall_pending) ) \ force_evtchn_callback(); \ - preempt_enable(); \ -} while (0) - - -#define __save_flags(x) \ -do { \ - vcpu_info_t *vcpu; \ - vcpu = HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ - (x) = _vcpu->evtchn_upcall_mask; \ } while (0) #define __restore_flags(x) \ do { \ vcpu_info_t *_vcpu; \ barrier(); \ - preempt_disable(); \ _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ if ((_vcpu->evtchn_upcall_mask = (x)) == 0) { \ barrier(); /* unmask then check (avoid races) */ \ if ( unlikely(_vcpu->evtchn_upcall_pending) ) \ force_evtchn_callback(); \ - preempt_enable(); \ - } else \ - preempt_enable_no_resched(); \ + } \ } while (0) /* Modified: head/sys/i386/include/xen/xen_intr.h ============================================================================== --- head/sys/i386/include/xen/xen_intr.h Tue Oct 21 05:08:35 2008 (r184109) +++ head/sys/i386/include/xen/xen_intr.h Tue Oct 21 06:38:05 2008 (r184110) @@ -32,7 +32,6 @@ /* Dynamic binding of event channels and VIRQ sources to Linux IRQ space. */ extern void unbind_from_irq(int irq); -extern void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu); extern int bind_caller_port_to_irqhandler(unsigned int caller_port, const char *devname, driver_intr_t handler, void *arg, unsigned long irqflags, void **cookiep); @@ -41,8 +40,12 @@ extern int bind_listening_port_to_irqhan void **cookiep); extern int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu, const char *devname, driver_filter_t filter, driver_intr_t handler, unsigned long irqflags); -extern int bind_ipi_to_irqhandler(unsigned int ipi, unsigned int cpu, const char *devname, - driver_intr_t handler, unsigned long irqflags); +extern int bind_ipi_to_irqhandler(unsigned int ipi, + unsigned int cpu, + const char *devname, + driver_intr_t handler, + unsigned long irqflags); + extern int bind_interdomain_evtchn_to_irqhandler(unsigned int remote_domain, unsigned int remote_port, const char *devname, @@ -65,7 +68,7 @@ extern void enable_irq(unsigned int); extern void irq_suspend(void); extern void irq_resume(void); -extern void idle_block(void); - +extern void idle_block(void); +extern int ap_cpu_initclocks(int cpu); #endif /* _XEN_INTR_H_ */ Modified: head/sys/i386/include/xen/xenfunc.h ============================================================================== --- head/sys/i386/include/xen/xenfunc.h Tue Oct 21 05:08:35 2008 (r184109) +++ head/sys/i386/include/xen/xenfunc.h Tue Oct 21 06:38:05 2008 (r184110) @@ -67,8 +67,6 @@ void _xen_machphys_update(vm_paddr_t, vm void xen_update_descriptor(union descriptor *, union descriptor *); -void ap_cpu_initclocks(void); - extern struct mtx balloon_lock; #if 0 #define balloon_lock(__flags) mtx_lock_irqsave(&balloon_lock, __flags) From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 06:38:41 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82619106567A; Tue, 21 Oct 2008 06:38:41 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 704488FC2B; Tue, 21 Oct 2008 06:38:41 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9L6cf4G091306; Tue, 21 Oct 2008 06:38:41 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9L6cf39091305; Tue, 21 Oct 2008 06:38:41 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200810210638.m9L6cf39091305@svn.freebsd.org> From: Kip Macy Date: Tue, 21 Oct 2008 06:38:41 +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: r184111 - head/sys/i386/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 06:38:41 -0000 Author: kmacy Date: Tue Oct 21 06:38:40 2008 New Revision: 184111 URL: http://svn.freebsd.org/changeset/base/184111 Log: Add routine for initializing AP clock Modified: head/sys/i386/xen/clock.c Modified: head/sys/i386/xen/clock.c ============================================================================== --- head/sys/i386/xen/clock.c Tue Oct 21 06:38:05 2008 (r184110) +++ head/sys/i386/xen/clock.c Tue Oct 21 06:38:40 2008 (r184111) @@ -766,27 +766,28 @@ cpu_initclocks(void) } /* should fast clock be enabled ? */ + } -/* - * - * XXX - */ -#if 0 && defined(SMP) -void -ap_cpu_initclocks(void) +int +ap_cpu_initclocks(int cpu) { - int irq; - int cpu = smp_processor_id(); - - per_cpu(processed_system_time, cpu) = processed_system_time; + int time_irq; + + xen_set_periodic_tick.period_ns = NS_PER_TICK; - irq = bind_virq_to_irq(VIRQ_TIMER); - PCPU_SET(time_irq, irq); - PANIC_IF(intr_add_handler("clk", irq, (driver_filter_t *)clkintr, NULL, - NULL, INTR_TYPE_CLK | INTR_FAST, NULL)); + HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, cpu, + &xen_set_periodic_tick); + + if ((time_irq = bind_virq_to_irqhandler(VIRQ_TIMER, cpu, "clk", + (driver_filter_t *)clkintr, NULL, + INTR_TYPE_CLK | INTR_FAST)) < 0) { + panic("failed to register clock interrupt\n"); + } + + return (0); } -#endif + void cpu_startprofclock(void) From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 06:39:40 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1EAA106567F; Tue, 21 Oct 2008 06:39:40 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF5668FC1B; Tue, 21 Oct 2008 06:39:40 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9L6derP091362; Tue, 21 Oct 2008 06:39:40 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9L6deef091360; Tue, 21 Oct 2008 06:39:40 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200810210639.m9L6deef091360@svn.freebsd.org> From: Kip Macy Date: Tue, 21 Oct 2008 06:39: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: r184112 - head/sys/i386/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 06:39:41 -0000 Author: kmacy Date: Tue Oct 21 06:39:40 2008 New Revision: 184112 URL: http://svn.freebsd.org/changeset/base/184112 Log: Implement infrastructure for gluing i386 ipi functions in to xen's infrastructure Modified: head/sys/i386/xen/exception.s head/sys/i386/xen/mp_machdep.c Modified: head/sys/i386/xen/exception.s ============================================================================== --- head/sys/i386/xen/exception.s Tue Oct 21 06:38:40 2008 (r184111) +++ head/sys/i386/xen/exception.s Tue Oct 21 06:39:40 2008 (r184112) @@ -184,14 +184,12 @@ call_evtchn_upcall: hypervisor_callback_pending: DISABLE_INTERRUPTS(%esi) /* cli */ jmp 10b - /* * alltraps entry point. Interrupts are enabled if this was a trap * gate (TGT), else disabled if this was an interrupt gate (IGT). * Note that int0x80_syscall is a trap gate. Only page faults * use an interrupt gate. */ - SUPERALIGN_TEXT .globl alltraps .type alltraps,@function Modified: head/sys/i386/xen/mp_machdep.c ============================================================================== --- head/sys/i386/xen/mp_machdep.c Tue Oct 21 06:38:40 2008 (r184111) +++ head/sys/i386/xen/mp_machdep.c Tue Oct 21 06:39:40 2008 (r184112) @@ -86,14 +86,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include - -#define WARMBOOT_TARGET 0 -#define WARMBOOT_OFF (KERNBASE + 0x0467) -#define WARMBOOT_SEG (KERNBASE + 0x0469) - #define stop_cpus_with_nmi 0 @@ -105,6 +101,10 @@ extern struct pcpu __pcpu[]; static int bootAP; static union descriptor *bootAPgdt; +static DEFINE_PER_CPU(int, resched_irq); +static DEFINE_PER_CPU(int, callfunc_irq); +static char resched_name[NR_CPUS][15]; +static char callfunc_name[NR_CPUS][15]; /* Free these after use */ void *bootstacks[MAXCPU]; @@ -119,6 +119,8 @@ vm_offset_t smp_tlb_addr1; vm_offset_t smp_tlb_addr2; volatile int smp_tlb_wait; +typedef void call_data_func_t(uintptr_t , uintptr_t); + static u_int logical_cpus; /* used to hold the AP's until we are ready to release them */ @@ -141,8 +143,6 @@ int cpu_apic_ids[MAXCPU]; /* Holds pending bitmap based IPIs per CPU */ static volatile u_int cpu_ipi_pending[MAXCPU]; -static u_int boot_address; - static void assign_cpu_ids(void); static void set_interrupt_apic_ids(void); int start_all_aps(void); @@ -300,6 +300,105 @@ cpu_mp_start(void) } +static void +iv_rendezvous(uintptr_t a, uintptr_t b) +{ + +} + +static void +iv_invltlb(uintptr_t a, uintptr_t b) +{ + +} + +static void +iv_invlpg(uintptr_t a, uintptr_t b) +{ + +} + +static void +iv_invlrng(uintptr_t a, uintptr_t b) +{ + +} + +static void +iv_invlcache(uintptr_t a, uintptr_t b) +{ + +} + +static void +iv_lazypmap(uintptr_t a, uintptr_t b) +{ + +} + +static void +iv_bitmap_vector(uintptr_t a, uintptr_t b) +{ + +} + + +static call_data_func_t *ipi_vectors[IPI_BITMAP_VECTOR + 1] = +{ iv_rendezvous, + iv_invltlb, + iv_invlpg, + iv_invlrng, + iv_invlcache, + iv_lazypmap, + iv_bitmap_vector +}; + +/* + * Reschedule call back. Nothing to do, + * all the work is done automatically when + * we return from the interrupt. + */ +static void +smp_reschedule_interrupt(void *unused) +{ +} + +struct _call_data { + call_data_func_t *func; + uintptr_t arg1; + uintptr_t arg2; + atomic_t started; + atomic_t finished; + int wait; +}; + +static struct _call_data *call_data; + +static void +smp_call_function_interrupt(void *unused) +{ + call_data_func_t *func = call_data->func; + uintptr_t arg1 = call_data->arg1; + uintptr_t arg2 = call_data->arg2; + int wait = call_data->wait; + + /* + * Notify initiating CPU that I've grabbed the data and am + * about to execute the function + */ + mb(); + atomic_inc(&call_data->started); + /* + * At this point the info structure may be out of scope unless wait==1 + */ + (*func)(arg1, arg2); + + if (wait) { + mb(); + atomic_inc(&call_data->finished); + } +} + /* * Print various information about the SMP system hardware and setup. */ @@ -323,6 +422,46 @@ cpu_mp_announce(void) } } + +static int +xen_smp_intr_init(unsigned int cpu) +{ + int rc; + + per_cpu(resched_irq, cpu) = per_cpu(callfunc_irq, cpu) = -1; + + sprintf(resched_name[cpu], "resched%u", cpu); + rc = bind_ipi_to_irqhandler(RESCHEDULE_VECTOR, + cpu, + resched_name[cpu], + smp_reschedule_interrupt, + INTR_FAST); + + per_cpu(resched_irq, cpu) = rc; + + sprintf(callfunc_name[cpu], "callfunc%u", cpu); + rc = bind_ipi_to_irqhandler(CALL_FUNCTION_VECTOR, + cpu, + callfunc_name[cpu], + smp_call_function_interrupt, + INTR_FAST); + if (rc < 0) + goto fail; + per_cpu(callfunc_irq, cpu) = rc; + + if ((cpu != 0) && ((rc = ap_cpu_initclocks(cpu)) != 0)) + goto fail; + + return 0; + + fail: + if (per_cpu(resched_irq, cpu) >= 0) + unbind_from_irqhandler(per_cpu(resched_irq, cpu), NULL); + if (per_cpu(callfunc_irq, cpu) >= 0) + unbind_from_irqhandler(per_cpu(callfunc_irq, cpu), NULL); + return rc; +} + #define MTOPSIZE (1<<(14 + PAGE_SHIFT)) /* @@ -336,8 +475,6 @@ init_secondary(void) /* bootAP is set in start_ap() to our ID. */ - - PCPU_SET(currentldt, _default_ldt); gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); #if 0 @@ -434,6 +571,7 @@ init_secondary(void) smp_active = 1; /* historic */ } + xen_smp_intr_init(bootAP); mtx_unlock_spin(&ap_boot_mtx); /* wait until all the AP's are up */ @@ -533,15 +671,11 @@ assign_cpu_ids(void) int start_all_aps(void) { - u_int32_t mpbioswarmvec; int x,apic_id, cpu; struct pcpu *pc; mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN); - /* save the current value of the warm-start vector */ - mpbioswarmvec = *((u_int32_t *) WARMBOOT_OFF); - /* set up temporary P==V mapping for AP boot */ /* XXX this is a hack, we should boot the AP on its own stack/PTD */ @@ -550,10 +684,6 @@ start_all_aps(void) apic_id = cpu_apic_ids[cpu]; - /* setup a vector to our boot code */ - *((volatile u_short *) WARMBOOT_OFF) = WARMBOOT_TARGET; - *((volatile u_short *) WARMBOOT_SEG) = (boot_address >> 4); - bootAP = cpu; bootAPgdt = gdt + (512*cpu); @@ -600,9 +730,6 @@ start_all_aps(void) /* build our map of 'other' CPUs */ PCPU_SET(other_cpus, all_cpus & ~PCPU_GET(cpumask)); - /* restore the warmstart vector */ - *(u_int32_t *) WARMBOOT_OFF = mpbioswarmvec; - pmap_invalidate_range(kernel_pmap, 0, NKPT * NBPDR - 1); /* number of APs actually started */ @@ -624,11 +751,8 @@ smp_trap_init(trap_info_t *trap_ctxt) } } -void -cpu_initialize_context(unsigned int cpu); extern int nkpt; - -void +static void cpu_initialize_context(unsigned int cpu) { /* vcpu_guest_context_t is too large to allocate on the stack. @@ -645,7 +769,6 @@ cpu_initialize_context(unsigned int cpu) * Page 0,[0-3] PTD * Page 1, [4] boot stack * Page [5] PDPT - * */ for (i = 0; i < NPGPTD + 2; i++) { @@ -796,8 +919,9 @@ smp_tlb_shootdown(u_int vector, vm_offse if (!(read_eflags() & PSL_I)) panic("%s: interrupts disabled", __func__); mtx_lock_spin(&smp_ipi_mtx); - smp_tlb_addr1 = addr1; - smp_tlb_addr2 = addr2; + call_data->func = ipi_vectors[vector]; + call_data->arg1 = addr1; + call_data->arg2 = addr2; atomic_store_rel_int(&smp_tlb_wait, 0); ipi_all_but_self(vector); while (smp_tlb_wait < ncpu) From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 08:01:20 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F6F3106566C; Tue, 21 Oct 2008 08:01:20 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1CE18FC18; Tue, 21 Oct 2008 08:01:19 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9L81Jug092791; Tue, 21 Oct 2008 08:01:19 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9L81J3b092789; Tue, 21 Oct 2008 08:01:19 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200810210801.m9L81J3b092789@svn.freebsd.org> From: Kip Macy Date: Tue, 21 Oct 2008 08:01: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: r184113 - in head/sys/i386: i386 include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 08:01:20 -0000 Author: kmacy Date: Tue Oct 21 08:01:19 2008 New Revision: 184113 URL: http://svn.freebsd.org/changeset/base/184113 Log: don't globally define ipi_bitmap_handler on xen Modified: head/sys/i386/i386/apic_vector.s head/sys/i386/include/smp.h Modified: head/sys/i386/i386/apic_vector.s ============================================================================== --- head/sys/i386/i386/apic_vector.s Tue Oct 21 06:39:40 2008 (r184112) +++ head/sys/i386/i386/apic_vector.s Tue Oct 21 08:01:19 2008 (r184113) @@ -270,6 +270,7 @@ IDTVEC(invlcache) /* * Handler for IPIs sent via the per-cpu IPI bitmap. */ +#ifndef XEN .text SUPERALIGN_TEXT IDTVEC(ipi_intr_bitmap_handler) @@ -284,7 +285,7 @@ IDTVEC(ipi_intr_bitmap_handler) call ipi_bitmap_handler MEXITCOUNT jmp doreti - +#endif /* * Executed by a CPU when it receives an IPI_STOP from another CPU. */ Modified: head/sys/i386/include/smp.h ============================================================================== --- head/sys/i386/include/smp.h Tue Oct 21 06:39:40 2008 (r184112) +++ head/sys/i386/include/smp.h Tue Oct 21 08:01:19 2008 (r184113) @@ -66,7 +66,9 @@ void cpustop_handler(void); void init_secondary(void); void ipi_selected(u_int cpus, u_int ipi); void ipi_all_but_self(u_int ipi); +#ifndef XEN void ipi_bitmap_handler(struct trapframe frame); +#endif u_int mp_bootaddress(u_int); int mp_grab_cpu_hlt(void); void smp_cache_flush(void); From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 08:02:18 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C51431065674; Tue, 21 Oct 2008 08:02:18 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3D438FC12; Tue, 21 Oct 2008 08:02:18 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9L82ICX092843; Tue, 21 Oct 2008 08:02:18 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9L82Ies092841; Tue, 21 Oct 2008 08:02:18 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200810210802.m9L82Ies092841@svn.freebsd.org> From: Kip Macy Date: Tue, 21 Oct 2008 08:02: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: r184114 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 08:02:18 -0000 Author: kmacy Date: Tue Oct 21 08:02:18 2008 New Revision: 184114 URL: http://svn.freebsd.org/changeset/base/184114 Log: remove gratuitous XEN define Modified: head/sys/i386/i386/trap.c Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Tue Oct 21 08:01:19 2008 (r184113) +++ head/sys/i386/i386/trap.c Tue Oct 21 08:02:18 2008 (r184114) @@ -123,14 +123,6 @@ dtrace_doubletrap_func_t dtrace_doubletr systrace_probe_func_t systrace_probe_func; #endif -#ifdef XEN -#include -#include -#include -#include -#include -#endif - extern void trap(struct trapframe *frame); extern void syscall(struct trapframe *frame); From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 08:03:12 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC3901065681; Tue, 21 Oct 2008 08:03:12 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DACF98FC1B; Tue, 21 Oct 2008 08:03:12 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9L83CO0092894; Tue, 21 Oct 2008 08:03:12 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9L83Cs9092893; Tue, 21 Oct 2008 08:03:12 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200810210803.m9L83Cs9092893@svn.freebsd.org> From: Kip Macy Date: Tue, 21 Oct 2008 08:03: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: r184115 - head/sys/i386/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 08:03:13 -0000 Author: kmacy Date: Tue Oct 21 08:03:12 2008 New Revision: 184115 URL: http://svn.freebsd.org/changeset/base/184115 Log: Hook in ipi handlers Modified: head/sys/i386/xen/mp_machdep.c Modified: head/sys/i386/xen/mp_machdep.c ============================================================================== --- head/sys/i386/xen/mp_machdep.c Tue Oct 21 08:02:18 2008 (r184114) +++ head/sys/i386/xen/mp_machdep.c Tue Oct 21 08:03:12 2008 (r184115) @@ -154,6 +154,7 @@ static cpumask_t hyperthreading_cpus_mas extern void Xhypervisor_callback(void); extern void failsafe_callback(void); +extern void pmap_lazyfix_action(void); struct cpu_group * cpu_topo(void) @@ -303,42 +304,51 @@ cpu_mp_start(void) static void iv_rendezvous(uintptr_t a, uintptr_t b) { - + smp_rendezvous_action(); } static void iv_invltlb(uintptr_t a, uintptr_t b) { - + xen_tlb_flush(); } static void iv_invlpg(uintptr_t a, uintptr_t b) { - + xen_invlpg(a); } static void iv_invlrng(uintptr_t a, uintptr_t b) { - + vm_offset_t start = (vm_offset_t)a; + vm_offset_t end = (vm_offset_t)b; + + while (start < end) { + xen_invlpg(start); + start += PAGE_SIZE; + } } + static void iv_invlcache(uintptr_t a, uintptr_t b) { - + + wbinvd(); } static void iv_lazypmap(uintptr_t a, uintptr_t b) { - + pmap_lazyfix_action(); } static void iv_bitmap_vector(uintptr_t a, uintptr_t b) { + } @@ -679,6 +689,7 @@ start_all_aps(void) /* set up temporary P==V mapping for AP boot */ /* XXX this is a hack, we should boot the AP on its own stack/PTD */ + xen_smp_intr_init(0); /* start each AP */ for (cpu = 1; cpu < mp_ncpus; cpu++) { apic_id = cpu_apic_ids[cpu]; @@ -1031,19 +1042,6 @@ smp_masked_invlpg_range(u_int mask, vm_o } } -void -ipi_bitmap_handler(struct trapframe frame) -{ - int cpu = PCPU_GET(cpuid); - u_int ipi_bitmap; - - ipi_bitmap = atomic_readandclear_int(&cpu_ipi_pending[cpu]); - - if (ipi_bitmap & (1 << IPI_PREEMPT)) { - sched_preempt(curthread); - } -} - /* * send an IPI to a set of cpus. */ @@ -1083,7 +1081,7 @@ ipi_selected(u_int32_t cpus, u_int ipi) if (old_pending) continue; } - + call_data->func = ipi_vectors[ipi]; ipi_pcpu(cpu, ipi); } } From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 09:55:50 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A1A0106567A; Tue, 21 Oct 2008 09:55:50 +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 69C678FC28; Tue, 21 Oct 2008 09:55:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9L9tooU094942; Tue, 21 Oct 2008 09:55:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9L9toRA094941; Tue, 21 Oct 2008 09:55:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200810210955.m9L9toRA094941@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 21 Oct 2008 09:55: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: r184118 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 09:55:50 -0000 Author: kib Date: Tue Oct 21 09:55:49 2008 New Revision: 184118 URL: http://svn.freebsd.org/changeset/base/184118 Log: Change vn_start_write() to clear *mpp on all failures when non-NULL vp is supplied, since vm_pageout_scan() expects it to be cleared on error. Submitted by: tegge PR: 123768 MFC after: 1 week Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Tue Oct 21 09:45:02 2008 (r184117) +++ head/sys/kern/vfs_vnops.c Tue Oct 21 09:55:49 2008 (r184118) @@ -967,12 +967,17 @@ vn_start_write(vp, mpp, flags) while ((mp->mnt_kern_flag & MNTK_SUSPEND) != 0) { if (flags & V_NOWAIT) { error = EWOULDBLOCK; + if (vp != NULL) + *mpp = NULL; goto unlock; } error = msleep(&mp->mnt_flag, MNT_MTX(mp), (PUSER - 1) | (flags & PCATCH), "suspfs", 0); - if (error) + if (error) { + if (vp != NULL) + *mpp = NULL; goto unlock; + } } } if (flags & V_XSLEEP) @@ -1028,6 +1033,8 @@ vn_start_secondary_write(vp, mpp, flags) if (flags & V_NOWAIT) { MNT_REL(mp); MNT_IUNLOCK(mp); + if (vp != NULL) + *mpp = NULL; return (EWOULDBLOCK); } /* @@ -1038,6 +1045,8 @@ vn_start_secondary_write(vp, mpp, flags) vfs_rel(mp); if (error == 0) goto retry; + if (vp != NULL) + *mpp = NULL; return (error); } From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 10:07:48 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35ADE1065671 for ; Tue, 21 Oct 2008 10:07:48 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.186]) by mx1.freebsd.org (Postfix) with ESMTP id B5C9C8FC13 for ; Tue, 21 Oct 2008 10:07:47 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by nf-out-0910.google.com with SMTP id h3so1013737nfh.33 for ; Tue, 21 Oct 2008 03:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=cclCd4P48GpdVHCzpPpPP2bObfwbMEXHu9wqMIQSVn8=; b=CNnR2ztZIoGYeZSek4VXNPHRj2sFBMnhlz0OLWgqIqjtdIEEuWUbXMnUr8VuO7Y33T vElihQJnXb+hGO9Z64IjRsl5dqW8QJPhDgyLSC+8EQeD8tErxp/3SXNVHWq18zMjwzZt k4onDtBzKoRQhZ6WYZVznWN1s9lap7tNmpD9U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=fM6yBm76+W2Zy2joB+mlUjmTwM2QNYyfs7TWWrrJHxnwFwIqg6cbM+sNF2HETlNCxx JWoE+LaZGU1pFs+AT0IPQDV3qf8i1+u1AKzMdXsPhFD4k/qefApq95tcoweIu46RJpNA 8PU/F2auwOK1qKBJv1Xk9KswDZQN+YThjsox4= Received: by 10.103.40.5 with SMTP id s5mr4351338muj.133.1224583666074; Tue, 21 Oct 2008 03:07:46 -0700 (PDT) Received: by 10.103.239.14 with HTTP; Tue, 21 Oct 2008 03:07:45 -0700 (PDT) Message-ID: <3bbf2fe10810210307t664cc8a2s62606f03427286f3@mail.gmail.com> Date: Tue, 21 Oct 2008 12:07:45 +0200 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Jung-uk Kim" In-Reply-To: <200810210431.m9L4V7Pb088978@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200810210431.m9L4V7Pb088978@svn.freebsd.org> X-Google-Sender-Auth: ebde5b4826b26e4d Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184108 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 10:07:48 -0000 2008/10/21, Jung-uk Kim : > Author: jkim > Date: Tue Oct 21 04:31:07 2008 > New Revision: 184108 > URL: http://svn.freebsd.org/changeset/base/184108 > > Log: > Fix 'kern.timeconter.invariant_tsc' tunable and back out a redundant hack. > Somehow incomplete version was committed. :-( > > Modified: > head/sys/i386/i386/tsc.c > > Modified: head/sys/i386/i386/tsc.c > ============================================================================== > --- head/sys/i386/i386/tsc.c Tue Oct 21 03:18:02 2008 (r184107) > +++ head/sys/i386/i386/tsc.c Tue Oct 21 04:31:07 2008 (r184108) > @@ -53,7 +53,8 @@ u_int tsc_present; > static eventhandler_tag tsc_levels_tag, tsc_pre_tag, tsc_post_tag; > > SYSCTL_INT(_kern_timecounter, OID_AUTO, invariant_tsc, CTLFLAG_RDTUN, > - &tsc_is_invariant, 0, "Indicates the TSC is P-state invariant"); > + &tsc_is_invariant, 0, "Indicates whether the TSC is P-state invariant"); > +TUNABLE_INT("kern.timecounter.invariant_tsc", &tsc_is_invariant); > > #ifdef SMP > static int smp_tsc; > @@ -111,9 +112,8 @@ init_TSC(void) > set_cputicker(rdtsc, tsc_freq, 1); > > /* Register to find out about changes in CPU frequency. */ > - if (!tsc_is_invariant) > - tsc_pre_tag = EVENTHANDLER_REGISTER(cpufreq_pre_change, > - tsc_freq_changing, NULL, EVENTHANDLER_PRI_FIRST); > + tsc_pre_tag = EVENTHANDLER_REGISTER(cpufreq_pre_change, > + tsc_freq_changing, NULL, EVENTHANDLER_PRI_FIRST); > tsc_post_tag = EVENTHANDLER_REGISTER(cpufreq_post_change, > tsc_freq_changed, NULL, EVENTHANDLER_PRI_FIRST); > tsc_levels_tag = EVENTHANDLER_REGISTER(cpufreq_levels_changed, > Something we could do with this is adding a "quirk" table of TSC arch dependant known to be working (based on cpu_model and such) and use that table in order to replace tsc_smp. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 11:58:27 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 377E510656B0; Tue, 21 Oct 2008 11:58:27 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 277828FC32; Tue, 21 Oct 2008 11:58:27 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LBwRAe098422; Tue, 21 Oct 2008 11:58:27 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LBwRFq098420; Tue, 21 Oct 2008 11:58:27 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810211158.m9LBwRFq098420@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 21 Oct 2008 11:58: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: r184122 - head/crypto/openssh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 11:58:27 -0000 Author: des Date: Tue Oct 21 11:58:26 2008 New Revision: 184122 URL: http://svn.freebsd.org/changeset/base/184122 Log: At some point, construct_utmp() was changed to use realhostname() to fill in the struct utmp due to concerns about the length of the hostname buffer. However, this breaks the UseDNS option. There is a simpler and better solution: initialize utmp_len to the correct value (UT_HOSTSIZE instead of MAXHOSTNAMELEN) and let get_remote_name_or_ip() worry about the size of the buffer. PR: bin/97499 Submitted by: Bruce Cran MFC after: 1 week Modified: head/crypto/openssh/loginrec.c head/crypto/openssh/sshd.c Modified: head/crypto/openssh/loginrec.c ============================================================================== --- head/crypto/openssh/loginrec.c Tue Oct 21 10:54:12 2008 (r184121) +++ head/crypto/openssh/loginrec.c Tue Oct 21 11:58:26 2008 (r184122) @@ -146,7 +146,6 @@ */ #include "includes.h" -__RCSID("$FreeBSD$"); #include #include @@ -689,8 +688,8 @@ construct_utmp(struct logininfo *li, strncpy(ut->ut_name, li->username, MIN_SIZEOF(ut->ut_name, li->username)); # ifdef HAVE_HOST_IN_UTMP - realhostname_sa(ut->ut_host, sizeof ut->ut_host, - &li->hostaddr.sa, li->hostaddr.sa.sa_len); + strncpy(ut->ut_host, li->hostname, + MIN_SIZEOF(ut->ut_host, li->hostname)); # endif # ifdef HAVE_ADDR_IN_UTMP /* this is just a 32-bit IP address */ Modified: head/crypto/openssh/sshd.c ============================================================================== --- head/crypto/openssh/sshd.c Tue Oct 21 10:54:12 2008 (r184121) +++ head/crypto/openssh/sshd.c Tue Oct 21 11:58:26 2008 (r184122) @@ -72,6 +72,7 @@ __RCSID("$FreeBSD$"); #include #include #include +#include #include #include @@ -238,7 +239,7 @@ u_char *session_id2 = NULL; u_int session_id2_len = 0; /* record remote hostname or ip */ -u_int utmp_len = MAXHOSTNAMELEN; +u_int utmp_len = UT_HOSTSIZE; /* options.max_startup sized array of fd ints */ int *startup_pipes = NULL; From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 12:10:31 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36049106569C; Tue, 21 Oct 2008 12:10:31 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 265518FC20; Tue, 21 Oct 2008 12:10:31 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LCAVm4098677; Tue, 21 Oct 2008 12:10:31 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LCAVuu098676; Tue, 21 Oct 2008 12:10:31 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810211210.m9LCAVuu098676@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 21 Oct 2008 12:10: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: r184123 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 12:10:31 -0000 Author: des Date: Tue Oct 21 12:10:30 2008 New Revision: 184123 URL: http://svn.freebsd.org/changeset/base/184123 Log: Move va_end() up Modified: head/lib/libarchive/archive_util.c Modified: head/lib/libarchive/archive_util.c ============================================================================== --- head/lib/libarchive/archive_util.c Tue Oct 21 11:58:26 2008 (r184122) +++ head/lib/libarchive/archive_util.c Tue Oct 21 12:10:30 2008 (r184123) @@ -168,6 +168,7 @@ archive_set_error(struct archive *a, int va_start(ap, fmt); archive_string_vsprintf(&(a->error_string), fmt, ap); + va_end(ap); if (error_number > 0) { archive_strcat(&(a->error_string), ": "); #ifdef HAVE_STRERROR_R @@ -184,7 +185,6 @@ archive_set_error(struct archive *a, int archive_strcat(&(a->error_string), errp); } a->error = a->error_string.s; - va_end(ap); } void From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 14:18:46 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03E651065670; Tue, 21 Oct 2008 14:18:46 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E713C8FC27; Tue, 21 Oct 2008 14:18:45 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LEIjB7001165; Tue, 21 Oct 2008 14:18:45 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LEIjVF001164; Tue, 21 Oct 2008 14:18:45 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200810211418.m9LEIjVF001164@svn.freebsd.org> From: Andrew Thompson Date: Tue, 21 Oct 2008 14:18: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: r184127 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 14:18:46 -0000 Author: thompsa Date: Tue Oct 21 14:18:45 2008 New Revision: 184127 URL: http://svn.freebsd.org/changeset/base/184127 Log: If we have getc_inject hooked then the outq buffer is inaccessible to the driver so skip the drain rather than waiting indefinitely. Reviewed by: ed Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Tue Oct 21 14:11:00 2008 (r184126) +++ head/sys/kern/tty.c Tue Oct 21 14:18:45 2008 (r184127) @@ -119,6 +119,10 @@ tty_drain(struct tty *tp) { int error; + if (ttyhook_hashook(tp, getc_inject)) + /* buffer is inaccessable */ + return (0); + while (ttyoutq_bytesused(&tp->t_outq) > 0) { ttydevsw_outwakeup(tp); /* Could be handled synchronously. */ From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 14:44:26 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02534106567A; Tue, 21 Oct 2008 14:44:26 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5B138FC1E; Tue, 21 Oct 2008 14:44:25 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LEiPn8001633; Tue, 21 Oct 2008 14:44:25 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LEiPaM001632; Tue, 21 Oct 2008 14:44:25 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200810211444.m9LEiPaM001632@svn.freebsd.org> From: Andrew Thompson Date: Tue, 21 Oct 2008 14:44: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: r184128 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 14:44:26 -0000 Author: thompsa Date: Tue Oct 21 14:44:25 2008 New Revision: 184128 URL: http://svn.freebsd.org/changeset/base/184128 Log: Fix spelling mistake in the last rev. Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Tue Oct 21 14:18:45 2008 (r184127) +++ head/sys/kern/tty.c Tue Oct 21 14:44:25 2008 (r184128) @@ -120,7 +120,7 @@ tty_drain(struct tty *tp) int error; if (ttyhook_hashook(tp, getc_inject)) - /* buffer is inaccessable */ + /* buffer is inaccessible */ return (0); while (ttyoutq_bytesused(&tp->t_outq) > 0) { From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 16:46:51 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E56E106566B; Tue, 21 Oct 2008 16:46:51 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0F118FC1B; Tue, 21 Oct 2008 16:46:50 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LGko2D003777; Tue, 21 Oct 2008 16:46:50 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LGkocx003776; Tue, 21 Oct 2008 16:46:50 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200810211646.m9LGkocx003776@svn.freebsd.org> From: Roman Divacky Date: Tue, 21 Oct 2008 16:46: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: r184129 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 16:46:51 -0000 Author: rdivacky Date: Tue Oct 21 16:46:50 2008 New Revision: 184129 URL: http://svn.freebsd.org/changeset/base/184129 Log: Remove __CC_INT_IS_32BIT define which was used to fix mpt driver but is not used anymore. This define is not referenced by anything in the FreeBSD srcs nor google shows any usage. Kernel and world builds fine without it. Approved by: kib (mentor) Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Tue Oct 21 14:44:25 2008 (r184128) +++ head/sys/sys/cdefs.h Tue Oct 21 16:46:50 2008 (r184129) @@ -103,9 +103,6 @@ #define __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1 -/* XXX: sys/dev/mpt/mpilib/mpi_type.h uses it, someone should review it */ -#define __CC_INT_IS_32BIT 1 - #endif /* __GNUC__ || __INTEL_COMPILER */ /* From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 18:30:11 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E45A106566B; Tue, 21 Oct 2008 18:30:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B11C8FC1B; Tue, 21 Oct 2008 18:30:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LIUBKw005553; Tue, 21 Oct 2008 18:30:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LIUAKB005537; Tue, 21 Oct 2008 18:30:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200810211830.m9LIUAKB005537@svn.freebsd.org> From: John Baldwin Date: Tue, 21 Oct 2008 18:30: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: r184130 - in head/sys/dev: ppbus ppc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 18:30:11 -0000 Author: jhb Date: Tue Oct 21 18:30:10 2008 New Revision: 184130 URL: http://svn.freebsd.org/changeset/base/184130 Log: Several cleanups to remove the need for explicit unit numbers and a few other fixes: - Add pointers back to device_t objects in softc structures instead of storing the unit and using devclass_get_device(). - Add 'lpbb', 'pcf', 'pps', and 'vpo' child devices to every 'ppbus' device instead of just the first one. - Store softc pointers in si_drv1 of character devices instead of pulling the unit number from the minor number and using devclass_get_softc() and devclass_get_device(). - Store the LP_BYPASS flag in si_drv2 instead of encoding it in the minor number. - Destroy character devices for lpt(4) when detaching the device. - Use bus_print_child_footer() instead of duplicating it in ppbus_print_child() and fix ppbus_print_child()'s return value. - Remove unused AVM ivar from ppbus. - Don't store the 'mode' ivar in the ppbus ivars since we always fetch it from the parent anyway. - Try to detach all the child devices before deleting them in ppbus_detach(). - Use pause() instead of a tsleep() on a dummy address when polling the ppbus. - Use if_printf() and device_printf() instead of explicit names with unit numbers. Silence on: current@ Modified: head/sys/dev/ppbus/if_plip.c head/sys/dev/ppbus/immio.c head/sys/dev/ppbus/lpbb.c head/sys/dev/ppbus/lpt.c head/sys/dev/ppbus/pcfclock.c head/sys/dev/ppbus/ppb_base.c head/sys/dev/ppbus/ppb_msq.c head/sys/dev/ppbus/ppbconf.c head/sys/dev/ppbus/ppbconf.h head/sys/dev/ppbus/ppi.c head/sys/dev/ppbus/pps.c head/sys/dev/ppbus/vpo.c head/sys/dev/ppbus/vpoio.c head/sys/dev/ppbus/vpoio.h head/sys/dev/ppc/ppc.c head/sys/dev/ppc/ppcreg.h Modified: head/sys/dev/ppbus/if_plip.c ============================================================================== --- head/sys/dev/ppbus/if_plip.c Tue Oct 21 16:46:50 2008 (r184129) +++ head/sys/dev/ppbus/if_plip.c Tue Oct 21 18:30:10 2008 (r184130) @@ -147,6 +147,7 @@ static int volatile lptflag = 0; struct lp_data { struct ifnet *sc_ifp; + device_t sc_dev; u_char *sc_ifbuf; int sc_iferrs; @@ -173,8 +174,6 @@ static void lp_intr(void *); #define DEVTOSOFTC(dev) \ ((struct lp_data *)device_get_softc(dev)) -#define UNITODEVICE(unit) \ - (devclass_get_device(lp_devclass, (unit))) static devclass_t lp_devclass; @@ -206,6 +205,8 @@ lp_attach (device_t dev) struct ifnet *ifp; int rid = 0; + lp->sc_dev = dev; + /* * Reserve the interrupt resource. If we don't have one, the * attach fails. @@ -284,9 +285,9 @@ lpinittables (void) static int lpioctl (struct ifnet *ifp, u_long cmd, caddr_t data) { - device_t dev = UNITODEVICE(ifp->if_dunit); + struct lp_data *sc = ifp->if_softc; + device_t dev = sc->sc_dev; device_t ppbus = device_get_parent(dev); - struct lp_data *sc = DEVTOSOFTC(dev); struct ifaddr *ifa = (struct ifaddr *)data; struct ifreq *ifr = (struct ifreq *)data; u_char *ptr; @@ -560,7 +561,7 @@ lp_intr (void *arg) * so stop wasting our time */ if (sc->sc_iferrs > LPMAXERRS) { - printf("lp%d: Too many errors, Going off-line.\n", device_get_unit(dev)); + if_printf(sc->sc_ifp, "Too many errors, Going off-line.\n"); ppb_wctr(ppbus, 0x00); sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; sc->sc_iferrs=0; @@ -589,7 +590,8 @@ static int lpoutput (struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct rtentry *rt) { - device_t dev = UNITODEVICE(ifp->if_dunit); + struct lp_data *sc = ifp->if_softc; + device_t dev = sc->sc_dev; device_t ppbus = device_get_parent(dev); int s, err; struct mbuf *mm; Modified: head/sys/dev/ppbus/immio.c ============================================================================== --- head/sys/dev/ppbus/immio.c Tue Oct 21 16:46:50 2008 (r184129) +++ head/sys/dev/ppbus/immio.c Tue Oct 21 18:30:10 2008 (r184130) @@ -298,8 +298,9 @@ imm_disconnect(struct vpoio_data *vpo, i if ((s1 != (char)0xb8 || s2 != (char)0x18 || s3 != (char)0x38)) { if (bootverbose) - printf("imm%d: (disconnect) s1=0x%x s2=0x%x, s3=0x%x\n", - vpo->vpo_unit, s1 & 0xff, s2 & 0xff, s3 & 0xff); + device_printf(vpo->vpo_dev, + "(disconnect) s1=0x%x s2=0x%x, s3=0x%x\n", + s1 & 0xff, s2 & 0xff, s3 & 0xff); if (connected) *connected = VP0_ECONNECT; } @@ -351,8 +352,9 @@ imm_connect(struct vpoio_data *vpo, int if ((s1 != (char)0xb8 || s2 != (char)0x18 || s3 != (char)0x30)) { if (bootverbose) - printf("imm%d: (connect) s1=0x%x s2=0x%x, s3=0x%x\n", - vpo->vpo_unit, s1 & 0xff, s2 & 0xff, s3 & 0xff); + device_printf(vpo->vpo_dev, + "(connect) s1=0x%x s2=0x%x, s3=0x%x\n", + s1 & 0xff, s2 & 0xff, s3 & 0xff); if (disconnected) *disconnected = VP0_ECONNECT; } @@ -397,7 +399,8 @@ imm_detect(struct vpoio_data *vpo) goto error; vpo->vpo_mode_found = VP0_MODE_NIBBLE; } else { - printf("imm%d: NIBBLE mode unavailable!\n", vpo->vpo_unit); + device_printf(vpo->vpo_dev, + "NIBBLE mode unavailable!\n"); goto error; } } else { @@ -418,8 +421,8 @@ imm_detect(struct vpoio_data *vpo) if (error) { if (bootverbose) - printf("imm%d: can't disconnect from the drive\n", - vpo->vpo_unit); + device_printf(vpo->vpo_dev, + "can't disconnect from the drive\n"); goto error; } @@ -611,17 +614,17 @@ imm_attach(struct vpoio_data *vpo) case VP0_MODE_EPP: ppb_MS_GET_init(ppbus, vpo->vpo_dev, epp17_instr); ppb_MS_PUT_init(ppbus, vpo->vpo_dev, epp17_outstr); - printf("imm%d: EPP mode\n", vpo->vpo_unit); + device_printf(vpo->vpo_dev, "EPP mode\n"); break; case VP0_MODE_PS2: ppb_MS_GET_init(ppbus, vpo->vpo_dev, ps2_inbyte_submicroseq); ppb_MS_PUT_init(ppbus, vpo->vpo_dev, spp_outbyte_submicroseq); - printf("imm%d: PS2 mode\n", vpo->vpo_unit); + device_printf(vpo->vpo_dev, "PS2 mode\n"); break; case VP0_MODE_NIBBLE: ppb_MS_GET_init(ppbus, vpo->vpo_dev, vpo->vpo_nibble_inbyte_msq); ppb_MS_PUT_init(ppbus, vpo->vpo_dev, spp_outbyte_submicroseq); - printf("imm%d: NIBBLE mode\n", vpo->vpo_unit); + device_printf(vpo->vpo_dev, "NIBBLE mode\n"); break; default: panic("imm: unknown mode %d", vpo->vpo_mode_found); Modified: head/sys/dev/ppbus/lpbb.c ============================================================================== --- head/sys/dev/ppbus/lpbb.c Tue Oct 21 16:46:50 2008 (r184129) +++ head/sys/dev/ppbus/lpbb.c Tue Oct 21 18:30:10 2008 (r184130) @@ -62,7 +62,7 @@ lpbb_identify(driver_t *driver, device_t device_t dev; - dev = device_find_child(parent, "lpbb", 0); + dev = device_find_child(parent, "lpbb", -1); if (!dev) BUS_ADD_CHILD(parent, 0, "lpbb", -1); } Modified: head/sys/dev/ppbus/lpt.c ============================================================================== --- head/sys/dev/ppbus/lpt.c Tue Oct 21 16:46:50 2008 (r184129) +++ head/sys/dev/ppbus/lpt.c Tue Oct 21 18:30:10 2008 (r184130) @@ -104,11 +104,10 @@ static int volatile lptflag = 1; #define BUFSIZE 1024 #define BUFSTATSIZE 32 -#define LPTUNIT(s) ((s)&0x03) -#define LPTFLAGS(s) ((s)&0xfc) - struct lpt_data { - + device_t dev; + struct cdev *cdev; + struct cdev *cdev_bypass; short sc_state; /* default case: negative prime, negative ack, handshake strobe, prime once */ @@ -145,10 +144,6 @@ static int lpt_detect(device_t dev); #define DEVTOSOFTC(dev) \ ((struct lpt_data *)device_get_softc(dev)) -#define UNITOSOFTC(unit) \ - ((struct lpt_data *)devclass_get_softc(lpt_devclass, (unit))) -#define UNITODEVICE(unit) \ - (devclass_get_device(lpt_devclass, (unit))) static void lptintr(device_t dev); static void lpt_intr(void *arg); /* without spls */ @@ -396,10 +391,15 @@ lpt_attach(device_t dev) lpt_release_ppbus(dev); - make_dev(&lpt_cdevsw, unit, + sc->dev = dev; + sc->cdev = make_dev(&lpt_cdevsw, unit, UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d", unit); - make_dev(&lpt_cdevsw, unit | LP_BYPASS, + sc->cdev->si_drv1 = sc; + sc->cdev->si_drv2 = 0; + sc->cdev_bypass = make_dev(&lpt_cdevsw, unit, UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d.ctl", unit); + sc->cdev_bypass->si_drv1 = sc; + sc->cdev_bypass->si_drv2 = LP_BYPASS; return (0); } @@ -408,6 +408,8 @@ lpt_detach(device_t dev) { struct lpt_data *sc = DEVTOSOFTC(dev); + destroy_dev(sc->cdev); + destroy_dev(sc->cdev_bypass); lpt_release_ppbus(dev); if (sc->intr_resource != 0) { BUS_TEARDOWN_INTR(device_get_parent(dev), dev, @@ -461,9 +463,8 @@ lptopen(struct cdev *dev, int flags, int { int s; int trys, err; - u_int unit = LPTUNIT(dev2unit(dev)); - struct lpt_data *sc = UNITOSOFTC(unit); - device_t lptdev = UNITODEVICE(unit); + struct lpt_data *sc = dev->si_drv1; + device_t lptdev = sc->dev; device_t ppbus = device_get_parent(lptdev); if (!sc) @@ -475,7 +476,7 @@ lptopen(struct cdev *dev, int flags, int } else sc->sc_state |= LPTINIT; - sc->sc_flags = LPTFLAGS(dev2unit(dev)); + sc->sc_flags = dev->si_drv2; /* Check for open with BYPASS flag set. */ if (sc->sc_flags & LP_BYPASS) { @@ -579,13 +580,12 @@ lptopen(struct cdev *dev, int flags, int static int lptclose(struct cdev *dev, int flags, int fmt, struct thread *td) { - u_int unit = LPTUNIT(dev2unit(dev)); - struct lpt_data *sc = UNITOSOFTC(unit); - device_t lptdev = UNITODEVICE(unit); + struct lpt_data *sc = dev->si_drv1; + device_t lptdev = sc->dev; device_t ppbus = device_get_parent(lptdev); int err; - if(sc->sc_flags & LP_BYPASS) + if (sc->sc_flags & LP_BYPASS) goto end_close; if ((err = lpt_request_ppbus(lptdev, PPB_WAIT|PPB_INTR)) != 0) @@ -688,9 +688,8 @@ lpt_pushbytes(device_t dev) static int lptread(struct cdev *dev, struct uio *uio, int ioflag) { - u_int unit = LPTUNIT(dev2unit(dev)); - struct lpt_data *sc = UNITOSOFTC(unit); - device_t lptdev = UNITODEVICE(unit); + struct lpt_data *sc = dev->si_drv1; + device_t lptdev = sc->dev; device_t ppbus = device_get_parent(lptdev); int error = 0, len; @@ -735,9 +734,8 @@ lptwrite(struct cdev *dev, struct uio *u { register unsigned n; int err; - u_int unit = LPTUNIT(dev2unit(dev)); - struct lpt_data *sc = UNITOSOFTC(unit); - device_t lptdev = UNITODEVICE(unit); + struct lpt_data *sc = dev->si_drv1; + device_t lptdev = sc->dev; device_t ppbus = device_get_parent(lptdev); if(sc->sc_flags & LP_BYPASS) { @@ -783,7 +781,9 @@ lptwrite(struct cdev *dev, struct uio *u return(err); case EINVAL: /* advanced mode not avail */ - log(LOG_NOTICE, LPT_NAME "%d: advanced mode not avail, polling\n", unit); + log(LOG_NOTICE, + "%s: advanced mode not avail, polling\n", + device_get_nameunit(sc->dev)); break; default: return(err); @@ -902,8 +902,7 @@ static int lptioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td) { int error = 0; - u_int unit = LPTUNIT(dev2unit(dev)); - struct lpt_data *sc = UNITOSOFTC(unit); + struct lpt_data *sc = dev->si_drv1; u_char old_sc_irq; /* old printer IRQ status */ switch (cmd) { @@ -942,8 +941,8 @@ lptioctl(struct cdev *dev, u_long cmd, c } if (old_sc_irq != sc->sc_irq ) - log(LOG_NOTICE, LPT_NAME "%d: switched to %s %s mode\n", - unit, + log(LOG_NOTICE, "%s: switched to %s %s mode\n", + device_get_nameunit(sc->dev), (sc->sc_irq & LP_ENABLE_IRQ)? "interrupt-driven":"polled", (sc->sc_irq & LP_ENABLE_EXT)? Modified: head/sys/dev/ppbus/pcfclock.c ============================================================================== --- head/sys/dev/ppbus/pcfclock.c Tue Oct 21 16:46:50 2008 (r184129) +++ head/sys/dev/ppbus/pcfclock.c Tue Oct 21 18:30:10 2008 (r184130) @@ -52,16 +52,11 @@ __FBSDID("$FreeBSD$"); #define PCFCLOCK_NAME "pcfclock" struct pcfclock_data { + device_t dev; + struct cdev *cdev; int count; }; -#define DEVTOSOFTC(dev) \ - ((struct pcfclock_data *)device_get_softc(dev)) -#define UNITOSOFTC(unit) \ - ((struct pcfclock_data *)devclass_get_softc(pcfclock_devclass, (unit))) -#define UNITODEVICE(unit) \ - (devclass_get_device(pcfclock_devclass, (unit))) - static devclass_t pcfclock_devclass; static d_open_t pcfclock_open; @@ -120,7 +115,7 @@ pcfclock_identify(driver_t *driver, devi device_t dev; - dev = device_find_child(parent, PCFCLOCK_NAME, 0); + dev = device_find_child(parent, PCFCLOCK_NAME, -1); if (!dev) BUS_ADD_CHILD(parent, 0, PCFCLOCK_NAME, -1); } @@ -128,24 +123,27 @@ pcfclock_identify(driver_t *driver, devi static int pcfclock_probe(device_t dev) { - struct pcfclock_data *sc; device_set_desc(dev, "PCF-1.0"); - - sc = DEVTOSOFTC(dev); - return (0); } static int pcfclock_attach(device_t dev) { + struct pcfclock_data *sc = device_get_softc(dev); int unit; unit = device_get_unit(dev); - make_dev(&pcfclock_cdevsw, unit, + sc->dev = dev; + sc->cdev = make_dev(&pcfclock_cdevsw, unit, UID_ROOT, GID_WHEEL, 0400, PCFCLOCK_NAME "%d", unit); + if (sc->cdev == NULL) { + device_printf(dev, "Failed to create character device\n"); + return (ENXIO); + } + sc->cdev->si_drv1 = sc; return (0); } @@ -153,9 +151,8 @@ pcfclock_attach(device_t dev) static int pcfclock_open(struct cdev *dev, int flag, int fms, struct thread *td) { - u_int unit = dev2unit(dev); - struct pcfclock_data *sc = UNITOSOFTC(unit); - device_t pcfclockdev = UNITODEVICE(unit); + struct pcfclock_data *sc = dev->si_drv1; + device_t pcfclockdev = sc->dev; device_t ppbus = device_get_parent(pcfclockdev); int res; @@ -174,9 +171,8 @@ pcfclock_open(struct cdev *dev, int flag static int pcfclock_close(struct cdev *dev, int flags, int fmt, struct thread *td) { - u_int unit = dev2unit(dev); - struct pcfclock_data *sc = UNITOSOFTC(unit); - device_t pcfclockdev = UNITODEVICE(unit); + struct pcfclock_data *sc = dev->si_drv1; + device_t pcfclockdev = sc->dev; device_t ppbus = device_get_parent(pcfclockdev); sc->count--; @@ -189,9 +185,9 @@ pcfclock_close(struct cdev *dev, int fla static void pcfclock_write_cmd(struct cdev *dev, unsigned char command) { - u_int unit = dev2unit(dev); - device_t ppidev = UNITODEVICE(unit); - device_t ppbus = device_get_parent(ppidev); + struct pcfclock_data *sc = dev->si_drv1; + device_t pcfclockdev = sc->dev; + device_t ppbus = device_get_parent(pcfclockdev); unsigned char ctr = 14; char i; @@ -209,7 +205,7 @@ pcfclock_write_cmd(struct cdev *dev, uns static void pcfclock_display_data(struct cdev *dev, char buf[18]) { - u_int unit = dev2unit(dev); + struct pcfclock_data *sc = dev->si_drv1; #ifdef PCFCLOCK_VERBOSE int year; @@ -217,25 +213,23 @@ pcfclock_display_data(struct cdev *dev, if (year < 70) year += 100; - printf(PCFCLOCK_NAME "%d: %02d.%02d.%4d %02d:%02d:%02d, " + device_printf(sc->dev, "%02d.%02d.%4d %02d:%02d:%02d, " "battery status: %s\n", - unit, NR(buf, 10), NR(buf, 12), 1900 + year, NR(buf, 6), NR(buf, 4), NR(buf, 2), PCFCLOCK_BATTERY_STATUS_LOW(buf) ? "LOW" : "ok"); #else if (PCFCLOCK_BATTERY_STATUS_LOW(buf)) - printf(PCFCLOCK_NAME "%d: BATTERY STATUS LOW ON\n", - unit); + device_printf(sc->dev, "BATTERY STATUS LOW ON\n"); #endif } static int pcfclock_read_data(struct cdev *dev, char *buf, ssize_t bits) { - u_int unit = dev2unit(dev); - device_t ppidev = UNITODEVICE(unit); - device_t ppbus = device_get_parent(ppidev); + struct pcfclock_data *sc = dev->si_drv1; + device_t pcfclockdev = sc->dev; + device_t ppbus = device_get_parent(pcfclockdev); int i; char waitfor; int offset; @@ -272,9 +266,9 @@ pcfclock_read_data(struct cdev *dev, cha static int pcfclock_read_dev(struct cdev *dev, char *buf, int maxretries) { - u_int unit = dev2unit(dev); - device_t ppidev = UNITODEVICE(unit); - device_t ppbus = device_get_parent(ppidev); + struct pcfclock_data *sc = dev->si_drv1; + device_t pcfclockdev = sc->dev; + device_t ppbus = device_get_parent(pcfclockdev); int error = 0; ppb_set_mode(ppbus, PPB_COMPATIBLE); @@ -302,7 +296,7 @@ pcfclock_read_dev(struct cdev *dev, char static int pcfclock_read(struct cdev *dev, struct uio *uio, int ioflag) { - u_int unit = dev2unit(dev); + struct pcfclock_data *sc = dev->si_drv1; char buf[18]; int error = 0; @@ -312,7 +306,7 @@ pcfclock_read(struct cdev *dev, struct u error = pcfclock_read_dev(dev, buf, PCFCLOCK_MAX_RETRIES); if (error) { - printf(PCFCLOCK_NAME "%d: no PCF found\n", unit); + device_printf(sc->dev, "no PCF found\n"); } else { pcfclock_display_data(dev, buf); Modified: head/sys/dev/ppbus/ppb_base.c ============================================================================== --- head/sys/dev/ppbus/ppb_base.c Tue Oct 21 16:46:50 2008 (r184129) +++ head/sys/dev/ppbus/ppb_base.c Tue Oct 21 18:30:10 2008 (r184130) @@ -75,7 +75,7 @@ ppb_poll_bus(device_t bus, int max, switch (how) { case PPB_NOINTR: /* wait 10 ms */ - tsleep((caddr_t)bus, PPBPRI, "ppbpoll", hz/100); + pause("ppbpoll", hz/100); break; case PPB_INTR: Modified: head/sys/dev/ppbus/ppb_msq.c ============================================================================== --- head/sys/dev/ppbus/ppb_msq.c Tue Oct 21 16:46:50 2008 (r184129) +++ head/sys/dev/ppbus/ppb_msq.c Tue Oct 21 18:30:10 2008 (r184130) @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); static struct ppb_xfer * mode2xfer(device_t bus, struct ppb_device *ppbdev, int opcode) { - int index, epp; + int index, epp, mode; struct ppb_xfer *table; switch (opcode) { @@ -72,7 +72,8 @@ mode2xfer(device_t bus, struct ppb_devic } /* retrieve the device operating mode */ - switch (ppb_get_mode(bus)) { + mode = ppb_get_mode(bus); + switch (mode) { case PPB_COMPATIBLE: index = COMPAT_MSQ; break; @@ -99,7 +100,7 @@ mode2xfer(device_t bus, struct ppb_devic index = ECP_MSQ; break; default: - panic("%s: unknown mode (%d)", __func__, ppbdev->mode); + panic("%s: unknown mode (%d)", __func__, mode); } return (&table[index]); Modified: head/sys/dev/ppbus/ppbconf.c ============================================================================== --- head/sys/dev/ppbus/ppbconf.c Tue Oct 21 16:46:50 2008 (r184129) +++ head/sys/dev/ppbus/ppbconf.c Tue Oct 21 18:30:10 2008 (r184130) @@ -54,21 +54,22 @@ static MALLOC_DEFINE(M_PPBUSDEV, "ppbusd * Device methods */ -static void +static int ppbus_print_child(device_t bus, device_t dev) { struct ppb_device *ppbdev; + int retval; - bus_print_child_header(bus, dev); + retval = bus_print_child_header(bus, dev); ppbdev = (struct ppb_device *)device_get_ivars(dev); if (ppbdev->flags != 0) - printf(" flags 0x%x", ppbdev->flags); + retval += printf(" flags 0x%x", ppbdev->flags); - printf(" on %s%d\n", device_get_name(bus), device_get_unit(bus)); + retval += bus_print_child_footer(bus, dev); - return; + return (retval); } static int @@ -110,16 +111,11 @@ ppbus_add_child(device_t dev, int order, static int ppbus_read_ivar(device_t bus, device_t dev, int index, uintptr_t* val) { - struct ppb_device *ppbdev = (struct ppb_device *)device_get_ivars(dev); switch (index) { case PPBUS_IVAR_MODE: /* XXX yet device mode = ppbus mode = chipset mode */ *val = (u_long)ppb_get_mode(bus); - ppbdev->mode = (u_short)*val; - break; - case PPBUS_IVAR_AVM: - *val = (u_long)ppbdev->avm; break; default: return (ENOENT); @@ -131,13 +127,11 @@ ppbus_read_ivar(device_t bus, device_t d static int ppbus_write_ivar(device_t bus, device_t dev, int index, u_long val) { - struct ppb_device *ppbdev = (struct ppb_device *)device_get_ivars(dev); switch (index) { case PPBUS_IVAR_MODE: /* XXX yet device mode = ppbus mode = chipset mode */ - ppb_set_mode(bus,val); - ppbdev->mode = ppb_get_mode(bus); + ppb_set_mode(bus, val); break; default: return (ENOENT); @@ -212,16 +206,15 @@ ppb_pnp_detect(device_t bus) int i, len, error; int class_id = -1; char str[PPB_PnP_STRING_SIZE+1]; - int unit = device_get_unit(bus); - printf("Probing for PnP devices on ppbus%d:\n", unit); + device_printf(bus, "Probing for PnP devices:\n"); if ((error = ppb_1284_read_id(bus, PPB_NIBBLE, str, PPB_PnP_STRING_SIZE, &len))) goto end_detect; #ifdef DEBUG_1284 - printf("ppb: %d characters: ", len); + device_printf(bus, " %d characters: ", len); for (i = 0; i < len; i++) printf("%c(0x%x) ", str[i], str[i]); printf("\n"); @@ -233,10 +226,10 @@ ppb_pnp_detect(device_t bus) if ((token = search_token(str, len, "MFG")) != NULL || (token = search_token(str, len, "MANUFACTURER")) != NULL) - printf("ppbus%d: <%s", unit, + device_printf(bus, "<%s", search_token(token, UNKNOWN_LENGTH, ":") + 1); else - printf("ppbus%d: ppb->ppb_link->base) #define ppb_get_epp_protocol(dev) ((dev)->ppb->ppb_link->epp_protocol) -#define ppb_get_irq(dev) ((dev)->ppb->ppb_link->id_irq) */ #endif Modified: head/sys/dev/ppbus/ppi.c ============================================================================== --- head/sys/dev/ppbus/ppi.c Tue Oct 21 16:46:50 2008 (r184129) +++ head/sys/dev/ppbus/ppi.c Tue Oct 21 18:30:10 2008 (r184130) @@ -59,8 +59,8 @@ __FBSDID("$FreeBSD$"); #define BUFSIZE 512 struct ppi_data { - - int ppi_unit; + device_t ppi_device; + struct cdev *ppi_cdev; int ppi_flags; #define HAVE_PPBUS (1<<0) #define HAD_PPBUS (1<<1) @@ -77,10 +77,6 @@ struct ppi_data { #define DEVTOSOFTC(dev) \ ((struct ppi_data *)device_get_softc(dev)) -#define UNITOSOFTC(unit) \ - ((struct ppi_data *)devclass_get_softc(ppi_devclass, (unit))) -#define UNITODEVICE(unit) \ - (devclass_get_device(ppi_devclass, (unit))) static devclass_t ppi_devclass; @@ -162,18 +158,24 @@ ppi_probe(device_t dev) static int ppi_attach(device_t dev) { + struct ppi_data *ppi = DEVTOSOFTC(dev); #ifdef PERIPH_1284 int rid = 0; - struct ppi_data *ppi = DEVTOSOFTC(dev); /* declare our interrupt handler */ ppi->intr_resource = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); #endif /* PERIPH_1284 */ - make_dev(&ppi_cdevsw, device_get_unit(dev), /* XXX cleanup */ + ppi->ppi_cdev = make_dev(&ppi_cdevsw, device_get_unit(dev), UID_ROOT, GID_WHEEL, 0600, "ppi%d", device_get_unit(dev)); + if (ppi->ppi_cdev == NULL) { + device_printf("Failed to create character device\n"); + return (ENXIO); + } + ppi->ppi_cdev->si_drv1 = ppi; + ppi->ppi_device = dev; return (0); } @@ -252,15 +254,11 @@ ppiintr(void *arg) static int ppiopen(struct cdev *dev, int flags, int fmt, struct thread *td) { - u_int unit = dev2unit(dev); - struct ppi_data *ppi = UNITOSOFTC(unit); - device_t ppidev = UNITODEVICE(unit); + struct ppi_data *ppi = dev->si_drv1; + device_t ppidev = ppi->ppi_device; device_t ppbus = device_get_parent(ppidev); int res; - if (!ppi) - return (ENXIO); - if (!(ppi->ppi_flags & HAVE_PPBUS)) { if ((res = ppb_request_bus(ppbus, ppidev, (flags & O_NONBLOCK) ? PPB_DONTWAIT : @@ -286,9 +284,8 @@ ppiopen(struct cdev *dev, int flags, int static int ppiclose(struct cdev *dev, int flags, int fmt, struct thread *td) { - u_int unit = dev2unit(dev); - struct ppi_data *ppi = UNITOSOFTC(unit); - device_t ppidev = UNITODEVICE(unit); + struct ppi_data *ppi = dev->si_drv1; + device_t ppidev = ppi->ppi_device; device_t ppbus = device_get_parent(ppidev); ppi->ppi_count --; @@ -329,9 +326,8 @@ static int ppiread(struct cdev *dev, struct uio *uio, int ioflag) { #ifdef PERIPH_1284 - u_int unit = dev2unit(dev); - struct ppi_data *ppi = UNITOSOFTC(unit); - device_t ppidev = UNITODEVICE(unit); + struct ppi_data *ppi = dev->si_drv1; + device_t ppidev = ppi->ppi_device; device_t ppbus = device_get_parent(ppidev); int len, error = 0; @@ -413,9 +409,8 @@ static int ppiwrite(struct cdev *dev, struct uio *uio, int ioflag) { #ifdef PERIPH_1284 - u_int unit = dev2unit(dev); - struct ppi_data *ppi = UNITOSOFTC(unit); - device_t ppidev = UNITODEVICE(unit); + struct ppi_data *ppi = dev->si_drv1; + device_t ppidev = ppi->ppi_device; device_t ppbus = device_get_parent(ppidev); int len, error = 0, sent; @@ -499,9 +494,8 @@ error: static int ppiioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td) { - u_int unit = dev2unit(dev); - device_t ppidev = UNITODEVICE(unit); - device_t ppbus = device_get_parent(ppidev); + struct ppi_data *ppi = dev->si_drv1; + device_t ppidev = ppi->ppi_device; int error = 0; u_int8_t *val = (u_int8_t *)data; Modified: head/sys/dev/ppbus/pps.c ============================================================================== --- head/sys/dev/ppbus/pps.c Tue Oct 21 16:46:50 2008 (r184129) +++ head/sys/dev/ppbus/pps.c Tue Oct 21 18:30:10 2008 (r184130) @@ -77,7 +77,7 @@ ppsidentify(driver_t *driver, device_t p device_t dev; - dev = device_find_child(parent, PPS_NAME, 0); + dev = device_find_child(parent, PPS_NAME, -1); if (!dev) BUS_ADD_CHILD(parent, 0, PPS_NAME, -1); } Modified: head/sys/dev/ppbus/vpo.c ============================================================================== --- head/sys/dev/ppbus/vpo.c Tue Oct 21 16:46:50 2008 (r184129) +++ head/sys/dev/ppbus/vpo.c Tue Oct 21 18:30:10 2008 (r184130) @@ -63,8 +63,7 @@ struct vpo_sense { }; struct vpo_data { - unsigned short vpo_unit; - + device_t vpo_dev; int vpo_stat; int vpo_count; int vpo_error; @@ -94,7 +93,7 @@ vpo_identify(driver_t *driver, device_t device_t dev; - dev = device_find_child(parent, "vpo", 0); + dev = device_find_child(parent, "vpo", -1); if (!dev) BUS_ADD_CHILD(parent, 0, "vpo", -1); } @@ -109,12 +108,7 @@ vpo_probe(device_t dev) int error; vpo = DEVTOSOFTC(dev); - - /* vpo dependent initialisation */ - vpo->vpo_unit = device_get_unit(dev); - - /* low level probe */ - vpoio_set_unit(&vpo->vpo_io, vpo->vpo_unit); + vpo->vpo_dev = dev; /* check ZIP before ZIP+ or imm_probe() will send controls to * the printer or whatelse connected to the port */ @@ -257,8 +251,8 @@ vpo_intr(struct vpo_data *vpo, struct cc /* if a timeout occured, no sense */ if (vpo->vpo_error) { if (vpo->vpo_error != VP0_ESELECT_TIMEOUT) - printf("vpo%d: VP0 error/timeout (%d)\n", - vpo->vpo_unit, vpo->vpo_error); + device_printf(vpo->vpo_dev, "VP0 error/timeout (%d)\n", + vpo->vpo_error); csio->ccb_h.status = CAM_CMD_TIMEOUT; goto error; @@ -348,8 +342,8 @@ vpo_action(struct cam_sim *sim, union cc csio = &ccb->csio; #ifdef VP0_DEBUG - printf("vpo%d: XPT_SCSI_IO (0x%x) request\n", - vpo->vpo_unit, csio->cdb_io.cdb_bytes[0]); + device_printf(vpo->vpo_dev, "XPT_SCSI_IO (0x%x) request\n", + csio->cdb_io.cdb_bytes[0]); #endif vpo_intr(vpo, csio); @@ -365,8 +359,7 @@ vpo_action(struct cam_sim *sim, union cc ccg = &ccb->ccg; #ifdef VP0_DEBUG - printf("vpo%d: XPT_CALC_GEOMETRY (bs=%d,vs=%jd,c=%d,h=%d,spt=%d) request\n", - vpo->vpo_unit, + device_printf(vpo->vpo_dev, "XPT_CALC_GEOMETRY (bs=%d,vs=%jd,c=%d,h=%d,spt=%d) request\n", ccg->block_size, (intmax_t)ccg->volume_size, ccg->cylinders, @@ -387,7 +380,7 @@ vpo_action(struct cam_sim *sim, union cc { #ifdef VP0_DEBUG - printf("vpo%d: XPT_RESET_BUS request\n", vpo->vpo_unit); + device_printf(vpo->vpo_dev, "XPT_RESET_BUS request\n"); #endif if (vpo->vpo_isplus) { @@ -413,7 +406,7 @@ vpo_action(struct cam_sim *sim, union cc struct ccb_pathinq *cpi = &ccb->cpi; #ifdef VP0_DEBUG - printf("vpo%d: XPT_PATH_INQ request\n", vpo->vpo_unit); + device_printf(vpo->vpo_dev, "XPT_PATH_INQ request\n"); #endif cpi->version_num = 1; /* XXX??? */ cpi->hba_inquiry = 0; Modified: head/sys/dev/ppbus/vpoio.c ============================================================================== --- head/sys/dev/ppbus/vpoio.c Tue Oct 21 16:46:50 2008 (r184129) +++ head/sys/dev/ppbus/vpoio.c Tue Oct 21 18:30:10 2008 (r184130) @@ -399,8 +399,8 @@ vpoio_detect(struct vpoio_data *vpo) if (!vpoio_in_disk_mode(vpo)) { vpo->vpo_mode_found = VP0_MODE_UNDEFINED; if (bootverbose) - printf("vpo%d: can't connect to the drive\n", - vpo->vpo_unit); + device_printf(vpo->vpo_dev, + "can't connect to the drive\n"); /* disconnect and release the bus */ ppb_MS_microseq(ppbus, vpo->vpo_dev, disconnect_microseq, @@ -420,8 +420,8 @@ vpoio_detect(struct vpoio_data *vpo) * may cause serious problem to the disk */ if (vpoio_in_disk_mode(vpo)) { if (bootverbose) - printf("vpo%d: can't disconnect from the drive\n", - vpo->vpo_unit); + device_printf(vpo->vpo_dev, + "can't disconnect from the drive\n"); goto error; } @@ -617,17 +617,17 @@ vpoio_attach(struct vpoio_data *vpo) case VP0_MODE_EPP: ppb_MS_GET_init(ppbus, vpo->vpo_dev, epp17_instr_body); ppb_MS_PUT_init(ppbus, vpo->vpo_dev, epp17_outstr_body); - printf("vpo%d: EPP mode\n", vpo->vpo_unit); + device_printf(vpo->vpo_dev, "EPP mode\n"); break; case VP0_MODE_PS2: ppb_MS_GET_init(ppbus, vpo->vpo_dev, ps2_inbyte_submicroseq); ppb_MS_PUT_init(ppbus, vpo->vpo_dev, spp_outbyte_submicroseq); - printf("vpo%d: PS2 mode\n", vpo->vpo_unit); + device_printf(vpo->vpo_dev, "PS2 mode\n"); break; case VP0_MODE_NIBBLE: ppb_MS_GET_init(ppbus, vpo->vpo_dev, vpo->vpo_nibble_inbyte_msq); ppb_MS_PUT_init(ppbus, vpo->vpo_dev, spp_outbyte_submicroseq); - printf("vpo%d: NIBBLE mode\n", vpo->vpo_unit); + device_printf(vpo->vpo_dev, "NIBBLE mode\n"); break; default: panic("vpo: unknown mode %d", vpo->vpo_mode_found); Modified: head/sys/dev/ppbus/vpoio.h ============================================================================== --- head/sys/dev/ppbus/vpoio.h Tue Oct 21 16:46:50 2008 (r184129) +++ head/sys/dev/ppbus/vpoio.h Tue Oct 21 18:30:10 2008 (r184130) @@ -66,7 +66,6 @@ struct vpo_nibble { #define VP0_MODE_EPP 0x3 struct vpoio_data { - unsigned short int vpo_unit; int vpo_mode_found; /* Mode found during init */ struct vpo_nibble vpo_nibble; @@ -77,8 +76,6 @@ struct vpoio_data { device_t vpo_dev; }; -#define vpoio_set_unit(vpo,unit) ((vpo)->vpo_unit = unit) - int vpoio_probe(device_t dev, struct vpoio_data *vpo); int vpoio_attach(struct vpoio_data *vpo); Modified: head/sys/dev/ppc/ppc.c ============================================================================== --- head/sys/dev/ppc/ppc.c Tue Oct 21 16:46:50 2008 (r184129) +++ head/sys/dev/ppc/ppc.c Tue Oct 21 18:30:10 2008 (r184130) @@ -133,8 +133,7 @@ ppc_ecp_sync(device_t dev) { DELAY(100); } - printf("ppc%d: ECP sync failed as data still " \ - "present in FIFO.\n", ppc->ppc_unit); + device_printf(dev, "ECP sync failed as data still present in FIFO.\n"); return; } @@ -752,8 +751,7 @@ config: if (bootverbose) { outb(csr, 0x1); - printf("ppc%d: SMC registers CR1=0x%x", ppc->ppc_unit, - inb(cio) & 0xff); + device_printf(dev, "SMC registers CR1=0x%x", inb(cio) & 0xff); outb(csr, 0x4); printf(" CR4=0x%x", inb(cio) & 0xff); @@ -1046,7 +1044,7 @@ found: if (bootverbose) { /* dump of registers */ - printf("ppc%d: 0x%x - ", ppc->ppc_unit, w83877f_keys[i]); + device_printf(dev, "0x%x - ", w83877f_keys[i]); for (i = 0; i <= 0xd; i ++) { outb(efir, i); printf("0x%x ", inb(efdr)); @@ -1062,7 +1060,6 @@ found: printf("0x%x ", inb(efdr)); } printf("\n"); - printf("ppc%d:", ppc->ppc_unit); } ppc->ppc_type = PPC_TYPE_GENERIC; @@ -1081,8 +1078,7 @@ found: switch (r) { case WINB_W83757: if (bootverbose) - printf("ppc%d: W83757 compatible mode\n", - ppc->ppc_unit); + device_printf(dev, "W83757 compatible mode\n"); return (-1); /* generic or SMC-like */ case WINB_EXTFDC: @@ -1090,19 +1086,20 @@ found: case WINB_EXT2FDD: case WINB_JOYSTICK: if (bootverbose) - printf(" not in parallel port mode\n"); + device_printf(dev, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 18:51:55 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 766EB1065699; Tue, 21 Oct 2008 18:51:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6524C8FC21; Tue, 21 Oct 2008 18:51:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LIptGK006142; Tue, 21 Oct 2008 18:51:55 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LIptwg006141; Tue, 21 Oct 2008 18:51:55 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200810211851.m9LIptwg006141@svn.freebsd.org> From: John Baldwin Date: Tue, 21 Oct 2008 18:51: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: r184135 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 18:51:55 -0000 Author: jhb Date: Tue Oct 21 18:51:55 2008 New Revision: 184135 URL: http://svn.freebsd.org/changeset/base/184135 Log: Restore the default maximum segment size for the bus dma tag to 64k as it is in 6.x and 7.x. The typo caused 64k transactions to be unnecessarily split up into two PRD entries. Modified: head/sys/dev/ata/ata-dma.c Modified: head/sys/dev/ata/ata-dma.c ============================================================================== --- head/sys/dev/ata/ata-dma.c Tue Oct 21 18:50:52 2008 (r184134) +++ head/sys/dev/ata/ata-dma.c Tue Oct 21 18:51:55 2008 (r184135) @@ -78,7 +78,7 @@ ata_dmainit(device_t dev) ch->dma.unload = ata_dmaunload; ch->dma.alignment = 2; ch->dma.boundary = 65536; - ch->dma.segsize = 63536; + ch->dma.segsize = 65536; ch->dma.max_iosize = 128 * DEV_BSIZE; ch->dma.max_address = BUS_SPACE_MAXADDR_32BIT; ch->dma.dma_slots = 6; From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 18:52:38 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C46111065683; Tue, 21 Oct 2008 18:52:38 +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 B33AB8FC0C; Tue, 21 Oct 2008 18:52:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LIqcYn006191; Tue, 21 Oct 2008 18:52:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LIqcrf006190; Tue, 21 Oct 2008 18:52:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200810211852.m9LIqcrf006190@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 21 Oct 2008 18:52: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: r184136 - head/sys/geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 18:52:38 -0000 Author: kib Date: Tue Oct 21 18:52:38 2008 New Revision: 184136 URL: http://svn.freebsd.org/changeset/base/184136 Log: Do not overflow crashdumpmap. Reported and tested by: pho Reviewed by: jhb MFC after: 1 week Modified: head/sys/geom/geom_disk.c Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Tue Oct 21 18:51:55 2008 (r184135) +++ head/sys/geom/geom_disk.c Tue Oct 21 18:52:38 2008 (r184136) @@ -179,7 +179,7 @@ g_disk_kerneldump(struct bio *bp, struct di.dumper = dp->d_dump; di.priv = dp; di.blocksize = dp->d_sectorsize; - di.maxiosize = dp->d_maxsize; + di.maxiosize = min(dp->d_maxsize, MAXDUMPPGS * PAGE_SIZE); di.mediaoffset = gkd->offset; if ((gkd->offset + gkd->length) > dp->d_mediasize) gkd->length = dp->d_mediasize - gkd->offset; From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 20:05:56 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id B45E11065672; Tue, 21 Oct 2008 20:05:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: "Attilio Rao" Date: Tue, 21 Oct 2008 16:05:41 -0400 User-Agent: KMail/1.6.2 References: <200810210431.m9L4V7Pb088978@svn.freebsd.org> <3bbf2fe10810210307t664cc8a2s62606f03427286f3@mail.gmail.com> In-Reply-To: <3bbf2fe10810210307t664cc8a2s62606f03427286f3@mail.gmail.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200810211605.46927.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184108 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 20:05:56 -0000 On Tuesday 21 October 2008 06:07 am, Attilio Rao wrote: > Something we could do with this is adding a "quirk" table of TSC > arch dependant known to be working (based on cpu_model and such) > and use that table in order to replace tsc_smp. Please note the invariant_tsc and smp_tsc are different. If we go with the route, we need two quirk tables. :-( BTW, Linux is using TSC now when the P-state invariant TSC bit is set by BIOS for AMD CPUs: http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg246251.html http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg246769.html "After a lot of discussions with AMD it turns out that TSC on Fam10h CPUs is synchronized when the CONSTANT_TSC cpuid bit is set. Or rather that if there are ever systems where that is not true it would be their BIOS' task to disable the bit." If this is statement is true, then we should do: if (amd_pminfo & AMDPM_TSC_INVARIANT) smp_tsc = 1; Also, I think we can safely assume: if (AMD64_FAMILY(cpu_id) >= 0x10) tsc_is_invariant = 1; Does anyone know whether these are correct assumptions? Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 20:33:41 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 299D1106567E; Tue, 21 Oct 2008 20:33:41 +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 16B9F8FC12; Tue, 21 Oct 2008 20:33:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LKXf9f008091; Tue, 21 Oct 2008 20:33:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LKXekg008087; Tue, 21 Oct 2008 20:33:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810212033.m9LKXekg008087@svn.freebsd.org> From: Alexander Motin Date: Tue, 21 Oct 2008 20:33: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: r184138 - in head/sys: conf dev/sdhci modules modules/sdhci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 20:33:41 -0000 Author: mav Date: Tue Oct 21 20:33:40 2008 New Revision: 184138 URL: http://svn.freebsd.org/changeset/base/184138 Log: Import sdhci (PCI SD Host Controller) driver. Driver supports PCI devices with class 8 and subclass 5 according to SD Host Controller Specification. Update NOTES, enable module and static build. Enable related mmc and mmcsd modules build. Discussed on: mobile@, current@ Added: head/sys/dev/sdhci/ head/sys/dev/sdhci/sdhci.c (contents, props changed) head/sys/dev/sdhci/sdhci.h (contents, props changed) head/sys/modules/sdhci/ head/sys/modules/sdhci/Makefile (contents, props changed) Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/modules/Makefile Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Oct 21 19:42:56 2008 (r184137) +++ head/sys/conf/NOTES Tue Oct 21 20:33:40 2008 (r184138) @@ -2216,10 +2216,13 @@ device cardbus # # MMC/SD # -# mmc: mmc bus -# mmcsd: mmc memory and sd cards. -#device mmc -#device mmcsd +# mmc MMC/SD bus +# mmcsd MMC/SD memory card +# sdhci Generic PCI SD Host Controller +# +device mmc +device mmcsd +device sdhci # # SMB bus Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Oct 21 19:42:56 2008 (r184137) +++ head/sys/conf/files Tue Oct 21 20:33:40 2008 (r184138) @@ -1136,6 +1136,7 @@ dev/scc/scc_dev_sab82532.c optional scc dev/scc/scc_dev_z8530.c optional scc dev/scd/scd.c optional scd isa dev/scd/scd_isa.c optional scd isa +dev/sdhci/sdhci.c optional sdhci pci dev/sf/if_sf.c optional sf pci dev/si/si.c optional si dev/si/si2_z280.c optional si Added: head/sys/dev/sdhci/sdhci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/sdhci/sdhci.c Tue Oct 21 20:33:40 2008 (r184138) @@ -0,0 +1,1530 @@ +/*- + * Copyright (c) 2008 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. + * 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 +#include + +#include "mmcbr_if.h" +#include "sdhci.h" + +#define DMA_BLOCK_SIZE 4096 +#define DMA_BOUNDARY 0 /* DMA reload every 4K */ + +/* Controller doesn't honor resets unless we touch the clock register */ +#define SDHCI_QUIRK_CLOCK_BEFORE_RESET (1<<0) +/* Controller really supports DMA */ +#define SDHCI_QUIRK_FORCE_DMA (1<<1) +/* Controller has unusable DMA engine */ +#define SDHCI_QUIRK_BROKEN_DMA (1<<2) +/* Controller doesn't like to be reset when there is no card inserted. */ +#define SDHCI_QUIRK_NO_CARD_NO_RESET (1<<3) +/* Controller has flaky internal state so reset it on each ios change */ +#define SDHCI_QUIRK_RESET_ON_IOS (1<<4) +/* Controller can only DMA chunk sizes that are a multiple of 32 bits */ +#define SDHCI_QUIRK_32BIT_DMA_SIZE (1<<5) +/* Controller needs to be reset after each request to stay stable */ +#define SDHCI_QUIRK_RESET_AFTER_REQUEST (1<<6) +/* Controller has an off-by-one issue with timeout value */ +#define SDHCI_QUIRK_INCR_TIMEOUT_CONTROL (1<<7) +/* Controller has broken read timings */ +#define SDHCI_QUIRK_BROKEN_TIMINGS (1<<8) + +static const struct sdhci_device { + uint32_t model; + uint16_t subvendor; + char *desc; + u_int quirks; +} sdhci_devices[] = { + { 0x08221180, 0xffff, "RICOH R5C822 SD", + SDHCI_QUIRK_FORCE_DMA }, + { 0x8034104c, 0xffff, "TI XX21/XX11 SD", + SDHCI_QUIRK_FORCE_DMA }, + { 0x05501524, 0xffff, "ENE CB712 SD", + SDHCI_QUIRK_BROKEN_TIMINGS }, + { 0x05511524, 0xffff, "ENE CB712 SD 2", + SDHCI_QUIRK_BROKEN_TIMINGS }, + { 0x07501524, 0xffff, "ENE CB714 SD", + SDHCI_QUIRK_RESET_ON_IOS | + SDHCI_QUIRK_BROKEN_TIMINGS }, + { 0x07511524, 0xffff, "ENE CB714 SD 2", + SDHCI_QUIRK_RESET_ON_IOS | + SDHCI_QUIRK_BROKEN_TIMINGS }, + { 0x410111ab, 0xffff, "Marvell CaFe SD", + SDHCI_QUIRK_INCR_TIMEOUT_CONTROL }, + { 0x2381197B, 0xffff, "JMicron JMB38X SD", + SDHCI_QUIRK_32BIT_DMA_SIZE | + SDHCI_QUIRK_RESET_AFTER_REQUEST }, + { 0, 0xffff, NULL, + 0 } +}; + +struct sdhci_softc; + +struct sdhci_slot { + struct sdhci_softc *sc; + device_t dev; /* Slot device */ + u_char num; /* Slot number */ + u_char opt; /* Slot options */ +#define SDHCI_HAVE_DMA 1 + uint32_t max_clk; /* Max possible freq */ + uint32_t timeout_clk; /* Timeout freq */ + struct resource *mem_res; /* Memory resource */ + int mem_rid; + bus_dma_tag_t dmatag; + bus_dmamap_t dmamap; + u_char *dmamem; + bus_addr_t paddr; /* DMA buffer address */ + struct task card_task; /* Card presence check task */ + struct callout card_callout; /* Card insert delay callout */ + struct mmc_host host; /* Host parameters */ + struct mmc_request *req; /* Current request */ + struct mmc_command *curcmd; /* Current command of current request */ + + uint32_t intmask; /* Current interrupt mask */ + uint32_t clock; /* Current clock freq. */ + size_t offset; /* Data buffer offset */ + uint8_t hostctrl; /* Current host control register */ + u_char power; /* Current power */ + u_char bus_busy; /* Bus busy status */ + u_char cmd_done; /* CMD command part done flag */ + u_char data_done; /* DAT command part done flag */ + u_char flags; /* Request execution flags */ +#define CMD_STARTED 1 +#define STOP_STARTED 2 +#define SDHCI_USE_DMA 4 /* Use DMA for this req. */ + struct mtx mtx; /* Slot mutex */ +}; + +struct sdhci_softc { + device_t dev; /* Controller device */ + u_int quirks; /* Chip specific quirks */ + struct resource *irq_res; /* IRQ resource */ + int irq_rid; + void *intrhand; /* Interrupt handle */ + + int num_slots; /* Number of slots on this controller */ + struct sdhci_slot slots[6]; +}; + +static inline uint8_t +RD1(struct sdhci_slot *slot, bus_size_t off) +{ + bus_barrier(slot->mem_res, 0, 0xFF, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + return bus_read_1(slot->mem_res, off); +} + +static inline void +WR1(struct sdhci_slot *slot, bus_size_t off, uint8_t val) +{ + bus_barrier(slot->mem_res, 0, 0xFF, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + bus_write_1(slot->mem_res, off, val); +} + +static inline uint16_t +RD2(struct sdhci_slot *slot, bus_size_t off) +{ + bus_barrier(slot->mem_res, 0, 0xFF, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + return bus_read_2(slot->mem_res, off); +} + +static inline void +WR2(struct sdhci_slot *slot, bus_size_t off, uint16_t val) +{ + bus_barrier(slot->mem_res, 0, 0xFF, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + bus_write_2(slot->mem_res, off, val); +} + +static inline uint32_t +RD4(struct sdhci_slot *slot, bus_size_t off) +{ + bus_barrier(slot->mem_res, 0, 0xFF, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + return bus_read_4(slot->mem_res, off); +} + +static inline void +WR4(struct sdhci_slot *slot, bus_size_t off, uint32_t val) +{ + bus_barrier(slot->mem_res, 0, 0xFF, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + bus_write_4(slot->mem_res, off, val); +} + +/* bus entry points */ +static int sdhci_probe(device_t dev); +static int sdhci_attach(device_t dev); +static int sdhci_detach(device_t dev); +static void sdhci_intr(void *); + +static void sdhci_set_clock(struct sdhci_slot *slot, uint32_t clock); +static void sdhci_start(struct sdhci_slot *slot); +static void sdhci_start_data(struct sdhci_slot *slot, struct mmc_data *data); + +static void sdhci_card_task(void *, int); + +/* helper routines */ +#define SDHCI_LOCK(_slot) mtx_lock(&(_slot)->mtx) +#define SDHCI_UNLOCK(_slot) mtx_unlock(&(_slot)->mtx) +#define SDHCI_LOCK_INIT(_slot) \ + mtx_init(&_slot->mtx, "SD slot mtx", "sdhci", MTX_DEF) +#define SDHCI_LOCK_DESTROY(_slot) mtx_destroy(&_slot->mtx); +#define SDHCI_ASSERT_LOCKED(_slot) mtx_assert(&_slot->mtx, MA_OWNED); +#define SDHCI_ASSERT_UNLOCKED(_slot) mtx_assert(&_slot->mtx, MA_NOTOWNED); + +static int +slot_printf(struct sdhci_slot *slot, const char * fmt, ...) +{ + va_list ap; + int retval; + + retval = printf("%s-slot%d: ", + device_get_nameunit(slot->sc->dev), slot->num); + + va_start(ap, fmt); + retval += vprintf(fmt, ap); + va_end(ap); + return (retval); +} + +static void +sdhci_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + if (error != 0) { + printf("getaddr: error %d\n", error); + return; + } + *(bus_addr_t *)arg = segs[0].ds_addr; +} + +static void +sdhci_dumpregs(struct sdhci_slot *slot) +{ + slot_printf(slot, + "============== REGISTER DUMP ==============\n"); + + slot_printf(slot, "Sys addr: 0x%08x | Version: 0x%08x\n", + RD4(slot, SDHCI_DMA_ADDRESS), RD2(slot, SDHCI_HOST_VERSION)); + slot_printf(slot, "Blk size: 0x%08x | Blk cnt: 0x%08x\n", + RD2(slot, SDHCI_BLOCK_SIZE), RD2(slot, SDHCI_BLOCK_COUNT)); + slot_printf(slot, "Argument: 0x%08x | Trn mode: 0x%08x\n", + RD4(slot, SDHCI_ARGUMENT), RD2(slot, SDHCI_TRANSFER_MODE)); + slot_printf(slot, "Present: 0x%08x | Host ctl: 0x%08x\n", + RD4(slot, SDHCI_PRESENT_STATE), RD1(slot, SDHCI_HOST_CONTROL)); + slot_printf(slot, "Power: 0x%08x | Blk gap: 0x%08x\n", + RD1(slot, SDHCI_POWER_CONTROL), RD1(slot, SDHCI_BLOCK_GAP_CONTROL)); + slot_printf(slot, "Wake-up: 0x%08x | Clock: 0x%08x\n", + RD1(slot, SDHCI_WAKE_UP_CONTROL), RD2(slot, SDHCI_CLOCK_CONTROL)); + slot_printf(slot, "Timeout: 0x%08x | Int stat: 0x%08x\n", + RD1(slot, SDHCI_TIMEOUT_CONTROL), RD4(slot, SDHCI_INT_STATUS)); + slot_printf(slot, "Int enab: 0x%08x | Sig enab: 0x%08x\n", + RD4(slot, SDHCI_INT_ENABLE), RD4(slot, SDHCI_SIGNAL_ENABLE)); + slot_printf(slot, "AC12 err: 0x%08x | Slot int: 0x%08x\n", + RD2(slot, SDHCI_ACMD12_ERR), RD2(slot, SDHCI_SLOT_INT_STATUS)); + slot_printf(slot, "Caps: 0x%08x | Max curr: 0x%08x\n", + RD4(slot, SDHCI_CAPABILITIES), RD4(slot, SDHCI_MAX_CURRENT)); + + slot_printf(slot, + "===========================================\n"); +} + +static void +sdhci_reset(struct sdhci_slot *slot, uint8_t mask) +{ + int timeout; + uint8_t res; + + if (slot->sc->quirks & SDHCI_QUIRK_NO_CARD_NO_RESET) { + if (!(RD4(slot, SDHCI_PRESENT_STATE) & + SDHCI_CARD_PRESENT)) + return; + } + + /* Some controllers need this kick or reset won't work. */ + if ((mask & SDHCI_RESET_ALL) == 0 && + (slot->sc->quirks & SDHCI_QUIRK_CLOCK_BEFORE_RESET)) { + uint32_t clock; + + /* This is to force an update */ + clock = slot->clock; + slot->clock = 0; + sdhci_set_clock(slot, clock); + } + + WR1(slot, SDHCI_SOFTWARE_RESET, mask); + + if (mask & SDHCI_RESET_ALL) + slot->clock = 0; + + /* Wait max 100 ms */ + timeout = 100; + /* Controller clears the bits when it's done */ + while ((res = RD1(slot, SDHCI_SOFTWARE_RESET)) & mask) { + if (timeout == 0) { + slot_printf(slot, + "Reset 0x%x never completed - 0x%x.\n", + (int)mask, (int)res); + sdhci_dumpregs(slot); + return; + } + timeout--; + DELAY(1000); + } +} + +static void +sdhci_init(struct sdhci_slot *slot) +{ + + sdhci_reset(slot, SDHCI_RESET_ALL); + + /* Enable interrupts. */ + slot->intmask = SDHCI_INT_BUS_POWER | SDHCI_INT_DATA_END_BIT | + SDHCI_INT_DATA_CRC | SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_INDEX | + SDHCI_INT_END_BIT | SDHCI_INT_CRC | SDHCI_INT_TIMEOUT | + SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT | + SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | + SDHCI_INT_DMA_END | SDHCI_INT_DATA_END | SDHCI_INT_RESPONSE | + SDHCI_INT_ACMD12ERR; + WR4(slot, SDHCI_INT_ENABLE, slot->intmask); + WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask); +} + +static void +sdhci_set_clock(struct sdhci_slot *slot, uint32_t clock) +{ + uint32_t res; + uint16_t clk; + int timeout; + + if (clock == slot->clock) + return; + slot->clock = clock; + + /* Turn off the clock. */ + WR2(slot, SDHCI_CLOCK_CONTROL, 0); + /* If no clock requested - left it so. */ + if (clock == 0) + return; + /* Looking for highest freq <= clock. */ + res = slot->max_clk; + for (clk = 1; clk < 256; clk <<= 1) { + if (res <= clock) + break; + res >>= 1; + } + /* Divider 1:1 is 0x00, 2:1 is 0x01, 256:1 is 0x80 ... */ + clk >>= 1; + /* Now we have got divider, set it. */ + clk <<= SDHCI_DIVIDER_SHIFT; + WR2(slot, SDHCI_CLOCK_CONTROL, clk); + /* Enable clock. */ + clk |= SDHCI_CLOCK_INT_EN; + WR2(slot, SDHCI_CLOCK_CONTROL, clk); + /* Wait up to 10 ms until it stabilize. */ + timeout = 10; + while (!((clk = RD2(slot, SDHCI_CLOCK_CONTROL)) + & SDHCI_CLOCK_INT_STABLE)) { + if (timeout == 0) { + slot_printf(slot, + "Internal clock never stabilised.\n"); + sdhci_dumpregs(slot); + return; + } + timeout--; + DELAY(1000); + } + /* Pass clock signal to the bus. */ + clk |= SDHCI_CLOCK_CARD_EN; + WR2(slot, SDHCI_CLOCK_CONTROL, clk); +} + +static void +sdhci_set_power(struct sdhci_slot *slot, u_char power) +{ + uint8_t pwr; + + if (slot->power == power) + return; + slot->power = power; + + /* Turn off the power. */ + pwr = 0; + WR1(slot, SDHCI_POWER_CONTROL, pwr); + /* If power down requested - left it so. */ + if (power == 0) + return; + /* Set voltage. */ + switch (1 << power) { + case MMC_OCR_LOW_VOLTAGE: + pwr |= SDHCI_POWER_180; + break; + case MMC_OCR_290_300: + case MMC_OCR_300_310: + pwr |= SDHCI_POWER_300; + break; + case MMC_OCR_320_330: + case MMC_OCR_330_340: + pwr |= SDHCI_POWER_330; + break; + } + WR1(slot, SDHCI_POWER_CONTROL, pwr); + /* Turn on the power. */ + pwr |= SDHCI_POWER_ON; + WR1(slot, SDHCI_POWER_CONTROL, pwr); +} + +static void +sdhci_read_block_pio(struct sdhci_slot *slot) +{ + uint32_t data; + char *buffer; + size_t left; + + buffer = slot->curcmd->data->data; + buffer += slot->offset; + /* Transfer one block at a time. */ + left = min(512, slot->curcmd->data->len - slot->offset); + slot->offset += left; + + /* If we are too fast, broken controllers return zeroes. */ + if (slot->sc->quirks & SDHCI_QUIRK_BROKEN_TIMINGS) + DELAY(10); + /* Handle unalligned and alligned buffer cases. */ + if ((intptr_t)buffer & 3) { + while (left > 3) { + data = RD4(slot, SDHCI_BUFFER); + buffer[0] = data; + buffer[1] = (data >> 8); + buffer[2] = (data >> 16); + buffer[3] = (data >> 24); + buffer += 4; + left -= 4; + } + } else { + bus_read_multi_stream_4(slot->mem_res, SDHCI_BUFFER, + (uint32_t *)buffer, left >> 2); + left &= 3; + } + /* Handle uneven size case. */ + if (left > 0) { + data = RD4(slot, SDHCI_BUFFER); + while (left > 0) { + *(buffer++) = data; + data >>= 8; + left--; + } + } +} + +static void +sdhci_write_block_pio(struct sdhci_slot *slot) +{ + uint32_t data = 0; + char *buffer; + size_t left; + + buffer = slot->curcmd->data->data; + buffer += slot->offset; + /* Transfer one block at a time. */ + left = min(512, slot->curcmd->data->len - slot->offset); + slot->offset += left; + + /* Handle unalligned and alligned buffer cases. */ + if ((intptr_t)buffer & 3) { + while (left > 3) { + data = buffer[0] + + (buffer[1] << 8) + + (buffer[2] << 16) + + (buffer[3] << 24); + left -= 4; + buffer += 4; + WR4(slot, SDHCI_BUFFER, data); + } + } else { + bus_write_multi_stream_4(slot->mem_res, SDHCI_BUFFER, + (uint32_t *)buffer, left >> 2); + left &= 3; + } + /* Handle uneven size case. */ + if (left > 0) { + while (left > 0) { + data <<= 8; + data += *(buffer++); + left--; + } + WR4(slot, SDHCI_BUFFER, data); + } +} + +static void +sdhci_transfer_pio(struct sdhci_slot *slot) +{ + + /* Read as many blocks as possible. */ + if (slot->curcmd->data->flags & MMC_DATA_READ) { + while (RD4(slot, SDHCI_PRESENT_STATE) & + SDHCI_DATA_AVAILABLE) { + sdhci_read_block_pio(slot); + if (slot->offset >= slot->curcmd->data->len) + break; + } + } else { + while (RD4(slot, SDHCI_PRESENT_STATE) & + SDHCI_SPACE_AVAILABLE) { + sdhci_write_block_pio(slot); + if (slot->offset >= slot->curcmd->data->len) + break; + } + } +} + +static void +sdhci_card_delay(void *arg) +{ + struct sdhci_slot *slot = arg; + + taskqueue_enqueue(taskqueue_swi_giant, &slot->card_task); +} + +static void +sdhci_card_task(void *arg, int pending) +{ + struct sdhci_slot *slot = arg; + + SDHCI_LOCK(slot); + if (RD4(slot, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT) { + if (slot->dev == NULL) { + /* If card is present - attach mmc bus. */ + slot->dev = device_add_child(slot->sc->dev, "mmc", -1); + device_set_ivars(slot->dev, slot); + SDHCI_UNLOCK(slot); + device_probe_and_attach(slot->dev); + } else + SDHCI_UNLOCK(slot); + } else { + if (slot->dev != NULL) { + /* If no card present - detach mmc bus. */ + device_t d = slot->dev; + slot->dev = NULL; + SDHCI_UNLOCK(slot); + device_delete_child(slot->sc->dev, d); + } else + SDHCI_UNLOCK(slot); + } +} + +static int +sdhci_probe(device_t dev) +{ + uint32_t model; + uint16_t subvendor; + uint8_t class, subclass; + int i, result; + + model = (uint32_t)pci_get_device(dev) << 16; + model |= (uint32_t)pci_get_vendor(dev) & 0x0000ffff; + subvendor = pci_get_subvendor(dev); + class = pci_get_class(dev); + subclass = pci_get_subclass(dev); + + result = ENXIO; + for (i = 0; sdhci_devices[i].model != 0; i++) { + if (sdhci_devices[i].model == model && + (sdhci_devices[i].subvendor == 0xffff || + sdhci_devices[i].subvendor == subvendor)) { + device_set_desc(dev, sdhci_devices[i].desc); + result = BUS_PROBE_DEFAULT; + break; + } + } + if (result == ENXIO && class == PCIC_BASEPERIPH && + subclass == PCIS_BASEPERIPH_SDHC) { + device_set_desc(dev, "Generic SD HCI"); + result = BUS_PROBE_GENERIC; + } + + return (result); +} + +static int +sdhci_attach(device_t dev) +{ + struct sdhci_softc *sc = device_get_softc(dev); + uint32_t model; + uint16_t subvendor; + uint8_t class, subclass, progif; + int err, slots, bar, i; + + sc->dev = dev; + model = (uint32_t)pci_get_device(dev) << 16; + model |= (uint32_t)pci_get_vendor(dev) & 0x0000ffff; + subvendor = pci_get_subvendor(dev); + class = pci_get_class(dev); + subclass = pci_get_subclass(dev); + progif = pci_get_progif(dev); + /* Apply chip specific quirks. */ + for (i = 0; sdhci_devices[i].model != 0; i++) { + if (sdhci_devices[i].model == model && + (sdhci_devices[i].subvendor == 0xffff || + sdhci_devices[i].subvendor == subvendor)) { + sc->quirks = sdhci_devices[i].quirks; + break; + } + } + /* Read slots info from PCI registers. */ + slots = pci_read_config(dev, PCI_SLOT_INFO, 1); + bar = PCI_SLOT_INFO_FIRST_BAR(slots); + slots = PCI_SLOT_INFO_SLOTS(slots); + if (slots > 6 || bar > 5) { + device_printf(dev, "Incorrect slots information (%d, %d).\n", + slots, bar); + return (EINVAL); + } + /* Allocate IRQ. */ + sc->irq_rid = 0; + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, + RF_SHAREABLE | RF_ACTIVE); + if (sc->irq_res == NULL) { + device_printf(dev, "Can't allocate IRQ\n"); + return (ENOMEM); + } + /* Scan all slots. */ + for (i = 0; i < slots; i++) { + struct sdhci_slot *slot = &sc->slots[sc->num_slots]; + uint32_t caps; + + SDHCI_LOCK_INIT(slot); + slot->sc = sc; + slot->num = sc->num_slots; + /* Allocate memory. */ + slot->mem_rid = PCIR_BAR(bar + i); + slot->mem_res = bus_alloc_resource(dev, + SYS_RES_MEMORY, &slot->mem_rid, 0ul, ~0ul, 0x100, RF_ACTIVE); + if (slot->mem_res == NULL) { + device_printf(dev, "Can't allocate memory\n"); + SDHCI_LOCK_DESTROY(slot); + continue; + } + /* Allocate DMA tag. */ + err = bus_dma_tag_create(bus_get_dma_tag(dev), + DMA_BLOCK_SIZE, 0, BUS_SPACE_MAXADDR_32BIT, + BUS_SPACE_MAXADDR, NULL, NULL, + DMA_BLOCK_SIZE, 1, DMA_BLOCK_SIZE, + BUS_DMA_ALLOCNOW, NULL, NULL, + &slot->dmatag); + if (err != 0) { + device_printf(dev, "Can't create DMA tag\n"); + SDHCI_LOCK_DESTROY(slot); + continue; + } + /* Allocate DMA memory. */ + err = bus_dmamem_alloc(slot->dmatag, (void **)&slot->dmamem, + BUS_DMA_NOWAIT, &slot->dmamap); + if (err != 0) { + device_printf(dev, "Can't alloc DMA memory\n"); + SDHCI_LOCK_DESTROY(slot); + continue; + } + /* Map the memory. */ + err = bus_dmamap_load(slot->dmatag, slot->dmamap, + (void *)slot->dmamem, DMA_BLOCK_SIZE, + sdhci_getaddr, &slot->paddr, 0); + if (err != 0 || slot->paddr == 0) { + device_printf(dev, "Can't load DMA memory\n"); + SDHCI_LOCK_DESTROY(slot); + continue; + } + /* Initialize slot. */ + sdhci_init(slot); + caps = RD4(slot, SDHCI_CAPABILITIES); + /* Calculate base clock frequency. */ + slot->max_clk = + (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT; + if (slot->max_clk == 0) { + device_printf(dev, "Hardware doesn't specify base clock " + "frequency.\n"); + } + slot->max_clk *= 1000000; + /* Calculate timeout clock frequency. */ + slot->timeout_clk = + (caps & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT; + if (slot->timeout_clk == 0) { + device_printf(dev, "Hardware doesn't specify timeout clock " + "frequency.\n"); + } + if (caps & SDHCI_TIMEOUT_CLK_UNIT) + slot->timeout_clk *= 1000; + + slot->host.f_min = slot->max_clk / 256; + slot->host.f_max = slot->max_clk; + slot->host.host_ocr = 0; + if (caps & SDHCI_CAN_VDD_330) + slot->host.host_ocr |= MMC_OCR_320_330 | MMC_OCR_330_340; + if (caps & SDHCI_CAN_VDD_300) + slot->host.host_ocr |= MMC_OCR_290_300 | MMC_OCR_300_310; + if (caps & SDHCI_CAN_VDD_180) + slot->host.host_ocr |= MMC_OCR_LOW_VOLTAGE; + if (slot->host.host_ocr == 0) { + device_printf(dev, "Hardware doesn't report any " + "support voltages.\n"); + } + slot->host.caps = MMC_CAP_4_BIT_DATA; + if (caps & SDHCI_CAN_DO_HISPD) + slot->host.caps |= MMC_CAP_HSPEED; + /* Decide if we have usable DMA. */ + if (caps & SDHCI_CAN_DO_DMA) + slot->opt |= SDHCI_HAVE_DMA; + if (class == PCIC_BASEPERIPH && + subclass == PCIS_BASEPERIPH_SDHC && + progif != PCI_SDHCI_IFDMA) + slot->opt &= ~SDHCI_HAVE_DMA; + if (sc->quirks & SDHCI_QUIRK_BROKEN_DMA) + slot->opt &= ~SDHCI_HAVE_DMA; + if (sc->quirks & SDHCI_QUIRK_FORCE_DMA) + slot->opt |= SDHCI_HAVE_DMA; + + if (bootverbose) { + slot_printf(slot, "%uMHz%s 4bits%s%s%s %s\n", + slot->max_clk / 1000000, + (caps & SDHCI_CAN_DO_HISPD) ? " HS" : "", + (caps & SDHCI_CAN_VDD_330) ? " 3.3V" : "", + (caps & SDHCI_CAN_VDD_300) ? " 3.0V" : "", + (caps & SDHCI_CAN_VDD_180) ? " 1.8V" : "", + (slot->opt & SDHCI_HAVE_DMA) ? "DMA" : "PIO"); + sdhci_dumpregs(slot); + } + + TASK_INIT(&slot->card_task, 0, sdhci_card_task, slot); + callout_init(&slot->card_callout, 1); + sc->num_slots++; + } + device_printf(dev, "%d slot(s) allocated\n", sc->num_slots); + /* Activate the interrupt */ + err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, sdhci_intr, sc, &sc->intrhand); + if (err) + device_printf(dev, "Can't setup IRQ\n"); + pci_enable_busmaster(dev); + /* Process cards detection. */ + for (i = 0; i < sc->num_slots; i++) { + struct sdhci_slot *slot = &sc->slots[i]; + + sdhci_card_task(slot, 0); + } + + return (0); +} + +static int +sdhci_detach(device_t dev) +{ + struct sdhci_softc *sc = device_get_softc(dev); + int i; + + bus_teardown_intr(dev, sc->irq_res, sc->intrhand); + bus_release_resource(dev, SYS_RES_IRQ, + sc->irq_rid, sc->irq_res); + + for (i = 0; i < sc->num_slots; i++) { + struct sdhci_slot *slot = &sc->slots[i]; + device_t d; + + callout_drain(&slot->card_callout); + taskqueue_drain(taskqueue_swi_giant, &slot->card_task); + + SDHCI_LOCK(slot); + d = slot->dev; + slot->dev = NULL; + SDHCI_UNLOCK(slot); + if (d != NULL) + device_delete_child(dev, d); + + SDHCI_LOCK(slot); + sdhci_reset(slot, SDHCI_RESET_ALL); + SDHCI_UNLOCK(slot); + bus_dmamap_unload(slot->dmatag, slot->dmamap); + bus_dmamem_free(slot->dmatag, slot->dmamem, slot->dmamap); + bus_dma_tag_destroy(slot->dmatag); + bus_release_resource(dev, SYS_RES_MEMORY, + slot->mem_rid, slot->mem_res); + SDHCI_LOCK_DESTROY(slot); + } + return (0); +} + +static int +sdhci_update_ios(device_t brdev, device_t reqdev) +{ + struct sdhci_slot *slot = device_get_ivars(reqdev); + struct mmc_ios *ios = &slot->host.ios; + + SDHCI_LOCK(slot); + /* Do full reset on bus power down to clear from any state. */ + if (ios->power_mode == power_off) { + WR4(slot, SDHCI_SIGNAL_ENABLE, 0); + sdhci_init(slot); + } + /* Configure the bus. */ + sdhci_set_clock(slot, ios->clock); + sdhci_set_power(slot, (ios->power_mode == power_off)?0:ios->vdd); + if (ios->bus_width == bus_width_4) + slot->hostctrl |= SDHCI_CTRL_4BITBUS; + else + slot->hostctrl &= ~SDHCI_CTRL_4BITBUS; + if (ios->timing == bus_timing_hs) + slot->hostctrl |= SDHCI_CTRL_HISPD; + else + slot->hostctrl &= ~SDHCI_CTRL_HISPD; + WR1(slot, SDHCI_HOST_CONTROL, slot->hostctrl); + /* Some controllers like reset after bus changes. */ + if(slot->sc->quirks & SDHCI_QUIRK_RESET_ON_IOS) + sdhci_reset(slot, SDHCI_RESET_CMD | SDHCI_RESET_DATA); + + SDHCI_UNLOCK(slot); + return (0); +} + +static void +sdhci_set_transfer_mode(struct sdhci_slot *slot, + struct mmc_data *data) +{ + uint16_t mode; + + if (data == NULL) + return; + + mode = SDHCI_TRNS_BLK_CNT_EN; + if (data->len > 512) + mode |= SDHCI_TRNS_MULTI; + if (data->flags & MMC_DATA_READ) + mode |= SDHCI_TRNS_READ; + if (slot->req->stop) + mode |= SDHCI_TRNS_ACMD12; + if (slot->flags & SDHCI_USE_DMA) + mode |= SDHCI_TRNS_DMA; + + WR2(slot, SDHCI_TRANSFER_MODE, mode); +} + +static void +sdhci_start_command(struct sdhci_slot *slot, struct mmc_command *cmd) +{ + struct mmc_request *req = slot->req; + int flags, timeout; + uint32_t mask, state; + + slot->curcmd = cmd; + slot->cmd_done = 0; + + cmd->error = MMC_ERR_NONE; + + /* This flags combination is not supported by controller. */ + if ((cmd->flags & MMC_RSP_136) && (cmd->flags & MMC_RSP_BUSY)) { + slot_printf(slot, "Unsupported response type!\n"); + cmd->error = MMC_ERR_FAILED; + slot->req = NULL; + slot->curcmd = NULL; + req->done(req); + return; + } + + /* Read controller present state. */ + state = RD4(slot, SDHCI_PRESENT_STATE); + /* Do not issue command if there is no card. */ + if ((state & SDHCI_CARD_PRESENT) == 0) { + cmd->error = MMC_ERR_FAILED; + slot->req = NULL; + slot->curcmd = NULL; + req->done(req); + return; + } + /* Always wait for free CMD bus. */ + mask = SDHCI_CMD_INHIBIT; + /* Wait for free DAT if we have data or busy signal. */ + if (cmd->data || (cmd->flags & MMC_RSP_BUSY)) + mask |= SDHCI_DAT_INHIBIT; + /* We shouldn't wait for DAT for stop commands. */ + if (cmd == slot->req->stop) + mask &= ~SDHCI_DAT_INHIBIT; + /* Wait for bus no more then 10 ms. */ + timeout = 10; + while (state & mask) { + if (timeout == 0) { + slot_printf(slot, "Controller never released " + "inhibit bit(s).\n"); + sdhci_dumpregs(slot); + cmd->error = MMC_ERR_FAILED; + slot->req = NULL; + slot->curcmd = NULL; + req->done(req); + return; + } + timeout--; + DELAY(1000); + state = RD4(slot, SDHCI_PRESENT_STATE); + } + + /* Prepare command flags. */ + if (!(cmd->flags & MMC_RSP_PRESENT)) + flags = SDHCI_CMD_RESP_NONE; + else if (cmd->flags & MMC_RSP_136) + flags = SDHCI_CMD_RESP_LONG; + else if (cmd->flags & MMC_RSP_BUSY) + flags = SDHCI_CMD_RESP_SHORT_BUSY; + else + flags = SDHCI_CMD_RESP_SHORT; + if (cmd->flags & MMC_RSP_CRC) + flags |= SDHCI_CMD_CRC; + if (cmd->flags & MMC_RSP_OPCODE) + flags |= SDHCI_CMD_INDEX; + if (cmd->data) + flags |= SDHCI_CMD_DATA; + if (cmd->opcode == MMC_STOP_TRANSMISSION) + flags |= SDHCI_CMD_TYPE_ABORT; + /* Prepare data. */ + sdhci_start_data(slot, cmd->data); + /* + * Interrupt aggregation: To reduce total number of interrupts + * group response interrupt with data interrupt when possible. + * If there going to be data interrupt, mask response one. + */ + if (slot->data_done == 0) { + WR4(slot, SDHCI_SIGNAL_ENABLE, + slot->intmask &= ~SDHCI_INT_RESPONSE); + } + /* Set command argument. */ + WR4(slot, SDHCI_ARGUMENT, cmd->arg); + /* Set data transfer mode. */ + sdhci_set_transfer_mode(slot, cmd->data); + /* Set command flags. */ + WR1(slot, SDHCI_COMMAND_FLAGS, flags); + /* Start command. */ + WR1(slot, SDHCI_COMMAND, cmd->opcode); +} + +static void +sdhci_finish_command(struct sdhci_slot *slot) +{ + int i; + + slot->cmd_done = 1; + /* Interrupt aggregation: Restore command interrupt. + * Main restore point for the case when command interrupt + * happened first. */ + WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask |= SDHCI_INT_RESPONSE); + /* In case of error - reset host and return. */ + if (slot->curcmd->error) { + sdhci_reset(slot, SDHCI_RESET_CMD); + sdhci_reset(slot, SDHCI_RESET_DATA); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 20:55:41 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E09AF1065675; Tue, 21 Oct 2008 20:55:41 +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 D00438FC17; Tue, 21 Oct 2008 20:55:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LKtfgN008498; Tue, 21 Oct 2008 20:55:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LKtfdN008497; Tue, 21 Oct 2008 20:55:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810212055.m9LKtfdN008497@svn.freebsd.org> From: Alexander Motin Date: Tue, 21 Oct 2008 20:55:41 +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: r184139 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 20:55:42 -0000 Author: mav Date: Tue Oct 21 20:55:41 2008 New Revision: 184139 URL: http://svn.freebsd.org/changeset/base/184139 Log: Add "SD host controller" subclass name. Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Oct 21 20:33:40 2008 (r184138) +++ head/sys/dev/pci/pci.c Tue Oct 21 20:55:41 2008 (r184139) @@ -2987,6 +2987,7 @@ static struct {PCIC_BASEPERIPH, PCIS_BASEPERIPH_TIMER, "timer"}, {PCIC_BASEPERIPH, PCIS_BASEPERIPH_RTC, "realtime clock"}, {PCIC_BASEPERIPH, PCIS_BASEPERIPH_PCIHOT, "PCI hot-plug controller"}, + {PCIC_BASEPERIPH, PCIS_BASEPERIPH_SDHC, "SD host controller"}, {PCIC_INPUTDEV, -1, "input device"}, {PCIC_INPUTDEV, PCIS_INPUTDEV_KEYBOARD, "keyboard"}, {PCIC_INPUTDEV, PCIS_INPUTDEV_DIGITIZER,"digitizer"}, From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 20:55:50 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA3DF106569B; Tue, 21 Oct 2008 20:55:50 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 373848FC1E; Tue, 21 Oct 2008 20:55:50 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local ([192.168.254.200]) (authenticated bits=0) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id m9LKtk8T091030; Tue, 21 Oct 2008 14:55:46 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <48FE41D2.90602@samsco.org> Date: Tue, 21 Oct 2008 14:55:46 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: John Baldwin References: <200810211851.m9LIptwg006141@svn.freebsd.org> In-Reply-To: <200810211851.m9LIptwg006141@svn.freebsd.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=3.8 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184135 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 20:55:51 -0000 John Baldwin wrote: > Author: jhb > Date: Tue Oct 21 18:51:55 2008 > New Revision: 184135 > URL: http://svn.freebsd.org/changeset/base/184135 > > Log: > Restore the default maximum segment size for the bus dma tag to 64k as it > is in 6.x and 7.x. The typo caused 64k transactions to be unnecessarily > split up into two PRD entries. > > Modified: > head/sys/dev/ata/ata-dma.c > > Modified: head/sys/dev/ata/ata-dma.c > ============================================================================== > --- head/sys/dev/ata/ata-dma.c Tue Oct 21 18:50:52 2008 (r184134) > +++ head/sys/dev/ata/ata-dma.c Tue Oct 21 18:51:55 2008 (r184135) > @@ -78,7 +78,7 @@ ata_dmainit(device_t dev) > ch->dma.unload = ata_dmaunload; > ch->dma.alignment = 2; > ch->dma.boundary = 65536; > - ch->dma.segsize = 63536; > + ch->dma.segsize = 65536; > ch->dma.max_iosize = 128 * DEV_BSIZE; > ch->dma.max_address = BUS_SPACE_MAXADDR_32BIT; > ch->dma.dma_slots = 6; Not having a multiple-of-512 transfer size is likely more responsible for data corruption than having a transfer size near 64k. Scott From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 20:57:22 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2297E1065680; Tue, 21 Oct 2008 20:57: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 120718FC20; Tue, 21 Oct 2008 20:57:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LKvLJx008571; Tue, 21 Oct 2008 20:57:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LKvLPU008570; Tue, 21 Oct 2008 20:57:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810212057.m9LKvLPU008570@svn.freebsd.org> From: Alexander Motin Date: Tue, 21 Oct 2008 20:57: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: r184140 - head/usr.sbin/pciconf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 20:57:22 -0000 Author: mav Date: Tue Oct 21 20:57:21 2008 New Revision: 184140 URL: http://svn.freebsd.org/changeset/base/184140 Log: Add "SD host controller" subclass name. Modified: head/usr.sbin/pciconf/pciconf.c Modified: head/usr.sbin/pciconf/pciconf.c ============================================================================== --- head/usr.sbin/pciconf/pciconf.c Tue Oct 21 20:55:41 2008 (r184139) +++ head/usr.sbin/pciconf/pciconf.c Tue Oct 21 20:57:21 2008 (r184140) @@ -310,6 +310,7 @@ static struct {PCIC_BASEPERIPH, PCIS_BASEPERIPH_TIMER, "timer"}, {PCIC_BASEPERIPH, PCIS_BASEPERIPH_RTC, "realtime clock"}, {PCIC_BASEPERIPH, PCIS_BASEPERIPH_PCIHOT, "PCI hot-plug controller"}, + {PCIC_BASEPERIPH, PCIS_BASEPERIPH_SDHC, "SD host controller"}, {PCIC_INPUTDEV, -1, "input device"}, {PCIC_INPUTDEV, PCIS_INPUTDEV_KEYBOARD, "keyboard"}, {PCIC_INPUTDEV, PCIS_INPUTDEV_DIGITIZER,"digitizer"}, From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 21:01:59 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id ACA75106567B; Tue, 21 Oct 2008 21:01:54 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: "Attilio Rao" Date: Tue, 21 Oct 2008 17:01:42 -0400 User-Agent: KMail/1.6.2 References: <200810210431.m9L4V7Pb088978@svn.freebsd.org> <3bbf2fe10810210307t664cc8a2s62606f03427286f3@mail.gmail.com> <200810211605.46927.jkim@FreeBSD.org> In-Reply-To: <200810211605.46927.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200810211701.45343.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184108 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 21:01:59 -0000 On Tuesday 21 October 2008 04:05 pm, Jung-uk Kim wrote: > On Tuesday 21 October 2008 06:07 am, Attilio Rao wrote: > > Something we could do with this is adding a "quirk" table of TSC > > arch dependant known to be working (based on cpu_model and such) > > and use that table in order to replace tsc_smp. > > Please note the invariant_tsc and smp_tsc are different. If we go > with the route, we need two quirk tables. :-( > > BTW, Linux is using TSC now when the P-state invariant TSC bit is > set by BIOS for AMD CPUs: > > http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg246251. >html > http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg246769. >html > > "After a lot of discussions with AMD it turns out that TSC on > Fam10h CPUs is synchronized when the CONSTANT_TSC cpuid bit is set. > Or rather that if there are ever systems where that is not true it > would be their BIOS' task to disable the bit." > > If this is statement is true, then we should do: > > if (amd_pminfo & AMDPM_TSC_INVARIANT) > smp_tsc = 1; I don't know if the above is true but "AMD Family 10h Processor BKDG" says the following on page 109: "Timers associated with different CPU cores in the same processor increment at the same rate. Timers associated with different CPU cores in different processors increment at slightly different rates if (1) they are located on different nodes and (2) CLKIN for these nodes is derived from different, non-synchronized oscillator sources." Now the problem is to detect the case reliably AND to find the diffs between TSCs. Once we get the information, we can use RDTSCP instruction to adjust it by the diff table. But I guess it is hard. :-( > Also, I think we can safely assume: > > if (AMD64_FAMILY(cpu_id) >= 0x10) > tsc_is_invariant = 1; I think this is always correct by the document. I will change the code soon. > Does anyone know whether these are correct assumptions? Anyone? Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 21:21:15 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B368710656A3; Tue, 21 Oct 2008 21:21:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 3303A8FC1C; Tue, 21 Oct 2008 21:21:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m9LLL8vv008548; Tue, 21 Oct 2008 17:21:09 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Scott Long Date: Tue, 21 Oct 2008 17:02:21 -0400 User-Agent: KMail/1.9.7 References: <200810211851.m9LIptwg006141@svn.freebsd.org> <48FE41D2.90602@samsco.org> In-Reply-To: <48FE41D2.90602@samsco.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200810211702.21348.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Tue, 21 Oct 2008 17:21:09 -0400 (EDT) X-Virus-Scanned: ClamAV 0.93.1/8465/Tue Oct 21 16:14:56 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184135 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 21:21:15 -0000 On Tuesday 21 October 2008 04:55:46 pm Scott Long wrote: > John Baldwin wrote: > > Author: jhb > > Date: Tue Oct 21 18:51:55 2008 > > New Revision: 184135 > > URL: http://svn.freebsd.org/changeset/base/184135 > > > > Log: > > Restore the default maximum segment size for the bus dma tag to 64k as it > > is in 6.x and 7.x. The typo caused 64k transactions to be unnecessarily > > split up into two PRD entries. > > > > Modified: > > head/sys/dev/ata/ata-dma.c > > > > Modified: head/sys/dev/ata/ata-dma.c > > ============================================================================== > > --- head/sys/dev/ata/ata-dma.c Tue Oct 21 18:50:52 2008 (r184134) > > +++ head/sys/dev/ata/ata-dma.c Tue Oct 21 18:51:55 2008 (r184135) > > @@ -78,7 +78,7 @@ ata_dmainit(device_t dev) > > ch->dma.unload = ata_dmaunload; > > ch->dma.alignment = 2; > > ch->dma.boundary = 65536; > > - ch->dma.segsize = 63536; > > + ch->dma.segsize = 65536; > > ch->dma.max_iosize = 128 * DEV_BSIZE; > > ch->dma.max_address = BUS_SPACE_MAXADDR_32BIT; > > ch->dma.dma_slots = 6; > > Not having a multiple-of-512 transfer size is likely more responsible > for data corruption than having a transfer size near 64k. This was only in HEAD though since the SATA port multiplier changes. The code in 6.x and 7.x that we were seeing data corruption with at work on Dell 1435's never had this bug. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 21:53:56 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 632561065671; Tue, 21 Oct 2008 21:53:56 +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 5266D8FC1A; Tue, 21 Oct 2008 21:53:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LLruxn009544; Tue, 21 Oct 2008 21:53:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LLrukt009542; Tue, 21 Oct 2008 21:53:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810212153.m9LLrukt009542@svn.freebsd.org> From: Alexander Motin Date: Tue, 21 Oct 2008 21:53: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: r184141 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 21:53:56 -0000 Author: mav Date: Tue Oct 21 21:53:55 2008 New Revision: 184141 URL: http://svn.freebsd.org/changeset/base/184141 Log: Add HDA multimedia subclass. Modified: head/sys/dev/pci/pci.c head/sys/dev/pci/pcireg.h Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Oct 21 20:57:21 2008 (r184140) +++ head/sys/dev/pci/pci.c Tue Oct 21 21:53:55 2008 (r184141) @@ -2963,6 +2963,7 @@ static struct {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_VIDEO, "video"}, {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_AUDIO, "audio"}, {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_TELE, "telephony"}, + {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_HDA, "HDA"}, {PCIC_MEMORY, -1, "memory"}, {PCIC_MEMORY, PCIS_MEMORY_RAM, "RAM"}, {PCIC_MEMORY, PCIS_MEMORY_FLASH, "flash"}, Modified: head/sys/dev/pci/pcireg.h ============================================================================== --- head/sys/dev/pci/pcireg.h Tue Oct 21 20:57:21 2008 (r184140) +++ head/sys/dev/pci/pcireg.h Tue Oct 21 21:53:55 2008 (r184141) @@ -255,6 +255,7 @@ #define PCIS_MULTIMEDIA_VIDEO 0x00 #define PCIS_MULTIMEDIA_AUDIO 0x01 #define PCIS_MULTIMEDIA_TELE 0x02 +#define PCIS_MULTIMEDIA_HDA 0x03 #define PCIS_MULTIMEDIA_OTHER 0x80 #define PCIC_MEMORY 0x05 From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 21:55:38 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5C9F1065672; Tue, 21 Oct 2008 21:55:38 +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 C52508FC0A; Tue, 21 Oct 2008 21:55:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LLtcZm009626; Tue, 21 Oct 2008 21:55:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LLtcbr009625; Tue, 21 Oct 2008 21:55:38 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810212155.m9LLtcbr009625@svn.freebsd.org> From: Alexander Motin Date: Tue, 21 Oct 2008 21:55: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: r184142 - head/usr.sbin/pciconf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 21:55:38 -0000 Author: mav Date: Tue Oct 21 21:55:38 2008 New Revision: 184142 URL: http://svn.freebsd.org/changeset/base/184142 Log: Add HDA multimedia subclass. Modified: head/usr.sbin/pciconf/pciconf.c Modified: head/usr.sbin/pciconf/pciconf.c ============================================================================== --- head/usr.sbin/pciconf/pciconf.c Tue Oct 21 21:53:55 2008 (r184141) +++ head/usr.sbin/pciconf/pciconf.c Tue Oct 21 21:55:38 2008 (r184142) @@ -286,6 +286,7 @@ static struct {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_VIDEO, "video"}, {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_AUDIO, "audio"}, {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_TELE, "telephony"}, + {PCIC_MULTIMEDIA, PCIS_MULTIMEDIA_HDA, "HDA"}, {PCIC_MEMORY, -1, "memory"}, {PCIC_MEMORY, PCIS_MEMORY_RAM, "RAM"}, {PCIC_MEMORY, PCIS_MEMORY_FLASH, "flash"}, From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 22:14:22 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBAA8106567E; Tue, 21 Oct 2008 22:14:22 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA6058FC0C; Tue, 21 Oct 2008 22:14:22 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LMEMGf009976; Tue, 21 Oct 2008 22:14:22 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LMEMMp009975; Tue, 21 Oct 2008 22:14:22 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200810212214.m9LMEMMp009975@svn.freebsd.org> From: Nick Hibma Date: Tue, 21 Oct 2008 22:14: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: r184143 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 22:14:23 -0000 Author: n_hibma Date: Tue Oct 21 22:14:22 2008 New Revision: 184143 URL: http://svn.freebsd.org/changeset/base/184143 Log: Add a device ID for the Ovation MC950D (Novatel Wireless HSUPA modem). Modified: head/sys/dev/usb/u3g.c Modified: head/sys/dev/usb/u3g.c ============================================================================== --- head/sys/dev/usb/u3g.c Tue Oct 21 21:55:38 2008 (r184142) +++ head/sys/dev/usb/u3g.c Tue Oct 21 22:14:22 2008 (r184143) @@ -133,6 +133,7 @@ static const struct u3g_dev_type_s u3g_d {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_V740 }, U3GSP_HSDPA, U3GFL_STUB_WAIT }, {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_X950D }, U3GSP_HSUPA, U3GFL_STUB_WAIT }, {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_XU870 }, U3GSP_HSDPA, U3GFL_STUB_WAIT }, + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_ZEROCD }, U3GSP_HSUPA, U3GFL_STUB_WAIT }, {{ USB_VENDOR_DELL, USB_PRODUCT_DELL_U740 }, U3GSP_HSDPA, U3GFL_STUB_WAIT }, /* OEM: Merlin */ {{ USB_VENDOR_MERLIN, USB_PRODUCT_MERLIN_V620 }, U3GSP_UMTS, U3GFL_NONE }, // XXX From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 22:50:02 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 374701065671; Tue, 21 Oct 2008 22:50:02 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25E838FC18; Tue, 21 Oct 2008 22:50:02 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LMo2CM010624; Tue, 21 Oct 2008 22:50:02 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LMo2CZ010623; Tue, 21 Oct 2008 22:50:02 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200810212250.m9LMo2CZ010623@svn.freebsd.org> From: Ken Smith Date: Tue, 21 Oct 2008 22:50: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: r184144 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 22:50:02 -0000 Author: kensmith Date: Tue Oct 21 22:50:01 2008 New Revision: 184144 URL: http://svn.freebsd.org/changeset/base/184144 Log: Oops, add missing @. Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Tue Oct 21 22:14:22 2008 (r184143) +++ head/release/Makefile Tue Oct 21 22:50:01 2008 (r184144) @@ -1033,7 +1033,7 @@ cdrom.2: @echo "CD_VOLUME = 1" >> ${CD_DVD1}/cdrom.inf .endif .if !defined(NODOC) - echo "Building CDROM docs filesystem image" + @echo "Building CDROM docs filesystem image" @mkdir -p ${CD_DOCS} @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DOCS}/cdrom.inf @mkdir -p ${CD_DOCS}/usr/share/doc From owner-svn-src-head@FreeBSD.ORG Tue Oct 21 23:36:29 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2E721065676; Tue, 21 Oct 2008 23:36:28 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E12888FC14; Tue, 21 Oct 2008 23:36:28 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LNaSje011434; Tue, 21 Oct 2008 23:36:28 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9LNaSBO011433; Tue, 21 Oct 2008 23:36:28 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200810212336.m9LNaSBO011433@svn.freebsd.org> From: Ken Smith Date: Tue, 21 Oct 2008 23:36: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: r184145 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 23:36:29 -0000 Author: kensmith Date: Tue Oct 21 23:36:28 2008 New Revision: 184145 URL: http://svn.freebsd.org/changeset/base/184145 Log: Move an echo that accidentally got put under the .if defined(MAKE_DVD). Pointy hat: kensmith Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Tue Oct 21 22:50:01 2008 (r184144) +++ head/release/Makefile Tue Oct 21 23:36:28 2008 (r184145) @@ -957,13 +957,13 @@ cdrom.1: @rm -f ${CD_LIVEFS}/boot/device.hints @cp ${RD}/trees/base/boot/device.hints ${CD_LIVEFS}/boot/device.hints .endif + @echo "CD_VERSION = ${BUILDNAME}" > ${CD_LIVEFS}/cdrom.inf .if defined(MAKE_DVD) @cp -Rp ${RD}/kernels/GENERIC/ ${CD_DVD1}/boot/kernel @rm -f ${CD_DVD1}/boot/kernel/*.symbols @rm -f ${CD_DVD1}/.profile @cp ${.CURDIR}/fixit.profile ${CD_DVD1}/.profile @ln -sf /rescue ${CD_DVD1}/stand - @echo "CD_VERSION = ${BUILDNAME}" > ${CD_LIVEFS}/cdrom.inf @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DVD1}/cdrom.inf @rm -f ${CD_DVD1}/boot/loader.conf @cp ${RD}/mfsroot/mfsroot.gz ${CD_DVD1}/boot/mfsroot.gz From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 00:01:53 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A69671065672; Wed, 22 Oct 2008 00:01:53 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 944128FC1E; Wed, 22 Oct 2008 00:01:53 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9M01rlS011952; Wed, 22 Oct 2008 00:01:53 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9M01rLq011948; Wed, 22 Oct 2008 00:01:53 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200810220001.m9M01rLq011948@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 22 Oct 2008 00:01: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: r184146 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 00:01:53 -0000 Author: jkim Date: Wed Oct 22 00:01:53 2008 New Revision: 184146 URL: http://svn.freebsd.org/changeset/base/184146 Log: Set kern.timecounter.invariant_tsc to 1 for AMD CPU family 10h and higher even if BIOS does not advertise it. Modified: head/sys/amd64/amd64/identcpu.c head/sys/amd64/include/specialreg.h head/sys/i386/i386/identcpu.c head/sys/i386/include/specialreg.h Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Tue Oct 21 23:36:28 2008 (r184145) +++ head/sys/amd64/amd64/identcpu.c Wed Oct 22 00:01:53 2008 (r184146) @@ -348,7 +348,9 @@ printcpuinfo(void) cpu_feature &= ~CPUID_HTT; if (!tsc_is_invariant && - (amd_pminfo & AMDPM_TSC_INVARIANT)) { + (strcmp(cpu_vendor, "AuthenticAMD") == 0 && + ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || + AMD64_CPU_FAMILY(cpu_id) >= 0x10))) { tsc_is_invariant = 1; printf("\n P-state invariant TSC"); } Modified: head/sys/amd64/include/specialreg.h ============================================================================== --- head/sys/amd64/include/specialreg.h Tue Oct 21 23:36:28 2008 (r184145) +++ head/sys/amd64/include/specialreg.h Wed Oct 22 00:01:53 2008 (r184146) @@ -153,6 +153,23 @@ #define AMDID2_PREFETCH 0x00000100 /* + * CPUID instruction 1 eax info + */ +#define CPUID_STEPPING 0x0000000f +#define CPUID_MODEL 0x000000f0 +#define CPUID_FAMILY 0x00000f00 +#define CPUID_EXT_MODEL 0x000f0000 +#define CPUID_EXT_FAMILY 0x0ff00000 +#define AMD64_CPU_MODEL(id) \ + ((((id) & CPUID_MODEL) >> 4) | \ + ((((id) & CPUID_FAMILY) >= 0x600) ? \ + (((id) & CPUID_EXT_MODEL) >> 12) : 0)) +#define AMD64_CPU_FAMILY(id) \ + ((((id) & CPUID_FAMILY) >> 8) + \ + ((((id) & CPUID_FAMILY) == 0xf00) ? \ + (((id) & CPUID_EXT_FAMILY) >> 20) : 0)) + +/* * CPUID instruction 1 ebx info */ #define CPUID_BRAND_INDEX 0x000000ff Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Tue Oct 21 23:36:28 2008 (r184145) +++ head/sys/i386/i386/identcpu.c Wed Oct 22 00:01:53 2008 (r184146) @@ -842,7 +842,9 @@ printcpuinfo(void) cpu_feature &= ~CPUID_HTT; if (!tsc_is_invariant && - (amd_pminfo & AMDPM_TSC_INVARIANT)) { + (strcmp(cpu_vendor, "AuthenticAMD") == 0 && + (amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || + I386_CPU_FAMILY(cpu_id) >= 0x10))) { tsc_is_invariant = 1; printf("\n P-state invariant TSC"); } Modified: head/sys/i386/include/specialreg.h ============================================================================== --- head/sys/i386/include/specialreg.h Tue Oct 21 23:36:28 2008 (r184145) +++ head/sys/i386/include/specialreg.h Wed Oct 22 00:01:53 2008 (r184146) @@ -150,6 +150,23 @@ #define AMDID2_PREFETCH 0x00000100 /* + * CPUID instruction 1 eax info + */ +#define CPUID_STEPPING 0x0000000f +#define CPUID_MODEL 0x000000f0 +#define CPUID_FAMILY 0x00000f00 +#define CPUID_EXT_MODEL 0x000f0000 +#define CPUID_EXT_FAMILY 0x0ff00000 +#define I386_CPU_MODEL(id) \ + ((((id) & CPUID_MODEL) >> 4) | \ + ((((id) & CPUID_FAMILY) >= 0x600) ? \ + (((id) & CPUID_EXT_MODEL) >> 12) : 0)) +#define I386_CPU_FAMILY(id) \ + ((((id) & CPUID_FAMILY) >> 8) + \ + ((((id) & CPUID_FAMILY) == 0xf00) ? \ + (((id) & CPUID_EXT_FAMILY) >> 20) : 0)) + +/* * CPUID instruction 1 ebx info */ #define CPUID_BRAND_INDEX 0x000000ff From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 02:08:55 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3BD410656AA; Wed, 22 Oct 2008 02:08:54 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1D1B8FC18; Wed, 22 Oct 2008 02:08:54 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9M28sSH014320; Wed, 22 Oct 2008 02:08:54 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9M28sV0014319; Wed, 22 Oct 2008 02:08:54 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200810220208.m9M28sV0014319@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 22 Oct 2008 02:08: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: r184151 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 02:08:55 -0000 Author: marcel Date: Wed Oct 22 02:08:54 2008 New Revision: 184151 URL: http://svn.freebsd.org/changeset/base/184151 Log: Allow dumps to partitions with a tag of 0. The legacy sunlabel implementation in FreeBSD does not use VTOC information and as such as no partition types. Modified: head/sys/geom/part/g_part_vtoc8.c Modified: head/sys/geom/part/g_part_vtoc8.c ============================================================================== --- head/sys/geom/part/g_part_vtoc8.c Wed Oct 22 01:50:35 2008 (r184150) +++ head/sys/geom/part/g_part_vtoc8.c Wed Oct 22 02:08:54 2008 (r184151) @@ -266,10 +266,13 @@ g_part_vtoc8_dumpto(struct g_part_table struct g_part_vtoc8_table *table; uint16_t tag; - /* Allow dumping to a swap partition only. */ + /* + * Allow dumping to a swap partition or a partition that + * has no type. + */ table = (struct g_part_vtoc8_table *)basetable; tag = be16dec(&table->vtoc.part[entry->gpe_index - 1].tag); - return ((tag == VTOC_TAG_FREEBSD_SWAP) ? 1 : 0); + return ((tag == 0 || tag == VTOC_TAG_FREEBSD_SWAP) ? 1 : 0); } static int From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 08:23:42 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8681F106567D; Wed, 22 Oct 2008 08:23:42 +0000 (UTC) (envelope-from sos@freebsd.org) Received: from deepcore.dk (adsl.deepcore.dk [87.63.29.106]) by mx1.freebsd.org (Postfix) with ESMTP id 109308FC20; Wed, 22 Oct 2008 08:23:41 +0000 (UTC) (envelope-from sos@freebsd.org) Received: from [172.18.2.117] (axiell-gw1.novi.dk [77.243.61.137]) by deepcore.dk (8.14.3/8.14.2) with ESMTP id m9M7lMIx099226; Wed, 22 Oct 2008 09:48:09 +0200 (CEST) (envelope-from sos@freebsd.org) Message-Id: <38B9B4B2-0EC5-4399-B7C2-55C095D95EAE@freebsd.org> From: =?ISO-8859-1?Q?S=F8ren_Schmidt?= To: John Baldwin In-Reply-To: <200810211851.m9LIptwg006141@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v929.2) Date: Wed, 22 Oct 2008 09:48:08 +0200 References: <200810211851.m9LIptwg006141@svn.freebsd.org> X-Mailer: Apple Mail (2.929.2) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (deepcore.dk [87.63.29.106]); Wed, 22 Oct 2008 09:48:09 +0200 (CEST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184135 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 08:23:42 -0000 Good catch!! thanks!! -S=F8ren On 21Oct, 2008, at 20:51 , John Baldwin wrote: > Author: jhb > Date: Tue Oct 21 18:51:55 2008 > New Revision: 184135 > URL: http://svn.freebsd.org/changeset/base/184135 > > Log: > Restore the default maximum segment size for the bus dma tag to 64k =20= > as it > is in 6.x and 7.x. The typo caused 64k transactions to be =20 > unnecessarily > split up into two PRD entries. > > Modified: > head/sys/dev/ata/ata-dma.c > > Modified: head/sys/dev/ata/ata-dma.c > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =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/dev/ata/ata-dma.c Tue Oct 21 18:50:52 2008 = (r184134) > +++ head/sys/dev/ata/ata-dma.c Tue Oct 21 18:51:55 2008 = (r184135) > @@ -78,7 +78,7 @@ ata_dmainit(device_t dev) > ch->dma.unload =3D ata_dmaunload; > ch->dma.alignment =3D 2; > ch->dma.boundary =3D 65536; > - ch->dma.segsize =3D 63536; > + ch->dma.segsize =3D 65536; > ch->dma.max_iosize =3D 128 * DEV_BSIZE; > ch->dma.max_address =3D BUS_SPACE_MAXADDR_32BIT; > ch->dma.dma_slots =3D 6; > -S=F8ren From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 08:23:43 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1FEE1065675; Wed, 22 Oct 2008 08:23:43 +0000 (UTC) (envelope-from sos@freebsd.org) Received: from deepcore.dk (adsl.deepcore.dk [87.63.29.106]) by mx1.freebsd.org (Postfix) with ESMTP id 204D58FC19; Wed, 22 Oct 2008 08:23:42 +0000 (UTC) (envelope-from sos@freebsd.org) Received: from [172.18.2.117] (axiell-gw1.novi.dk [77.243.61.137]) by deepcore.dk (8.14.3/8.14.2) with ESMTP id m9M7lMIw099226; Wed, 22 Oct 2008 09:47:22 +0200 (CEST) (envelope-from sos@freebsd.org) Message-Id: <19AE8B2B-1C78-49EB-96D4-029FBFB9552E@freebsd.org> From: =?ISO-8859-1?Q?S=F8ren_Schmidt?= To: John Baldwin In-Reply-To: <200810171603.m9HG3buK092293@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v929.2) Date: Wed, 22 Oct 2008 09:47:21 +0200 References: <200810171603.m9HG3buK092293@svn.freebsd.org> X-Mailer: Apple Mail (2.929.2) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (deepcore.dk [87.63.29.106]); Wed, 22 Oct 2008 09:47:22 +0200 (CEST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r183981 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 08:23:43 -0000 Well, it has been busy around here.. Anyhow, I think this is an overly pessimistic change, I've not seen =20 nor heard about problems with the 63K transfer size on anything but =20 the HT1000 based machines. It seems that all serverworks chips are =20 bugridden in some way or another, just avoid :) On the MIO change, the original docs I got from serverworks states =20 that PCI id to not support MIO mode and be for compat/legacy setups, =20 so this might produce some hickups if thats true. However their docs are often as flawed as their silicon so, guess this =20= is up to the board/BIOS producer to decide. -S=F8ren On 17Oct, 2008, at 18:03 , John Baldwin wrote: > Author: jhb > Date: Fri Oct 17 16:03:37 2008 > New Revision: 183981 > URL: http://svn.freebsd.org/changeset/base/183981 > > Log: > - For chipsets that can't do 64k transfers, fall back to 32k =20 > transfers > (still a power of 2) rather than 63k transfers. Even with 63k =20 > transfers > some machines (such as Dell SC1435's) were experiencing chronic =20 > data > corruption. > - Use the MIO method to talk to the Serverworks HT1000_S1 SATA =20 > controller > like all the other SATA controllers rather than the compat PATA > method. This lets the controller see all 4 SATA ports and also > matches the behavior of the Linux driver. > > Silence from: sos > MFC after: 3 days > > Modified: > head/sys/dev/ata/chipsets/ata-cyrix.c > head/sys/dev/ata/chipsets/ata-marvell.c > head/sys/dev/ata/chipsets/ata-national.c > head/sys/dev/ata/chipsets/ata-serverworks.c > > Modified: head/sys/dev/ata/chipsets/ata-cyrix.c > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =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/dev/ata/chipsets/ata-cyrix.c Fri Oct 17 15:11:12 2008 = =20 > (r183980) > +++ head/sys/dev/ata/chipsets/ata-cyrix.c Fri Oct 17 16:03:37 2008 = =20 > (r183981) > @@ -109,7 +109,7 @@ ata_cyrix_setmode(device_t dev, int mode > /* dont try to set the mode if we dont have the resource */ > if (ctlr->r_res1) { > ch->dma.alignment =3D 16; > - ch->dma.max_iosize =3D 126 * DEV_BSIZE; > + ch->dma.max_iosize =3D 64 * DEV_BSIZE; > > if (mode >=3D ATA_UDMA0) { > ATA_OUTL(ch->r_io[ATA_BMCMD_PORT].res, > > Modified: head/sys/dev/ata/chipsets/ata-marvell.c > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =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/dev/ata/chipsets/ata-marvell.c Fri Oct 17 15:11:12 2008 = =20 > (r183980) > +++ head/sys/dev/ata/chipsets/ata-marvell.c Fri Oct 17 16:03:37 2008 = =20 > (r183981) > @@ -536,7 +536,7 @@ ata_marvell_edma_dmainit(device_t dev) > ch->dma.max_address =3D BUS_SPACE_MAXADDR; > > /* chip does not reliably do 64K DMA transfers */ > - ch->dma.max_iosize =3D 126 * DEV_BSIZE; > + ch->dma.max_iosize =3D 64 * DEV_BSIZE; > } > > ATA_DECLARE_DRIVER(ata_marvell); > > Modified: head/sys/dev/ata/chipsets/ata-national.c > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =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/dev/ata/chipsets/ata-national.c Fri Oct 17 15:11:12 =20 > 2008 (r183980) > +++ head/sys/dev/ata/chipsets/ata-national.c Fri Oct 17 16:03:37 =20 > 2008 (r183981) > @@ -101,7 +101,7 @@ ata_national_setmode(device_t dev, int m > int error; > > ch->dma.alignment =3D 16; > - ch->dma.max_iosize =3D 126 * DEV_BSIZE; > + ch->dma.max_iosize =3D 64 * DEV_BSIZE; > > mode =3D ata_limit_mode(dev, mode, ATA_UDMA2); > > > Modified: head/sys/dev/ata/chipsets/ata-serverworks.c > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =3D=20 > =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/dev/ata/chipsets/ata-serverworks.c Fri Oct 17 = 15:11:12 =20 > 2008 (r183980) > +++ head/sys/dev/ata/chipsets/ata-serverworks.c Fri Oct 17 = 16:03:37 =20 > 2008 (r183981) > @@ -79,7 +79,7 @@ ata_serverworks_probe(device_t dev) > { ATA_CSB6, 0x00, SWKS_100, 0, ATA_UDMA5, "CSB6" }, > { ATA_CSB6_1, 0x00, SWKS_66, 0, ATA_UDMA4, "CSB6" }, > { ATA_HT1000, 0x00, SWKS_100, 0, ATA_UDMA5, "HT1000" }, > - { ATA_HT1000_S1, 0x00, SWKS_100, 4, ATA_SA150, "HT1000" }, > + { ATA_HT1000_S1, 0x00, SWKS_MIO, 4, ATA_SA150, "HT1000" }, > { ATA_HT1000_S2, 0x00, SWKS_MIO, 4, ATA_SA150, "HT1000" }, > { ATA_K2, 0x00, SWKS_MIO, 4, ATA_SA150, "K2" }, > { ATA_FRODO4, 0x00, SWKS_MIO, 4, ATA_SA150, "Frodo4" }, > @@ -184,7 +184,7 @@ ata_serverworks_allocate(device_t dev) > ch->hw.tf_write =3D ata_serverworks_tf_write; > > /* chip does not reliably do 64K DMA transfers */ > - ch->dma.max_iosize =3D 126 * DEV_BSIZE; > + ch->dma.max_iosize =3D 64 * DEV_BSIZE; > > return 0; > } > -S=F8ren From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 08:43:35 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78754106566B; Wed, 22 Oct 2008 08:43:35 +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 672A18FC0A; Wed, 22 Oct 2008 08:43:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9M8hZjR023441; Wed, 22 Oct 2008 08:43:35 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9M8hZMG023440; Wed, 22 Oct 2008 08:43:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810220843.m9M8hZMG023440@svn.freebsd.org> From: Alexander Motin Date: Wed, 22 Oct 2008 08:43:35 +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: r184154 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 08:43:35 -0000 Author: mav Date: Wed Oct 22 08:43:35 2008 New Revision: 184154 URL: http://svn.freebsd.org/changeset/base/184154 Log: Update man page. Modified: head/share/man/man4/mmcsd.4 Modified: head/share/man/man4/mmcsd.4 ============================================================================== --- head/share/man/man4/mmcsd.4 Wed Oct 22 07:21:02 2008 (r184153) +++ head/share/man/man4/mmcsd.4 Wed Oct 22 08:43:35 2008 (r184154) @@ -24,18 +24,18 @@ .\" .\" $FreeBSD$ .\" -.Dd May 26, 2007 +.Dd Oct 22, 2008 .Dt MMCSD 4 .Os .Sh NAME .Nm mmcsd -.Nd MMC and SD card driver. +.Nd MMC and SD memory card driver. .Sh SYNOPSIS .Cd device mmcsd .Sh DESCRIPTION The .Nm -driver implements the MMC and SD memory cards. +driver implements direct access block device for MMC and SD memory cards. .Sh SEE ALSO .Xr mmc 4 , .Xr at91_mci 4 @@ -45,7 +45,3 @@ driver implements the MMC and SD memory .Rs .%T "The MultiMediaCard System Specification" .Re -.Sh BUGS -Memory MultMediaCards do not currently work. -SDIO cards currently do not work. -SDHC cards currently do not work. From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 09:04:05 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F86B1065670; Wed, 22 Oct 2008 09:04:05 +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 6D9B08FC25; Wed, 22 Oct 2008 09:04:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9M945bm023935; Wed, 22 Oct 2008 09:04:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9M945hM023932; Wed, 22 Oct 2008 09:04:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810220904.m9M945hM023932@svn.freebsd.org> From: Alexander Motin Date: Wed, 22 Oct 2008 09:04: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: r184156 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 09:04:05 -0000 Author: mav Date: Wed Oct 22 09:04:05 2008 New Revision: 184156 URL: http://svn.freebsd.org/changeset/base/184156 Log: Add sdhci driver man page. Link it up to mmc subsystem. Added: head/share/man/man4/sdhci.4 (contents, props changed) Modified: head/share/man/man4/mmc.4 head/share/man/man4/mmcsd.4 Modified: head/share/man/man4/mmc.4 ============================================================================== --- head/share/man/man4/mmc.4 Wed Oct 22 08:52:45 2008 (r184155) +++ head/share/man/man4/mmc.4 Wed Oct 22 09:04:05 2008 (r184156) @@ -48,7 +48,8 @@ MultiMediaCards exist only in memory. SD Cards exist as memory, I/O, or combination cards. .Sh SEE ALSO .Xr mmcsd 4 , -.Xr at91_mci 4 +.Xr at91_mci 4 , +.Xr sdhci 4 .Rs .%T "SD Specifications, Part 1, Physical Layer, Simplified Specification" .Re Modified: head/share/man/man4/mmcsd.4 ============================================================================== --- head/share/man/man4/mmcsd.4 Wed Oct 22 08:52:45 2008 (r184155) +++ head/share/man/man4/mmcsd.4 Wed Oct 22 09:04:05 2008 (r184156) @@ -38,7 +38,8 @@ The driver implements direct access block device for MMC and SD memory cards. .Sh SEE ALSO .Xr mmc 4 , -.Xr at91_mci 4 +.Xr at91_mci 4 , +.Xr sdhci 4 .Rs .%T "SD Specifications, Part 1, Physical Layer, Simplified Specification" .Re Added: head/share/man/man4/sdhci.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/sdhci.4 Wed Oct 22 09:04:05 2008 (r184156) @@ -0,0 +1,52 @@ +.\" +.\" Copyright (c) 2008 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. +.\" 2. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" 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$ +.\" +.Dd October 22, 2008 +.Dt SDHCI 4 +.Os +.Sh NAME +.Nm sdhci +.Nd PCI SD Host Controller bridge driver +.Sh SYNOPSIS +.Cd device mmc +.Cd device mmcsd +.Cd device sdhci +.Sh DESCRIPTION +The +.Nm +driver supports PCI devices with class 8 and subclass 5 according to +SD Host Controller Specification. +Driver supports up to six high speed 4bit MMC/SD slots per controller. +Driver attaches mmc bus to the respective slot on card insertion and +detaches it on card removing. +.Sh SEE ALSO +.Xr mmc 4 , +.Xr mmcsd 4 +.Rs +.%T "SD Specifications, Part 2, SD Host Controller, Simplified Specification" +.Re +.Sh AUTHORS +.An Alexander Motin Aq mav@FreeBSD.org . From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 09:11:36 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 654861065674; Wed, 22 Oct 2008 09:11:36 +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 3B07E8FC22; Wed, 22 Oct 2008 09:11:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9M9BaKR024113; Wed, 22 Oct 2008 09:11:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9M9Baqf024112; Wed, 22 Oct 2008 09:11:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810220911.m9M9Baqf024112@svn.freebsd.org> From: Alexander Motin Date: Wed, 22 Oct 2008 09:11:36 +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: r184157 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 09:11:36 -0000 Author: mav Date: Wed Oct 22 09:11:35 2008 New Revision: 184157 URL: http://svn.freebsd.org/changeset/base/184157 Log: Use full month name. Modified: head/share/man/man4/mmcsd.4 Modified: head/share/man/man4/mmcsd.4 ============================================================================== --- head/share/man/man4/mmcsd.4 Wed Oct 22 09:04:05 2008 (r184156) +++ head/share/man/man4/mmcsd.4 Wed Oct 22 09:11:35 2008 (r184157) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Oct 22, 2008 +.Dd October 22, 2008 .Dt MMCSD 4 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 10:01:24 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A65B91065670; Wed, 22 Oct 2008 10:01:24 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from redbull.bpaserver.net (redbullneu.bpaserver.net [213.198.78.217]) by mx1.freebsd.org (Postfix) with ESMTP id 56A878FC22; Wed, 22 Oct 2008 10:01:24 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (pD9E2FEE4.dip.t-dialin.net [217.226.254.228]) by redbull.bpaserver.net (Postfix) with ESMTP id 857632E1E0; Wed, 22 Oct 2008 11:44:33 +0200 (CEST) Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102]) by outgoing.leidinger.net (Postfix) with ESMTP id 908CF5B06C; Wed, 22 Oct 2008 11:44:01 +0200 (CEST) Received: (from www@localhost) by webmail.leidinger.net (8.14.2/8.13.8/Submit) id m9M9i0un024668; Wed, 22 Oct 2008 11:44:00 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.cec.eu.int (pslux.cec.eu.int [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Wed, 22 Oct 2008 11:43:59 +0200 Message-ID: <20081022114359.19407gtt68cj7aww@webmail.leidinger.net> X-Priority: 3 (Normal) Date: Wed, 22 Oct 2008 11:43:59 +0200 From: Alexander Leidinger To: John Baldwin References: <200810211851.m9LIptwg006141@svn.freebsd.org> <48FE41D2.90602@samsco.org> <200810211702.21348.jhb@freebsd.org> In-Reply-To: <200810211702.21348.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.3) / FreeBSD-8.0 X-BPAnet-MailScanner-Information: Please contact the ISP for more information X-MailScanner-ID: 857632E1E0.2AE7A X-BPAnet-MailScanner: Found to be clean X-BPAnet-MailScanner-SpamCheck: not spam, ORDB-RBL, SpamAssassin (not cached, score=-14.823, required 6, BAYES_00 -15.00, RDNS_DYNAMIC 0.10, TW_SV 0.08) X-BPAnet-MailScanner-From: alexander@leidinger.net X-Spam-Status: No Cc: svn-src-head@freebsd.org, Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r184135 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 10:01:24 -0000 Quoting John Baldwin (from Tue, 21 Oct 2008 17:02:21 -0400): >> John Baldwin wrote: >> > --- head/sys/dev/ata/ata-dma.c Tue Oct 21 18:50:52 2008 (r184134) >> > +++ head/sys/dev/ata/ata-dma.c Tue Oct 21 18:51:55 2008 (r184135) >> > @@ -78,7 +78,7 @@ ata_dmainit(device_t dev) >> > ch->dma.unload = ata_dmaunload; >> > ch->dma.alignment = 2; >> > ch->dma.boundary = 65536; >> > - ch->dma.segsize = 63536; >> > + ch->dma.segsize = 65536; > This was only in HEAD though since the SATA port multiplier changes. Can this be the reason for "acd0: FAILURE - non aligned DMA transfer attempted" messages when trying to play a DVD with xine? Bye, Alexander. -- Work may be the crabgrass of life, but money is still the water that keeps it green. http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 10:12:22 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 240811065672; Wed, 22 Oct 2008 10:12:22 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F7798FC13; Wed, 22 Oct 2008 10:12:22 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MACL3g025302; Wed, 22 Oct 2008 10:12:21 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MACLaI025301; Wed, 22 Oct 2008 10:12:21 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200810221012.m9MACLaI025301@svn.freebsd.org> From: Nick Hibma Date: Wed, 22 Oct 2008 10:12: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: r184160 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 10:12:22 -0000 Author: n_hibma Date: Wed Oct 22 10:12:21 2008 New Revision: 184160 URL: http://svn.freebsd.org/changeset/base/184160 Log: Remove the debug flag. This makes the u3gstub lines and the Windows-driver CD-ROM devices disappear. Modified: head/sys/dev/usb/u3g.c Modified: head/sys/dev/usb/u3g.c ============================================================================== --- head/sys/dev/usb/u3g.c Wed Oct 22 09:30:32 2008 (r184159) +++ head/sys/dev/usb/u3g.c Wed Oct 22 10:12:21 2008 (r184160) @@ -48,7 +48,6 @@ #include "usbdevs.h" -#define U3G_DEBUG 1 #ifdef U3G_DEBUG #define DPRINTF(x...) do { if (u3gdebug) device_printf(self, ##x); } while (0) #define DPRINTFN(n, x...) do { if (u3gdebug > (n)) device_printf(self, ##x); } while (0) From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 14:45:30 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A596A1065681; Wed, 22 Oct 2008 14:45:30 +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 909178FC1F; Wed, 22 Oct 2008 14:45:30 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MEjUaK031170; Wed, 22 Oct 2008 14:45:30 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MEjUcq031169; Wed, 22 Oct 2008 14:45:30 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <200810221445.m9MEjUcq031169@svn.freebsd.org> From: "Andrey A. Chernov" Date: Wed, 22 Oct 2008 14:45: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: r184161 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 14:45:30 -0000 Author: ache Date: Wed Oct 22 14:45:30 2008 New Revision: 184161 URL: http://svn.freebsd.org/changeset/base/184161 Log: Fix compiler error with missing/unneded ')' Modified: head/sys/i386/i386/identcpu.c Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Wed Oct 22 10:12:21 2008 (r184160) +++ head/sys/i386/i386/identcpu.c Wed Oct 22 14:45:30 2008 (r184161) @@ -842,9 +842,9 @@ printcpuinfo(void) cpu_feature &= ~CPUID_HTT; if (!tsc_is_invariant && - (strcmp(cpu_vendor, "AuthenticAMD") == 0 && - (amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || - I386_CPU_FAMILY(cpu_id) >= 0x10))) { + ((strcmp(cpu_vendor, "AuthenticAMD") == 0 && + (amd_pminfo & AMDPM_TSC_INVARIANT) != 0) || + I386_CPU_FAMILY(cpu_id) >= 0x10)) { tsc_is_invariant = 1; printf("\n P-state invariant TSC"); } From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 15:00:22 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DA2F1065672; Wed, 22 Oct 2008 15:00:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BCAF8FC08; Wed, 22 Oct 2008 15:00:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MF0Mv1031616; Wed, 22 Oct 2008 15:00:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MF0MvH031614; Wed, 22 Oct 2008 15:00:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200810221500.m9MF0MvH031614@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Oct 2008 15:00: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: r184164 - head/sys/dev/ppbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 15:00:22 -0000 Author: jhb Date: Wed Oct 22 15:00:22 2008 New Revision: 184164 URL: http://svn.freebsd.org/changeset/base/184164 Log: Fix build breakage. Pointy hat: jhb Modified: head/sys/dev/ppbus/lpt.c head/sys/dev/ppbus/ppi.c Modified: head/sys/dev/ppbus/lpt.c ============================================================================== --- head/sys/dev/ppbus/lpt.c Wed Oct 22 14:58:23 2008 (r184163) +++ head/sys/dev/ppbus/lpt.c Wed Oct 22 15:00:22 2008 (r184164) @@ -399,7 +399,7 @@ lpt_attach(device_t dev) sc->cdev_bypass = make_dev(&lpt_cdevsw, unit, UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d.ctl", unit); sc->cdev_bypass->si_drv1 = sc; - sc->cdev_bypass->si_drv2 = LP_BYPASS; + sc->cdev_bypass->si_drv2 = (void *)LP_BYPASS; return (0); } @@ -476,7 +476,7 @@ lptopen(struct cdev *dev, int flags, int } else sc->sc_state |= LPTINIT; - sc->sc_flags = dev->si_drv2; + sc->sc_flags = (uintptr_t)dev->si_drv2; /* Check for open with BYPASS flag set. */ if (sc->sc_flags & LP_BYPASS) { Modified: head/sys/dev/ppbus/ppi.c ============================================================================== --- head/sys/dev/ppbus/ppi.c Wed Oct 22 14:58:23 2008 (r184163) +++ head/sys/dev/ppbus/ppi.c Wed Oct 22 15:00:22 2008 (r184164) @@ -171,7 +171,7 @@ ppi_attach(device_t dev) UID_ROOT, GID_WHEEL, 0600, "ppi%d", device_get_unit(dev)); if (ppi->ppi_cdev == NULL) { - device_printf("Failed to create character device\n"); + device_printf(dev, "Failed to create character device\n"); return (ENXIO); } ppi->ppi_cdev->si_drv1 = ppi; @@ -496,6 +496,7 @@ ppiioctl(struct cdev *dev, u_long cmd, c { struct ppi_data *ppi = dev->si_drv1; device_t ppidev = ppi->ppi_device; + device_t ppbus = device_get_parent(ppidev); int error = 0; u_int8_t *val = (u_int8_t *)data; From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 15:04:41 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C531E106566B; Wed, 22 Oct 2008 15:04:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 47BC18FC19; Wed, 22 Oct 2008 15:04:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m9MF4TKB017475; Wed, 22 Oct 2008 11:04:35 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Jung-uk Kim Date: Wed, 22 Oct 2008 11:01:37 -0400 User-Agent: KMail/1.9.7 References: <200810220001.m9M01rLq011948@svn.freebsd.org> In-Reply-To: <200810220001.m9M01rLq011948@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200810221101.37788.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Wed, 22 Oct 2008 11:04:35 -0400 (EDT) X-Virus-Scanned: ClamAV 0.93.1/8468/Wed Oct 22 08:35:20 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184146 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 15:04:41 -0000 On Tuesday 21 October 2008 08:01:53 pm Jung-uk Kim wrote: > Author: jkim > Date: Wed Oct 22 00:01:53 2008 > New Revision: 184146 > URL: http://svn.freebsd.org/changeset/base/184146 > > Log: > Set kern.timecounter.invariant_tsc to 1 for AMD CPU family 10h and higher > even if BIOS does not advertise it. > > Modified: > head/sys/amd64/amd64/identcpu.c > head/sys/amd64/include/specialreg.h > head/sys/i386/i386/identcpu.c > head/sys/i386/include/specialreg.h > > Modified: head/sys/amd64/amd64/identcpu.c > ============================================================================== > --- head/sys/amd64/amd64/identcpu.c Tue Oct 21 23:36:28 2008 (r184145) > +++ head/sys/amd64/amd64/identcpu.c Wed Oct 22 00:01:53 2008 (r184146) > @@ -348,7 +348,9 @@ printcpuinfo(void) > cpu_feature &= ~CPUID_HTT; > > if (!tsc_is_invariant && > - (amd_pminfo & AMDPM_TSC_INVARIANT)) { > + (strcmp(cpu_vendor, "AuthenticAMD") == 0 && > + ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || > + AMD64_CPU_FAMILY(cpu_id) >= 0x10))) { > tsc_is_invariant = 1; > printf("\n P-state invariant TSC"); > } Perhaps a simpler approach might be to just set AMDPM_TSC_INVARIANT for AMD64_CPU_FAMILY(cpu_id) >= 0x10? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 15:04:59 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EDD510656AF; Wed, 22 Oct 2008 15:04:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id E03368FC0A; Wed, 22 Oct 2008 15:04:58 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1KsfGc-00038c-2O; Wed, 22 Oct 2008 18:04:58 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m9MF4qPf016706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 22 Oct 2008 18:04:52 +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.3/8.14.3) with ESMTP id m9MF4qiC079282; Wed, 22 Oct 2008 18:04:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id m9MF4qZc079281; Wed, 22 Oct 2008 18:04:52 +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, 22 Oct 2008 18:04:52 +0300 From: Kostik Belousov To: "Andrey A. Chernov" Message-ID: <20081022150452.GD94031@deviant.kiev.zoral.com.ua> References: <200810221445.m9MEjUcq031169@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IQ2ZtBPOZQVGoXc0" Content-Disposition: inline In-Reply-To: <200810221445.m9MEjUcq031169@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 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 X-Virus-Scanned: mail.terabit.net.ua 1KsfGc-00038c-2O 575c7730f839cf48cbafa1a1c2796616 X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184161 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 15:04:59 -0000 --IQ2ZtBPOZQVGoXc0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 22, 2008 at 02:45:30PM +0000, Andrey A. Chernov wrote: > Author: ache > Date: Wed Oct 22 14:45:30 2008 > New Revision: 184161 > URL: http://svn.freebsd.org/changeset/base/184161 >=20 > Log: > Fix compiler error with missing/unneded ')' >=20 > Modified: > head/sys/i386/i386/identcpu.c >=20 > Modified: head/sys/i386/i386/identcpu.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/i386/i386/identcpu.c Wed Oct 22 10:12:21 2008 (r184160) > +++ head/sys/i386/i386/identcpu.c Wed Oct 22 14:45:30 2008 (r184161) > @@ -842,9 +842,9 @@ printcpuinfo(void) > cpu_feature &=3D ~CPUID_HTT; > =20 > if (!tsc_is_invariant && > - (strcmp(cpu_vendor, "AuthenticAMD") =3D=3D 0 && > - (amd_pminfo & AMDPM_TSC_INVARIANT) !=3D 0 || > - I386_CPU_FAMILY(cpu_id) >=3D 0x10))) { > + ((strcmp(cpu_vendor, "AuthenticAMD") =3D=3D 0 && > + (amd_pminfo & AMDPM_TSC_INVARIANT) !=3D 0) || > + I386_CPU_FAMILY(cpu_id) >=3D 0x10)) { > tsc_is_invariant =3D 1; > printf("\n P-state invariant TSC"); > } Taking apart commit message, I think you change is wrong semantically. Checking CPU_FAMILY without first checking vendor is meaningless. --IQ2ZtBPOZQVGoXc0 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkj/QRMACgkQC3+MBN1Mb4h/ggCg7dqXQJOZEOD/cghLxCA9pK9x 6QkAoOfopbiy1A9LwcCr+DSDHnMBfR/c =YBo5 -----END PGP SIGNATURE----- --IQ2ZtBPOZQVGoXc0-- From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 15:30:09 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2771C1065671; Wed, 22 Oct 2008 15:30:08 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 432AC8FC17; Wed, 22 Oct 2008 15:30:07 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.3/8.14.3) with ESMTP id m9MFIifv099157; Wed, 22 Oct 2008 19:18:44 +0400 (MSD) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1224688724; bh=WV3Qcs9PMytB7NN6NzUYDbBWcSOoiJGux2Fyf2c /CpE=; l=791; h=Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=Gmui5smlsv1pnerWsH1rGZb7s sHoSqvscg1GyCGGXvbWr4FlOZVEbz1wWsneFrngxjQhz1MIdHPJkaw5Z4a621uBJvWu R5XG2znC47zQf3JlCGP7mbadPXiEruDJuvO8nBhcO1rK94txhM0wMn7BeRtvWwfa6Bc Fpc4XfprnYUg= Received: (from ache@localhost) by nagual.pp.ru (8.14.3/8.14.3/Submit) id m9MFIh4s099156; Wed, 22 Oct 2008 19:18:43 +0400 (MSD) (envelope-from ache) Date: Wed, 22 Oct 2008 19:18:43 +0400 From: Andrey Chernov To: Kostik Belousov , jkim@freebsd.org Message-ID: <20081022151843.GA98808@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Kostik Belousov , jkim@freebsd.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <200810221445.m9MEjUcq031169@svn.freebsd.org> <20081022150452.GD94031@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Q68bSM7Ycu6FN28Q" Content-Disposition: inline In-Reply-To: <20081022150452.GD94031@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184161 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 15:30:09 -0000 --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 22, 2008 at 06:04:52PM +0300, Kostik Belousov wrote: > Taking apart commit message, I think you change is wrong semantically. > Checking CPU_FAMILY without first checking vendor is meaningless. It was simple build breakage fix. Discuss this matter with original=20 committer jkim@ --=20 http://ache.pp.ru/ --Q68bSM7Ycu6FN28Q Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkj/RFMACgkQVg5YK5ZEdN35aACgjiRzHBu7p6cIYPp73zd8yX3W 4OkAn0ej64sOeAgpslRSx6ROWoA0C4yf =SOZH -----END PGP SIGNATURE----- --Q68bSM7Ycu6FN28Q-- From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 15:32:19 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 244EC1065680; Wed, 22 Oct 2008 15:32:18 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Kostik Belousov Date: Wed, 22 Oct 2008 11:31:58 -0400 User-Agent: KMail/1.6.2 References: <200810221445.m9MEjUcq031169@svn.freebsd.org> <20081022150452.GD94031@deviant.kiev.zoral.com.ua> In-Reply-To: <20081022150452.GD94031@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200810221132.02162.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "Andrey A. Chernov" Subject: Re: svn commit: r184161 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 15:32:19 -0000 On Wednesday 22 October 2008 11:04 am, Kostik Belousov wrote: > On Wed, Oct 22, 2008 at 02:45:30PM +0000, Andrey A. Chernov wrote: > > Author: ache > > Date: Wed Oct 22 14:45:30 2008 > > New Revision: 184161 > > URL: http://svn.freebsd.org/changeset/base/184161 > > > > Log: > > Fix compiler error with missing/unneded ')' > > > > Modified: > > head/sys/i386/i386/identcpu.c > > > > Modified: head/sys/i386/i386/identcpu.c > > ================================================================= > >============= --- head/sys/i386/i386/identcpu.c Wed Oct 22 > > 10:12:21 2008 (r184160) +++ head/sys/i386/i386/identcpu.c Wed Oct > > 22 14:45:30 2008 (r184161) @@ -842,9 +842,9 @@ printcpuinfo(void) > > cpu_feature &= ~CPUID_HTT; > > > > if (!tsc_is_invariant && > > - (strcmp(cpu_vendor, "AuthenticAMD") == 0 && > > - (amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || > > - I386_CPU_FAMILY(cpu_id) >= 0x10))) { > > + ((strcmp(cpu_vendor, "AuthenticAMD") == 0 && > > + (amd_pminfo & AMDPM_TSC_INVARIANT) != 0) || > > + I386_CPU_FAMILY(cpu_id) >= 0x10)) { > > tsc_is_invariant = 1; > > printf("\n P-state invariant TSC"); > > } > > Taking apart commit message, I think you change is wrong > semantically. Checking CPU_FAMILY without first checking vendor is > meaningless. Correct. Please do not touch this part cause I am going to fix it and add more quirks. Sorry for the breakage. Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 15:42:02 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 0EE8E1065671; Wed, 22 Oct 2008 15:42:02 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Baldwin Date: Wed, 22 Oct 2008 11:41:36 -0400 User-Agent: KMail/1.6.2 References: <200810220001.m9M01rLq011948@svn.freebsd.org> <200810221101.37788.jhb@freebsd.org> In-Reply-To: <200810221101.37788.jhb@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200810221141.52036.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184146 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 15:42:02 -0000 On Wednesday 22 October 2008 11:01 am, John Baldwin wrote: > On Tuesday 21 October 2008 08:01:53 pm Jung-uk Kim wrote: > > Author: jkim > > Date: Wed Oct 22 00:01:53 2008 > > New Revision: 184146 > > URL: http://svn.freebsd.org/changeset/base/184146 > > > > Log: > > Set kern.timecounter.invariant_tsc to 1 for AMD CPU family 10h > > and higher even if BIOS does not advertise it. > > > > Modified: > > head/sys/amd64/amd64/identcpu.c > > head/sys/amd64/include/specialreg.h > > head/sys/i386/i386/identcpu.c > > head/sys/i386/include/specialreg.h > > > > Modified: head/sys/amd64/amd64/identcpu.c > > =================================================================== >=========== > > > --- head/sys/amd64/amd64/identcpu.c Tue Oct 21 23:36:28 > > 2008 (r184145) +++ head/sys/amd64/amd64/identcpu.c Wed Oct 22 > > 00:01:53 2008 (r184146) @@ -348,7 +348,9 @@ printcpuinfo(void) > > cpu_feature &= ~CPUID_HTT; > > > > if (!tsc_is_invariant && > > - (amd_pminfo & AMDPM_TSC_INVARIANT)) { > > + (strcmp(cpu_vendor, "AuthenticAMD") == 0 && > > + ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || > > + AMD64_CPU_FAMILY(cpu_id) >= 0x10))) { > > tsc_is_invariant = 1; > > printf("\n P-state invariant TSC"); > > } > > Perhaps a simpler approach might be to just set AMDPM_TSC_INVARIANT > for AMD64_CPU_FAMILY(cpu_id) >= 0x10? It seems Athlon X2 (Family 0Fh, Model 6Bh, Stepping G2) that I bought also has invariant TSC although it is not advertised by CPUID. If BIOS manufacturer decide to set the bit later, it should be honored IMO. Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 15:53:53 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CBE710656AC for ; Wed, 22 Oct 2008 15:53:53 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-gx0-f16.google.com (mail-gx0-f16.google.com [209.85.217.16]) by mx1.freebsd.org (Postfix) with ESMTP id 23FD18FC17 for ; Wed, 22 Oct 2008 15:53:52 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by gxk9 with SMTP id 9so7220471gxk.19 for ; Wed, 22 Oct 2008 08:53:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=3hx7+NwCgHr2sI34d1afrYVR+YjW142Pnu/G5gKzCVQ=; b=TeIwlyOKpV8DYyD9niio16GQxxJBbPI1x6/N+NOFD11kaoPpmIJPoQ77cFEbjE68hr FOFbnfOvVJgzI2gQXBWgEUMEixP3M9MdxKn84kX8cBzPmQUn/jBS8DiEHpCbxLqhguDE aB3Eu8hrCfN8z/sIRB6hWWxhkHnHcZ+DY6+u0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=mZ3o5tjR4i2SAEjn1mXFYlss14zO/paHXXENOsDonIyKPnwcsmXEB5b/gLSDgyA2i8 lL4yrMqUX3UqywWrI/PWxsH+MZ40Mnnr9Yb6QSCTv0QWw7izadFB0GLJLs73twk33eSx +8E609nN1uRLa7XdwPBooyea7u5ibDxp8oBXY= Received: by 10.103.252.17 with SMTP id e17mr5255124mus.115.1224690830964; Wed, 22 Oct 2008 08:53:50 -0700 (PDT) Received: by 10.103.239.14 with HTTP; Wed, 22 Oct 2008 08:53:50 -0700 (PDT) Message-ID: <3bbf2fe10810220853r34256b59y1fe57f49eca2014@mail.gmail.com> Date: Wed, 22 Oct 2008 17:53:50 +0200 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Jung-uk Kim" In-Reply-To: <200810211605.46927.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200810210431.m9L4V7Pb088978@svn.freebsd.org> <3bbf2fe10810210307t664cc8a2s62606f03427286f3@mail.gmail.com> <200810211605.46927.jkim@FreeBSD.org> X-Google-Sender-Auth: fd1f8b4ed9372959 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184108 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 15:53:53 -0000 2008/10/21, Jung-uk Kim : > On Tuesday 21 October 2008 06:07 am, Attilio Rao wrote: > > Something we could do with this is adding a "quirk" table of TSC > > arch dependant known to be working (based on cpu_model and such) > > and use that table in order to replace tsc_smp. > > Please note the invariant_tsc and smp_tsc are different. If we go > with the route, we need two quirk tables. :-( It doesn't matter. I think it is silly we have different quirks flag states for TSC. We should just having a table assuming that the TSC is safe to use in SMP environments and gets rid of any other flag (in this case, for amd64 based machine, the logic could, for example, check if the CPU is P state invariant and assume it is safe, etc.) Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 16:07:56 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 541B2106569D; Wed, 22 Oct 2008 16:07:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id D8D038FC1E; Wed, 22 Oct 2008 16:07:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m9MG7dq6017965; Wed, 22 Oct 2008 12:07:46 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Alexander Leidinger Date: Wed, 22 Oct 2008 11:19:01 -0400 User-Agent: KMail/1.9.7 References: <200810211851.m9LIptwg006141@svn.freebsd.org> <200810211702.21348.jhb@freebsd.org> <20081022114359.19407gtt68cj7aww@webmail.leidinger.net> In-Reply-To: <20081022114359.19407gtt68cj7aww@webmail.leidinger.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200810221119.01902.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Wed, 22 Oct 2008 12:07:47 -0400 (EDT) X-Virus-Scanned: ClamAV 0.93.1/8468/Wed Oct 22 08:35:20 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, Scott Long , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r184135 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 16:07:56 -0000 On Wednesday 22 October 2008 05:43:59 am Alexander Leidinger wrote: > Quoting John Baldwin (from Tue, 21 Oct 2008 17:02:21 -0400): > > >> John Baldwin wrote: > > >> > --- head/sys/dev/ata/ata-dma.c Tue Oct 21 18:50:52 2008 (r184134) > >> > +++ head/sys/dev/ata/ata-dma.c Tue Oct 21 18:51:55 2008 (r184135) > >> > @@ -78,7 +78,7 @@ ata_dmainit(device_t dev) > >> > ch->dma.unload = ata_dmaunload; > >> > ch->dma.alignment = 2; > >> > ch->dma.boundary = 65536; > >> > - ch->dma.segsize = 63536; > >> > + ch->dma.segsize = 65536; > > > This was only in HEAD though since the SATA port multiplier changes. > > Can this be the reason for "acd0: FAILURE - non aligned DMA transfer > attempted" messages when trying to play a DVD with xine? I don't think so as that printf is in the ATA code before it does a bus_dmamap_load(), and this bug just caused busdma to split up some ATA DMA requests into more scatter/gather entries than truly necessary. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 16:08:02 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69D8810656A2; Wed, 22 Oct 2008 16:08:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 598568FC16; Wed, 22 Oct 2008 16:08:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m9MG7dq7017965; Wed, 22 Oct 2008 12:07:53 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: =?iso-8859-1?q?S=F8ren_Schmidt?= Date: Wed, 22 Oct 2008 11:22:28 -0400 User-Agent: KMail/1.9.7 References: <200810171603.m9HG3buK092293@svn.freebsd.org> <19AE8B2B-1C78-49EB-96D4-029FBFB9552E@freebsd.org> In-Reply-To: <19AE8B2B-1C78-49EB-96D4-029FBFB9552E@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200810221122.28481.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Wed, 22 Oct 2008 12:07:54 -0400 (EDT) X-Virus-Scanned: ClamAV 0.93.1/8468/Wed Oct 22 08:35:20 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r183981 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 16:08:02 -0000 On Wednesday 22 October 2008 03:47:21 am S=F8ren Schmidt wrote: > Well, it has been busy around here.. >=20 > Anyhow, I think this is an overly pessimistic change, I've not seen =20 > nor heard about problems with the 63K transfer size on anything but =20 > the HT1000 based machines. It seems that all serverworks chips are =20 > bugridden in some way or another, just avoid :) Unfortunately I have to support existing machines, so I'm stuck with them. = =20 Given Scott's comments, it seems that the 1k runt transfers are probably=20 non-optimal anyway. > On the MIO change, the original docs I got from serverworks states =20 > that PCI id to not support MIO mode and be for compat/legacy setups, =20 > so this might produce some hickups if thats true. > However their docs are often as flawed as their silicon so, guess this =20 > is up to the board/BIOS producer to decide. Note that the Linux driver does use MIO, and w/o MIO it can't see 4 SATA=20 ports. This has been in use on ${BIGNUM} Dell 1435 machines for over a yea= r=20 btw. > -S=F8ren >=20 > On 17Oct, 2008, at 18:03 , John Baldwin wrote: >=20 > > Author: jhb > > Date: Fri Oct 17 16:03:37 2008 > > New Revision: 183981 > > URL: http://svn.freebsd.org/changeset/base/183981 > > > > Log: > > - For chipsets that can't do 64k transfers, fall back to 32k =20 > > transfers > > (still a power of 2) rather than 63k transfers. Even with 63k =20 > > transfers > > some machines (such as Dell SC1435's) were experiencing chronic =20 > > data > > corruption. > > - Use the MIO method to talk to the Serverworks HT1000_S1 SATA =20 > > controller > > like all the other SATA controllers rather than the compat PATA > > method. This lets the controller see all 4 SATA ports and also > > matches the behavior of the Linux driver. > > > > Silence from: sos > > MFC after: 3 days > > > > Modified: > > head/sys/dev/ata/chipsets/ata-cyrix.c > > head/sys/dev/ata/chipsets/ata-marvell.c > > head/sys/dev/ata/chipsets/ata-national.c > > head/sys/dev/ata/chipsets/ata-serverworks.c > > > > Modified: head/sys/dev/ata/chipsets/ata-cyrix.c > > =3D=20 > > =3D=20 > > =3D=20 > > =3D=20 > > =3D=20 > > =3D=20 > > =3D=20 > > =3D=20 > > =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/dev/ata/chipsets/ata-cyrix.c Fri Oct 17 15:11:12 2008 =20 > > (r183980) > > +++ head/sys/dev/ata/chipsets/ata-cyrix.c Fri Oct 17 16:03:37 2008 =20 > > (r183981) > > @@ -109,7 +109,7 @@ ata_cyrix_setmode(device_t dev, int mode > > /* dont try to set the mode if we dont have the resource */ > > if (ctlr->r_res1) { > > ch->dma.alignment =3D 16; > > - ch->dma.max_iosize =3D 126 * DEV_BSIZE; > > + ch->dma.max_iosize =3D 64 * DEV_BSIZE; > > > > if (mode >=3D ATA_UDMA0) { > > ATA_OUTL(ch->r_io[ATA_BMCMD_PORT].res, > > > > Modified: head/sys/dev/ata/chipsets/ata-marvell.c > > =3D=20 > > =3D=20 > > =3D=20 > > =3D=20 > > =3D=20 > > =3D=20 > > =3D=20 > > =3D=20 > > =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/dev/ata/chipsets/ata-marvell.c Fri Oct 17 15:11:12 2008 =20 > > (r183980) > > +++ head/sys/dev/ata/chipsets/ata-marvell.c Fri Oct 17 16:03:37 2008 =20 > > (r183981) > > @@ -536,7 +536,7 @@ ata_marvell_edma_dmainit(device_t dev) > > ch->dma.max_address =3D BUS_SPACE_MAXADDR; > > > > /* chip does not reliably do 64K DMA transfers */ > > - ch->dma.max_iosize =3D 126 * DEV_BSIZE; > > + ch->dma.max_iosize =3D 64 * DEV_BSIZE; > > } > > > > ATA_DECLARE_DRIVER(ata_marvell); > > > > Modified: head/sys/dev/ata/chipsets/ata-national.c > > =3D=20 > > =3D=20 > > =3D=20 > > =3D=20 > > =3D=20 > > =3D=20 > > =3D=20 > > =3D=20 > > =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/dev/ata/chipsets/ata-national.c Fri Oct 17 15:11:12 =20 > > 2008 (r183980) > > +++ head/sys/dev/ata/chipsets/ata-national.c Fri Oct 17 16:03:37 =20 > > 2008 (r183981) > > @@ -101,7 +101,7 @@ ata_national_setmode(device_t dev, int m > > int error; > > > > ch->dma.alignment =3D 16; > > - ch->dma.max_iosize =3D 126 * DEV_BSIZE; > > + ch->dma.max_iosize =3D 64 * DEV_BSIZE; > > > > mode =3D ata_limit_mode(dev, mode, ATA_UDMA2); > > > > > > Modified: head/sys/dev/ata/chipsets/ata-serverworks.c > > =3D=20 > > =3D=20 > > =3D=20 > > =3D=20 > > =3D=20 > > =3D=20 > > =3D=20 > > =3D=20 > > =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/dev/ata/chipsets/ata-serverworks.c Fri Oct 17 15:11:12 =20 > > 2008 (r183980) > > +++ head/sys/dev/ata/chipsets/ata-serverworks.c Fri Oct 17 16:03:37 =20 > > 2008 (r183981) > > @@ -79,7 +79,7 @@ ata_serverworks_probe(device_t dev) > > { ATA_CSB6, 0x00, SWKS_100, 0, ATA_UDMA5, "CSB6" }, > > { ATA_CSB6_1, 0x00, SWKS_66, 0, ATA_UDMA4, "CSB6" }, > > { ATA_HT1000, 0x00, SWKS_100, 0, ATA_UDMA5, "HT1000" }, > > - { ATA_HT1000_S1, 0x00, SWKS_100, 4, ATA_SA150, "HT1000" }, > > + { ATA_HT1000_S1, 0x00, SWKS_MIO, 4, ATA_SA150, "HT1000" }, > > { ATA_HT1000_S2, 0x00, SWKS_MIO, 4, ATA_SA150, "HT1000" }, > > { ATA_K2, 0x00, SWKS_MIO, 4, ATA_SA150, "K2" }, > > { ATA_FRODO4, 0x00, SWKS_MIO, 4, ATA_SA150, "Frodo4" }, > > @@ -184,7 +184,7 @@ ata_serverworks_allocate(device_t dev) > > ch->hw.tf_write =3D ata_serverworks_tf_write; > > > > /* chip does not reliably do 64K DMA transfers */ > > - ch->dma.max_iosize =3D 126 * DEV_BSIZE; > > + ch->dma.max_iosize =3D 64 * DEV_BSIZE; > > > > return 0; > > } > > >=20 > -S=F8ren >=20 >=20 >=20 >=20 >=20 >=20 >=20 =2D-=20 John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 16:08:43 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 605B210656BC; Wed, 22 Oct 2008 16:08:43 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 9B90C8FC08; Wed, 22 Oct 2008 16:08:42 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m9MG8YFU017993; Wed, 22 Oct 2008 12:08:36 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Jung-uk Kim Date: Wed, 22 Oct 2008 12:02:40 -0400 User-Agent: KMail/1.9.7 References: <200810220001.m9M01rLq011948@svn.freebsd.org> <200810221101.37788.jhb@freebsd.org> <200810221141.52036.jkim@FreeBSD.org> In-Reply-To: <200810221141.52036.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200810221202.40803.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Wed, 22 Oct 2008 12:08:36 -0400 (EDT) X-Virus-Scanned: ClamAV 0.93.1/8468/Wed Oct 22 08:35:20 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184146 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 16:08:43 -0000 On Wednesday 22 October 2008 11:41:36 am Jung-uk Kim wrote: > On Wednesday 22 October 2008 11:01 am, John Baldwin wrote: > > On Tuesday 21 October 2008 08:01:53 pm Jung-uk Kim wrote: > > > Author: jkim > > > Date: Wed Oct 22 00:01:53 2008 > > > New Revision: 184146 > > > URL: http://svn.freebsd.org/changeset/base/184146 > > > > > > Log: > > > Set kern.timecounter.invariant_tsc to 1 for AMD CPU family 10h > > > and higher even if BIOS does not advertise it. > > > > > > Modified: > > > head/sys/amd64/amd64/identcpu.c > > > head/sys/amd64/include/specialreg.h > > > head/sys/i386/i386/identcpu.c > > > head/sys/i386/include/specialreg.h > > > > > > Modified: head/sys/amd64/amd64/identcpu.c > > > > =================================================================== > >=========== > > > > > --- head/sys/amd64/amd64/identcpu.c Tue Oct 21 23:36:28 > > > 2008 (r184145) +++ head/sys/amd64/amd64/identcpu.c Wed Oct 22 > > > 00:01:53 2008 (r184146) @@ -348,7 +348,9 @@ printcpuinfo(void) > > > cpu_feature &= ~CPUID_HTT; > > > > > > if (!tsc_is_invariant && > > > - (amd_pminfo & AMDPM_TSC_INVARIANT)) { > > > + (strcmp(cpu_vendor, "AuthenticAMD") == 0 && > > > + ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || > > > + AMD64_CPU_FAMILY(cpu_id) >= 0x10))) { > > > tsc_is_invariant = 1; > > > printf("\n P-state invariant TSC"); > > > } > > > > Perhaps a simpler approach might be to just set AMDPM_TSC_INVARIANT > > for AMD64_CPU_FAMILY(cpu_id) >= 0x10? > > It seems Athlon X2 (Family 0Fh, Model 6Bh, Stepping G2) that I bought > also has invariant TSC although it is not advertised by CPUID. If > BIOS manufacturer decide to set the bit later, it should be honored > IMO. Err, yeah, my suggestion is something like this: /* * These CPUs have an invariant TSC even though they don't * always advertise it. */ if (strcmp(cpu_vendor, "AuthenticAMD") == 0 && AMD64_CPU_FAMILY(cpu_id) >= 0x10) amd_pminfo |= AMDPM_TSC_INVARIANT; if (!tsc_is_invariant && (amd_pminfo & AMDPM_TSC_INVARIANT)) { tsc_is_invariant; printf(...); } That will still support any other CPUs that grow the CPUID flag at some point, it just fakes the CPUID flag for CPUs that we know have it but just aren't advertising it. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 16:41:31 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id B9B80106566B; Wed, 22 Oct 2008 16:41:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Baldwin Date: Wed, 22 Oct 2008 12:41:19 -0400 User-Agent: KMail/1.6.2 References: <200810220001.m9M01rLq011948@svn.freebsd.org> <200810221141.52036.jkim@FreeBSD.org> <200810221202.40803.jhb@freebsd.org> In-Reply-To: <200810221202.40803.jhb@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200810221241.22455.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184146 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 16:41:31 -0000 On Wednesday 22 October 2008 12:02 pm, John Baldwin wrote: > On Wednesday 22 October 2008 11:41:36 am Jung-uk Kim wrote: > > On Wednesday 22 October 2008 11:01 am, John Baldwin wrote: > > > On Tuesday 21 October 2008 08:01:53 pm Jung-uk Kim wrote: > > > > Author: jkim > > > > Date: Wed Oct 22 00:01:53 2008 > > > > New Revision: 184146 > > > > URL: http://svn.freebsd.org/changeset/base/184146 > > > > > > > > Log: > > > > Set kern.timecounter.invariant_tsc to 1 for AMD CPU family > > > > 10h and higher even if BIOS does not advertise it. > > > > > > > > Modified: > > > > head/sys/amd64/amd64/identcpu.c > > > > head/sys/amd64/include/specialreg.h > > > > head/sys/i386/i386/identcpu.c > > > > head/sys/i386/include/specialreg.h > > > > > > > > Modified: head/sys/amd64/amd64/identcpu.c > > > > > > =============================================================== > > >==== =========== > > > > > > > --- head/sys/amd64/amd64/identcpu.c Tue Oct 21 23:36:28 > > > > 2008 (r184145) +++ head/sys/amd64/amd64/identcpu.c Wed Oct 22 > > > > 00:01:53 2008 (r184146) @@ -348,7 +348,9 @@ > > > > printcpuinfo(void) cpu_feature &= ~CPUID_HTT; > > > > > > > > if (!tsc_is_invariant && > > > > - (amd_pminfo & AMDPM_TSC_INVARIANT)) { > > > > + (strcmp(cpu_vendor, "AuthenticAMD") == 0 && > > > > + ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || > > > > + AMD64_CPU_FAMILY(cpu_id) >= 0x10))) { > > > > tsc_is_invariant = 1; > > > > printf("\n P-state invariant TSC"); > > > > } > > > > > > Perhaps a simpler approach might be to just set > > > AMDPM_TSC_INVARIANT for AMD64_CPU_FAMILY(cpu_id) >= 0x10? > > > > It seems Athlon X2 (Family 0Fh, Model 6Bh, Stepping G2) that I > > bought also has invariant TSC although it is not advertised by > > CPUID. If BIOS manufacturer decide to set the bit later, it > > should be honored IMO. > > Err, yeah, my suggestion is something like this: > > /* > * These CPUs have an invariant TSC even though they don't > * always advertise it. > */ > if (strcmp(cpu_vendor, "AuthenticAMD") == 0 && > AMD64_CPU_FAMILY(cpu_id) >= 0x10) > amd_pminfo |= AMDPM_TSC_INVARIANT; > > if (!tsc_is_invariant && > (amd_pminfo & AMDPM_TSC_INVARIANT)) { > tsc_is_invariant; > printf(...); > } > > That will still support any other CPUs that grow the CPUID flag at > some point, it just fakes the CPUID flag for CPUs that we know have > it but just aren't advertising it. Hmm, interesting idea. But please read this: http://docs.freebsd.org/cgi/mid.cgi?200810211605.46927.jkim If Linux people are actually correct, then: if (amd_pminfo & AMDPM_TSC_INVARIANT) smp_tsc = 1; I like to use it later if it is really true. Besides, I hate to set/clear CPUIDs like this. For that, I believe we should have a single feature flag for all amd64/i386 CPUs regardless of vendors, e.g., CPU_CAP_LONGMODE, CPU_CAP_SSE3, CPU_CAP_INVARIANT_TSC, etc. and we should leave the feature variables as is. Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 16:50:13 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DA571065673; Wed, 22 Oct 2008 16:50:13 +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 3BEC88FC08; Wed, 22 Oct 2008 16:50:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MGoD4M033804; Wed, 22 Oct 2008 16:50:13 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MGoD7I033803; Wed, 22 Oct 2008 16:50:13 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200810221650.m9MGoD7I033803@svn.freebsd.org> From: Robert Watson Date: Wed, 22 Oct 2008 16:50: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: r184168 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 16:50:13 -0000 Author: rwatson Date: Wed Oct 22 16:50:12 2008 New Revision: 184168 URL: http://svn.freebsd.org/changeset/base/184168 Log: Update mmap() comment: no more block devices, so no more block device cache coherency questions. MFC after: 3 days Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Wed Oct 22 15:43:28 2008 (r184167) +++ head/sys/vm/vm_mmap.c Wed Oct 22 16:50:12 2008 (r184168) @@ -187,10 +187,6 @@ ogetpagesize(td, uap) * memory-based, such as a video framebuffer, can be mmap'd. Otherwise * there would be no cache coherency between a descriptor and a VM mapping * both to the same character device. - * - * Block devices can be mmap'd no matter what they represent. Cache coherency - * is maintained as long as you do not write directly to the underlying - * character device. */ #ifndef _SYS_SYSPROTO_H_ struct mmap_args { From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 17:08:07 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E18010656A4; Wed, 22 Oct 2008 17:08:07 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:3fb::211]) by mx1.freebsd.org (Postfix) with ESMTP id C29878FC14; Wed, 22 Oct 2008 17:08:06 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 01EFD1CD19; Wed, 22 Oct 2008 19:08:05 +0200 (CEST) Date: Wed, 22 Oct 2008 19:08:05 +0200 From: Ed Schouten To: John Baldwin Message-ID: <20081022170805.GJ16837@hoeg.nl> References: <200810221500.m9MF0MvH031614@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="w5xl9Cr7DZZ9WNrn" Content-Disposition: inline In-Reply-To: <200810221500.m9MF0MvH031614@svn.freebsd.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184164 - head/sys/dev/ppbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 17:08:07 -0000 --w5xl9Cr7DZZ9WNrn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi John, It seems I forgot to CC my message to you, so I'll just stick it to to the commit message as well. Sorry. * John Baldwin wrote: > Modified: head/sys/dev/ppbus/lpt.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/ppbus/lpt.c Wed Oct 22 14:58:23 2008 (r184163) > +++ head/sys/dev/ppbus/lpt.c Wed Oct 22 15:00:22 2008 (r184164) > @@ -399,7 +399,7 @@ lpt_attach(device_t dev) > sc->cdev_bypass =3D make_dev(&lpt_cdevsw, unit, > UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d.ctl", unit); > sc->cdev_bypass->si_drv1 =3D sc; > - sc->cdev_bypass->si_drv2 =3D LP_BYPASS; > + sc->cdev_bypass->si_drv2 =3D (void *)LP_BYPASS; > return (0); > } > =20 > @@ -476,7 +476,7 @@ lptopen(struct cdev *dev, int flags, int > } else > sc->sc_state |=3D LPTINIT; > =20 > - sc->sc_flags =3D dev->si_drv2; > + sc->sc_flags =3D (uintptr_t)dev->si_drv2; > =20 > /* Check for open with BYPASS flag set. */ > if (sc->sc_flags & LP_BYPASS) { Maybe it's better to just use the device unit number to store these flags? This value is stored inside si_drv0, which is an integer. Hopefully we'll get rid of make_dev()'s unit number argument somewhere in the far future, which means drivers can use si_drv0 directly. I sent the following patch to current@ this morning: --- sys/dev/ppbus/lpt.c +++ sys/dev/ppbus/lpt.c @@ -392,14 +392,12 @@ lpt_release_ppbus(dev); =20 sc->dev =3D dev; - sc->cdev =3D make_dev(&lpt_cdevsw, unit, + sc->cdev =3D make_dev(&lpt_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d", unit); sc->cdev->si_drv1 =3D sc; - sc->cdev->si_drv2 =3D 0; - sc->cdev_bypass =3D make_dev(&lpt_cdevsw, unit, + sc->cdev_bypass =3D make_dev(&lpt_cdevsw, LP_BYPASS, UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d.ctl", unit); sc->cdev_bypass->si_drv1 =3D sc; - sc->cdev_bypass->si_drv2 =3D LP_BYPASS; return (0); } =20 @@ -476,7 +474,7 @@ } else sc->sc_state |=3D LPTINIT; =20 - sc->sc_flags =3D dev->si_drv2; + sc->sc_flags =3D dev2unit(dev); =20 /* Check for open with BYPASS flag set. */ if (sc->sc_flags & LP_BYPASS) { --=20 Ed Schouten WWW: http://80386.nl/ --w5xl9Cr7DZZ9WNrn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkj/XfUACgkQ52SDGA2eCwXNfQCfUXM3QS0oleInghXtV72F3EGg GHIAn0Eet57diTTxDtNOfQHLKSdmXH0J =qn3I -----END PGP SIGNATURE----- --w5xl9Cr7DZZ9WNrn-- From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 17:30:38 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 419B11065673; Wed, 22 Oct 2008 17:30:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FD128FC16; Wed, 22 Oct 2008 17:30:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MHUcPX034509; Wed, 22 Oct 2008 17:30:38 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MHUc0R034507; Wed, 22 Oct 2008 17:30:38 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200810221730.m9MHUc0R034507@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 22 Oct 2008 17:30: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: r184169 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 17:30:38 -0000 Author: jkim Date: Wed Oct 22 17:30:37 2008 New Revision: 184169 URL: http://svn.freebsd.org/changeset/base/184169 Log: Add AMD Family 0Fh, Model 6Bh, Stepping 2 to the list of invariant TSCs and fix i386 test. Modified: head/sys/amd64/amd64/identcpu.c head/sys/i386/i386/identcpu.c Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Wed Oct 22 16:50:12 2008 (r184168) +++ head/sys/amd64/amd64/identcpu.c Wed Oct 22 17:30:37 2008 (r184169) @@ -347,12 +347,17 @@ printcpuinfo(void) "AuthenticAMD") == 0) cpu_feature &= ~CPUID_HTT; + /* + * If this CPU supports P-state invariant TSC then + * mention the capability. + */ if (!tsc_is_invariant && (strcmp(cpu_vendor, "AuthenticAMD") == 0 && ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || - AMD64_CPU_FAMILY(cpu_id) >= 0x10))) { + AMD64_CPU_FAMILY(cpu_id) >= 0x10 || + cpu_id == 0x60fb2))) { tsc_is_invariant = 1; - printf("\n P-state invariant TSC"); + printf("\n TSC: P-state invariant"); } /* Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Wed Oct 22 16:50:12 2008 (r184168) +++ head/sys/i386/i386/identcpu.c Wed Oct 22 17:30:37 2008 (r184169) @@ -841,12 +841,17 @@ printcpuinfo(void) "AuthenticAMD") == 0) cpu_feature &= ~CPUID_HTT; + /* + * If this CPU supports P-state invariant TSC then + * mention the capability. + */ if (!tsc_is_invariant && - ((strcmp(cpu_vendor, "AuthenticAMD") == 0 && - (amd_pminfo & AMDPM_TSC_INVARIANT) != 0) || - I386_CPU_FAMILY(cpu_id) >= 0x10)) { + (strcmp(cpu_vendor, "AuthenticAMD") == 0 && + ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || + AMD64_CPU_FAMILY(cpu_id) >= 0x10 || + cpu_id == 0x60fb2))) { tsc_is_invariant = 1; - printf("\n P-state invariant TSC"); + printf("\n TSC: P-state invariant"); } /* From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 17:36:15 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70B87106566C; Wed, 22 Oct 2008 17:36:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id E55A78FC23; Wed, 22 Oct 2008 17:36:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m9MHa6cF018609; Wed, 22 Oct 2008 13:36:06 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Ed Schouten Date: Wed, 22 Oct 2008 13:35:58 -0400 User-Agent: KMail/1.9.7 References: <200810221500.m9MF0MvH031614@svn.freebsd.org> <20081022170805.GJ16837@hoeg.nl> In-Reply-To: <20081022170805.GJ16837@hoeg.nl> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200810221335.59296.jhb@freebsd.org> Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Wed, 22 Oct 2008 13:36:06 -0400 (EDT) X-Virus-Scanned: ClamAV 0.93.1/8470/Wed Oct 22 11:13:42 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184164 - head/sys/dev/ppbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 17:36:15 -0000 On Wednesday 22 October 2008 01:08:05 pm Ed Schouten wrote: > Hi John, > > It seems I forgot to CC my message to you, so I'll just stick it to to > the commit message as well. Sorry. > > * John Baldwin wrote: > > Modified: head/sys/dev/ppbus/lpt.c > > ============================================================================== > > --- head/sys/dev/ppbus/lpt.c Wed Oct 22 14:58:23 2008 (r184163) > > +++ head/sys/dev/ppbus/lpt.c Wed Oct 22 15:00:22 2008 (r184164) > > @@ -399,7 +399,7 @@ lpt_attach(device_t dev) > > sc->cdev_bypass = make_dev(&lpt_cdevsw, unit, > > UID_ROOT, GID_WHEEL, 0600, LPT_NAME "%d.ctl", unit); > > sc->cdev_bypass->si_drv1 = sc; > > - sc->cdev_bypass->si_drv2 = LP_BYPASS; > > + sc->cdev_bypass->si_drv2 = (void *)LP_BYPASS; > > return (0); > > } > > > > @@ -476,7 +476,7 @@ lptopen(struct cdev *dev, int flags, int > > } else > > sc->sc_state |= LPTINIT; > > > > - sc->sc_flags = dev->si_drv2; > > + sc->sc_flags = (uintptr_t)dev->si_drv2; > > > > /* Check for open with BYPASS flag set. */ > > if (sc->sc_flags & LP_BYPASS) { > > Maybe it's better to just use the device unit number to store these > flags? This value is stored inside si_drv0, which is an integer. > Hopefully we'll get rid of make_dev()'s unit number argument somewhere > in the far future, which means drivers can use si_drv0 directly. Once si_drv0 is publicly available then I would have no problem with doing that, but abusing the unit number is non-obvious to me. Traditionally si_drv[12] have been the publicly available fields for drivers to use, and I'd rather stick to that until si_drv0 joins them and can be used directly. Using si_drv0 is also something that can't be MFC'd to 7.x. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 17:36:52 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABE19106567C; Wed, 22 Oct 2008 17:36:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A4DB8FC20; Wed, 22 Oct 2008 17:36:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MHaqFD034646; Wed, 22 Oct 2008 17:36:52 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MHaqHX034645; Wed, 22 Oct 2008 17:36:52 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200810221736.m9MHaqHX034645@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 22 Oct 2008 17:36: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: r184170 - head/sys/amd64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 17:36:52 -0000 Author: jkim Date: Wed Oct 22 17:36:52 2008 New Revision: 184170 URL: http://svn.freebsd.org/changeset/base/184170 Log: Simplify AMD64_CPU_MODEL() and AMD64_CPU_FAMILY() macros as the base family should be at least 0xf00 for all supported platforms. Modified: head/sys/amd64/include/specialreg.h Modified: head/sys/amd64/include/specialreg.h ============================================================================== --- head/sys/amd64/include/specialreg.h Wed Oct 22 17:30:37 2008 (r184169) +++ head/sys/amd64/include/specialreg.h Wed Oct 22 17:36:52 2008 (r184170) @@ -162,12 +162,10 @@ #define CPUID_EXT_FAMILY 0x0ff00000 #define AMD64_CPU_MODEL(id) \ ((((id) & CPUID_MODEL) >> 4) | \ - ((((id) & CPUID_FAMILY) >= 0x600) ? \ - (((id) & CPUID_EXT_MODEL) >> 12) : 0)) + (((id) & CPUID_EXT_MODEL) >> 12)) #define AMD64_CPU_FAMILY(id) \ ((((id) & CPUID_FAMILY) >> 8) + \ - ((((id) & CPUID_FAMILY) == 0xf00) ? \ - (((id) & CPUID_EXT_FAMILY) >> 20) : 0)) + (((id) & CPUID_EXT_FAMILY) >> 20)) /* * CPUID instruction 1 ebx info From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 17:50:45 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9D86106567F; Wed, 22 Oct 2008 17:50:45 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A83CF8FC0A; Wed, 22 Oct 2008 17:50:45 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MHoj6t034930; Wed, 22 Oct 2008 17:50:45 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MHojaN034929; Wed, 22 Oct 2008 17:50:45 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <200810221750.m9MHojaN034929@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 22 Oct 2008 17:50: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: r184171 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 17:50:45 -0000 Author: obrien Date: Wed Oct 22 17:50:45 2008 New Revision: 184171 URL: http://svn.freebsd.org/changeset/base/184171 Log: Clarify the PREEMPTION description a little. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Oct 22 17:36:52 2008 (r184170) +++ head/sys/conf/NOTES Wed Oct 22 17:50:45 2008 (r184171) @@ -242,9 +242,9 @@ options SX_NOINLINE # SMP Debugging Options: # -# PREEMPTION allows the threads that are in the kernel to be preempted -# by higher priority threads. It helps with interactivity and -# allows interrupt threads to run sooner rather than waiting. +# PREEMPTION allows the threads that are in the kernel to be preempted by +# higher priority [interrupt] threads. It helps with interactivity +# and allows interrupt threads to run sooner rather than waiting. # WARNING! Only tested on amd64 and i386. # FULL_PREEMPTION instructs the kernel to preempt non-realtime kernel # threads. Its sole use is to expose race conditions and other From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 17:56:28 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 97DE5106569D; Wed, 22 Oct 2008 17:56:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Wed, 22 Oct 2008 13:56:09 -0400 User-Agent: KMail/1.6.2 References: <200810221730.m9MHUc0R034507@svn.freebsd.org> In-Reply-To: <200810221730.m9MHUc0R034507@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200810221356.20156.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r184169 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 17:56:28 -0000 On Wednesday 22 October 2008 01:30 pm, Jung-uk Kim wrote: > Author: jkim > Date: Wed Oct 22 17:30:37 2008 > New Revision: 184169 > URL: http://svn.freebsd.org/changeset/base/184169 > > Log: > Add AMD Family 0Fh, Model 6Bh, Stepping 2 to the list of > invariant TSCs and fix i386 test. Here is a simple test program: http://people.freebsd.org/~jkim/get_tsc.c How to find whether you have P-state invariant TSC: - Kill powerd if you are running it. - Set kern.timecounter.hardware to something other than TSC. - Set the lowest CPU frequency manually and run the test. If it reports something close to maximum frequency, you have P-state invariant TSC. FYI... Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 18:20:45 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAEE31065682; Wed, 22 Oct 2008 18:20:45 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99B8D8FC25; Wed, 22 Oct 2008 18:20:45 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MIKj0s035540; Wed, 22 Oct 2008 18:20:45 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MIKjWe035539; Wed, 22 Oct 2008 18:20:45 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200810221820.m9MIKjWe035539@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 22 Oct 2008 18:20: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: r184173 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 18:20:45 -0000 Author: marcel Date: Wed Oct 22 18:20:45 2008 New Revision: 184173 URL: http://svn.freebsd.org/changeset/base/184173 Log: Trivially avoid a null pointer dereference when drivers don't set the rman description. While drivers should set it, a kernel panic is not the right behaviour when faced without one. Modified: head/sys/kern/subr_rman.c Modified: head/sys/kern/subr_rman.c ============================================================================== --- head/sys/kern/subr_rman.c Wed Oct 22 18:07:37 2008 (r184172) +++ head/sys/kern/subr_rman.c Wed Oct 22 18:20:45 2008 (r184173) @@ -866,7 +866,8 @@ sysctl_rman(SYSCTL_HANDLER_ARGS) if (res_idx == -1) { bzero(&urm, sizeof(urm)); urm.rm_handle = (uintptr_t)rm; - strlcpy(urm.rm_descr, rm->rm_descr, RM_TEXTLEN); + if (rm->rm_descr != NULL) + strlcpy(urm.rm_descr, rm->rm_descr, RM_TEXTLEN); urm.rm_start = rm->rm_start; urm.rm_size = rm->rm_end - rm->rm_start + 1; urm.rm_type = rm->rm_type; From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 18:30:01 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 715011065671; Wed, 22 Oct 2008 18:30:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: "Attilio Rao" Date: Wed, 22 Oct 2008 14:29:47 -0400 User-Agent: KMail/1.6.2 References: <200810210431.m9L4V7Pb088978@svn.freebsd.org> <200810211605.46927.jkim@FreeBSD.org> <3bbf2fe10810220853r34256b59y1fe57f49eca2014@mail.gmail.com> In-Reply-To: <3bbf2fe10810220853r34256b59y1fe57f49eca2014@mail.gmail.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200810221429.51834.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184108 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 18:30:01 -0000 On Wednesday 22 October 2008 11:53 am, Attilio Rao wrote: > 2008/10/21, Jung-uk Kim : > > On Tuesday 21 October 2008 06:07 am, Attilio Rao wrote: > > > Something we could do with this is adding a "quirk" table of > > > TSC arch dependant known to be working (based on cpu_model and > > > such) and use that table in order to replace tsc_smp. > > > > Please note the invariant_tsc and smp_tsc are different. If we > > go with the route, we need two quirk tables. :-( > > It doesn't matter. > I think it is silly we have different quirks flag states for TSC. > We should just having a table assuming that the TSC is safe to use > in SMP environments and gets rid of any other flag (in this case, > for amd64 based machine, the logic could, for example, check if the > CPU is P state invariant and assume it is safe, etc.) Yes, it does matter as TSC is not just for timecounter and it can be used independently. For example, if a thread is bound to a CPU, it can provide the fastest AND safest timer. Besides, the whole point was not to modify TSC freq. if it is independent from CPU freq. Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 18:35:51 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id A7C641065671; Wed, 22 Oct 2008 18:35:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: "Attilio Rao" Date: Wed, 22 Oct 2008 14:35:36 -0400 User-Agent: KMail/1.6.2 References: <200810210431.m9L4V7Pb088978@svn.freebsd.org> <3bbf2fe10810220853r34256b59y1fe57f49eca2014@mail.gmail.com> <200810221429.51834.jkim@FreeBSD.org> In-Reply-To: <200810221429.51834.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200810221435.42202.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184108 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 18:35:51 -0000 On Wednesday 22 October 2008 02:29 pm, Jung-uk Kim wrote: > On Wednesday 22 October 2008 11:53 am, Attilio Rao wrote: > > 2008/10/21, Jung-uk Kim : > > > On Tuesday 21 October 2008 06:07 am, Attilio Rao wrote: > > > > Something we could do with this is adding a "quirk" table of > > > > TSC arch dependant known to be working (based on cpu_model > > > > and such) and use that table in order to replace tsc_smp. > > > > > > Please note the invariant_tsc and smp_tsc are different. If we > > > go with the route, we need two quirk tables. :-( > > > > It doesn't matter. > > I think it is silly we have different quirks flag states for TSC. > > We should just having a table assuming that the TSC is safe to > > use in SMP environments and gets rid of any other flag (in this > > case, for amd64 based machine, the logic could, for example, > > check if the CPU is P state invariant and assume it is safe, > > etc.) > > Yes, it does matter as TSC is not just for timecounter and it can > be used independently. For example, if a thread is bound to a CPU and the CPU has P-state invariant TSC, > it can provide the fastest AND safest timer. > Besides, the whole point was not to modify TSC freq. if it is > independent from CPU freq. > > Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 19:39:16 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BC4110656FD; Wed, 22 Oct 2008 19:39:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AE678FC17; Wed, 22 Oct 2008 19:39:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MJdGMv037209; Wed, 22 Oct 2008 19:39:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MJdG10037208; Wed, 22 Oct 2008 19:39:16 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200810221939.m9MJdG10037208@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Oct 2008 19:39:16 +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: r184176 - head/sys/dev/ppc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 19:39:16 -0000 Author: jhb Date: Wed Oct 22 19:39:16 2008 New Revision: 184176 URL: http://svn.freebsd.org/changeset/base/184176 Log: Fix build with PPC_PROBE_CHIPSET enabled. Modified: head/sys/dev/ppc/ppc.c Modified: head/sys/dev/ppc/ppc.c ============================================================================== --- head/sys/dev/ppc/ppc.c Wed Oct 22 19:27:40 2008 (r184175) +++ head/sys/dev/ppc/ppc.c Wed Oct 22 19:39:16 2008 (r184176) @@ -751,7 +751,8 @@ config: if (bootverbose) { outb(csr, 0x1); - device_printf(dev, "SMC registers CR1=0x%x", inb(cio) & 0xff); + device_printf(ppc->ppc_dev, "SMC registers CR1=0x%x", + inb(cio) & 0xff); outb(csr, 0x4); printf(" CR4=0x%x", inb(cio) & 0xff); @@ -1044,7 +1045,7 @@ found: if (bootverbose) { /* dump of registers */ - device_printf(dev, "0x%x - ", w83877f_keys[i]); + device_printf(ppc->ppc_dev, "0x%x - ", w83877f_keys[i]); for (i = 0; i <= 0xd; i ++) { outb(efir, i); printf("0x%x ", inb(efdr)); @@ -1078,7 +1079,8 @@ found: switch (r) { case WINB_W83757: if (bootverbose) - device_printf(dev, "W83757 compatible mode\n"); + device_printf(ppc->ppc_dev, + "W83757 compatible mode\n"); return (-1); /* generic or SMC-like */ case WINB_EXTFDC: @@ -1086,20 +1088,20 @@ found: case WINB_EXT2FDD: case WINB_JOYSTICK: if (bootverbose) - device_printf(dev, + device_printf(ppc->ppc_dev, "not in parallel port mode\n"); return (-1); case (WINB_PARALLEL | WINB_EPP_SPP): ppc->ppc_avm |= PPB_EPP | PPB_SPP; if (bootverbose) - device_printf(dev, "EPP SPP\n"); + device_printf(ppc->ppc_dev, "EPP SPP\n"); break; case (WINB_PARALLEL | WINB_ECP): ppc->ppc_avm |= PPB_ECP | PPB_SPP; if (bootverbose) - device_printf(dev, "ECP SPP\n"); + device_printf(ppc->ppc_dev, "ECP SPP\n"); break; case (WINB_PARALLEL | WINB_ECP_EPP): @@ -1107,7 +1109,7 @@ found: ppc->ppc_type = PPC_TYPE_SMCLIKE; if (bootverbose) - device_printf(dev, "ECP+EPP SPP\n"); + device_printf(ppc->ppc_dev, "ECP+EPP SPP\n"); break; default: printf("%s: unknown case (0x%x)!\n", __func__, r); @@ -1128,20 +1130,21 @@ found: if (chipset_mode & PPB_EPP) { outb(efdr, inb(efdr) | WINB_ECP_EPP); if (bootverbose) - device_printf(dev, "ECP+EPP\n"); + device_printf(ppc->ppc_dev, + "ECP+EPP\n"); ppc->ppc_type = PPC_TYPE_SMCLIKE; } else { outb(efdr, inb(efdr) | WINB_ECP); if (bootverbose) - device_printf(dev, "ECP\n"); + device_printf(ppc->ppc_dev, "ECP\n"); } } else { /* select EPP_SPP otherwise */ outb(efdr, inb(efdr) | WINB_EPP_SPP); if (bootverbose) - device_printf(dev, "EPP SPP\n"); + device_printf(ppc->ppc_dev, "EPP SPP\n"); } ppc->ppc_avm = chipset_mode; } From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 19:55:13 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29C94106566C; Wed, 22 Oct 2008 19:55:13 +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 1860B8FC18; Wed, 22 Oct 2008 19:55:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MJtCEC037517; Wed, 22 Oct 2008 19:55:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MJtCT9037516; Wed, 22 Oct 2008 19:55:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200810221955.m9MJtCT9037516@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Oct 2008 19:55: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: r184177 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 19:55:13 -0000 Author: kib Date: Wed Oct 22 19:55:12 2008 New Revision: 184177 URL: http://svn.freebsd.org/changeset/base/184177 Log: Remove doubtful structure definition with variable array members. I believe this is not a valid C99 construct. Use directly calculated offsets into the supplied buffer, using specified members length, to fill appropriate structure. Either use sysctl, or copy the value of the UNAME_x environment variable, instead of unconditionally doing sysctl, and then overriding a returned value with user-specified one. Noted and tested by: rdivacky Modified: head/lib/libc/gen/__xuname.c Modified: head/lib/libc/gen/__xuname.c ============================================================================== --- head/lib/libc/gen/__xuname.c Wed Oct 22 19:39:16 2008 (r184176) +++ head/lib/libc/gen/__xuname.c Wed Oct 22 19:55:12 2008 (r184177) @@ -45,94 +45,102 @@ __xuname(int namesize, void *namebuf) { int mib[2], rval; size_t len; - char *p; + char *p, *q; int oerrno; - struct xutsname { - char sysname[namesize]; /* Name of this OS. */ - char nodename[namesize]; /* Name of this network node. */ - char release[namesize]; /* Release level. */ - char version[namesize]; /* Version level. */ - char machine[namesize]; /* Hardware type. */ - } *name; - name = (struct xutsname *)namebuf; rval = 0; + q = (char *)namebuf; mib[0] = CTL_KERN; - mib[1] = KERN_OSTYPE; - len = sizeof(name->sysname); - oerrno = errno; - if (sysctl(mib, 2, &name->sysname, &len, NULL, 0) == -1) { - if(errno == ENOMEM) - errno = oerrno; - else - rval = -1; - } - name->sysname[sizeof(name->sysname) - 1] = '\0'; + if ((p = getenv("UNAME_s"))) - strlcpy(name->sysname, p, sizeof(name->sysname)); + strlcpy(q, p, namesize); + else { + mib[1] = KERN_OSTYPE; + len = namesize; + oerrno = errno; + if (sysctl(mib, 2, q, &len, NULL, 0) == -1) { + if (errno == ENOMEM) + errno = oerrno; + else + rval = -1; + } + q[namesize - 1] = '\0'; + } + q += namesize; - mib[0] = CTL_KERN; mib[1] = KERN_HOSTNAME; - len = sizeof(name->nodename); + len = namesize; oerrno = errno; - if (sysctl(mib, 2, &name->nodename, &len, NULL, 0) == -1) { - if(errno == ENOMEM) + if (sysctl(mib, 2, q, &len, NULL, 0) == -1) { + if (errno == ENOMEM) errno = oerrno; else rval = -1; } - name->nodename[sizeof(name->nodename) - 1] = '\0'; + q[namesize - 1] = '\0'; + q += namesize; - mib[0] = CTL_KERN; - mib[1] = KERN_OSRELEASE; - len = sizeof(name->release); - oerrno = errno; - if (sysctl(mib, 2, &name->release, &len, NULL, 0) == -1) { - if(errno == ENOMEM) - errno = oerrno; - else - rval = -1; - } - name->release[sizeof(name->release) - 1] = '\0'; if ((p = getenv("UNAME_r"))) - strlcpy(name->release, p, sizeof(name->release)); - - /* The version may have newlines in it, turn them into spaces. */ - mib[0] = CTL_KERN; - mib[1] = KERN_VERSION; - len = sizeof(name->version); - oerrno = errno; - if (sysctl(mib, 2, &name->version, &len, NULL, 0) == -1) { - if (errno == ENOMEM) - errno = oerrno; - else - rval = -1; - } - name->version[sizeof(name->version) - 1] = '\0'; - for (p = name->version; len--; ++p) { - if (*p == '\n' || *p == '\t') { - if (len > 1) - *p = ' '; + strlcpy(q, p, namesize); + else { + mib[1] = KERN_OSRELEASE; + len = namesize; + oerrno = errno; + if (sysctl(mib, 2, q, &len, NULL, 0) == -1) { + if (errno == ENOMEM) + errno = oerrno; else - *p = '\0'; + rval = -1; } + q[namesize - 1] = '\0'; } + q += namesize; + if ((p = getenv("UNAME_v"))) - strlcpy(name->version, p, sizeof(name->version)); + strlcpy(q, p, namesize); + else { - mib[0] = CTL_HW; - mib[1] = HW_MACHINE; - len = sizeof(name->machine); - oerrno = errno; - if (sysctl(mib, 2, &name->machine, &len, NULL, 0) == -1) { - if (errno == ENOMEM) - errno = oerrno; - else - rval = -1; + /* + * The version may have newlines in it, turn them into + * spaces. + */ + mib[1] = KERN_VERSION; + len = namesize; + oerrno = errno; + if (sysctl(mib, 2, q, &len, NULL, 0) == -1) { + if (errno == ENOMEM) + errno = oerrno; + else + rval = -1; + } + q[namesize - 1] = '\0'; + for (p = q; len--; ++p) { + if (*p == '\n' || *p == '\t') { + if (len > 1) + *p = ' '; + else + *p = '\0'; + } + } } - name->machine[sizeof(name->machine) - 1] = '\0'; + q += namesize; + if ((p = getenv("UNAME_m"))) - strlcpy(name->machine, p, sizeof(name->machine)); + strlcpy(q, p, namesize); + else { + mib[0] = CTL_HW; + mib[1] = HW_MACHINE; + len = namesize; + oerrno = errno; + if (sysctl(mib, 2, &q, &len, NULL, 0) == -1) { + if (errno == ENOMEM) + errno = oerrno; + else + rval = -1; + } + q[namesize - 1] = '\0'; + } + return (rval); } From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 20:18:47 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF0201065670; Wed, 22 Oct 2008 20:18:47 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE2498FC16; Wed, 22 Oct 2008 20:18:47 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MKIlvj037975; Wed, 22 Oct 2008 20:18:47 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MKIlmm037974; Wed, 22 Oct 2008 20:18:47 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200810222018.m9MKIlmm037974@svn.freebsd.org> From: Nick Hibma Date: Wed, 22 Oct 2008 20:18:47 +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: r184178 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 20:18:48 -0000 Author: n_hibma Date: Wed Oct 22 20:18:47 2008 New Revision: 184178 URL: http://svn.freebsd.org/changeset/base/184178 Log: Remove a comment that belonged to a deleted if statement. Modified: head/sys/dev/usb/ubsa.c Modified: head/sys/dev/usb/ubsa.c ============================================================================== --- head/sys/dev/usb/ubsa.c Wed Oct 22 19:55:12 2008 (r184177) +++ head/sys/dev/usb/ubsa.c Wed Oct 22 20:18:47 2008 (r184178) @@ -433,7 +433,6 @@ ubsa_request(struct ubsa_softc *sc, u_in usb_device_request_t req; usbd_status err; - /* The huawei Exxx devices support none of these tricks */ req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = request; USETW(req.wValue, value); From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 20:32:20 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C4B91065710; Wed, 22 Oct 2008 20:32:20 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 136708FC28; Wed, 22 Oct 2008 20:32:20 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MKWJV5038282; Wed, 22 Oct 2008 20:32:19 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MKWJ2X038281; Wed, 22 Oct 2008 20:32:19 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200810222032.m9MKWJ2X038281@svn.freebsd.org> From: Ken Smith Date: Wed, 22 Oct 2008 20:32: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: r184180 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 20:32:20 -0000 Author: kensmith Date: Wed Oct 22 20:32:19 2008 New Revision: 184180 URL: http://svn.freebsd.org/changeset/base/184180 Log: Turns out its not a good idea to assume the packages that might be selected from the "dists" are all on the current volume. Looks like xorg won't fit on disc1 for 6.4-REL. Iterate through media volumes for packages that wind up being selected from the dists section in addition to the ones that get selected from the packages menu. MFC after: 2 days Modified: head/usr.sbin/sysinstall/package.c Modified: head/usr.sbin/sysinstall/package.c ============================================================================== --- head/usr.sbin/sysinstall/package.c Wed Oct 22 20:24:52 2008 (r184179) +++ head/usr.sbin/sysinstall/package.c Wed Oct 22 20:32:19 2008 (r184180) @@ -55,7 +55,7 @@ int package_add(char *name) { PkgNodePtr tmp; - int i; + int i, current, low, high; if (!mediaVerify()) return DITEM_FAILURE; @@ -68,9 +68,16 @@ package_add(char *name) return i; tmp = index_search(&Top, name, &tmp); - if (tmp) - return index_extract(mediaDevice, &Top, tmp, FALSE, 0); - else { + if (tmp) { + if (have_volumes) { + low = low_volume; + high = high_volume; + } else + low = high = 0; + for (current = low; current <= high; current++) + i = index_extract(mediaDevice, &Top, tmp, FALSE, current); + return i; + } else { msgConfirm("Sorry, package %s was not found in the INDEX.", name); return DITEM_FAILURE; } From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 21:02:20 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 559051065675; Wed, 22 Oct 2008 21:02:20 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id BAEE68FC28; Wed, 22 Oct 2008 21:02:19 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.3/8.14.3) with ESMTP id m9ML2Ivr067573; Thu, 23 Oct 2008 01:02:18 +0400 (MSD) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1224709338; bh=qHRM6vlBDmbIPG5GcMbzDXtMsGUuSzj54Ud36GQ /qBw=; l=825; h=Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To; b=oukzVRUWRHzH0Yu9IQtvCp4Zj mOZImAy5LJeuO+f6G+qUY6hphdW/mhb0d7HkdnjEdMlagPdBUTFD2p5x2Id8S/dfkLI PQXXOmoJ/Q9Mv2dznFIO81cZ2ocFFaxnYdvgI60klHPNtI9X0A3poxfTnKwT/MTiJwF mxNP7RXycJXI= Received: (from ache@localhost) by nagual.pp.ru (8.14.3/8.14.3/Submit) id m9ML2IoU067572; Thu, 23 Oct 2008 01:02:18 +0400 (MSD) (envelope-from ache) Date: Thu, 23 Oct 2008 01:02:16 +0400 From: Andrey Chernov To: Konstantin Belousov Message-ID: <20081022210216.GA67445@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Konstantin Belousov , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <200810221955.m9MJtCT9037516@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200810221955.m9MJtCT9037516@svn.freebsd.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184177 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 21:02:20 -0000 On Wed, Oct 22, 2008 at 07:55:12PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Wed Oct 22 19:55:12 2008 > New Revision: 184177 > URL: http://svn.freebsd.org/changeset/base/184177 > > Log: > Remove doubtful structure definition with variable array members. > I believe this is not a valid C99 construct. Use directly calculated > offsets into the supplied buffer, using specified members length, > to fill appropriate structure. > > Either use sysctl, or copy the value of the UNAME_x environment > variable, instead of unconditionally doing sysctl, and then > overriding a returned value with user-specified one. > > Noted and tested by: rdivacky Unfortunately on i386 this change cause segfaults in many programs at once (even in make(1)) -- http://ache.pp.ru/ From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 21:03:30 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73FE21065672; Wed, 22 Oct 2008 21:03:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 631438FC13; Wed, 22 Oct 2008 21:03:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9ML3U7d038877; Wed, 22 Oct 2008 21:03:30 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9ML3UUO038876; Wed, 22 Oct 2008 21:03:30 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200810222103.m9ML3UUO038876@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 22 Oct 2008 21:03: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: r184181 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 21:03:30 -0000 Author: jkim Date: Wed Oct 22 21:03:30 2008 New Revision: 184181 URL: http://svn.freebsd.org/changeset/base/184181 Log: Really fix i386 test this time. A whole stack of pointyhat to me, please. Modified: head/sys/i386/i386/identcpu.c Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Wed Oct 22 20:32:19 2008 (r184180) +++ head/sys/i386/i386/identcpu.c Wed Oct 22 21:03:30 2008 (r184181) @@ -848,7 +848,7 @@ printcpuinfo(void) if (!tsc_is_invariant && (strcmp(cpu_vendor, "AuthenticAMD") == 0 && ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || - AMD64_CPU_FAMILY(cpu_id) >= 0x10 || + I386_CPU_FAMILY(cpu_id) >= 0x10 || cpu_id == 0x60fb2))) { tsc_is_invariant = 1; printf("\n TSC: P-state invariant"); From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 21:31:49 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 59A4A1065670; Wed, 22 Oct 2008 21:31:47 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Doug Barton Date: Wed, 22 Oct 2008 17:31:27 -0400 User-Agent: KMail/1.6.2 References: <200810221730.m9MHUc0R034507@svn.freebsd.org> <48FF988F.80000@FreeBSD.org> In-Reply-To: <48FF988F.80000@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200810221731.34257.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184169 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 21:31:49 -0000 On Wednesday 22 October 2008 05:18 pm, Doug Barton wrote: > This change in the i386 directory causes the following error. After > reverting this it compiles. Yes, it should be fixed now. I am having trouble building universe today and keep making mistakes. :-( Sorry, Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 21:44:49 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC6911065675 for ; Wed, 22 Oct 2008 21:44:49 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx24.fluidhosting.com [204.14.89.7]) by mx1.freebsd.org (Postfix) with ESMTP id 932498FC26 for ; Wed, 22 Oct 2008 21:44:49 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 6034 invoked by uid 399); 22 Oct 2008 21:18:09 -0000 Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 22 Oct 2008 21:18:09 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <48FF988F.80000@FreeBSD.org> Date: Wed, 22 Oct 2008 14:18:07 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.17 (X11/20081010) MIME-Version: 1.0 To: Jung-uk Kim References: <200810221730.m9MHUc0R034507@svn.freebsd.org> In-Reply-To: <200810221730.m9MHUc0R034507@svn.freebsd.org> X-Enigmail-Version: 0.95.7 OpenPGP: id=D5B2F0FB 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: r184169 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 21:44:50 -0000 This change in the i386 directory causes the following error. After reverting this it compiles. Doug cc -c -O -pipe -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/usr/local/src/sys -I/usr/local/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-protector -Werror /usr/local/src/sys/i386/i386/identcpu.c cc1: warnings being treated as errors /usr/local/src/sys/i386/i386/identcpu.c: In function 'printcpuinfo': /usr/local/src/sys/i386/i386/identcpu.c:851: warning: implicit declaration of function 'AMD64_CPU_FAMILY' /usr/local/src/sys/i386/i386/identcpu.c:851: warning: nested extern declaration of 'AMD64_CPU_FAMILY' *** Error code 1 Jung-uk Kim wrote: > Author: jkim > Date: Wed Oct 22 17:30:37 2008 > New Revision: 184169 > URL: http://svn.freebsd.org/changeset/base/184169 > > Log: > Add AMD Family 0Fh, Model 6Bh, Stepping 2 to the list of invariant TSCs > and fix i386 test. > > Modified: > head/sys/amd64/amd64/identcpu.c > head/sys/i386/i386/identcpu.c > > Modified: head/sys/amd64/amd64/identcpu.c > ============================================================================== > --- head/sys/amd64/amd64/identcpu.c Wed Oct 22 16:50:12 2008 (r184168) > +++ head/sys/amd64/amd64/identcpu.c Wed Oct 22 17:30:37 2008 (r184169) > @@ -347,12 +347,17 @@ printcpuinfo(void) > "AuthenticAMD") == 0) > cpu_feature &= ~CPUID_HTT; > > + /* > + * If this CPU supports P-state invariant TSC then > + * mention the capability. > + */ > if (!tsc_is_invariant && > (strcmp(cpu_vendor, "AuthenticAMD") == 0 && > ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || > - AMD64_CPU_FAMILY(cpu_id) >= 0x10))) { > + AMD64_CPU_FAMILY(cpu_id) >= 0x10 || > + cpu_id == 0x60fb2))) { > tsc_is_invariant = 1; > - printf("\n P-state invariant TSC"); > + printf("\n TSC: P-state invariant"); > } > > /* > > Modified: head/sys/i386/i386/identcpu.c > ============================================================================== > --- head/sys/i386/i386/identcpu.c Wed Oct 22 16:50:12 2008 (r184168) > +++ head/sys/i386/i386/identcpu.c Wed Oct 22 17:30:37 2008 (r184169) > @@ -841,12 +841,17 @@ printcpuinfo(void) > "AuthenticAMD") == 0) > cpu_feature &= ~CPUID_HTT; > > + /* > + * If this CPU supports P-state invariant TSC then > + * mention the capability. > + */ > if (!tsc_is_invariant && > - ((strcmp(cpu_vendor, "AuthenticAMD") == 0 && > - (amd_pminfo & AMDPM_TSC_INVARIANT) != 0) || > - I386_CPU_FAMILY(cpu_id) >= 0x10)) { > + (strcmp(cpu_vendor, "AuthenticAMD") == 0 && > + ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || > + AMD64_CPU_FAMILY(cpu_id) >= 0x10 || > + cpu_id == 0x60fb2))) { > tsc_is_invariant = 1; > - printf("\n P-state invariant TSC"); > + printf("\n TSC: P-state invariant"); > } > > /* > From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 21:46:59 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B79F8106566C; Wed, 22 Oct 2008 21:46:59 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A638E8FC08; Wed, 22 Oct 2008 21:46:59 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MLkxdJ039675; Wed, 22 Oct 2008 21:46:59 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MLkxor039674; Wed, 22 Oct 2008 21:46:59 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200810222146.m9MLkxor039674@svn.freebsd.org> From: Nick Hibma Date: Wed, 22 Oct 2008 21:46:59 +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: r184182 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 21:46:59 -0000 Author: n_hibma Date: Wed Oct 22 21:46:59 2008 New Revision: 184182 URL: http://svn.freebsd.org/changeset/base/184182 Log: The driver supports the Sony W810i phone (interface class driver). Note: This entry is added as this is there was no mention of any phones in the list. This entry might have people try the driver against their device. The Sony Ericsson phone provides an OBEX stack on further CDC interfaces. Umodem wrongfully assumes that it is the driver for this interface. This is due to a bogus implementation in the umodem driver when searching for the data interface. This should be read from the CDC descriptors. Also, more of this should happen in the probe instead of attach. MFC after: 4 weeks Modified: head/share/man/man4/umodem.4 Modified: head/share/man/man4/umodem.4 ============================================================================== --- head/share/man/man4/umodem.4 Wed Oct 22 21:03:30 2008 (r184181) +++ head/share/man/man4/umodem.4 Wed Oct 22 21:46:59 2008 (r184182) @@ -96,6 +96,8 @@ Sierra MC5720 Wireless Modem Yamaha Broadband Wireless Router RTW65b .It ELSA MicroLink 56k USB modem +.It +Sony Ericsson W810i phone .El .Sh SEE ALSO .Xr tty 4 , From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 21:55:49 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 387471065679; Wed, 22 Oct 2008 21:55:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2652F8FC18; Wed, 22 Oct 2008 21:55:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MLtmBs039896; Wed, 22 Oct 2008 21:55:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MLtmVa039892; Wed, 22 Oct 2008 21:55:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200810222155.m9MLtmVa039892@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Oct 2008 21:55: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: r184183 - in head/sys: compat/freebsd32 kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 21:55:49 -0000 Author: jhb Date: Wed Oct 22 21:55:48 2008 New Revision: 184183 URL: http://svn.freebsd.org/changeset/base/184183 Log: Split the copyout of *base at the end of getdirentries() out leaving the rest in kern_getdirentries(). Use kern_getdirentries() to implement freebsd32_getdirentries(). This fixes a bug where calls to getdirentries() in 32-bit binaries would trash the 4 bytes after the 'long base' in userland. Submitted by: ups MFC after: 1 week Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/syscalls.master head/sys/kern/vfs_syscalls.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Wed Oct 22 21:46:59 2008 (r184182) +++ head/sys/compat/freebsd32/freebsd32_misc.c Wed Oct 22 21:55:48 2008 (r184183) @@ -1762,6 +1762,24 @@ freebsd32_ftruncate(struct thread *td, s return (ftruncate(td, &ap)); } +int +freebsd32_getdirentries(struct thread *td, + struct freebsd32_getdirentries_args *uap) +{ + long base; + int32_t base32; + int error; + + error = kern_getdirentries(td, uap->fd, uap->buf, uap->count, &base); + if (error) + return (error); + if (uap->basep != NULL) { + base32 = base; + error = copyout(&base32, uap->basep, sizeof(int32_t)); + } + return (error); +} + #ifdef COMPAT_FREEBSD6 /* versions with the 'int pad' argument */ int Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Wed Oct 22 21:46:59 2008 (r184182) +++ head/sys/compat/freebsd32/syscalls.master Wed Oct 22 21:55:48 2008 (r184183) @@ -350,8 +350,8 @@ 195 AUE_SETRLIMIT NOPROTO { int setrlimit(u_int which, \ struct rlimit *rlp); } setrlimit \ __setrlimit_args int -196 AUE_GETDIRENTRIES NOPROTO { int getdirentries(int fd, char *buf, \ - u_int count, long *basep); } +196 AUE_GETDIRENTRIES STD { int freebsd32_getdirentries(int fd, \ + char *buf, u_int count, int32_t *basep); } 197 AUE_MMAP COMPAT6 { caddr_t freebsd32_mmap(caddr_t addr, \ size_t len, int prot, int flags, int fd, \ int pad, u_int32_t poslo, \ Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Wed Oct 22 21:46:59 2008 (r184182) +++ head/sys/kern/vfs_syscalls.c Wed Oct 22 21:55:48 2008 (r184183) @@ -4016,6 +4016,21 @@ getdirentries(td, uap) long *basep; } */ *uap; { + long base; + int error; + + error = kern_getdirentries(td, uap->fd, uap->buf, uap->count, &base); + if (error) + return (error); + if (uap->basep != NULL) + error = copyout(&base, uap->basep, sizeof(long)); + return (error); +} + +int +kern_getdirentries(struct thread *td, int fd, char *buf, u_int count, + long *basep) +{ struct vnode *vp; struct file *fp; struct uio auio; @@ -4024,8 +4039,8 @@ getdirentries(td, uap) long loff; int error, eofflag; - AUDIT_ARG(fd, uap->fd); - if ((error = getvnode(td->td_proc->p_fd, uap->fd, &fp)) != 0) + AUDIT_ARG(fd, fd); + if ((error = getvnode(td->td_proc->p_fd, fd, &fp)) != 0) return (error); if ((fp->f_flag & FREAD) == 0) { fdrop(fp, td); @@ -4039,14 +4054,14 @@ unionread: error = EINVAL; goto fail; } - aiov.iov_base = uap->buf; - aiov.iov_len = uap->count; + aiov.iov_base = buf; + aiov.iov_len = count; auio.uio_iov = &aiov; auio.uio_iovcnt = 1; auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_USERSPACE; auio.uio_td = td; - auio.uio_resid = uap->count; + auio.uio_resid = count; /* vn_lock(vp, LK_SHARED | LK_RETRY); */ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); AUDIT_ARG(vnode, vp, ARG_VNODE1); @@ -4063,7 +4078,7 @@ unionread: VFS_UNLOCK_GIANT(vfslocked); goto fail; } - if (uap->count == auio.uio_resid && + if (count == auio.uio_resid && (vp->v_vflag & VV_ROOT) && (vp->v_mount->mnt_flag & MNT_UNION)) { struct vnode *tvp = vp; @@ -4078,10 +4093,8 @@ unionread: } VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); - if (uap->basep != NULL) { - error = copyout(&loff, uap->basep, sizeof(long)); - } - td->td_retval[0] = uap->count - auio.uio_resid; + *basep = loff; + td->td_retval[0] = count - auio.uio_resid; fail: fdrop(fp, td); return (error); Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Wed Oct 22 21:46:59 2008 (r184182) +++ head/sys/sys/syscallsubr.h Wed Oct 22 21:55:48 2008 (r184183) @@ -91,6 +91,8 @@ int kern_fstatfs(struct thread *td, int int kern_ftruncate(struct thread *td, int fd, off_t length); int kern_futimes(struct thread *td, int fd, struct timeval *tptr, enum uio_seg tptrseg); +int kern_getdirentries(struct thread *td, int fd, char *buf, u_int count, + long *basep); int kern_getfsstat(struct thread *td, struct statfs **buf, size_t bufsize, enum uio_seg bufseg, int flags); int kern_getgroups(struct thread *td, u_int *ngrp, gid_t *groups); From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 21:56:45 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10C851065675; Wed, 22 Oct 2008 21:56:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F32BF8FC19; Wed, 22 Oct 2008 21:56:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MLuir6039949; Wed, 22 Oct 2008 21:56:44 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MLuinB039945; Wed, 22 Oct 2008 21:56:44 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200810222156.m9MLuinB039945@svn.freebsd.org> From: John Baldwin Date: Wed, 22 Oct 2008 21:56: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: r184184 - head/sys/compat/freebsd32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 21:56:45 -0000 Author: jhb Date: Wed Oct 22 21:56:44 2008 New Revision: 184184 URL: http://svn.freebsd.org/changeset/base/184184 Log: Regen for freebsd32_getdirentries(). Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Wed Oct 22 21:55:48 2008 (r184183) +++ head/sys/compat/freebsd32/freebsd32_proto.h Wed Oct 22 21:56:44 2008 (r184184) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 183361 2008-09-25 20:07:42Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184183 2008-10-22 21:55:48Z jhb */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -152,6 +152,12 @@ struct freebsd32_lstat_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char ub_l_[PADL_(struct stat32 *)]; struct stat32 * ub; char ub_r_[PADR_(struct stat32 *)]; }; +struct freebsd32_getdirentries_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char count_l_[PADL_(u_int)]; u_int count; char count_r_[PADR_(u_int)]; + char basep_l_[PADL_(int32_t *)]; int32_t * basep; char basep_r_[PADR_(int32_t *)]; +}; struct freebsd32_sysctl_args { char name_l_[PADL_(int *)]; int * name; char name_r_[PADR_(int *)]; char namelen_l_[PADL_(u_int)]; u_int namelen; char namelen_r_[PADR_(u_int)]; @@ -406,6 +412,7 @@ int freebsd32_shmsys(struct thread *, st int freebsd32_stat(struct thread *, struct freebsd32_stat_args *); int freebsd32_fstat(struct thread *, struct freebsd32_fstat_args *); int freebsd32_lstat(struct thread *, struct freebsd32_lstat_args *); +int freebsd32_getdirentries(struct thread *, struct freebsd32_getdirentries_args *); int freebsd32_sysctl(struct thread *, struct freebsd32_sysctl_args *); int freebsd32_futimes(struct thread *, struct freebsd32_futimes_args *); int freebsd32_semctl(struct thread *, struct freebsd32_semctl_args *); @@ -618,6 +625,7 @@ int freebsd6_freebsd32_ftruncate(struct #define FREEBSD32_SYS_AUE_freebsd32_stat AUE_STAT #define FREEBSD32_SYS_AUE_freebsd32_fstat AUE_FSTAT #define FREEBSD32_SYS_AUE_freebsd32_lstat AUE_LSTAT +#define FREEBSD32_SYS_AUE_freebsd32_getdirentries AUE_GETDIRENTRIES #define FREEBSD32_SYS_AUE_freebsd32_sysctl AUE_SYSCTL #define FREEBSD32_SYS_AUE_freebsd32_futimes AUE_FUTIMES #define FREEBSD32_SYS_AUE_freebsd32_semctl AUE_SEMCTL Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Wed Oct 22 21:55:48 2008 (r184183) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Wed Oct 22 21:56:44 2008 (r184184) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 183361 2008-09-25 20:07:42Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184183 2008-10-22 21:55:48Z jhb */ #define FREEBSD32_SYS_syscall 0 @@ -177,7 +177,7 @@ #define FREEBSD32_SYS_fpathconf 192 #define FREEBSD32_SYS_getrlimit 194 #define FREEBSD32_SYS_setrlimit 195 -#define FREEBSD32_SYS_getdirentries 196 +#define FREEBSD32_SYS_freebsd32_getdirentries 196 #define FREEBSD32_SYS_freebsd6_freebsd32_mmap 197 #define FREEBSD32_SYS___syscall 198 #define FREEBSD32_SYS_freebsd6_freebsd32_lseek 199 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Wed Oct 22 21:55:48 2008 (r184183) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Wed Oct 22 21:56:44 2008 (r184184) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 183361 2008-09-25 20:07:42Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184183 2008-10-22 21:55:48Z jhb */ const char *freebsd32_syscallnames[] = { @@ -203,7 +203,7 @@ const char *freebsd32_syscallnames[] = { "#193", /* 193 = nosys */ "getrlimit", /* 194 = getrlimit */ "setrlimit", /* 195 = setrlimit */ - "getdirentries", /* 196 = getdirentries */ + "freebsd32_getdirentries", /* 196 = freebsd32_getdirentries */ "compat6.freebsd32_mmap", /* 197 = old freebsd32_mmap */ "__syscall", /* 198 = __syscall */ "compat6.freebsd32_lseek", /* 199 = old freebsd32_lseek */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Wed Oct 22 21:55:48 2008 (r184183) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Wed Oct 22 21:56:44 2008 (r184184) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 183361 2008-09-25 20:07:42Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 184183 2008-10-22 21:55:48Z jhb */ #include "opt_compat.h" @@ -234,7 +234,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 193 = nosys */ { AS(__getrlimit_args), (sy_call_t *)getrlimit, AUE_GETRLIMIT, NULL, 0, 0 }, /* 194 = getrlimit */ { AS(__setrlimit_args), (sy_call_t *)setrlimit, AUE_SETRLIMIT, NULL, 0, 0 }, /* 195 = setrlimit */ - { AS(getdirentries_args), (sy_call_t *)getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0 }, /* 196 = getdirentries */ + { AS(freebsd32_getdirentries_args), (sy_call_t *)freebsd32_getdirentries, AUE_GETDIRENTRIES, NULL, 0, 0 }, /* 196 = freebsd32_getdirentries */ { compat6(AS(freebsd6_freebsd32_mmap_args),freebsd32_mmap), AUE_MMAP, NULL, 0, 0 }, /* 197 = old freebsd32_mmap */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 198 = __syscall */ { compat6(AS(freebsd6_freebsd32_lseek_args),freebsd32_lseek), AUE_LSEEK, NULL, 0, 0 }, /* 199 = old freebsd32_lseek */ From owner-svn-src-head@FreeBSD.ORG Wed Oct 22 21:56:58 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46D701065791; Wed, 22 Oct 2008 21:56:58 +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 360388FC1F; Wed, 22 Oct 2008 21:56:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9MLuwUU039989; Wed, 22 Oct 2008 21:56:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9MLuwtD039988; Wed, 22 Oct 2008 21:56:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200810222156.m9MLuwtD039988@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 22 Oct 2008 21:56: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: r184185 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Oct 2008 21:56:58 -0000 Author: kib Date: Wed Oct 22 21:56:57 2008 New Revision: 184185 URL: http://svn.freebsd.org/changeset/base/184185 Log: Fix a typo. q is already a pointer. Reported by: ache Pointy hat to: kib Modified: head/lib/libc/gen/__xuname.c Modified: head/lib/libc/gen/__xuname.c ============================================================================== --- head/lib/libc/gen/__xuname.c Wed Oct 22 21:56:44 2008 (r184184) +++ head/lib/libc/gen/__xuname.c Wed Oct 22 21:56:57 2008 (r184185) @@ -133,7 +133,7 @@ __xuname(int namesize, void *namebuf) mib[1] = HW_MACHINE; len = namesize; oerrno = errno; - if (sysctl(mib, 2, &q, &len, NULL, 0) == -1) { + if (sysctl(mib, 2, q, &len, NULL, 0) == -1) { if (errno == ENOMEM) errno = oerrno; else From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 00:15:01 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F393106566B; Thu, 23 Oct 2008 00:15:01 +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 8C6488FC16; Thu, 23 Oct 2008 00:15:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9N0F0ZY042384; Thu, 23 Oct 2008 00:15:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9N0F0DN042379; Thu, 23 Oct 2008 00:15:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200810230015.m9N0F0DN042379@svn.freebsd.org> From: Xin LI Date: Thu, 23 Oct 2008 00:15: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: r184186 - head/usr.sbin/nscd/agents X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 00:15:01 -0000 Author: delphij Date: Thu Oct 23 00:15:00 2008 New Revision: 184186 URL: http://svn.freebsd.org/changeset/base/184186 Log: Replace malloc() + memset() with calloc. This corrects a misuse of memset() as a side effect. Modified: head/usr.sbin/nscd/agents/group.c head/usr.sbin/nscd/agents/passwd.c head/usr.sbin/nscd/agents/services.c Modified: head/usr.sbin/nscd/agents/group.c ============================================================================== --- head/usr.sbin/nscd/agents/group.c Wed Oct 22 21:56:57 2008 (r184185) +++ head/usr.sbin/nscd/agents/group.c Thu Oct 23 00:15:00 2008 (r184186) @@ -140,9 +140,8 @@ group_lookup_func(const char *key, size_ switch (lookup_type) { case nss_lt_name: size = key_size - sizeof(enum nss_lookup_type) + 1; - name = (char *)malloc(size); + name = (char *)calloc(1, size); assert(name != NULL); - memset(name, 0, size); memcpy(name, key + sizeof(enum nss_lookup_type), size - 1); break; case nss_lt_id: @@ -225,9 +224,8 @@ init_group_agent() struct common_agent *retval; TRACE_IN(init_group_agent); - retval = (struct common_agent *)malloc(sizeof(struct common_agent)); + retval = (struct common_agent *)calloc(1, sizeof(struct common_agent)); assert(retval != NULL); - memset(retval, 0, sizeof(struct common_agent)); retval->parent.name = strdup("group"); assert(retval->parent.name != NULL); @@ -245,10 +243,9 @@ init_group_mp_agent() struct multipart_agent *retval; TRACE_IN(init_group_mp_agent); - retval = (struct multipart_agent *)malloc( + retval = (struct multipart_agent *)calloc(1, sizeof(struct multipart_agent)); assert(retval != NULL); - memset(retval, 0, sizeof(struct multipart_agent)); retval->parent.name = strdup("group"); retval->parent.type = MULTIPART_AGENT; Modified: head/usr.sbin/nscd/agents/passwd.c ============================================================================== --- head/usr.sbin/nscd/agents/passwd.c Wed Oct 22 21:56:57 2008 (r184185) +++ head/usr.sbin/nscd/agents/passwd.c Thu Oct 23 00:15:00 2008 (r184186) @@ -148,9 +148,8 @@ passwd_lookup_func(const char *key, size switch (lookup_type) { case nss_lt_name: size = key_size - sizeof(enum nss_lookup_type) + 1; - login = (char *)malloc(size); + login = (char *)calloc(1, size); assert(login != NULL); - memset(login, 0, size); memcpy(login, key + sizeof(enum nss_lookup_type), size - 1); break; case nss_lt_id: @@ -232,9 +231,8 @@ init_passwd_agent() struct common_agent *retval; TRACE_IN(init_passwd_agent); - retval = (struct common_agent *)malloc(sizeof(struct common_agent)); + retval = (struct common_agent *)calloc(1, sizeof(struct common_agent)); assert(retval != NULL); - memset(retval, 0, sizeof(struct common_agent)); retval->parent.name = strdup("passwd"); assert(retval->parent.name != NULL); @@ -252,10 +250,9 @@ init_passwd_mp_agent() struct multipart_agent *retval; TRACE_IN(init_passwd_mp_agent); - retval = (struct multipart_agent *)malloc( + retval = (struct multipart_agent *)calloc(1, sizeof(struct multipart_agent)); assert(retval != NULL); - memset(retval, 0, sizeof(struct multipart_agent)); retval->parent.name = strdup("passwd"); retval->parent.type = MULTIPART_AGENT; Modified: head/usr.sbin/nscd/agents/services.c ============================================================================== --- head/usr.sbin/nscd/agents/services.c Wed Oct 22 21:56:57 2008 (r184185) +++ head/usr.sbin/nscd/agents/services.c Thu Oct 23 00:15:00 2008 (r184186) @@ -145,9 +145,8 @@ services_lookup_func(const char *key, si switch (lookup_type) { case nss_lt_name: size = key_size - sizeof(enum nss_lookup_type); - name = (char *)malloc(size + 1); + name = (char *)calloc(1, size + 1); assert(name != NULL); - memset(name, 0, size + 1); memcpy(name, key + sizeof(enum nss_lookup_type), size); size2 = strlen(name) + 1; @@ -169,9 +168,8 @@ services_lookup_func(const char *key, si size = key_size - sizeof(enum nss_lookup_type) - sizeof(int); if (size > 0) { - proto = (char *)malloc(size + 1); + proto = (char *)calloc(1, size + 1); assert(proto != NULL); - memset(proto, size + 1, 0); memcpy(proto, key + sizeof(enum nss_lookup_type) + sizeof(int), size); } @@ -247,9 +245,8 @@ init_services_agent() struct common_agent *retval; TRACE_IN(init_services_agent); - retval = (struct common_agent *)malloc(sizeof(struct common_agent)); + retval = (struct common_agent *)calloc(1, sizeof(struct common_agent)); assert(retval != NULL); - memset(retval, 0, sizeof(struct common_agent)); retval->parent.name = strdup("services"); assert(retval->parent.name != NULL); @@ -267,10 +264,9 @@ init_services_mp_agent() struct multipart_agent *retval; TRACE_IN(init_services_mp_agent); - retval = (struct multipart_agent *)malloc( + retval = (struct multipart_agent *)calloc(1, sizeof(struct multipart_agent)); assert(retval != NULL); - memset(retval, 0, sizeof(struct multipart_agent)); retval->parent.name = strdup("services"); retval->parent.type = MULTIPART_AGENT; From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 00:27:35 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B122C106567E; Thu, 23 Oct 2008 00:27:35 +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 9F3988FC08; Thu, 23 Oct 2008 00:27:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9N0RZxQ042621; Thu, 23 Oct 2008 00:27:35 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9N0RZp4042620; Thu, 23 Oct 2008 00:27:35 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200810230027.m9N0RZp4042620@svn.freebsd.org> From: Xin LI Date: Thu, 23 Oct 2008 00:27:35 +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: r184187 - head/usr.sbin/nscd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 00:27:35 -0000 Author: delphij Date: Thu Oct 23 00:27:35 2008 New Revision: 184187 URL: http://svn.freebsd.org/changeset/base/184187 Log: Since we are going to strlen() on the string, it is supposed to be NUL-terminated, so use strlcpy() instead of strncpy() here. Modified: head/usr.sbin/nscd/nscd.c Modified: head/usr.sbin/nscd/nscd.c ============================================================================== --- head/usr.sbin/nscd/nscd.c Thu Oct 23 00:15:00 2008 (r184186) +++ head/usr.sbin/nscd/nscd.c Thu Oct 23 00:27:35 2008 (r184187) @@ -173,7 +173,7 @@ init_runtime_env(struct configuration *c memset(&serv_addr, 0, sizeof(struct sockaddr_un)); serv_addr.sun_family = PF_LOCAL; - strncpy(serv_addr.sun_path, config->socket_path, + strlcpy(serv_addr.sun_path, config->socket_path, sizeof(serv_addr.sun_path)); serv_addr_len = sizeof(serv_addr.sun_family) + strlen(serv_addr.sun_path) + 1; From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 00:28:21 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77E51106567A; Thu, 23 Oct 2008 00:28:21 +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 6607E8FC13; Thu, 23 Oct 2008 00:28:21 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9N0SL9l042674; Thu, 23 Oct 2008 00:28:21 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9N0SLnc042673; Thu, 23 Oct 2008 00:28:21 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200810230028.m9N0SLnc042673@svn.freebsd.org> From: Xin LI Date: Thu, 23 Oct 2008 00:28: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: r184188 - head/usr.sbin/nscd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 00:28:21 -0000 Author: delphij Date: Thu Oct 23 00:28:21 2008 New Revision: 184188 URL: http://svn.freebsd.org/changeset/base/184188 Log: Use strlcpy() before strlen() instead of strncpy(). Modified: head/usr.sbin/nscd/nscdcli.c Modified: head/usr.sbin/nscd/nscdcli.c ============================================================================== --- head/usr.sbin/nscd/nscdcli.c Thu Oct 23 00:27:35 2008 (r184187) +++ head/usr.sbin/nscd/nscdcli.c Thu Oct 23 00:28:21 2008 (r184188) @@ -187,7 +187,7 @@ open_nscd_connection__(struct nscd_conne client_socket = socket(PF_LOCAL, SOCK_STREAM, 0); client_address.sun_family = PF_LOCAL; - strncpy(client_address.sun_path, params->socket_path, + strlcpy(client_address.sun_path, params->socket_path, sizeof(client_address.sun_path)); client_address_len = sizeof(client_address.sun_family) + strlen(client_address.sun_path) + 1; From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 00:31:15 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5C8D1065679; Thu, 23 Oct 2008 00:31:15 +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 93D258FC0A; Thu, 23 Oct 2008 00:31:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9N0VFYK042766; Thu, 23 Oct 2008 00:31:15 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9N0VFXJ042765; Thu, 23 Oct 2008 00:31:15 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200810230031.m9N0VFXJ042765@svn.freebsd.org> From: Xin LI Date: Thu, 23 Oct 2008 00:31: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: r184189 - head/usr.sbin/nscd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 00:31:15 -0000 Author: delphij Date: Thu Oct 23 00:31:15 2008 New Revision: 184189 URL: http://svn.freebsd.org/changeset/base/184189 Log: Slightly adjust code logic: we allocate a "size"ed length of memory, not size+1. Use strlcpy() to avoid using - 1 as length for strncpy(). Modified: head/usr.sbin/nscd/cachelib.c Modified: head/usr.sbin/nscd/cachelib.c ============================================================================== --- head/usr.sbin/nscd/cachelib.c Thu Oct 23 00:28:21 2008 (r184188) +++ head/usr.sbin/nscd/cachelib.c Thu Oct 23 00:31:15 2008 (r184189) @@ -550,7 +550,7 @@ register_cache_entry(struct cache_ *the_ the_cache->entries = new_entries; } - entry_name_size = strlen(params->entry_name); + entry_name_size = strlen(params->entry_name) + 1; switch (params->entry_type) { case CET_COMMON: @@ -564,9 +564,9 @@ register_cache_entry(struct cache_ *the_ (struct cache_entry_params *)&new_common_entry->common_params; new_common_entry->common_params.entry_name = (char *)calloc(1, - entry_name_size+1); + entry_name_size); assert(new_common_entry->common_params.entry_name != NULL); - strncpy(new_common_entry->common_params.entry_name, + strlcpy(new_common_entry->common_params.entry_name, params->entry_name, entry_name_size); new_common_entry->name = new_common_entry->common_params.entry_name; @@ -618,9 +618,9 @@ register_cache_entry(struct cache_ *the_ (struct cache_entry_params *)&new_mp_entry->mp_params; new_mp_entry->mp_params.entry_name = (char *)calloc(1, - entry_name_size+1); + entry_name_size); assert(new_mp_entry->mp_params.entry_name != NULL); - strncpy(new_mp_entry->mp_params.entry_name, params->entry_name, + strlcpy(new_mp_entry->mp_params.entry_name, params->entry_name, entry_name_size); new_mp_entry->name = new_mp_entry->mp_params.entry_name; From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 01:27:15 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDEFE1065670; Thu, 23 Oct 2008 01:27:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBEBD8FC20; Thu, 23 Oct 2008 01:27:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9N1RFuW044149; Thu, 23 Oct 2008 01:27:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9N1RFdl044147; Thu, 23 Oct 2008 01:27:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200810230127.m9N1RFdl044147@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 23 Oct 2008 01:27: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: r184192 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 01:27:15 -0000 Author: yongari Date: Thu Oct 23 01:27:15 2008 New Revision: 184192 URL: http://svn.freebsd.org/changeset/base/184192 Log: Correct PHY description and OUI of VSC8211. Previously VSC8211 was not recognized by ciphy(4) due to the incorrect OUI. Reported by: nork Tested by: nork Modified: head/sys/dev/mii/ciphy.c head/sys/dev/mii/miidevs Modified: head/sys/dev/mii/ciphy.c ============================================================================== --- head/sys/dev/mii/ciphy.c Thu Oct 23 00:56:01 2008 (r184191) +++ head/sys/dev/mii/ciphy.c Thu Oct 23 01:27:15 2008 (r184192) @@ -92,9 +92,9 @@ static const struct mii_phydesc ciphys[] MII_PHY_DESC(CICADA, CS8201A), MII_PHY_DESC(CICADA, CS8201B), MII_PHY_DESC(CICADA, CS8204), + MII_PHY_DESC(CICADA, VSC8211), MII_PHY_DESC(CICADA, CS8244), MII_PHY_DESC(VITESSE, VSC8601), - MII_PHY_DESC(VITESSE, VSC8211), MII_PHY_END }; @@ -423,9 +423,9 @@ ciphy_fixup(struct mii_softc *sc) } break; + case MII_MODEL_CICADA_VSC8211: case MII_MODEL_CICADA_CS8244: case MII_MODEL_VITESSE_VSC8601: - case MII_MODEL_VITESSE_VSC8211: break; default: device_printf(sc->mii_dev, "unknown CICADA PHY model %x\n", Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Thu Oct 23 00:56:01 2008 (r184191) +++ head/sys/dev/mii/miidevs Thu Oct 23 01:27:15 2008 (r184192) @@ -155,11 +155,11 @@ model BROADCOM2 BCM5906 0x0004 BCM5906 /* Cicada Semiconductor PHYs (now owned by Vitesse?) */ model CICADA CS8201 0x0001 Cicada CS8201 10/100/1000TX PHY model CICADA CS8204 0x0004 Cicada CS8204 10/100/1000TX PHY +model CICADA VSC8211 0x000b Cicada VSC8211 10/100/1000TX PHY model CICADA CS8201A 0x0020 Cicada CS8201 10/100/1000TX PHY model CICADA CS8201B 0x0021 Cicada CS8201 10/100/1000TX PHY model CICADA CS8244 0x002c Cicada CS8244 10/100/1000TX PHY model VITESSE VSC8601 0x0002 Vitesse VSC8601 10/100/1000TX PHY -model VITESSE VSC8211 0x000b Vitesse VSC8211 10/100/1000TX PHY /* Davicom Semiconductor PHYs */ model DAVICOM DM9102 0x0004 DM9102 10/100 media interface From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 01:51:56 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91E2D1065683; Thu, 23 Oct 2008 01:51:56 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F1048FC19; Thu, 23 Oct 2008 01:51:56 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9N1pu6e044635; Thu, 23 Oct 2008 01:51:56 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9N1ptUe044619; Thu, 23 Oct 2008 01:51:55 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200810230151.m9N1ptUe044619@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 23 Oct 2008 01:51: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: r184193 - in head/sys: arm/conf conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 01:51:56 -0000 Author: marcel Date: Thu Oct 23 01:51:55 2008 New Revision: 184193 URL: http://svn.freebsd.org/changeset/base/184193 Log: Add arm/conf/DEFAULTS and populate it with: machine arm device mem options GEOM_BSD options GEOM_MBR Remove the first two from all kernel configuration files and change geom_bsd and geom_mbr from standard to optional. Added: head/sys/arm/conf/DEFAULTS (contents, props changed) Modified: head/sys/arm/conf/AVILA head/sys/arm/conf/BWCT head/sys/arm/conf/CRB head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/EP80219 head/sys/arm/conf/GUMSTIX head/sys/arm/conf/HL200 head/sys/arm/conf/IQ31244 head/sys/arm/conf/KB920X head/sys/arm/conf/NSLU head/sys/arm/conf/SIMICS head/sys/arm/conf/SKYEYE head/sys/conf/files.arm Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Thu Oct 23 01:27:15 2008 (r184192) +++ head/sys/arm/conf/AVILA Thu Oct 23 01:51:55 2008 (r184193) @@ -18,7 +18,6 @@ # # $FreeBSD$ -machine arm ident AVILA options PHYSADDR=0x10000000 @@ -80,7 +79,6 @@ options BOOTP_COMPAT #options PREEMPTION #options VERBOSE_SYSINIT -device mem # Memory and kernel memory devices #device saarm device pci Modified: head/sys/arm/conf/BWCT ============================================================================== --- head/sys/arm/conf/BWCT Thu Oct 23 01:27:15 2008 (r184192) +++ head/sys/arm/conf/BWCT Thu Oct 23 01:51:55 2008 (r184193) @@ -17,7 +17,6 @@ # # $FreeBSD$ -machine arm ident BWCT options VERBOSE_INIT_ARM @@ -85,7 +84,6 @@ device rlswitch #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed #options DIAGNOSTIC -device mem # Memory and kernel memory devices device md device at91_twi # TWI: Two Wire Interface device at91_spi # SPI: Modified: head/sys/arm/conf/CRB ============================================================================== --- head/sys/arm/conf/CRB Thu Oct 23 01:27:15 2008 (r184192) +++ head/sys/arm/conf/CRB Thu Oct 23 01:51:55 2008 (r184193) @@ -17,7 +17,6 @@ # # $FreeBSD$ -machine arm ident CRB options PHYSADDR=0x00000000 @@ -67,7 +66,6 @@ options BOOTP_COMPAT #options PREEMPTION device loop device ether -device mem # Memory and kernel memory devices #device saarm device miibus device rl Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Thu Oct 23 01:27:15 2008 (r184192) +++ head/sys/arm/conf/DB-78XXX Thu Oct 23 01:51:55 2008 (r184193) @@ -4,7 +4,6 @@ # $FreeBSD$ # -machine arm ident DB-88F78XX include "../mv/discovery/std.db78xxx" @@ -49,7 +48,6 @@ options WITNESS_SKIPSPIN #Don't run wit # Pseudo devices device loop -device mem device md device pty device random Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Thu Oct 23 01:27:15 2008 (r184192) +++ head/sys/arm/conf/DB-88F5XXX Thu Oct 23 01:51:55 2008 (r184193) @@ -4,7 +4,6 @@ # $FreeBSD$ # -machine arm ident DB-88F5XXX include "../mv/orion/std.db88f5xxx" @@ -48,7 +47,6 @@ options WITNESS_SKIPSPIN #Don't run wit #options WITNESS_KDB # Pseudo devices -device mem device md device loop device pty Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Thu Oct 23 01:27:15 2008 (r184192) +++ head/sys/arm/conf/DB-88F6XXX Thu Oct 23 01:51:55 2008 (r184193) @@ -4,7 +4,6 @@ # $FreeBSD$ # -machine arm ident DB-88F6XXX include "../mv/kirkwood/std.db88f6xxx" @@ -49,7 +48,6 @@ options WITNESS_SKIPSPIN #Don't run wit # Pseudo devices device loop -device mem device md device pty device random Added: head/sys/arm/conf/DEFAULTS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/DEFAULTS Thu Oct 23 01:51:55 2008 (r184193) @@ -0,0 +1,11 @@ +# +# DEFAULTS -- Default kernel configuration file for FreeBSD/arm +# +# $FreeBSD$ + +machine arm + +device mem + +options GEOM_BSD +options GEOM_MBR Modified: head/sys/arm/conf/EP80219 ============================================================================== --- head/sys/arm/conf/EP80219 Thu Oct 23 01:27:15 2008 (r184192) +++ head/sys/arm/conf/EP80219 Thu Oct 23 01:51:55 2008 (r184193) @@ -17,7 +17,6 @@ # # $FreeBSD$ -machine arm ident EP80219 options PHYSADDR=0xa0000000 @@ -69,7 +68,6 @@ options BOOTP_COMPAT #options PREEMPTION device loop device ether -device mem # Memory and kernel memory devices #device saarm device miibus device fxp Modified: head/sys/arm/conf/GUMSTIX ============================================================================== --- head/sys/arm/conf/GUMSTIX Thu Oct 23 01:27:15 2008 (r184192) +++ head/sys/arm/conf/GUMSTIX Thu Oct 23 01:51:55 2008 (r184193) @@ -18,7 +18,6 @@ # # $FreeBSD$ -machine arm ident GUMSTIX cpu CPU_XSCALE_PXA2X0 @@ -71,7 +70,6 @@ options BOOTP_BLOCKSIZE=4096 options PREEMPTION device loop device ether -device mem # Memory and kernel memory devices device mii device smc device smcphy Modified: head/sys/arm/conf/HL200 ============================================================================== --- head/sys/arm/conf/HL200 Thu Oct 23 01:27:15 2008 (r184192) +++ head/sys/arm/conf/HL200 Thu Oct 23 01:51:55 2008 (r184193) @@ -18,7 +18,6 @@ # # $FreeBSD$ -machine arm ident HL200 include "../at91/std.at91" @@ -89,7 +88,6 @@ device lxtphy #options WITNESS #Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed -device mem # Memory and kernel memory devices device md device at91_twi # TWI: Two Wire Interface device at91_spi # SPI: Modified: head/sys/arm/conf/IQ31244 ============================================================================== --- head/sys/arm/conf/IQ31244 Thu Oct 23 01:27:15 2008 (r184192) +++ head/sys/arm/conf/IQ31244 Thu Oct 23 01:51:55 2008 (r184193) @@ -17,7 +17,6 @@ # # $FreeBSD$ -machine arm ident IQ31244 options PHYSADDR=0xa0000000 @@ -66,7 +65,6 @@ options BOOTP_COMPAT #options PREEMPTION device loop device ether -device mem # Memory and kernel memory devices #device saarm device miibus device rl Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Thu Oct 23 01:27:15 2008 (r184192) +++ head/sys/arm/conf/KB920X Thu Oct 23 01:51:55 2008 (r184193) @@ -18,7 +18,6 @@ # # $FreeBSD$ -machine arm ident KB920X include "../at91/std.kb920x" @@ -80,7 +79,6 @@ device lxtphy #options WITNESS #Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed -device mem # Memory and kernel memory devices device md device at91_twi # TWI: Two Wire Interface device at91_spi # SPI: Modified: head/sys/arm/conf/NSLU ============================================================================== --- head/sys/arm/conf/NSLU Thu Oct 23 01:27:15 2008 (r184192) +++ head/sys/arm/conf/NSLU Thu Oct 23 01:51:55 2008 (r184193) @@ -17,7 +17,6 @@ # # $FreeBSD$ -machine arm ident NSLU options PHYSADDR=0x10000000 @@ -76,7 +75,6 @@ options BOOTP_NFSV3 options BOOTP_WIRED_TO=npe0 options BOOTP_COMPAT -device mem # Memory and kernel memory devices device pci device uart Modified: head/sys/arm/conf/SIMICS ============================================================================== --- head/sys/arm/conf/SIMICS Thu Oct 23 01:27:15 2008 (r184192) +++ head/sys/arm/conf/SIMICS Thu Oct 23 01:51:55 2008 (r184193) @@ -17,7 +17,6 @@ # # $FreeBSD$ -machine arm ident SIMICS options KERNPHYSADDR=0xc0000000 @@ -68,5 +67,4 @@ device uart #options WITNESS #Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed -device mem # Memory and kernel memory devices device md Modified: head/sys/arm/conf/SKYEYE ============================================================================== --- head/sys/arm/conf/SKYEYE Thu Oct 23 01:27:15 2008 (r184192) +++ head/sys/arm/conf/SKYEYE Thu Oct 23 01:51:55 2008 (r184193) @@ -18,7 +18,6 @@ # # $FreeBSD$ -machine arm ident KB920X options KERNPHYSADDR=0xc0000000 @@ -79,7 +78,6 @@ device uart #options SMP # Symmetric MultiProcessor Kernel #options APIC_IO # Symmetric (APIC) I/O -device mem # Memory and kernel memory devices device md options SKYEYE_WORKAROUNDS # Floppy drives Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Thu Oct 23 01:27:15 2008 (r184192) +++ head/sys/conf/files.arm Thu Oct 23 01:51:55 2008 (r184193) @@ -46,10 +46,10 @@ arm/arm/vm_machdep.c standard arm/fpe-arm/armfpe_glue.S optional armfpe arm/fpe-arm/armfpe_init.c optional armfpe arm/fpe-arm/armfpe.S optional armfpe -geom/geom_bsd.c standard -geom/geom_bsd_enc.c standard -geom/geom_mbr.c standard -geom/geom_mbr_enc.c standard +geom/geom_bsd.c optional geom_bsd +geom/geom_bsd_enc.c optional geom_bsd +geom/geom_mbr.c optional geom_mbr +geom/geom_mbr_enc.c optional geom_mbr hal.o optional ath_hal \ compile-with "ATH_HAL_CPU=`echo ${CONF_CFLAGS}|sed 's/.*-mcpu=\([a-zA-Z0-9]*\).*/\1/'`; ATH_ENDIAN=`if (echo ${CC}|grep mbig-endian>/dev/null); then echo be; else echo le; fi;`; uudecode < $S/contrib/dev/ath/public/$$ATH_HAL_CPU-$$ATH_ENDIAN-elf.hal.o.uu" \ no-implicit-rule From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 02:16:39 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D41D1065673; Thu, 23 Oct 2008 02:16:39 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7AE908FC20; Thu, 23 Oct 2008 02:16:39 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9N2GdPW045113; Thu, 23 Oct 2008 02:16:39 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9N2Gdxw045106; Thu, 23 Oct 2008 02:16:39 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200810230216.m9N2Gdxw045106@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 23 Oct 2008 02:16: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: r184194 - in head/sys: conf mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 02:16:39 -0000 Author: marcel Date: Thu Oct 23 02:16:38 2008 New Revision: 184194 URL: http://svn.freebsd.org/changeset/base/184194 Log: Add mips/conf/DEFAULTS and populate it with: machine arm device mem device uart_ns8250 options GEOM_BSD options GEOM_MBR Remove the first three from all kernel configuration files (sometimes commented-out) and change geom_bsd and geom_mbr from standard to optional. Added: head/sys/mips/conf/DEFAULTS (contents, props changed) Modified: head/sys/conf/files.mips head/sys/mips/conf/ADM5120 head/sys/mips/conf/IDT head/sys/mips/conf/MALTA head/sys/mips/conf/QEMU head/sys/mips/conf/SENTRY5 Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Thu Oct 23 01:51:55 2008 (r184193) +++ head/sys/conf/files.mips Thu Oct 23 02:16:38 2008 (r184194) @@ -71,10 +71,10 @@ mips/mips/stack_machdep.c optional ddb | mips/mips/support.S standard mips/mips/swtch.S standard mips/mips/uio_machdep.c standard -geom/geom_bsd.c standard -geom/geom_bsd_enc.c standard -geom/geom_mbr.c standard -geom/geom_mbr_enc.c standard +geom/geom_bsd.c optional geom_bsd +geom/geom_bsd_enc.c optional geom_bsd +geom/geom_mbr.c optional geom_mbr +geom/geom_mbr_enc.c optional geom_mbr hal.o optional ath_hal \ compile-with "ATH_HAL_CPU=mips; ATH_ENDIAN=`if ([ x${TARGET_BIG_ENDIAN} = x ]); then echo le; else echo be; fi;`; uudecode < $S/contrib/dev/ath/public/$$ATH_HAL_CPU-$$ATH_ENDIAN-elf.hal.o.uu" \ no-implicit-rule Modified: head/sys/mips/conf/ADM5120 ============================================================================== --- head/sys/mips/conf/ADM5120 Thu Oct 23 01:51:55 2008 (r184193) +++ head/sys/mips/conf/ADM5120 Thu Oct 23 02:16:38 2008 (r184194) @@ -17,7 +17,6 @@ # # $FreeBSD$ -machine mips ident ADM5120 #makeoptions ARCH_FLAGS=-march=mips32 @@ -66,5 +65,3 @@ device loop device ether device uart # device md -# device mem -# device uart_ns8250 Added: head/sys/mips/conf/DEFAULTS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/DEFAULTS Thu Oct 23 02:16:38 2008 (r184194) @@ -0,0 +1,13 @@ +# +# DEFAULTS -- Default kernel configuration file for FreeBSD/mips +# +# $FreeBSD$ + +machine mips + +device mem + +device uart_ns8250 + +options GEOM_BSD +options GEOM_MBR Modified: head/sys/mips/conf/IDT ============================================================================== --- head/sys/mips/conf/IDT Thu Oct 23 01:51:55 2008 (r184193) +++ head/sys/mips/conf/IDT Thu Oct 23 02:16:38 2008 (r184194) @@ -1,6 +1,5 @@ # $FreeBSD$ -machine mips cpu CPU_MIPS4KC ident RB532 @@ -38,7 +37,6 @@ device miibus device vr device kr device uart -device uart_ns8250 device md # Wireless NIC cards Modified: head/sys/mips/conf/MALTA ============================================================================== --- head/sys/mips/conf/MALTA Thu Oct 23 01:51:55 2008 (r184193) +++ head/sys/mips/conf/MALTA Thu Oct 23 02:16:38 2008 (r184194) @@ -17,7 +17,6 @@ # # $FreeBSD$ -machine mips ident MALTA #makeoptions ARCH_FLAGS=-march=mips32 @@ -66,6 +65,4 @@ device ether device le device miibus device md -device mem device uart -device uart_ns8250 Modified: head/sys/mips/conf/QEMU ============================================================================== --- head/sys/mips/conf/QEMU Thu Oct 23 01:51:55 2008 (r184193) +++ head/sys/mips/conf/QEMU Thu Oct 23 02:16:38 2008 (r184194) @@ -17,7 +17,6 @@ # # $FreeBSD$ -machine mips cpu CPU_MIPS32 ident QEMU @@ -53,5 +52,4 @@ options _KPOSIX_PRIORITY_SCHEDULING #Po device loop device ether -device mem device md Modified: head/sys/mips/conf/SENTRY5 ============================================================================== --- head/sys/mips/conf/SENTRY5 Thu Oct 23 01:51:55 2008 (r184193) +++ head/sys/mips/conf/SENTRY5 Thu Oct 23 02:16:38 2008 (r184194) @@ -24,7 +24,6 @@ # will be necessary to support multi-user boot. # -machine mips ident SENTRY5 cpu CPU_MIPS4KC options CPU_NOFPU @@ -91,9 +90,7 @@ device ehci # EHCI PCI->USB interface # XXX notyet; need to be auto probed children of siba_cc. #device uart -#device uart_ns8250 device loop device ether device md -device mem From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 07:20:44 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F3EA106567E; Thu, 23 Oct 2008 07:20:44 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C0F88FC1B; Thu, 23 Oct 2008 07:20:44 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9N7Ki2f050714; Thu, 23 Oct 2008 07:20:44 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9N7KhfT050706; Thu, 23 Oct 2008 07:20:43 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200810230720.m9N7KhfT050706@svn.freebsd.org> From: Kip Macy Date: Thu, 23 Oct 2008 07:20: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: r184198 - in head/sys: i386/include i386/include/xen i386/xen xen/evtchn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 07:20:44 -0000 Author: kmacy Date: Thu Oct 23 07:20:43 2008 New Revision: 184198 URL: http://svn.freebsd.org/changeset/base/184198 Log: Fix IPI support Modified: head/sys/i386/include/pcpu.h head/sys/i386/include/smp.h head/sys/i386/include/xen/xen-os.h head/sys/i386/include/xen/xen_intr.h head/sys/i386/xen/clock.c head/sys/i386/xen/exception.s head/sys/i386/xen/mp_machdep.c head/sys/xen/evtchn/evtchn.c Modified: head/sys/i386/include/pcpu.h ============================================================================== --- head/sys/i386/include/pcpu.h Thu Oct 23 04:51:14 2008 (r184197) +++ head/sys/i386/include/pcpu.h Thu Oct 23 07:20:43 2008 (r184198) @@ -45,6 +45,24 @@ */ #ifdef XEN +#ifndef NR_VIRQS +#define NR_VIRQS 24 +#endif +#ifndef NR_IPIS +#define NR_IPIS 2 +#endif + +/* These are peridically updated in shared_info, and then copied here. */ +struct shadow_time_info { + uint64_t tsc_timestamp; /* TSC at last update of time vals. */ + uint64_t system_timestamp; /* Time, in nanosecs, since boot. */ + uint32_t tsc_to_nsec_mul; + uint32_t tsc_to_usec_mul; + int tsc_shift; + uint32_t version; +}; + + #define PCPU_MD_FIELDS \ char pc_monitorbuf[128] __aligned(128); /* cache line */ \ struct pcpu *pc_prvspace; /* Self-reference */ \ @@ -62,7 +80,14 @@ u_int pc_pdir; \ u_int pc_lazypmap; \ u_int pc_rendezvous; \ - u_int pc_cpuast + u_int pc_cpuast; \ + uint64_t pc_processed_system_time; \ + struct shadow_time_info pc_shadow_time; \ + int pc_resched_irq; \ + int pc_callfunc_irq; \ + int pc_virq_to_irq[NR_VIRQS]; \ + int pc_ipi_to_irq[NR_IPIS] + #else @@ -88,7 +113,7 @@ extern struct pcpu *pcpup; #define PCPU_GET(member) (pcpup->pc_ ## member) -#define PCPU_ADD(member, val) (pcpu->pc_ ## member += (val)) +#define PCPU_ADD(member, val) (pcpup->pc_ ## member += (val)) #define PCPU_INC(member) PCPU_ADD(member, 1) #define PCPU_PTR(member) (&pcpup->pc_ ## member) #define PCPU_SET(member, val) (pcpup->pc_ ## member = (val)) Modified: head/sys/i386/include/smp.h ============================================================================== --- head/sys/i386/include/smp.h Thu Oct 23 04:51:14 2008 (r184197) +++ head/sys/i386/include/smp.h Thu Oct 23 07:20:43 2008 (r184198) @@ -86,8 +86,8 @@ int ipi_nmi_handler(void); #ifdef XEN void ipi_to_irq_init(void); -#define RESCHEDULE_VECTOR 0 -#define CALL_FUNCTION_VECTOR 1 +#define CALL_FUNCTION_VECTOR 0 +#define RESCHEDULE_VECTOR 1 #define NR_IPIS 2 #endif Modified: head/sys/i386/include/xen/xen-os.h ============================================================================== --- head/sys/i386/include/xen/xen-os.h Thu Oct 23 04:51:14 2008 (r184197) +++ head/sys/i386/include/xen/xen-os.h Thu Oct 23 07:20:43 2008 (r184198) @@ -77,10 +77,7 @@ static inline void rep_nop(void) #define __builtin_expect(x, expected_value) (x) #endif -#define DEFINE_PER_CPU(type, name) \ - __typeof__(type) per_cpu__##name - -#define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var)) +#define per_cpu(var, cpu) (pcpu_find((cpu))->pc_ ## var) /* crude memory allocator for memory allocation early in * boot Modified: head/sys/i386/include/xen/xen_intr.h ============================================================================== --- head/sys/i386/include/xen/xen_intr.h Thu Oct 23 04:51:14 2008 (r184197) +++ head/sys/i386/include/xen/xen_intr.h Thu Oct 23 07:20:43 2008 (r184198) @@ -43,7 +43,7 @@ extern int bind_virq_to_irqhandler(unsig extern int bind_ipi_to_irqhandler(unsigned int ipi, unsigned int cpu, const char *devname, - driver_intr_t handler, + driver_filter_t handler, unsigned long irqflags); extern int bind_interdomain_evtchn_to_irqhandler(unsigned int remote_domain, Modified: head/sys/i386/xen/clock.c ============================================================================== --- head/sys/i386/xen/clock.c Thu Oct 23 04:51:14 2008 (r184197) +++ head/sys/i386/xen/clock.c Thu Oct 23 07:20:43 2008 (r184198) @@ -154,19 +154,6 @@ SYSCTL_INT(_machdep, OID_AUTO, xen_disab }) -/* These are peridically updated in shared_info, and then copied here. */ -struct shadow_time_info { - uint64_t tsc_timestamp; /* TSC at last update of time vals. */ - uint64_t system_timestamp; /* Time, in nanosecs, since boot. */ - uint32_t tsc_to_nsec_mul; - uint32_t tsc_to_usec_mul; - int tsc_shift; - uint32_t version; -}; -static DEFINE_PER_CPU(uint64_t, processed_system_time); -static DEFINE_PER_CPU(struct shadow_time_info, shadow_time); - - #define NS_PER_TICK (1000000000ULL/hz) #define rdtscll(val) \ @@ -300,10 +287,11 @@ static struct timecounter xen_timecounte 0 /* quality */ }; -static void -clkintr(struct trapframe *frame) +static int +clkintr(void *arg) { int64_t delta_cpu, delta; + struct trapframe *frame = (struct trapframe *)arg; int cpu = smp_processor_id(); struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu); @@ -319,7 +307,54 @@ clkintr(struct trapframe *frame) if (unlikely(delta < (int64_t)0) || unlikely(delta_cpu < (int64_t)0)) { printf("Timer ISR: Time went backwards: %lld\n", delta); - return; + return (FILTER_HANDLED); + } + + /* Process elapsed ticks since last call. */ + if (delta >= NS_PER_TICK) { + processed_system_time += (delta / NS_PER_TICK) * NS_PER_TICK; + per_cpu(processed_system_time, cpu) += (delta_cpu / NS_PER_TICK) * NS_PER_TICK; + } + hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); + + /* + * Take synchronised time from Xen once a minute if we're not + * synchronised ourselves, and we haven't chosen to keep an independent + * time base. + */ + + if (shadow_tv_version != HYPERVISOR_shared_info->wc_version) { + update_wallclock(); + tc_setclock(&shadow_tv); + } + + /* XXX TODO */ + return (FILTER_HANDLED); +} + +int clkintr2(void *arg); + +int +clkintr2(void *arg) +{ + int64_t delta_cpu, delta; + struct trapframe *frame = (struct trapframe *)arg; + int cpu = smp_processor_id(); + struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu); + + do { + __get_time_values_from_xen(); + + delta = delta_cpu = + shadow->system_timestamp + get_nsec_offset(shadow); + delta -= processed_system_time; + delta_cpu -= per_cpu(processed_system_time, cpu); + + } while (!time_values_up_to_date(cpu)); + + if (unlikely(delta < (int64_t)0) || unlikely(delta_cpu < (int64_t)0)) { + printf("Timer ISR: Time went backwards: %lld\n", delta); + return (FILTER_HANDLED); } /* Process elapsed ticks since last call. */ @@ -341,6 +376,7 @@ clkintr(struct trapframe *frame) } /* XXX TODO */ + return (FILTER_HANDLED); } static uint32_t @@ -760,7 +796,7 @@ cpu_initclocks(void) &xen_set_periodic_tick); if ((time_irq = bind_virq_to_irqhandler(VIRQ_TIMER, 0, "clk", - (driver_filter_t *)clkintr, NULL, + clkintr, NULL, INTR_TYPE_CLK | INTR_FAST)) < 0) { panic("failed to register clock interrupt\n"); } @@ -780,7 +816,7 @@ ap_cpu_initclocks(int cpu) &xen_set_periodic_tick); if ((time_irq = bind_virq_to_irqhandler(VIRQ_TIMER, cpu, "clk", - (driver_filter_t *)clkintr, NULL, + clkintr2, NULL, INTR_TYPE_CLK | INTR_FAST)) < 0) { panic("failed to register clock interrupt\n"); } Modified: head/sys/i386/xen/exception.s ============================================================================== --- head/sys/i386/xen/exception.s Thu Oct 23 04:51:14 2008 (r184197) +++ head/sys/i386/xen/exception.s Thu Oct 23 07:20:43 2008 (r184198) @@ -51,13 +51,10 @@ #ifdef SMP -#ifdef notyet -#define GET_VCPU_INFO movl TI_cpu(%ebp),reg ; \ +#define GET_VCPU_INFO(reg) movl PCPU(CPUID),reg ; \ shl $sizeof_vcpu_shift,reg ; \ addl HYPERVISOR_shared_info,reg #else -#endif - #define GET_VCPU_INFO(reg) movl HYPERVISOR_shared_info,reg #endif Modified: head/sys/i386/xen/mp_machdep.c ============================================================================== --- head/sys/i386/xen/mp_machdep.c Thu Oct 23 04:51:14 2008 (r184197) +++ head/sys/i386/xen/mp_machdep.c Thu Oct 23 07:20:43 2008 (r184198) @@ -101,8 +101,6 @@ extern struct pcpu __pcpu[]; static int bootAP; static union descriptor *bootAPgdt; -static DEFINE_PER_CPU(int, resched_irq); -static DEFINE_PER_CPU(int, callfunc_irq); static char resched_name[NR_CPUS][15]; static char callfunc_name[NR_CPUS][15]; @@ -311,12 +309,14 @@ static void iv_invltlb(uintptr_t a, uintptr_t b) { xen_tlb_flush(); + atomic_add_int(&smp_tlb_wait, 1); } static void iv_invlpg(uintptr_t a, uintptr_t b) { xen_invlpg(a); + atomic_add_int(&smp_tlb_wait, 1); } static void @@ -329,6 +329,7 @@ iv_invlrng(uintptr_t a, uintptr_t b) xen_invlpg(start); start += PAGE_SIZE; } + atomic_add_int(&smp_tlb_wait, 1); } @@ -337,6 +338,7 @@ iv_invlcache(uintptr_t a, uintptr_t b) { wbinvd(); + atomic_add_int(&smp_tlb_wait, 1); } static void @@ -349,7 +351,24 @@ static void iv_bitmap_vector(uintptr_t a, uintptr_t b) { - + int cpu = PCPU_GET(cpuid); + u_int ipi_bitmap; + + ipi_bitmap = atomic_readandclear_int(&cpu_ipi_pending[cpu]); + + if (ipi_bitmap & (1 << IPI_PREEMPT)) { +#ifdef COUNT_IPIS + (*ipi_preempt_counts[cpu])++; +#endif + sched_preempt(curthread); + } + + if (ipi_bitmap & (1 << IPI_AST)) { +#ifdef COUNT_IPIS + (*ipi_ast_counts[cpu])++; +#endif + /* Nothing to do for AST */ + } } @@ -368,9 +387,10 @@ static call_data_func_t *ipi_vectors[IPI * all the work is done automatically when * we return from the interrupt. */ -static void +static int smp_reschedule_interrupt(void *unused) { + return (FILTER_HANDLED); } struct _call_data { @@ -384,7 +404,7 @@ struct _call_data { static struct _call_data *call_data; -static void +static int smp_call_function_interrupt(void *unused) { call_data_func_t *func = call_data->func; @@ -407,6 +427,7 @@ smp_call_function_interrupt(void *unused mb(); atomic_inc(&call_data->finished); } + return (FILTER_HANDLED); } /* @@ -432,7 +453,6 @@ cpu_mp_announce(void) } } - static int xen_smp_intr_init(unsigned int cpu) { @@ -445,8 +465,11 @@ xen_smp_intr_init(unsigned int cpu) cpu, resched_name[cpu], smp_reschedule_interrupt, - INTR_FAST); + INTR_FAST|INTR_TYPE_TTY|INTR_MPSAFE); + printf("cpu=%d irq=%d vector=%d\n", + cpu, rc, RESCHEDULE_VECTOR); + per_cpu(resched_irq, cpu) = rc; sprintf(callfunc_name[cpu], "callfunc%u", cpu); @@ -454,11 +477,15 @@ xen_smp_intr_init(unsigned int cpu) cpu, callfunc_name[cpu], smp_call_function_interrupt, - INTR_FAST); + INTR_FAST|INTR_TYPE_TTY|INTR_MPSAFE); if (rc < 0) goto fail; per_cpu(callfunc_irq, cpu) = rc; + printf("cpu=%d irq=%d vector=%d\n", + cpu, rc, CALL_FUNCTION_VECTOR); + + if ((cpu != 0) && ((rc = ap_cpu_initclocks(cpu)) != 0)) goto fail; @@ -472,6 +499,15 @@ xen_smp_intr_init(unsigned int cpu) return rc; } +static void +xen_smp_intr_init_cpus(void *unused) +{ + int i; + + for (i = 0; i < mp_ncpus; i++) + xen_smp_intr_init(i); +} + #define MTOPSIZE (1<<(14 + PAGE_SHIFT)) /* @@ -581,7 +617,6 @@ init_secondary(void) smp_active = 1; /* historic */ } - xen_smp_intr_init(bootAP); mtx_unlock_spin(&ap_boot_mtx); /* wait until all the AP's are up */ @@ -689,7 +724,6 @@ start_all_aps(void) /* set up temporary P==V mapping for AP boot */ /* XXX this is a hack, we should boot the AP on its own stack/PTD */ - xen_smp_intr_init(0); /* start each AP */ for (cpu = 1; cpu < mp_ncpus; cpu++) { apic_id = cpu_apic_ids[cpu]; @@ -923,14 +957,16 @@ static void smp_tlb_shootdown(u_int vector, vm_offset_t addr1, vm_offset_t addr2) { u_int ncpu; + struct _call_data data; + call_data = &data; + ncpu = mp_ncpus - 1; /* does not shootdown self */ if (ncpu < 1) return; /* no other cpus */ if (!(read_eflags() & PSL_I)) panic("%s: interrupts disabled", __func__); mtx_lock_spin(&smp_ipi_mtx); - call_data->func = ipi_vectors[vector]; call_data->arg1 = addr1; call_data->arg2 = addr2; atomic_store_rel_int(&smp_tlb_wait, 0); @@ -1052,7 +1088,10 @@ ipi_selected(u_int32_t cpus, u_int ipi) u_int bitmap = 0; u_int old_pending; u_int new_pending; + struct _call_data data; + call_data = &data; + if (IPI_IS_BITMAPED(ipi)) { bitmap = 1 << ipi; ipi = IPI_BITMAP_VECTOR; @@ -1082,7 +1121,7 @@ ipi_selected(u_int32_t cpus, u_int ipi) continue; } call_data->func = ipi_vectors[ipi]; - ipi_pcpu(cpu, ipi); + ipi_pcpu(cpu, CALL_FUNCTION_VECTOR); } } @@ -1098,7 +1137,7 @@ ipi_all_but_self(u_int ipi) return; } CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); - ipi_selected(((int)-1 & ~(1 << curcpu)), ipi); + ipi_selected((all_cpus & ~(1 << curcpu)), ipi); } #ifdef STOP_NMI @@ -1194,4 +1233,5 @@ release_aps(void *dummy __unused) ia32_pause(); } SYSINIT(start_aps, SI_SUB_SMP, SI_ORDER_FIRST, release_aps, NULL); +SYSINIT(start_ipis, SI_SUB_INTR, SI_ORDER_ANY, xen_smp_intr_init_cpus, NULL); Modified: head/sys/xen/evtchn/evtchn.c ============================================================================== --- head/sys/xen/evtchn/evtchn.c Thu Oct 23 04:51:14 2008 (r184197) +++ head/sys/xen/evtchn/evtchn.c Thu Oct 23 07:20:43 2008 (r184198) @@ -18,6 +18,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -26,6 +27,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include @@ -113,13 +115,14 @@ enum { #define type_from_irq(irq) ((uint8_t)(irq_info[irq] >> 24)) /* IRQ <-> VIRQ mapping. */ -DEFINE_PER_CPU(int, virq_to_irq[NR_VIRQS]) = {[0 ... NR_VIRQS-1] = -1}; /* IRQ <-> IPI mapping. */ -#ifndef NR_IPIS +#ifndef NR_IPIS +#ifdef SMP +#error "NR_IPIS not defined" +#endif #define NR_IPIS 1 #endif -DEFINE_PER_CPU(int, ipi_to_irq[NR_IPIS]) = {[0 ... NR_IPIS-1] = -1}; /* Bitmap indicating which PIRQs require Xen to be notified on unmask. */ static unsigned long pirq_needs_unmask_notify[NR_PIRQS/sizeof(unsigned long)]; @@ -222,8 +225,11 @@ evtchn_do_upcall(struct trapframe *frame void ipi_pcpu(unsigned int cpu, int vector) { - int irq = per_cpu(ipi_to_irq, cpu)[vector]; + int irq; + irq = per_cpu(ipi_to_irq, cpu)[vector]; + irq = (pcpu_find((cpu))->pc_ipi_to_irq)[vector]; + notify_remote_via_irq(irq); } @@ -331,6 +337,9 @@ bind_virq_to_irq(unsigned int virq, unsi mtx_lock_spin(&irq_mapping_update_lock); if ((irq = per_cpu(virq_to_irq, cpu)[virq]) == -1) { + if ((irq = find_unbound_irq()) < 0) + goto out; + bind_virq.virq = virq; bind_virq.vcpu = cpu; PANIC_IF(HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq, @@ -338,7 +347,6 @@ bind_virq_to_irq(unsigned int virq, unsi evtchn = bind_virq.port; - irq = find_unbound_irq(); evtchn_to_irq[evtchn] = irq; irq_info[irq] = mk_irq_info(IRQT_VIRQ, virq, evtchn); @@ -348,7 +356,7 @@ bind_virq_to_irq(unsigned int virq, unsi } irq_bindcount[irq]++; - +out: mtx_unlock_spin(&irq_mapping_update_lock); return irq; @@ -370,7 +378,6 @@ bind_ipi_to_irq(unsigned int ipi, unsign PANIC_IF(HYPERVISOR_event_channel_op(EVTCHNOP_bind_ipi, &bind_ipi) != 0); evtchn = bind_ipi.port; - irq = find_unbound_irq(); evtchn_to_irq[evtchn] = irq; irq_info[irq] = mk_irq_info(IRQT_IPI, ipi, evtchn); @@ -378,7 +385,6 @@ bind_ipi_to_irq(unsigned int ipi, unsign bind_evtchn_to_cpu(evtchn, cpu); } - irq_bindcount[irq]++; out: @@ -515,15 +521,15 @@ int bind_ipi_to_irqhandler(unsigned int ipi, unsigned int cpu, const char *devname, - driver_intr_t handler, + driver_filter_t filter, unsigned long irqflags) { - unsigned int irq; - int retval; - + int irq, retval; + irq = bind_ipi_to_irq(ipi, cpu); intr_register_source(&xp->xp_pins[irq].xp_intsrc); - retval = intr_add_handler(devname, irq, NULL, handler, NULL, irqflags, NULL); + retval = intr_add_handler(devname, irq, filter, NULL, + NULL, irqflags, NULL); if (retval != 0) { unbind_from_irq(irq); return -retval; @@ -760,6 +766,8 @@ notify_remote_via_irq(int irq) if (VALID_EVTCHN(evtchn)) notify_remote_via_evtchn(evtchn); + else + panic("invalid evtchn"); } /* required for support of physical devices */ @@ -810,6 +818,9 @@ xenpic_pirq_enable_intr(struct intsrc *i bind_pirq.flags = probing_irq(irq) ? 0 : BIND_PIRQ__WILL_SHARE; if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_pirq, &bind_pirq) != 0) { +#ifndef XEN_PRIVILEGED_GUEST + panic("unexpected pirq call"); +#endif if (!probing_irq(irq)) /* Some failures are expected when probing. */ printf("Failed to obtain physical IRQ %d\n", irq); mtx_unlock_spin(&irq_mapping_update_lock); @@ -1037,7 +1048,7 @@ evtchn_init(void *dummy __unused) struct xenpic_intsrc *pin, *tpin; /* No VIRQ or IPI bindings. */ - for (cpu = 0; cpu < NR_CPUS; cpu++) { + for (cpu = 0; cpu < mp_ncpus; cpu++) { for (i = 0; i < NR_VIRQS; i++) per_cpu(virq_to_irq, cpu)[i] = -1; for (i = 0; i < NR_IPIS; i++) @@ -1104,7 +1115,7 @@ evtchn_init(void *dummy __unused) } } -SYSINIT(evtchn_init, SI_SUB_INTR, SI_ORDER_ANY, evtchn_init, NULL); +SYSINIT(evtchn_init, SI_SUB_INTR, SI_ORDER_MIDDLE, evtchn_init, NULL); /* * irq_mapping_update_lock: in order to allow an interrupt to occur in a critical * section, to set pcpu->ipending (etc...) properly, we From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 07:55:39 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09218106566C; Thu, 23 Oct 2008 07:55:39 +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 EAFEF8FC08; Thu, 23 Oct 2008 07:55:38 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9N7tcY4051319; Thu, 23 Oct 2008 07:55:38 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9N7tceu051313; Thu, 23 Oct 2008 07:55:38 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <200810230755.m9N7tceu051313@svn.freebsd.org> From: David Xu Date: Thu, 23 Oct 2008 07:55: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: r184199 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 07:55:39 -0000 Author: davidxu Date: Thu Oct 23 07:55:38 2008 New Revision: 184199 URL: http://svn.freebsd.org/changeset/base/184199 Log: Actually, for signal and thread suspension, extra process spin lock is unnecessary, the normal process lock and thread lock are enough. The spin lock is still needed for process and thread exiting to mimic single sched_lock. Modified: head/sys/kern/kern_sig.c head/sys/kern/kern_thr.c head/sys/kern/kern_thread.c head/sys/kern/subr_sleepqueue.c head/sys/kern/sys_process.c head/sys/sys/proc.h Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Thu Oct 23 07:20:43 2008 (r184198) +++ head/sys/kern/kern_sig.c Thu Oct 23 07:55:38 2008 (r184199) @@ -2115,19 +2115,15 @@ tdsignal(struct proc *p, struct thread * * Otherwise, process goes back to sleep state. */ p->p_flag &= ~P_STOPPED_SIG; - PROC_SLOCK(p); if (p->p_numthreads == p->p_suspcount) { - PROC_SUNLOCK(p); p->p_flag |= P_CONTINUED; p->p_xstat = SIGCONT; PROC_LOCK(p->p_pptr); childproc_continued(p); PROC_UNLOCK(p->p_pptr); - PROC_SLOCK(p); } if (action == SIG_DFL) { thread_unsuspend(p); - PROC_SUNLOCK(p); sigqueue_delete(sigqueue, sig); goto out; } @@ -2136,14 +2132,12 @@ tdsignal(struct proc *p, struct thread * * The process wants to catch it so it needs * to run at least one thread, but which one? */ - PROC_SUNLOCK(p); goto runfast; } /* * The signal is not ignored or caught. */ thread_unsuspend(p); - PROC_SUNLOCK(p); goto out; } @@ -2167,12 +2161,10 @@ tdsignal(struct proc *p, struct thread * * It may run a bit until it hits a thread_suspend_check(). */ wakeup_swapper = 0; - PROC_SLOCK(p); thread_lock(td); if (TD_ON_SLEEPQ(td) && (td->td_flags & TDF_SINTR)) wakeup_swapper = sleepq_abort(td, intrval); thread_unlock(td); - PROC_SUNLOCK(p); if (wakeup_swapper) kick_proc0(); goto out; @@ -2193,7 +2185,6 @@ tdsignal(struct proc *p, struct thread * goto out; p->p_flag |= P_STOPPED_SIG; p->p_xstat = sig; - PROC_SLOCK(p); sig_suspend_threads(td, p, 1); if (p->p_numthreads == p->p_suspcount) { /* @@ -2204,10 +2195,8 @@ tdsignal(struct proc *p, struct thread * * should never be equal to p_suspcount. */ thread_stopped(p); - PROC_SUNLOCK(p); sigqueue_delete_proc(p, p->p_xstat); - } else - PROC_SUNLOCK(p); + } goto out; } } else { @@ -2222,12 +2211,8 @@ tdsignal(struct proc *p, struct thread * */ runfast: tdsigwakeup(td, sig, action, intrval); - PROC_SLOCK(p); thread_unsuspend(p); - PROC_SUNLOCK(p); out: - /* If we jump here, proc slock should not be owned. */ - PROC_SLOCK_ASSERT(p, MA_NOTOWNED); return (ret); } @@ -2247,7 +2232,6 @@ tdsigwakeup(struct thread *td, int sig, PROC_LOCK_ASSERT(p, MA_OWNED); prop = sigprop(sig); - PROC_SLOCK(p); thread_lock(td); /* * Bring the priority of a thread up if we want it to get @@ -2271,7 +2255,6 @@ tdsigwakeup(struct thread *td, int sig, */ if ((prop & SA_CONT) && action == SIG_DFL) { thread_unlock(td); - PROC_SUNLOCK(p); sigqueue_delete(&p->p_sigqueue, sig); /* * It may be on either list in this state. @@ -2300,7 +2283,6 @@ tdsigwakeup(struct thread *td, int sig, #endif } out: - PROC_SUNLOCK(p); thread_unlock(td); if (wakeup_swapper) kick_proc0(); @@ -2312,7 +2294,6 @@ sig_suspend_threads(struct thread *td, s struct thread *td2; PROC_LOCK_ASSERT(p, MA_OWNED); - PROC_SLOCK_ASSERT(p, MA_OWNED); FOREACH_THREAD_IN_PROC(p, td2) { thread_lock(td2); @@ -2344,11 +2325,9 @@ ptracestop(struct thread *td, int sig) td->td_dbgflags |= TDB_XSIG; td->td_xsig = sig; - PROC_SLOCK(p); while ((p->p_flag & P_TRACED) && (td->td_dbgflags & TDB_XSIG)) { if (p->p_flag & P_SINGLE_EXIT) { td->td_dbgflags &= ~TDB_XSIG; - PROC_SUNLOCK(p); return (sig); } /* @@ -2370,7 +2349,6 @@ stopme: goto stopme; } } - PROC_SUNLOCK(p); return (td->td_xsig); } @@ -2511,10 +2489,8 @@ issignal(td) &p->p_mtx.lock_object, "Catching SIGSTOP"); p->p_flag |= P_STOPPED_SIG; p->p_xstat = sig; - PROC_SLOCK(p); sig_suspend_threads(td, p, 0); thread_suspend_switch(td); - PROC_SUNLOCK(p); mtx_lock(&ps->ps_mtx); break; } else if (prop & SA_IGNORE) { @@ -2556,18 +2532,15 @@ thread_stopped(struct proc *p) int n; PROC_LOCK_ASSERT(p, MA_OWNED); - PROC_SLOCK_ASSERT(p, MA_OWNED); n = p->p_suspcount; if (p == curproc) n++; if ((p->p_flag & P_STOPPED_SIG) && (n == p->p_numthreads)) { - PROC_SUNLOCK(p); p->p_flag &= ~P_WAITED; PROC_LOCK(p->p_pptr); childproc_stopped(p, (p->p_flag & P_TRACED) ? CLD_TRAPPED : CLD_STOPPED); PROC_UNLOCK(p->p_pptr); - PROC_SLOCK(p); } } Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Thu Oct 23 07:20:43 2008 (r184198) +++ head/sys/kern/kern_thr.c Thu Oct 23 07:55:38 2008 (r184199) @@ -283,7 +283,6 @@ thr_exit(struct thread *td, struct thr_e PROC_LOCK(p); sigqueue_flush(&td->td_sigqueue); - PROC_SLOCK(p); /* * Shutting down last thread in the proc. This will actually @@ -291,10 +290,10 @@ thr_exit(struct thread *td, struct thr_e */ if (p->p_numthreads != 1) { thread_stopped(p); + PROC_SLOCK(p); thread_exit(); /* NOTREACHED */ } - PROC_SUNLOCK(p); PROC_UNLOCK(p); return (0); } Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Thu Oct 23 07:20:43 2008 (r184198) +++ head/sys/kern/kern_thread.c Thu Oct 23 07:55:38 2008 (r184199) @@ -543,7 +543,6 @@ thread_single(int mode) p->p_flag &= ~P_SINGLE_BOUNDARY; } p->p_flag |= P_STOPPED_SINGLE; - PROC_SLOCK(p); p->p_singlethread = td; if (mode == SINGLE_EXIT) remaining = p->p_numthreads; @@ -642,7 +641,6 @@ stopme: p->p_flag &= ~(P_STOPPED_SINGLE | P_SINGLE_EXIT); thread_unthread(td); } - PROC_SUNLOCK(p); return (0); } @@ -716,15 +714,16 @@ thread_suspend_check(int return_instead) if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) sigqueue_flush(&td->td_sigqueue); - PROC_SLOCK(p); thread_stopped(p); /* * If the process is waiting for us to exit, * this thread should just suicide. * Assumes that P_SINGLE_EXIT implies P_STOPPED_SINGLE. */ - if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) + if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) { + PROC_SLOCK(p); thread_exit(); + } if (P_SHOULDSTOP(p) == P_STOPPED_SINGLE) { if (p->p_numthreads == p->p_suspcount + 1) { thread_lock(p->p_singlethread); @@ -735,8 +734,8 @@ thread_suspend_check(int return_instead) kick_proc0(); } } - PROC_UNLOCK(p); thread_lock(td); + PROC_UNLOCK(p); /* * When a thread suspends, it just * gets taken off all queues. @@ -746,7 +745,6 @@ thread_suspend_check(int return_instead) p->p_boundary_count++; td->td_flags |= TDF_BOUNDARY; } - PROC_SUNLOCK(p); mi_switch(SW_INVOL | SWT_SUSPEND, NULL); if (return_instead == 0) td->td_flags &= ~TDF_BOUNDARY; @@ -766,25 +764,22 @@ thread_suspend_switch(struct thread *td) p = td->td_proc; KASSERT(!TD_IS_SUSPENDED(td), ("already suspended")); PROC_LOCK_ASSERT(p, MA_OWNED); - PROC_SLOCK_ASSERT(p, MA_OWNED); /* * We implement thread_suspend_one in stages here to avoid * dropping the proc lock while the thread lock is owned. */ thread_stopped(p); p->p_suspcount++; - PROC_UNLOCK(p); thread_lock(td); + PROC_UNLOCK(p); td->td_flags &= ~TDF_NEEDSUSPCHK; TD_SET_SUSPENDED(td); sched_sleep(td, 0); - PROC_SUNLOCK(p); DROP_GIANT(); mi_switch(SW_VOL | SWT_SUSPEND, NULL); thread_unlock(td); PICKUP_GIANT(); PROC_LOCK(p); - PROC_SLOCK(p); } void @@ -792,7 +787,6 @@ thread_suspend_one(struct thread *td) { struct proc *p = td->td_proc; - PROC_SLOCK_ASSERT(p, MA_OWNED); THREAD_LOCK_ASSERT(td, MA_OWNED); KASSERT(!TD_IS_SUSPENDED(td), ("already suspended")); p->p_suspcount++; @@ -806,7 +800,6 @@ thread_unsuspend_one(struct thread *td) { struct proc *p = td->td_proc; - PROC_SLOCK_ASSERT(p, MA_OWNED); THREAD_LOCK_ASSERT(td, MA_OWNED); KASSERT(TD_IS_SUSPENDED(td), ("Thread not suspended")); TD_CLR_SUSPENDED(td); @@ -824,7 +817,6 @@ thread_unsuspend(struct proc *p) int wakeup_swapper; PROC_LOCK_ASSERT(p, MA_OWNED); - PROC_SLOCK_ASSERT(p, MA_OWNED); wakeup_swapper = 0; if (!P_SHOULDSTOP(p)) { FOREACH_THREAD_IN_PROC(p, td) { @@ -863,7 +855,6 @@ thread_single_end(void) p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); p->p_flag &= ~(P_STOPPED_SINGLE | P_SINGLE_EXIT | P_SINGLE_BOUNDARY); - PROC_SLOCK(p); p->p_singlethread = NULL; wakeup_swapper = 0; /* @@ -881,7 +872,6 @@ thread_single_end(void) thread_unlock(td); } } - PROC_SUNLOCK(p); if (wakeup_swapper) kick_proc0(); } Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Thu Oct 23 07:20:43 2008 (r184198) +++ head/sys/kern/subr_sleepqueue.c Thu Oct 23 07:55:38 2008 (r184199) @@ -395,6 +395,8 @@ sleepq_catch_signals(void *wchan, int pr sleepq_switch(wchan, pri); return (0); } + +catch_sig: thread_unlock(td); mtx_unlock_spin(&sc->sc_lock); CTR3(KTR_PROC, "sleepq catching signals: thread %p (pid %ld, %s)", @@ -414,20 +416,19 @@ sleepq_catch_signals(void *wchan, int pr ret = ERESTART; mtx_unlock(&ps->ps_mtx); } - /* - * Lock the per-process spinlock prior to dropping the PROC_LOCK - * to avoid a signal delivery race. PROC_LOCK, PROC_SLOCK, and - * thread_lock() are currently held in tdsignal(). - */ - PROC_SLOCK(p); - mtx_lock_spin(&sc->sc_lock); PROC_UNLOCK(p); + + mtx_lock_spin(&sc->sc_lock); thread_lock(td); - PROC_SUNLOCK(p); - if (ret == 0) { - sleepq_switch(wchan, pri); - return (0); - } + if (ret != 0) + goto out; + if ((td->td_flags & (TDF_NEEDSIGCHK | TDF_NEEDSUSPCHK)) != 0) + goto catch_sig; + + sleepq_switch(wchan, pri); + return (0); + +out: /* * There were pending signals and this thread is still * on the sleep queue, remove it from the sleep queue. Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Thu Oct 23 07:20:43 2008 (r184198) +++ head/sys/kern/sys_process.c Thu Oct 23 07:55:38 2008 (r184199) @@ -795,10 +795,8 @@ kern_ptrace(struct thread *td, int req, * you should use PT_SUSPEND to suspend it before * continuing process. */ - PROC_SLOCK(p); p->p_flag &= ~(P_STOPPED_TRACE|P_STOPPED_SIG|P_WAITED); thread_unsuspend(p); - PROC_SUNLOCK(p); } else { if (data) psignal(p, data); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Oct 23 07:20:43 2008 (r184198) +++ head/sys/sys/proc.h Thu Oct 23 07:55:38 2008 (r184199) @@ -500,8 +500,8 @@ struct proc { u_char p_pfsflags; /* (c) Procfs flags. */ struct nlminfo *p_nlminfo; /* (?) Only used by/for lockd. */ struct kaioinfo *p_aioinfo; /* (c) ASYNC I/O info. */ - struct thread *p_singlethread;/* (c + j) If single threading this is it */ - int p_suspcount; /* (j) Num threads in suspended mode. */ + struct thread *p_singlethread;/* (c) If single threading this is it */ + int p_suspcount; /* (c) Num threads in suspended mode. */ struct thread *p_xthread; /* (c) Trap thread */ int p_boundary_count;/* (c) Num threads at user boundary */ int p_pendingcnt; /* how many signals are pending */ From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 10:38:04 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 700EC1065672; Thu, 23 Oct 2008 10:38:04 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EC8D8FC14; Thu, 23 Oct 2008 10:38:04 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9NAc42M054114; Thu, 23 Oct 2008 10:38:04 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9NAc4G7054113; Thu, 23 Oct 2008 10:38:04 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <200810231038.m9NAc4G7054113@svn.freebsd.org> From: Dmitry Morozovsky Date: Thu, 23 Oct 2008 10:38:04 +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: r184200 - head/release/doc/en_US.ISO8859-1/hardware X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 10:38:04 -0000 Author: marck (doc committer) Date: Thu Oct 23 10:38:04 2008 New Revision: 184200 URL: http://svn.freebsd.org/changeset/base/184200 Log: Correct a typo in Nocona core name. MFC after: 3 days (modulo RE approval) Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.sgml Thu Oct 23 07:55:38 2008 (r184199) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Thu Oct 23 10:38:04 2008 (r184200) @@ -90,7 +90,7 @@ - &intel; 64-bit &xeon; (Nacona). This + &intel; 64-bit &xeon; (Nocona). This processor is fabricated on 90nm process technology, and operates with 2.80 to 3.60 GHz (FSB 800MHz) and &intel; E7520/E7525/E7320 chipsets. From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 11:57:58 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19D63106566B; Thu, 23 Oct 2008 11:57:58 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id C808C8FC1D; Thu, 23 Oct 2008 11:57:57 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id A22606D449; Thu, 23 Oct 2008 11:57:56 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 82B23844A6; Thu, 23 Oct 2008 13:57:56 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "Attilio Rao" References: <200810210431.m9L4V7Pb088978@svn.freebsd.org> <3bbf2fe10810210307t664cc8a2s62606f03427286f3@mail.gmail.com> <200810211605.46927.jkim@FreeBSD.org> <3bbf2fe10810220853r34256b59y1fe57f49eca2014@mail.gmail.com> Date: Thu, 23 Oct 2008 13:57:56 +0200 In-Reply-To: <3bbf2fe10810220853r34256b59y1fe57f49eca2014@mail.gmail.com> (Attilio Rao's message of "Wed, 22 Oct 2008 17:53:50 +0200") Message-ID: <86bpxb34mz.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jung-uk Kim Subject: Re: svn commit: r184108 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 11:57:58 -0000 "Attilio Rao" writes: > I think it is silly we have different quirks flag states for TSC. We > should just having a table assuming that the TSC is safe to use in SMP > environments and gets rid of any other flag (in this case, for amd64 > based machine, the logic could, for example, check if the CPU is P > state invariant and assume it is safe, etc.) No, these are two entirely different things. An SMP-safe TSC is a TSC that is synchronized across cores / packages. A P-state invariant TSC is a TSC that does not vary with the CPU frequency. One does not imply the other, and in many cases (if not most), there is no way to detect programmatically that the TSC is SMP-safe or P-state invariant or both. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 15:32:06 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A08321065670; Thu, 23 Oct 2008 15:32:06 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F5948FC0A; Thu, 23 Oct 2008 15:32:06 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9NFW6uh060159; Thu, 23 Oct 2008 15:32:06 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9NFW6N4060158; Thu, 23 Oct 2008 15:32:06 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200810231532.m9NFW6N4060158@svn.freebsd.org> From: Roman Divacky Date: Thu, 23 Oct 2008 15:32: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: r184203 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 15:32:06 -0000 Author: rdivacky Date: Thu Oct 23 15:32:06 2008 New Revision: 184203 URL: http://svn.freebsd.org/changeset/base/184203 Log: Fix a typo. Approved by: kib (mentor) Modified: head/lib/libc/gen/posix_spawn.c Modified: head/lib/libc/gen/posix_spawn.c ============================================================================== --- head/lib/libc/gen/posix_spawn.c Thu Oct 23 13:24:58 2008 (r184202) +++ head/lib/libc/gen/posix_spawn.c Thu Oct 23 15:32:06 2008 (r184203) @@ -444,7 +444,7 @@ posix_spawnattr_setpgroup(posix_spawnatt } int -posix_spawnattr_setschedparam(posix_spawnattr_t *sa __restrict, +posix_spawnattr_setschedparam(posix_spawnattr_t * __restrict sa, const struct sched_param * __restrict schedparam) { (*sa)->sa_schedparam = *schedparam; From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 15:53:52 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E92BC1065675; Thu, 23 Oct 2008 15:53:52 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D36528FC20; Thu, 23 Oct 2008 15:53:52 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9NFrqgg060616; Thu, 23 Oct 2008 15:53:52 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9NFrqQj060598; Thu, 23 Oct 2008 15:53:52 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810231553.m9NFrqQj060598@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 23 Oct 2008 15:53: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: r184205 - in head: . share/man/man9 sys/arm/arm sys/cam/scsi sys/compat/linux sys/contrib/altq/altq sys/contrib/ipfilter/netinet sys/dev/ar sys/dev/ce sys/dev/hwpmc sys/dev/lmc sys/dev/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 15:53:53 -0000 Author: des Date: Thu Oct 23 15:53:51 2008 New Revision: 184205 URL: http://svn.freebsd.org/changeset/base/184205 Log: Retire the MALLOC and FREE macros. They are an abomination unto style(9). MFC after: 3 months Modified: head/Makefile.inc1 head/share/man/man9/Makefile head/share/man/man9/malloc.9 head/sys/arm/arm/undefined.c head/sys/cam/scsi/scsi_target.c head/sys/compat/linux/linux_ioctl.c head/sys/compat/linux/linux_socket.c head/sys/compat/linux/linux_util.c head/sys/contrib/altq/altq/altq_cbq.c head/sys/contrib/altq/altq/altq_cdnr.c head/sys/contrib/altq/altq/altq_hfsc.c head/sys/contrib/altq/altq/altq_priq.c head/sys/contrib/altq/altq/altq_red.c head/sys/contrib/altq/altq/altq_rio.c head/sys/contrib/altq/altq/altq_rmclass.c head/sys/contrib/altq/altq/altq_subr.c head/sys/contrib/ipfilter/netinet/ip_compat.h head/sys/dev/ar/if_ar.c head/sys/dev/ce/if_ce.c head/sys/dev/hwpmc/hwpmc_amd.c head/sys/dev/hwpmc/hwpmc_logging.c head/sys/dev/hwpmc/hwpmc_mod.c head/sys/dev/hwpmc/hwpmc_piv.c head/sys/dev/hwpmc/hwpmc_ppro.c head/sys/dev/hwpmc/hwpmc_x86.c head/sys/dev/lmc/if_lmc.c head/sys/dev/ray/if_ray.c head/sys/dev/ray/if_rayvar.h head/sys/dev/sr/if_sr.c head/sys/dev/usb/udbp.c head/sys/fs/cd9660/cd9660_node.c head/sys/fs/cd9660/cd9660_vfsops.c head/sys/fs/cd9660/cd9660_vnops.c head/sys/fs/fdescfs/fdesc_vfsops.c head/sys/fs/fdescfs/fdesc_vnops.c head/sys/fs/fifofs/fifo_vnops.c head/sys/fs/hpfs/hpfs_subr.c head/sys/fs/hpfs/hpfs_vfsops.c head/sys/fs/hpfs/hpfs_vnops.c head/sys/fs/msdosfs/msdosfs_denode.c head/sys/fs/msdosfs/msdosfs_vnops.c head/sys/fs/ntfs/ntfs_subr.c head/sys/fs/ntfs/ntfs_vfsops.c head/sys/fs/ntfs/ntfs_vnops.c head/sys/fs/nullfs/null_subr.c head/sys/fs/nullfs/null_vnops.c head/sys/fs/nwfs/nwfs_node.c head/sys/fs/nwfs/nwfs_vfsops.c head/sys/fs/portalfs/portal_vfsops.c head/sys/fs/portalfs/portal_vnops.c head/sys/fs/pseudofs/pseudofs.c head/sys/fs/pseudofs/pseudofs_vncache.c head/sys/fs/smbfs/smbfs_node.c head/sys/fs/smbfs/smbfs_vfsops.c head/sys/fs/udf/udf_vfsops.c head/sys/fs/udf/udf_vnops.c head/sys/fs/unionfs/union_subr.c head/sys/gnu/fs/ext2fs/ext2_inode.c head/sys/gnu/fs/ext2fs/ext2_lookup.c head/sys/gnu/fs/ext2fs/ext2_vfsops.c head/sys/gnu/fs/reiserfs/reiserfs_inode.c head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c head/sys/i386/i386/sys_machdep.c head/sys/ia64/ia64/sscdisk.c head/sys/kern/kern_descrip.c head/sys/kern/kern_event.c head/sys/kern/kern_jail.c head/sys/kern/kern_linker.c head/sys/kern/kern_mtxpool.c head/sys/kern/kern_proc.c head/sys/kern/kern_prot.c head/sys/kern/kern_resource.c head/sys/kern/subr_blist.c head/sys/kern/subr_witness.c head/sys/kern/uipc_accf.c head/sys/kern/uipc_mqueue.c head/sys/kern/uipc_syscalls.c head/sys/kern/uipc_usrreq.c head/sys/kern/vfs_export.c head/sys/kern/vfs_syscalls.c head/sys/net/bpf.c head/sys/net/bsd_comp.c head/sys/net/if.c head/sys/net/if_arcsubr.c head/sys/net/if_ethersubr.c head/sys/net/if_fddisubr.c head/sys/net/if_iso88025subr.c head/sys/net/if_ppp.c head/sys/net/if_sl.c head/sys/net/if_tap.c head/sys/net/if_tun.c head/sys/net/ppp_deflate.c head/sys/net/rtsock.c head/sys/net80211/ieee80211_acl.c head/sys/net80211/ieee80211_crypto_ccmp.c head/sys/net80211/ieee80211_crypto_tkip.c head/sys/net80211/ieee80211_crypto_wep.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_input.c head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_node.c head/sys/net80211/ieee80211_power.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_scan.c head/sys/net80211/ieee80211_scan_sta.c head/sys/net80211/ieee80211_sta.c head/sys/netatalk/ddp_pcb.c head/sys/netgraph/atm/sscfu/ng_sscfu_cust.h head/sys/netgraph/bluetooth/drivers/h4/ng_h4.c head/sys/netgraph/bluetooth/hci/ng_hci_main.c head/sys/netgraph/bluetooth/hci/ng_hci_misc.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_main.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.h head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c head/sys/netgraph/netflow/netflow.c head/sys/netgraph/netflow/ng_netflow.c head/sys/netgraph/netgraph.h head/sys/netgraph/ng_UI.c head/sys/netgraph/ng_async.c head/sys/netgraph/ng_atmllc.c head/sys/netgraph/ng_base.c head/sys/netgraph/ng_bpf.c head/sys/netgraph/ng_bridge.c head/sys/netgraph/ng_cisco.c head/sys/netgraph/ng_device.c head/sys/netgraph/ng_eiface.c head/sys/netgraph/ng_etf.c head/sys/netgraph/ng_ether.c head/sys/netgraph/ng_fec.c head/sys/netgraph/ng_frame_relay.c head/sys/netgraph/ng_gif.c head/sys/netgraph/ng_gif_demux.c head/sys/netgraph/ng_hole.c head/sys/netgraph/ng_iface.c head/sys/netgraph/ng_ipfw.c head/sys/netgraph/ng_ksocket.c head/sys/netgraph/ng_l2tp.c head/sys/netgraph/ng_lmi.c head/sys/netgraph/ng_message.h head/sys/netgraph/ng_mppc.c head/sys/netgraph/ng_nat.c head/sys/netgraph/ng_one2many.c head/sys/netgraph/ng_parse.c head/sys/netgraph/ng_pipe.c head/sys/netgraph/ng_ppp.c head/sys/netgraph/ng_pptpgre.c head/sys/netgraph/ng_rfc1490.c head/sys/netgraph/ng_sample.c head/sys/netgraph/ng_split.c head/sys/netgraph/ng_sppp.c head/sys/netgraph/ng_tag.c head/sys/netgraph/ng_tcpmss.c head/sys/netgraph/ng_tee.c head/sys/netgraph/ng_tty.c head/sys/netgraph/ng_vjc.c head/sys/netgraph/ng_vlan.c head/sys/netinet/igmp.c head/sys/netinet/in_mcast.c head/sys/netinet/in_pcb.c head/sys/netinet/ip_carp.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet/tcp_syncache.c head/sys/netinet6/in6.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_src.c head/sys/netinet6/raw_ip6.c head/sys/netipsec/keysock.c head/sys/netipsec/xform_ah.c head/sys/netipx/ipx_pcb.c head/sys/netipx/spx_usrreq.c head/sys/netnatm/natm.c head/sys/netnatm/natm_pcb.c head/sys/netncp/ncp_conn.c head/sys/netncp/ncp_rq.c head/sys/netncp/ncp_sock.c head/sys/netncp/ncp_subr.c head/sys/netsmb/smb_rq.c head/sys/netsmb/smb_trantcp.c head/sys/nfs4client/nfs4_dev.c head/sys/nfs4client/nfs4_idmap.c head/sys/nfs4client/nfs4_socket.c head/sys/nfs4client/nfs4_vfsops.c head/sys/nfs4client/nfs4_vn_subs.c head/sys/nfs4client/nfs4_vnops.c head/sys/nfsclient/krpc_subr.c head/sys/nfsclient/nfs_lock.c head/sys/nfsclient/nfs_node.c head/sys/nfsclient/nfs_socket.c head/sys/nfsclient/nfs_subs.c head/sys/nfsclient/nfs_vfsops.c head/sys/nfsclient/nfs_vnops.c head/sys/nfsserver/nfs_serv.c head/sys/nfsserver/nfs_srvcache.c head/sys/nfsserver/nfs_srvsock.c head/sys/nfsserver/nfs_syscalls.c head/sys/opencrypto/cryptodev.c head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/deflate.c head/sys/opencrypto/xform.c head/sys/rpc/rpcclnt.c head/sys/security/mac_bsdextended/mac_bsdextended.c head/sys/security/mac_lomac/mac_lomac.c head/sys/sys/malloc.h head/sys/sys/param.h head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ufs/ufs_dirhash.c head/sys/ufs/ufs/ufs_extattr.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Oct 23 15:44:00 2008 (r184204) +++ head/Makefile.inc1 Thu Oct 23 15:53:51 2008 (r184205) @@ -758,11 +758,14 @@ buildkernel: @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR} .endif +.if !defined(NO_KERNELOBJ) @echo @echo "--------------------------------------------------------------" @echo ">>> stage 2.2: rebuilding the object tree" @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj +.endif +.if !defined(NO_KERNELTOOLS) @echo @echo "--------------------------------------------------------------" @echo ">>> stage 2.3: build tools" @@ -779,6 +782,7 @@ buildkernel: ${MAKE} -DWITHOUT_SSP -DNO_CPU_CFLAGS -DNO_CTF ${target} .endfor .endif +.endif .if !defined(NO_KERNELDEPEND) @echo @echo "--------------------------------------------------------------" Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Oct 23 15:44:00 2008 (r184204) +++ head/share/man/man9/Makefile Thu Oct 23 15:53:51 2008 (r184205) @@ -741,9 +741,7 @@ MLINKS+=LOCK_PROFILING.9 MUTEX_PROFILING MLINKS+=make_dev.9 destroy_dev.9 \ make_dev.9 dev_depends.9 \ make_dev.9 make_dev_alias.9 -MLINKS+=malloc.9 FREE.9 \ - malloc.9 free.9 \ - malloc.9 MALLOC.9 \ +MLINKS+=malloc.9 free.9 \ malloc.9 MALLOC_DECLARE.9 \ malloc.9 MALLOC_DEFINE.9 \ malloc.9 realloc.9 \ Modified: head/share/man/man9/malloc.9 ============================================================================== --- head/share/man/man9/malloc.9 Thu Oct 23 15:44:00 2008 (r184204) +++ head/share/man/man9/malloc.9 Thu Oct 23 15:53:51 2008 (r184205) @@ -36,14 +36,12 @@ .\" $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $ .\" $FreeBSD$ .\" -.Dd June 12, 2003 +.Dd October 23, 2008 .Dt MALLOC 9 .Os .Sh NAME .Nm malloc , -.Nm MALLOC , .Nm free , -.Nm FREE , .Nm realloc , .Nm reallocf , .Nm MALLOC_DEFINE , @@ -54,10 +52,8 @@ .In sys/malloc.h .Ft void * .Fn malloc "unsigned long size" "struct malloc_type *type" "int flags" -.Fn MALLOC space cast "unsigned long size" "struct malloc_type *type" "int flags" .Ft void .Fn free "void *addr" "struct malloc_type *type" -.Fn FREE "void *addr" "struct malloc_type *type" .Ft void * .Fn realloc "void *addr" "unsigned long size" "struct malloc_type *type" "int flags" .Ft void * @@ -123,20 +119,6 @@ function is identical to except that it will free the passed pointer when the requested memory cannot be allocated. .Pp -The -.Fn MALLOC -macro variant is functionally equivalent to -.Bd -literal -offset indent -(space) = (cast)malloc((u_long)(size), type, flags) -.Ed -.Pp -and the -.Fn FREE -macro variant is equivalent to -.Bd -literal -offset indent -free((addr), type) -.Ed -.Pp Unlike its standard C library counterpart .Pq Xr malloc 3 , the kernel version takes two more arguments. @@ -219,7 +201,7 @@ MALLOC_DEFINE(M_FOOBUF, "foobuffers", "B /* sys/something/foo_subr.c */ \&... -MALLOC(buf, struct foo_buf *, sizeof *buf, M_FOOBUF, M_NOWAIT); +buf = malloc(sizeof *buf, M_FOOBUF, M_NOWAIT); .Ed .Pp Modified: head/sys/arm/arm/undefined.c ============================================================================== --- head/sys/arm/arm/undefined.c Thu Oct 23 15:44:00 2008 (r184204) +++ head/sys/arm/arm/undefined.c Thu Oct 23 15:53:51 2008 (r184205) @@ -106,7 +106,7 @@ install_coproc_handler(int coproc, undef KASSERT(handler != NULL, ("handler is NULL")); /* Used to be legal. */ /* XXX: M_TEMP??? */ - MALLOC(uh, struct undefined_handler *, sizeof(*uh), M_TEMP, M_WAITOK); + uh = malloc(sizeof(*uh), M_TEMP, M_WAITOK); uh->uh_handler = handler; install_coproc_handler_static(coproc, uh); return uh; @@ -125,7 +125,7 @@ remove_coproc_handler(void *cookie) struct undefined_handler *uh = cookie; LIST_REMOVE(uh, uh_link); - FREE(uh, M_TEMP); + free(uh, M_TEMP); } Modified: head/sys/cam/scsi/scsi_target.c ============================================================================== --- head/sys/cam/scsi/scsi_target.c Thu Oct 23 15:44:00 2008 (r184204) +++ head/sys/cam/scsi/scsi_target.c Thu Oct 23 15:53:51 2008 (r184205) @@ -183,7 +183,7 @@ targopen(struct cdev *dev, int flags, in make_dev(&targ_cdevsw, dev2unit(dev), UID_ROOT, GID_WHEEL, 0600, "targ%d", dev2unit(dev)); } - MALLOC(softc, struct targ_softc *, sizeof(*softc), M_TARG, + softc = malloc(sizeof(*softc), M_TARG, M_WAITOK | M_ZERO); dev->si_drv1 = softc; softc->state = TARG_STATE_OPENED; @@ -211,7 +211,7 @@ targclose(struct cdev *dev, int flag, in if ((softc->periph == NULL) || (softc->state & TARG_STATE_LUN_ENABLED) == 0) { destroy_dev(dev); - FREE(softc, M_TARG); + free(softc, M_TARG); return (0); } @@ -230,7 +230,7 @@ targclose(struct cdev *dev, int flag, in softc->periph = NULL; } destroy_dev(dev); - FREE(softc, M_TARG); + free(softc, M_TARG); } cam_periph_unlock(periph); cam_periph_release(periph); @@ -531,7 +531,7 @@ targdtor(struct cam_periph *periph) } while ((descr = TAILQ_FIRST(&softc->abort_queue)) != NULL) { TAILQ_REMOVE(&softc->abort_queue, descr, tqe); - FREE(descr, M_TARG); + free(descr, M_TARG); } softc->periph = NULL; @@ -966,7 +966,7 @@ targgetccb(struct targ_softc *softc, xpt int ccb_len; ccb_len = targccblen(type); - MALLOC(ccb, union ccb *, ccb_len, M_TARG, M_WAITOK); + ccb = malloc(ccb_len, M_TARG, M_WAITOK); CAM_DEBUG(softc->path, CAM_DEBUG_PERIPH, ("getccb %p\n", ccb)); xpt_setup_ccb(&ccb->ccb_h, softc->path, priority); @@ -981,13 +981,13 @@ targfreeccb(struct targ_softc *softc, un { CAM_DEBUG_PRINT(CAM_DEBUG_PERIPH, ("targfreeccb descr %p and\n", ccb->ccb_h.targ_descr)); - FREE(ccb->ccb_h.targ_descr, M_TARG); + free(ccb->ccb_h.targ_descr, M_TARG); switch (ccb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: case XPT_IMMED_NOTIFY: CAM_DEBUG_PRINT(CAM_DEBUG_PERIPH, ("freeing ccb %p\n", ccb)); - FREE(ccb, M_TARG); + free(ccb, M_TARG); break; default: /* Send back CCB if we got it from the periph */ @@ -998,7 +998,7 @@ targfreeccb(struct targ_softc *softc, un } else { CAM_DEBUG_PRINT(CAM_DEBUG_PERIPH, ("freeing ccb %p\n", ccb)); - FREE(ccb, M_TARG); + free(ccb, M_TARG); } break; } @@ -1009,7 +1009,7 @@ targgetdescr(struct targ_softc *softc) { struct targ_cmd_descr *descr; - MALLOC(descr, struct targ_cmd_descr *, sizeof(*descr), M_TARG, + descr = malloc(sizeof(*descr), M_TARG, M_WAITOK); descr->mapinfo.num_bufs_used = 0; return (descr); Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Thu Oct 23 15:44:00 2008 (r184204) +++ head/sys/compat/linux/linux_ioctl.c Thu Oct 23 15:53:51 2008 (r184205) @@ -2673,7 +2673,7 @@ linux_ioctl_register_handler(struct linu break; } if (he == NULL) { - MALLOC(he, struct handler_element *, sizeof(*he), + he = malloc(sizeof(*he), M_LINUX, M_WAITOK); he->func = h->func; } else @@ -2711,7 +2711,7 @@ linux_ioctl_unregister_handler(struct li if (he->func == h->func) { TAILQ_REMOVE(&handlers, he, list); sx_xunlock(&linux_ioctl_sx); - FREE(he, M_LINUX); + free(he, M_LINUX); return (0); } } Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Thu Oct 23 15:44:00 2008 (r184204) +++ head/sys/compat/linux/linux_socket.c Thu Oct 23 15:53:51 2008 (r184205) @@ -120,7 +120,7 @@ do_sa_get(struct sockaddr **sap, const s } #endif - MALLOC(kosa, struct osockaddr *, alloclen, mtype, M_WAITOK); + kosa = malloc(alloclen, mtype, M_WAITOK); if ((error = copyin(osa, kosa, *osalen))) goto out; @@ -168,7 +168,7 @@ do_sa_get(struct sockaddr **sap, const s return (0); out: - FREE(kosa, mtype); + free(kosa, mtype); return (error); } @@ -458,7 +458,7 @@ linux_sendit(struct thread *td, int s, s bad: if (to) - FREE(to, M_SONAME); + free(to, M_SONAME); return (error); } Modified: head/sys/compat/linux/linux_util.c ============================================================================== --- head/sys/compat/linux/linux_util.c Thu Oct 23 15:44:00 2008 (r184204) +++ head/sys/compat/linux/linux_util.c Thu Oct 23 15:53:51 2008 (r184205) @@ -165,7 +165,7 @@ linux_get_char_devices() char formated[256]; int current_size = 0, string_size = 1024; - MALLOC(string, char *, string_size, M_LINUX, M_WAITOK); + string = malloc(string_size, M_LINUX, M_WAITOK); string[0] = '\000'; last = ""; TAILQ_FOREACH(de, &devices, list) { @@ -181,10 +181,10 @@ linux_get_char_devices() if (strlen(formated) + current_size >= string_size) { string_size *= 2; - MALLOC(string, char *, string_size, + string = malloc(string_size, M_LINUX, M_WAITOK); bcopy(temp, string, current_size); - FREE(temp, M_LINUX); + free(temp, M_LINUX); } strcat(string, formated); current_size = strlen(string); @@ -197,7 +197,7 @@ linux_get_char_devices() void linux_free_get_char_devices(char *string) { - FREE(string, M_LINUX); + free(string, M_LINUX); } static int linux_major_starting = 200; @@ -210,7 +210,7 @@ linux_device_register_handler(struct lin if (d == NULL) return (EINVAL); - MALLOC(de, struct device_element *, sizeof(*de), + de = malloc(sizeof(*de), M_LINUX, M_WAITOK); if (d->linux_major < 0) { d->linux_major = linux_major_starting++; @@ -234,7 +234,7 @@ linux_device_unregister_handler(struct l TAILQ_FOREACH(de, &devices, list) { if (bcmp(d, &de->entry, sizeof(*d)) == 0) { TAILQ_REMOVE(&devices, de, list); - FREE(de, M_LINUX); + free(de, M_LINUX); return (0); } } Modified: head/sys/contrib/altq/altq/altq_cbq.c ============================================================================== --- head/sys/contrib/altq/altq/altq_cbq.c Thu Oct 23 15:44:00 2008 (r184204) +++ head/sys/contrib/altq/altq/altq_cbq.c Thu Oct 23 15:53:51 2008 (r184205) @@ -273,7 +273,7 @@ cbq_add_altq(struct pf_altq *a) return (ENODEV); /* allocate and initialize cbq_state_t */ - MALLOC(cbqp, cbq_state_t *, sizeof(cbq_state_t), M_DEVBUF, M_WAITOK); + cbqp = malloc(sizeof(cbq_state_t), M_DEVBUF, M_WAITOK); if (cbqp == NULL) return (ENOMEM); bzero(cbqp, sizeof(cbq_state_t)); @@ -304,7 +304,7 @@ cbq_remove_altq(struct pf_altq *a) cbq_class_destroy(cbqp, cbqp->ifnp.root_); /* deallocate cbq_state_t */ - FREE(cbqp, M_DEVBUF); + free(cbqp, M_DEVBUF); return (0); } @@ -927,7 +927,7 @@ cbq_ifattach(ifacep) return (ENXIO); /* allocate and initialize cbq_state_t */ - MALLOC(new_cbqp, cbq_state_t *, sizeof(cbq_state_t), M_DEVBUF, M_WAITOK); + new_cbqp = malloc(sizeof(cbq_state_t), M_DEVBUF, M_WAITOK); if (new_cbqp == NULL) return (ENOMEM); bzero(new_cbqp, sizeof(cbq_state_t)); @@ -943,7 +943,7 @@ cbq_ifattach(ifacep) cbq_enqueue, cbq_dequeue, cbq_request, &new_cbqp->cbq_classifier, acc_classify); if (error) { - FREE(new_cbqp, M_DEVBUF); + free(new_cbqp, M_DEVBUF); return (error); } @@ -987,7 +987,7 @@ cbq_ifdetach(ifacep) } /* deallocate cbq_state_t */ - FREE(cbqp, M_DEVBUF); + free(cbqp, M_DEVBUF); return (0); } Modified: head/sys/contrib/altq/altq/altq_cdnr.c ============================================================================== --- head/sys/contrib/altq/altq/altq_cdnr.c Thu Oct 23 15:44:00 2008 (r184204) +++ head/sys/contrib/altq/altq/altq_cdnr.c Thu Oct 23 15:53:51 2008 (r184205) @@ -274,7 +274,7 @@ cdnr_cballoc(top, type, input_func) return (NULL); } - MALLOC(cb, struct cdnr_block *, size, M_DEVBUF, M_WAITOK); + cb = malloc(size, M_DEVBUF, M_WAITOK); if (cb == NULL) return (NULL); bzero(cb, size); @@ -319,7 +319,7 @@ cdnr_cbdestroy(cblock) if (cb->cb_top != cblock) LIST_REMOVE(cb, cb_next); - FREE(cb, M_DEVBUF); + free(cb, M_DEVBUF); } /* Modified: head/sys/contrib/altq/altq/altq_hfsc.c ============================================================================== --- head/sys/contrib/altq/altq/altq_hfsc.c Thu Oct 23 15:44:00 2008 (r184204) +++ head/sys/contrib/altq/altq/altq_hfsc.c Thu Oct 23 15:53:51 2008 (r184205) @@ -202,7 +202,7 @@ hfsc_add_altq(struct pf_altq *a) if (!ALTQ_IS_READY(&ifp->if_snd)) return (ENODEV); - MALLOC(hif, struct hfsc_if *, sizeof(struct hfsc_if), + hif = malloc(sizeof(struct hfsc_if), M_DEVBUF, M_WAITOK); if (hif == NULL) return (ENOMEM); @@ -210,7 +210,7 @@ hfsc_add_altq(struct pf_altq *a) hif->hif_eligible = ellist_alloc(); if (hif->hif_eligible == NULL) { - FREE(hif, M_DEVBUF); + free(hif, M_DEVBUF); return (ENOMEM); } @@ -236,7 +236,7 @@ hfsc_remove_altq(struct pf_altq *a) ellist_destroy(hif->hif_eligible); - FREE(hif, M_DEVBUF); + free(hif, M_DEVBUF); return (0); } @@ -404,13 +404,13 @@ hfsc_class_create(struct hfsc_if *hif, s } #endif - MALLOC(cl, struct hfsc_class *, sizeof(struct hfsc_class), + cl = malloc(sizeof(struct hfsc_class), M_DEVBUF, M_WAITOK); if (cl == NULL) return (NULL); bzero(cl, sizeof(struct hfsc_class)); - MALLOC(cl->cl_q, class_queue_t *, sizeof(class_queue_t), + cl->cl_q = malloc(sizeof(class_queue_t), M_DEVBUF, M_WAITOK); if (cl->cl_q == NULL) goto err_ret; @@ -471,8 +471,7 @@ hfsc_class_create(struct hfsc_if *hif, s #endif /* ALTQ_RED */ if (rsc != NULL && (rsc->m1 != 0 || rsc->m2 != 0)) { - MALLOC(cl->cl_rsc, struct internal_sc *, - sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); + cl->cl_rsc = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); if (cl->cl_rsc == NULL) goto err_ret; sc2isc(rsc, cl->cl_rsc); @@ -480,16 +479,14 @@ hfsc_class_create(struct hfsc_if *hif, s rtsc_init(&cl->cl_eligible, cl->cl_rsc, 0, 0); } if (fsc != NULL && (fsc->m1 != 0 || fsc->m2 != 0)) { - MALLOC(cl->cl_fsc, struct internal_sc *, - sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); + cl->cl_fsc = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); if (cl->cl_fsc == NULL) goto err_ret; sc2isc(fsc, cl->cl_fsc); rtsc_init(&cl->cl_virtual, cl->cl_fsc, 0, 0); } if (usc != NULL && (usc->m1 != 0 || usc->m2 != 0)) { - MALLOC(cl->cl_usc, struct internal_sc *, - sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); + cl->cl_usc = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); if (cl->cl_usc == NULL) goto err_ret; sc2isc(usc, cl->cl_usc); @@ -565,14 +562,14 @@ hfsc_class_create(struct hfsc_if *hif, s #endif } if (cl->cl_fsc != NULL) - FREE(cl->cl_fsc, M_DEVBUF); + free(cl->cl_fsc, M_DEVBUF); if (cl->cl_rsc != NULL) - FREE(cl->cl_rsc, M_DEVBUF); + free(cl->cl_rsc, M_DEVBUF); if (cl->cl_usc != NULL) - FREE(cl->cl_usc, M_DEVBUF); + free(cl->cl_usc, M_DEVBUF); if (cl->cl_q != NULL) - FREE(cl->cl_q, M_DEVBUF); - FREE(cl, M_DEVBUF); + free(cl->cl_q, M_DEVBUF); + free(cl, M_DEVBUF); return (NULL); } @@ -649,13 +646,13 @@ hfsc_class_destroy(struct hfsc_class *cl IFQ_UNLOCK(cl->cl_hif->hif_ifq); if (cl->cl_usc != NULL) - FREE(cl->cl_usc, M_DEVBUF); + free(cl->cl_usc, M_DEVBUF); if (cl->cl_fsc != NULL) - FREE(cl->cl_fsc, M_DEVBUF); + free(cl->cl_fsc, M_DEVBUF); if (cl->cl_rsc != NULL) - FREE(cl->cl_rsc, M_DEVBUF); - FREE(cl->cl_q, M_DEVBUF); - FREE(cl, M_DEVBUF); + free(cl->cl_rsc, M_DEVBUF); + free(cl->cl_q, M_DEVBUF); + free(cl, M_DEVBUF); return (0); } @@ -1203,7 +1200,7 @@ ellist_alloc(void) { ellist_t *head; - MALLOC(head, ellist_t *, sizeof(ellist_t), M_DEVBUF, M_WAITOK); + head = malloc(sizeof(ellist_t), M_DEVBUF, M_WAITOK); TAILQ_INIT(head); return (head); } @@ -1211,7 +1208,7 @@ ellist_alloc(void) static void ellist_destroy(ellist_t *head) { - FREE(head, M_DEVBUF); + free(head, M_DEVBUF); } static void @@ -1306,7 +1303,7 @@ actlist_alloc(void) { actlist_t *head; - MALLOC(head, actlist_t *, sizeof(actlist_t), M_DEVBUF, M_WAITOK); + head = malloc(sizeof(actlist_t), M_DEVBUF, M_WAITOK); TAILQ_INIT(head); return (head); } @@ -1314,7 +1311,7 @@ actlist_alloc(void) static void actlist_destroy(actlist_t *head) { - FREE(head, M_DEVBUF); + free(head, M_DEVBUF); } static void actlist_insert(struct hfsc_class *cl) @@ -1743,7 +1740,7 @@ hfsc_attach(ifq, bandwidth) { struct hfsc_if *hif; - MALLOC(hif, struct hfsc_if *, sizeof(struct hfsc_if), + hif = malloc(sizeof(struct hfsc_if), M_DEVBUF, M_WAITOK); if (hif == NULL) return (NULL); @@ -1751,7 +1748,7 @@ hfsc_attach(ifq, bandwidth) hif->hif_eligible = ellist_alloc(); if (hif->hif_eligible == NULL) { - FREE(hif, M_DEVBUF); + free(hif, M_DEVBUF); return NULL; } @@ -1787,7 +1784,7 @@ hfsc_detach(hif) ellist_destroy(hif->hif_eligible); - FREE(hif, M_DEVBUF); + free(hif, M_DEVBUF); return (0); } @@ -1804,22 +1801,19 @@ hfsc_class_modify(cl, rsc, fsc, usc) rsc_tmp = fsc_tmp = usc_tmp = NULL; if (rsc != NULL && (rsc->m1 != 0 || rsc->m2 != 0) && cl->cl_rsc == NULL) { - MALLOC(rsc_tmp, struct internal_sc *, - sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); + rsc_tmp = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); if (rsc_tmp == NULL) return (ENOMEM); } if (fsc != NULL && (fsc->m1 != 0 || fsc->m2 != 0) && cl->cl_fsc == NULL) { - MALLOC(fsc_tmp, struct internal_sc *, - sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); + fsc_tmp = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); if (fsc_tmp == NULL) return (ENOMEM); } if (usc != NULL && (usc->m1 != 0 || usc->m2 != 0) && cl->cl_usc == NULL) { - MALLOC(usc_tmp, struct internal_sc *, - sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); + usc_tmp = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); if (usc_tmp == NULL) return (ENOMEM); } @@ -1837,7 +1831,7 @@ hfsc_class_modify(cl, rsc, fsc, usc) if (cl->cl_rsc != NULL) { if (!qempty(cl->cl_q)) hfsc_purgeq(cl); - FREE(cl->cl_rsc, M_DEVBUF); + free(cl->cl_rsc, M_DEVBUF); cl->cl_rsc = NULL; } } else { @@ -1859,7 +1853,7 @@ hfsc_class_modify(cl, rsc, fsc, usc) if (cl->cl_fsc != NULL) { if (!qempty(cl->cl_q)) hfsc_purgeq(cl); - FREE(cl->cl_fsc, M_DEVBUF); + free(cl->cl_fsc, M_DEVBUF); cl->cl_fsc = NULL; } } else { @@ -1874,7 +1868,7 @@ hfsc_class_modify(cl, rsc, fsc, usc) if (usc != NULL) { if (usc->m1 == 0 && usc->m2 == 0) { if (cl->cl_usc != NULL) { - FREE(cl->cl_usc, M_DEVBUF); + free(cl->cl_usc, M_DEVBUF); cl->cl_usc = NULL; cl->cl_myf = 0; } Modified: head/sys/contrib/altq/altq/altq_priq.c ============================================================================== --- head/sys/contrib/altq/altq/altq_priq.c Thu Oct 23 15:44:00 2008 (r184204) +++ head/sys/contrib/altq/altq/altq_priq.c Thu Oct 23 15:53:51 2008 (r184205) @@ -134,7 +134,7 @@ priq_add_altq(struct pf_altq *a) if (!ALTQ_IS_READY(&ifp->if_snd)) return (ENODEV); - MALLOC(pif, struct priq_if *, sizeof(struct priq_if), + pif = malloc(sizeof(struct priq_if), M_DEVBUF, M_WAITOK); if (pif == NULL) return (ENOMEM); @@ -160,7 +160,7 @@ priq_remove_altq(struct pf_altq *a) (void)priq_clear_interface(pif); - FREE(pif, M_DEVBUF); + free(pif, M_DEVBUF); return (0); } @@ -320,13 +320,13 @@ priq_class_create(struct priq_if *pif, i red_destroy(cl->cl_red); #endif } else { - MALLOC(cl, struct priq_class *, sizeof(struct priq_class), + cl = malloc(sizeof(struct priq_class), M_DEVBUF, M_WAITOK); if (cl == NULL) return (NULL); bzero(cl, sizeof(struct priq_class)); - MALLOC(cl->cl_q, class_queue_t *, sizeof(class_queue_t), + cl->cl_q = malloc(sizeof(class_queue_t), M_DEVBUF, M_WAITOK); if (cl->cl_q == NULL) goto err_ret; @@ -397,8 +397,8 @@ priq_class_create(struct priq_if *pif, i #endif } if (cl->cl_q != NULL) - FREE(cl->cl_q, M_DEVBUF); - FREE(cl, M_DEVBUF); + free(cl->cl_q, M_DEVBUF); + free(cl, M_DEVBUF); return (NULL); } @@ -447,8 +447,8 @@ priq_class_destroy(struct priq_class *cl red_destroy(cl->cl_red); #endif } - FREE(cl->cl_q, M_DEVBUF); - FREE(cl, M_DEVBUF); + free(cl->cl_q, M_DEVBUF); + free(cl, M_DEVBUF); return (0); } @@ -666,7 +666,7 @@ priq_attach(ifq, bandwidth) { struct priq_if *pif; - MALLOC(pif, struct priq_if *, sizeof(struct priq_if), + pif = malloc(sizeof(struct priq_if), M_DEVBUF, M_WAITOK); if (pif == NULL) return (NULL); @@ -702,7 +702,7 @@ priq_detach(pif) ASSERT(p != NULL); } - FREE(pif, M_DEVBUF); + free(pif, M_DEVBUF); return (0); } Modified: head/sys/contrib/altq/altq/altq_red.c ============================================================================== --- head/sys/contrib/altq/altq/altq_red.c Thu Oct 23 15:44:00 2008 (r184204) +++ head/sys/contrib/altq/altq/altq_red.c Thu Oct 23 15:53:51 2008 (r184205) @@ -233,7 +233,7 @@ red_alloc(int weight, int inv_pmax, int int w, i; int npkts_per_sec; - MALLOC(rp, red_t *, sizeof(red_t), M_DEVBUF, M_WAITOK); + rp = malloc(sizeof(red_t), M_DEVBUF, M_WAITOK); if (rp == NULL) return (NULL); bzero(rp, sizeof(red_t)); @@ -321,7 +321,7 @@ red_destroy(red_t *rp) #endif #endif /* ALTQ3_COMPAT */ wtab_destroy(rp->red_wtab); - FREE(rp, M_DEVBUF); + free(rp, M_DEVBUF); } void @@ -646,7 +646,7 @@ wtab_alloc(int weight) return (w); } - MALLOC(w, struct wtab *, sizeof(struct wtab), M_DEVBUF, M_WAITOK); + w = malloc(sizeof(struct wtab), M_DEVBUF, M_WAITOK); if (w == NULL) panic("wtab_alloc: malloc failed!"); bzero(w, sizeof(struct wtab)); @@ -682,7 +682,7 @@ wtab_destroy(struct wtab *w) break; } - FREE(w, M_DEVBUF); + free(w, M_DEVBUF); return (0); } @@ -816,17 +816,17 @@ redioctl(dev, cmd, addr, flag, p) } /* allocate and initialize red_queue_t */ - MALLOC(rqp, red_queue_t *, sizeof(red_queue_t), M_DEVBUF, M_WAITOK); + rqp = malloc(sizeof(red_queue_t), M_DEVBUF, M_WAITOK); if (rqp == NULL) { error = ENOMEM; break; } bzero(rqp, sizeof(red_queue_t)); - MALLOC(rqp->rq_q, class_queue_t *, sizeof(class_queue_t), + rqp->rq_q = malloc(sizeof(class_queue_t), M_DEVBUF, M_WAITOK); if (rqp->rq_q == NULL) { - FREE(rqp, M_DEVBUF); + free(rqp, M_DEVBUF); error = ENOMEM; break; } @@ -834,8 +834,8 @@ redioctl(dev, cmd, addr, flag, p) rqp->rq_red = red_alloc(0, 0, 0, 0, 0, 0); if (rqp->rq_red == NULL) { - FREE(rqp->rq_q, M_DEVBUF); - FREE(rqp, M_DEVBUF); + free(rqp->rq_q, M_DEVBUF); + free(rqp, M_DEVBUF); error = ENOMEM; break; } @@ -854,8 +854,8 @@ redioctl(dev, cmd, addr, flag, p) NULL, NULL); if (error) { red_destroy(rqp->rq_red); - FREE(rqp->rq_q, M_DEVBUF); - FREE(rqp, M_DEVBUF); + free(rqp->rq_q, M_DEVBUF); + free(rqp, M_DEVBUF); break; } @@ -1016,8 +1016,8 @@ red_detach(rqp) } red_destroy(rqp->rq_red); - FREE(rqp->rq_q, M_DEVBUF); - FREE(rqp, M_DEVBUF); + free(rqp->rq_q, M_DEVBUF); + free(rqp, M_DEVBUF); return (error); } @@ -1297,16 +1297,16 @@ fv_alloc(rp) int i, num; num = FV_FLOWLISTSIZE; - MALLOC(fv, struct flowvalve *, sizeof(struct flowvalve), + fv = malloc(sizeof(struct flowvalve), M_DEVBUF, M_WAITOK); if (fv == NULL) return (NULL); bzero(fv, sizeof(struct flowvalve)); - MALLOC(fv->fv_fves, struct fve *, sizeof(struct fve) * num, + fv->fv_fves = malloc(sizeof(struct fve) * num, M_DEVBUF, M_WAITOK); if (fv->fv_fves == NULL) { - FREE(fv, M_DEVBUF); + free(fv, M_DEVBUF); return (NULL); } bzero(fv->fv_fves, sizeof(struct fve) * num); @@ -1323,11 +1323,11 @@ fv_alloc(rp) fv->fv_pthresh = (FV_PSCALE(1) << FP_SHIFT) / rp->red_inv_pmax; /* initialize drop rate to fraction table */ - MALLOC(fv->fv_p2ftab, int *, sizeof(int) * BRTT_SIZE, + fv->fv_p2ftab = malloc(sizeof(int) * BRTT_SIZE, M_DEVBUF, M_WAITOK); if (fv->fv_p2ftab == NULL) { - FREE(fv->fv_fves, M_DEVBUF); - FREE(fv, M_DEVBUF); + free(fv->fv_fves, M_DEVBUF); + free(fv, M_DEVBUF); return (NULL); } /* @@ -1348,9 +1348,9 @@ fv_alloc(rp) static void fv_destroy(fv) struct flowvalve *fv; { - FREE(fv->fv_p2ftab, M_DEVBUF); - FREE(fv->fv_fves, M_DEVBUF); - FREE(fv, M_DEVBUF); + free(fv->fv_p2ftab, M_DEVBUF); + free(fv->fv_fves, M_DEVBUF); + free(fv, M_DEVBUF); } static __inline int Modified: head/sys/contrib/altq/altq/altq_rio.c ============================================================================== --- head/sys/contrib/altq/altq/altq_rio.c Thu Oct 23 15:44:00 2008 (r184204) +++ head/sys/contrib/altq/altq/altq_rio.c Thu Oct 23 15:53:51 2008 (r184205) @@ -206,7 +206,7 @@ rio_alloc(int weight, struct redparams * int w, i; int npkts_per_sec; - MALLOC(rp, rio_t *, sizeof(rio_t), M_DEVBUF, M_WAITOK); + rp = malloc(sizeof(rio_t), M_DEVBUF, M_WAITOK); if (rp == NULL) return (NULL); bzero(rp, sizeof(rio_t)); @@ -293,7 +293,7 @@ void rio_destroy(rio_t *rp) { wtab_destroy(rp->rio_wtab); - FREE(rp, M_DEVBUF); + free(rp, M_DEVBUF); } void @@ -572,17 +572,17 @@ rioioctl(dev, cmd, addr, flag, p) } /* allocate and initialize rio_queue_t */ - MALLOC(rqp, rio_queue_t *, sizeof(rio_queue_t), M_DEVBUF, M_WAITOK); + rqp = malloc(sizeof(rio_queue_t), M_DEVBUF, M_WAITOK); if (rqp == NULL) { error = ENOMEM; break; } bzero(rqp, sizeof(rio_queue_t)); - MALLOC(rqp->rq_q, class_queue_t *, sizeof(class_queue_t), + rqp->rq_q = malloc(sizeof(class_queue_t), M_DEVBUF, M_WAITOK); if (rqp->rq_q == NULL) { - FREE(rqp, M_DEVBUF); + free(rqp, M_DEVBUF); error = ENOMEM; break; } @@ -590,8 +590,8 @@ rioioctl(dev, cmd, addr, flag, p) rqp->rq_rio = rio_alloc(0, NULL, 0, 0); if (rqp->rq_rio == NULL) { - FREE(rqp->rq_q, M_DEVBUF); - FREE(rqp, M_DEVBUF); + free(rqp->rq_q, M_DEVBUF); + free(rqp, M_DEVBUF); error = ENOMEM; break; } @@ -610,8 +610,8 @@ rioioctl(dev, cmd, addr, flag, p) NULL, NULL); if (error) { rio_destroy(rqp->rq_rio); - FREE(rqp->rq_q, M_DEVBUF); - FREE(rqp, M_DEVBUF); + free(rqp->rq_q, M_DEVBUF); + free(rqp, M_DEVBUF); break; } @@ -759,8 +759,8 @@ rio_detach(rqp) } rio_destroy(rqp->rq_rio); - FREE(rqp->rq_q, M_DEVBUF); - FREE(rqp, M_DEVBUF); + free(rqp->rq_q, M_DEVBUF); + free(rqp, M_DEVBUF); return (error); } Modified: head/sys/contrib/altq/altq/altq_rmclass.c ============================================================================== --- head/sys/contrib/altq/altq/altq_rmclass.c Thu Oct 23 15:44:00 2008 (r184204) +++ head/sys/contrib/altq/altq/altq_rmclass.c Thu Oct 23 15:53:51 2008 (r184205) @@ -220,16 +220,16 @@ rmc_newclass(int pri, struct rm_ifdat *i } #endif - MALLOC(cl, struct rm_class *, sizeof(struct rm_class), + cl = malloc(sizeof(struct rm_class), M_DEVBUF, M_WAITOK); if (cl == NULL) return (NULL); bzero(cl, sizeof(struct rm_class)); CALLOUT_INIT(&cl->callout_); - MALLOC(cl->q_, class_queue_t *, sizeof(class_queue_t), + cl->q_ = malloc(sizeof(class_queue_t), M_DEVBUF, M_WAITOK); if (cl->q_ == NULL) { - FREE(cl, M_DEVBUF); + free(cl, M_DEVBUF); return (NULL); } bzero(cl->q_, sizeof(class_queue_t)); @@ -658,8 +658,8 @@ rmc_delete_class(struct rm_ifdat *ifd, s red_destroy(cl->red_); #endif } - FREE(cl->q_, M_DEVBUF); - FREE(cl, M_DEVBUF); + free(cl->q_, M_DEVBUF); + free(cl, M_DEVBUF); } Modified: head/sys/contrib/altq/altq/altq_subr.c ============================================================================== --- head/sys/contrib/altq/altq/altq_subr.c Thu Oct 23 15:44:00 2008 (r184204) +++ head/sys/contrib/altq/altq/altq_subr.c Thu Oct 23 15:53:51 2008 (r184205) @@ -397,13 +397,13 @@ tbr_set(ifq, profile) return (ENOENT); } ifq->altq_tbr = NULL; - FREE(tbr, M_DEVBUF); + free(tbr, M_DEVBUF); IFQ_UNLOCK(ifq); return (0); } IFQ_UNLOCK(ifq); - MALLOC(tbr, struct tb_regulator *, sizeof(struct tb_regulator), + tbr = malloc(sizeof(struct tb_regulator), M_DEVBUF, M_WAITOK); if (tbr == NULL) { /* can not happen */ IFQ_UNLOCK(ifq); @@ -426,7 +426,7 @@ tbr_set(ifq, profile) ifq->altq_tbr = tbr; /* set the new tbr */ if (otbr != NULL) - FREE(otbr, M_DEVBUF); + free(otbr, M_DEVBUF); else { if (tbr_timer == 0) { CALLOUT_RESET(&tbr_callout, 1, tbr_timeout, (void *)0); @@ -1402,7 +1402,7 @@ acc_add_filter(classifier, filter, class return (EINVAL); #endif - MALLOC(afp, struct acc_filter *, sizeof(struct acc_filter), + afp = malloc(sizeof(struct acc_filter), M_DEVBUF, M_WAITOK); if (afp == NULL) return (ENOMEM); @@ -1529,7 +1529,7 @@ acc_delete_filter(classifier, handle) LIST_REMOVE(afp, f_chain); splx(s); - FREE(afp, M_DEVBUF); + free(afp, M_DEVBUF); /* todo: update filt_bmask */ @@ -1559,7 +1559,7 @@ acc_discard_filters(classifier, class, a LIST_FOREACH(afp, &classifier->acc_filters[i], f_chain) if (all || afp->f_class == class) { LIST_REMOVE(afp, f_chain); - FREE(afp, M_DEVBUF); + free(afp, M_DEVBUF); /* start again from the head */ break; } @@ -1981,7 +1981,7 @@ ip4f_init(void) TAILQ_INIT(&ip4f_list); for (i=0; i= 800051 +# define KMALLOC(a, b) do { \ + a = (b)malloc(sizeof(*(a)), _M_IPF, M_NOWAIT); \ + } while (0) +# define KMALLOCS(a, b, c) do { \ + a = (b)malloc((c), _M_IPF, ((c) > 4096) ? M_WAITOK : M_NOWAIT); \ + } while (0) +# define KFREE(x) free((x), _M_IPF) +# define KFREES(x,s) free((x), _M_IPF) +# else +# define KMALLOC(a, b) MALLOC((a), b, sizeof(*(a)), _M_IPF, M_NOWAIT) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 15:56:38 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 345741065681; Thu, 23 Oct 2008 15:56:38 +0000 (UTC) (envelope-from rdivacky@lev.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id B97428FC08; Thu, 23 Oct 2008 15:56:36 +0000 (UTC) (envelope-from rdivacky@lev.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 46BC79CB4F9; Thu, 23 Oct 2008 17:55:45 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BIyFKODFGhAS; Thu, 23 Oct 2008 17:55:30 +0200 (CEST) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 34C0E9CB716; Thu, 23 Oct 2008 17:55:30 +0200 (CEST) Received: (from rdivacky@localhost) by lev.vlakno.cz (8.14.2/8.14.2/Submit) id m9NFtUAd001015; Thu, 23 Oct 2008 17:55:30 +0200 (CEST) (envelope-from rdivacky) Date: Thu, 23 Oct 2008 17:55:30 +0200 From: Roman Divacky To: Dag-Erling Smorgrav Message-ID: <20081023155530.GA810@freebsd.org> References: <200810231553.m9NFrqQj060598@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200810231553.m9NFrqQj060598@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: r184205 - in head: . share/man/man9 sys/arm/arm sys/cam/scsi sys/compat/linux sys/contrib/altq/altq sys/contrib/ipfilter/netinet sys/dev/ar sys/dev/ce sys/dev/hwpmc sys/dev/lmc sys/dev/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 15:56:38 -0000 On Thu, Oct 23, 2008 at 03:53:52PM +0000, Dag-Erling Smorgrav wrote: > Author: des > Date: Thu Oct 23 15:53:51 2008 > New Revision: 184205 > URL: http://svn.freebsd.org/changeset/base/184205 > > Log: > Retire the MALLOC and FREE macros. They are an abomination unto style(9). > > MFC after: 3 months > > Modified: > head/Makefile.inc1 > > Modified: head/Makefile.inc1 > ============================================================================== > --- head/Makefile.inc1 Thu Oct 23 15:44:00 2008 (r184204) > +++ head/Makefile.inc1 Thu Oct 23 15:53:51 2008 (r184205) > @@ -758,11 +758,14 @@ buildkernel: > @echo "--------------------------------------------------------------" > cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR} > .endif > +.if !defined(NO_KERNELOBJ) > @echo > @echo "--------------------------------------------------------------" > @echo ">>> stage 2.2: rebuilding the object tree" > @echo "--------------------------------------------------------------" > cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj > +.endif > +.if !defined(NO_KERNELTOOLS) > @echo > @echo "--------------------------------------------------------------" > @echo ">>> stage 2.3: build tools" > @@ -779,6 +782,7 @@ buildkernel: > ${MAKE} -DWITHOUT_SSP -DNO_CPU_CFLAGS -DNO_CTF ${target} > .endfor > .endif > +.endif > .if !defined(NO_KERNELDEPEND) > @echo > @echo "--------------------------------------------------------------" > are you sure this belongs here? From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 16:03:52 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98D2D106567B; Thu, 23 Oct 2008 16:03:52 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 6C19D8FC16; Thu, 23 Oct 2008 16:03:52 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id m9NG3pW0096944 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 23 Oct 2008 09:03:51 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <4900A067.80003@freebsd.org> Date: Thu, 23 Oct 2008 09:03:51 -0700 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.9 (X11/20071125) MIME-Version: 1.0 To: Dag-Erling Smorgrav References: <200810231553.m9NFrqQj060598@svn.freebsd.org> In-Reply-To: <200810231553.m9NFrqQj060598@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC--Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184205 - in head: . share/man/man9 sys/arm/arm sys/cam/scsi sys/compat/linux sys/contrib/altq/altq sys/contrib/ipfilter/netinet sys/dev/ar sys/dev/ce sys/dev/hwpmc sys/dev/lmc sys/dev/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 16:03:52 -0000 Dag-Erling Smorgrav wrote: > Author: des > Date: Thu Oct 23 15:53:51 2008 > New Revision: 184205 > URL: http://svn.freebsd.org/changeset/base/184205 > > Log: > Retire the MALLOC and FREE macros. They are an abomination unto style(9). > > I didn't see this discussed anywhere. You have now generated huge gratuitous differences in net80211 against other code bases I maintain. I am likely to return these privately to net80211 which means code churn that could have been avoided. Sam From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 16:04:04 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 509B410656C9; Thu, 23 Oct 2008 16:04:04 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 0BA458FC1A; Thu, 23 Oct 2008 16:04:03 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 0D7166D449; Thu, 23 Oct 2008 16:04:03 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id F2354844A7; Thu, 23 Oct 2008 18:04:02 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Roman Divacky References: <200810231553.m9NFrqQj060598@svn.freebsd.org> <20081023155530.GA810@freebsd.org> Date: Thu, 23 Oct 2008 18:04:02 +0200 In-Reply-To: <20081023155530.GA810@freebsd.org> (Roman Divacky's message of "Thu, 23 Oct 2008 17:55:30 +0200") Message-ID: <86k5bz1eod.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184205 - in head: . share/man/man9 sys/arm/arm sys/cam/scsi sys/compat/linux sys/contrib/altq/altq sys/contrib/ipfilter/netinet sys/dev/ar sys/dev/ce sys/dev/hwpmc sys/dev/lmc sys/dev/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 16:04:04 -0000 Roman Divacky writes: > Dag-Erling Smorgrav writes: > > Modified: head/Makefile.inc1 > > [...] > are you sure this belongs here? No. This was something I threw in to make testing easier. Thanks for noticing. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 16:06:49 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9431F106567C; Thu, 23 Oct 2008 16:06:49 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 836ED8FC0C; Thu, 23 Oct 2008 16:06:49 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9NG6neK060956; Thu, 23 Oct 2008 16:06:49 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9NG6nhl060955; Thu, 23 Oct 2008 16:06:49 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810231606.m9NG6nhl060955@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 23 Oct 2008 16: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: r184206 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 16:06:49 -0000 Author: des Date: Thu Oct 23 16:06:49 2008 New Revision: 184206 URL: http://svn.freebsd.org/changeset/base/184206 Log: Back out testing aid that was inadvertantly committed as part of r184205. Noticed by: rdivacky Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Oct 23 15:53:51 2008 (r184205) +++ head/Makefile.inc1 Thu Oct 23 16:06:49 2008 (r184206) @@ -758,14 +758,11 @@ buildkernel: @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR} .endif -.if !defined(NO_KERNELOBJ) @echo @echo "--------------------------------------------------------------" @echo ">>> stage 2.2: rebuilding the object tree" @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj -.endif -.if !defined(NO_KERNELTOOLS) @echo @echo "--------------------------------------------------------------" @echo ">>> stage 2.3: build tools" @@ -782,7 +779,6 @@ buildkernel: ${MAKE} -DWITHOUT_SSP -DNO_CPU_CFLAGS -DNO_CTF ${target} .endfor .endif -.endif .if !defined(NO_KERNELDEPEND) @echo @echo "--------------------------------------------------------------" From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 16:09:55 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C792C106567E; Thu, 23 Oct 2008 16:09:55 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 81CB08FC2B; Thu, 23 Oct 2008 16:09:55 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id BFB7B6D449; Thu, 23 Oct 2008 16:09:54 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id AA875844A7; Thu, 23 Oct 2008 18:09:54 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Sam Leffler References: <200810231553.m9NFrqQj060598@svn.freebsd.org> <4900A067.80003@freebsd.org> Date: Thu, 23 Oct 2008 18:09:54 +0200 In-Reply-To: <4900A067.80003@freebsd.org> (Sam Leffler's message of "Thu, 23 Oct 2008 09:03:51 -0700") Message-ID: <86fxmn1eel.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184205 - in head: . share/man/man9 sys/arm/arm sys/cam/scsi sys/compat/linux sys/contrib/altq/altq sys/contrib/ipfilter/netinet sys/dev/ar sys/dev/ce sys/dev/hwpmc sys/dev/lmc sys/dev/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 16:09:55 -0000 Sam Leffler writes: > I didn't see this discussed anywhere. You have now generated huge > gratuitous differences in net80211 against other code bases I > maintain. I suggest you look at ipfilter, for instance, which defines its own cross-platform malloc / free wrappers. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 16:20:54 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC879106566B; Thu, 23 Oct 2008 16:20:54 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 875918FC12; Thu, 23 Oct 2008 16:20:54 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id CB4536D44C; Thu, 23 Oct 2008 16:20:53 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id B8488844A7; Thu, 23 Oct 2008 18:20:53 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Sam Leffler References: <200810231553.m9NFrqQj060598@svn.freebsd.org> <4900A067.80003@freebsd.org> <86fxmn1eel.fsf@ds4.des.no> Date: Thu, 23 Oct 2008 18:20:53 +0200 In-Reply-To: <86fxmn1eel.fsf@ds4.des.no> ("Dag-Erling =?utf-8?Q?Sm=C3=B8rg?= =?utf-8?Q?rav=22's?= message of "Thu, 23 Oct 2008 18:09:54 +0200") Message-ID: <86bpxb1dwa.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184205 - in head: . share/man/man9 sys/arm/arm sys/cam/scsi sys/compat/linux sys/contrib/altq/altq sys/contrib/ipfilter/netinet sys/dev/ar sys/dev/ce sys/dev/hwpmc sys/dev/lmc sys/dev/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 16:20:54 -0000 Dag-Erling Sm=C3=B8rgrav writes: > Sam Leffler writes: > > I didn't see this discussed anywhere. You have now generated huge > > gratuitous differences in net80211 against other code bases I > > maintain. > I suggest you look at ipfilter, for instance, which defines its own > cross-platform malloc / free wrappers. This was actually intended as a constructive suggestion, not a brush-off. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 16:44:38 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52C851065674; Thu, 23 Oct 2008 16:44:38 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 10A178FC0C; Thu, 23 Oct 2008 16:44:37 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 5D2BE6D44C; Thu, 23 Oct 2008 16:44:36 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 4D59B84515; Thu, 23 Oct 2008 18:44:36 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: src-committers@freebsd.org References: <200810231553.m9NFrqQj060598@svn.freebsd.org> Date: Thu, 23 Oct 2008 18:44:36 +0200 In-Reply-To: <200810231553.m9NFrqQj060598@svn.freebsd.org> (Dag-Erling Smorgrav's message of "Thu, 23 Oct 2008 15:53:52 +0000 (UTC)") Message-ID: <861vy71csr.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r184205 - in head: . share/man/man9 sys/arm/arm sys/cam/scsi sys/compat/linux sys/contrib/altq/altq sys/contrib/ipfilter/netinet sys/dev/ar sys/dev/ce sys/dev/hwpmc sys/dev/lmc sys/dev/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 16:44:38 -0000 Dag-Erling Smorgrav writes: > Retire the MALLOC and FREE macros. They are an abomination unto style(9). The following one-liner can be used to convert existing code: find . -type f -name \*.c | xargs perl -p -i -e ' s/\bMALLOC(\s*\()([^,]+?),\s*([^,]+?),\s*/$2 =3D malloc$1/; s/\bFREE(\s*\()/free$1/; ' Or if you absolutely positively want the useless cast: find . -type f -name \*.c | xargs perl -p -i -e ' s/\bMALLOC(\s*\()([^,]+?),\s*([^,]+?),\s*/$2 =3D ($3)malloc$1/; s/\bFREE(\s*\()/free$1/; ' DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 18:30:07 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 068A11065670; Thu, 23 Oct 2008 18:30:07 +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 E8FC88FC2B; Thu, 23 Oct 2008 18:30:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9NIU6Kr063528; Thu, 23 Oct 2008 18:30:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9NIU6Pm063527; Thu, 23 Oct 2008 18:30:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810231830.m9NIU6Pm063527@svn.freebsd.org> From: Alexander Motin Date: Thu, 23 Oct 2008 18:30: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: r184207 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 18:30:07 -0000 Author: mav Date: Thu Oct 23 18:30:06 2008 New Revision: 184207 URL: http://svn.freebsd.org/changeset/base/184207 Log: Add Intel ICH10 and SCH HDA controllers PCI IDs. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Thu Oct 23 16:06:49 2008 (r184206) +++ head/sys/dev/sound/pci/hda/hdac.c Thu Oct 23 18:30:06 2008 (r184207) @@ -148,6 +148,8 @@ SND_DECLARE_FILE("$FreeBSD$"); #define HDA_INTEL_82801G HDA_MODEL_CONSTRUCT(INTEL, 0x27d8) #define HDA_INTEL_82801H HDA_MODEL_CONSTRUCT(INTEL, 0x284b) #define HDA_INTEL_82801I HDA_MODEL_CONSTRUCT(INTEL, 0x293e) +#define HDA_INTEL_82801J HDA_MODEL_CONSTRUCT(INTEL, 0x3a3e) +#define HDA_INTEL_SCH HDA_MODEL_CONSTRUCT(INTEL, 0x811b) #define HDA_INTEL_ALL HDA_MODEL_CONSTRUCT(INTEL, 0xffff) /* Nvidia */ @@ -450,6 +452,8 @@ static const struct { { HDA_INTEL_82801G, "Intel 82801G" }, { HDA_INTEL_82801H, "Intel 82801H" }, { HDA_INTEL_82801I, "Intel 82801I" }, + { HDA_INTEL_82801J, "Intel 82801J" }, + { HDA_INTEL_SCH, "Intel SCH" }, { HDA_NVIDIA_MCP51, "NVidia MCP51" }, { HDA_NVIDIA_MCP55, "NVidia MCP55" }, { HDA_NVIDIA_MCP61_1, "NVidia MCP61" }, From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 19:01:48 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F2C0106567B; Thu, 23 Oct 2008 19:01:48 +0000 (UTC) (envelope-from jh@saunalahti.fi) Received: from emh03.mail.saunalahti.fi (emh03.mail.saunalahti.fi [62.142.5.109]) by mx1.freebsd.org (Postfix) with ESMTP id B8D608FC1D; Thu, 23 Oct 2008 19:01:47 +0000 (UTC) (envelope-from jh@saunalahti.fi) Received: from saunalahti-vams (vs3-10.mail.saunalahti.fi [62.142.5.94]) by emh03-2.mail.saunalahti.fi (Postfix) with SMTP id 97DA2EC661; Thu, 23 Oct 2008 21:46:26 +0300 (EEST) Received: from emh02.mail.saunalahti.fi ([62.142.5.108]) by vs3-10.mail.saunalahti.fi ([62.142.5.94]) with SMTP (gateway) id A02D3B892E1; Thu, 23 Oct 2008 21:46:26 +0300 Received: from ws64.jh.dy.fi (a91-153-122-179.elisa-laajakaista.fi [91.153.122.179]) by emh02.mail.saunalahti.fi (Postfix) with SMTP id D37832BD52; Thu, 23 Oct 2008 21:46:21 +0300 (EEST) Date: Thu, 23 Oct 2008 21:46:21 +0300 From: Jaakko Heinonen To: Dag-Erling Smorgrav Message-ID: <20081023184621.GA32081@ws64.jh.dy.fi> References: <200810231553.m9NFrqQj060598@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200810231553.m9NFrqQj060598@svn.freebsd.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Antivirus: VAMS Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184205 - in head: . share/man/man9 sys/arm/arm sys/cam/scsi sys/compat/linux sys/contrib/altq/altq sys/contrib/ipfilter/netinet sys/dev/ar sys/dev/ce sys/dev/hwpmc sys/dev/lmc sys/dev/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 19:01:48 -0000 Hi, On 2008-10-23, Dag-Erling Smorgrav wrote: > Log: > Retire the MALLOC and FREE macros. They are an abomination unto style(9). This change introduces some bad formatting. Many statements would now fit to 80 columns and don't need to be wrapped. > - MALLOC(softc, struct targ_softc *, sizeof(*softc), M_TARG, > + softc = malloc(sizeof(*softc), M_TARG, > M_WAITOK | M_ZERO); . > - MALLOC(descr, struct targ_cmd_descr *, sizeof(*descr), M_TARG, > + descr = malloc(sizeof(*descr), M_TARG, > M_WAITOK); . > - MALLOC(de, struct device_element *, sizeof(*de), > + de = malloc(sizeof(*de), > M_LINUX, M_WAITOK); There are also places with unnecessary white space: > + cl->cl_rsc = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); . > + cl->cl_fsc = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); . > + cl->cl_usc = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); . > + rsc_tmp = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); > + usc_tmp = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); . . . -- Jaakko From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 19:11:44 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97B481065679; Thu, 23 Oct 2008 19:11:44 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86BC58FC0A; Thu, 23 Oct 2008 19:11:44 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9NJBiDm064281; Thu, 23 Oct 2008 19:11:44 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9NJBisd064280; Thu, 23 Oct 2008 19:11:44 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200810231911.m9NJBisd064280@svn.freebsd.org> From: Ed Schouten Date: Thu, 23 Oct 2008 19:11: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: r184208 - head/sys/dev/uart X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 19:11:44 -0000 Author: ed Date: Thu Oct 23 19:11:44 2008 New Revision: 184208 URL: http://svn.freebsd.org/changeset/base/184208 Log: Fix detaching of uart(4) devices. With our new TTY layer we use a two step device destruction procedure. The TTY first gets abandoned by the device driver. When the TTY layer notices all threads have left the TTY layer, it deallocates the TTY. This means that the device unit number should not be reused before a callback from the TTY layer to the device driver has been made. newbus doesn't seem to support this concept (yet), so right now just add a destructor with a big comment in it. It's not ideal, but at least it's better than panicing. Reported by: rnoland Modified: head/sys/dev/uart/uart_tty.c Modified: head/sys/dev/uart/uart_tty.c ============================================================================== --- head/sys/dev/uart/uart_tty.c Thu Oct 23 18:30:06 2008 (r184207) +++ head/sys/dev/uart/uart_tty.c Thu Oct 23 19:11:44 2008 (r184208) @@ -327,6 +327,18 @@ uart_tty_intr(void *arg) tty_unlock(tp); } +static void +uart_tty_free(void *arg) +{ + + /* + * XXX: uart(4) could reuse the device unit number before it is + * being freed by the TTY layer. We should use this hook to free + * the device unit number, but unfortunately newbus does not + * seem to support such a construct. + */ +} + static struct ttydevsw uart_tty_class = { .tsw_flags = TF_INITLOCK|TF_CALLOUT, .tsw_open = uart_tty_open, @@ -335,6 +347,7 @@ static struct ttydevsw uart_tty_class = .tsw_ioctl = uart_tty_ioctl, .tsw_param = uart_tty_param, .tsw_modem = uart_tty_modem, + .tsw_free = uart_tty_free, }; int From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 19:12:51 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A69D1065672; Thu, 23 Oct 2008 19:12:51 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 564238FC12; Thu, 23 Oct 2008 19:12:51 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 8669F6D44C; Thu, 23 Oct 2008 19:12:50 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 7E72F844A7; Thu, 23 Oct 2008 21:12:50 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Jaakko Heinonen References: <200810231553.m9NFrqQj060598@svn.freebsd.org> <20081023184621.GA32081@ws64.jh.dy.fi> Date: Thu, 23 Oct 2008 21:12:49 +0200 In-Reply-To: <20081023184621.GA32081@ws64.jh.dy.fi> (Jaakko Heinonen's message of "Thu, 23 Oct 2008 21:46:21 +0300") Message-ID: <86ej27xgzy.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184205 - in head: . share/man/man9 sys/arm/arm sys/cam/scsi sys/compat/linux sys/contrib/altq/altq sys/contrib/ipfilter/netinet sys/dev/ar sys/dev/ce sys/dev/hwpmc sys/dev/lmc sys/dev/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 19:12:51 -0000 Jaakko Heinonen writes: > This change introduces some bad formatting. Many statements would now > fit to 80 columns and don't need to be wrapped. You're right, and I'd appreciate a patch, if you feel like it - but not right away, as I'm about to revert the net80211 parts of the commit. > There are also places with unnecessary white space: They were already broken, and I didn't want to mix style changes with code changes. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 19:16:57 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBD2B1065670; Thu, 23 Oct 2008 19:16:57 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB0708FC12; Thu, 23 Oct 2008 19:16:57 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9NJGvXq064465; Thu, 23 Oct 2008 19:16:57 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9NJGvht064463; Thu, 23 Oct 2008 19:16:57 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200810231916.m9NJGvht064463@svn.freebsd.org> From: Ed Schouten Date: Thu, 23 Oct 2008 19:16:57 +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: r184209 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 19:16:58 -0000 Author: ed Date: Thu Oct 23 19:16:57 2008 New Revision: 184209 URL: http://svn.freebsd.org/changeset/base/184209 Log: Don't include inside ucom(4) and ufoma(4). After being ported to the MPSAFE TTY layer, these drivers do not use clists anymore. Don't include their header files. Modified: head/sys/dev/usb/ucom.c head/sys/dev/usb/ufoma.c Modified: head/sys/dev/usb/ucom.c ============================================================================== --- head/sys/dev/usb/ucom.c Thu Oct 23 19:11:44 2008 (r184208) +++ head/sys/dev/usb/ucom.c Thu Oct 23 19:16:57 2008 (r184209) @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/dev/usb/ufoma.c ============================================================================== --- head/sys/dev/usb/ufoma.c Thu Oct 23 19:11:44 2008 (r184208) +++ head/sys/dev/usb/ufoma.c Thu Oct 23 19:16:57 2008 (r184209) @@ -88,7 +88,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 19:57:14 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A388106567D; Thu, 23 Oct 2008 19:57:14 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2725E8FC21; Thu, 23 Oct 2008 19:57:14 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9NJvE0D065209; Thu, 23 Oct 2008 19:57:14 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9NJvDf1065194; Thu, 23 Oct 2008 19:57:13 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810231957.m9NJvDf1065194@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 23 Oct 2008 19:57: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: r184210 - in head/sys: net80211 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 19:57:14 -0000 Author: des Date: Thu Oct 23 19:57:13 2008 New Revision: 184210 URL: http://svn.freebsd.org/changeset/base/184210 Log: Revert the removal of the MALLOC and FREE macros from the net80211 code. Requested by: sam Modified: head/sys/net80211/ieee80211_acl.c head/sys/net80211/ieee80211_crypto_ccmp.c head/sys/net80211/ieee80211_crypto_tkip.c head/sys/net80211/ieee80211_crypto_wep.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_input.c head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_node.c head/sys/net80211/ieee80211_power.c head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_scan.c head/sys/net80211/ieee80211_scan_sta.c head/sys/net80211/ieee80211_sta.c head/sys/sys/malloc.h Modified: head/sys/net80211/ieee80211_acl.c ============================================================================== --- head/sys/net80211/ieee80211_acl.c Thu Oct 23 19:16:57 2008 (r184209) +++ head/sys/net80211/ieee80211_acl.c Thu Oct 23 19:57:13 2008 (r184210) @@ -99,7 +99,7 @@ acl_attach(struct ieee80211vap *vap) { struct aclstate *as; - as = malloc(sizeof(struct aclstate), + MALLOC(as, struct aclstate *, sizeof(struct aclstate), M_80211_ACL, M_NOWAIT | M_ZERO); if (as == NULL) return 0; @@ -123,7 +123,7 @@ acl_detach(struct ieee80211vap *vap) acl_free_all(vap); vap->iv_as = NULL; ACL_LOCK_DESTROY(as); - free(as, M_80211_ACL); + FREE(as, M_80211_ACL); } static __inline struct acl * @@ -147,7 +147,7 @@ _acl_free(struct aclstate *as, struct ac TAILQ_REMOVE(&as->as_list, acl, acl_list); LIST_REMOVE(acl, acl_hash); - free(acl, M_80211_ACL); + FREE(acl, M_80211_ACL); as->as_nacls--; } @@ -175,7 +175,7 @@ acl_add(struct ieee80211vap *vap, const struct acl *acl, *new; int hash; - new = malloc(sizeof(struct acl), M_80211_ACL, M_NOWAIT | M_ZERO); + MALLOC(new, struct acl *, sizeof(struct acl), M_80211_ACL, M_NOWAIT | M_ZERO); if (new == NULL) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_ACL, "ACL: add %s failed, no memory\n", ether_sprintf(mac)); @@ -188,7 +188,7 @@ acl_add(struct ieee80211vap *vap, const LIST_FOREACH(acl, &as->as_hash[hash], acl_hash) { if (IEEE80211_ADDR_EQ(acl->acl_macaddr, mac)) { ACL_UNLOCK(as); - free(new, M_80211_ACL); + FREE(new, M_80211_ACL); IEEE80211_DPRINTF(vap, IEEE80211_MSG_ACL, "ACL: add %s failed, already present\n", ether_sprintf(mac)); @@ -301,7 +301,7 @@ acl_getioctl(struct ieee80211vap *vap, s ireq->i_len = space; /* return required space */ return 0; /* NB: must not error */ } - ap = malloc(space, + MALLOC(ap, struct ieee80211req_maclist *, space, M_TEMP, M_NOWAIT); if (ap == NULL) return ENOMEM; @@ -317,7 +317,7 @@ acl_getioctl(struct ieee80211vap *vap, s ireq->i_len = space; } else error = copyout(ap, ireq->i_data, ireq->i_len); - free(ap, M_TEMP); + FREE(ap, M_TEMP); return error; } return EINVAL; Modified: head/sys/net80211/ieee80211_crypto_ccmp.c ============================================================================== --- head/sys/net80211/ieee80211_crypto_ccmp.c Thu Oct 23 19:16:57 2008 (r184209) +++ head/sys/net80211/ieee80211_crypto_ccmp.c Thu Oct 23 19:57:13 2008 (r184210) @@ -96,7 +96,7 @@ ccmp_attach(struct ieee80211vap *vap, st { struct ccmp_ctx *ctx; - ctx = malloc(sizeof(struct ccmp_ctx), + MALLOC(ctx, struct ccmp_ctx *, sizeof(struct ccmp_ctx), M_80211_CRYPTO, M_NOWAIT | M_ZERO); if (ctx == NULL) { vap->iv_stats.is_crypto_nomem++; @@ -113,7 +113,7 @@ ccmp_detach(struct ieee80211_key *k) { struct ccmp_ctx *ctx = k->wk_private; - free(ctx, M_80211_CRYPTO); + FREE(ctx, M_80211_CRYPTO); KASSERT(nrefs > 0, ("imbalanced attach/detach")); nrefs--; /* NB: we assume caller locking */ } Modified: head/sys/net80211/ieee80211_crypto_tkip.c ============================================================================== --- head/sys/net80211/ieee80211_crypto_tkip.c Thu Oct 23 19:16:57 2008 (r184209) +++ head/sys/net80211/ieee80211_crypto_tkip.c Thu Oct 23 19:57:13 2008 (r184210) @@ -109,7 +109,7 @@ tkip_attach(struct ieee80211vap *vap, st { struct tkip_ctx *ctx; - ctx = malloc(sizeof(struct tkip_ctx), + MALLOC(ctx, struct tkip_ctx *, sizeof(struct tkip_ctx), M_80211_CRYPTO, M_NOWAIT | M_ZERO); if (ctx == NULL) { vap->iv_stats.is_crypto_nomem++; @@ -126,7 +126,7 @@ tkip_detach(struct ieee80211_key *k) { struct tkip_ctx *ctx = k->wk_private; - free(ctx, M_80211_CRYPTO); + FREE(ctx, M_80211_CRYPTO); KASSERT(nrefs > 0, ("imbalanced attach/detach")); nrefs--; /* NB: we assume caller locking */ } Modified: head/sys/net80211/ieee80211_crypto_wep.c ============================================================================== --- head/sys/net80211/ieee80211_crypto_wep.c Thu Oct 23 19:16:57 2008 (r184209) +++ head/sys/net80211/ieee80211_crypto_wep.c Thu Oct 23 19:57:13 2008 (r184210) @@ -87,7 +87,7 @@ wep_attach(struct ieee80211vap *vap, str { struct wep_ctx *ctx; - ctx = malloc(sizeof(struct wep_ctx), + MALLOC(ctx, struct wep_ctx *, sizeof(struct wep_ctx), M_80211_CRYPTO, M_NOWAIT | M_ZERO); if (ctx == NULL) { vap->iv_stats.is_crypto_nomem++; @@ -106,7 +106,7 @@ wep_detach(struct ieee80211_key *k) { struct wep_ctx *ctx = k->wk_private; - free(ctx, M_80211_CRYPTO); + FREE(ctx, M_80211_CRYPTO); KASSERT(nrefs > 0, ("imbalanced attach/detach")); nrefs--; /* NB: we assume caller locking */ } Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Thu Oct 23 19:16:57 2008 (r184209) +++ head/sys/net80211/ieee80211_freebsd.c Thu Oct 23 19:57:13 2008 (r184210) @@ -234,7 +234,7 @@ ieee80211_sysctl_vattach(struct ieee8021 struct sysctl_oid *oid; char num[14]; /* sufficient for 32 bits */ - ctx = malloc(sizeof(struct sysctl_ctx_list), + MALLOC(ctx, struct sysctl_ctx_list *, sizeof(struct sysctl_ctx_list), M_DEVBUF, M_NOWAIT | M_ZERO); if (ctx == NULL) { if_printf(ifp, "%s: cannot allocate sysctl context!\n", @@ -310,7 +310,7 @@ ieee80211_sysctl_vdetach(struct ieee8021 if (vap->iv_sysctl != NULL) { sysctl_ctx_free(vap->iv_sysctl); - free(vap->iv_sysctl, M_DEVBUF); + FREE(vap->iv_sysctl, M_DEVBUF); vap->iv_sysctl = NULL; } } Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Thu Oct 23 19:16:57 2008 (r184209) +++ head/sys/net80211/ieee80211_hostap.c Thu Oct 23 19:57:13 2008 (r184210) @@ -902,7 +902,7 @@ hostap_auth_open(struct ieee80211_node * * open auth is attempted. */ if (ni->ni_challenge != NULL) { - free(ni->ni_challenge, M_80211_NODE); + FREE(ni->ni_challenge, M_80211_NODE); ni->ni_challenge = NULL; } /* XXX hack to workaround calling convention */ @@ -1986,7 +1986,7 @@ hostap_recv_mgmt(struct ieee80211_node * return; /* discard challenge after association */ if (ni->ni_challenge != NULL) { - free(ni->ni_challenge, M_80211_NODE); + FREE(ni->ni_challenge, M_80211_NODE); ni->ni_challenge = NULL; } /* NB: 802.11 spec says to ignore station's privacy bit */ Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Thu Oct 23 19:16:57 2008 (r184209) +++ head/sys/net80211/ieee80211_input.c Thu Oct 23 19:57:13 2008 (r184210) @@ -499,7 +499,7 @@ int ieee80211_alloc_challenge(struct ieee80211_node *ni) { if (ni->ni_challenge == NULL) - ni->ni_challenge = malloc(IEEE80211_CHALLENGE_LEN, + MALLOC(ni->ni_challenge, uint32_t*, IEEE80211_CHALLENGE_LEN, M_80211_NODE, M_NOWAIT); if (ni->ni_challenge == NULL) { IEEE80211_NOTE(ni->ni_vap, Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Thu Oct 23 19:16:57 2008 (r184209) +++ head/sys/net80211/ieee80211_ioctl.c Thu Oct 23 19:57:13 2008 (r184210) @@ -320,14 +320,14 @@ ieee80211_ioctl_getscanresults(struct ie space = req.space; /* XXX M_WAITOK after driver lock released */ - p = malloc(space, M_TEMP, M_NOWAIT | M_ZERO); + MALLOC(p, void *, space, M_TEMP, M_NOWAIT | M_ZERO); if (p == NULL) return ENOMEM; req.sr = p; ieee80211_scan_iterate(vap, get_scan_result, &req); ireq->i_len = space - req.space; error = copyout(p, ireq->i_data, ireq->i_len); - free(p, M_TEMP); + FREE(p, M_TEMP); } else ireq->i_len = 0; @@ -467,7 +467,7 @@ getstainfo_common(struct ieee80211vap *v if (req.space > 0) { space = req.space; /* XXX M_WAITOK after driver lock released */ - p = malloc(space, M_TEMP, M_NOWAIT | M_ZERO); + MALLOC(p, void *, space, M_TEMP, M_NOWAIT | M_ZERO); if (p == NULL) { error = ENOMEM; goto bad; @@ -479,7 +479,7 @@ getstainfo_common(struct ieee80211vap *v get_sta_info(&req, ni); ireq->i_len = space - req.space; error = copyout(p, (uint8_t *) ireq->i_data+off, ireq->i_len); - free(p, M_TEMP); + FREE(p, M_TEMP); } else ireq->i_len = 0; bad: @@ -696,7 +696,8 @@ ieee80211_ioctl_getdevcaps(struct ieee80 if (ireq->i_len != sizeof(struct ieee80211_devcaps_req)) return EINVAL; - dc = malloc( sizeof(struct ieee80211_devcaps_req), M_TEMP, M_NOWAIT | M_ZERO); + MALLOC(dc, struct ieee80211_devcaps_req *, + sizeof(struct ieee80211_devcaps_req), M_TEMP, M_NOWAIT | M_ZERO); if (dc == NULL) return ENOMEM; dc->dc_drivercaps = ic->ic_caps; @@ -706,7 +707,7 @@ ieee80211_ioctl_getdevcaps(struct ieee80 ic->ic_getradiocaps(ic, &ci->ic_nchans, ci->ic_chans); ieee80211_sort_channels(ci->ic_chans, ci->ic_nchans); error = copyout(dc, ireq->i_data, sizeof(*dc)); - free(dc, M_TEMP); + FREE(dc, M_TEMP); return error; } @@ -1992,13 +1993,14 @@ ieee80211_ioctl_setregdomain(struct ieee if (ireq->i_len != sizeof(struct ieee80211_regdomain_req)) return EINVAL; - reg = malloc( sizeof(struct ieee80211_regdomain_req), M_TEMP, M_NOWAIT); + MALLOC(reg, struct ieee80211_regdomain_req *, + sizeof(struct ieee80211_regdomain_req), M_TEMP, M_NOWAIT); if (reg == NULL) return ENOMEM; error = copyin(ireq->i_data, reg, sizeof(*reg)); if (error == 0) error = ieee80211_setregdomain(vap, reg); - free(reg, M_TEMP); + FREE(reg, M_TEMP); return (error == 0 ? ENETRESET : error); } @@ -2137,7 +2139,7 @@ setappie(struct ieee80211_appie **aie, c if (ireq->i_len == 0) { /* delete any existing ie */ if (app != NULL) { *aie = NULL; /* XXX racey */ - free(app, M_80211_NODE_IE); + FREE(app, M_80211_NODE_IE); } return 0; } @@ -2151,19 +2153,20 @@ setappie(struct ieee80211_appie **aie, c * * XXX bad bad bad */ - napp = malloc( sizeof(struct ieee80211_appie) + ireq->i_len, M_80211_NODE_IE, M_NOWAIT); + MALLOC(napp, struct ieee80211_appie *, + sizeof(struct ieee80211_appie) + ireq->i_len, M_80211_NODE_IE, M_NOWAIT); if (napp == NULL) return ENOMEM; /* XXX holding ic lock */ error = copyin(ireq->i_data, napp->ie_data, ireq->i_len); if (error) { - free(napp, M_80211_NODE_IE); + FREE(napp, M_80211_NODE_IE); return error; } napp->ie_len = ireq->i_len; *aie = napp; if (app != NULL) - free(app, M_80211_NODE_IE); + FREE(app, M_80211_NODE_IE); return 0; } Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Thu Oct 23 19:16:57 2008 (r184209) +++ head/sys/net80211/ieee80211_node.c Thu Oct 23 19:57:13 2008 (r184210) @@ -148,7 +148,8 @@ ieee80211_node_latevattach(struct ieee80 "WARNING: max aid too small, changed to %d\n", vap->iv_max_aid); } - vap->iv_aid_bitmap = malloc( howmany(vap->iv_max_aid, 32) * sizeof(uint32_t), + MALLOC(vap->iv_aid_bitmap, uint32_t *, + howmany(vap->iv_max_aid, 32) * sizeof(uint32_t), M_80211_NODE, M_NOWAIT | M_ZERO); if (vap->iv_aid_bitmap == NULL) { /* XXX no way to recover */ @@ -174,7 +175,7 @@ ieee80211_node_vdetach(struct ieee80211v vap->iv_bss = NULL; } if (vap->iv_aid_bitmap != NULL) { - free(vap->iv_aid_bitmap, M_80211_NODE); + FREE(vap->iv_aid_bitmap, M_80211_NODE); vap->iv_aid_bitmap = NULL; } } @@ -768,7 +769,7 @@ node_alloc(struct ieee80211vap *vap, con { struct ieee80211_node *ni; - ni = malloc(sizeof(struct ieee80211_node), + MALLOC(ni, struct ieee80211_node *, sizeof(struct ieee80211_node), M_80211_NODE, M_NOWAIT | M_ZERO); return ni; } @@ -786,11 +787,11 @@ ieee80211_ies_init(struct ieee80211_ies memset(ies, 0, offsetof(struct ieee80211_ies, data)); if (ies->data != NULL && ies->len != len) { /* data size changed */ - free(ies->data, M_80211_NODE_IE); + FREE(ies->data, M_80211_NODE_IE); ies->data = NULL; } if (ies->data == NULL) { - ies->data = malloc(len, M_80211_NODE_IE, M_NOWAIT); + MALLOC(ies->data, uint8_t *, len, M_80211_NODE_IE, M_NOWAIT); if (ies->data == NULL) { ies->len = 0; /* NB: pointers have already been zero'd above */ @@ -809,7 +810,7 @@ void ieee80211_ies_cleanup(struct ieee80211_ies *ies) { if (ies->data != NULL) - free(ies->data, M_80211_NODE_IE); + FREE(ies->data, M_80211_NODE_IE); } /* @@ -889,7 +890,7 @@ node_cleanup(struct ieee80211_node *ni) ni->ni_associd = 0; if (ni->ni_challenge != NULL) { - free(ni->ni_challenge, M_80211_NODE); + FREE(ni->ni_challenge, M_80211_NODE); ni->ni_challenge = NULL; } /* @@ -925,7 +926,7 @@ node_free(struct ieee80211_node *ni) ieee80211_ies_cleanup(&ni->ni_ies); IEEE80211_NODE_SAVEQ_DESTROY(ni); IEEE80211_NODE_WDSQ_DESTROY(ni); - free(ni, M_80211_NODE); + FREE(ni, M_80211_NODE); } static void @@ -1777,7 +1778,8 @@ ieee80211_node_table_init(struct ieee802 nt->nt_inact_init = inact; nt->nt_keyixmax = keyixmax; if (nt->nt_keyixmax > 0) { - nt->nt_keyixmap = malloc( keyixmax * sizeof(struct ieee80211_node *), + MALLOC(nt->nt_keyixmap, struct ieee80211_node **, + keyixmax * sizeof(struct ieee80211_node *), M_80211_NODE, M_NOWAIT | M_ZERO); if (nt->nt_keyixmap == NULL) if_printf(ic->ic_ifp, @@ -1837,7 +1839,7 @@ ieee80211_node_table_cleanup(struct ieee printf("%s: %s[%u] still active\n", __func__, nt->nt_name, i); #endif - free(nt->nt_keyixmap, M_80211_NODE); + FREE(nt->nt_keyixmap, M_80211_NODE); nt->nt_keyixmap = NULL; } IEEE80211_NODE_ITERATE_LOCK_DESTROY(nt); Modified: head/sys/net80211/ieee80211_power.c ============================================================================== --- head/sys/net80211/ieee80211_power.c Thu Oct 23 19:16:57 2008 (r184209) +++ head/sys/net80211/ieee80211_power.c Thu Oct 23 19:57:13 2008 (r184210) @@ -80,7 +80,7 @@ ieee80211_power_latevattach(struct ieee8 */ if (vap->iv_opmode == IEEE80211_M_HOSTAP) { vap->iv_tim_len = howmany(vap->iv_max_aid,8) * sizeof(uint8_t); - vap->iv_tim_bitmap = malloc(vap->iv_tim_len, + MALLOC(vap->iv_tim_bitmap, uint8_t *, vap->iv_tim_len, M_80211_POWER, M_NOWAIT | M_ZERO); if (vap->iv_tim_bitmap == NULL) { printf("%s: no memory for TIM bitmap!\n", __func__); @@ -94,7 +94,7 @@ void ieee80211_power_vdetach(struct ieee80211vap *vap) { if (vap->iv_tim_bitmap != NULL) { - free(vap->iv_tim_bitmap, M_80211_POWER); + FREE(vap->iv_tim_bitmap, M_80211_POWER); vap->iv_tim_bitmap = NULL; } } Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Thu Oct 23 19:16:57 2008 (r184209) +++ head/sys/net80211/ieee80211_proto.c Thu Oct 23 19:57:13 2008 (r184210) @@ -214,7 +214,7 @@ ieee80211_proto_vdetach(struct ieee80211 { #define FREEAPPIE(ie) do { \ if (ie != NULL) \ - free(ie, M_80211_NODE_IE); \ + FREE(ie, M_80211_NODE_IE); \ } while (0) /* * Detach operating mode module. Modified: head/sys/net80211/ieee80211_scan.c ============================================================================== --- head/sys/net80211/ieee80211_scan.c Thu Oct 23 19:16:57 2008 (r184209) +++ head/sys/net80211/ieee80211_scan.c Thu Oct 23 19:57:13 2008 (r184210) @@ -96,7 +96,7 @@ ieee80211_scan_attach(struct ieee80211co { struct scan_state *ss; - ss = malloc(sizeof(struct scan_state), + MALLOC(ss, struct scan_state *, sizeof(struct scan_state), M_80211_SCAN, M_NOWAIT | M_ZERO); if (ss == NULL) { ic->ic_scan = NULL; @@ -122,7 +122,7 @@ ieee80211_scan_detach(struct ieee80211co } ic->ic_flags &= ~IEEE80211_F_SCAN; ic->ic_scan = NULL; - free(SCAN_PRIVATE(ss), M_80211_SCAN); + FREE(SCAN_PRIVATE(ss), M_80211_SCAN); } } Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Thu Oct 23 19:16:57 2008 (r184209) +++ head/sys/net80211/ieee80211_scan_sta.c Thu Oct 23 19:57:13 2008 (r184210) @@ -138,7 +138,7 @@ sta_attach(struct ieee80211_scan_state * { struct sta_table *st; - st = malloc(sizeof(struct sta_table), + MALLOC(st, struct sta_table *, sizeof(struct sta_table), M_80211_SCAN, M_NOWAIT | M_ZERO); if (st == NULL) return 0; @@ -162,7 +162,7 @@ sta_detach(struct ieee80211_scan_state * sta_flush_table(st); mtx_destroy(&st->st_lock); mtx_destroy(&st->st_scanlock); - free(st, M_80211_SCAN); + FREE(st, M_80211_SCAN); KASSERT(nrefs > 0, ("imbalanced attach/detach")); nrefs--; /* NB: we assume caller locking */ } @@ -196,7 +196,7 @@ sta_flush_table(struct sta_table *st) TAILQ_REMOVE(&st->st_entry, se, se_list); LIST_REMOVE(se, se_hash); ieee80211_ies_cleanup(&se->base.se_ies); - free(se, M_80211_SCAN); + FREE(se, M_80211_SCAN); } memset(st->st_maxrssi, 0, sizeof(st->st_maxrssi)); } @@ -229,7 +229,7 @@ sta_add(struct ieee80211_scan_state *ss, LIST_FOREACH(se, &st->st_hash[hash], se_hash) if (IEEE80211_ADDR_EQ(se->base.se_macaddr, macaddr)) goto found; - se = malloc(sizeof(struct sta_entry), + MALLOC(se, struct sta_entry *, sizeof(struct sta_entry), M_80211_SCAN, M_NOWAIT | M_ZERO); if (se == NULL) { mtx_unlock(&st->st_lock); @@ -1439,7 +1439,7 @@ adhoc_age(struct ieee80211_scan_state *s TAILQ_REMOVE(&st->st_entry, se, se_list); LIST_REMOVE(se, se_hash); ieee80211_ies_cleanup(&se->base.se_ies); - free(se, M_80211_SCAN); + FREE(se, M_80211_SCAN); } } mtx_unlock(&st->st_lock); Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Thu Oct 23 19:16:57 2008 (r184209) +++ head/sys/net80211/ieee80211_sta.c Thu Oct 23 19:57:13 2008 (r184210) @@ -1013,7 +1013,7 @@ sta_auth_shared(struct ieee80211_node *n switch (seq) { case IEEE80211_AUTH_SHARED_PASS: if (ni->ni_challenge != NULL) { - free(ni->ni_challenge, M_80211_NODE); + FREE(ni->ni_challenge, M_80211_NODE); ni->ni_challenge = NULL; } if (status != 0) { Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Thu Oct 23 19:16:57 2008 (r184209) +++ head/sys/sys/malloc.h Thu Oct 23 19:57:13 2008 (r184210) @@ -167,6 +167,13 @@ MALLOC_DECLARE(M_IP6OPT); /* for INET6 * MALLOC_DECLARE(M_IP6NDP); /* for INET6 */ /* + * Deprecated macro versions of not-quite-malloc() and free(). + */ +#define MALLOC(space, cast, size, type, flags) \ + ((space) = (cast)malloc((u_long)(size), (type), (flags))) +#define FREE(addr, type) free((addr), (type)) + +/* * XXX this should be declared in , but that tends to fail * because is included in a header before the source file * has a chance to include to get MALLOC_DECLARE() defined. From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 20:07:08 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 773A01065670; Thu, 23 Oct 2008 20:07:08 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64A588FC19; Thu, 23 Oct 2008 20:07:08 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9NK78BY065699; Thu, 23 Oct 2008 20:07:08 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9NK78ZK065697; Thu, 23 Oct 2008 20:07:08 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <200810232007.m9NK78ZK065697@svn.freebsd.org> From: Andrew Gallatin Date: Thu, 23 Oct 2008 20:07:08 +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: r184211 - head/sys/dev/mxge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 20:07:08 -0000 Author: gallatin Date: Thu Oct 23 20:07:08 2008 New Revision: 184211 URL: http://svn.freebsd.org/changeset/base/184211 Log: Update to Myri10GE Firmware 1.4.36. This update fixes a transmit bug in the multi-queue (MSI-X) firmware which happens when RDMAs complete out of order, and provides improved support for the new Myri10GE NIC models (10G-PCIE-8Bx) Sponsored by: Myricom Inc. MFC after:3 days Modified: head/sys/dev/mxge/eth_z8e.h head/sys/dev/mxge/ethp_z8e.h head/sys/dev/mxge/rss_eth_z8e.h head/sys/dev/mxge/rss_ethp_z8e.h Modified: head/sys/dev/mxge/eth_z8e.h ============================================================================== --- head/sys/dev/mxge/eth_z8e.h Thu Oct 23 19:57:13 2008 (r184210) +++ head/sys/dev/mxge/eth_z8e.h Thu Oct 23 20:07:08 2008 (r184211) @@ -28,7045 +28,7074 @@ POSSIBILITY OF SUCH DAMAGE. $FreeBSD$ ***************************************************************************/ -static unsigned int eth_z8e_uncompressed_length = 369236; -static unsigned int eth_z8e_length = 112602; -static char eth_z8e[112602] = - "\x78\x9c\xec\xbd\x7f\x7c\x94\xc5\xb5\x3f\x7e\x76\xb3\xc0\x26\x0d" - "\x6c\xb4\x11\xb7\x88\xba\x28\xb6\xab\x82\x44\x8b\x35\x5a\xd4\x54" - "\xb0\xc5\xfb\x42\x08\x12\x35\xca\x8f\x84\x0a\xde\xa0\x08\x01\x02" - "\x2c\x18\xb2\x61\xc1\xdb\x84\xf2\x23\x2a\x6a\xd4\x40\x62\x4b\x6f" - "\xb1\x62\x4d\x5b\xda\x4b\x11\x75\x95\xf4\x96\x62\x92\x05\x4b\x7b" - "\x73\xef\x97\x5e\x57\x3e\x48\x73\xf9\x04\xdd\x92\x85\xac\xc9\xee" - "\xce\xf7\x7d\x66\x9e\x67\xf3\xec\xe6\xd9\x20\xf7\xde\xd7\xf7\xfb" - "\x4f\xf3\xe2\xe1\xd9\x99\x39\x73\xe6\x9c\x33\x67\xce\x9c\xf9\xf1" - "\xcc\x10\xfd\x0f\xfe\xac\x1f\x15\xff\x4f\xb2\xff\xfd\xef\xef\x7f" - "\x7f\xff\xfb\xfb\xdf\xdf\xff\xfe\xfe\xf7\xf7\xbf\xff\x7f\xfe\xce" - "\x5a\x6d\xf4\x41\x1d\x51\x8f\xcf\xee\x0c\x5a\xf2\xe8\xa5\xe7\x45" - "\x14\xd1\x96\x20\xd9\x9d\xfc\xd6\x1e\x7a\x0e\xf1\xd6\x3a\xb2\x5f" - "\x93\x43\xd9\x93\x77\x10\x6d\x1f\x29\xba\x9e\x7f\x51\x84\x36\xbc" - "\x28\xba\xa6\xfc\x84\xa8\x65\x2c\xd1\xf3\x23\x45\x18\x78\xe6\x04" - "\x69\x43\x11\xe3\xd9\x80\x30\xa7\x6f\x1c\x29\x42\x88\xaf\x40\x7c" - "\x2b\xc7\xaf\x1f\x09\x5c\xb9\x44\xbe\x17\x45\xc4\x80\xd7\xce\xf9" - "\x19\xe7\x94\x31\x92\x9e\x5d\x29\x78\x18\xc7\xbe\x20\x6d\x9c\x32" - "\x08\x8e\x6c\xce\x2f\x69\x43\x9e\x6e\x1f\x39\xc3\x56\xb2\x84\x7d" - "\xfe\xcb\x90\x37\x0c\x9e\xdc\x9c\x77\x1b\xd2\x85\x8f\x32\x18\x6f" - "\x20\x12\xa5\x96\x4a\x22\xc0\x92\xab\x8a\x2c\xa7\x28\xf3\x4e\xc0" - "\x5b\x36\xa8\xfc\x2e\xc4\x59\x65\x1c\xf0\x70\x1c\xa7\x21\x7e\x2c" - "\x87\x7b\x7c\x99\x53\x13\x38\x59\x16\x9c\x6e\xf5\x5b\x91\x6e\x41" - "\x3e\x1b\xf2\xad\x6c\x69\x22\x52\xb8\x72\x32\x83\x94\xd9\xa0\xe5" - "\xab\x46\xbe\x6a\xce\x77\x10\xe9\x93\x1b\x14\x8f\xb3\x1a\xc8\xca" - "\xe9\x2c\x5f\x94\x63\x05\xdc\x6e\x1d\xbf\xc2\x61\xbd\x4f\xe3\xe7" - "\x2b\x48\x6b\x49\x4e\xb3\x3d\xa7\xa5\x65\x23\x2d\x98\x9c\x06\x7c" - "\x2a\xed\x12\xa4\x45\xd3\xa4\x5d\xda\xe3\xcb\x72\x26\xa7\xbd\x9b" - "\xa7\xa5\x5d\x8e\xb4\x89\xc9\x69\x16\x3d\x9f\x13\x69\x85\x7a\x9a" - "\xb1\x5e\x8c\x7a\xb3\xc2\x29\xe2\xde\xaf\x91\x4d\x6c\xda\xdf\x14" - "\xf7\x09\x0a\x78\x22\xe4\x1a\x45\xde\x13\x94\xd5\x0c\x3c\xb4\x75" - "\x2d\xd9\xbd\xe5\x22\x12\xf0\x74\x51\x7b\xa8\x8b\xbc\x21\xd1\x19" - "\x88\x9e\xa3\xaa\x73\x64\x0f\x44\xcf\x50\xd5\x32\x72\xb6\x54\x7e" - "\x4a\x66\xf5\x1e\xb7\x0a\xf2\x8e\xe6\xbc\x27\xa9\xbd\xe1\x24\x79" - "\x1b\x92\xf3\x7a\xaf\x24\x67\x1b\xc2\xa8\x73\x47\x45\xbd\x88\xb7" - "\xb8\xa2\x14\xcd\xda\xdf\x54\xf9\x13\xb2\x79\xc7\x90\xb5\x6d\x81" - "\x9f\x5c\x5f\x67\x5a\xbe\xe2\x61\x5a\x36\x3e\x41\xf6\x1f\x3f\xee" - "\xb7\x8a\x4d\x1f\x34\xfd\xbc\x37\x62\xdd\x70\x9a\x6c\x07\x9d\x53" - "\xe8\xa0\xf3\x38\x05\xea\xef\xa4\x40\x38\x4a\x5b\x9f\xa0\xec\x83" - "\xe1\x49\x14\xd8\x18\x27\xc6\x17\x58\x3c\x09\xef\x73\x80\xe9\x22" - "\xd7\x72\xa2\x53\xf4\x95\xb2\xed\xc0\x13\x54\x38\x51\xe7\x5f\xa9" - "\x78\xbf\x9c\x64\xfb\xe2\x70\x1a\xfd\xcd\x79\x9e\x75\xd3\x2a\x75" - "\xa6\xab\x71\xa4\xe8\xbc\x76\x3b\xe5\x02\x3e\x07\xf9\xf7\x06\xad" - "\xbf\x2a\xd4\xf4\xb7\x73\xc2\x76\xca\xd9\x5b\x15\xb2\x41\xef\xba" - "\x1c\x1e\xe8\xdb\x5a\x1a\xe2\x88\x92\x05\x3c\xbc\xdc\x88\xb8\x6b" - "\x73\x65\x9e\xce\x20\x35\x6f\xe7\x3c\xe2\xf2\xd9\x7f\x8b\x5f\x3e" - "\x3b\x14\x7f\x69\xf6\x59\xf1\xd2\xec\xee\xd8\x4b\xb3\xc3\xde\x35" - "\x64\x8f\x5d\x3e\xfb\x5c\x7b\xb9\x94\x55\x4e\x7b\x39\x64\x15\x23" - "\xfb\xba\x33\x94\x33\x6f\x19\xea\x28\xfa\x17\x5a\xb7\x88\x9c\xf1" - "\xcc\xf7\x8b\x03\xd1\x3f\xd1\xbc\x4a\x12\xf8\x5d\x66\x46\x7b\x77" - "\xd6\x07\x41\xa5\x4b\x76\xb4\xdd\xec\x52\xd0\x5a\xce\xe5\x76\x67" - "\x1d\xd6\xe2\x99\x9e\x6c\x8f\x1e\x2f\xb2\x3e\xe0\x36\xe8\x1d\xb1" - "\xde\x42\x3b\x7b\x89\x26\xc4\xc9\x72\x9a\xb2\x37\x82\x97\x1c\x23" - "\xfe\x07\xee\x7d\xe8\x4e\xca\xbb\x7d\x7c\xde\x37\x6f\xcb\xff\x26" - "\xdd\xff\x9d\xc9\x77\x52\xe1\xc3\x0f\xe0\xbf\xe9\x77\x52\xf1\x77" - "\xef\xc3\x8f\xc9\x77\xde\x9c\xf7\xbd\xf1\x85\x93\xef\xbb\x77\x7c" - "\x3e\xcd\x2c\xba\x25\xef\x96\x5b\xe8\x3b\xf7\x4e\xbb\x39\x2f\x4f" - "\x7b\xdf\x9c\xc7\x40\x8f\xe6\xdf\x3b\x6b\x7c\xe1\xf2\xa5\x15\x4b" - "\xc7\x4f\xbf\x6f\x32\x8d\xc7\xbf\xfb\x68\xfc\xcc\x42\x3c\x34\xfe" - "\x01\x1a\x7f\xcb\x2c\xa3\x8d\xcb\x15\xab\xe2\x04\xf9\x87\x45\xdf" - "\x54\xe2\xfa\xf0\x57\x9d\x45\x9d\x0e\xff\x09\xe2\x42\x4a\xff\xb3" - "\x9b\xc0\x93\xad\xc7\x37\x7c\x1a\x78\x6a\x66\x9e\x5c\xd7\x70\xbd" - "\x8f\x70\x72\x9b\x46\xbd\x84\x99\xe7\x8c\x4a\x09\x53\xae\xd7\x9d" - "\xc8\xda\x7f\x28\xfc\x74\x99\xb4\x3d\x88\xaf\x09\x5a\xf7\x7a\x34" - "\xfb\x11\x6e\xa9\x2c\x20\xf1\xe3\xa9\x16\x9b\x4b\xda\x0f\x2e\x6f" - "\xe2\x76\xa6\xc1\x7e\x38\x84\xfa\xe5\xf0\x11\xbc\x33\x44\xcd\xe1" - "\xb0\x96\x7e\x54\x86\xad\x78\x32\x25\x4c\xc6\x29\xca\x39\xc4\x36" - "\xbb\x1f\x26\xe7\x10\x68\xfd\x09\xca\x0b\x81\xf6\x93\x28\x33\x8a" - "\x32\x9b\x35\x3d\x3a\xa9\xd1\x7c\x89\xcc\x63\x25\x6b\x10\xf0\xc0" - "\x15\xd6\x78\xfc\xb9\xe2\x71\x44\x5e\x0a\x8f\xc5\x48\xfb\x15\xd3" - "\xac\xf8\x1b\x81\xf6\xff\x95\x8d\x9c\x1e\xa4\xe1\x1e\xc6\xa5\x6c" - "\xa1\x4c\x5b\x9c\x92\xb7\x5e\xca\x47\xa5\x67\x65\x78\x24\x4c\x9d" - "\x2e\x1f\xce\x1f\xce\xec\xd0\x6c\x66\xf6\x3e\xc0\x64\x20\xbd\x39" - "\x05\x47\x2b\xd2\x0e\x70\xf9\xd0\xf9\x0c\xce\xd3\x98\xb0\xbf\x12" - "\x5f\x30\x19\xde\x51\x0e\xf8\xf7\xb7\x29\x9c\x01\xe8\x98\x0d\xb2" - "\xe8\x3a\xe8\xe1\x7e\xc6\x91\xad\xcb\x43\x83\x75\x41\x2f\xad\x8c" - "\x53\xd4\x4a\x39\x74\x21\xcf\x9f\x01\x37\x31\x05\x6e\x2a\xcb\x5d" - "\xc2\x65\x26\xe0\xfe\x13\x70\x73\x52\xe0\x0a\x00\x87\xfe\xd4\xe1" - "\x04\x5e\x9b\x46\xe3\x70\xc0\x6d\x4c\xa6\x31\x67\x17\xf2\x9f\xda" - "\xa6\x74\x6e\x04\x68\x1c\x81\xfa\x1b\x8f\xfc\xbf\x66\x3b\xa0\xf1" - "\xea\x00\x9f\x9d\xc0\xd1\x09\xd8\x08\xf0\xa0\x8f\x70\xb4\xa6\xf0" - "\x1a\x54\xe5\x49\xba\x42\x1a\x6c\x9f\x06\x1b\x49\x29\x33\x9b\x69" - "\xd2\x78\xd5\x61\xe3\x4a\xe6\x39\x63\x53\xf0\xfe\x3b\xf0\x0e\x51" - "\x30\xc3\xad\x0a\x5f\xce\xd4\x14\x7c\x43\x58\x76\x1a\xcc\x10\x0d" - "\x66\xb1\x09\x9e\x0c\x0d\xc6\xae\x95\x55\x67\x82\x67\x18\xd3\x15" - "\x52\x3c\xa0\xad\xe4\xec\x4d\x96\x2b\x68\xb6\xd2\x50\x9d\x4f\x33" - "\x9b\xd4\x67\xcd\x7d\x1f\xfd\xcd\xcf\xfa\xbc\x6e\x12\x35\xfb\xf7" - "\x8d\x27\xb2\x8e\xab\xa6\xcc\x40\xf4\x18\xcd\x88\x8a\x18\x9e\xbe" - "\xeb\x89\x2e\x09\x44\x5b\xe9\x1b\x44\x63\x02\xd1\xed\xb0\x79\x15" - "\x9c\xf6\xde\xb5\x64\xb1\xe0\xed\xbd\x81\xac\x96\x40\x74\x22\xe2" - "\x77\xd1\x58\xb2\x59\xbe\xfb\x8c\xe8\x09\x44\xa7\x20\xbc\x98\x4a" - "\x62\x94\x33\x6d\x88\xf0\xce\x88\x89\x8f\xbf\x3b\x24\x2e\x02\xd1" - "\x16\xc4\x2f\xa0\x19\xb1\x2f\xc4\x8c\x58\x0f\x9e\xcf\xf1\x7c\x8c" - "\xe7\x3d\x3c\x5e\x21\x6a\xf7\xef\xeb\x83\x2d\x04\x4d\x87\xfa\x44" - "\x19\xda\xf1\x7e\xb4\x4d\x12\xb0\x09\x1d\x81\xe8\x24\xe0\xb3\x12" - "\x60\x0e\xf5\xf5\x21\x6d\xd3\xfe\x7f\x93\x30\x59\xfb\xff\x2c\xc3" - "\x35\xfb\x3b\x85\x7d\x7f\xc7\xf8\x6a\x1a\xc6\xf4\xc7\xa1\xe7\x81" - "\x28\xfa\xa3\xe8\xa7\x34\x63\x4d\x48\x30\x0f\x23\xd6\x0b\xfc\x7e" - "\x4f\x8c\x08\x93\x63\xc6\x1a\xaf\x28\x89\x92\x5d\x64\x32\xee\x2e" - "\xc6\xdb\x09\x5c\x9f\x2a\x5c\x6f\xdb\x01\x1b\x62\x38\xc6\xa5\xe3" - "\x61\x1c\x0c\x3b\x23\x46\x0e\x51\xfb\xb6\xbd\xaf\x76\x7f\xa4\xaf" - "\xf6\x6d\x27\x9e\xa9\x22\xeb\xed\x47\xfb\x9e\x66\x39\xbe\x5d\x86" - "\xdf\x9e\x08\x7c\x1c\x29\xc7\x18\x0d\x03\x6c\x59\x8f\x8f\xa6\xf4" - "\x48\xba\xdf\xae\x97\x74\x6f\x7a\xfb\xa5\x88\xa4\xff\xed\x17\x15" - "\x3f\x6f\xbf\xc0\xf1\x61\x1f\x0d\xc1\xef\x7d\x61\x95\xf6\x2f\xc8" - "\x57\xd4\xa3\x68\xda\x27\xec\x6f\x1f\x8a\xc3\x2f\x83\x3c\xab\x59" - "\x96\x90\x6f\x35\xfb\x03\x2c\x53\x94\xb1\x4f\x64\xbe\x7d\x08\xb4" - "\x74\x20\xff\xe9\x3e\x01\x5a\xb2\xde\x8e\x44\x14\xee\x1e\xe0\x99" - "\xd3\xc3\x38\xed\x6f\x47\x44\xcd\x01\xfb\x17\x3e\x17\x64\x21\x22" - "\x33\xa2\xeb\xa3\x25\x6b\x28\xc3\x4d\xd5\xa0\x77\x07\xfc\x8e\xc5" - "\xc0\xb7\x91\xd3\x3e\x9e\xb1\x86\xbe\x8a\xb2\xde\x03\xde\x08\x97" - "\x27\x6a\x0f\xd8\x45\xd6\x81\x21\xc0\xb5\x80\x69\xea\xf5\x51\x0e" - "\xc2\xce\x5e\x49\xdf\x81\xfc\x78\xcd\x81\xe2\xb8\xfd\xc0\x54\xa3" - "\xfe\x28\x99\xb1\xde\xbc\xc9\x71\x39\xba\xae\xc4\x6a\x0e\xb8\x6f" - "\x24\xca\x99\x1e\x16\x51\xd6\x97\x09\x54\x6e\x69\x0f\xb7\x52\x49" - "\xd4\x4e\xed\xe5\x7b\xe9\x06\x62\xdf\x24\x4c\xed\xe1\xed\x08\x6f" - "\xc1\xbb\x82\xda\xba\x76\x11\xd3\x38\xbd\x3c\xbc\x3e\x66\x3f\xb0" - "\xbb\xad\xeb\x7e\x42\xfe\xf7\x40\x63\x7c\x5e\xb9\xad\xba\xbd\x3c" - "\xcc\x61\x6f\x5b\x17\x74\x34\x26\x62\xd1\x9a\x03\xce\xa8\xfd\xc0" - "\xbe\xe9\xe7\x44\xe8\xfe\xae\xea\x21\x88\xeb\x73\x58\x44\xd4\xe1" - "\xf1\x8a\xb6\xae\x8d\x34\xef\x1c\x59\xda\xca\xf6\x4a\x5d\x9d\x57" - "\x5e\x4e\x32\xff\xb9\xa8\x63\x6e\x57\x35\xcd\x2d\xa3\x11\x80\xff" - "\x9c\x75\x57\x8c\xa8\xa6\xd6\x93\x0b\xe8\xfe\x33\xd1\x8c\xe9\xe7" - "\xfa\x44\x6b\xe9\x76\x6a\x2b\xdb\xce\xf2\xc8\x67\xdf\xe0\xfe\x33" - "\xdd\x62\xfa\xb9\x1e\xd1\x56\xf6\x26\xb5\x96\xee\xa5\x69\x9f\xfa" - "\x1d\xb1\xda\x03\xee\x78\xe6\x81\xa9\xf1\xda\x03\xc5\xd1\xda\x03" - "\xce\x58\xe6\x81\xdd\xd1\xcc\x03\xfb\xc4\xa6\x77\xdc\x90\x5f\xa6" - "\xac\x8b\xac\x77\xbe\x8e\xdf\x2e\x59\xbf\xf6\x77\xf2\x45\xcd\x3b" - "\xc5\x7d\xb5\xef\x4c\x0d\x78\x26\x91\xc8\x7c\x27\x9f\x75\x5e\xd4" - "\xbe\x53\x0c\xb8\x62\xa5\x23\xef\x94\xb1\x8e\x00\xc6\x83\xa7\x06" - "\x4f\x3d\xe2\x3a\x81\xe3\x12\x0d\xdf\x5f\x19\x2e\x6e\x7f\xa7\x33" - "\x5e\xf3\x4e\x44\xd8\xdf\xb5\xb3\xbd\x99\xbe\x2c\x02\xf9\x41\x76" - "\x1e\xc8\x1d\x76\x23\xe0\x89\x21\x1c\xa3\x79\xcb\xc8\x1b\xf0\x1c" - "\xc7\xef\xe3\x24\xde\xad\xa3\xe9\xcb\xde\x13\x9c\x36\x7d\x99\x57" - "\x40\x36\x8e\x78\x26\xf0\xd4\x02\x4f\x26\xf0\x6c\x7a\xf7\x67\x11" - "\xd6\xa9\x9a\x77\x77\xdf\xff\x8c\x08\x09\xfb\x7b\xf6\xf8\x50\x92" - "\x6d\x23\xfe\xae\x10\xaa\x7d\x74\x41\x27\x47\x55\x97\x78\xa8\x49" - "\xd4\xbe\xbb\x5b\x64\xbe\x87\x7c\xef\xff\x83\xec\x7f\xa5\x8d\x79" - "\x7f\x6a\x5f\xed\xfb\x65\x78\x8a\xfb\xdb\x14\xb7\xbd\xf7\xa7\xa6" - "\xfa\xc5\x44\x36\x3c\x43\xec\x44\x43\xf1\x0c\xb3\xeb\x36\xab\xc7" - "\x77\x59\x43\x90\xfe\xd8\xc0\x76\x0e\xbf\xe1\xff\x1f\x2b\xd7\x7e" - "\xef\x0d\xd2\xfe\x43\xd2\x87\x80\x2d\x2b\xaf\xa2\xcb\x4e\xd3\xc8" - "\x32\xf0\x4b\xf8\x9d\x8d\xdf\x8b\x67\x5c\xff\x9e\x88\x6f\xb6\x1e" - "\x42\x9d\xf6\xb0\xad\x11\xbe\x89\xe8\xdf\xa8\xa0\xa7\xa7\xcc\x2e" - "\x7a\xdc\xd9\x22\xab\xf5\x26\xd1\xe7\x64\x1f\xcf\x81\xf0\x08\xc8" - "\x6e\x2c\xde\x97\xee\x38\x4f\xb9\x78\x9c\x3b\x7c\xf1\x6a\xee\xbb" - "\xf1\x3b\x4f\xac\x76\x66\x6d\x5d\x45\xe3\x1c\x61\xb2\x37\xfa\xe2" - "\xc5\x8e\xf5\x39\x84\xfe\x27\x97\x7f\x0b\xdf\xbb\x5d\x8d\xe7\xc9" - "\xc6\x7e\x67\x7c\x38\xca\xf3\x38\x84\x58\xe1\xa6\xc6\xe5\xc4\xf5" - "\xe1\x6c\xf4\x89\xe6\x58\x8f\xdb\xca\x74\xea\xb4\x30\x6d\xa0\xf3" - "\x4a\xd0\x59\xf9\xe0\x9a\x02\xfa\x1d\xfa\x5e\x33\x9b\xdd\xe3\x1b" - "\x99\xe0\x3f\x4d\xfa\x01\x5d\x26\x69\xd2\x8f\xeb\x72\x4a\xe3\x63" - "\xe7\x72\x5b\x8e\x9d\x17\xa1\x6d\x4b\x88\x65\xe1\xf4\x46\xc5\xff" - "\x81\x3d\xad\xae\x8a\xd1\x95\x33\xd6\x5c\x2d\x02\x21\xe1\x0f\x78" - "\xce\xc8\xf1\x6c\x23\x60\xaa\xa2\x22\xae\x8f\x2b\xb7\xa3\xff\x8d" - "\xd7\xb6\xe6\x88\xda\xd6\xec\xee\x55\x22\xba\x53\xfa\x54\x97\xc3" - "\xff\xc9\x3b\xa6\xea\xe6\x40\xfe\x56\xc4\x75\xdb\x5b\xb3\x81\xfb" - "\x12\xc6\xdd\x5e\x2e\xfc\xf1\xcc\xd6\x5c\xc0\x79\x82\xf4\xf1\x21" - "\xe3\x98\x16\x63\xe3\xae\x8d\xc0\x89\xb4\xed\x41\x1a\x3d\x60\x6c" - "\xab\x46\xdf\x84\x7a\x71\xf5\x0f\xda\x2d\x9a\xfa\xe8\x7f\x39\x78" - "\x0a\xcc\x93\x75\xbe\x41\xd7\xbe\x6e\xf8\xb1\xde\x75\x34\x1a\xf5" - "\x70\xc5\x69\x72\x66\x7a\x3d\xe2\x94\xf0\x5d\xde\xf4\xe3\xb5\x11" - "\xf4\xd3\xce\xdc\x20\xfd\xb4\x2c\x9d\xdc\x04\xdb\xbe\xf3\xf0\x43" - "\x56\x25\x64\xf6\xc9\x8c\x35\x71\xc1\xbf\xb9\x4d\x35\x22\x9e\xe5" - "\x01\x3c\x73\x74\x59\xa4\x91\xbf\x4d\xd4\xb4\xba\x94\x6f\xea\x3c" - "\x20\x30\x16\xf4\x5f\x15\xe5\xdf\xef\x28\xbf\xf5\x9d\xa9\xdd\xb0" - "\x15\x3c\x0e\x81\xaf\x13\xc6\xb8\x31\x02\x9c\xcd\x41\x72\xed\xd3" - "\xfd\xe4\x40\xf4\x5e\xb6\x1b\x53\xd3\xd7\xaf\x8e\xff\x8a\x3d\x1a" - "\xce\x62\x61\xef\x98\x52\xa5\xe8\x8e\x54\x85\x45\x27\xe3\x66\x9f" - "\xfe\x24\x60\x76\xa2\x1e\x44\x4d\x47\xfe\x56\x8e\x5b\xd5\xcb\x71" - "\x6f\x42\x8f\x85\xa2\xeb\x8a\x37\x21\xb7\xcb\xe1\x97\x85\xfc\x6b" - "\x7b\xe9\x54\x25\x65\xf0\xf8\xaa\xc7\xf7\xb5\x29\x41\xba\x53\xfa" - "\xee\xe8\xc3\x7f\xd6\x6d\x7d\xf0\x41\xc4\x15\x07\xe9\x2e\xa9\xbb" - "\xc8\x73\x19\xc2\x65\x09\x18\xe0\x40\xd8\x63\xc8\xf3\x60\xb7\xf5" - "\x86\x9f\x21\x6e\x73\x4a\x9e\x86\x94\x3c\x7b\xf4\x30\xe8\xeb\x72" - "\xad\x92\x7c\x3d\x85\xfc\x4d\x78\xaa\xb5\x72\x8f\xa4\xe0\x08\xa6" - "\xe0\x08\x0d\xa4\x75\x94\x2d\x39\xcf\xa8\xdc\xe4\x3c\xa3\xc6\x0e" - "\xa4\x75\x54\x7e\x4a\x9e\xa9\x29\x79\x8a\xf5\xb0\x36\xb7\x90\x87" - "\xb8\xc5\x29\x79\x2a\x53\xf2\x6c\x36\x84\xbf\x8a\x70\x82\x7f\xae" - "\x6b\xf8\x03\x82\xc7\x8f\xd0\x5b\xe8\x20\xf7\x19\xec\x0f\x9c\xa3" - "\x15\x95\x22\x02\x1d\xc8\x07\x7c\xab\x8e\x5f\xd7\x1d\x09\xaf\xf4" - "\xa7\x53\xe9\xcf\xa8\x50\x02\x06\x2e\x56\x8b\x2b\x4c\x90\x65\x27" - "\xcf\x03\x05\xc2\xf7\x92\x1a\x5b\x5d\x31\x91\x75\x4a\x2f\xd3\x51" - "\xa9\xf4\x86\xc7\xc8\x7a\x99\x41\xe8\x0a\xf7\x57\x06\xfd\x3c\xc9" - "\x65\xa9\x32\xae\x28\xd2\xcb\x00\xee\x93\xac\x3f\x72\x5e\x00\xf8" - "\xb5\x7c\x53\x95\xdc\xaf\xa8\x4c\x96\xc7\x15\x9b\x93\xe5\x71\x45" - "\x83\x51\x86\x6c\x23\x82\x34\xaa\x94\xf5\xd8\xb4\x5d\xda\x0f\xd8" - "\xbd\x5f\xd0\x55\xde\xb8\x38\x71\x8a\x46\xdf\x0c\xbd\xcf\xe0\xb7" - "\xf4\xa3\x22\xe0\xd7\x7e\xf4\x98\xf4\xa1\x2a\xcf\xa1\xcf\x95\xb0" - "\x5f\x05\xec\x49\xc0\x8c\xd1\x60\xc7\xa8\xb9\x2a\xf9\x1e\xc6\x6f" - "\xb1\xe9\xc0\x10\xd8\xa2\xfc\x90\x97\xfb\xed\x0e\xd2\xc3\x02\x61" - "\xf0\x12\x12\xb5\x47\x8f\x99\xd3\x82\x3e\x53\xd9\xd6\x2e\x94\x73" - "\x39\xdb\x08\xc8\xef\x6b\xb0\x33\x9f\x54\xad\xa3\xaf\xb2\x7d\x10" - "\x99\xad\xe3\x94\xbc\x47\x6f\x14\xbe\x6a\x0a\xa0\x37\x2c\x5f\x45" - "\x57\xc0\x9e\x8e\x3d\x4d\xa3\x5f\x2e\xa9\x74\x81\x56\x8c\x0f\x3f" - "\x23\x92\x7d\x47\x66\xab\x9b\xfb\xd1\xc6\xcf\x78\xac\x36\x7a\x9f" - "\x6e\x5b\xf0\xbb\x65\x30\x3b\x8f\xba\xab\x51\x73\x77\x57\xde\xcc" - "\x75\x74\x82\xae\x1c\xcd\xfc\xaa\x39\xbe\x2b\x87\x8b\xf3\x62\x8e" - "\x60\x5f\x1c\xbe\x46\x90\xae\x9c\x8a\x77\x8d\x7c\x7c\x54\xaa\x85" - "\x3d\xa0\x31\x2a\xce\xc7\x19\xa6\x06\x71\xb9\xc2\x67\x61\x1b\x77" - "\xa0\xc7\x77\x65\x41\x90\xbe\x59\xaf\xc6\xab\x57\x66\x33\xae\x34" - "\x34\x78\xfa\xe7\x0e\xae\x7c\xdd\x55\x65\x61\x3a\xd6\x49\x9b\x04" - "\x5c\x8d\x56\xd5\xdf\xc2\x97\xa9\xd9\xe9\x8b\x97\xa1\x6f\x2d\x8b" - "\x6f\xfa\x53\x8e\xfc\xad\xa5\x31\x1d\xf0\x51\x6a\x4c\xf1\x27\x6c" - "\xd4\x55\x0f\x6a\x76\xae\x0c\xbe\x51\x8d\x66\x9f\x3b\xc1\x6b\xe6" - "\x09\xba\xaa\x08\x61\xab\xb0\x5e\x19\xf9\x79\x3c\x64\x7d\xbf\x42" - "\xef\x22\xae\x2a\x32\x79\xd0\xc9\x5c\x95\x87\x67\x92\x16\x9e\x2a" - "\x79\xe8\x5e\x80\xf1\xe4\x55\x45\xf0\x97\x6a\x38\x8c\xdf\x6e\xd1" - "\x3d\xd6\xaa\xff\x6e\xfc\x1b\x8f\xb9\xaf\x82\xfe\x5f\x59\x94\xb6" - "\x3e\x12\xb4\x5e\x7d\x89\x81\x56\x8f\x81\x56\xfb\x09\xba\x3a\x47" - "\xd1\x7a\xd5\xae\x64\x5a\xaf\x46\x0f\x77\xd5\x71\x3c\x61\xfc\xb6" - "\xa9\xb0\xf1\xb9\xea\x10\xca\x3f\x06\x1d\x3d\xa2\xea\x84\xe3\x50" - "\x06\xcb\xe2\x6f\x64\x8f\xf7\x15\x13\xcf\x03\x72\x3c\xcb\x93\xe3" - "\xe3\xf0\x83\x40\x7b\x27\xd2\x73\x58\x57\xb6\xc5\x95\x2e\x98\xfb" - "\x14\x57\xe7\x25\x7c\x2f\xf8\x9e\xac\xbf\x5d\xe4\x9a\x04\x1d\x07" - "\x1f\x7f\xce\x51\x7d\x8d\xeb\x4e\x0e\xa3\x6d\x7d\x82\xdf\xf9\x6d" - "\xd0\xe1\xde\x4d\x87\x83\x7d\x56\x1a\xd6\x6b\xa5\x82\xe8\x56\x6b" - "\x57\x34\xeb\x83\xae\x40\xe7\x5e\x6a\x8f\xfe\x92\x5c\x4f\x48\x1c" - "\x37\x07\xca\x60\xab\xd6\x88\xd8\x5b\xbd\xbb\x31\x9e\xfb\xdc\x8f" - "\xbe\xf9\xea\xd3\xe4\x92\xf4\xff\xf0\x04\x7a\xfd\x79\x12\xb7\xe2" - "\x27\xdb\x7a\x68\xeb\xe3\xb0\x2f\xa7\x78\x8e\xc0\x99\xb5\xa5\x97" - "\xc6\xbd\xb2\x96\xf2\x1a\x7a\x69\xec\xce\x5e\x72\x8b\xbf\xba\xad" - "\x0d\xf0\xcf\xe6\x9d\xcb\x21\xe8\x50\xf1\x88\x72\xb2\xef\x5c\x0b" - "\x3f\x2d\x4a\x96\xd8\x16\xf8\x69\x51\xf8\x69\x9f\xbb\xb9\x2d\x25" - "\xfc\xb4\xbe\x3e\xf6\xd3\x5a\xeb\x18\x06\x6d\xb0\x6e\x78\x19\x59" - "\xb2\x4b\x29\x07\xf4\x79\x3f\xa3\xab\x97\x65\x9f\x84\x8f\x08\x9e" - "\x83\x1a\xbf\x90\xe1\x46\x47\x19\x0d\x93\xbc\xa2\x7d\x8b\xda\x3f" - "\xe7\xa4\x9b\xcf\x67\x5b\xeb\x47\x95\x71\x3b\x03\x0f\xb5\x3c\x27" - "\xb9\x77\x54\xc4\xb6\xa2\x41\x44\x38\xbe\x62\x8c\x88\x20\xbe\x9c" - "\xcb\x6e\x46\x7c\x8f\xcf\x55\x1f\xb4\x36\x57\x98\xcd\x23\xa7\xf3" - "\x97\xd9\x9f\x90\x73\xfd\xb2\xef\x70\x75\xa4\xf4\x3f\xb0\x19\xae" - "\x2e\xdd\xde\x56\x8c\x21\x67\x85\x4b\x74\x0e\x32\xf7\x1a\xd6\xfd" - "\xbc\x83\xa3\x39\xef\x18\x77\xc2\xef\x50\x6b\x06\xa4\x7c\x86\x31" - "\xb2\x0d\xb3\x4f\xc0\x7d\x0c\xfb\xc1\x3c\x2f\xa8\xe6\x93\xc6\xcc" - "\x31\xf8\x2a\xdc\xc7\x84\xf7\xae\x8d\xd8\x38\x3f\xf3\xa9\xe5\x9f" - "\x94\xce\x9e\xf3\x1a\x06\x7c\x11\x77\x7b\x03\x51\x3b\x5a\x63\x5b" - "\x43\x01\xfc\xa3\x5e\xe9\x8b\x9e\xa0\x31\x2d\xd2\x9e\x2c\xe9\x25" - "\xfe\x1d\xa8\xbc\x83\x02\x80\x51\xf6\x74\x4c\xb4\xc5\xa3\xe6\x1d" - "\x5b\xca\xcf\xf2\x7a\x86\xf0\x2f\x67\xbb\x73\xcd\xf5\x07\x2b\x43" - "\x4c\x57\x58\x9f\x7b\x0d\xd2\x35\x6e\x2e\xbf\xbb\xa6\xc3\xb5\x53" - "\xcd\x0b\x76\x1d\x0c\xe7\x03\xe6\x1a\x67\x90\xc6\x90\xce\x2f\xfc" - "\x58\xf4\x3d\x63\x8e\x0c\x42\x6b\x8e\xea\xb3\xae\x29\x4c\xf6\x2f" - "\x86\xa0\x9f\xbb\x66\x41\x72\x3f\x77\x4d\x45\x72\x3f\x77\xcd\xc6" - "\x64\xff\xc2\x0a\xff\xe2\x9a\xfa\x94\x3c\xbb\x53\xf2\xec\x33\xe4" - "\xa9\xd3\xca\x69\x4d\xc9\x73\x3c\x25\x4f\x97\x21\xcc\x3c\x46\xf5" - "\xfa\xe9\x96\xf3\xf2\xd7\x66\x1b\xc2\xd6\xed\x72\xad\xea\x5a\x97" - "\x1e\x87\x7e\x94\xe0\x1f\x86\x59\x27\x14\xbe\x6b\x27\xa5\xe8\x18" - "\xc3\x17\x26\xd3\x70\x6d\x69\x32\x0d\xd7\x96\x27\x7c\x1a\xe0\x47" - "\x7d\x7d\x70\x8a\xc6\x4e\x95\x3a\xc4\x3e\x5d\x15\xcd\xe0\x30\x70" - "\xd5\x03\x1e\x72\xb8\xb6\x29\x05\x5f\x73\x0a\x3e\xbf\x21\x9c\x83" - "\xf0\x11\x03\x0f\x39\x19\x4e\xb2\x40\x5f\x30\xa6\xb8\xb6\x53\x8f" - "\x67\xdf\x96\xe7\xdc\xbc\x72\x4d\xa4\x80\xd7\x5e\x2e\x3d\x41\xd7" - "\xfe\x89\xfd\x60\x85\x73\xac\xd1\xff\x23\xc5\xd7\x58\x77\x32\x1d" - "\x63\xf3\x93\xe9\x18\x3b\xd5\xc0\x57\xd8\xb1\x9e\x66\x3a\xa2\x0f" - "\x3c\xc2\x7e\x32\xaf\x87\xb1\xbf\x0a\xbf\xcd\x89\x32\x73\x78\xbd" - "\xe7\x54\x05\x65\x04\x3c\x9d\xf0\x43\x5a\x37\xa7\xd5\xa7\xac\x8e" - "\x3c\x6d\xbd\xc0\x05\xfc\xbb\x75\x7d\xc4\x6f\x8c\x7f\xaf\x99\x28" - "\x6d\xf0\xa6\x8f\x8a\x85\xb7\xb8\x1e\x72\x44\x5f\x7e\xdd\x0e\xd5" - "\x9f\x74\x4c\x91\x73\xa3\x78\x60\x67\xb2\xd5\x3c\xf0\xd8\x4e\x83" - "\x3e\x87\x5d\x6b\xef\x16\x27\xe8\xba\xd7\xd9\x0e\xb1\xff\xc7\x3e" - "\xff\xc1\x70\x08\x7d\xc3\x69\x62\x9a\x91\xb6\x5b\xe5\xbb\xce\x65" - "\xc8\x17\xe2\x36\xc5\xf0\x9c\x36\x21\x4a\x36\xce\x03\x1c\xb9\x72" - "\x3c\x00\x7c\x07\xd1\x46\x91\xa7\x48\xcf\x03\x58\x99\xc7\x51\x41" - "\xb6\x9b\x2a\xc9\xe6\x5f\x7b\x42\xe2\xd6\xea\xbb\x73\x0b\xe4\x12" - "\xa8\xec\x84\x6f\xd8\xc1\x63\x6a\x9b\xbf\xea\x04\xe3\xd9\x9d\x11" - "\x21\x7b\x77\x6d\x07\xca\xbe\x6e\x77\xac\xb6\xc3\x1d\xaf\xe9\x80" - "\x9f\x31\xf6\x08\xf4\xcf\xd4\x66\x99\xaf\x85\x91\x63\x9b\x2f\xde" - "\xe1\xaf\x3a\xc9\x38\x8f\x71\xbf\x1b\x70\x46\xa9\xbd\x21\x8a\x7e" - "\x86\x72\xe4\x9a\x18\xc6\xb6\x81\x26\xf8\xa6\x18\xb7\x95\x78\xa8" - "\x00\xbe\x46\x87\x48\xe4\x0b\x23\xdf\xd7\xb3\x99\xd6\x8d\x1c\x8f" - "\xfc\xb0\x99\x21\xf6\x65\xd3\xf4\xeb\x0e\x86\xf3\x5f\xc3\x7d\xfb" - "\xd7\xa7\x28\xdf\x86\xa6\xc2\x97\xe9\x30\x5d\x27\xb2\x52\xa0\xc7" - "\xf7\xf5\xea\x20\xdd\xe3\xd2\x75\xed\x60\xbd\xac\x6f\x8c\x41\xbf" - "\x8e\xf6\x7f\x5d\x5a\x9f\x4e\xd3\xcb\x72\xc0\x0e\x03\x6c\xcb\x60" - "\xb0\x4c\xf7\x41\xf0\x2d\x36\x1d\x8e\xfc\xb8\x2a\x6f\x88\xa6\x53" - "\xe8\xcb\xbf\x1e\xd5\xf3\x7d\x19\xfe\xd8\x1e\xb3\x4d\x40\xbf\x10" - "\x56\xf3\xce\xee\x65\xbc\x46\xd7\xe3\xfb\x06\xc6\x7f\x5f\x2f\xd3" - "\x78\xf8\x0a\xc2\xa8\xff\xaf\x4b\xff\x63\x2b\xcf\xe1\xa3\xef\x5b" - "\x51\x8e\x3e\xc1\x19\x86\x6e\x7c\xa3\x5c\x4f\x93\xe3\x0b\x4e\xc3" - "\xf8\xe5\xa0\xf3\x24\xa7\x6d\x4e\xa4\x71\x3e\xa6\xdb\x13\xe5\xf8" - "\x5d\x7a\xbc\xb2\x5b\xdf\xd8\x9b\x12\x6e\xd1\xc3\xf8\x8d\xf6\xff" - "\xf5\x7c\x7d\x1d\x1a\x3a\xc7\xeb\x47\x96\x13\xe4\xbe\x79\xa7\xb4" - "\x67\xdf\x08\xe9\xe9\x4c\x97\xf7\x35\x11\xe2\xb9\xc7\x78\xd6\xe1" - "\x88\xb4\xf3\xc8\xf3\xd6\xd9\xc8\x10\x8c\x2d\x2d\xa2\xaf\x8c\xd7" - "\x66\xba\x18\x0f\xf7\x6b\xd0\x77\xee\xdb\xba\x4e\xd0\x37\x4e\xf2" - "\x1a\x0b\xeb\xc8\xea\x28\x8d\x2e\xbf\x8b\xc7\x10\xee\x3c\xa9\xd3" - "\x3e\xa9\x3f\x82\xf1\xc1\x27\x90\xb8\x19\xdf\x56\xee\x33\xbb\xcb" - "\x40\xab\x9b\xf9\xdf\x95\x7e\xce\xc6\x5d\x67\x90\xe5\x10\x84\x9b" - "\x92\x79\x75\x37\xa7\x84\xfd\x7a\x18\xf2\xaa\x56\xba\xe7\xde\xab" - "\xa5\x1d\x1f\xac\x2c\xf6\x17\x7a\x7c\xd7\x53\x72\x79\xd7\xe7\x24" - "\xe3\xbf\xde\x95\x12\xce\xd3\xc3\xdb\xe5\x5a\xc4\xf5\x05\x7a\x19" - "\xb2\xce\xa0\x63\xbb\xaa\x42\x43\xbe\x9c\xfe\xdc\xf0\xb2\xd2\x9f" - "\xeb\x37\x1a\x68\x18\x8a\xf0\xf6\xfe\xfa\xbc\xbe\x49\xc7\x8f\xdf" - "\x7b\x0c\x70\x68\x23\xd7\x1f\x48\xd5\x97\x15\x1e\xd6\x33\xd6\x99" - "\xeb\x3b\x4c\xd2\x22\x5a\x5a\xd8\x5c\xcf\x6e\xc8\x36\xc4\x6b\xeb" - "\x8c\x37\x2c\xd3\xfb\x26\xb9\x66\xe6\x2d\xb2\x48\x1f\xe7\x45\xa5" - "\x17\xbc\x2e\x2a\xf5\x42\xee\xc9\xb8\x61\x5a\x2a\x5e\xff\xda\x68" - "\x3f\x8e\x7e\x9c\xa3\x39\x0c\xf8\xca\x7e\xde\x6e\xc0\xb8\xca\x5d" - "\xa9\xeb\xad\xf2\xa3\xaf\xf7\xa4\xf3\x37\x00\xbf\x2f\x59\x66\x37" - "\x1c\xea\x97\xd9\x0d\xc7\x0c\x78\x83\x06\xb8\xdf\x23\x1c\x32\xc0" - "\x45\x2f\xa4\x1f\x6a\x1f\xcb\x8d\x63\x93\xcb\xba\x71\x62\x3f\x8e" - "\x1b\x0b\xfa\xcb\xba\x71\x9a\x01\xae\x03\xe1\x39\xe9\xeb\xe7\x46" - "\x4f\xfa\xfa\xb9\x71\xbb\x79\xfd\xdc\xb8\xc7\x50\xee\xbe\x0b\xeb" - "\xf6\x8d\xc7\x0d\xf4\x34\x22\xdc\x95\xac\xcb\x37\x46\x93\xc3\xe3" - "\x12\xf5\x2f\xd0\x7e\x77\xad\x2d\x18\xc2\xf1\xf0\x95\x73\x94\xae" - "\x8f\x1b\x67\x4c\x7f\xab\x57\xa5\x33\x8d\x3c\x07\x22\xe7\xfe\x14" - "\x5c\x51\x2a\x1c\xc3\x18\xd2\x2b\x74\xda\x37\x22\x9c\x6e\x9f\x88" - "\xde\x0f\x05\xe2\xdc\x0f\x8d\xdb\xae\xc6\xc0\x1f\x46\x84\xef\xbd" - "\xe2\x74\x7d\x0a\x70\xc3\xfe\x8d\xab\x51\x73\x40\x1f\x46\xa0\x47" - "\xbd\xa7\x68\xfc\x22\xbc\xfb\xf0\xbe\x3f\xb9\x6f\x1b\xd7\x89\xb1" - "\xf7\xac\x46\x5f\x6a\x9f\x37\x9e\xe0\xbf\xf4\x3a\xa2\xd5\xc5\x26" - "\x69\xa3\x85\x2f\xe3\x01\x93\xf8\x89\xa8\xa7\xde\x20\x8d\x2f\x63" - "\x1a\x0d\xf1\xd3\x84\x6f\x44\x11\xc3\x07\xb9\x3c\xe4\x31\x9f\x1f" - "\xf8\x30\xb2\xe2\x6b\xe4\x04\x9d\x5f\x9c\xa2\x9b\x2c\x2b\x9c\x72" - "\x1c\x0c\x9a\x6f\x7a\x30\xa5\x9c\x86\x34\x34\xef\x05\xcd\x5f\xa4" - "\xa1\xf9\x88\x5a\xd3\x07\xdd\x03\xfa\xf7\xf1\x3c\x96\xf9\x42\xca" - "\x35\x29\xfe\x26\x9b\xf7\x65\x8c\x87\xad\x24\xf3\xcc\xaa\xec\xaf" - "\x0f\x2d\x7d\xac\xa3\x9e\x0a\x07\x96\x75\xd3\x24\xe1\x1b\x36\x2b" - "\x48\x37\x55\xe8\xfd\x81\x16\x5f\xa4\x68\x80\x2c\xac\x2c\x0b\xf0" - "\x81\x7c\xe9\xea\x51\x6f\x7b\x2c\x87\x1e\xdf\x4d\xe8\xff\xc6\x57" - "\xe8\x7d\x26\xfa\xcb\x10\xcb\x4a\x4b\xf3\xa7\xa4\x45\x0c\x69\xc7" - "\x93\xd2\xd6\x25\xe2\xc3\x7a\xfc\x05\xea\x02\xf2\x9f\xf0\x32\xe7" - "\x49\xe6\x71\x82\xcb\xbc\x0e\x26\xe4\xa3\x0e\xfa\xcc\xeb\x60\x42" - "\x91\xb9\xde\x4c\x58\x2c\x9e\x23\x33\x5c\x1b\x51\x2f\x7d\x5c\x2f" - "\x5c\x0f\x03\xe5\x3f\x61\x97\x2e\xff\x0b\xf0\x10\x3b\x45\x79\xf7" - "\xf7\xeb\x53\xde\xcb\x29\x78\xba\xcc\x79\xc9\xb3\x81\x97\x98\x39" - "\x2f\x79\x2e\x73\x5e\xf2\xf2\x41\x73\x6c\xa0\x2e\xe5\x15\x22\xde" - "\x0c\xbe\x4c\xf8\x4c\xf1\x57\xb3\xef\x10\xa4\xbc\xbd\x3c\x27\x64" - "\x88\xaf\xef\x6f\x4b\x13\x78\x6f\x94\x83\xe7\x8b\xfc\x55\xb7\x10" - "\xd3\x73\xca\x45\xd6\xc1\xe4\x01\xfe\x3f\x3f\x45\x37\x3f\x12\xb7" - "\x5a\x76\x29\x59\xdc\x92\x99\x52\x6e\xc4\x5c\x16\x37\xe7\x40\x16" - "\x9f\x9b\xcb\xe2\xe6\x71\xe6\xb2\xb8\x79\x0a\x78\xfe\x7c\xa0\x2c" - "\x6e\x9e\xa3\xcb\x02\xe3\x49\x87\x78\xb5\x44\xdc\x54\x4e\x76\xf0" - "\x99\xe3\x40\x1d\x2b\xb8\x2e\x86\xdb\xe8\x88\xa8\xfa\x75\x2d\x27" - "\xfb\x67\x74\x73\x05\xef\xe5\x10\xaf\xce\x16\x23\x42\x34\x8c\xe1" - "\x03\x9e\xcf\xfd\x01\x58\x70\x1e\xd3\xa7\x94\xe1\x37\x6f\x9b\x37" - "\xc3\xc7\xcd\x78\xce\x24\x3e\xa4\xf6\x79\xde\x32\x36\xb9\xcd\xde" - "\x62\xef\x97\x77\x9e\xe4\xc3\xb0\x0f\x74\xd0\x67\xf0\x3a\xb8\xe5" - "\x0b\x4d\xfe\x7f\x49\xa6\xe3\x16\x8f\xb9\xfc\x6f\xa9\x4b\x2f\xff" - "\x5b\xf6\x98\xcb\xff\x96\x16\x96\x3f\x78\x8a\x24\xdb\xe3\x5b\x8e" - "\xf7\xf3\x74\x0b\xcf\xc9\x3a\x84\x6f\xe8\x57\x39\xfc\x65\x79\xd3" - "\x1f\xe0\xb7\x34\xbe\x42\xd0\x3d\xcb\x98\xff\x4e\xfe\x74\x4f\xdd" - "\x28\xf3\xf5\x50\x8c\x15\xc8\x75\x15\x8f\x73\xbf\xf9\x0e\x74\xa7" - "\x03\xbf\xad\xa7\xe8\xd6\x85\x71\x9f\xb5\x52\x93\xed\xc7\xa7\x68" - "\xe2\xed\x4a\xb6\xb7\xde\x9b\x2c\x8f\x6f\x1e\x33\x97\xed\x37\xbb" - "\x20\xdb\x8f\xcd\x65\x3b\xd1\x9e\xbe\xdf\x98\x38\x16\xfc\x7f\x3c" - "\x50\xbf\x27\x4e\x52\x79\x68\x03\xe7\x51\xfb\x1f\x27\xbe\xc9\x30" - "\x4a\x8f\x27\xbe\xc0\xe9\xac\xf3\x86\x3c\xe5\xc0\x55\xdc\xaf\xeb" - "\x13\x17\x6b\x38\x8c\x78\xb7\x3b\x42\x66\x3a\x3d\x51\xae\xeb\xdd" - "\x14\x96\xf2\x29\xde\xc9\x65\xae\x22\xfa\x8c\x6e\x95\xf9\x39\xfe" - "\x5a\xa7\x51\xa7\x27\x1e\xd7\xe1\xd8\xc6\x28\xd8\x89\xc7\xc4\xab" - "\x65\xc4\x70\xc9\xb8\x6f\xd5\xf8\x1f\x36\xab\x51\x83\x67\xb8\x14" - "\x98\x71\xaa\xed\xdc\x5a\x9e\xdc\x76\x6e\x9d\x92\xdc\xdf\x41\xfe" - "\xc8\x17\xf7\x59\xd0\x97\x7d\xf3\x00\x68\xf8\xd2\xfa\x32\x48\x5b" - "\x42\x7d\x7f\xeb\x5e\x55\xdf\xdf\xba\x3e\x85\xae\x16\xf3\xfa\xbe" - "\xf5\x78\xfa\xfa\xbe\x35\x62\xde\x96\xbe\x95\xc3\x75\x1d\xa4\x6f" - "\x4d\x49\x6e\x4b\xdf\x72\xf7\xb7\xa5\x5b\x5b\x54\x5b\xa2\x4b\x2e" - "\xa6\x2d\xc0\x57\x48\xdb\xf6\xf4\xf6\xf5\x65\x65\x82\xf6\xc0\x34" - "\x49\x5f\x07\x63\xfc\x7c\x96\x51\xbb\x53\xee\xe5\xf6\x9e\xa2\xdb" - "\x66\xf2\x3c\xae\x92\x55\xfe\xf0\x14\xfe\x42\xe6\xb2\xba\xcd\x0e" - "\x59\x79\xcd\x65\x75\xdb\x58\x73\x59\xdd\x36\x89\xf7\xb2\x0e\x6c" - "\x17\xb7\x15\xb1\xdd\x07\x8d\xbc\x87\xa2\xe3\x33\xba\xed\x27\xd2" - "\xfe\x77\x97\x08\xe8\x9d\x89\xfd\xbf\xad\xdf\xfe\x8f\xe2\x36\x71" - "\x9b\xf4\xa7\x44\x37\xec\x7f\x3d\x0d\xe3\xbe\xa0\xbf\x0f\xc8\x33" - "\xe9\x03\x6e\x6b\x31\xef\x03\x6e\x3b\x6e\xde\x07\xdc\x16\x56\x7a" - "\x9c\xef\x4e\xd6\xe3\xfc\xec\xfe\x3a\x86\x9c\xfe\x77\xfa\x80\x6d" - "\xc0\xfb\x09\xfa\xe1\x6a\x55\x1f\xb7\x3f\x9b\x4c\x4b\x7e\xb5\x79" - "\x7d\xe4\xd7\xa3\x3e\xb6\x99\xd7\x47\xfe\x5e\xf3\xfa\xc8\x6f\x85" - "\xdc\xb7\x0d\xac\x8f\xfc\x93\x5f\xae\x1f\xbe\x3d\x3b\xb9\x1f\xce" - "\x8f\x7e\xf9\x7e\xf8\xf6\xa9\xe6\x75\x70\x7b\xa9\x79\x1d\xdc\xee" - "\x51\x75\x70\xfb\x9e\xe4\x3a\xb8\xbd\xae\xbf\x0e\x20\x9b\xff\x79" - "\x1d\x44\xd5\xfa\xee\x1d\xc3\xbb\xe5\xfc\xd9\x1d\xb6\x20\xdd\xd1" - "\xaa\xd6\x03\xee\xf0\xab\x39\x54\x59\x4f\x6f\xa1\xec\xc8\x40\x5b" - "\x7c\x87\x4b\x8b\x7b\x78\x60\xbf\x70\xc7\x24\xd8\xc9\xae\x96\x4a" - "\xb9\xd6\xa3\xea\x09\xf2\xdd\x06\x38\x35\x17\x70\xc7\x1c\xce\x8b" - "\x7a\x14\xfc\xbd\x05\xdb\x56\xc0\x87\x19\x4f\x8b\x2b\x96\x22\xbf" - "\x3b\x6a\x2e\xa6\xdf\x4c\xc7\x2b\xfb\x87\xa7\xe8\xce\xdb\x19\x26" - "\xce\x7c\xad\xa2\xc6\x53\xf4\xed\x85\x78\x43\xf7\xee\xfc\x5a\x4a" - "\x99\x51\x73\xdd\xfb\x76\x2e\x68\x6e\x34\xd7\xbd\x6f\xe7\xa5\xef" - "\x27\xbf\x3d\x4d\x96\xeb\xa3\xc6\xb8\xf2\xe5\x2f\x9d\x57\x19\x4c" - "\xf1\xe5\xbf\x5d\xae\xf7\x6d\xdd\x99\xa8\x9b\x55\x2c\xf7\x49\x43" - "\x14\x7d\x93\x62\x29\xb0\x0d\xaa\x2c\xcb\x2c\x93\xb2\xf6\x81\xc6" - "\xb7\xd2\xd0\x78\xcc\xbc\x7d\x7c\xbb\x4b\xab\xcb\xb7\x44\x66\x6a" - "\x1b\x99\xc4\x73\xa7\x26\xb2\x98\xa4\xd7\x7f\xb1\xa4\x21\xa9\x7e" - "\x27\x4d\x4a\xae\x5f\x2a\xae\xc0\x78\xcd\x04\x6e\x81\x11\x8e\xf7" - "\xe2\x30\x2c\xeb\x80\x09\x6c\x5d\x2a\xce\x34\x70\xfb\x06\xe8\x16" - "\xef\xcd\x30\xd5\xad\x49\x27\x55\x5b\xbb\x73\x4a\x72\x5b\x9b\x14" - "\xed\x6f\x6b\xdf\x6e\x48\xce\x73\xa7\x33\xb9\x4f\xbf\x23\x2a\xfb" - "\x74\xe8\x14\x60\x37\x73\xbd\xfd\x2f\xd8\xc6\xf7\x50\x8e\xe6\x1f" - "\xdf\x95\x32\x5f\x71\x67\xbd\xb9\x6e\xde\xd9\x0c\x9e\xdf\x33\xaf" - "\xf7\x3b\x5b\xcd\xeb\xfd\x4e\xb6\x7f\xef\x69\xe3\xcb\x4b\x67\x55" - "\x16\x0c\x4b\x4e\xbf\xcb\x66\x6e\xbb\xee\x4a\x33\xff\x71\xd7\x44" - "\x25\xcf\xbb\xca\x92\xe5\x79\x97\x61\xfe\x03\xf4\xff\xef\xf4\x1f" - "\x81\x53\x74\xf7\x18\x25\xa3\x82\x21\x29\x74\x1c\x30\x97\xd1\x5d" - "\xc7\x20\xa3\x80\xb9\x8c\xee\x0a\xa5\x6f\xbf\x77\xf3\xbe\xf8\xc0" - "\xc0\xfe\xe3\xee\xb1\xde\x1d\x72\x7e\x44\xb6\xc3\x59\x51\xf8\x9f" - "\x3e\x3d\x9d\xfb\x8d\xbb\x79\xfc\x27\x1c\xa3\xa9\x30\x50\x1f\xe5" - "\x3d\x48\x39\x0c\x57\x52\x99\xba\x4e\x72\xb7\xf2\x75\x7d\x82\x1c" - "\x9e\x04\xac\x5d\x87\x4d\xc1\xc9\xfd\x9f\xd0\xe1\xd4\xbc\x4c\x75" - "\x8a\x2d\xb9\xfb\x80\x79\xbd\xdd\x9d\xa6\xfd\xdf\xdd\xa5\xea\xad" - "\x20\x65\xec\x57\x60\x4b\xd6\x75\xc8\xf5\x22\xea\x8e\xd7\x51\x4c" - "\xeb\x6f\xc3\xec\x8e\xf2\x2a\xba\xea\x34\x15\xbc\x2f\xf1\x23\xcc" - "\xdf\xfd\x94\x44\xc9\x2a\x36\x3c\xd9\xe1\xc0\xef\x46\x9f\x88\x6c" - "\xb3\x8a\x23\xdb\x7c\xe2\x48\x20\x7a\x96\x7d\xb6\xaf\x9e\xa0\x82" - "\x67\x15\x7d\x22\xa2\x64\x51\x50\xc3\xb0\x3d\xbe\x02\xbf\x3e\xdf" - "\x97\xae\x3c\xde\x9f\xcd\xb8\x07\x9f\xe3\xfd\x8e\x1d\x32\x98\xa3" - "\xaf\xe5\x22\xec\xec\xdf\x5f\xf4\x9d\xb1\x48\xfb\x52\xdf\x2b\x02" - "\xb6\xd0\x88\x47\x7d\xab\xf8\x9d\x05\xfa\x1e\x21\xfc\x2e\xbf\x00" - "\x2e\x9d\x9e\xfa\x14\x7a\x76\xa3\xef\x9f\xa3\xe1\xd8\x3b\x18\x0e" - "\xae\x27\xa5\x5f\x5c\x8f\xdf\x69\x1d\x6c\x9e\x28\xc3\x49\x85\xcf" - "\x0f\xd0\xf9\x7b\xa4\xcf\xcd\x38\xd2\xb5\x41\xd5\xa7\xde\xf3\x37" - "\xd5\x06\xef\x39\x9a\x92\xbf\x40\xcd\x1d\xaa\x3e\x6a\x5e\x34\x55" - "\x47\xef\x29\x75\x84\xcd\x74\xf4\x1e\x8f\xae\xa3\xf0\x79\x19\xef" - "\x2f\x52\xd2\xeb\x95\xae\xde\x13\x42\x3f\x69\x18\x87\xdc\xd3\x2c" - "\x75\xe9\x52\xd5\x16\x91\x5e\x9f\x92\xef\x48\xb2\x2e\xdf\x53\x30" - "\xd8\x3c\xac\xe2\x6d\x72\xad\xe2\x6d\xca\xa2\x64\x5c\x93\x47\x0f" - "\xce\xdb\xe4\x49\xe6\xbc\x4d\x2e\x4a\xe6\x6d\xca\x7d\x29\xe9\xd2" - "\xbf\xef\x1e\xd0\x07\x4f\xde\xac\xfb\xa9\xae\x6b\xd8\xff\x9c\xfc" - "\x17\xe9\xaf\x36\x96\x88\xb1\x2e\x33\x7f\x75\xf2\x81\x84\xbf\xaa" - "\xe0\xd5\xbe\xd7\x46\xf8\xab\x4d\xa9\xe3\x86\x02\x3a\x18\x4d\xf5" - "\x59\x27\x47\x1d\x0d\x66\xf4\x4f\xc9\xd5\x6c\xe4\x73\x03\x6d\xe4" - "\x94\x3c\x55\x2f\x53\x6a\x92\x6d\xc8\x94\xa9\xc9\xf5\x32\xb9\x22" - "\x25\x5f\x59\x72\xbd\x4c\x1e\xfd\xdf\xed\x1f\x58\x61\x33\x32\x32" - "\xac\x19\x16\xab\x25\x03\xc9\x60\x93\x86\x65\xd8\x32\x86\xe0\x19" - "\xaa\xbd\x87\x59\x33\xac\x36\x3c\x43\xb4\xf7\xd0\x94\xf0\x30\xce" - "\x8b\xc7\xa6\xbd\x87\xa4\x84\x87\x5e\x20\x7d\x98\x56\xae\x5e\xbe" - "\x2d\x25\x3c\xe4\x02\xe9\x43\xff\x87\xf9\x69\x40\x38\x79\x9f\xd4" - "\x7d\x4b\x56\xcd\x5f\xbc\x68\x81\x6b\xf5\xf2\x45\x15\x0b\x5d\xf3" - "\x1f\x7b\x6c\xe1\x8a\x15\xae\x8a\xa5\xae\x7b\xbe\xf3\xc0\x2d\x77" - "\xb8\xf2\x3c\xd7\x79\xc6\xb9\x16\xdf\x79\xdd\x82\x2c\xba\x7f\xf5" - "\x72\x4e\xb8\x7f\xd6\x7d\xc5\xae\xc2\x7b\xbe\x93\x9c\xa8\xa3\x59" - "\xbe\x70\xfe\x82\x41\xb1\x18\x6c\x5a\x41\xed\x48\xa2\x2d\x23\xa5" - "\x6d\x3b\xd9\xd6\x44\xa4\xc6\xea\xf3\xef\x6c\xdd\x45\x24\x7a\xbd" - "\xc2\x7f\x0d\xef\xb9\xf8\xee\x16\x66\x62\x7c\x53\x35\x95\x3f\xce" - "\xdf\x31\x7c\xf7\x75\xf1\x6e\x88\x5c\xff\x40\xd6\x13\xe4\xfd\xa4" - "\x05\xda\xc4\xe1\xc0\xc9\x28\xb9\xbc\x64\x3f\x45\xa5\xff\x85\x34" - "\x8b\xb8\x2b\x8e\xb8\xb0\xb6\xb7\xf2\xbe\x1d\x32\xee\xdd\x6a\x1d" - "\xce\x71\x8a\xbe\x37\x53\xbc\x2b\x64\x58\xdc\x55\xa7\xc1\x7d\x6f" - "\x4c\xdc\x77\x6f\x90\xd7\x64\x5f\xbe\x94\xec\x2f\x8f\x14\xc7\x1b" - "\x9e\x23\xdb\xce\xe7\x78\x1d\xec\x7b\xb9\x41\xeb\x2f\xe4\xfe\xfb" - "\x5a\xc4\x07\xc9\x1b\xe4\xb2\x19\x36\x6e\xfd\x6e\x16\xc3\x4b\xd8" - "\x4b\x89\x38\x1f\xe0\xa7\x24\xc3\x7f\xcf\x69\x05\xec\x8c\x4f\xc9" - "\x11\xc9\xfa\x20\x18\xa8\xac\x26\x47\x4c\xfc\xed\xa6\xa9\x64\x69" - "\xdf\x48\xb4\x26\x2a\xa2\xfe\xe5\xa7\x99\x86\x17\x1c\x6b\xc4\xdf" - "\x02\x18\x79\xdf\xdf\xe5\x15\x5b\xcf\x90\x0d\x63\x50\x8b\x7f\x39" - "\xef\x25\xf9\x5e\xe5\xce\x2f\xc8\x06\x39\x8c\x3e\x4d\x53\xf7\x54" - "\xde\x2f\x62\xde\xfb\xc9\x76\xd8\x53\x4d\x62\x53\xeb\x4d\x5b\x3f" - "\x22\xdb\x1b\xbd\xd5\xd6\x5e\xe1\xa4\xca\x0a\x5e\x9f\x10\xe4\x0d" - "\x8b\x08\xaf\xb7\xb7\x96\xc6\x18\xe6\xaa\x1e\xaf\x93\xda\x2b\xc2" - "\xb4\xee\xb8\x88\xd4\x7c\x44\x76\x9e\xeb\x6a\xeb\x0a\xf3\xf7\xd3" - "\xf6\x75\xf7\x53\xc6\xa9\x62\xb2\xb6\x95\xd5\x53\x60\x4e\x98\x2a" - "\x8f\x8b\xce\xd6\xd2\x4f\xa9\xbd\xac\x99\x4a\x3a\xc8\xda\x7a\xf2" - "\x2f\x24\xbf\x09\xde\x6a\x0d\x56\x9d\x23\xe7\xba\x45\x1c\x77\x8e" - "\xd6\xae\xa3\xe1\x6b\xff\x44\x8e\x40\x67\x07\xca\x39\x43\x8f\x1e" - "\x23\x0b\xf0\x59\x9f\xfe\x0b\x39\x9f\x7e\x84\xf7\x6b\x16\x50\x43" - "\x15\x39\x85\xd7\x9d\xdd\xeb\x75\xe7\xf4\x0a\xf7\xa5\x3d\x5e\x77" - "\x6e\x7b\x39\xe0\x4f\xbe\x43\x23\x3a\x28\xf7\xdd\xd3\x1d\xd6\xfa" - "\xb3\x34\xda\x35\x9d\x75\x60\xea\xee\x86\xb3\x80\xdf\xd4\x51\x1a" - "\x47\x5e\x63\x9e\x68\x66\x87\x27\x50\x1c\xa1\x38\x70\xd5\xf7\xd2" - "\xe8\x86\x5e\x72\xc6\x6b\x3b\x4a\x59\x16\x7d\x9b\x0e\x07\x61\x07" - "\x87\xbd\xf5\xfd\x7d\xb6\x40\x6b\x17\xb5\x85\x7b\xa9\x9d\xfe\x83" - "\x02\x9e\xbf\xfa\xdf\xf8\xfe\xbe\x21\x71\x34\x00\xff\x5a\xde\xf7" - "\xa2\xf4\xc6\xdb\xc6\xdf\xc8\x55\xd3\xb6\x2a\xca\x2e\x5f\x4b\xc3" - "\x4e\x23\x5e\x8d\x73\xdf\xe9\x0c\x44\xff\xea\x5f\x2b\xf7\x6a\x7a" - "\x83\x55\x6d\x94\xd1\x1e\xae\xe7\x6f\xa0\xad\xb1\x11\xd6\x60\x20" - "\x7c\x84\x02\xe5\x1f\xfb\xe3\xd9\xd6\x43\x9b\xe3\x64\x7f\xf3\xfc" - "\x11\x6b\xc0\x76\x9e\x02\xc5\x61\x7a\x0f\x65\x8b\xad\x56\x5e\x87" - "\x28\x68\x0f\x47\xf8\x9b\x97\x3c\xd1\xed\xcc\xda\xb6\x9c\xc6\xed" - "\x3c\x4b\x63\x77\x9c\x25\xb7\xe8\x71\x5b\x79\xff\xe5\xdc\x33\x39" - "\xb4\x03\xef\xec\x93\xd0\x9d\xb3\x6a\x1f\xa6\x18\xae\xed\xc3\xec" - "\x73\x53\x63\x6f\xff\x3e\xcc\xde\xee\xfe\x7d\x98\xac\x4b\xbc\x17" - "\x13\x6d\xe3\x08\xeb\xf4\xe6\x25\x64\xdb\xf0\x19\xd1\x84\x6a\x2b" - "\xef\x1b\x15\x27\x90\x7e\x70\x41\x8c\xbc\xff\xc5\xb2\xbf\xef\x48" - "\xf2\x5e\xd9\xef\x61\xbc\x72\xff\x71\x3c\x9d\x78\xa0\x65\x10\x38" - "\x4d\xcf\xc6\x83\xf1\xdb\x74\xf8\xeb\xd3\x21\x99\xe9\x85\x78\x4a" - "\xf1\x94\xe3\xf1\xe0\xa9\xc6\x03\x3b\x3e\x1d\x63\xae\xe9\xe8\x6f" - "\xa7\xa3\x85\x4e\xc7\xb8\x6a\x7a\x2b\x9e\x20\x1e\xe0\x99\x91\x83" - "\x67\x1c\x1e\xe4\x9f\x51\x8c\x07\x79\x67\x20\xcf\x0c\xe4\x99\x81" - "\xd6\x3d\x63\x37\x1e\xf4\xc9\x33\x90\x6f\x46\x0b\x9e\x0e\x3c\xf0" - "\x33\x51\x14\x15\xc2\x62\x17\xa2\xbf\x28\xc4\xb8\xb8\x10\xf6\xbf" - "\x10\x65\x16\x22\x5f\x21\xf2\x14\x22\x4f\xa1\x1f\xcf\x21\x3c\xe8" - "\xb3\x0b\x91\xaf\x10\xe3\xb4\x42\xd8\xf7\x99\xa0\x7b\x26\xe8\x9e" - "\x09\xba\x67\x02\xd1\x4c\xf8\xcd\x33\x51\xe6\x4c\xd0\x38\x13\xf9" - "\x66\x22\xcf\x4c\xe4\x99\x09\x1a\x67\x82\xdf\x99\xf0\xe9\x67\x22" - "\xdf\x03\x30\x82\x0f\x40\x0e\x0f\x80\xde\x07\x0a\xf0\x14\xe1\x01" - "\xbd\x0f\x6c\xc6\x83\x32\x1f\x00\x8d\x0f\x20\xdf\x03\xc8\xf3\x00" - "\xf2\xcc\x02\x8d\xb3\x60\x2f\x67\x81\xc7\x59\xc8\x37\x0b\xf9\x66" - "\x81\xcf\x59\x18\xaf\xce\x82\x6c\x66\x61\xfc\x3d\x0b\x34\xce\x02" - "\x5d\x45\x80\x2b\x02\x4d\x45\xc0\x5b\x04\x19\x16\x81\x9f\x22\xc0" - "\x14\x81\xae\x22\xf0\x54\x04\xda\x8a\xd0\xff\x16\x81\xb6\x22\xc0" - "\xf3\xd6\xec\x07\x47\xe3\x01\xfc\x83\xc0\xf7\x20\xe0\x1e\x84\xbc" - "\x1e\x04\xbe\x07\x41\xf7\x83\xa0\xe1\x21\xc0\x3c\x04\xbc\x0f\xa1" - "\xfc\x87\x50\xfe\x43\x28\xff\x21\x94\xff\x10\xe0\x1f\x02\xee\x87" - "\x50\xfe\x43\x80\x7f\x08\xf8\x1e\x06\xdc\xc3\x28\xff\x61\xe0\x7b" - "\x18\xe5\x3f\x8c\xf2\x1f\x06\xcc\xc3\xc0\xfb\x30\xca\x7f\x18\xe5" - "\x3f\x0c\xfc\x0f\x43\x3e\x0f\x23\xcf\xc3\xe0\xf3\x61\x94\xf3\x30" - "\xe4\x52\x0c\xfc\xc5\x6e\x3c\x90\x67\x31\xf0\x17\xcf\xc1\x83\x32" - "\x8a\x21\x9b\x62\xd4\x49\x31\xf0\x14\x03\x4f\x31\x70\x14\x23\x7f" - "\x31\x78\x28\x46\x5e\x34\x48\x7a\x04\x74\x3d\x92\x8f\x07\x75\xff" - "\x08\xea\xe1\x11\xc0\x3d\x02\x3d\x79\x04\xbc\x3e\x82\x72\x1e\x01" - "\xec\x23\x28\xeb\x11\xd4\xdf\x23\xe0\xe9\x51\xf0\xf4\x28\xf2\x3c" - "\x8a\x7a\x7f\x14\x65\x3d\x0a\x3a\x1f\x45\x9e\x47\x21\xff\x47\x0f" - "\xe0\x01\xdc\xa3\xd0\xab\x47\xa3\x44\xb3\x41\xd7\x6c\xc0\xce\x06" - "\x5f\xb3\x41\xdf\x6c\x94\x33\x1b\xf5\x3d\x1b\x79\x66\x83\xa6\xd9" - "\xa0\x67\x36\xea\x6c\x36\xf2\xcc\x06\x2d\x73\xa0\x17\x73\x00\x37" - "\x07\xe3\xf8\x39\xd0\xa9\x39\x90\xc3\x1c\xc0\xce\x01\x1f\x73\xc0" - "\xc7\x1c\xe4\x99\x03\x59\xcc\x81\x1c\xe6\x80\x8f\x39\xa0\x6f\x0e" - "\xf2\xce\x41\x5d\xcf\x85\xfc\xe6\x42\x1f\xe7\x22\xff\xdc\x49\x78" - "\x80\x63\x2e\xca\x9a\x0b\xbe\xe6\x02\xcf\x5c\xe0\x99\x0b\x1c\x73" - "\x91\x7f\x2e\x68\x9d\x8b\xbc\x73\x91\x77\x2e\xca\x9d\x07\x1a\xe7" - "\x81\xb6\x79\x28\x73\x1e\xe0\xe6\xc1\xb2\xcf\x83\x4e\xcd\x43\x39" - "\xf3\x00\x3b\x0f\x65\xcd\x03\x9d\xf3\x20\x8b\x79\x90\xdb\x3c\xe4" +static unsigned int eth_z8e_uncompressed_length = 369604; +static unsigned int eth_z8e_length = 113069; +static unsigned char eth_z8e[113069 + 1] = + "\x78\x9c\xec\xbd\x7f\x7c\x54\xd5\xb5\x37\xbc\x66\x32\xc0\x24\x0d" + "\x4c\xb4\x94\x8e\x88\x3a\x2a\xb6\xa3\xa2\x46\xc5\x16\x2d\x6a\x2c" + "\x70\x1b\xef\x8b\x12\x21\x68\x90\x1f\x09\x36\xf8\x44\x45\x18\x21" + "\xc0\x04\x43\x26\x0c\xd8\x06\xca\xaf\x6a\xb4\x28\x81\xa4\x15\x6f" + "\xb1\xc5\x8a\xb7\x78\x4b\x5b\x7e\x8c\x12\xef\xa5\x36\xc9\x44\xc1" + "\xe7\x06\x3f\xb4\x4e\x79\x22\x4d\x79\x82\x4e\xc9\x40\x62\x32\x33" + "\xfb\xfd\xae\xbd\xcf\x99\x9c\x99\x9c\x09\x72\xef\xfd\xbc\xef\x3f" + "\xcd\xe7\x73\x72\x66\xef\xbd\xf6\xda\x6b\xad\xbd\xf6\xda\x6b\xff" + "\x38\x7b\x13\xfd\x37\xfe\xac\x47\x03\xff\x9d\xec\xff\xf8\xfb\xc7" + "\xdf\x3f\xfe\xfe\xf1\xf7\x8f\xbf\x7f\xfc\xfd\xe3\xef\xff\x9f\xbf" + "\xb3\x56\x1b\xbd\xbb\x85\xa8\xdb\x6f\x77\x86\x2c\xb7\x4e\xfe\xc9" + "\x0b\x22\x8a\x68\x4b\x88\xec\x4e\x7e\x6b\x0f\x3d\x8f\x78\xeb\x16" + "\xb2\x5f\x93\x43\xd9\x93\xb6\x13\xd5\x8e\x12\x9d\x2f\xbc\x24\xc2" + "\x6b\x5e\x12\x9d\x93\x5f\x23\x6a\x1c\x4b\xf4\xc2\x28\x11\x01\x9e" + "\x39\x21\x5a\x5b\xc9\x78\xd6\x20\xcc\xe9\x6b\x47\x89\x30\xe2\xcb" + "\x11\x1f\xe1\xf8\xd5\xa3\x80\x6b\x24\x91\xff\x25\xd1\x63\xc0\x6b" + "\xe7\xfc\x8c\x73\xf2\xd5\x92\x9e\x9d\x29\x78\x18\xc7\xbe\x10\x3d" + "\xb7\x70\x10\x1c\xd9\x9c\x5f\xd2\x86\x3c\x5d\x7e\x72\x46\xac\x64" + "\x89\xf8\x03\x5f\x43\xde\x08\x78\x72\x73\xde\xcd\x48\x17\x7e\xca" + "\x60\xbc\xc1\x9e\x28\x35\x56\x12\x01\x96\x5c\x55\x64\x39\x45\x99" + "\x77\x03\xde\xb2\x46\xe5\x77\x21\xce\x2a\xe3\x80\x87\xe3\x38\x0d" + "\xf1\x63\x39\xdc\xed\xcf\xcc\x4f\xe0\x64\x59\x70\xba\x35\x60\x45" + "\xba\x05\xf9\x6c\xc8\xb7\xac\xb1\x81\x48\xe1\xca\xc9\x0c\x51\x66" + "\x9d\x96\xaf\x1a\xf9\xaa\x39\xdf\x61\xa4\x4f\xaa\x53\x3c\xce\xa8" + "\x23\x2b\xa7\xb3\x7c\x51\x8e\x15\x70\xbb\x74\xfc\x0a\x87\xf5\x7e" + "\x8d\x9f\xaf\x20\xad\x31\x39\xcd\xf6\xbc\x96\x96\x8d\xb4\x50\x72" + "\x1a\xf0\xa9\xb4\x4b\x90\x16\x4d\x93\x76\x69\xb7\x3f\xcb\x99\x9c" + "\x76\x30\x57\x4b\xfb\x3a\xd2\xc6\x27\xa7\x59\xf4\x7c\x4e\xa4\x15" + "\xe8\x69\xc6\x7a\x51\x1a\x66\xc3\x33\xc4\x4e\x34\x14\xcf\x30\xbb" + "\x5e\x57\x4b\x9d\x22\xee\xbb\x8c\x6c\x62\xfd\x7e\x7b\xdc\x2f\x28" + "\xe8\xed\x21\xd7\x68\xf2\x9d\xa4\xac\x00\xf0\xd2\xa6\x95\x64\xf7" + "\x79\x44\x4f\xd0\xdb\x49\x2d\xe1\x4e\xf2\x85\x45\x47\x30\x7a\x8e" + "\xaa\xce\x91\x3d\x18\x3d\x43\x55\xcf\x90\xb3\xb1\xf2\x53\x32\xd3" + "\x83\xb8\x55\x90\x6f\x0c\xe7\x6d\xa7\x96\xba\x76\xf2\xd5\x25\xe7" + "\xf5\x5d\x41\xce\x66\x84\xa1\x03\x8e\xf2\xad\x22\xde\xe8\x8a\x52" + "\x34\x6b\xbf\xbd\xf2\x35\xb2\xf9\xae\x26\x6b\x73\x69\x80\x5c\xdf" + "\x60\x5a\xbe\x52\xc3\xb4\xac\x7d\x92\xec\xaf\x3e\x1e\xb0\x8a\xf5" + "\x8d\xf6\x5f\xf5\xf6\x58\xd7\x9c\x26\xdb\x61\xe7\x64\x3a\xec\x3c" + "\x41\xc1\xad\x77\x53\x30\x12\xa5\x4d\x4f\x52\xf6\xe1\xc8\x44\x0a" + "\xae\x8d\x13\xe3\x0b\x2e\x9c\x88\xf7\x39\xc0\x74\x92\x6b\x09\xd1" + "\x29\xfa\x8a\xb7\x16\x78\x42\x0a\x27\x74\xe0\x2b\x6b\xdf\xf1\x10" + "\xb1\xcc\x38\x9c\x46\x9f\x73\x5e\x60\x5d\xb5\x4a\x1d\xea\xac\x1f" + "\x25\x3a\xae\xad\xa5\x91\x80\xcf\x41\xfe\xc6\x90\x75\xef\x3e\x4d" + "\x9f\x3b\x6e\xa9\xa5\x9c\xbd\x55\x61\x1b\xf4\xb0\xd3\xe1\x85\xfe" + "\xad\xa4\x21\x8e\x28\x59\xc0\xc3\xeb\xf5\x88\xbb\x76\xa4\xcc\xd3" + "\x13\xa2\xb7\xda\x38\x8f\xf8\xfa\xec\xbf\xc7\xbf\x3e\x3b\x1c\xff" + "\xc9\xec\xb3\xe2\x27\xb3\xbb\x62\x3f\x99\x1d\xf1\x55\x90\x3d\xf6" + "\xf5\xd9\xe7\x5a\x3c\x52\x56\x39\x2d\x1e\xc8\x2a\x46\xf6\x55\x67" + "\x28\x67\xde\x33\xa8\xa3\xe8\x9f\x68\xd5\x13\xe4\x8c\x67\xbe\x1b" + "\x08\x46\x3f\xa2\x79\x95\x24\xf0\xbb\xd5\x8c\xf6\xae\xac\xc6\x7c" + "\xa5\x5b\x76\xb4\xe5\x6c\x0f\x68\x95\xe5\x76\x65\x35\x69\xf1\x4c" + "\x4f\x76\x8d\x1e\x2f\xb2\x1a\x0b\x51\x1f\xbe\x11\xab\x2d\xb4\xa3" + "\x97\xe8\x96\x38\x59\x4e\x53\x76\x2d\x78\xc9\x31\xe2\x9f\x3e\xe5" + "\xe1\xbb\x29\xf7\xce\x9b\x72\x6f\xff\xf6\x84\xdb\xe9\x81\xfb\x26" + "\xdd\x4d\x05\x8f\x4c\xc7\xbf\x07\xef\xa6\xa2\x7f\xba\x1f\x3f\x26" + "\xdd\x7d\x6b\xee\xf7\x6e\x2a\x98\x74\xff\x94\x9b\x26\xd0\x43\x85" + "\xb7\xe5\xde\x76\x1b\xdd\x37\x65\xea\xad\xb9\xb9\xda\xfb\xd6\x5c" + "\x06\x7a\x74\xc2\x94\x19\x37\x15\x2c\x59\x5c\xbe\xf8\xa6\x07\xef" + "\x9f\x64\xb4\x6f\x39\xf1\xe5\x71\xda\x01\x1d\x17\x5d\xf9\xc4\xb2" + "\x0f\x54\x9d\x45\xfd\x0d\xff\x29\xe4\x1f\x56\xba\x9f\xbd\x07\xf4" + "\xdb\xba\xfd\xc3\xf3\x43\xd6\xb7\x9d\x4c\xbf\xeb\x1a\xae\xe3\x11" + "\x5b\xb9\x3d\xa3\x0e\x22\xcc\x5f\x46\xa5\x84\x59\xa8\xd7\x53\x3c" + "\x6b\x7f\x6e\x64\x69\x99\xb4\x3b\x88\x5f\x8b\xbc\x21\x8e\xdf\x84" + "\x70\xa3\x27\x8f\xc4\xab\xf9\x16\x9b\x4b\xda\x0e\x2e\x2f\xb7\x96" + "\x69\xc8\x6a\x2a\x12\x7d\x45\xa4\xc5\xb5\xc6\x39\xbc\xbe\x69\x96" + "\xf0\x21\x6e\xa5\x8c\xfb\x00\xe1\xa2\x6e\xd8\xb3\x6e\x51\x46\xf1" + "\xa5\x45\xac\x6f\x19\xa0\x65\x0a\x78\xe8\x90\xf0\x5d\x32\xff\x50" + "\xc4\x5d\x07\x7c\xb3\xf0\x3c\xaa\xe1\x84\x6d\xbb\x24\x8c\xfc\xb3" + "\xe3\xa2\x88\x44\xf6\x65\x76\xfc\x9e\x13\x58\xd9\x49\xa7\x3c\x64" + "\x0d\x21\x2d\xee\x2b\x23\x43\xf9\x11\xee\x0f\x50\x96\xad\xbb\xaf" + "\x8c\x42\x34\xbc\x47\xe2\x62\x9c\xfd\x30\xed\x5c\x26\x78\x0c\x43" + "\x4e\x6f\x77\xfb\x47\x80\xff\x7f\x33\xca\xa8\x86\xe1\xc1\x73\x07" + "\xf3\x01\x1c\x21\x2e\x03\x38\xad\x1a\x4e\x3d\x3f\xcb\xf9\xa0\x92" + "\xf3\x88\x3d\x29\x72\x6e\x43\xda\x61\xe8\x7d\x24\xc3\x2b\xd3\x5b" + "\xd1\xae\x6a\x39\x1d\xf9\xcb\x99\x46\x65\x8b\x65\x5a\x67\x72\x5e" + "\x87\xd3\x50\x47\x59\xaa\x8e\x1c\x39\x7a\x1d\x71\xfe\x48\xe6\x71" + "\x8f\x56\xfe\x11\xc0\x64\x20\x3d\x37\x05\xc7\x54\xa4\x35\x71\xbd" + "\x8d\xf0\x50\x06\xe7\xd9\x31\x4a\xb7\xff\x12\x5f\x49\x32\x7c\xce" + "\x18\xc0\x7f\xb0\x59\xe1\xfc\x04\x3a\x6d\x83\x2e\x75\x1e\xf6\x72" + "\x3f\xe7\xd8\x90\x2c\x1f\xc7\x2e\x96\x8b\x94\x87\x90\xf2\xd0\xf9" + "\xe9\x44\xde\x53\x80\xdf\x9f\x02\xdf\x06\x79\xcd\x92\xf5\xdf\x35" + "\x00\xfe\x33\xc0\x77\x26\xc3\xe7\x64\x4b\xfd\x51\x79\xf4\x7a\x2c" + "\xd7\xea\xd5\x92\x52\x26\xf3\x33\xbc\xdb\x9f\x93\xc2\xff\x25\xfb" + "\x80\xfb\xfc\x26\xd5\x46\x46\xa0\xde\x6f\x02\xde\x05\x23\xc2\xe4" + "\x40\xd8\x61\x08\xe7\xe0\xb9\x44\x74\xff\x3f\x71\xc4\xdd\x86\xb8" + "\xe7\xd0\x9e\xac\x08\xc7\x54\xf8\x92\xb7\x10\xb6\x80\x9e\x47\x05" + "\xeb\x59\x77\x3e\xeb\xd0\x78\xc4\xbf\xae\xa5\xff\x54\xc2\x03\x26" + "\xce\x7a\xd6\x95\xd0\xd9\x97\x99\x3e\xd6\x5b\x3d\x9f\x58\x21\xd3" + "\x26\x21\xed\x39\xbc\xef\xc7\xfb\x19\xbc\x1f\xc2\xfb\x01\xdf\x17" + "\xe4\xf4\xc5\x44\x87\x16\xbe\x13\xef\xe9\x78\x5f\x87\xf7\x0c\xbc" + "\x2f\xe1\x36\xc6\x3c\x87\x9f\x45\xfb\xc9\x92\x6d\x69\xa8\x51\x96" + "\xc6\xf6\x95\x88\x53\x70\x56\xa3\xfc\x40\x07\xb7\xdd\x02\xf0\xd9" + "\xc1\x65\x6a\xb8\x86\x98\xe0\xb2\x99\xe0\xb2\x18\x71\x85\x28\x67" + "\xbf\xcf\x2b\x04\xde\xbb\x46\x44\x38\x7c\x49\x03\xe4\x60\x43\x78" + "\x2d\xcb\x44\xd9\x90\x4b\x8e\x24\xd7\xed\xf0\x72\x96\x89\xae\x3b" + "\x5a\x59\x43\x8c\x65\x99\xd9\xea\x3e\xeb\xc8\x77\xd0\x0f\x5f\xda" + "\xe7\x73\x93\xa8\xd9\xef\xba\x89\xc8\x3a\xae\x9a\x32\x83\xd1\x63" + "\x34\x2d\x2a\x62\x78\xfa\xae\x27\xba\x24\x18\x6d\xa2\x6f\x12\x5d" + "\x1d\x8c\xd6\xa2\x2f\x28\xe7\xb4\x43\xd7\x92\xc5\x82\xb7\xef\x06" + "\xb2\x5a\x82\xd1\xf1\x88\xdf\x49\x63\xc9\x66\xf9\xa7\xe7\x44\x77" + "\x30\x3a\x19\xe1\x85\x54\x1c\xa3\x9c\xa9\x43\x84\x6f\x5a\x4c\x7c" + "\xf2\x4f\x43\xe2\x22\x18\x6d\x44\x7c\x29\x4d\x8b\x7d\x21\xa6\xc5" + "\xba\xf1\x7c\x8e\xe7\x13\x3c\x87\xf0\xf8\x84\x58\xb7\xdf\xd5\x87" + "\x3e\x02\x34\xe5\xf6\x89\xb2\x0c\xd0\x94\x8b\x3e\x43\x88\xac\xfd" + "\x79\xc1\xe8\x44\xe0\xb3\x12\x60\x72\xfb\xfa\x90\xb6\x7e\xff\xbd" + "\x12\x26\x6b\xff\x3d\x32\x5c\xb3\xbf\x40\xd8\xf7\xe7\xdd\x54\x4d" + "\xc3\x98\xfe\x38\x64\x16\x8c\xa2\x9f\x8e\x7e\x4a\xd3\x2a\xc2\x82" + "\x79\x18\xb1\x5a\xe0\xf7\x21\x01\xb9\x3a\xa6\x55\xf8\x44\x71\x94" + "\xec\x22\x93\x71\x77\x32\xde\x02\xe0\x7a\x40\xc3\xe5\x01\x6c\x98" + "\xe1\x18\x97\x8e\x87\x71\x30\xec\xb4\x18\xf4\x7d\xdd\x7e\x4f\xdf" + "\xba\xfd\x25\x78\xaa\xf1\xec\x41\xde\x77\xfb\x9e\x95\x72\x6c\xc5" + "\xef\x50\x0f\xea\x55\xca\x31\x46\xc3\x00\xdb\x8a\xfa\x98\xdc\x2d" + "\xe9\x3e\x40\x92\xee\xf5\xfb\x45\x8f\xa2\x3f\xae\xf1\x13\xe3\xf8" + "\x08\xea\x0d\x30\xae\x88\x4c\x3b\x70\x15\xf2\x15\xca\x7c\x35\x07" + "\x5c\xc2\x7e\x20\x37\x0e\x7d\x84\x3c\xab\x59\x96\x90\x6f\x35\xfb" + "\x49\x2c\x53\xb1\x0e\xe9\x99\x07\x72\xfb\xd6\x1d\xc8\x43\xfe\xe9" + "\x7d\x02\xb4\x64\x1d\x28\xe9\x51\x65\x16\x03\xcf\x9c\x6e\xc6\x69" + "\x3f\x50\x02\x5c\x9e\x2f\xfc\x2e\xc8\x42\xf4\x4c\x8b\xae\x8e\x16" + "\x57\x50\x86\x9b\xaa\x41\xef\x76\xf8\x63\x0b\x81\x6f\x2d\xa7\x7d" + "\x32\xad\x82\xbe\x8a\xb2\x0e\x01\x6f\x09\x97\x87\x32\x3c\xc0\xf9" + "\x34\x70\x95\x32\x4d\xbd\x7e\xca\x41\xb8\xba\x57\xd1\xd7\x10\xaf" + "\x39\x10\x88\xdb\x0f\xec\x31\xea\x8f\x92\x19\xeb\xcd\x1b\x1c\x97" + "\xa3\xeb\x4a\xac\xe6\xc0\x96\x1b\x89\x72\x1e\x8c\x88\x28\xeb\xcb" + "\x2d\xe4\xb1\xb4\x44\x9a\xa8\x38\x6a\xa7\x16\xcf\x5e\xba\x81\xd8" + "\x67\x8b\x50\x4b\xa4\x16\xe1\x8d\x78\x97\x53\x73\xe7\x4e\x62\x1a" + "\x1f\xf4\x44\x56\xc7\xec\x07\x73\x9a\x3b\x1f\x20\xe4\x3f\x04\x1a" + "\xe3\xf3\x3c\xb6\xea\x16\x4f\x84\xc3\xbe\xe6\x4e\xe8\x68\x4c\xc4" + "\xa2\x35\x07\xaa\xa3\xf6\x83\xae\x07\xcf\x89\xf0\x03\x9d\xd5\x43" + "\x10\xd7\xe7\xb0\x88\xa8\xc3\xeb\x13\xcd\x9d\x6b\x69\xde\x39\xb2" + "\x34\x97\xed\x95\xba\x3a\xcf\xe3\x21\x99\xff\x5c\xd4\x31\xb7\xb3" + "\x9a\xe6\x96\xd1\x08\xc0\x7f\xce\xba\x2b\x46\x54\x53\x53\x7b\x29" + "\x3d\x70\x26\x9a\xf1\xe0\xb9\x3e\xd1\x54\x52\x4b\xcd\x65\xb5\x2c" + "\x8f\x06\xf6\x99\x1e\x38\xd3\x25\x1e\x3c\xd7\x2d\x9a\xcb\xde\xa0" + "\xa6\x92\xbd\x34\xf5\xd3\x80\x23\xb6\xee\xc0\x96\x78\xe6\x81\x3d" + "\xf1\x75\x07\x02\xd1\x75\x07\xaa\x63\x99\x07\x73\xa2\x99\x07\x5d" + "\x62\xfd\xc1\x2d\x90\x5f\xa6\xac\x8b\xac\x83\x9b\xf0\xdb\x25\xeb" + "\xd7\x7e\xb0\x41\xd4\x1c\x0c\xf4\xad\x3b\xb8\x27\xe8\x9d\x48\x22" + "\xf3\x60\x03\xeb\xbc\x58\x77\x30\x00\xb8\x80\xd2\x91\x83\xad\xac" + "\x23\x80\x09\xe1\x09\xf7\xad\x3b\x84\xb6\x72\xa8\x00\x38\x2e\x51" + "\xf8\x0e\x4d\x63\xb8\xb8\xfd\x50\x41\xbc\xe6\x50\x89\xb0\x1f\xf2" + "\xc0\xb7\xb2\x3e\xf8\x4c\x0f\xe4\x07\xd9\x79\x21\x77\x3f\xda\x87" + "\x37\x86\x70\x8c\xe6\x3d\x43\xbe\xa0\xf7\x04\x7e\x9f\x20\x71\x70" + "\x0b\x3d\xf8\xcc\x21\xc1\x69\x0f\x3e\xe3\x13\x90\x8d\x23\x9e\x09" + "\x3c\xeb\x80\x27\x13\x78\xd6\x07\x2e\xed\x61\x9d\xaa\x09\xe4\x3c" + "\xf0\x9c\x08\x0b\x7b\xc0\x13\x1f\x4a\xb2\x6d\xc4\x0f\x0a\xa1\xda" + "\x47\x27\x74\x72\x74\x75\xb1\x97\x1a\xc4\xba\x40\x8e\xc8\x0c\x20" + "\xdf\xbb\xff\x0a\xbb\x95\x21\xa4\x8d\x79\x77\x4f\xdf\xba\x77\x5b" + "\xf1\x04\xfa\xdb\x14\xb7\xbd\x77\xf7\x7c\xd9\xf1\x43\xb7\x7f\x14" + "\xc6\x3f\xc7\xa4\xff\x84\xdf\xe8\xff\x3f\xda\xab\xfd\x3e\x11\xa2" + "\xfd\xd9\xd2\xa7\x84\x2d\xf3\x54\xd1\xd7\x4e\xd3\xd7\xb7\x80\x5f" + "\xc2\xef\x6c\xfc\xae\x9d\x76\xfd\x21\x11\xdf\x60\x9b\x80\x3a\xed" + "\x66\x5b\x23\xfc\xe3\xd9\xff\xc8\xeb\xee\x2e\xb3\x8b\x6e\x77\xb6" + "\xc8\x6a\x7e\x49\xf4\x39\xd9\xf7\x75\x20\x3c\x02\xb2\x1b\x8b\xf7" + "\xa5\xdb\xcf\xd3\x48\x3c\xce\xed\xfe\x78\x35\xdb\x52\xfc\xce\x15" + "\x2b\x9c\x59\x9b\x96\xd3\x38\x47\x84\xec\xf5\xfe\x78\x91\x63\x75" + "\x0e\xc1\xef\x1e\xc9\xbf\x85\x3f\x90\x5b\x7f\x9e\x6c\xec\x8f\xc7" + "\x87\xa3\x3c\xaf\x43\x88\xa5\x6e\xaa\x5f\x02\x7b\x83\xb1\x69\xbd" + "\x5f\xec\x89\x75\xbb\xad\x4c\xa7\x4e\x0b\xd3\x06\x3a\xaf\x00\x9d" + "\x3b\x67\x56\xe4\xd1\x7b\xf0\x11\xcc\x6c\x76\xb7\xff\xeb\x09\xfe" + "\xd3\xa4\xb7\xeb\x32\x31\x4f\x77\xda\x74\x39\xa5\x19\x7b\x8c\xe4" + "\xb6\x1c\x3b\x2f\xc2\x9b\x17\x11\xcb\xc2\xe9\x8b\x8a\xff\x03\x7b" + "\x5a\x5d\x15\xa3\x2b\xa6\x55\x5c\x25\x82\x61\x11\x08\x7a\xcf\xc8" + "\x71\x7f\x3d\x60\xaa\xa2\x22\xae\x8f\xbf\x6b\x5f\x82\xef\xb9\xae" + "\xd9\x2b\xd6\x35\x97\x77\x2d\x17\x51\xf8\x47\xed\x28\xd3\x1b\xa2" + "\x5b\xa3\xaa\x6e\x0e\x34\xc0\x7f\x68\xef\xb2\x37\x97\x03\xf7\x25" + "\x8c\xbb\xc5\x23\x02\xf1\xcc\xe6\x4a\xc0\x35\x84\xe8\x2f\xd9\xc6" + "\xb1\xff\x5a\xe0\x5c\x0b\x9c\x48\xdb\x1f\xa2\x2b\x06\xcc\x01\xa8" + "\x59\x0a\x42\xbd\xb8\xfa\x27\x37\x2c\x9a\xfa\xe8\x7f\x39\x78\xf2" + "\xcc\x93\x75\xbe\xd1\xf6\x5c\x5d\xf0\xf9\x7d\xab\x68\x0c\xea\xe1" + "\xf2\xd3\x74\xd9\xad\xe8\x87\x4f\x09\xbf\xf3\xc8\xab\x2b\x7b\x30" + "\x26\xbf\x6c\x62\x88\x76\xd5\xa6\x93\x9b\x60\xdb\x77\x5e\x74\x6c" + "\x5e\x9e\x90\xd9\x5f\xa6\x55\xc4\x05\xff\xe6\x36\x55\x8f\x78\x96" + "\x07\xf0\xac\xd5\x65\x91\x46\xfe\x36\x51\xd3\x5c\xa3\x7c\xea\xcb" + "\xda\x05\xc6\xc8\x81\x2b\xa3\xfc\xfb\x53\xe9\x33\xd4\x1c\xdc\xd3" + "\x05\x5b\xc1\xe3\x33\x8c\xef\x22\x18\x4f\xf7\x00\x67\x5b\x88\xae" + "\x0e\x69\xf3\x11\x91\x60\x74\x0a\xdb\x8d\x3d\xe9\xeb\x57\xc7\x3f" + "\xe6\x98\x86\x33\x20\xec\xc7\xf7\x56\x29\xba\x7b\xaa\x22\xa2\x83" + "\x71\xf3\xf8\xa7\x1d\x30\x3b\x50\x0f\xa2\xe6\xf8\xae\x4d\x1c\xb7" + "\xbc\x97\xe3\x3e\x82\x1e\x0b\x45\xd7\x98\x8f\x20\xb7\xaf\xc3\xc7" + "\x0d\x07\x56\xf6\xd2\xa9\x4a\xca\xe0\x71\x67\xb7\x7f\xf4\xc2\x10" + "\xdd\xd3\x20\xc7\x7e\x7e\xfa\x45\x97\x75\xe6\x4c\xc4\x55\x87\xe8" + "\xde\x46\x19\x67\xa5\xaf\x21\xbc\x25\x01\x03\x1c\x08\x37\x18\xf2" + "\xcc\xec\xb2\xde\xf0\x0b\xc4\xed\x4d\xc9\xd3\x98\x92\xe7\x98\x1e" + "\x06\x7d\x9d\xae\xe5\x92\xaf\x17\x91\xbf\x01\x4f\xb5\x56\x6e\x4f" + "\x32\x8e\xcb\xed\xc9\x38\x2e\x77\x0e\xa4\xf5\xf2\x71\x29\x79\x26" + "\xa6\xe4\x99\x3a\x90\xd6\xcb\x4b\x52\xf2\x78\x52\xf2\x54\xeb\x61" + "\x6d\x0e\x26\x17\x71\xb5\x29\x79\x76\xa6\xe4\xd9\x6b\x08\x7f\x15" + "\xe1\x04\xff\x5c\xd7\xf0\x07\x04\x8f\xab\xa1\xb7\xac\xc3\x0d\x6c" + "\x4f\x79\xce\x63\x69\x25\xdc\x8b\x75\x07\x1b\x00\x1f\xd1\xf1\xeb" + "\xba\x23\xe1\x95\xfe\x74\x28\xfd\x19\xe3\x4c\xc0\xc0\xc5\x6a\x74" + "\x45\x08\xb2\xec\xe0\xf9\xb2\x60\x64\x8a\x36\xde\x1c\x33\x87\x75" + "\x4a\x2f\xd3\x51\xa9\xf4\x86\xe7\x0e\xf4\x32\x43\xd0\x15\xee\xaf" + "\x0c\xfa\xd9\xce\x65\x69\x65\x54\xea\x65\x00\x77\x3b\xeb\x8f\x9c" + "\x2f\x01\x7e\x2d\xdf\x1e\x25\xf7\x31\x3b\x93\xe5\x31\x66\x6f\xb2" + "\x3c\xc6\x34\x1a\x65\xc8\x36\x22\x44\x97\xd7\xa4\xf3\x71\xe1\xef" + "\x78\xe0\x93\x5f\xe9\x8b\x8b\x93\xa7\xe8\x8a\x59\xd0\xfb\x0c\x7e" + "\x4b\x3f\xaa\x07\xfc\xda\x8f\x4e\x94\x3e\x54\xe5\x39\xf4\xb9\x12" + "\xf6\xab\x80\x6d\x07\xcc\xfd\x1a\xec\xfd\x6a\x4e\x4f\xbe\x87\xf1" + "\x1b\xfe\xd4\xd3\xb0\x45\x25\x61\x1f\xf7\xdb\xc7\x3d\x7a\x18\x63" + "\x12\x8c\x09\xaf\x70\x8a\x75\x47\x27\x9a\xd3\x82\x3e\x53\xd9\xd6" + "\x4e\x94\xf3\x75\xb6\x11\x90\xdf\x65\xb0\x33\x7f\xa9\x5a\x45\x5f" + "\x65\xfb\x20\x32\x9b\x6b\x95\xbc\xaf\xd8\x2d\xfc\xd5\x14\x44\x6f" + "\xe8\x59\x4e\x97\xc3\x9e\x6e\x38\x4d\x57\xbc\x53\x5c\xe9\x02\xad" + "\x18\xc7\x7e\x46\x24\xfb\x8e\xcc\xe6\x2d\xdc\x8f\xd6\x7f\xc6\x63" + "\xca\x2b\x42\xba\x6d\xc1\xef\xce\xc1\xec\x3c\xea\x2e\xac\xc6\x54" + "\x57\xce\xe2\x3a\x3a\x49\x57\x4e\x66\x7e\xd5\x5c\xe8\x95\x77\x88" + "\xf3\x62\x8e\x60\x5f\x1c\xbe\x46\x88\xae\xf4\xe0\x1d\x96\x8f\x9f" + "\x4a\xb4\x70\x08\x70\x63\xc5\xf9\x38\xc3\xa0\x0e\xae\x9c\x28\xfc" + "\x16\xb6\x71\xfb\xbb\xfd\x57\x96\x85\x68\x7c\x40\x8d\xab\xaf\x1c" + "\xcf\xb8\xd2\xd0\x10\xea\x9f\x67\xb9\xf2\x03\x57\x95\x85\xe9\x78" + "\x4d\xda\x24\xe0\xaa\xb7\xaa\xfe\x36\x0e\x5a\x77\xf8\xe3\x65\xe8" + "\x5b\xcb\xe2\xeb\xff\xb7\x57\xfe\xd6\xd2\x98\x8e\x38\xca\x37\xc5" + "\x9f\xb0\x51\x57\xad\xd2\xec\x5c\x6b\xdc\x7e\x30\xac\xd9\x67\x1e" + "\x17\x66\x9e\xa4\xab\x2a\x11\xc6\x58\xf3\x2a\xd7\xaf\xe2\x61\xeb" + "\x3b\xe5\x7a\x17\x71\x55\xa5\xc9\x93\x8f\xa7\x08\x4f\xa9\x16\xf6" + "\x48\x1e\xba\x4a\x31\x4e\xbb\xaa\x32\x9e\x09\xf9\xd4\xb0\xbc\xae" + "\x2a\x10\x5d\x63\xad\xfa\xef\xfa\xbf\xf3\xdc\xc0\x55\xd0\xff\x2b" + "\x2b\xd3\xd6\x47\x82\x56\xd7\x9d\x06\x5a\x43\x06\x5a\xed\x27\xc9" + "\x35\x41\xa3\xb5\x29\x99\x56\xd7\x04\x3c\xe8\xd2\x5c\x63\xf0\x8c" + "\xd3\xc2\x86\xe7\xaa\x30\xca\x47\x5d\x5c\xd1\xa3\xea\x84\xe3\x50" + "\x06\xcb\xe2\xef\x64\x8f\xf7\x15\x11\xcf\x8f\x72\x3c\xcb\x93\xe3" + "\xe3\xf0\x83\x10\xce\x41\x7a\x0e\xeb\xca\xe6\xb8\xd2\x05\x73\x9f" + "\xc2\x55\x94\xf0\xbd\xe0\x7b\xb2\xfe\x76\xd2\xd5\xa5\xd0\x71\xf0" + "\xf1\x9f\x5e\xd5\xd7\x5c\xbd\x80\xc3\x68\x5b\x7f\xc1\xef\x92\x66" + "\x48\xaf\x77\x7d\x53\x7e\x9f\x95\x86\xf5\x5a\x29\x2f\xba\xc9\x36" + "\x27\x9a\xd5\x58\x18\xec\xd8\x4b\x2d\xd1\x7f\x25\xd7\x93\x12\xc7" + "\xac\x60\x19\x6c\x55\x85\x88\xbd\xd9\xbb\x0b\xe3\xb9\xcf\x03\xe8" + "\x9b\xaf\x3a\x4d\x57\x4b\xfa\x7f\x74\x12\xdc\xcd\x93\xb8\x15\x3f" + "\xd9\xb6\x09\x9b\x1e\x87\x7d\x39\x25\x22\xf0\xe3\xb2\x36\xf6\xd2" + "\xb8\x57\x56\x52\x6e\x5d\x2f\x8d\xdd\xd1\x4b\x6e\xf1\x57\xb7\xb5" + "\x0e\xfe\xd9\xbc\x73\x39\x04\x1d\x2a\x1a\xe1\x21\xfb\x8e\x95\xf0" + "\xd3\xa2\x64\x89\x6d\x84\x9f\x16\x85\x9f\xf6\xb9\x9b\xdb\x52\xc2" + "\x4f\xeb\xeb\x63\x3f\xad\xb9\x87\x61\xd0\x06\x7b\x86\x97\x91\x25" + "\xbb\x84\x72\x40\x9f\xef\x33\x72\xbd\x9c\xdd\x0e\x1f\x11\x3c\x87" + "\x34\x7e\x21\xb3\xdd\x8e\x32\x1a\x26\x79\x45\xfb\x16\xeb\xfe\xd3" + "\x9b\x6e\xdd\x83\x6d\x6d\xe0\xca\x08\xcf\x47\x33\x0f\x6f\xf1\x5c" + "\xed\xde\xd1\x3d\xb6\xa5\x75\xa2\x87\xe3\xcb\xaf\x16\x3d\x88\xdf" + "\xca\x65\xef\x41\x7c\xb7\xff\xea\x40\xc8\xfa\xd6\x89\x8b\x99\x6f" + "\x67\x7f\x42\xae\x89\xc8\xbe\xe3\x1a\x4a\xe9\x7f\x60\x33\xae\x19" + "\xa9\xdb\xdb\xf2\xab\xc9\x59\xee\x12\x1d\x83\xcc\x49\x47\x74\x3f" + "\xef\xf0\x18\x99\xb7\x20\xe1\x77\xa8\xb5\x15\x52\x3e\xc3\x35\xb2" + "\x0d\xb3\x4f\xc0\x7d\x0c\xfb\xc1\x3c\x87\xaa\xe6\xbd\xae\x59\x6b" + "\xf0\x55\xb8\x8f\x89\xec\x5d\xd9\x63\xe3\xfc\xcc\xa7\x96\xbf\x34" + "\x9d\x3d\xe7\xb5\x1e\xf8\x22\x5b\x5b\xea\x88\x5a\xe0\xf2\x35\xd7" + "\xe5\xc1\x3f\xea\x95\xbe\xe8\x49\xba\x46\xce\x99\x07\x16\xf5\x12" + "\xff\x0e\x56\xde\x45\x41\xc0\x28\x7b\x7a\xed\xd8\x46\xaf\x9a\xff" + "\x6b\xf4\x9c\xe5\x75\x1f\x11\x58\xc2\x76\xe7\xda\x87\x0e\x57\x86" + "\x41\xd7\xb5\x63\xf4\x39\xe9\x10\x5d\x5b\xc0\xe5\x77\xd5\x1c\xdf" + "\xc2\xf3\x7b\x72\xce\x2e\x32\x81\x61\xf2\x42\x74\x4d\x62\x2d\x09" + "\x7e\x2c\xec\xde\x35\x3d\x83\xd0\x9a\xa3\xfa\xac\x6b\xbd\xc9\xfe" + "\xc5\x10\xf4\x73\xd7\x6e\x48\xee\xe7\xae\xad\x4b\xee\xe7\xae\xdd" + "\x9d\xec\x5f\x58\xe1\x5f\x5c\x1b\x48\xc9\xd3\x9a\x92\x27\x64\xc8" + "\xb3\x45\x2b\x27\x92\x9c\x67\xac\x2d\x39\xcf\xd8\x91\x86\x30\x78" + "\x1c\x3b\x56\xaf\x9f\x2e\xb9\x5e\x31\x76\xbc\x21\x6c\xad\x95\x6b" + "\x7a\x63\xf3\xf5\x38\xf4\xa3\x04\xff\x30\xc2\x3a\xa1\xe1\x2b\x4d" + "\xd1\x31\x86\xf7\xa6\xd0\x50\x93\x42\xc3\xd6\x84\x4f\x03\xfc\xa8" + "\xaf\x77\x4f\xd1\x75\x1e\xa9\x43\xec\xd3\x55\xd1\x34\x0e\x03\xd7" + "\x56\xc0\x43\x0e\x63\x8f\xa4\xe0\x6b\x4b\xc1\xd7\x61\x08\xe7\x20" + "\xdc\x63\xe0\x21\x27\xc3\x49\x16\xe8\x0b\xc6\x14\xd7\xe5\xe8\xf1" + "\xec\xdb\x82\xde\x0e\x9f\x5c\x2b\xca\xe3\x35\xa9\x4b\x4f\xd2\xd8" + "\x18\xfb\xc1\x0a\xe7\x75\x46\xff\x8f\x14\x5f\xd7\x15\x24\xd3\x71" + "\x5d\x49\x32\x1d\xd7\x79\x0c\x7c\x45\x1c\xab\xe9\x21\x47\x74\xfa" + "\x2c\xf6\x93\x79\xdd\x90\xfd\x55\xf8\x6d\x4e\x94\x99\xc3\xeb\x60" + "\xa7\xca\x29\x23\xe8\xed\x80\x1f\xd2\x1c\x49\xab\x4f\x59\xc7\x1b" + "\xb4\x75\x14\x17\xf0\xb7\xea\xfa\x88\xdf\x18\xff\x5e\x3b\x47\xda" + "\xe0\xf5\x47\x03\xc2\x57\xb4\x15\x72\x44\x5f\xfe\x8d\xf7\x54\x7f" + "\x72\x7c\x2f\xb7\x45\xf8\x4b\x1d\xb0\x33\xd9\x6a\xbe\xfa\x1b\x39" + "\x06\x7d\x8e\xb8\x56\xde\x2b\x4e\xd2\x37\x3e\x60\x3b\xc4\xfe\x1f" + "\xfb\xfc\x87\x23\x61\xf4\x0d\xa7\x89\x69\x46\x5a\xab\x96\x2f\xdf" + "\x90\x2f\xcc\x6d\x8a\xe1\x39\xed\x96\x28\xd9\x38\x0f\x70\x8c\x94" + "\xe3\x01\xe0\x3b\x8c\x36\x8a\x3c\x95\x7a\x1e\xc0\xca\x3c\x8e\x72" + "\xb2\xdd\x5c\x49\xb6\xc0\xca\x93\x12\xb7\x56\xdf\x1d\x1b\x21\x97" + "\x60\x65\x07\x7c\xc3\x36\x1e\x53\xdb\x02\x55\x27\x19\x4f\x6b\x46" + "\x0f\xd9\xbb\xd6\x1d\xc7\x98\xe1\x1b\xad\xb1\x75\xc7\xb7\xc6\x6b" + "\x8e\xef\x09\xd1\x75\x3d\xd0\x3f\x53\x9b\x65\xbe\x46\x48\x8e\xcd" + "\xfe\x78\x5b\xa0\xaa\x9d\x71\x46\xb9\xdf\x0d\x3a\xa3\xd4\x52\x17" + "\x45\x3f\x43\x39\x72\xad\x10\x63\xdb\x60\x03\x7c\x53\x8c\xdb\x8a" + "\xbd\x94\x07\x5f\xa3\x4d\x24\xf2\x45\x90\xef\x9b\xe3\x99\xd6\xb5" + "\x1c\x8f\xfc\xb0\x99\x61\xf6\x65\xd3\xf4\xeb\x0e\x86\x0b\x5c\xc3" + "\x7d\xfb\x37\x17\x2a\xdf\x86\xf2\xe1\xcb\xb4\x99\xae\x9f\x59\x29" + "\xd8\xed\xff\xe6\xae\x10\x4d\xca\xd7\x75\xed\xf0\x56\x59\xdf\x18" + "\x83\x7e\x13\xed\xff\x1b\xe1\x74\x3e\x84\xa6\x97\x1e\xc0\x0e\x03" + "\x6c\xe7\x60\xb0\x4c\xf7\x61\xf0\x2d\xd6\x37\x95\xbc\x5a\x95\x3b" + "\x44\xd3\x29\xf4\xe5\xee\xb1\x7a\xbe\x2f\xc3\x1f\xdb\x63\xb6\x09" + "\xe8\x17\x22\x6a\x2e\xfa\xfa\x97\x79\xed\x12\x78\x30\xfe\xfb\xe6" + "\x16\x8d\x87\xaf\x20\x8c\xfa\xff\x66\x8f\xbe\xee\xc5\x7d\xdf\x52" + "\x0f\xfa\x04\x67\x04\xba\xe1\xde\xaa\xa7\xc9\xf1\x05\xa7\x61\xfc" + "\x72\xd8\xd9\xce\x69\x7b\x13\x69\x9c\x8f\xe9\xf6\x46\x39\xbe\x49" + "\x8f\x57\x76\xcb\x7d\x22\x25\xdc\xa9\x87\xf1\x1b\xed\xff\x9b\x25" + "\xfa\x7a\x3d\x74\x8e\xe7\xeb\x2d\x27\xe9\xfa\x59\x3b\xa4\x3d\xbb" + "\xde\xa9\xa7\x33\x5d\xbe\x9f\x8a\x30\xcf\x3d\xc6\xb3\x9a\x4a\xa4" + "\x9d\x47\x9e\x37\xcf\xf6\x0c\xc1\xd8\xd2\x22\xfa\xca\x88\xe3\x18" + "\x0f\xf7\x6b\xd0\x77\xee\xdb\x3a\x81\x2b\xbb\x9e\xf5\x1a\xf5\xba" + "\x22\x4a\x63\x3c\xf7\xf0\x18\xe2\xfa\x22\xa9\xd3\x7e\xa9\x3f\x82" + "\xf1\xc1\x27\x90\xb8\x19\xdf\x26\xee\x33\xbb\x78\x0d\xec\x7a\xe6" + "\xbf\x29\xfd\x9c\xcd\xf5\xfb\x0c\xb2\x1c\x82\xf0\x91\x64\x5e\xaf" + "\x6f\x4b\x09\x77\xe8\x61\xc8\xab\x5a\xe9\xde\xf5\x27\x54\xda\x0d" + "\xb6\xc1\xca\x62\x7f\x01\x30\xee\xe4\xf2\x6e\x98\x90\x8c\xff\x86" + "\xfc\x94\x70\x91\x1e\xae\x95\xeb\x13\x37\x94\xe9\x65\xc8\x3a\x83" + "\x8e\xed\xac\x0a\x0f\xf9\x72\xfa\x73\xe3\x3b\x4a\x7f\x6e\xd8\x6d" + "\xa0\x61\x28\xc2\xfb\xfb\xeb\xf3\x86\x23\x3a\x7e\xfc\x3e\x66\x80" + "\x43\x1b\xb9\xa1\x3d\x55\x5f\x96\x7a\x59\xcf\x58\x67\x6e\x24\x93" + "\xb4\x1e\x2d\x6d\x8c\xb9\x9e\xdd\x38\xde\x10\x1f\x56\xbe\xc4\x8d" + "\x2f\xeb\x7d\x93\x5c\xdb\xf3\x15\x5a\xa4\x8f\xf3\x92\xd2\x0b\xe8" + "\x43\x44\xea\x85\xdc\xbb\x72\x63\x79\x2a\xde\xc0\xca\x68\x3f\x8e" + "\x7e\x9c\x93\xd5\x5a\xdc\x8d\x3b\xfb\x79\xbb\x11\xf6\xed\xfa\x9d" + "\xba\xde\x2a\x3f\xfa\x86\x86\x74\xfe\x06\xe0\x43\xc9\x32\xbb\x31" + "\xdc\x2f\xb3\x1b\xa3\xfd\x78\xc7\xd9\x0d\x70\xff\x81\xb0\xb3\x1f" + "\x6e\xdc\xd8\x0b\xe9\x87\xda\xef\x33\x6e\x6a\x72\x59\xe3\xe6\x18" + "\x70\x94\x19\xca\x2a\x37\xc0\xb5\x21\xbc\x36\x7d\xfd\x8c\x6b\x48" + "\x5f\x3f\xe3\xf6\x9b\xd7\xcf\xb8\x63\x86\x72\x43\x17\xd6\xed\x9b" + "\x6c\x06\x7a\xea\x11\x1e\x99\xac\xcb\x37\x8d\x4d\x09\x27\xea\x5f" + "\xa0\xfd\xee\x5c\x99\x37\x84\xe3\xe1\x2b\xe7\x28\x5d\xbf\xa9\xd0" + "\x98\xfe\x66\xaf\x4a\x67\x1a\x79\x0e\x44\xce\xfd\x29\xb8\xca\x54" + "\x38\x86\x31\xa4\xd7\xe9\xb4\xaf\x45\x38\xd5\xbf\x4f\xd8\x6d\xad" + "\x1f\x0a\xc6\xb9\x1f\xba\x69\xbf\x1a\x03\x37\x97\x08\xff\xa1\xa2" + "\x74\x7d\x0a\x70\xc3\xfe\xdd\xb4\x47\xcd\x01\x35\x97\x40\x8f\x7a" + "\x4f\xd1\xcd\x3f\xc6\xbb\x0f\xef\x65\xc9\x7d\xdb\xcd\x39\x18\x7b" + "\xcf\xa8\xf7\xa7\xf6\x79\x37\xbb\xe1\xbf\xf4\x3a\xa2\xd5\x45\x26" + "\x69\x93\x85\x3f\x63\xba\x49\x3c\xcf\x21\xf4\x86\xe8\xe6\x2d\x4c" + "\xa3\x21\xbe\x5c\xf8\x47\x14\x32\x7c\x88\xcb\x43\x1e\xf3\xf9\x81" + "\xe6\x92\xa5\x97\x91\x13\x74\x7e\x71\x8a\x6e\xb9\x7e\xa9\x53\x8e" + "\x83\x41\xf3\x2d\xab\x52\xca\x69\x4c\x43\xf3\x09\xd0\xfc\x45\x1a" + "\x9a\xa5\xdf\x2e\xac\xa0\x7b\x40\xff\x7e\xcb\x48\xd0\xfd\x85\x94" + "\x6b\x72\xfc\x38\xdf\xcb\xc4\xf4\xca\x3c\x33\x2a\xfb\xeb\x43\x4b" + "\x9f\xea\xd8\x4a\x05\x03\xcb\xba\xa5\x54\xf8\x87\xcd\x08\xd1\x2d" + "\x75\x7a\x7f\xa0\xc5\x57\x2a\x1a\x20\x0b\xab\x94\x45\x23\xe7\x4b" + "\x57\x8f\x7a\xdb\x63\x39\x74\xfb\x6f\x41\xff\x77\x73\x9d\xde\x67" + "\xa2\xbf\x0c\xb3\xac\xb4\xb4\x8e\x94\xb4\x9e\xfe\xb4\x5c\x5b\x52" + "\xda\xaa\x44\xfc\x18\x3d\xfe\x02\x75\x01\xf9\xe7\xbe\xc3\x79\x92" + "\x79\xcc\xcd\x37\xaf\x83\xdc\x12\xd4\x41\x9f\x79\x1d\xe4\x56\x9a" + "\xeb\x4d\x6e\xad\x78\x9e\xcc\x70\xed\x46\xbd\xf4\x71\xbd\x70\x3d" + "\x0c\x94\x7f\x6e\x93\x2e\xff\x0b\xf0\x10\x3b\x45\xb7\x2e\xeb\xd7" + "\xa7\x5b\xdf\x49\xc6\x73\xeb\x48\x73\x5e\x6e\x1d\x07\x5e\x62\xe6" + "\xbc\xdc\x9a\x6f\xce\xcb\xad\x68\x9b\x14\x1b\xa8\x4b\xb7\x7a\x11" + "\x6f\x06\xbf\x45\xf8\x4d\xf1\xef\x62\xdf\x21\x44\xb7\x9e\xe0\x39" + "\x21\x43\x7c\xa0\xbf\x2d\x81\x6e\xe4\xe1\xf9\xa2\x40\xd5\x6d\xc4" + "\xf4\x9c\x72\x91\x75\x30\x79\x80\xff\xcf\x4f\xd1\x6d\xab\xe3\x56" + "\xcb\x4e\x25\x8b\xdb\x6f\x4d\x2e\xf7\x36\x97\xb9\x2c\x6e\x9b\x00" + "\x59\x7c\x6e\x2e\x8b\xdb\x0a\xcd\x65\x71\xdb\x42\xf0\xfc\xf9\x40" + "\x59\xdc\xb6\x56\x97\x05\xc6\x93\x0e\xb1\xad\x58\xdc\xec\x21\x3b" + "\xf8\xcc\x71\xa0\x8e\x15\x5c\x27\xc3\xed\x76\xf4\xa8\xfa\x75\x2d" + "\x21\xfb\x67\x74\x5b\x9d\xdc\x47\xb2\x6d\xb6\x18\x11\xa6\x61\x0c" + "\x1f\xf4\x7e\x1e\x08\xa2\xa7\xe3\x31\x7d\x4a\x19\x1d\xe6\x6d\xf3" + "\x76\x96\xd3\xf3\x26\xf1\x4e\xb5\x1f\xe3\xf6\xa9\xc9\x6d\xf6\xf6" + "\xdc\x7e\x79\x43\x36\xc8\x63\xd8\x2f\x3b\xe8\x33\x78\x1d\x8c\xbf" + "\x5a\xc9\x7f\xfc\x90\x14\x3a\x1a\xcc\xe5\x7f\xfb\xbe\xf4\xf2\xbf" + "\xfd\x98\xb9\xfc\x6f\xe7\x39\x9a\xcf\x43\x34\xde\x95\x6c\x8f\xc7" + "\xdb\xfa\x79\xba\x9d\xf7\x9b\x38\x84\x7f\xe8\x57\x39\xfc\x65\x79" + "\xd3\x1f\xe0\xb7\xd4\xbf\x42\x90\xa9\xe5\xea\xff\x4a\xfe\x74\xcf" + "\x96\xd1\xe6\xeb\xa1\x18\x2b\x90\xeb\x4a\x1e\xe7\x8e\xff\x14\xba" + "\xd3\x86\xdf\xd6\x53\xf4\xad\x8d\x71\xbf\xb5\x52\x93\xed\x27\xa7" + "\xe8\x8e\xf9\x4a\xb6\xdf\x7a\x3a\x59\x1e\xe3\xa3\xe6\xb2\xbd\x63" + "\x24\x64\xfb\x89\xb9\x6c\xef\xc8\x4d\xdf\x6f\xdc\x31\x15\xfc\x7f" + "\x32\x50\xbf\xef\x28\x55\x79\x68\x0d\xe7\x51\xfb\x42\xef\xf8\x88" + "\x61\x94\x1e\xdf\x71\x80\xd3\x59\xe7\x0d\x79\xb6\x02\x57\x51\xbf" + "\xae\xdf\x51\xab\xe1\x30\xe2\xdd\xef\x08\x9b\xe9\xf4\x1d\x72\x5d" + "\xef\xe6\x88\x94\x4f\xd1\x0e\x2e\x73\x39\xd1\x67\xf4\xad\xeb\x19" + "\x8e\xe3\xaf\x75\x1a\x75\xfa\x5b\x36\x1d\x8e\x6d\x8c\x82\xbd\x23" + "\x2a\xb6\x95\x11\xc3\x25\xe3\xfe\x96\xc6\xff\xb0\x19\xf5\x1a\x3c" + "\xc3\xa5\xc0\x14\xaa\xb6\xf3\xad\xad\xc9\x6d\xe7\x5b\x0b\x93\xfb" + "\xbb\xf1\x3c\xde\x72\xc4\xfd\x16\xf8\xbc\xe3\xdb\x41\xc3\x97\xd6" + "\x97\x41\xda\x12\xea\xfb\xdb\x4f\xab\xfa\xfe\xf6\x43\x29\x74\x75" + "\x9a\xd7\xf7\xb7\x6d\xe9\xeb\xfb\xdb\x2e\xf3\xb6\xf4\xed\x09\x5c" + "\xd7\x21\xfa\xf6\xc2\xe4\xb6\xf4\xed\x82\xfe\xb6\xf4\xad\x4e\xd5" + "\x96\xe8\x92\x8b\x69\x0b\xf0\x15\xd2\xb6\x3d\xbd\x7d\x7d\x59\x99" + "\xa0\x3d\x30\x4d\xd2\xd7\xc1\x18\x7f\x02\xcb\xa8\xc5\x29\xf7\xbc" + "\xfb\x4e\xd1\x84\x0a\x9e\xc7\x55\xb2\xba\xf3\x8e\x64\xfe\x26\x38" + "\xcd\x65\x35\x21\x17\xb2\xf2\x99\xcb\x6a\xc2\x54\x73\x59\x4d\x28" + "\xe5\x3d\xbe\x03\xdb\xc5\x84\x4a\xb6\xfb\xa0\x91\xf7\x50\xb4\x7d" + "\x46\x13\x9a\xa5\xfd\xef\x2a\x16\xd0\x3b\x13\xfb\x3f\xa1\xdf\xfe" + "\x8f\xe6\x36\x31\x41\xfa\x53\xa2\x0b\xf6\x7f\x2b\x0d\xe3\xbe\xa0" + "\xbf\x0f\xc8\x35\xe9\x03\x26\x74\x9a\xf7\x01\x77\xda\xcc\xfb\x80" + "\x3b\xc7\x28\x3d\xbe\xb3\x20\x59\x8f\xef\x1c\xdf\x5f\xc7\x90\xd3" + "\xff\x4c\x1f\xb0\xf9\x14\xdd\x95\x89\x7e\xb8\x5a\xd5\xc7\x5d\xbf" + "\x4d\xa1\x65\x97\x79\x7d\xdc\x19\x40\x7d\x6c\x36\xaf\x8f\x3b\x4f" + "\x98\xd7\xc7\x9d\x3c\x7e\xda\x3c\xb0\x3e\xee\xca\xfe\x72\xfd\xf0" + "\x5d\xe3\x93\xfb\xe1\xbb\xc6\x7e\xf9\x7e\xf8\x2e\x8f\x79\x1d\xdc" + "\x55\x63\x5e\x07\x77\x35\xa8\x3a\xb8\xeb\x58\x72\x1d\xdc\xb5\xaf" + "\xbf\x0e\x20\x9b\xff\x7e\x1d\x94\xaa\xf5\xdd\xef\xdc\xd1\x25\xe7" + "\xcf\xbe\x33\x2e\x44\xdf\x89\xa8\xf5\x80\xef\x74\xa8\x39\x54\x59" + "\x4f\x6f\x02\xc6\x35\xd0\x16\x7f\x27\x5f\x8b\x7b\x64\x60\xbf\xf0" + "\x9d\x52\xd8\xc9\xce\xc6\x4a\xb9\xd6\xa3\xea\x09\xf2\xdd\x0c\x38" + "\x35\x17\xf0\x9d\xb5\x9c\x17\xf5\x28\xf8\xbb\x14\xb6\xad\x80\x8f" + "\x30\x9e\x46\x57\x2c\x45\x7e\xdf\xd9\x73\x31\xfd\x66\x3a\x5e\xd9" + "\x3f\x3c\x45\xf7\xcc\x67\x98\x38\xf3\xb5\x9c\xea\x4f\xd1\xc4\x8d" + "\x78\x43\xf7\xee\xb9\x2f\xb9\xcc\x89\x63\xcd\x75\x6f\xe2\x44\xd0" + "\x5c\x6f\xae\x7b\x13\x8b\xd2\xf7\x93\x13\xe5\x9e\x54\xe8\x58\x7d" + "\x5c\xf9\xf2\x97\xce\xab\x0c\xa5\xf8\xf2\x13\xb7\xea\x7d\x5b\x57" + "\x26\xea\x66\x39\xcb\xfd\xee\x9b\x34\xfa\xae\x4b\x81\x6d\x54\x65" + "\x59\x66\x98\x94\x15\x02\x8d\x6f\xa6\xa1\x31\x6a\xde\x3e\xee\x1e" + "\xa9\xd5\xe5\x9b\x22\x33\xb5\x8d\xdc\x0d\xff\xcf\x6c\x6c\x72\xb7" + "\x5e\xff\x45\x92\x86\xa4\xfa\xbd\xbb\x34\xb9\x7e\xa9\xa8\x1c\xe3" + "\x35\x13\xb8\x0d\x46\x38\xde\x8b\xc3\xb0\xac\x03\x26\xb0\xfb\x52" + "\x71\xa6\x81\x0b\x0d\xd0\x2d\xde\x9b\x61\xaa\x5b\xf7\x64\xab\xb6" + "\x76\xcf\xc2\xe4\xb6\x76\xcf\xd8\xfe\xb6\x36\xb1\x31\x25\x4f\x5e" + "\x72\x9f\x3e\x71\xac\xec\xd3\xa1\x53\xf8\xbd\x97\xeb\xed\x7f\xc0" + "\x36\x1e\x3a\x45\xf7\x6a\xfe\xf1\xbd\x29\xf3\x15\xf7\x04\xcc\x75" + "\xf3\x9e\x36\xf0\x7c\xc8\xbc\xde\xef\x89\x98\xd7\xfb\xbd\x6c\xff" + "\x0e\x69\xe3\xcb\x4b\x67\x54\xe6\x0d\x4b\x49\x1f\x67\x6e\xbb\xee" + "\x4d\x33\xff\x71\xef\x1c\x25\xcf\x7b\xb7\x24\xcb\xf3\x5e\xc3\xfc" + "\x07\xe8\xff\x9f\xe9\x3f\x82\xa7\x28\xef\x7e\x25\xa3\xfb\x6e\x4a" + "\xa1\xa3\xdd\x5c\x46\xf7\x46\x21\xa3\xa0\xb9\x8c\xf2\x9c\xe9\xdb" + "\x6f\x1e\xfa\x3f\x0a\x0e\xec\x3f\xf2\xa6\xfa\xb6\xcb\xf9\x11\xd9" + "\x0e\x67\x44\xe1\x7f\xfa\xf5\x74\xee\x37\xf2\x78\xfc\x27\x1c\x63" + "\xa8\x20\xb8\x35\xca\x7b\x90\x72\x18\xae\xb8\x32\x75\x9d\x24\x4f" + "\xf9\xba\x7e\x41\x0e\x6f\x02\xd6\xae\xc3\xa6\xe0\xe4\xfe\x4f\xe8" + "\x70\x6a\x5e\xa6\x3a\xc5\x96\xe4\xb5\x9b\xd7\x5b\x5e\x9a\xf6\x7f" + "\xdf\x48\x55\x6f\xf7\xa5\x8c\xfd\xee\x1b\x97\xac\xeb\x90\xeb\x45" + "\xd4\x1d\xaf\xa3\x98\xd6\xdf\x9a\xd9\x6d\x9e\x2a\xba\xf2\x34\xdd" + "\xf7\x37\x89\x1f\x61\xfe\x1e\xaa\x38\x4a\x56\xb1\xe6\x29\xe8\xb1" + "\x85\xea\xfd\xa2\x67\xb3\x55\xb4\x6e\xf6\x8b\xd6\x60\xf4\x2c\xfb" + "\x6c\x5f\x3d\x49\xf7\xfd\x56\xd1\x27\x7a\x94\x2c\xee\xdb\xc3\xb0" + "\xdd\xfe\xfb\x3a\xf4\xf9\xbe\x74\xe5\xf1\xfe\x6c\xc6\x3d\xf8\x1c" + "\xef\x77\x73\x21\x83\xb5\xfa\x5a\x2e\xc2\x79\xfd\xfb\x8b\xbe\x3b" + "\x15\x69\x5f\xea\xbb\x4e\xc0\x7a\x8d\x78\xd4\x37\x9d\xdf\xdd\xa0" + "\xef\x11\xc2\xef\xad\x17\xc0\xa5\xd3\x13\x48\xa1\xa7\x15\x7d\xff" + "\x5a\x0d\xc7\x89\xc1\x70\x70\x3d\x29\xfd\xe2\x7a\xfc\x6e\x64\xb0" + "\x79\xa2\x0c\x27\x15\xbc\x30\x40\xe7\x27\xb9\x59\xd6\x8c\x23\x5d" + "\x1b\x54\x7d\xea\xe4\xcb\x54\x1b\x9c\xf4\x45\x4a\xfe\x32\x35\x77" + "\xa8\xfa\xa8\x79\xd1\x54\x1d\x9d\x54\xe3\x88\x98\xe9\xe8\xa4\x06" + "\x5d\x47\xe1\xf3\x32\xde\xe3\x29\xe9\x01\xa5\xab\x93\x9d\xe8\x27" + "\x0d\xe3\x90\x49\x72\xfc\x20\x2e\x55\x6d\x31\x04\xb8\x94\x7c\x3d" + "\xc9\xba\x3c\xa9\x6c\xb0\x79\x58\x8d\xb7\xb7\x14\x6f\x53\x7e\x9c" + "\x8c\x6b\xf2\xe4\xc1\x79\x9b\x5c\x6a\xce\xdb\xe4\xca\x64\xde\xa6" + "\x3c\x93\x92\x2e\xfd\xfb\xae\x01\x7d\xf0\xe4\xbd\xba\x9f\xea\xba" + "\x86\xfd\xcf\x29\x43\xa4\xbf\x5a\x5f\x2c\xc6\xba\xcc\xfc\xd5\xc9" + "\xed\x09\x7f\x55\xc2\x4f\x56\xfb\x5e\xeb\xe1\xaf\x36\xa4\x8e\x1b" + "\xf2\xe8\x70\x34\xd5\x67\x9d\x32\xd6\x51\x67\x46\xff\x94\x89\x9a" + "\x8d\x7c\x7e\xa0\x8d\x9c\x52\xa4\xea\x65\xca\x9e\x64\x1b\x32\xc5" + "\x93\x5c\x2f\x93\xeb\x52\xf2\x6d\x49\xae\x97\xc9\x93\xff\xab\xfd" + "\x03\x0f\x12\x33\x32\x32\xac\x19\x16\xab\x25\x03\xc9\x60\x93\x86" + "\x65\xd8\x32\x86\xe0\x19\xaa\xbd\x87\x59\x33\xac\x36\x3c\x43\xb4" + "\xf7\xd0\x94\xf0\x30\xce\x8b\xc7\xa6\xbd\x87\xa4\x84\x87\x5e\x20" + "\x7d\x98\x56\xae\x5e\xbe\x2d\x25\x3c\xe4\x02\xe9\x43\xff\x9b\xf9" + "\x69\x40\x38\x79\x9f\xd4\xfd\x8b\x96\xcf\x5f\xf8\x44\xa9\x6b\xc5" + "\x92\x27\xca\x17\xb8\xe6\x7f\xff\xfb\x0b\x96\x2e\x75\x95\x2f\x76" + "\x7d\xf7\xbe\xe9\xb7\xdd\xe5\xca\xf5\x5e\xe7\x1d\xe7\x5a\x78\xf7" + "\x75\xa5\x59\xf4\xc0\x8a\x25\x9c\xf0\xc0\x8c\xfb\x8b\x5c\x05\xdf" + "\xbd\x2f\x39\x51\x47\xb3\x64\xc1\xfc\xd2\x41\xb1\x18\x6c\x5a\xde" + "\xba\x51\x44\x1b\x47\x49\xdb\xd6\xde\x8c\x51\x8e\x1a\xab\x3f\xb6" + "\xa0\x69\x27\x91\xe8\xf5\x89\xc0\x35\xbc\xe7\xe2\x7b\x6f\x33\x13" + "\x37\x35\x54\x93\xe7\x71\xfe\x8e\xe1\x7b\x1f\x88\x83\x61\x72\xfd" + "\x33\x59\x4f\xd2\xea\xcc\x46\x78\x9d\x1c\x0e\xb6\x47\xc9\xe5\x23" + "\x3b\xf2\x5f\x82\x34\x8b\xb8\x27\x8e\xb8\x88\xb6\xb7\xf2\x9f\xdf" + "\x93\x71\x07\xab\x75\x38\xc7\x29\xca\xaf\x10\x07\x85\x0c\x8b\x7b" + "\xb6\x68\x70\xf9\xf7\xc7\xfd\xdf\x93\x6b\xb2\x2f\x5f\x4a\xf6\x97" + "\x47\x89\x13\x75\xcf\x93\x6d\xc7\xf3\xbc\x0e\x96\x3f\x31\x64\xfd" + "\xd7\xdd\x6c\x5f\xd7\x21\x3e\x44\xab\xed\x5c\x36\xc3\xc6\xad\xdf" + "\xbb\x8d\xe1\x25\xec\xa5\x44\x9c\x0f\xf0\x0b\x93\xe1\xf3\xf3\xac" + "\x80\x9d\xf6\x29\x39\x7a\xb2\x1a\xf3\x83\x95\xd5\xe4\x88\x89\xbf" + "\xdf\x9c\x4f\x96\x16\x8c\x7e\x2a\xa2\x22\x1a\x58\x72\x9a\x69\x38" + "\xe0\xa8\x10\x7f\x0f\x46\x88\x1e\xe8\xf4\x89\x4d\x67\xc8\x86\x31" + "\xa8\x25\xb0\x84\xf7\x92\xe4\xef\xdc\xf1\x05\xd9\x20\x87\x31\xa7" + "\xe9\xfe\x63\x95\x0f\x88\x98\xef\x01\xb2\xbd\xef\xad\x26\xb1\xbe" + "\xf9\xa5\x4d\x1f\x92\xed\x97\xbd\xd5\xd6\x5e\xe1\xa4\xca\x72\x5e" + "\x9f\x10\xe4\x8b\x88\x1e\x5e\x6f\x6f\x2a\x89\x31\xcc\x0f\xba\x7d" + "\x4e\x6a\x29\x8f\xd0\xaa\x13\xa2\xa7\xe6\x43\xb2\xf3\x5c\x57\x73" + "\x67\x84\xbf\x2b\xb7\xaf\x7a\x80\x32\x4e\x15\x91\xb5\xb9\x6c\x2b" + "\x05\xe7\x44\xa8\xf2\x84\xe8\x68\x2a\xf9\x94\x5a\xca\xf6\x50\x71" + "\x1b\x59\x9b\xda\xff\x44\xf2\x5b\xe9\x4d\xb6\x82\xaa\x73\xe4\x5c" + "\xf5\x04\xc7\x9d\xa3\x95\xab\x68\xf8\xca\x8f\xc8\x11\xec\x68\x43" + "\x39\x67\xe8\xd1\x63\x64\x01\x3e\xeb\xb3\x7f\x22\xe7\xb3\xb3\x78" + "\xbf\x66\x1e\xd5\x55\x91\x53\xf8\xdc\xd9\xbd\x3e\x77\x4e\xaf\x70" + "\x5f\xda\xed\x73\x8f\x6c\xf1\x00\xbe\xfd\x00\x8d\x68\xa3\x91\x07" + "\x4f\xb7\x59\xb7\x9e\xa5\x31\xae\x07\x59\x07\xee\x6f\xad\x3b\x0b" + "\xf8\xf5\xc7\x5b\xe3\xc8\x6b\xcc\x13\xcd\x3c\xde\x11\x2c\xea\xa1" + "\x38\x70\x6d\xed\xa5\x31\x75\xbd\xe4\x8c\xaf\x3b\xde\xca\xb2\xe8" + "\x5b\xdf\x94\x0f\x3b\x38\xec\xcd\xc7\xf6\xd9\x82\x4d\x9d\xd4\x1c" + "\xe9\xa5\x16\xfa\x98\x82\xde\xbf\x06\x7e\xf9\xd8\xbe\x21\x71\x34" + "\x80\xc0\x4a\xde\xf7\xa2\xf4\xc6\xd7\xcc\xdf\xc8\x55\xd3\xe6\x2a" + "\xca\xf6\xac\xa4\x61\xa7\x11\xaf\xc6\xb9\x87\x0a\x82\xd1\xbf\x06" + "\x56\xca\xbd\x9a\xab\xed\x55\xcd\x94\xd1\x12\xd9\xca\xdf\x86\x5b" + "\x63\x23\x6c\x05\xc1\x48\x2b\x05\x3d\x9f\x04\xe2\xd9\xb6\x09\x1b" + "\xe2\x64\x7f\xe3\x7c\xab\x35\x68\x3b\x4f\xc1\xa2\x08\x1d\x42\xd9" + "\x62\x93\x6d\x0e\x6c\x56\x5e\x4b\xa4\x87\xbf\x79\xc9\x15\x5d\xce" + "\xac\xcd\x4b\x68\xdc\x8e\xb3\x34\x76\xfb\x59\x72\x8b\x6e\xb7\x95" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 20:09:50 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D70A106566B; Thu, 23 Oct 2008 20:09:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id E12158FC1B; Thu, 23 Oct 2008 20:09:49 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m9NK9hMO030923; Thu, 23 Oct 2008 16:09:43 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Ed Schouten Date: Thu, 23 Oct 2008 15:55:06 -0400 User-Agent: KMail/1.9.7 References: <200810231911.m9NJBisd064280@svn.freebsd.org> In-Reply-To: <200810231911.m9NJBisd064280@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200810231555.06892.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Thu, 23 Oct 2008 16:09:43 -0400 (EDT) X-Virus-Scanned: ClamAV 0.93.1/8479/Thu Oct 23 13:54:32 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184208 - head/sys/dev/uart X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 20:09:50 -0000 On Thursday 23 October 2008 03:11:44 pm Ed Schouten wrote: > Author: ed > Date: Thu Oct 23 19:11:44 2008 > New Revision: 184208 > URL: http://svn.freebsd.org/changeset/base/184208 > > Log: > Fix detaching of uart(4) devices. > > With our new TTY layer we use a two step device destruction procedure. > The TTY first gets abandoned by the device driver. When the TTY layer > notices all threads have left the TTY layer, it deallocates the TTY. > > This means that the device unit number should not be reused before a > callback from the TTY layer to the device driver has been made. newbus > doesn't seem to support this concept (yet), so right now just add a > destructor with a big comment in it. It's not ideal, but at least it's > better than panicing. Perhaps have tty drivers sleep in detach until the tty is completely gone? Either that or free the unit number in the tty layer when the tty is abandoned. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 20:19:56 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F132E1065671; Thu, 23 Oct 2008 20:19:56 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFB398FC18; Thu, 23 Oct 2008 20:19:56 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9NKJuCo065945; Thu, 23 Oct 2008 20:19:56 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9NKJub8065944; Thu, 23 Oct 2008 20:19:56 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200810232019.m9NKJub8065944@svn.freebsd.org> From: Robert Noland Date: Thu, 23 Oct 2008 20:19: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: r184212 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 20:19:57 -0000 Author: rnoland Date: Thu Oct 23 20:19:56 2008 New Revision: 184212 URL: http://svn.freebsd.org/changeset/base/184212 Log: This check is invalid and I disabled it once already. I accidentally reintroduced it with the sync to git master. Commit the fix in both places this time. Approved by: jhb (mentor) MFC after: 2 weeks Modified: head/sys/dev/drm/drm_lock.c Modified: head/sys/dev/drm/drm_lock.c ============================================================================== --- head/sys/dev/drm/drm_lock.c Thu Oct 23 20:07:08 2008 (r184211) +++ head/sys/dev/drm/drm_lock.c Thu Oct 23 20:19:56 2008 (r184212) @@ -105,17 +105,15 @@ int drm_unlock(struct drm_device *dev, v { struct drm_lock *lock = data; + DRM_DEBUG("%d (pid %d) requests unlock (0x%08x), flags = 0x%08x\n", + lock->context, DRM_CURRENTPID, dev->lock.hw_lock->lock, + lock->flags); + if (lock->context == DRM_KERNEL_CONTEXT) { DRM_ERROR("Process %d using kernel context %d\n", DRM_CURRENTPID, lock->context); return EINVAL; } - /* Check that the context unlock being requested actually matches - * who currently holds the lock. - */ - if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock) || - _DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock) != lock->context) - return EINVAL; DRM_SPINLOCK(&dev->tsk_lock); if (dev->locked_task_call != NULL) { From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 20:23:03 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D443B1065670; Thu, 23 Oct 2008 20:23:03 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B08058FC1A; Thu, 23 Oct 2008 20:23:03 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9NKN3GZ066056; Thu, 23 Oct 2008 20:23:03 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9NKN3g8066054; Thu, 23 Oct 2008 20:23:03 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200810232023.m9NKN3g8066054@svn.freebsd.org> From: Robert Noland Date: Thu, 23 Oct 2008 20:23: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: r184213 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 20:23:04 -0000 Author: rnoland Date: Thu Oct 23 20:23:03 2008 New Revision: 184213 URL: http://svn.freebsd.org/changeset/base/184213 Log: Replace calls to minor() with dev2unit(). Ed already fixed this once, but I inadvertently overwrote the change when I synced to git. Commit the fix in both places, so this doesn't happen again. Approved by: jhb (mentor) MFC after: 2 weeks Modified: head/sys/dev/drm/drm_drv.c head/sys/dev/drm/drm_fops.c Modified: head/sys/dev/drm/drm_drv.c ============================================================================== --- head/sys/dev/drm/drm_drv.c Thu Oct 23 20:19:56 2008 (r184212) +++ head/sys/dev/drm/drm_drv.c Thu Oct 23 20:23:03 2008 (r184213) @@ -537,7 +537,7 @@ int drm_open(struct cdev *kdev, int flag struct drm_device *dev = NULL; int retcode = 0; - dev = DRIVER_SOFTC(minor(kdev)); + dev = DRIVER_SOFTC(dev2unit(kdev)); DRM_DEBUG("open_count = %d\n", dev->open_count); Modified: head/sys/dev/drm/drm_fops.c ============================================================================== --- head/sys/dev/drm/drm_fops.c Thu Oct 23 20:19:56 2008 (r184212) +++ head/sys/dev/drm/drm_fops.c Thu Oct 23 20:23:03 2008 (r184213) @@ -44,7 +44,7 @@ int drm_open_helper(struct cdev *kdev, i struct drm_device *dev) { struct drm_file *priv; - int m = minor(kdev); + int m = dev2unit(kdev); int retcode; if (flags & O_EXCL) From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 20:26:17 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06EB61065672; Thu, 23 Oct 2008 20:26:17 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E59A38FC1C; Thu, 23 Oct 2008 20:26:16 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9NKQGl9066196; Thu, 23 Oct 2008 20:26:16 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9NKQFWs066164; Thu, 23 Oct 2008 20:26:15 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810232026.m9NKQFWs066164@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 23 Oct 2008 20:26: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: r184214 - in head/sys: contrib/altq/altq dev/hwpmc dev/ray dev/sr fs/hpfs fs/ntfs fs/udf fs/unionfs kern net netgraph netgraph/bluetooth/socket netgraph/netflow netinet netinet6 nfs4cli... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 20:26:17 -0000 Author: des Date: Thu Oct 23 20:26:15 2008 New Revision: 184214 URL: http://svn.freebsd.org/changeset/base/184214 Log: Fix a number of style issues in the MALLOC / FREE commit. I've tried to be careful not to fix anything that was already broken; the NFSv4 code is particularly bad in this respect. Modified: head/sys/contrib/altq/altq/altq_hfsc.c head/sys/dev/hwpmc/hwpmc_mod.c head/sys/dev/hwpmc/hwpmc_piv.c head/sys/dev/ray/if_ray.c head/sys/dev/sr/if_sr.c head/sys/fs/hpfs/hpfs_subr.c head/sys/fs/ntfs/ntfs_subr.c head/sys/fs/ntfs/ntfs_vfsops.c head/sys/fs/udf/udf_vfsops.c head/sys/fs/unionfs/union_subr.c head/sys/kern/kern_descrip.c head/sys/kern/kern_event.c head/sys/kern/kern_linker.c head/sys/kern/kern_mtxpool.c head/sys/kern/subr_witness.c head/sys/net/if_sl.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c head/sys/netgraph/netflow/netflow.c head/sys/netgraph/ng_async.c head/sys/netgraph/ng_bridge.c head/sys/netgraph/ng_fec.c head/sys/netgraph/ng_l2tp.c head/sys/netgraph/ng_mppc.c head/sys/netinet/in_mcast.c head/sys/netinet/tcp_syncache.c head/sys/netinet6/raw_ip6.c head/sys/nfs4client/nfs4_vnops.c head/sys/nfsclient/nfs_lock.c head/sys/opencrypto/cryptodev.c head/sys/security/mac_bsdextended/mac_bsdextended.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ufs/ufs_extattr.c Modified: head/sys/contrib/altq/altq/altq_hfsc.c ============================================================================== --- head/sys/contrib/altq/altq/altq_hfsc.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/contrib/altq/altq/altq_hfsc.c Thu Oct 23 20:26:15 2008 (r184214) @@ -202,8 +202,7 @@ hfsc_add_altq(struct pf_altq *a) if (!ALTQ_IS_READY(&ifp->if_snd)) return (ENODEV); - hif = malloc(sizeof(struct hfsc_if), - M_DEVBUF, M_WAITOK); + hif = malloc(sizeof(struct hfsc_if), M_DEVBUF, M_WAITOK); if (hif == NULL) return (ENOMEM); bzero(hif, sizeof(struct hfsc_if)); @@ -404,14 +403,12 @@ hfsc_class_create(struct hfsc_if *hif, s } #endif - cl = malloc(sizeof(struct hfsc_class), - M_DEVBUF, M_WAITOK); + cl = malloc(sizeof(struct hfsc_class), M_DEVBUF, M_WAITOK); if (cl == NULL) return (NULL); bzero(cl, sizeof(struct hfsc_class)); - cl->cl_q = malloc(sizeof(class_queue_t), - M_DEVBUF, M_WAITOK); + cl->cl_q = malloc(sizeof(class_queue_t), M_DEVBUF, M_WAITOK); if (cl->cl_q == NULL) goto err_ret; bzero(cl->cl_q, sizeof(class_queue_t)); @@ -471,7 +468,8 @@ hfsc_class_create(struct hfsc_if *hif, s #endif /* ALTQ_RED */ if (rsc != NULL && (rsc->m1 != 0 || rsc->m2 != 0)) { - cl->cl_rsc = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); + cl->cl_rsc = malloc(sizeof(struct internal_sc), + M_DEVBUF, M_WAITOK); if (cl->cl_rsc == NULL) goto err_ret; sc2isc(rsc, cl->cl_rsc); @@ -479,14 +477,16 @@ hfsc_class_create(struct hfsc_if *hif, s rtsc_init(&cl->cl_eligible, cl->cl_rsc, 0, 0); } if (fsc != NULL && (fsc->m1 != 0 || fsc->m2 != 0)) { - cl->cl_fsc = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); + cl->cl_fsc = malloc(sizeof(struct internal_sc), + M_DEVBUF, M_WAITOK); if (cl->cl_fsc == NULL) goto err_ret; sc2isc(fsc, cl->cl_fsc); rtsc_init(&cl->cl_virtual, cl->cl_fsc, 0, 0); } if (usc != NULL && (usc->m1 != 0 || usc->m2 != 0)) { - cl->cl_usc = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); + cl->cl_usc = malloc(sizeof(struct internal_sc), + M_DEVBUF, M_WAITOK); if (cl->cl_usc == NULL) goto err_ret; sc2isc(usc, cl->cl_usc); @@ -1740,8 +1740,7 @@ hfsc_attach(ifq, bandwidth) { struct hfsc_if *hif; - hif = malloc(sizeof(struct hfsc_if), - M_DEVBUF, M_WAITOK); + hif = malloc(sizeof(struct hfsc_if), M_DEVBUF, M_WAITOK); if (hif == NULL) return (NULL); bzero(hif, sizeof(struct hfsc_if)); @@ -1801,19 +1800,22 @@ hfsc_class_modify(cl, rsc, fsc, usc) rsc_tmp = fsc_tmp = usc_tmp = NULL; if (rsc != NULL && (rsc->m1 != 0 || rsc->m2 != 0) && cl->cl_rsc == NULL) { - rsc_tmp = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); + rsc_tmp = malloc(sizeof(struct internal_sc), + M_DEVBUF, M_WAITOK); if (rsc_tmp == NULL) return (ENOMEM); } if (fsc != NULL && (fsc->m1 != 0 || fsc->m2 != 0) && cl->cl_fsc == NULL) { - fsc_tmp = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); + fsc_tmp = malloc(sizeof(struct internal_sc), + M_DEVBUF, M_WAITOK); if (fsc_tmp == NULL) return (ENOMEM); } if (usc != NULL && (usc->m1 != 0 || usc->m2 != 0) && cl->cl_usc == NULL) { - usc_tmp = malloc( sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); + usc_tmp = malloc(sizeof(struct internal_sc), + M_DEVBUF, M_WAITOK); if (usc_tmp == NULL) return (ENOMEM); } Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/dev/hwpmc/hwpmc_mod.c Thu Oct 23 20:26:15 2008 (r184214) @@ -331,8 +331,7 @@ pmc_debugflags_parse(char *newstr, char int error, found, *newbits, tmp; size_t kwlen; - tmpflags = malloc(sizeof(*tmpflags), - M_PMC, M_WAITOK|M_ZERO); + tmpflags = malloc(sizeof(*tmpflags), M_PMC, M_WAITOK|M_ZERO); p = newstr; error = 0; @@ -777,8 +776,7 @@ pmc_link_target_process(struct pmc *pm, __LINE__, pp, pm)); #endif - pt = malloc(sizeof(struct pmc_target), - M_PMC, M_ZERO|M_WAITOK); + pt = malloc(sizeof(struct pmc_target), M_PMC, M_ZERO|M_WAITOK); pt->pt_process = pp; @@ -1861,8 +1859,7 @@ pmc_allocate_owner_descriptor(struct pro poh = &pmc_ownerhash[hindex]; /* allocate space for N pointers and one descriptor struct */ - po = malloc(sizeof(struct pmc_owner), - M_PMC, M_ZERO|M_WAITOK); + po = malloc(sizeof(struct pmc_owner), M_PMC, M_ZERO|M_WAITOK); po->po_sscount = po->po_error = po->po_flags = 0; po->po_file = NULL; @@ -1915,7 +1912,7 @@ pmc_find_process_descriptor(struct proc if (mode & PMC_FLAG_ALLOCATE) { /* allocate additional space for 'n' pmc pointers */ - ppnew = malloc( sizeof(struct pmc_process) + md->pmd_npmc * + ppnew = malloc(sizeof(struct pmc_process) + md->pmd_npmc * sizeof(struct pmc_targetstate), M_PMC, M_ZERO|M_WAITOK); } @@ -2818,8 +2815,7 @@ pmc_syscall_handler(struct thread *td, v npmc = md->pmd_npmc; pmcinfo_size = npmc * sizeof(struct pmc_info); - pmcinfo = malloc(pmcinfo_size, M_PMC, - M_WAITOK); + pmcinfo = malloc(pmcinfo_size, M_PMC, M_WAITOK); p = pmcinfo; @@ -4356,7 +4352,8 @@ pmc_initialize(void) M_PMC, M_WAITOK|M_ZERO); /* per-cpu 'saved values' for managing process-mode PMCs */ - pmc_pcpu_saved = malloc( sizeof(pmc_value_t) * maxcpu * md->pmd_npmc, M_PMC, M_WAITOK); + pmc_pcpu_saved = malloc(sizeof(pmc_value_t) * maxcpu * md->pmd_npmc, + M_PMC, M_WAITOK); /* Perform CPU-dependent initialization. */ pmc_save_cpu_binding(&pb); @@ -4376,7 +4373,7 @@ pmc_initialize(void) for (cpu = 0; cpu < maxcpu; cpu++) { if (!pmc_cpu_is_active(cpu)) continue; - sb = malloc( sizeof(struct pmc_samplebuffer) + + sb = malloc(sizeof(struct pmc_samplebuffer) + pmc_nsamples * sizeof(struct pmc_sample), M_PMC, M_WAITOK|M_ZERO); @@ -4385,7 +4382,8 @@ pmc_initialize(void) KASSERT(pmc_pcpu[cpu] != NULL, ("[pmc,%d] cpu=%d Null per-cpu data", __LINE__, cpu)); - sb->ps_callchains = malloc( pmc_callchaindepth * pmc_nsamples * sizeof(uintptr_t), + sb->ps_callchains = malloc(pmc_callchaindepth * + pmc_nsamples * sizeof(uintptr_t), M_PMC, M_WAITOK|M_ZERO); for (n = 0, ps = sb->ps_samples; n < pmc_nsamples; n++, ps++) Modified: head/sys/dev/hwpmc/hwpmc_piv.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_piv.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/dev/hwpmc/hwpmc_piv.c Thu Oct 23 20:26:15 2008 (r184214) @@ -628,7 +628,8 @@ p4_init(int cpu) if (pcs == NULL) /* decline to init */ return ENXIO; - plcs = malloc( sizeof(struct p4_logicalcpu), M_PMC, M_WAITOK|M_ZERO); + plcs = malloc(sizeof(struct p4_logicalcpu), + M_PMC, M_WAITOK|M_ZERO); /* The TSC is architectural state and is not shared */ plcs->pc_hwpmcs[0] = &plcs->pc_tsc; @@ -644,8 +645,7 @@ p4_init(int cpu) return 0; } - pcs = malloc(sizeof(struct p4_cpu), M_PMC, - M_WAITOK|M_ZERO); + pcs = malloc(sizeof(struct p4_cpu), M_PMC, M_WAITOK|M_ZERO); if (pcs == NULL) return ENOMEM; Modified: head/sys/dev/ray/if_ray.c ============================================================================== --- head/sys/dev/ray/if_ray.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/dev/ray/if_ray.c Thu Oct 23 20:26:15 2008 (r184214) @@ -3177,7 +3177,7 @@ ray_com_malloc(ray_comqfn_t function, in { struct ray_comq_entry *com; - com = malloc( sizeof(struct ray_comq_entry), M_RAYCOM, M_WAITOK); + com = malloc(sizeof(struct ray_comq_entry), M_RAYCOM, M_WAITOK); return (ray_com_init(com, function, flags, mesg)); } Modified: head/sys/dev/sr/if_sr.c ============================================================================== --- head/sys/dev/sr/if_sr.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/dev/sr/if_sr.c Thu Oct 23 20:26:15 2008 (r184214) @@ -305,7 +305,7 @@ sr_attach(device_t device) int unit; /* index: channel w/in card */ hc = (struct sr_hardc *)device_get_softc(device); - sc = malloc( hc->numports * sizeof(struct sr_softc), + sc = malloc(hc->numports * sizeof(struct sr_softc), M_DEVBUF, M_WAITOK | M_ZERO); if (sc == NULL) goto errexit; Modified: head/sys/fs/hpfs/hpfs_subr.c ============================================================================== --- head/sys/fs/hpfs/hpfs_subr.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/fs/hpfs/hpfs_subr.c Thu Oct 23 20:26:15 2008 (r184214) @@ -278,7 +278,8 @@ hpfs_cpinit ( cpicnt = hpmp->hpm_sp.sp_cpinum; - hpmp->hpm_cpdblk = malloc( cpicnt * sizeof(struct cpdblk), M_HPFSMNT, M_WAITOK); + hpmp->hpm_cpdblk = malloc(cpicnt * sizeof(struct cpdblk), + M_HPFSMNT, M_WAITOK); cpdbp = hpmp->hpm_cpdblk; lsn = hpmp->hpm_sp.sp_cpi; Modified: head/sys/fs/ntfs/ntfs_subr.c ============================================================================== --- head/sys/fs/ntfs/ntfs_subr.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/fs/ntfs/ntfs_subr.c Thu Oct 23 20:26:15 2008 (r184214) @@ -1143,7 +1143,8 @@ ntfs_ntreaddir( if (fp->f_dirblbuf == NULL) { fp->f_dirblsz = vap->va_a_iroot->ir_size; - fp->f_dirblbuf = malloc( max(vap->va_datalen,fp->f_dirblsz), M_NTFSDIR, M_WAITOK); + fp->f_dirblbuf = malloc(max(vap->va_datalen,fp->f_dirblsz), + M_NTFSDIR, M_WAITOK); } blsize = fp->f_dirblsz; Modified: head/sys/fs/ntfs/ntfs_vfsops.c ============================================================================== --- head/sys/fs/ntfs/ntfs_vfsops.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/fs/ntfs/ntfs_vfsops.c Thu Oct 23 20:26:15 2008 (r184214) @@ -416,7 +416,7 @@ ntfs_mountfs(devvp, mp, td) } /* Alloc memory for attribute definitions */ - ntmp->ntm_ad = malloc( num * sizeof(struct ntvattrdef), + ntmp->ntm_ad = malloc(num * sizeof(struct ntvattrdef), M_NTFSMNT, M_WAITOK); ntmp->ntm_adnum = num; Modified: head/sys/fs/udf/udf_vfsops.c ============================================================================== --- head/sys/fs/udf/udf_vfsops.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/fs/udf/udf_vfsops.c Thu Oct 23 20:26:15 2008 (r184214) @@ -647,8 +647,7 @@ udf_vget(struct mount *mp, ino_t ino, in return (ENOMEM); } size = UDF_FENTRY_SIZE + le32toh(fe->l_ea) + le32toh(fe->l_ad); - unode->fentry = malloc(size, M_UDFFENTRY, - M_NOWAIT | M_ZERO); + unode->fentry = malloc(size, M_UDFFENTRY, M_NOWAIT | M_ZERO); if (unode->fentry == NULL) { printf("Cannot allocate file entry block\n"); vgone(vp); @@ -757,7 +756,8 @@ udf_find_partmaps(struct udf_mnt *udfmp, pms = (struct part_map_spare *)pmap; pmap += UDF_PMAP_TYPE2_SIZE; - udfmp->s_table = malloc( le32toh(pms->st_size), M_UDFMOUNT, M_NOWAIT | M_ZERO); + udfmp->s_table = malloc(le32toh(pms->st_size), + M_UDFMOUNT, M_NOWAIT | M_ZERO); if (udfmp->s_table == NULL) return (ENOMEM); Modified: head/sys/fs/unionfs/union_subr.c ============================================================================== --- head/sys/fs/unionfs/union_subr.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/fs/unionfs/union_subr.c Thu Oct 23 20:26:15 2008 (r184214) @@ -440,7 +440,8 @@ unionfs_get_node_status(struct unionfs_n } /* create a new unionfs node status */ - unsp = malloc( sizeof(struct unionfs_node_status), M_TEMP, M_WAITOK | M_ZERO); + unsp = malloc(sizeof(struct unionfs_node_status), + M_TEMP, M_WAITOK | M_ZERO); unsp->uns_pid = pid; LIST_INSERT_HEAD(&(unp->un_unshead), unsp, uns_list); Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/kern/kern_descrip.c Thu Oct 23 20:26:15 2008 (r184214) @@ -2409,7 +2409,7 @@ filedesc_to_leader_alloc(struct filedesc { struct filedesc_to_leader *fdtol; - fdtol = malloc( sizeof(struct filedesc_to_leader), + fdtol = malloc(sizeof(struct filedesc_to_leader), M_FILEDESC_TO_LEADER, M_WAITOK); fdtol->fdl_refcount = 1; Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/kern/kern_event.c Thu Oct 23 20:26:15 2008 (r184214) @@ -529,8 +529,7 @@ filt_timerattach(struct knote *kn) kn->kn_flags |= EV_CLEAR; /* automatically set */ kn->kn_status &= ~KN_DETACHED; /* knlist_add usually sets it */ - calloutp = malloc(sizeof(*calloutp), - M_KQUEUE, M_WAITOK); + calloutp = malloc(sizeof(*calloutp), M_KQUEUE, M_WAITOK); callout_init(calloutp, CALLOUT_MPSAFE); kn->kn_hook = calloutp; callout_reset_curcpu(calloutp, timertoticks(kn->kn_sdata), @@ -1109,7 +1108,7 @@ kqueue_expand(struct kqueue *kq, struct size = kq->kq_knlistsize; while (size <= fd) size += KQEXTENT; - list = malloc( size * sizeof list, M_KQUEUE, mflag); + list = malloc(size * sizeof list, M_KQUEUE, mflag); if (list == NULL) return ENOMEM; KQ_LOCK(kq); Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/kern/kern_linker.c Thu Oct 23 20:26:15 2008 (r184214) @@ -1893,8 +1893,8 @@ linker_hwpmc_list_objects(void) retry: /* allocate nmappings+1 entries */ - hc.kobase = malloc( (hc.nmappings + 1) * sizeof(struct pmckern_map_in), M_LINKER, - M_WAITOK | M_ZERO); + hc.kobase = malloc((hc.nmappings + 1) * sizeof(struct pmckern_map_in), + M_LINKER, M_WAITOK | M_ZERO); hc.nobjects = 0; if (linker_file_foreach(linker_hwpmc_list_object, &hc) != 0) { Modified: head/sys/kern/kern_mtxpool.c ============================================================================== --- head/sys/kern/kern_mtxpool.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/kern/kern_mtxpool.c Thu Oct 23 20:26:15 2008 (r184214) @@ -146,7 +146,8 @@ mtx_pool_create(const char *mtx_name, in mtx_name); pool_size = 128; } - pool = malloc( sizeof (struct mtx_pool) + ((pool_size - 1) * sizeof (struct mtx)), + pool = malloc(sizeof (struct mtx_pool) + + ((pool_size - 1) * sizeof (struct mtx)), M_MTXPOOL, M_WAITOK | M_ZERO); mtx_pool_initialize(pool, mtx_name, pool_size, opts); return pool; Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/kern/subr_witness.c Thu Oct 23 20:26:15 2008 (r184214) @@ -708,7 +708,7 @@ witness_initialize(void *dummy __unused) struct witness *w, *w1; int i; - w_data = malloc( sizeof (struct witness) * WITNESS_COUNT, M_WITNESS, + w_data = malloc(sizeof (struct witness) * WITNESS_COUNT, M_WITNESS, M_NOWAIT | M_ZERO); /* Modified: head/sys/net/if_sl.c ============================================================================== --- head/sys/net/if_sl.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/net/if_sl.c Thu Oct 23 20:26:15 2008 (r184214) @@ -664,7 +664,8 @@ sltstart(struct tty *tp) register u_char *cp; if (sc->bpfbuf == NULL) - sc->bpfbuf = malloc( SLTMAX + SLIP_HDRLEN, M_SL, M_NOWAIT); + sc->bpfbuf = malloc(SLTMAX + SLIP_HDRLEN, + M_SL, M_NOWAIT); if (sc->bpfbuf) { cp = sc->bpfbuf + SLIP_HDRLEN; Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c Thu Oct 23 20:26:15 2008 (r184214) @@ -377,7 +377,7 @@ ng_btsocket_l2cap_raw_input(void *contex rt = (ng_btsocket_l2cap_rtentry_t *) NG_HOOK_PRIVATE(hook); if (rt == NULL) { - rt = malloc( sizeof(*rt), + rt = malloc(sizeof(*rt), M_NETGRAPH_BTSOCKET_L2CAP_RAW, M_NOWAIT|M_ZERO); if (rt == NULL) Modified: head/sys/netgraph/netflow/netflow.c ============================================================================== --- head/sys/netgraph/netflow/netflow.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/netgraph/netflow/netflow.c Thu Oct 23 20:26:15 2008 (r184214) @@ -331,7 +331,7 @@ ng_netflow_cache_init(priv_p priv) uma_zone_set_max(priv->zone, CACHESIZE); /* Allocate hash. */ - priv->hash = malloc( NBUCKETS * sizeof(struct flow_hash_entry), + priv->hash = malloc(NBUCKETS * sizeof(struct flow_hash_entry), M_NETFLOW_HASH, M_WAITOK | M_ZERO); if (priv->hash == NULL) { Modified: head/sys/netgraph/ng_async.c ============================================================================== --- head/sys/netgraph/ng_async.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/netgraph/ng_async.c Thu Oct 23 20:26:15 2008 (r184214) @@ -190,10 +190,12 @@ nga_constructor(node_p node) sc->cfg.accm = ~0; sc->cfg.amru = NG_ASYNC_DEFAULT_MRU; sc->cfg.smru = NG_ASYNC_DEFAULT_MRU; - sc->abuf = malloc( ASYNC_BUF_SIZE(sc->cfg.smru), M_NETGRAPH_ASYNC, M_NOWAIT); + sc->abuf = malloc(ASYNC_BUF_SIZE(sc->cfg.smru), + M_NETGRAPH_ASYNC, M_NOWAIT); if (sc->abuf == NULL) goto fail; - sc->sbuf = malloc( SYNC_BUF_SIZE(sc->cfg.amru), M_NETGRAPH_ASYNC, M_NOWAIT); + sc->sbuf = malloc(SYNC_BUF_SIZE(sc->cfg.amru), + M_NETGRAPH_ASYNC, M_NOWAIT); if (sc->sbuf == NULL) { free(sc->abuf, M_NETGRAPH_ASYNC); fail: Modified: head/sys/netgraph/ng_bridge.c ============================================================================== --- head/sys/netgraph/ng_bridge.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/netgraph/ng_bridge.c Thu Oct 23 20:26:15 2008 (r184214) @@ -304,7 +304,8 @@ ng_bridge_constructor(node_p node) ng_callout_init(&priv->timer); /* Allocate and initialize hash table, etc. */ - priv->tab = malloc( MIN_BUCKETS * sizeof(*priv->tab), M_NETGRAPH_BRIDGE, M_NOWAIT | M_ZERO); + priv->tab = malloc(MIN_BUCKETS * sizeof(*priv->tab), + M_NETGRAPH_BRIDGE, M_NOWAIT | M_ZERO); if (priv->tab == NULL) { free(priv, M_NETGRAPH_BRIDGE); return (ENOMEM); @@ -358,7 +359,8 @@ ng_bridge_newhook(node_p node, hook_p ho return (EINVAL); if (priv->links[linkNum] != NULL) return (EISCONN); - priv->links[linkNum] = malloc( sizeof(*priv->links[linkNum]), M_NETGRAPH_BRIDGE, M_NOWAIT|M_ZERO); + priv->links[linkNum] = malloc(sizeof(*priv->links[linkNum]), + M_NETGRAPH_BRIDGE, M_NOWAIT|M_ZERO); if (priv->links[linkNum] == NULL) return (ENOMEM); priv->links[linkNum]->hook = hook; @@ -848,7 +850,7 @@ ng_bridge_put(priv_p priv, const u_char #endif /* Allocate and initialize new hashtable entry */ - hent = malloc( sizeof(*hent), M_NETGRAPH_BRIDGE, M_NOWAIT); + hent = malloc(sizeof(*hent), M_NETGRAPH_BRIDGE, M_NOWAIT); if (hent == NULL) return (0); bcopy(addr, hent->host.addr, ETHER_ADDR_LEN); @@ -892,7 +894,8 @@ ng_bridge_rehash(priv_p priv) newMask = newNumBuckets - 1; /* Allocate and initialize new table */ - newTab = malloc( newNumBuckets * sizeof(*newTab), M_NETGRAPH_BRIDGE, M_NOWAIT | M_ZERO); + newTab = malloc(newNumBuckets * sizeof(*newTab), + M_NETGRAPH_BRIDGE, M_NOWAIT | M_ZERO); if (newTab == NULL) return; Modified: head/sys/netgraph/ng_fec.c ============================================================================== --- head/sys/netgraph/ng_fec.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/netgraph/ng_fec.c Thu Oct 23 20:26:15 2008 (r184214) @@ -403,7 +403,7 @@ ng_fec_addport(struct ng_fec_private *pr } /* Allocate new list entry. */ - new = malloc( sizeof(struct ng_fec_portlist), M_NETGRAPH, M_NOWAIT); + new = malloc(sizeof(struct ng_fec_portlist), M_NETGRAPH, M_NOWAIT); if (new == NULL) return(ENOMEM); Modified: head/sys/netgraph/ng_l2tp.c ============================================================================== --- head/sys/netgraph/ng_l2tp.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/netgraph/ng_l2tp.c Thu Oct 23 20:26:15 2008 (r184214) @@ -428,7 +428,8 @@ ng_l2tp_newhook(node_p node, hook_p hook return (EINVAL); /* Create hook private structure */ - hpriv = malloc( sizeof(*hpriv), M_NETGRAPH_L2TP, M_NOWAIT | M_ZERO); + hpriv = malloc(sizeof(*hpriv), + M_NETGRAPH_L2TP, M_NOWAIT | M_ZERO); if (hpriv == NULL) return (ENOMEM); hpriv->conf.session_id = session_id; Modified: head/sys/netgraph/ng_mppc.c ============================================================================== --- head/sys/netgraph/ng_mppc.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/netgraph/ng_mppc.c Thu Oct 23 20:26:15 2008 (r184214) @@ -295,7 +295,8 @@ ng_mppc_rcvmsg(node_p node, item_p item, d->history = NULL; } if ((cfg->bits & MPPC_BIT) != 0) { - d->history = malloc( isComp ? MPPC_SizeOfCompressionHistory() : + d->history = malloc(isComp ? + MPPC_SizeOfCompressionHistory() : MPPC_SizeOfDecompressionHistory(), M_NETGRAPH_MPPC, M_NOWAIT); if (d->history == NULL) Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/netinet/in_mcast.c Thu Oct 23 20:26:15 2008 (r184214) @@ -817,7 +817,7 @@ inp_get_source_filters(struct inpcb *inp * has asked for, but we always tell userland how big the * buffer really needs to be. */ - tss = malloc( sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs, + tss = malloc(sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs, M_TEMP, M_NOWAIT); if (tss == NULL) { error = ENOBUFS; @@ -1569,7 +1569,7 @@ inp_set_source_filters(struct inpcb *inp * that we may copy them with a single copyin. This * allows us to deal with page faults up-front. */ - kss = malloc( sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs, + kss = malloc(sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs, M_TEMP, M_WAITOK); error = copyin(msfr.msfr_srcs, kss, sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs); @@ -1623,7 +1623,7 @@ inp_set_source_filters(struct inpcb *inp * entries we are about to allocate, in case we * abruptly need to free them. */ - pnims = malloc( sizeof(struct in_msource *) * msfr.msfr_nsrcs, + pnims = malloc(sizeof(struct in_msource *) * msfr.msfr_nsrcs, M_TEMP, M_WAITOK | M_ZERO); /* @@ -1634,8 +1634,8 @@ inp_set_source_filters(struct inpcb *inp pkss = kss; nims = NULL; for (i = 0; i < msfr.msfr_nsrcs; i++, pkss++) { - nims = malloc( sizeof(struct in_msource) * msfr.msfr_nsrcs, - M_IPMSOURCE, M_WAITOK | M_ZERO); + nims = malloc(sizeof(struct in_msource) * + msfr.msfr_nsrcs, M_IPMSOURCE, M_WAITOK | M_ZERO); pnims[i] = nims; } if (i < msfr.msfr_nsrcs) { Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/netinet/tcp_syncache.c Thu Oct 23 20:26:15 2008 (r184214) @@ -247,8 +247,8 @@ syncache_init(void) &V_tcp_syncache.cache_limit); /* Allocate the hash table. */ - V_tcp_syncache.hashbase = malloc( V_tcp_syncache.hashsize * sizeof(struct syncache_head), - M_SYNCACHE, M_WAITOK | M_ZERO); + V_tcp_syncache.hashbase = malloc(V_tcp_syncache.hashsize * + sizeof(struct syncache_head), M_SYNCACHE, M_WAITOK | M_ZERO); /* Initialize the hash buckets. */ for (i = 0; i < V_tcp_syncache.hashsize; i++) { Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/netinet6/raw_ip6.c Thu Oct 23 20:26:15 2008 (r184214) @@ -565,7 +565,7 @@ rip6_attach(struct socket *so, int proto error = soreserve(so, rip_sendspace, rip_recvspace); if (error) return (error); - filter = malloc( sizeof(struct icmp6_filter), M_PCB, M_NOWAIT); + filter = malloc(sizeof(struct icmp6_filter), M_PCB, M_NOWAIT); if (filter == NULL) return (ENOMEM); INP_INFO_WLOCK(&V_ripcbinfo); Modified: head/sys/nfs4client/nfs4_vnops.c ============================================================================== --- head/sys/nfs4client/nfs4_vnops.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/nfs4client/nfs4_vnops.c Thu Oct 23 20:26:15 2008 (r184214) @@ -2235,8 +2235,7 @@ nfs4_sillyrename(struct vnode *dvp, stru if (vp->v_type == VDIR) panic("nfs: sillyrename dir"); #endif - sp = malloc(sizeof (struct sillyrename), - M_NFSREQ, M_WAITOK); + sp = malloc(sizeof (struct sillyrename), M_NFSREQ, M_WAITOK); sp->s_cred = crhold(cnp->cn_cred); sp->s_dvp = dvp; sp->s_removeit = nfs4_removeit; @@ -2352,7 +2351,7 @@ nfs4_lookitup(struct vnode *dvp, const c np->n_namelen = len; if (np->n_name != NULL) free(np->n_name, M_NFSREQ); - np->n_name = malloc( np->n_namelen + 1, M_NFSREQ, M_WAITOK); + np->n_name = malloc(np->n_namelen + 1, M_NFSREQ, M_WAITOK); memcpy(np->n_name, name, len); np->n_name[len] = '\0'; } Modified: head/sys/nfsclient/nfs_lock.c ============================================================================== --- head/sys/nfsclient/nfs_lock.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/nfsclient/nfs_lock.c Thu Oct 23 20:26:15 2008 (r184214) @@ -281,7 +281,8 @@ nfs_dolock(struct vop_advlock_args *ap) * if there is no nfsowner table yet, allocate one. */ if (p->p_nlminfo == NULL) { - p->p_nlminfo = malloc( sizeof(struct nlminfo), M_NLMINFO, M_WAITOK | M_ZERO); + p->p_nlminfo = malloc(sizeof(struct nlminfo), + M_NLMINFO, M_WAITOK | M_ZERO); p->p_nlminfo->pid_start = p->p_stats->p_start; timevaladd(&p->p_nlminfo->pid_start, &boottime); } Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/opencrypto/cryptodev.c Thu Oct 23 20:26:15 2008 (r184214) @@ -267,7 +267,8 @@ cryptof_ioctl( goto bail; } - crie.cri_key = malloc( crie.cri_klen / 8, M_XDATA, M_WAITOK); + crie.cri_key = malloc(crie.cri_klen / 8, + M_XDATA, M_WAITOK); if ((error = copyin(sop->key, crie.cri_key, crie.cri_klen / 8))) goto bail; @@ -284,7 +285,8 @@ cryptof_ioctl( } if (cria.cri_klen) { - cria.cri_key = malloc( cria.cri_klen / 8, M_XDATA, M_WAITOK); + cria.cri_key = malloc(cria.cri_klen / 8, + M_XDATA, M_WAITOK); if ((error = copyin(sop->mackey, cria.cri_key, cria.cri_klen / 8))) goto bail; @@ -776,11 +778,9 @@ csecreate(struct fcrypt *fcr, u_int64_t #ifdef INVARIANTS /* NB: required when mtx_init is built with INVARIANTS */ - cse = malloc(sizeof(struct csession), - M_XDATA, M_NOWAIT | M_ZERO); + cse = malloc(sizeof(struct csession), M_XDATA, M_NOWAIT | M_ZERO); #else - cse = malloc(sizeof(struct csession), - M_XDATA, M_NOWAIT); + cse = malloc(sizeof(struct csession), M_XDATA, M_NOWAIT); #endif if (cse == NULL) return NULL; @@ -840,7 +840,7 @@ cryptoioctl(struct cdev *dev, u_long cmd switch (cmd) { case CRIOGET: - fcr = malloc( sizeof(struct fcrypt), M_XDATA, M_WAITOK); + fcr = malloc(sizeof(struct fcrypt), M_XDATA, M_WAITOK); TAILQ_INIT(&fcr->csessions); fcr->sesn = 0; Modified: head/sys/security/mac_bsdextended/mac_bsdextended.c ============================================================================== --- head/sys/security/mac_bsdextended/mac_bsdextended.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/security/mac_bsdextended/mac_bsdextended.c Thu Oct 23 20:26:15 2008 (r184214) @@ -152,7 +152,8 @@ sysctl_rule(SYSCTL_HANDLER_ARGS) error = SYSCTL_IN(req, &temprule, sizeof(temprule)); if (error) return (error); - ruleptr = malloc( sizeof(*ruleptr), M_MACBSDEXTENDED, M_WAITOK | M_ZERO); + ruleptr = malloc(sizeof(*ruleptr), M_MACBSDEXTENDED, + M_WAITOK | M_ZERO); } mtx_lock(&ugidfw_mtx); Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Oct 23 20:26:15 2008 (r184214) @@ -3920,7 +3920,8 @@ initiate_write_inodeblock_ufs1(inodedep, if (inodedep->id_savedino1 != NULL) panic("initiate_write_inodeblock_ufs1: I/O underway"); FREE_LOCK(&lk); - sip = malloc( sizeof(struct ufs1_dinode), M_SAVEDINO, M_SOFTDEP_FLAGS); + sip = malloc(sizeof(struct ufs1_dinode), + M_SAVEDINO, M_SOFTDEP_FLAGS); ACQUIRE_LOCK(&lk); inodedep->id_savedino1 = sip; *inodedep->id_savedino1 = *dp; @@ -4065,7 +4066,8 @@ initiate_write_inodeblock_ufs2(inodedep, if (inodedep->id_savedino2 != NULL) panic("initiate_write_inodeblock_ufs2: I/O underway"); FREE_LOCK(&lk); - sip = malloc( sizeof(struct ufs2_dinode), M_SAVEDINO, M_SOFTDEP_FLAGS); + sip = malloc(sizeof(struct ufs2_dinode), + M_SAVEDINO, M_SOFTDEP_FLAGS); ACQUIRE_LOCK(&lk); inodedep->id_savedino2 = sip; *inodedep->id_savedino2 = *dp; Modified: head/sys/ufs/ufs/ufs_extattr.c ============================================================================== --- head/sys/ufs/ufs/ufs_extattr.c Thu Oct 23 20:23:03 2008 (r184213) +++ head/sys/ufs/ufs/ufs_extattr.c Thu Oct 23 20:26:15 2008 (r184214) @@ -588,7 +588,8 @@ ufs_extattr_enable(struct ufsmount *ump, if (backing_vnode->v_type != VREG) return (EINVAL); - attribute = malloc( sizeof(struct ufs_extattr_list_entry), M_UFS_EXTATTR, M_WAITOK); + attribute = malloc(sizeof(struct ufs_extattr_list_entry), + M_UFS_EXTATTR, M_WAITOK); if (attribute == NULL) return (ENOMEM); From owner-svn-src-head@FreeBSD.ORG Thu Oct 23 21:50:16 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 876E1106567C; Thu, 23 Oct 2008 21:50:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75CA58FC0A; Thu, 23 Oct 2008 21:50:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9NLoGCG067758; Thu, 23 Oct 2008 21:50:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9NLoGjc067757; Thu, 23 Oct 2008 21:50:16 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200810232150.m9NLoGjc067757@svn.freebsd.org> From: John Baldwin Date: Thu, 23 Oct 2008 21:50:16 +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: r184215 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2008 21:50:16 -0000 Author: jhb Date: Thu Oct 23 21:50:16 2008 New Revision: 184215 URL: http://svn.freebsd.org/changeset/base/184215 Log: Whitespace fix. Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Oct 23 20:26:15 2008 (r184214) +++ head/sys/kern/vfs_syscalls.c Thu Oct 23 21:50:16 2008 (r184215) @@ -2084,7 +2084,8 @@ struct faccessat_args { int flag; } #endif -int faccessat(struct thread *td, struct faccessat_args *uap) +int +faccessat(struct thread *td, struct faccessat_args *uap) { if (uap->flag & ~AT_EACCESS) From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 01:03:32 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 062921065699; Fri, 24 Oct 2008 01:03:32 +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 E7F038FC0C; Fri, 24 Oct 2008 01:03:31 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9O13VCE071076; Fri, 24 Oct 2008 01:03:31 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9O13V7f071075; Fri, 24 Oct 2008 01:03:31 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <200810240103.m9O13V7f071075@svn.freebsd.org> From: David Xu Date: Fri, 24 Oct 2008 01:03: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: r184216 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 01:03:32 -0000 Author: davidxu Date: Fri Oct 24 01:03:31 2008 New Revision: 184216 URL: http://svn.freebsd.org/changeset/base/184216 Log: partly revert revision 184199, because TDF_NEEDSIGCHK is persitent when thread is in kernel mode, it can cause dead loop, now unlock process lock after acquired sleep queue lock and thread lock to avoid the problem. This means TDF_NEEDSIGCHK and TDF_NEEDSUSPCHK must be set with process lock and thread lock being hold at same time. Modified: head/sys/kern/subr_sleepqueue.c Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Thu Oct 23 21:50:16 2008 (r184215) +++ head/sys/kern/subr_sleepqueue.c Fri Oct 24 01:03:31 2008 (r184216) @@ -396,7 +396,6 @@ sleepq_catch_signals(void *wchan, int pr return (0); } -catch_sig: thread_unlock(td); mtx_unlock_spin(&sc->sc_lock); CTR3(KTR_PROC, "sleepq catching signals: thread %p (pid %ld, %s)", @@ -416,19 +415,15 @@ catch_sig: ret = ERESTART; mtx_unlock(&ps->ps_mtx); } - PROC_UNLOCK(p); mtx_lock_spin(&sc->sc_lock); thread_lock(td); - if (ret != 0) - goto out; - if ((td->td_flags & (TDF_NEEDSIGCHK | TDF_NEEDSUSPCHK)) != 0) - goto catch_sig; - - sleepq_switch(wchan, pri); - return (0); + PROC_UNLOCK(p); + if (ret == 0) { + sleepq_switch(wchan, pri); + return (0); + } -out: /* * There were pending signals and this thread is still * on the sleep queue, remove it from the sleep queue. From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 01:09:25 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5325D106566C; Fri, 24 Oct 2008 01:09:25 +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 415088FC14; Fri, 24 Oct 2008 01:09:25 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9O19P7L071215; Fri, 24 Oct 2008 01:09:25 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9O19P1u071214; Fri, 24 Oct 2008 01:09:25 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <200810240109.m9O19P1u071214@svn.freebsd.org> From: David Xu Date: Fri, 24 Oct 2008 01:09: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: r184217 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 01:09:25 -0000 Author: davidxu Date: Fri Oct 24 01:09:24 2008 New Revision: 184217 URL: http://svn.freebsd.org/changeset/base/184217 Log: Don't rearm callout if the process is exiting, it may leak a callout because callout_drain() only waits for running callout, but not disable it if it is rearmed. Modified: head/sys/kern/kern_resource.c Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Fri Oct 24 01:03:31 2008 (r184216) +++ head/sys/kern/kern_resource.c Fri Oct 24 01:09:24 2008 (r184217) @@ -638,7 +638,8 @@ lim_cb(void *arg) psignal(p, SIGXCPU); } } - callout_reset(&p->p_limco, hz, lim_cb, p); + if ((p->p_flag & P_WEXIT) == 0) + callout_reset(&p->p_limco, hz, lim_cb, p); } int From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 01:10:43 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0659F106566C; Fri, 24 Oct 2008 01:10:43 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id B96348FC1C; Fri, 24 Oct 2008 01:10:42 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id m9O19hj6082272; Thu, 23 Oct 2008 19:09:43 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 23 Oct 2008 19:09:42 -0600 (MDT) Message-Id: <20081023.190942.74668946.imp@bsdimp.com> To: marcel@FreeBSD.org From: Warner Losh In-Reply-To: <200810230151.m9N1ptUe044619@svn.freebsd.org> References: <200810230151.m9N1ptUe044619@svn.freebsd.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184193 - in head/sys: arm/conf conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 01:10:43 -0000 From: Marcel Moolenaar Subject: svn commit: r184193 - in head/sys: arm/conf conf Date: Thu, 23 Oct 2008 01:51:55 +0000 (UTC) > Author: marcel > Date: Thu Oct 23 01:51:55 2008 > New Revision: 184193 > URL: http://svn.freebsd.org/changeset/base/184193 > > Log: > Add arm/conf/DEFAULTS and populate it with: > machine arm > device mem > options GEOM_BSD > options GEOM_MBR > > Remove the first two from all kernel configuration files and > change geom_bsd and geom_mbr from standard to optional. > > Added: > head/sys/arm/conf/DEFAULTS (contents, props changed) We already have a better mechanism for including config files. We should be using that instead of poluting another port with the DEFAULTS file. Warner From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 01:14:59 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B2F61065672; Fri, 24 Oct 2008 01:14:59 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id E484B8FC13; Fri, 24 Oct 2008 01:14:58 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id m9O1AFWA082282; Thu, 23 Oct 2008 19:10:15 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 23 Oct 2008 19:10:14 -0600 (MDT) Message-Id: <20081023.191014.41711418.imp@bsdimp.com> To: marcel@FreeBSD.org From: Warner Losh In-Reply-To: <200810230216.m9N2Gdxw045106@svn.freebsd.org> References: <200810230216.m9N2Gdxw045106@svn.freebsd.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184194 - in head/sys: conf mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 01:14:59 -0000 > Add mips/conf/DEFAULTS and populate it with: > machine arm > device mem > device uart_ns8250 > options GEOM_BSD > options GEOM_MBR > > Remove the first three from all kernel configuration files > (sometimes commented-out) and change geom_bsd and geom_mbr > from standard to optional. We shouldn't be using DEFAULTS for this. Warner From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 01:26:44 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53CF51065679; Fri, 24 Oct 2008 01:26:44 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 1058D8FC0C; Fri, 24 Oct 2008 01:26:43 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 3400E6D449; Fri, 24 Oct 2008 01:26:43 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 2355F844BA; Fri, 24 Oct 2008 03:26:43 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Warner Losh References: <200810230151.m9N1ptUe044619@svn.freebsd.org> <20081023.190942.74668946.imp@bsdimp.com> Date: Fri, 24 Oct 2008 03:26:43 +0200 In-Reply-To: <20081023.190942.74668946.imp@bsdimp.com> (Warner Losh's message of "Thu, 23 Oct 2008 19:09:42 -0600 (MDT)") Message-ID: <868wsewzos.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, marcel@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184193 - in head/sys: arm/conf conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 01:26:44 -0000 Warner Losh writes: > We already have a better mechanism for including config files. We > should be using that instead of poluting another port with the > DEFAULTS file. Should we even have DEFAULTS files at all? IMHO they just confuse matters by introducing "stealth" options into your config. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 02:31:10 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67B6A1065675; Fri, 24 Oct 2008 02:31:10 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 25EE18FC08; Fri, 24 Oct 2008 02:31:10 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id m9O2Tk9j083081; Thu, 23 Oct 2008 20:29:47 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 23 Oct 2008 20:29:46 -0600 (MDT) Message-Id: <20081023.202946.74666802.imp@bsdimp.com> To: des@des.no From: Warner Losh In-Reply-To: <868wsewzos.fsf@ds4.des.no> References: <200810230151.m9N1ptUe044619@svn.freebsd.org> <20081023.190942.74668946.imp@bsdimp.com> <868wsewzos.fsf@ds4.des.no> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, marcel@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184193 - in head/sys: arm/conf conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 02:31:10 -0000 From: Dag-Erling Sm=F8rgrav Subject: Re: svn commit: r184193 - in head/sys: arm/conf conf Date: Fri, 24 Oct 2008 03:26:43 +0200 > Warner Losh writes: > > We already have a better mechanism for including config files. We > > should be using that instead of poluting another port with the > > DEFAULTS file. > = > Should we even have DEFAULTS files at all? IMHO they just confuse > matters by introducing "stealth" options into your config. No. It is a useful transition tool when things become required, it isn't a useful long-term resting place for options. IMHO. Warner From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 04:50:14 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38E9C106567A; Fri, 24 Oct 2008 04:50:14 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:3fb::211]) by mx1.freebsd.org (Postfix) with ESMTP id EDB3F8FC08; Fri, 24 Oct 2008 04:50:13 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id BA3B51CDB7; Fri, 24 Oct 2008 06:50:12 +0200 (CEST) Date: Fri, 24 Oct 2008 06:50:12 +0200 From: Ed Schouten To: John Baldwin Message-ID: <20081024045012.GD6808@hoeg.nl> References: <200810231911.m9NJBisd064280@svn.freebsd.org> <200810231555.06892.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="g7w8+K/95kPelPD2" Content-Disposition: inline In-Reply-To: <200810231555.06892.jhb@freebsd.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184208 - head/sys/dev/uart X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 04:50:14 -0000 --g7w8+K/95kPelPD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * John Baldwin wrote: > Perhaps have tty drivers sleep in detach until the tty is completely gone= ? =20 > Either that or free the unit number in the tty layer when the tty is=20 > abandoned. Well, I could add a routine to the TTY layer that does that. The reason why the TTY layer is a little `lazy' with deallocating TTY unit numbers, is because I want to be absolutely sure processes agree they do not use the TTY (device name) anymore. I'll see if I can add a sleepable tty_gone() routine one of these days. --=20 Ed Schouten WWW: http://80386.nl/ --g7w8+K/95kPelPD2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkkBVAQACgkQ52SDGA2eCwXviQCfYJ0Z+RZQFNi6U7DC0n9f1Z6P BUkAnRjBa5K93ZwWWYcOLN8D1KUzIyYU =WABh -----END PGP SIGNATURE----- --g7w8+K/95kPelPD2-- From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 07:08:42 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DFB81065681; Fri, 24 Oct 2008 07:08:42 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BC168FC0C; Fri, 24 Oct 2008 07:08:42 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9O78g3s083087; Fri, 24 Oct 2008 07:08:42 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9O78gFl083086; Fri, 24 Oct 2008 07:08:42 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200810240708.m9O78gFl083086@svn.freebsd.org> From: Nick Hibma Date: Fri, 24 Oct 2008 07:08: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: r184218 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 07:08:42 -0000 Author: n_hibma Date: Fri Oct 24 07:08:42 2008 New Revision: 184218 URL: http://svn.freebsd.org/changeset/base/184218 Log: - Bugfix: Only claim interface after having checked all endpoints. This might make Qualcomm and Option cards (which have all endpoints in 1 interface) work. - Change the USB buffer sizes to depend on the transfer speed. With UMTS we use a buffer 384k / 1000 frames/sec * 50msecs =~ 15kB for example. - Add a MODULE_VERSION statement Modified: head/sys/dev/usb/u3g.c Modified: head/sys/dev/usb/u3g.c ============================================================================== --- head/sys/dev/usb/u3g.c Fri Oct 24 01:09:24 2008 (r184217) +++ head/sys/dev/usb/u3g.c Fri Oct 24 07:08:42 2008 (r184218) @@ -48,6 +48,7 @@ #include "usbdevs.h" +//#define U3G_DEBUG #ifdef U3G_DEBUG #define DPRINTF(x...) do { if (u3gdebug) device_printf(self, ##x); } while (0) #define DPRINTFN(n, x...) do { if (u3gdebug > (n)) device_printf(self, ##x); } while (0) @@ -57,7 +58,6 @@ int u3gdebug = 1; #define DPRINTFN(n, x...) /* nop */ #endif -#define U3G_BUFSIZ 10240 #define U3G_MAXPORTS 4 #define U3G_CONFIG_INDEX 0 @@ -85,25 +85,42 @@ struct ucom_callback u3g_callback = { }; +struct u3g_speeds_s { + u_int32_t ispeed; + u_int32_t ospeed; +}; + +static const struct u3g_speeds_s u3g_speeds[] = { +#define U3GSP_GPRS 0 + {64000, 64000}, +#define U3GSP_EDGE 1 + {384000, 64000}, +#define U3GSP_CDMA 2 + {384000, 64000}, +#define U3GSP_UMTS 3 + {384000, 64000}, +#define U3GSP_HSDPA 4 + {1200000, 384000}, +#define U3GSP_HSUPA 5 + {1200000, 384000}, +#define U3GSP_HSPA 6 + {7200000, 384000}, +}; + /* * Various supported device vendors/products. */ struct u3g_dev_type_s { struct usb_devno devno; u_int8_t speed; -#define U3GSP_GPRS 1 -#define U3GSP_EDGE 2 -#define U3GSP_UMTS 3 -#define U3GSP_HSDPA 4 -#define U3GSP_HSUPA 5 -#define U3GSP_HSPA 6 - u_int8_t flags; #define U3GFL_NONE 0x00 #define U3GFL_HUAWEI_INIT 0x01 // Requires init (Huawei cards) #define U3GFL_STUB_WAIT 0x02 // Device reappears after a short delay }; +// Note: The entries marked with XXX should be checked for the correct speed +// indication to set the buffer sizes. static const struct u3g_dev_type_s u3g_devs[] = { /* OEM: Option */ {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3G }, U3GSP_UMTS, U3GFL_NONE }, @@ -113,12 +130,12 @@ static const struct u3g_dev_type_s u3g_d {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GTMAXHSUPA }, U3GSP_HSDPA, U3GFL_NONE }, {{ USB_VENDOR_OPTION, USB_PRODUCT_OPTION_VODAFONEMC3G }, U3GSP_UMTS, U3GFL_NONE }, /* OEM: Qualcomm, Inc. */ - {{ USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_CDMA_MSM }, U3GSP_UMTS, U3GFL_STUB_WAIT }, // XXX + {{ USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_CDMA_MSM }, U3GSP_CDMA, U3GFL_STUB_WAIT }, /* OEM: Huawei */ {{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_MOBILE }, U3GSP_HSDPA, U3GFL_HUAWEI_INIT }, {{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E220 }, U3GSP_HSDPA, U3GFL_HUAWEI_INIT }, /* OEM: Novatel */ - {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_CDMA_MODEM }, U3GSP_UMTS, U3GFL_STUB_WAIT }, // XXX + {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_CDMA_MODEM }, U3GSP_CDMA, U3GFL_STUB_WAIT }, {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_ES620 }, U3GSP_UMTS, U3GFL_STUB_WAIT }, // XXX {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_MC950D }, U3GSP_HSUPA, U3GFL_STUB_WAIT }, {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U720 }, U3GSP_UMTS, U3GFL_STUB_WAIT }, // XXX @@ -242,6 +259,7 @@ u3g_attach(device_t self) } int bulkin_no = -1, bulkout_no = -1; + int claim_iface = 0; for (n = 0; n < id->bNumEndpoints; n++) { ed = usbd_interface2endpoint_descriptor(uaa->ifaces[i], n); if (ed == NULL) @@ -264,10 +282,11 @@ u3g_attach(device_t self) ucom->sc_udev = dev; ucom->sc_iface = uaa->ifaces[i]; ucom->sc_bulkin_no = bulkin_no; - ucom->sc_ibufsize = U3G_BUFSIZ; - ucom->sc_ibufsizepad = U3G_BUFSIZ; // XXX What's this? ucom->sc_bulkout_no = bulkout_no; - ucom->sc_obufsize = U3G_BUFSIZ; + // Allocate a buffer enough for 10ms worth of data + ucom->sc_ibufsize = u3g_speeds[sc->sc_speed].ispeed/USB_FRAMES_PER_SECOND*10; + ucom->sc_ibufsizepad = ucom->sc_ibufsize; + ucom->sc_obufsize = u3g_speeds[sc->sc_speed].ospeed/USB_FRAMES_PER_SECOND*10; ucom->sc_opkthdrlen = 0; ucom->sc_callback = &u3g_callback; @@ -284,12 +303,13 @@ u3g_attach(device_t self) ucom_attach_tty(ucom, devnamefmt, portno); #endif - uaa->ifaces[i] = NULL; + claim_iface = 1; portno++; bulkin_no = bulkout_no = -1; } } - + if (claim_iface) + uaa->ifaces[i] = NULL; // claim the interface } sc->sc_numports = portno; @@ -327,37 +347,17 @@ u3g_open(void *addr, int portno) * anyway. * Note: We abuse the fact that ucom sets the speed through * ispeed/ospeed, not through ispeedwat/ospeedwat. + * XXX Are the speeds correct? */ if (portno == 0) { struct u3g_softc *sc = addr; struct ucom_softc *ucom = &sc->sc_ucom[portno]; struct tty *tp = ucom->sc_tty; -#ifdef U3G_DEBUG - device_t self = sc->sc_dev; -#endif - if (sc->sc_speed&U3GSP_HSPA) { - tp->t_ispeedwat = 7200000; - tp->t_ospeedwat = 384000; - } else if (sc->sc_speed&U3GSP_HSUPA) { - tp->t_ispeedwat = 1200000; - tp->t_ospeedwat = 384000; - } else if (sc->sc_speed&U3GSP_HSDPA) { - tp->t_ispeedwat = 1200000; - tp->t_ospeedwat = 384000; - } else if (sc->sc_speed&U3GSP_UMTS) { - tp->t_ispeedwat = 384000; - tp->t_ospeedwat = 64000; - } else if (sc->sc_speed&U3GSP_EDGE) { - tp->t_ispeedwat = 384000; - tp->t_ospeedwat = 64000; - } else { - tp->t_ispeedwat = 64000; - tp->t_ospeedwat = 64000; - } + tp->t_ispeedwat = u3g_speeds[sc->sc_speed].ispeed; + tp->t_ospeedwat = u3g_speeds[sc->sc_speed].ospeed; - /* Avoid excessive buffer sizes. On modern fast machines this is - * not needed. + /* Avoid excessive buffer sizes. * XXX The values here should be checked. Lower them and see * whether 'lost chars' messages appear. */ @@ -366,8 +366,6 @@ u3g_open(void *addr, int portno) if (tp->t_ospeedwat > 384000) tp->t_ospeedwat = 384000; - DPRINTF("ispeedwat = %d, ospeedwat = %d\n", - tp->t_ispeedwat, tp->t_ospeedwat); ttsetwater(tp); } #endif @@ -391,7 +389,6 @@ u3g_close(void *addr, int portno) tp->t_ispeedwat = (speed_t)-1; tp->t_ospeedwat = (speed_t)-1; - DPRINTF("ispeedwat = default, ospeedwat = default\n"); ttsetwater(tp); } #endif @@ -415,6 +412,7 @@ static driver_t u3g_driver = { DRIVER_MODULE(u3g, uhub, u3g_driver, ucom_devclass, usbd_driver_load, 0); MODULE_DEPEND(u3g, usb, 1, 1, 1); MODULE_DEPEND(u3g, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); +MODULE_VERSION(u3g, 1); /******************************************************************* ****** Stub driver to hide devices that need to reinitialise ****** From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 07:12:06 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A7FB106566C; Fri, 24 Oct 2008 07:12:06 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED44E8FC1E; Fri, 24 Oct 2008 07:12:05 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9O7C57v083190; Fri, 24 Oct 2008 07:12:05 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9O7C5GZ083189; Fri, 24 Oct 2008 07:12:05 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200810240712.m9O7C5GZ083189@svn.freebsd.org> From: Nick Hibma Date: Fri, 24 Oct 2008 07:12: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: r184219 - head/sys/i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 07:12:06 -0000 Author: n_hibma Date: Fri Oct 24 07:12:05 2008 New Revision: 184219 URL: http://svn.freebsd.org/changeset/base/184219 Log: Remove the entry from the i386 specific NOTES as it is in the generic NOTES file as well. This avoids one of the warnings from make LINT && config LINT Modified: head/sys/i386/conf/NOTES Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Fri Oct 24 07:08:42 2008 (r184218) +++ head/sys/i386/conf/NOTES Fri Oct 24 07:12:05 2008 (r184219) @@ -610,7 +610,6 @@ hint.sr.0.at="isa" hint.sr.0.port="0x300" hint.sr.0.irq="5" hint.sr.0.maddr="0xd0000" -device ural device wl hint.wl.0.at="isa" hint.wl.0.port="0x300" From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 07:16:13 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0CB71065674; Fri, 24 Oct 2008 07:16:13 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F2AC8FC13; Fri, 24 Oct 2008 07:16:13 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9O7GDlG083297; Fri, 24 Oct 2008 07:16:13 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9O7GDX2083294; Fri, 24 Oct 2008 07:16:13 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200810240716.m9O7GDX2083294@svn.freebsd.org> From: Nick Hibma Date: Fri, 24 Oct 2008 07:16: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: r184220 - in head/sys: conf dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 07:16:13 -0000 Author: n_hibma Date: Fri Oct 24 07:16:13 2008 New Revision: 184220 URL: http://svn.freebsd.org/changeset/base/184220 Log: Add U3G_DEBUG to LINT Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/dev/usb/u3g.c Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Oct 24 07:12:05 2008 (r184219) +++ head/sys/conf/NOTES Fri Oct 24 07:16:13 2008 (r184220) @@ -2419,7 +2419,7 @@ device uscanner # # USB serial support device ucom -# USB support for 3G modem cards by Option, Huawei and Sierra +# USB support for 3G modem cards by Option, Novatel, Huawei and Sierra device u3g # USB support for Technologies ARK3116 based serial adapters device uark @@ -2486,6 +2486,7 @@ device rum # debugging options for the USB subsystem # options USB_DEBUG +options U3G_DEBUG # options for ukbd: options UKBD_DFLT_KEYMAP # specify the built-in keymap Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Oct 24 07:12:05 2008 (r184219) +++ head/sys/conf/options Fri Oct 24 07:16:13 2008 (r184220) @@ -618,6 +618,7 @@ BUS_DEBUG opt_bus.h # options for USB support USB_DEBUG opt_usb.h USBVERBOSE opt_usb.h +U3G_DEBUG opt_u3g.h UKBD_DFLT_KEYMAP opt_ukbd.h UPLCOM_INTR_INTERVAL opt_uplcom.h UVSCOM_DEFAULT_OPKTSIZE opt_uvscom.h Modified: head/sys/dev/usb/u3g.c ============================================================================== --- head/sys/dev/usb/u3g.c Fri Oct 24 07:12:05 2008 (r184219) +++ head/sys/dev/usb/u3g.c Fri Oct 24 07:16:13 2008 (r184220) @@ -46,6 +46,7 @@ #include +#include "opt_u3g.h" #include "usbdevs.h" //#define U3G_DEBUG From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 07:19:09 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75A971065671; Fri, 24 Oct 2008 07:19:09 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64BB88FC0C; Fri, 24 Oct 2008 07:19:09 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9O7J9vS083381; Fri, 24 Oct 2008 07:19:09 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9O7J9XX083380; Fri, 24 Oct 2008 07:19:09 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200810240719.m9O7J9XX083380@svn.freebsd.org> From: Nick Hibma Date: Fri, 24 Oct 2008 07:19: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: r184221 - head/sys/modules/u3g X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 07:19:09 -0000 Author: n_hibma Date: Fri Oct 24 07:19:09 2008 New Revision: 184221 URL: http://svn.freebsd.org/changeset/base/184221 Log: After adding U3G_DEBUG to LINT we need to create the opt_u3g.h file when building the module. Modified: head/sys/modules/u3g/Makefile Modified: head/sys/modules/u3g/Makefile ============================================================================== --- head/sys/modules/u3g/Makefile Fri Oct 24 07:16:13 2008 (r184220) +++ head/sys/modules/u3g/Makefile Fri Oct 24 07:19:09 2008 (r184221) @@ -3,6 +3,10 @@ .PATH: ${.CURDIR}/../../dev/usb KMOD= u3g -SRCS= u3g.c ucomvar.h opt_usb.h device_if.h bus_if.h usbdevs.h +SRCS= opt_usb.h opt_u3g.h \ + device_if.h bus_if.h \ + usbdevs.h \ + ucomvar.h \ + u3g.c .include From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 07:56:01 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76D08106567A; Fri, 24 Oct 2008 07:56:01 +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 664DA8FC1D; Fri, 24 Oct 2008 07:56:01 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9O7u1x1084050; Fri, 24 Oct 2008 07:56:01 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9O7u1Ws084049; Fri, 24 Oct 2008 07:56:01 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200810240756.m9O7u1Ws084049@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 24 Oct 2008 07:56: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: r184222 - head/lib/libfetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 07:56:01 -0000 Author: ru Date: Fri Oct 24 07:56:01 2008 New Revision: 184222 URL: http://svn.freebsd.org/changeset/base/184222 Log: Don't fail mistakenly with -r when we already have the whole file. Reviewed by: des Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Fri Oct 24 07:19:09 2008 (r184221) +++ head/lib/libfetch/http.c Fri Oct 24 07:56:01 2008 (r184222) @@ -1064,6 +1064,7 @@ http_request(struct url *URL, const char if (url->offset == size && url->length == 0) { /* asked for 0 bytes; fake it */ offset = url->offset; + clength = -1; conn->err = HTTP_OK; break; } else { From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 07:57:48 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA103106567D; Fri, 24 Oct 2008 07:57:48 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D92128FC28; Fri, 24 Oct 2008 07:57:48 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9O7vmAH084112; Fri, 24 Oct 2008 07:57:48 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9O7vmEw084111; Fri, 24 Oct 2008 07:57:48 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200810240757.m9O7vmEw084111@svn.freebsd.org> From: Kip Macy Date: Fri, 24 Oct 2008 07:57: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: r184223 - head/sys/xen/evtchn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 07:57:49 -0000 Author: kmacy Date: Fri Oct 24 07:57:48 2008 New Revision: 184223 URL: http://svn.freebsd.org/changeset/base/184223 Log: Fix evtchn initialization on SMP Modified: head/sys/xen/evtchn/evtchn.c Modified: head/sys/xen/evtchn/evtchn.c ============================================================================== --- head/sys/xen/evtchn/evtchn.c Fri Oct 24 07:56:01 2008 (r184222) +++ head/sys/xen/evtchn/evtchn.c Fri Oct 24 07:57:48 2008 (r184223) @@ -101,18 +101,48 @@ enum { IRQT_VIRQ, IRQT_IPI, IRQT_LOCAL_PORT, - IRQT_CALLER_PORT + IRQT_CALLER_PORT, + _IRQT_COUNT + }; + +#define _IRQT_BITS 4 +#define _EVTCHN_BITS 12 +#define _INDEX_BITS (32 - _IRQT_BITS - _EVTCHN_BITS) + +/* Constructor for packed IRQ information. */ +static inline uint32_t +mk_irq_info(uint32_t type, uint32_t index, uint32_t evtchn) +{ + + return ((type << (32 - _IRQT_BITS)) | (index << _EVTCHN_BITS) | evtchn); +} + /* Constructor for packed IRQ information. */ -#define mk_irq_info(type, index, evtchn) \ - (((uint32_t)(type) << 24) | ((uint32_t)(index) << 16) | (uint32_t)(evtchn)) + /* Convenient shorthand for packed representation of an unbound IRQ. */ #define IRQ_UNBOUND mk_irq_info(IRQT_UNBOUND, 0, 0) -/* Accessor macros for packed IRQ information. */ -#define evtchn_from_irq(irq) ((uint16_t)(irq_info[irq])) -#define index_from_irq(irq) ((uint8_t)(irq_info[irq] >> 16)) -#define type_from_irq(irq) ((uint8_t)(irq_info[irq] >> 24)) + +/* + * Accessors for packed IRQ information. + */ + +static inline unsigned int evtchn_from_irq(int irq) +{ + return irq_info[irq] & ((1U << _EVTCHN_BITS) - 1); +} + +static inline unsigned int index_from_irq(int irq) +{ + return (irq_info[irq] >> _EVTCHN_BITS) & ((1U << _INDEX_BITS) - 1); +} + +static inline unsigned int type_from_irq(int irq) +{ + return irq_info[irq] >> (32 - _IRQT_BITS); +} + /* IRQ <-> VIRQ mapping. */ @@ -132,9 +162,9 @@ static int irq_bindcount[NR_IRQS]; #define VALID_EVTCHN(_chn) ((_chn) != 0) -#ifdef CONFIG_SMP +#ifdef SMP -static u8 cpu_evtchn[NR_EVENT_CHANNELS]; +static uint8_t cpu_evtchn[NR_EVENT_CHANNELS]; static unsigned long cpu_evtchn_mask[NR_CPUS][NR_EVENT_CHANNELS/BITS_PER_LONG]; #define active_evtchns(cpu,sh,idx) \ @@ -228,7 +258,6 @@ ipi_pcpu(unsigned int cpu, int vector) int irq; irq = per_cpu(ipi_to_irq, cpu)[vector]; - irq = (pcpu_find((cpu))->pc_ipi_to_irq)[vector]; notify_remote_via_irq(irq); } @@ -362,7 +391,10 @@ out: return irq; } -static int + +extern int bind_ipi_to_irq(unsigned int ipi, unsigned int cpu); + +int bind_ipi_to_irq(unsigned int ipi, unsigned int cpu) { struct evtchn_bind_ipi bind_ipi; @@ -1047,7 +1079,10 @@ evtchn_init(void *dummy __unused) int i, cpu; struct xenpic_intsrc *pin, *tpin; - /* No VIRQ or IPI bindings. */ + + init_evtchn_cpu_bindings(); + + /* No VIRQ or IPI bindings. */ for (cpu = 0; cpu < mp_ncpus; cpu++) { for (i = 0; i < NR_VIRQS; i++) per_cpu(virq_to_irq, cpu)[i] = -1; From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 07:58:38 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4687106569E; Fri, 24 Oct 2008 07:58:38 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C28898FC1F; Fri, 24 Oct 2008 07:58:38 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9O7wcGJ084171; Fri, 24 Oct 2008 07:58:38 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9O7wcvt084168; Fri, 24 Oct 2008 07:58:38 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200810240758.m9O7wcvt084168@svn.freebsd.org> From: Kip Macy Date: Fri, 24 Oct 2008 07:58: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: r184224 - in head/sys/i386: include xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 07:58:39 -0000 Author: kmacy Date: Fri Oct 24 07:58:38 2008 New Revision: 184224 URL: http://svn.freebsd.org/changeset/base/184224 Log: Fix general issues with IPI support Modified: head/sys/i386/include/apicvar.h head/sys/i386/include/smp.h head/sys/i386/xen/mp_machdep.c Modified: head/sys/i386/include/apicvar.h ============================================================================== --- head/sys/i386/include/apicvar.h Fri Oct 24 07:57:48 2008 (r184223) +++ head/sys/i386/include/apicvar.h Fri Oct 24 07:58:38 2008 (r184224) @@ -114,14 +114,14 @@ #define APIC_IPI_INTS (APIC_LOCAL_INTS + 2) #ifdef XEN -#define IPI_RENDEZVOUS (0) /* Inter-CPU rendezvous. */ -#define IPI_INVLTLB (1) /* TLB Shootdown IPIs */ -#define IPI_INVLPG (2) -#define IPI_INVLRNG (3) -#define IPI_INVLCACHE (4) -#define IPI_LAZYPMAP (5) /* Lazy pmap release. */ +#define IPI_RENDEZVOUS (2) /* Inter-CPU rendezvous. */ +#define IPI_INVLTLB (3) /* TLB Shootdown IPIs */ +#define IPI_INVLPG (4) +#define IPI_INVLRNG (5) +#define IPI_INVLCACHE (6) +#define IPI_LAZYPMAP (7) /* Lazy pmap release. */ /* Vector to handle bitmap based IPIs */ -#define IPI_BITMAP_VECTOR (6) +#define IPI_BITMAP_VECTOR (8) #else #define IPI_RENDEZVOUS (APIC_IPI_INTS) /* Inter-CPU rendezvous. */ Modified: head/sys/i386/include/smp.h ============================================================================== --- head/sys/i386/include/smp.h Fri Oct 24 07:57:48 2008 (r184223) +++ head/sys/i386/include/smp.h Fri Oct 24 07:58:38 2008 (r184224) @@ -86,8 +86,8 @@ int ipi_nmi_handler(void); #ifdef XEN void ipi_to_irq_init(void); -#define CALL_FUNCTION_VECTOR 0 -#define RESCHEDULE_VECTOR 1 +#define RESCHEDULE_VECTOR 0 +#define CALL_FUNCTION_VECTOR 1 #define NR_IPIS 2 #endif Modified: head/sys/i386/xen/mp_machdep.c ============================================================================== --- head/sys/i386/xen/mp_machdep.c Fri Oct 24 07:57:48 2008 (r184223) +++ head/sys/i386/xen/mp_machdep.c Fri Oct 24 07:58:38 2008 (r184224) @@ -309,14 +309,12 @@ static void iv_invltlb(uintptr_t a, uintptr_t b) { xen_tlb_flush(); - atomic_add_int(&smp_tlb_wait, 1); } static void iv_invlpg(uintptr_t a, uintptr_t b) { xen_invlpg(a); - atomic_add_int(&smp_tlb_wait, 1); } static void @@ -329,7 +327,6 @@ iv_invlrng(uintptr_t a, uintptr_t b) xen_invlpg(start); start += PAGE_SIZE; } - atomic_add_int(&smp_tlb_wait, 1); } @@ -345,12 +342,36 @@ static void iv_lazypmap(uintptr_t a, uintptr_t b) { pmap_lazyfix_action(); + atomic_add_int(&smp_tlb_wait, 1); } + static void -iv_bitmap_vector(uintptr_t a, uintptr_t b) +iv_noop(uintptr_t a, uintptr_t b) { + atomic_add_int(&smp_tlb_wait, 1); +} +static call_data_func_t *ipi_vectors[IPI_BITMAP_VECTOR] = +{ + iv_noop, + iv_noop, + iv_rendezvous, + iv_invltlb, + iv_invlpg, + iv_invlrng, + iv_invlcache, + iv_lazypmap, +}; + +/* + * Reschedule call back. Nothing to do, + * all the work is done automatically when + * we return from the interrupt. + */ +static int +smp_reschedule_interrupt(void *unused) +{ int cpu = PCPU_GET(cpuid); u_int ipi_bitmap; @@ -369,37 +390,16 @@ iv_bitmap_vector(uintptr_t a, uintptr_t #endif /* Nothing to do for AST */ } -} - - -static call_data_func_t *ipi_vectors[IPI_BITMAP_VECTOR + 1] = -{ iv_rendezvous, - iv_invltlb, - iv_invlpg, - iv_invlrng, - iv_invlcache, - iv_lazypmap, - iv_bitmap_vector -}; - -/* - * Reschedule call back. Nothing to do, - * all the work is done automatically when - * we return from the interrupt. - */ -static int -smp_reschedule_interrupt(void *unused) -{ return (FILTER_HANDLED); } struct _call_data { - call_data_func_t *func; + uint16_t func_id; + uint16_t wait; uintptr_t arg1; uintptr_t arg2; atomic_t started; atomic_t finished; - int wait; }; static struct _call_data *call_data; @@ -407,17 +407,23 @@ static struct _call_data *call_data; static int smp_call_function_interrupt(void *unused) { - call_data_func_t *func = call_data->func; + call_data_func_t *func; uintptr_t arg1 = call_data->arg1; uintptr_t arg2 = call_data->arg2; int wait = call_data->wait; + atomic_t *started = &call_data->started; + atomic_t *finished = &call_data->finished; + if (call_data->func_id > IPI_BITMAP_VECTOR) + panic("invalid function id %u", call_data->func_id); + + func = ipi_vectors[call_data->func_id]; /* * Notify initiating CPU that I've grabbed the data and am * about to execute the function */ mb(); - atomic_inc(&call_data->started); + atomic_inc(started); /* * At this point the info structure may be out of scope unless wait==1 */ @@ -425,8 +431,9 @@ smp_call_function_interrupt(void *unused if (wait) { mb(); - atomic_inc(&call_data->finished); + atomic_inc(finished); } + atomic_add_int(&smp_tlb_wait, 1); return (FILTER_HANDLED); } @@ -967,12 +974,14 @@ smp_tlb_shootdown(u_int vector, vm_offse if (!(read_eflags() & PSL_I)) panic("%s: interrupts disabled", __func__); mtx_lock_spin(&smp_ipi_mtx); + call_data->func_id = vector; call_data->arg1 = addr1; call_data->arg2 = addr2; atomic_store_rel_int(&smp_tlb_wait, 0); ipi_all_but_self(vector); while (smp_tlb_wait < ncpu) ia32_pause(); + call_data = NULL; mtx_unlock_spin(&smp_ipi_mtx); } @@ -980,6 +989,7 @@ static void smp_targeted_tlb_shootdown(u_int mask, u_int vector, vm_offset_t addr1, vm_offset_t addr2) { int ncpu, othercpus; + struct _call_data data; othercpus = mp_ncpus - 1; if (mask == (u_int)-1) { @@ -1004,8 +1014,10 @@ smp_targeted_tlb_shootdown(u_int mask, u if (!(read_eflags() & PSL_I)) panic("%s: interrupts disabled", __func__); mtx_lock_spin(&smp_ipi_mtx); - smp_tlb_addr1 = addr1; - smp_tlb_addr2 = addr2; + call_data = &data; + call_data->func_id = vector; + call_data->arg1 = addr1; + call_data->arg2 = addr2; atomic_store_rel_int(&smp_tlb_wait, 0); if (mask == (u_int)-1) ipi_all_but_self(vector); @@ -1013,6 +1025,7 @@ smp_targeted_tlb_shootdown(u_int mask, u ipi_selected(mask, vector); while (smp_tlb_wait < ncpu) ia32_pause(); + call_data = NULL; mtx_unlock_spin(&smp_ipi_mtx); } @@ -1082,20 +1095,17 @@ smp_masked_invlpg_range(u_int mask, vm_o * send an IPI to a set of cpus. */ void -ipi_selected(u_int32_t cpus, u_int ipi) +ipi_selected(uint32_t cpus, u_int ipi) { int cpu; u_int bitmap = 0; u_int old_pending; u_int new_pending; - struct _call_data data; - - call_data = &data; if (IPI_IS_BITMAPED(ipi)) { bitmap = 1 << ipi; ipi = IPI_BITMAP_VECTOR; - } + } #ifdef STOP_NMI if (ipi == IPI_STOP && stop_cpus_with_nmi) { @@ -1117,10 +1127,13 @@ ipi_selected(u_int32_t cpus, u_int ipi) new_pending = old_pending | bitmap; } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu],old_pending, new_pending)); - if (old_pending) - continue; + if (!old_pending) + ipi_pcpu(cpu, RESCHEDULE_VECTOR); + continue; + } - call_data->func = ipi_vectors[ipi]; + + KASSERT(call_data != NULL, ("call_data not set")); ipi_pcpu(cpu, CALL_FUNCTION_VECTOR); } } @@ -1137,7 +1150,7 @@ ipi_all_but_self(u_int ipi) return; } CTR2(KTR_SMP, "%s: ipi: %x", __func__, ipi); - ipi_selected((all_cpus & ~(1 << curcpu)), ipi); + ipi_selected(PCPU_GET(other_cpus), ipi); } #ifdef STOP_NMI From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 08:50:51 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29C011065673; Fri, 24 Oct 2008 08:50:51 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by mx1.freebsd.org (Postfix) with ESMTP id EEAC08FC21; Fri, 24 Oct 2008 08:50:50 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 62B991823E0; Fri, 24 Oct 2008 04:50:50 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Fri, 24 Oct 2008 04:50:50 -0400 X-Sasl-enc: uRwrapVBiYJ+hOEGsGjmmKJYz1R8iOPQE12kaWWkX+VJ 1224838250 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 856901D03E; Fri, 24 Oct 2008 04:50:49 -0400 (EDT) Message-ID: <49018C68.3020706@FreeBSD.org> Date: Fri, 24 Oct 2008 09:50:48 +0100 From: "Bruce M. Simpson" User-Agent: Thunderbird 2.0.0.14 (X11/20080514) MIME-Version: 1.0 To: Warner Losh References: <200810230216.m9N2Gdxw045106@svn.freebsd.org> <20081023.191014.41711418.imp@bsdimp.com> In-Reply-To: <20081023.191014.41711418.imp@bsdimp.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, marcel@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184194 - in head/sys: conf mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 08:50:51 -0000 Warner Losh wrote: >> Add mips/conf/DEFAULTS and populate it with: >> machine arm >> device mem >> device uart_ns8250 >> options GEOM_BSD >> options GEOM_MBR >> >> Remove the first three from all kernel configuration files >> (sometimes commented-out) and change geom_bsd and geom_mbr >> from standard to optional. >> > > We shouldn't be using DEFAULTS for this. > I agree. Marcel, can you please back this change out (at least the mips or SENTRY5 part of it) ? uart support isn't ready on SENTRY5; shipping these drivers in a default configuration just adds dead wood on a platform where kernel size is critical. thanks BMS From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 09:52:08 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 512681065670; Fri, 24 Oct 2008 09:52:08 +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 DD5F88FC36; Fri, 24 Oct 2008 09:52:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-151-199.carlnfd1.nsw.optusnet.com.au (c122-106-151-199.carlnfd1.nsw.optusnet.com.au [122.106.151.199]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m9O9pviH003253 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Oct 2008 20:52:02 +1100 Date: Fri, 24 Oct 2008 20:51:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= In-Reply-To: <86ej27xgzy.fsf@ds4.des.no> Message-ID: <20081024204301.A72819@delplex.bde.org> References: <200810231553.m9NFrqQj060598@svn.freebsd.org> <20081023184621.GA32081@ws64.jh.dy.fi> <86ej27xgzy.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1994515382-1224841917=:72819" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Jaakko Heinonen , src-committers@FreeBSD.org Subject: Re: svn commit: r184205 - in head: . share/man/man9 sys/arm/arm sys/cam/scsi sys/compat/linux sys/contrib/altq/altq sys/contrib/ipfilter/netinet sys/dev/ar sys/dev/ce sys/dev/hwpmc sys/dev/lmc sys/dev/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 09:52:08 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1994515382-1224841917=:72819 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Thu, 23 Oct 2008, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote: > Jaakko Heinonen writes: >> This change introduces some bad formatting. Many statements would now >> fit to 80 columns and don't need to be wrapped. > > You're right, and I'd appreciate a patch, if you feel like it - but not > right away, as I'm about to revert the net80211 parts of the commit. > >> There are also places with unnecessary white space: > > They were already broken, and I didn't want to mix style changes with > code changes. Actually, at least the first 6 weren't broken, but were broken by mixing style changes with the code changes. The first 1 is: % Modified: head/sys/contrib/altq/altq/altq_hfsc.c % =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D % --- head/sys/contrib/altq/altq/altq_hfsc.c=09Thu Oct 23 15:44:00 2008=09(= r184204) % +++ head/sys/contrib/altq/altq/altq_hfsc.c=09Thu Oct 23 15:53:51 2008=09(= r184205) % ... % @@ -471,8 +471,7 @@ hfsc_class_create(struct hfsc_if *hif, s % #endif /* ALTQ_RED */ %=20 % =09if (rsc !=3D NULL && (rsc->m1 !=3D 0 || rsc->m2 !=3D 0)) { % -=09=09MALLOC(cl->cl_rsc, struct internal_sc *, % -=09=09 sizeof(struct internal_sc), M_DEVBUF, M_WAITOK); % +=09=09cl->cl_rsc =3D malloc(=09=09 sizeof(struct internal_sc), M_DEVB= UF, M_WAITOK); % =09=09if (cl->cl_rsc =3D=3D NULL) % =09=09=09goto err_ret; % =09=09sc2isc(rsc, cl->cl_rsc); Here the sizeof() was perfectly indented, with 2 tabs and then 4 spaces for a continuation line. A dumb sed script appears to have been run over this blindly. It duplicated the 2 tabs and 4 spaces, which would have been OK if it didn't also join the lines by removing only the newline, leaving weird whitespace after "malloc(". Bruce --0-1994515382-1224841917=:72819-- From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 13:27:03 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 816ED106567E; Fri, 24 Oct 2008 13:27:03 +0000 (UTC) Date: Fri, 24 Oct 2008 13:27:03 +0000 From: Alexey Dokuchaev To: Dag-Erling Sm??rgrav Message-ID: <20081024132703.GA81378@FreeBSD.org> References: <200810230151.m9N1ptUe044619@svn.freebsd.org> <20081023.190942.74668946.imp@bsdimp.com> <868wsewzos.fsf@ds4.des.no> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <868wsewzos.fsf@ds4.des.no> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, marcel@FreeBSD.org, Warner Losh , src-committers@FreeBSD.org Subject: Re: svn commit: r184193 - in head/sys: arm/conf conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 13:27:03 -0000 On Fri, Oct 24, 2008 at 03:26:43AM +0200, Dag-Erling Sm??rgrav wrote: > Warner Losh writes: > > We already have a better mechanism for including config files. We > > should be using that instead of poluting another port with the > > DEFAULTS file. > > Should we even have DEFAULTS files at all? IMHO they just confuse > matters by introducing "stealth" options into your config. I tend to second this. I always try to get everything possible out of my kernel to modules, and thus was surprised to see io.ko and mem.ko fail to load because they were silently included into my custom kernel. I understand that some things like 'device isa' and 'device npx' aren't really optional, but if something is useful to have, but can be loaded as a module, it belongs to GENERIC rather than DEFAULTS. Killing the latter altogether and throwing a comment that says particular option or device is mandatory in GENERIC is probably even better (and more transparent). ./danfe From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 14:40:13 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F3AA1065676; Fri, 24 Oct 2008 14:40:13 +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 4D6E18FC1A; Fri, 24 Oct 2008 14:40:13 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9OEeDoN092228; Fri, 24 Oct 2008 14:40:13 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9OEeDmG092227; Fri, 24 Oct 2008 14:40:13 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200810241440.m9OEeDmG092227@svn.freebsd.org> From: Alan Cox Date: Fri, 24 Oct 2008 14: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: r184226 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 14:40:13 -0000 Author: alc Date: Fri Oct 24 14:40:13 2008 New Revision: 184226 URL: http://svn.freebsd.org/changeset/base/184226 Log: Finish what revision 1.40 started. Revision 1.40 removed a false statement from the description but not the errors section. This revision removes it from the errors statement. Add a statement about the non-portability of non-page-aligned offsets. Modified: head/lib/libc/sys/mmap.2 Modified: head/lib/libc/sys/mmap.2 ============================================================================== --- head/lib/libc/sys/mmap.2 Fri Oct 24 13:23:54 2008 (r184225) +++ head/lib/libc/sys/mmap.2 Fri Oct 24 14:40:13 2008 (r184226) @@ -28,7 +28,7 @@ .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 .\" $FreeBSD$ .\" -.Dd April 21, 2006 +.Dd October 24, 2008 .Dt MMAP 2 .Os .Sh NAME @@ -252,6 +252,11 @@ In the future we may define an additiona in which the file descriptor argument specifies a file or device to which swapping should be done. +.Sh NOTES +Although this implementation does not impose any alignment restrictions on +the +.Fa offset +argument, a portable program must only use page-aligned values. .Sh RETURN VALUES Upon successful completion, .Fn mmap @@ -307,13 +312,6 @@ was negative. was specified and the .Fa fd argument was not -1. -The -.Fa offset -argument -was not page-aligned. -(See -.Sx BUGS -below.) .It Bq Er ENODEV .Dv MAP_ANON has not been specified and From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 15:11:12 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A5CC1065682; Fri, 24 Oct 2008 15:11:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id BDF708FC16; Fri, 24 Oct 2008 15:11:11 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m9OFB5aT040064; Fri, 24 Oct 2008 11:11:05 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: David Xu Date: Fri, 24 Oct 2008 10:27:23 -0400 User-Agent: KMail/1.9.7 References: <200810240109.m9O19P1u071214@svn.freebsd.org> In-Reply-To: <200810240109.m9O19P1u071214@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200810241027.24970.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Fri, 24 Oct 2008 11:11:05 -0400 (EDT) X-Virus-Scanned: ClamAV 0.93.1/8485/Fri Oct 24 09:38:51 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184217 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 15:11:12 -0000 On Thursday 23 October 2008 09:09:25 pm David Xu wrote: > Author: davidxu > Date: Fri Oct 24 01:09:24 2008 > New Revision: 184217 > URL: http://svn.freebsd.org/changeset/base/184217 > > Log: > Don't rearm callout if the process is exiting, it may leak a callout > because callout_drain() only waits for running callout, but not disable > it if it is rearmed. Actually, it does prevent rearming from within the callout routine itself while waiting: int callout_reset_on(struct callout *c, int to_ticks, void (*ftn)(void *), void *arg, int cpu) { ... if (cc->cc_curr == c) { ... if (cc->cc_waiting) { /* * Someone has called callout_drain to kill this * callout. Don't reschedule. */ CTR4(KTR_CALLOUT, "%s %p func %p arg %p", cancelled ? "cancelled" : "failed to cancel", c, c->c_func, c->c_arg); CC_UNLOCK(cc); return (cancelled); } } ... } Lots of callouts using callout_init_mtx() (e.g. all the callouts in the NIC drivers) depend on this feature. Please revert this. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 15:11:19 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E8551065769 for ; Fri, 24 Oct 2008 15:11:19 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 179BE8FC1E for ; Fri, 24 Oct 2008 15:11:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m9OFB5aU040064; Fri, 24 Oct 2008 11:11:11 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Alexey Dokuchaev Date: Fri, 24 Oct 2008 10:31:07 -0400 User-Agent: KMail/1.9.7 References: <200810230151.m9N1ptUe044619@svn.freebsd.org> <868wsewzos.fsf@ds4.des.no> <20081024132703.GA81378@FreeBSD.org> In-Reply-To: <20081024132703.GA81378@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200810241031.08780.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Fri, 24 Oct 2008 11:11:12 -0400 (EDT) X-Virus-Scanned: ClamAV 0.93.1/8485/Fri Oct 24 09:38:51 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: marcel@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org, Dag-Erling Sm??rgrav , Warner Losh Subject: Re: svn commit: r184193 - in head/sys: arm/conf conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 15:11:19 -0000 On Friday 24 October 2008 09:27:03 am Alexey Dokuchaev wrote: > On Fri, Oct 24, 2008 at 03:26:43AM +0200, Dag-Erling Sm??rgrav wrote: > > Warner Losh writes: > > > We already have a better mechanism for including config files. We > > > should be using that instead of poluting another port with the > > > DEFAULTS file. > > > > Should we even have DEFAULTS files at all? IMHO they just confuse > > matters by introducing "stealth" options into your config. > > I tend to second this. I always try to get everything possible out of > my kernel to modules, and thus was surprised to see io.ko and mem.ko > fail to load because they were silently included into my custom kernel. > > I understand that some things like 'device isa' and > 'device npx' aren't really optional, but if something is useful to have, > but can be loaded as a module, it belongs to GENERIC rather than > DEFAULTS. Killing the latter altogether and throwing a comment that > says particular option or device is mandatory in GENERIC is probably > even better (and more transparent). The one thing I think DEFAULTS is useful for are replacing NO_FOO options with FOO options. That is, if someone wants to turn a feature on by default, I'd rather them put 'options FOO' in DEFAULTS rather than rename all the #ifdef's,e tc. to '#ifndef NO_FOO'. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 15:11:33 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59850106566C; Fri, 24 Oct 2008 15:11:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id D0EE38FC2C; Fri, 24 Oct 2008 15:11:32 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m9OFB5aW040064; Fri, 24 Oct 2008 11:11:24 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Ed Schouten Date: Fri, 24 Oct 2008 10:36:09 -0400 User-Agent: KMail/1.9.7 References: <200810231911.m9NJBisd064280@svn.freebsd.org> <200810231555.06892.jhb@freebsd.org> <20081024045012.GD6808@hoeg.nl> In-Reply-To: <20081024045012.GD6808@hoeg.nl> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200810241036.10595.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Fri, 24 Oct 2008 11:11:24 -0400 (EDT) X-Virus-Scanned: ClamAV 0.93.1/8485/Fri Oct 24 09:38:51 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184208 - head/sys/dev/uart X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 15:11:33 -0000 On Friday 24 October 2008 12:50:12 am Ed Schouten wrote: > * John Baldwin wrote: > > Perhaps have tty drivers sleep in detach until the tty is completely gone? > > Either that or free the unit number in the tty layer when the tty is > > abandoned. > > Well, I could add a routine to the TTY layer that does that. The reason > why the TTY layer is a little `lazy' with deallocating TTY unit numbers, > is because I want to be absolutely sure processes agree they do not use > the TTY (device name) anymore. > > I'll see if I can add a sleepable tty_gone() routine one of these days. I think what you want then is for the detach() routines to block until the tty is fully drained. This is similar to what we do for other places (ether_ifdetach() is supposed to sleep until the ifnet is completely unreferenced from userland for example (it may not fully ensure this yet, but that is the way the driver should use the API, the driver can't possibly close that sort of race in its own code). Actually, detach() _needs_ to block because when you kldunload a driver, once detach() returns the code segment for that module can be unmapped. If there are threads in that driver's tty routines still then you can get kernel page faults. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 15:28:20 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6685A106567A; Fri, 24 Oct 2008 15:28:20 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (unknown [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 00D768FC26; Fri, 24 Oct 2008 15:28:20 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 930931D10F; Fri, 24 Oct 2008 17:28:18 +0200 (CEST) Date: Fri, 24 Oct 2008 17:28:18 +0200 From: Ed Schouten To: John Baldwin Message-ID: <20081024152818.GI6808@hoeg.nl> References: <200810231911.m9NJBisd064280@svn.freebsd.org> <200810231555.06892.jhb@freebsd.org> <20081024045012.GD6808@hoeg.nl> <200810241036.10595.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fckbADODYWZD5TdN" Content-Disposition: inline In-Reply-To: <200810241036.10595.jhb@freebsd.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184208 - head/sys/dev/uart X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 15:28:20 -0000 --fckbADODYWZD5TdN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * John Baldwin wrote: > On Friday 24 October 2008 12:50:12 am Ed Schouten wrote: > > * John Baldwin wrote: > > > Perhaps have tty drivers sleep in detach until the tty is completely = gone? =20 > > > Either that or free the unit number in the tty layer when the tty is= =20 > > > abandoned. > >=20 > > Well, I could add a routine to the TTY layer that does that. The reason > > why the TTY layer is a little `lazy' with deallocating TTY unit numbers, > > is because I want to be absolutely sure processes agree they do not use > > the TTY (device name) anymore. > >=20 > > I'll see if I can add a sleepable tty_gone() routine one of these days. >=20 > I think what you want then is for the detach() routines to block until th= e tty=20 > is fully drained. This is similar to what we do for other places=20 > (ether_ifdetach() is supposed to sleep until the ifnet is completely=20 > unreferenced from userland for example (it may not fully ensure this yet,= but=20 > that is the way the driver should use the API, the driver can't possibly= =20 > close that sort of race in its own code). >=20 > Actually, detach() _needs_ to block because when you kldunload a driver, = once=20 > detach() returns the code segment for that module can be unmapped. If th= ere=20 > are threads in that driver's tty routines still then you can get kernel p= age=20 > faults. Yes. That's true, but the reason why I implemented the way it is right now, is because the current behaviour is *very* pleasant to implement things like pts(4). There is no blocking inside the close() path of a pseudo-terminal master device (which makes no sense) and the tsw_free routine just returns the unit number back to the unrhdr (see ptsdrv_free() in sys/kern/tty_pts.c). But as I said, I will add a routine which does this. Apart from that, drivers could already implement the sleeping themselves, by just sleeping on a conditional variable until tsw_free() has been called. But it's easier to provide a proper routine to do this. --=20 Ed Schouten WWW: http://80386.nl/ --fckbADODYWZD5TdN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkkB6ZIACgkQ52SDGA2eCwVeZwCff3wJ07yNXP0QVojAOzRzT2lM NxwAn2isRp1wAx4P7iw3mAeEhOhqCl5h =HfTL -----END PGP SIGNATURE----- --fckbADODYWZD5TdN-- From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 16:01:16 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95C041065699 for ; Fri, 24 Oct 2008 16:01:16 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from rn-out-0910.google.com (rn-out-0910.google.com [64.233.170.189]) by mx1.freebsd.org (Postfix) with ESMTP id 40DBB8FC2D for ; Fri, 24 Oct 2008 16:01:16 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by rn-out-0910.google.com with SMTP id j71so605354rne.12 for ; Fri, 24 Oct 2008 09:01:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=MM8bYIndOiQtRtjFVTqYOboj2BojHmfyijmEjYeCj2E=; b=alJ7jIUktf2M/pxxpHxapHny56h1je1Lp9oXxp9efAUh8H9ZBe7yEBXuxeVumw8XwS FtySEYxkFgCNTKDK6Vdag+JUoNGxqcF5w/MkXiRzjHJCJnH+XgI7L+GQmHwyqiEOOSGS TEMDmm44gtmrMZCmHoZCxhbcfJRcqRvfzuH38= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=SlNihARdN1tJESbDnuMslWNTbtqZgFLlv6JyJl6UvLM1EZEf3MS60VLV4aiQfnVffu UFiUfPZuguni1d61TBMtVnqQlTTcuz6KVba1FHbJSyn2NBmrrXpcAppfr9z1pyDDE9jL L5fjKxarh+jv+YgjoxxmV2zg2eCnfy5/mY/Lo= Received: by 10.103.218.9 with SMTP id v9mr1129573muq.91.1224864074596; Fri, 24 Oct 2008 09:01:14 -0700 (PDT) Received: by 10.103.239.14 with HTTP; Fri, 24 Oct 2008 09:01:14 -0700 (PDT) Message-ID: <3bbf2fe10810240901s576f6dday9b59ad44f0a1a85@mail.gmail.com> Date: Fri, 24 Oct 2008 18:01:14 +0200 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "David Xu" In-Reply-To: <200810240103.m9O13V7f071075@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200810240103.m9O13V7f071075@svn.freebsd.org> X-Google-Sender-Auth: cd72d7d9da6f7025 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184216 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 16:01:16 -0000 2008/10/24 David Xu : > Author: davidxu > Date: Fri Oct 24 01:03:31 2008 > New Revision: 184216 > URL: http://svn.freebsd.org/changeset/base/184216 > > Log: > partly revert revision 184199, because TDF_NEEDSIGCHK is persitent > when thread is in kernel mode, it can cause dead loop, now unlock > process lock after acquired sleep queue lock and thread lock to > avoid the problem. This means TDF_NEEDSIGCHK and TDF_NEEDSUSPCHK must > be set with process lock and thread lock being hold at same time. > > Modified: > head/sys/kern/subr_sleepqueue.c > > Modified: head/sys/kern/subr_sleepqueue.c > ============================================================================== > --- head/sys/kern/subr_sleepqueue.c Thu Oct 23 21:50:16 2008 (r184215) > +++ head/sys/kern/subr_sleepqueue.c Fri Oct 24 01:03:31 2008 (r184216) > @@ -396,7 +396,6 @@ sleepq_catch_signals(void *wchan, int pr > return (0); > } > > -catch_sig: > thread_unlock(td); > mtx_unlock_spin(&sc->sc_lock); > CTR3(KTR_PROC, "sleepq catching signals: thread %p (pid %ld, %s)", > @@ -416,19 +415,15 @@ catch_sig: > ret = ERESTART; > mtx_unlock(&ps->ps_mtx); > } > - PROC_UNLOCK(p); > > mtx_lock_spin(&sc->sc_lock); > thread_lock(td); > - if (ret != 0) > - goto out; > - if ((td->td_flags & (TDF_NEEDSIGCHK | TDF_NEEDSUSPCHK)) != 0) > - goto catch_sig; > - > - sleepq_switch(wchan, pri); > - return (0); > + PROC_UNLOCK(p); > + if (ret == 0) { > + sleepq_switch(wchan, pri); > + return (0); > + } > > -out: > /* > * There were pending signals and this thread is still > * on the sleep queue, remove it from the sleep queue. > As long as this is a variation about the usual scheme in the td_flags locking, you should document that with a comment IMHO. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 16:01:58 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09BA01065673; Fri, 24 Oct 2008 16:01:58 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id CFDE28FC39; Fri, 24 Oct 2008 16:01:57 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id m9OG1to8004307 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Oct 2008 09:01:55 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <4901F173.2070701@freebsd.org> Date: Fri, 24 Oct 2008 09:01:55 -0700 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.9 (X11/20071125) MIME-Version: 1.0 To: marcel@freebsd.org References: <200810230151.m9N1ptUe044619@svn.freebsd.org> <20081023.190942.74668946.imp@bsdimp.com> In-Reply-To: <20081023.190942.74668946.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC--Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r184193 - in head/sys: arm/conf conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 16:01:58 -0000 Warner Losh wrote: > From: Marcel Moolenaar > Subject: svn commit: r184193 - in head/sys: arm/conf conf > Date: Thu, 23 Oct 2008 01:51:55 +0000 (UTC) > > >> Author: marcel >> Date: Thu Oct 23 01:51:55 2008 >> New Revision: 184193 >> URL: http://svn.freebsd.org/changeset/base/184193 >> >> Log: >> Add arm/conf/DEFAULTS and populate it with: >> machine arm >> device mem >> options GEOM_BSD >> options GEOM_MBR >> >> Remove the first two from all kernel configuration files and >> change geom_bsd and geom_mbr from standard to optional. >> >> Added: >> head/sys/arm/conf/DEFAULTS (contents, props changed) >> > > We already have a better mechanism for including config files. We > should be using that instead of poluting another port with the > DEFAULTS file. > More importantly this change forces GEOM_BSD and GEOM_MBR on every target platform. This is just wrong and clearly Marvel never discussed it with anyone working on arm systems or he'd have gotten an earful. Marcel, please back this stuff out. Sam From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 16:04:10 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1F45106567B; Fri, 24 Oct 2008 16:04:10 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0BAD8FC16; Fri, 24 Oct 2008 16:04:10 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9OG4Agg093705; Fri, 24 Oct 2008 16:04:10 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9OG4AfH093704; Fri, 24 Oct 2008 16:04:10 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200810241604.m9OG4AfH093704@svn.freebsd.org> From: Doug Rabson Date: Fri, 24 Oct 2008 16:04: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: r184227 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 16:04:11 -0000 Author: dfr Date: Fri Oct 24 16:04:10 2008 New Revision: 184227 URL: http://svn.freebsd.org/changeset/base/184227 Log: Don't rely on the value of *statep without first taking the vnode interlock. Reviewed by: Mike Tancsa MFC after: 2 weeks Modified: head/sys/kern/kern_lockf.c Modified: head/sys/kern/kern_lockf.c ============================================================================== --- head/sys/kern/kern_lockf.c Fri Oct 24 14:40:13 2008 (r184226) +++ head/sys/kern/kern_lockf.c Fri Oct 24 16:04:10 2008 (r184227) @@ -467,12 +467,15 @@ lf_advlockasync(struct vop_advlockasync_ /* * Avoid the common case of unlocking when inode has no locks. */ - if ((*statep) == NULL || LIST_EMPTY(&(*statep)->ls_active)) { + VI_LOCK(vp); + if ((*statep) == NULL) { if (ap->a_op != F_SETLK) { fl->l_type = F_UNLCK; + VI_UNLOCK(vp); return (0); } } + VI_UNLOCK(vp); /* * Map our arguments to an existing lock owner or create one From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 16:14:39 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54664106567D; Fri, 24 Oct 2008 16:14:39 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 2561D8FC1A; Fri, 24 Oct 2008 16:14:39 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id m9OGEbHc004393 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Oct 2008 09:14:37 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <4901F46D.8010906@freebsd.org> Date: Fri, 24 Oct 2008 09:14:37 -0700 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.9 (X11/20071125) MIME-Version: 1.0 To: Marcel Moolenaar References: <200810230151.m9N1ptUe044619@svn.freebsd.org> <20081023.190942.74668946.imp@bsdimp.com> <4901F173.2070701@freebsd.org> <37EC82F7-ECD8-4470-8406-084D7F839664@mac.com> In-Reply-To: <37EC82F7-ECD8-4470-8406-084D7F839664@mac.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC--Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, marcel@freebsd.org, src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r184193 - in head/sys: arm/conf conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 16:14:39 -0000 Marcel Moolenaar wrote: > > On Oct 24, 2008, at 9:01 AM, Sam Leffler wrote: > >>> We already have a better mechanism for including config files. We >>> should be using that instead of poluting another port with the >>> DEFAULTS file. >>> >> More importantly this change forces GEOM_BSD and GEOM_MBR on every >> target platform. > > geom_bsd and geom_mbr were defined standard in file.arm > before. There's no change in behaviour other than that > people can now opt-out. > >> This is just wrong and clearly Marvel never discussed it with anyone >> working on arm systems or he'd have gotten an earful. > > Get your facts straight. > I checked with folks and you never asked for review of this change. As to not changing behaviour; the existing use of mbr+bsdlabels is stopgap and I believe everyone actively working on these platforms would like to ditch 'em. I've got mods to switch to gpt on Gateworks boards. Sam From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 16:23:10 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B91C510656A9; Fri, 24 Oct 2008 16:23:10 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout017.mac.com (asmtpout017.mac.com [17.148.16.92]) by mx1.freebsd.org (Postfix) with ESMTP id 9D0B78FC21; Fri, 24 Oct 2008 16:23:10 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp017.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0K99006DJ469MH10@asmtp017.mac.com>; Fri, 24 Oct 2008 09:22:58 -0700 (PDT) Message-id: <5D27204C-0E14-4154-BBC5-AB90B1AC657D@mac.com> From: Marcel Moolenaar To: Sam Leffler In-reply-to: <4901F46D.8010906@freebsd.org> Date: Fri, 24 Oct 2008 09:22:56 -0700 References: <200810230151.m9N1ptUe044619@svn.freebsd.org> <20081023.190942.74668946.imp@bsdimp.com> <4901F173.2070701@freebsd.org> <37EC82F7-ECD8-4470-8406-084D7F839664@mac.com> <4901F46D.8010906@freebsd.org> X-Mailer: Apple Mail (2.929.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, marcel@freebsd.org, src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r184193 - in head/sys: arm/conf conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 16:23:10 -0000 On Oct 24, 2008, at 9:14 AM, Sam Leffler wrote: >>> This is just wrong and clearly Marvel never discussed it with >>> anyone working on arm systems or he'd have gotten an earful. >> >> Get your facts straight. >> > I checked with folks and you never asked for review of this change. What you mean to say is: "Oops, sorry!" > As to not changing behaviour; the existing use of mbr+bsdlabels is > stopgap and I believe everyone actively working on these platforms > would like to ditch 'em. I am actively working on ARM and I need to ditch them myself. For that I chose to make them optional first so that people can keep the old behaviour if they want to. Stopgap or not, as ARM was before my change, those two were non-optional. -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 16:33:36 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8702E1065671; Fri, 24 Oct 2008 16:33:36 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 5698B8FC1A; Fri, 24 Oct 2008 16:33:36 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id m9OGXYZh004530 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Oct 2008 09:33:34 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <4901F8DE.9050803@freebsd.org> Date: Fri, 24 Oct 2008 09:33:34 -0700 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.9 (X11/20071125) MIME-Version: 1.0 To: Marcel Moolenaar References: <200810230151.m9N1ptUe044619@svn.freebsd.org> <20081023.190942.74668946.imp@bsdimp.com> <4901F173.2070701@freebsd.org> <37EC82F7-ECD8-4470-8406-084D7F839664@mac.com> <4901F46D.8010906@freebsd.org> <5D27204C-0E14-4154-BBC5-AB90B1AC657D@mac.com> In-Reply-To: <5D27204C-0E14-4154-BBC5-AB90B1AC657D@mac.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC--Metrics: ebb.errno.com; whitelist Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r184193 - in head/sys: arm/conf conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 16:33:36 -0000 Marcel Moolenaar wrote: > > On Oct 24, 2008, at 9:14 AM, Sam Leffler wrote: > >>>> This is just wrong and clearly Marvel never discussed it with >>>> anyone working on arm systems or he'd have gotten an earful. >>> >>> Get your facts straight. >>> >> I checked with folks and you never asked for review of this change. > > What you mean to say is: "Oops, sorry!" So long as "you" == marcel that is correct. I don't know if it's the phase of the moon but we seem to have a spate of commits that affect many folks but were not peer-reviewed. This is bad for the health of the project and I will complain when I see it happen. > >> As to not changing behaviour; the existing use of mbr+bsdlabels is >> stopgap and I believe everyone actively working on these platforms >> would like to ditch 'em. > > I am actively working on ARM and I need to ditch them myself. > For that I chose to make them optional first so that people > can keep the old behaviour if they want to. Stopgap or not, > as ARM was before my change, those two were non-optional. > Glad to hear you're working on ARM. Please talk to others actively involved so we can share the work. Sam From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 17:05:02 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55A341065670; Fri, 24 Oct 2008 17:05:02 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout019.mac.com (asmtpout019.mac.com [17.148.16.94]) by mx1.freebsd.org (Postfix) with ESMTP id 3DB308FC26; Fri, 24 Oct 2008 17:05:02 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp019.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0K9900EFE3BLFC70@asmtp019.mac.com>; Fri, 24 Oct 2008 09:04:34 -0700 (PDT) Message-id: From: Marcel Moolenaar To: "Bruce M. Simpson" In-reply-to: <49018C68.3020706@FreeBSD.org> Date: Fri, 24 Oct 2008 09:04:32 -0700 References: <200810230216.m9N2Gdxw045106@svn.freebsd.org> <20081023.191014.41711418.imp@bsdimp.com> <49018C68.3020706@FreeBSD.org> X-Mailer: Apple Mail (2.929.2) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, marcel@FreeBSD.org, Warner Losh , src-committers@FreeBSD.org Subject: Re: svn commit: r184194 - in head/sys: conf mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 17:05:02 -0000 On Oct 24, 2008, at 1:50 AM, Bruce M. Simpson wrote: > Warner Losh wrote: >>> Add mips/conf/DEFAULTS and populate it with: >>> machine arm >>> device mem >>> device uart_ns8250 >>> options GEOM_BSD >>> options GEOM_MBR >>> Remove the first three from all kernel configuration files >>> (sometimes commented-out) and change geom_bsd and geom_mbr >>> from standard to optional. >>> >> >> We shouldn't be using DEFAULTS for this. >> > > I agree. Marcel, can you please back this change out (at least the > mips or SENTRY5 part of it) ? > > uart support isn't ready on SENTRY5; shipping these drivers in a > default configuration just adds dead wood on a platform where kernel > size is critical. I have no problem reverting, but the reasons you put forward don't hold. uart(4) is not enabled by default so there's no change to the SENTRY5 configuration at all in that respect. Please provide other grounds for reversal. -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 17:09:33 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A4971065679; Fri, 24 Oct 2008 17:09:33 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout021.mac.com (asmtpout021.mac.com [17.148.16.96]) by mx1.freebsd.org (Postfix) with ESMTP id 12D078FC16; Fri, 24 Oct 2008 17:09:33 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp021.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0K9900G8S3JLW960@asmtp021.mac.com>; Fri, 24 Oct 2008 09:09:21 -0700 (PDT) Message-id: <37EC82F7-ECD8-4470-8406-084D7F839664@mac.com> From: Marcel Moolenaar To: Sam Leffler In-reply-to: <4901F173.2070701@freebsd.org> Date: Fri, 24 Oct 2008 09:09:18 -0700 References: <200810230151.m9N1ptUe044619@svn.freebsd.org> <20081023.190942.74668946.imp@bsdimp.com> <4901F173.2070701@freebsd.org> X-Mailer: Apple Mail (2.929.2) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, marcel@freebsd.org, src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r184193 - in head/sys: arm/conf conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 17:09:33 -0000 On Oct 24, 2008, at 9:01 AM, Sam Leffler wrote: >> We already have a better mechanism for including config files. We >> should be using that instead of poluting another port with the >> DEFAULTS file. >> > More importantly this change forces GEOM_BSD and GEOM_MBR on every > target platform. geom_bsd and geom_mbr were defined standard in file.arm before. There's no change in behaviour other than that people can now opt-out. > This is just wrong and clearly Marvel never discussed it with > anyone working on arm systems or he'd have gotten an earful. Get your facts straight. -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 18:28:53 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56A5F106569E; Fri, 24 Oct 2008 18:28:53 +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 44EEE8FC13; Fri, 24 Oct 2008 18:28:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9OISrBB096255; Fri, 24 Oct 2008 18:28:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9OISrUk096254; Fri, 24 Oct 2008 18:28:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810241828.m9OISrUk096254@svn.freebsd.org> From: Alexander Motin Date: Fri, 24 Oct 2008 18:28: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: r184228 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 18:28:53 -0000 Author: mav Date: Fri Oct 24 18:28:52 2008 New Revision: 184228 URL: http://svn.freebsd.org/changeset/base/184228 Log: Add hint.hdac.%d.msi description. Modified: head/share/man/man4/snd_hda.4 Modified: head/share/man/man4/snd_hda.4 ============================================================================== --- head/share/man/man4/snd_hda.4 Fri Oct 24 16:04:10 2008 (r184227) +++ head/share/man/man4/snd_hda.4 Fri Oct 24 18:28:52 2008 (r184228) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Sep 17, 2008 +.Dd Sep 24, 2008 .Dt SND_HDA 4 .Os .Sh NAME @@ -129,6 +129,8 @@ If you have no sound or sound volume is GPIO combination required for your system. ivrefX/ovrefX options controls voltage used to power external microphones and so on. +.It Va hint.hdac.%d.msi +Controls MSI (Message Signaled Interrupts) support. .It Va hint.hdac.%d.cad%d.nid%d.config Overrides codec pin configuration set by BIOS. May be specified as a 32bit HEX value with a leading "0x" or as a set of From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 18:57:11 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0947106566C; Fri, 24 Oct 2008 18:57:11 +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 8574F8FC12; Fri, 24 Oct 2008 18:57:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9OIvBBE096776; Fri, 24 Oct 2008 18:57:11 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9OIvB3W096775; Fri, 24 Oct 2008 18:57:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810241857.m9OIvB3W096775@svn.freebsd.org> From: Alexander Motin Date: Fri, 24 Oct 2008 18:57: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: r184229 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 18:57:11 -0000 Author: mav Date: Fri Oct 24 18:57:11 2008 New Revision: 184229 URL: http://svn.freebsd.org/changeset/base/184229 Log: Fix month mistake. Again. Sorry. :) Modified: head/share/man/man4/snd_hda.4 Modified: head/share/man/man4/snd_hda.4 ============================================================================== --- head/share/man/man4/snd_hda.4 Fri Oct 24 18:28:52 2008 (r184228) +++ head/share/man/man4/snd_hda.4 Fri Oct 24 18:57:11 2008 (r184229) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Sep 24, 2008 +.Dd October 24, 2008 .Dt SND_HDA 4 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 19:29:08 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E618106573D; Fri, 24 Oct 2008 19:29:08 +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 1E28E8FC29; Fri, 24 Oct 2008 19:29:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9OJT8PK097347; Fri, 24 Oct 2008 19:29:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9OJT74g097346; Fri, 24 Oct 2008 19:29:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810241929.m9OJT74g097346@svn.freebsd.org> From: Alexander Motin Date: Fri, 24 Oct 2008 19:29: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: r184230 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 19:29:08 -0000 Author: mav Date: Fri Oct 24 19:29:07 2008 New Revision: 184230 URL: http://svn.freebsd.org/changeset/base/184230 Log: Add some special handeling for AD1981HD codec. It has very unusual design with several points unappropriate for the present parser. This patch disables input-to-output analog monitoring but instead fixes recording. Tested by Tobias Grosser on ThinkPad T61p. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Fri Oct 24 18:57:11 2008 (r184229) +++ head/sys/dev/sound/pci/hda/hdac.c Fri Oct 24 19:29:07 2008 (r184230) @@ -4510,6 +4510,24 @@ hdac_vendor_patch_parse(struct hdac_devi ~HDA_QUIRK_EAPDINV; } break; + case HDA_CODEC_AD1981HD: + /* + * This codec has very unusual design with several + * points unappropriate for the present parser. + */ + /* Disable recording from mono playback mix. */ + w = hdac_widget_get(devinfo, 21); + if (w != NULL) + w->connsenable[3] = 0; + /* Disable rear to front mic mixer, use separately. */ + w = hdac_widget_get(devinfo, 31); + if (w != NULL) + w->enable = 0; + /* Disable playback mixer, use direct bypass. */ + w = hdac_widget_get(devinfo, 14); + if (w != NULL) + w->enable = 0; + break; } } From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 19:32:06 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 421761065680; Fri, 24 Oct 2008 19:32:06 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by mx1.freebsd.org (Postfix) with ESMTP id 11D478FC41; Fri, 24 Oct 2008 19:32:06 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 8406B1819EF; Fri, 24 Oct 2008 15:32:05 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Fri, 24 Oct 2008 15:32:05 -0400 X-Sasl-enc: Qo/NhmF1kFwZVHnNRLEMDYJxo9bn+3PkfIMIF5PW0HNR 1224876725 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id E99C2253CA; Fri, 24 Oct 2008 15:32:03 -0400 (EDT) Message-ID: <490222B1.8070205@FreeBSD.org> Date: Fri, 24 Oct 2008 20:32:01 +0100 From: "Bruce M. Simpson" User-Agent: Thunderbird 2.0.0.14 (X11/20080514) MIME-Version: 1.0 To: Marcel Moolenaar References: <200810230216.m9N2Gdxw045106@svn.freebsd.org> <20081023.191014.41711418.imp@bsdimp.com> <49018C68.3020706@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, marcel@FreeBSD.org, Warner Losh , src-committers@FreeBSD.org Subject: Re: svn commit: r184194 - in head/sys: conf mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 19:32:06 -0000 Marcel Moolenaar wrote: > > I have no problem reverting, but the reasons you put forward > don't hold. uart(4) is not enabled by default so there's no > change to the SENTRY5 configuration at all in that respect. OK, most of the uarts I've seen, but not all, on the MIPS boards, are 16C550 style UARTs. All the same it would be desirable not to enable 'options uart_ns8520' in all cases. > Please provide other grounds for reversal. I didn't point this out in my original message, but my concern with the commit as a whole, was more to do with the fact that GEOM_MBR and GEOM_BSD were being enabled by default. For a kernel shipping on a system where there are no UFS filesystems or DOS style partitions, and often a 1MB kernel size limit (which may be compressed) it might be more desirable not to ship those by default. Same re uart_ns8250. thanks, BMS From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 19:36:29 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A5F71065672; Fri, 24 Oct 2008 19:36:29 +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 4199B8FC1B; Fri, 24 Oct 2008 19:36:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9OJaTrl097516; Fri, 24 Oct 2008 19:36:29 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9OJaTQQ097515; Fri, 24 Oct 2008 19:36:29 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810241936.m9OJaTQQ097515@svn.freebsd.org> From: Alexander Motin Date: Fri, 24 Oct 2008 19:36: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: r184231 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 19:36:29 -0000 Author: mav Date: Fri Oct 24 19:36:28 2008 New Revision: 184231 URL: http://svn.freebsd.org/changeset/base/184231 Log: Bump the revision after the latest commits. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Fri Oct 24 19:29:07 2008 (r184230) +++ head/sys/dev/sound/pci/hda/hdac.c Fri Oct 24 19:36:28 2008 (r184231) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20081013_0113" +#define HDA_DRV_TEST_REV "20081024_0114" SND_DECLARE_FILE("$FreeBSD$"); From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 19:51:36 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95B9B1065671; Fri, 24 Oct 2008 19:51:36 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout015.mac.com (asmtpout015.mac.com [17.148.16.90]) by mx1.freebsd.org (Postfix) with ESMTP id 79EE38FC18; Fri, 24 Oct 2008 19:51:36 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp015.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0K9900H8LDTZCY80@asmtp015.mac.com>; Fri, 24 Oct 2008 12:51:36 -0700 (PDT) Message-id: <561E3029-B6E1-4447-8439-D61ECD2BED4B@mac.com> From: Marcel Moolenaar To: "Bruce M. Simpson" In-reply-to: <490222B1.8070205@FreeBSD.org> Date: Fri, 24 Oct 2008 12:51:35 -0700 References: <200810230216.m9N2Gdxw045106@svn.freebsd.org> <20081023.191014.41711418.imp@bsdimp.com> <49018C68.3020706@FreeBSD.org> <490222B1.8070205@FreeBSD.org> X-Mailer: Apple Mail (2.929.2) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, marcel@FreeBSD.org, Warner Losh , src-committers@FreeBSD.org Subject: Re: svn commit: r184194 - in head/sys: conf mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 19:51:36 -0000 On Oct 24, 2008, at 12:32 PM, Bruce M. Simpson wrote: >> Please provide other grounds for reversal. > > I didn't point this out in my original message, but my concern with > the commit as a whole, was more to do with the fact that GEOM_MBR > and GEOM_BSD were being enabled by default. *sigh* They were enabled by default and they were non-optional by virtue of being standard. My change *only* made them optional so that people can opt-out (by using nooption, rather than editing sys/conf/files.mips). I didn't change the status-quo WRT having them compiled-in by default, and to achieve that, I added them to DEFAULTS. -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 19:53:17 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35A251065699; Fri, 24 Oct 2008 19:53:17 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by mx1.freebsd.org (Postfix) with ESMTP id 046448FC17; Fri, 24 Oct 2008 19:53:16 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 63C63181EA2; Fri, 24 Oct 2008 15:53:16 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Fri, 24 Oct 2008 15:53:16 -0400 X-Sasl-enc: QGwt1QQyilc/z0vz4UUMKj+EPb6SomZR4e5aGlEZ4IPX 1224877996 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 60D55156C7; Fri, 24 Oct 2008 15:53:15 -0400 (EDT) Message-ID: <490227A9.2090007@FreeBSD.org> Date: Fri, 24 Oct 2008 20:53:13 +0100 From: "Bruce M. Simpson" User-Agent: Thunderbird 2.0.0.14 (X11/20080514) MIME-Version: 1.0 To: Marcel Moolenaar References: <200810230216.m9N2Gdxw045106@svn.freebsd.org> <20081023.191014.41711418.imp@bsdimp.com> <49018C68.3020706@FreeBSD.org> <490222B1.8070205@FreeBSD.org> <561E3029-B6E1-4447-8439-D61ECD2BED4B@mac.com> In-Reply-To: <561E3029-B6E1-4447-8439-D61ECD2BED4B@mac.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, marcel@FreeBSD.org, Warner Losh , src-committers@FreeBSD.org Subject: Re: svn commit: r184194 - in head/sys: conf mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 19:53:17 -0000 Marcel Moolenaar wrote: > ... > They were enabled by default and they were non-optional by > virtue of being standard. My change *only* made them > optional so that people can opt-out (by using nooption, > rather than editing sys/conf/files.mips). I didn't change > the status-quo WRT having them compiled-in by default, and > to achieve that, I added them to DEFAULTS. Thanks for the explanation, I clearly misunderstood what was going on. thanks BMS From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 21:21:44 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 253591065672; Fri, 24 Oct 2008 21:21: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 140CC8FC08; Fri, 24 Oct 2008 21:21:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9OLLh82099380; Fri, 24 Oct 2008 21:21:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9OLLh6j099379; Fri, 24 Oct 2008 21:21:43 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810242121.m9OLLh6j099379@svn.freebsd.org> From: Alexander Motin Date: Fri, 24 Oct 2008 21:21: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: r184233 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 21:21:44 -0000 Author: mav Date: Fri Oct 24 21:21:43 2008 New Revision: 184233 URL: http://svn.freebsd.org/changeset/base/184233 Log: Add MSI support. Tested on: Acer TravelMate 6292 with 0x4229 chip. Reviewed by: sam@ Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Fri Oct 24 20:10:22 2008 (r184232) +++ head/sys/dev/iwn/if_iwn.c Fri Oct 24 21:21:43 2008 (r184233) @@ -253,7 +253,7 @@ iwn_attach(device_t dev) struct iwn_softc *sc = (struct iwn_softc *)device_get_softc(dev); struct ieee80211com *ic; struct ifnet *ifp; - int i, error; + int i, error, result; sc->sc_dev = dev; @@ -282,6 +282,9 @@ iwn_attach(device_t dev) sc->sc_st = rman_get_bustag(sc->mem); sc->sc_sh = rman_get_bushandle(sc->mem); sc->irq_rid = 0; + if ((result = pci_msi_count(dev)) == 1 && + pci_alloc_msi(dev, &result) == 0) + sc->irq_rid = 1; sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, RF_ACTIVE | RF_SHAREABLE); if (sc->irq == NULL) { @@ -487,6 +490,8 @@ iwn_cleanup(device_t dev) if (sc->irq != NULL) { bus_teardown_intr(dev, sc->irq, sc->sc_ih); bus_release_resource(dev, SYS_RES_IRQ, sc->irq_rid, sc->irq); + if (sc->irq_rid == 1) + pci_release_msi(dev); } if (sc->mem != NULL) bus_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, sc->mem); From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 21:52:50 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6FD81065671; Fri, 24 Oct 2008 21:52:50 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5F1B8FC12; Fri, 24 Oct 2008 21:52:50 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9OLqoJx099945; Fri, 24 Oct 2008 21:52:50 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9OLqoct099944; Fri, 24 Oct 2008 21:52:50 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200810242152.m9OLqoct099944@svn.freebsd.org> From: Nick Hibma Date: Fri, 24 Oct 2008 21:52: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: r184234 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 21:52:51 -0000 Author: n_hibma Date: Fri Oct 24 21:52:50 2008 New Revision: 184234 URL: http://svn.freebsd.org/changeset/base/184234 Log: Make the driver compile on FBSD6 as well. Up the speed on the E220 ID as it is a part which is used in other devices that are capable of HSPA speeds. Modified: head/sys/dev/usb/u3g.c Modified: head/sys/dev/usb/u3g.c ============================================================================== --- head/sys/dev/usb/u3g.c Fri Oct 24 21:21:43 2008 (r184233) +++ head/sys/dev/usb/u3g.c Fri Oct 24 21:52:50 2008 (r184234) @@ -46,7 +46,9 @@ #include +#if __FreeBSD_version >= 800000 #include "opt_u3g.h" +#endif #include "usbdevs.h" //#define U3G_DEBUG @@ -134,7 +136,7 @@ static const struct u3g_dev_type_s u3g_d {{ USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_CDMA_MSM }, U3GSP_CDMA, U3GFL_STUB_WAIT }, /* OEM: Huawei */ {{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_MOBILE }, U3GSP_HSDPA, U3GFL_HUAWEI_INIT }, - {{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E220 }, U3GSP_HSDPA, U3GFL_HUAWEI_INIT }, + {{ USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E220 }, U3GSP_HSPA, U3GFL_HUAWEI_INIT }, /* OEM: Novatel */ {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_CDMA_MODEM }, U3GSP_CDMA, U3GFL_STUB_WAIT }, {{ USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_ES620 }, U3GSP_UMTS, U3GFL_STUB_WAIT }, // XXX @@ -298,7 +300,9 @@ u3g_attach(device_t self) portno, i, ucom->sc_bulkin_no, ucom->sc_bulkout_no); -#if __FreeBSD_version < 800000 +#if __FreeBSD_version < 700000 + ucom_attach_tty(ucom, MINOR_CALLOUT, devnamefmt, portno); +#elif __FreeBSD_version < 800000 ucom_attach_tty(ucom, TS_CALLOUT, devnamefmt, portno); #else ucom_attach_tty(ucom, devnamefmt, portno); From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 22:49:47 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A42261065672; Fri, 24 Oct 2008 22:49:47 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 5FB378FC12; Fri, 24 Oct 2008 22:49:47 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id m9OMle5T003504; Fri, 24 Oct 2008 16:47:40 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 24 Oct 2008 16:47:40 -0600 (MDT) Message-Id: <20081024.164740.74747369.imp@bsdimp.com> To: jhb@freebsd.org From: Warner Losh In-Reply-To: <200810241031.08780.jhb@freebsd.org> References: <868wsewzos.fsf@ds4.des.no> <20081024132703.GA81378@FreeBSD.org> <200810241031.08780.jhb@freebsd.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: danfe@freebsd.org, marcel@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org, des@des.no Subject: Re: svn commit: r184193 - in head/sys: arm/conf conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 22:49:47 -0000 From: John Baldwin Subject: Re: svn commit: r184193 - in head/sys: arm/conf conf Date: Fri, 24 Oct 2008 10:31:07 -0400 > On Friday 24 October 2008 09:27:03 am Alexey Dokuchaev wrote: > > On Fri, Oct 24, 2008 at 03:26:43AM +0200, Dag-Erling Sm??rgrav wrote: > > > Warner Losh writes: > > > > We already have a better mechanism for including config files. We > > > > should be using that instead of poluting another port with the > > > > DEFAULTS file. > > > > > > Should we even have DEFAULTS files at all? IMHO they just confuse > > > matters by introducing "stealth" options into your config. > > > > I tend to second this. I always try to get everything possible out of > > my kernel to modules, and thus was surprised to see io.ko and mem.ko > > fail to load because they were silently included into my custom kernel. > > > > I understand that some things like 'device isa' and > > 'device npx' aren't really optional, but if something is useful to have, > > but can be loaded as a module, it belongs to GENERIC rather than > > DEFAULTS. Killing the latter altogether and throwing a comment that > > says particular option or device is mandatory in GENERIC is probably > > even better (and more transparent). > > The one thing I think DEFAULTS is useful for are replacing NO_FOO options with > FOO options. That is, if someone wants to turn a feature on by default, I'd > rather them put 'options FOO' in DEFAULTS rather than rename all the > #ifdef's,e tc. to '#ifndef NO_FOO'. Wouldn't it be better to move to a system where we explicitly include std.i386 and have them all defined there? We already encourage stuff like this with advice to include GENERIC with nodev... Warner From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 22:53:05 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 198631065673; Fri, 24 Oct 2008 22:53:05 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id CB8848FC0A; Fri, 24 Oct 2008 22:53:04 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id m9OMpo0o003551; Fri, 24 Oct 2008 16:51:50 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 24 Oct 2008 16:51:50 -0600 (MDT) Message-Id: <20081024.165150.71091594.imp@bsdimp.com> To: xcllnt@mac.com From: Warner Losh In-Reply-To: <37EC82F7-ECD8-4470-8406-084D7F839664@mac.com> References: <20081023.190942.74668946.imp@bsdimp.com> <4901F173.2070701@freebsd.org> <37EC82F7-ECD8-4470-8406-084D7F839664@mac.com> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: marcel@FreeBSD.org, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, sam@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184193 - in head/sys: arm/conf conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 22:53:05 -0000 From: Marcel Moolenaar Subject: Re: svn commit: r184193 - in head/sys: arm/conf conf Date: Fri, 24 Oct 2008 09:09:18 -0700 > > On Oct 24, 2008, at 9:01 AM, Sam Leffler wrote: > > >> We already have a better mechanism for including config files. We > >> should be using that instead of poluting another port with the > >> DEFAULTS file. > >> > > More importantly this change forces GEOM_BSD and GEOM_MBR on every > > target platform. > > geom_bsd and geom_mbr were defined standard in file.arm > before. There's no change in behaviour other than that > people can now opt-out. > > > This is just wrong and clearly Marvel never discussed it with > > anyone working on arm systems or he'd have gotten an earful. > > Get your facts straight. Did you talk to people first? No. Facts seem to be right here. Please, stop being stubborn and back this or, or we'll do it for you and put you on the defensive... This isn't a good way to operate. Warner From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 22:53:06 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C70C4106566C; Fri, 24 Oct 2008 22:53:06 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 837A28FC08; Fri, 24 Oct 2008 22:53:06 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id m9OMoZtp003546; Fri, 24 Oct 2008 16:50:36 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 24 Oct 2008 16:50:35 -0600 (MDT) Message-Id: <20081024.165035.41635952.imp@bsdimp.com> To: xcllnt@mac.com From: Warner Losh In-Reply-To: References: <20081023.191014.41711418.imp@bsdimp.com> <49018C68.3020706@FreeBSD.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, marcel@FreeBSD.org, bms@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184194 - in head/sys: conf mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 22:53:06 -0000 From: Marcel Moolenaar Subject: Re: svn commit: r184194 - in head/sys: conf mips/conf Date: Fri, 24 Oct 2008 09:04:32 -0700 > > On Oct 24, 2008, at 1:50 AM, Bruce M. Simpson wrote: > > > Warner Losh wrote: > >>> Add mips/conf/DEFAULTS and populate it with: > >>> machine arm > >>> device mem > >>> device uart_ns8250 > >>> options GEOM_BSD > >>> options GEOM_MBR > >>> Remove the first three from all kernel configuration files > >>> (sometimes commented-out) and change geom_bsd and geom_mbr > >>> from standard to optional. > >>> > >> > >> We shouldn't be using DEFAULTS for this. > >> > > > > I agree. Marcel, can you please back this change out (at least the > > mips or SENTRY5 part of it) ? > > > > uart support isn't ready on SENTRY5; shipping these drivers in a > > default configuration just adds dead wood on a platform where kernel > > size is critical. > > I have no problem reverting, but the reasons you put forward > don't hold. uart(4) is not enabled by default so there's no > change to the SENTRY5 configuration at all in that respect. > Please provide other grounds for reversal. (1) You didn't ask us first. (2) Others have said this is a bad idea. (3) There's appears to be a conensus that we should move the other way from what you are doing. Warner From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 22:58:25 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 140A41065670; Fri, 24 Oct 2008 22:58:25 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id C6B668FC18; Fri, 24 Oct 2008 22:58:24 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id m9OMut9o003675; Fri, 24 Oct 2008 16:56:55 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 24 Oct 2008 16:56:55 -0600 (MDT) Message-Id: <20081024.165655.104036719.imp@bsdimp.com> To: bms@FreeBSD.org From: Warner Losh In-Reply-To: <490227A9.2090007@FreeBSD.org> References: <490222B1.8070205@FreeBSD.org> <561E3029-B6E1-4447-8439-D61ECD2BED4B@mac.com> <490227A9.2090007@FreeBSD.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: marcel@FreeBSD.org, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, xcllnt@mac.com, src-committers@FreeBSD.org Subject: Re: svn commit: r184194 - in head/sys: conf mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 22:58:25 -0000 From: "Bruce M. Simpson" Subject: Re: svn commit: r184194 - in head/sys: conf mips/conf Date: Fri, 24 Oct 2008 20:53:13 +0100 > Marcel Moolenaar wrote: > > ... > > They were enabled by default and they were non-optional by > > virtue of being standard. My change *only* made them > > optional so that people can opt-out (by using nooption, > > rather than editing sys/conf/files.mips). I didn't change > > the status-quo WRT having them compiled-in by default, and > > to achieve that, I added them to DEFAULTS. > > Thanks for the explanation, I clearly misunderstood what was going on. My conern was that this was the wrong mechanism, it wasn't discssed and lots of folks dislike it. Warner From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 23:04:52 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5844F1065674; Fri, 24 Oct 2008 23:04:52 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout013.mac.com (asmtpout013.mac.com [17.148.16.88]) by mx1.freebsd.org (Postfix) with ESMTP id 3DCC98FC1A; Fri, 24 Oct 2008 23:04:52 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp013.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0K990086AMRWYE00@asmtp013.mac.com>; Fri, 24 Oct 2008 16:04:45 -0700 (PDT) Message-id: From: Marcel Moolenaar To: Warner Losh In-reply-to: <20081024.165035.41635952.imp@bsdimp.com> Date: Fri, 24 Oct 2008 16:04:44 -0700 References: <20081023.191014.41711418.imp@bsdimp.com> <49018C68.3020706@FreeBSD.org> <20081024.165035.41635952.imp@bsdimp.com> X-Mailer: Apple Mail (2.929.2) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, marcel@FreeBSD.org, bms@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184194 - in head/sys: conf mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2008 23:04:52 -0000 On Oct 24, 2008, at 3:50 PM, Warner Losh wrote: >> Please provide other grounds for reversal. > > (1) You didn't ask us first. This is no grounds for reversal. > (2) Others have said this is a bad idea. People were confused about the change. > (3) There's appears to be a conensus that we should move the other way > from what you are doing. Ok, this I buy. If people agree, we can discuss the scope and impact of the new route. If it's not too big a job I'll do the back-out by implementing it or otherwise I'll just back out this change and forget about it. Does that sound like a plan? -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 02:36:09 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4ED9E1065675; Sat, 25 Oct 2008 02:36:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B4188FC1A; Sat, 25 Oct 2008 02:36:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9P2a9qY005250; Sat, 25 Oct 2008 02:36:09 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9P2a8CJ005248; Sat, 25 Oct 2008 02:36:08 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200810250236.m9P2a8CJ005248@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 25 Oct 2008 02:36:08 +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: r184240 - head/sys/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 02:36:09 -0000 Author: yongari Date: Sat Oct 25 02:36:08 2008 New Revision: 184240 URL: http://svn.freebsd.org/changeset/base/184240 Log: Various bus_dma(9) fixes. - The hardware does not support DAC so limit DMA address space to 4GB. - Removed BUS_DMA_ALLOC_NOW flag. - Created separated Tx buffer and Rx buffer DMA tags. Previously it used to single DMA tag and it was not possible to specify different DMA restrictions. - Apply 4 bytes alignment limitation of Tx buffer. - Apply 8 bytes alignment limitation of Rx buffer. - Tx side bus_dmamap_load_mbuf_sg(9) support. - Preallocate Tx DMA maps as creating DMA maps take very long time on architectures that require real DMA maps. - Adjust guard buffer size to 1522 + 8 as it should include VLAN and additional reserved bytes in Rx buffer. - Plug memory leak in device detach. Previously wrong buffer address was used to free allocated memory. - Added rl_list_rx_init() to clear Rx buffer and cleared the buffer. - Don't destroy DMA maps in rl_txeof() as the DMA map should be reused. There is no reason to destroy/recreate the DMA maps in this driver. - Removed rl_dma_map_rxbuf()/rl_dma_map_txbuf() callbacks. - The hardware does not support descriptor based DMA on Tx side and the Tx buffer address should be aligned on 4 bytes boundary as well as manual padding for short frames. Because of this hardware limitation rl(4) always used to invoke m_defrag(9) to get a 4 bytes aligned single buffer. However m_defrag(9) takes a lot of CPU cycles on slow machines and not all packets need the help of m_defrag(9). Armed with the information, don't invoke m_defrag(9) if the following conditions are true. 1. Buffer is not fragmented. 2. Buffer is aligned on 4 bytes boundary. 3. Manual padding is not necessary. 4. Or padding is necessary but upper stack passed a writable buffer and the space needed for padding is satisfied. This change combined with preallocated DMA maps greatly increased Tx performance of driver on sparc64. - Moved bus_dmamap_sync(9) in rl_start_locked() to rl_encap() and corrected memory synchronization operation specifier of bus_dmamap_sync(9). - Removed bus_dmamap_unload(9) in rl_stop(). There is no need to reload/unload Rx buffer as rl(4) always have to copy from the buffer. It just needs proper bus_dmamap_sync(9) calls before copying the received frame. With this change rl(4) should work on systems with more than 4GB memory. PR: kern/128143 Modified: head/sys/pci/if_rl.c head/sys/pci/if_rlreg.h Modified: head/sys/pci/if_rl.c ============================================================================== --- head/sys/pci/if_rl.c Sat Oct 25 01:46:29 2008 (r184239) +++ head/sys/pci/if_rl.c Sat Oct 25 02:36:08 2008 (r184240) @@ -182,12 +182,14 @@ static struct rl_type rl_devs[] = { static int rl_attach(device_t); static int rl_detach(device_t); -static void rl_dma_map_rxbuf(void *, bus_dma_segment_t *, int, int); -static void rl_dma_map_txbuf(void *, bus_dma_segment_t *, int, int); +static void rl_dmamap_cb(void *, bus_dma_segment_t *, int, int); +static int rl_dma_alloc(struct rl_softc *); +static void rl_dma_free(struct rl_softc *); static void rl_eeprom_putbyte(struct rl_softc *, int); static void rl_eeprom_getword(struct rl_softc *, int, uint16_t *); -static int rl_encap(struct rl_softc *, struct mbuf * ); +static int rl_encap(struct rl_softc *, struct mbuf **); static int rl_list_tx_init(struct rl_softc *); +static int rl_list_rx_init(struct rl_softc *); static int rl_ifmedia_upd(struct ifnet *); static void rl_ifmedia_sts(struct ifnet *, struct ifmediareq *); static int rl_ioctl(struct ifnet *, u_long, caddr_t); @@ -269,22 +271,6 @@ DRIVER_MODULE(miibus, rl, miibus_driver, CSR_WRITE_1(sc, RL_EECMD, \ CSR_READ_1(sc, RL_EECMD) & ~x) -static void -rl_dma_map_rxbuf(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - struct rl_softc *sc = arg; - - CSR_WRITE_4(sc, RL_RXADDR, segs->ds_addr & 0xFFFFFFFF); -} - -static void -rl_dma_map_txbuf(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - struct rl_softc *sc = arg; - - CSR_WRITE_4(sc, RL_CUR_TXADDR(sc), segs->ds_addr & 0xFFFFFFFF); -} - /* * Send a read command and address to the EEPROM, check for ACK. */ @@ -756,6 +742,24 @@ rl_probe(device_t dev) return (ENXIO); } +struct rl_dmamap_arg { + bus_addr_t rl_busaddr; +}; + +static void +rl_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct rl_dmamap_arg *ctx; + + if (error != 0) + return; + + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + ctx = (struct rl_dmamap_arg *)arg; + ctx->rl_busaddr = segs[0].ds_addr; +} + /* * Attach the interface. Allocate softc structures, do ifmedia * setup and ethernet/BPF attach. @@ -862,59 +866,9 @@ rl_attach(device_t dev) goto fail; } - /* - * Allocate the parent bus DMA tag appropriate for PCI. - */ -#define RL_NSEG_NEW 32 - error = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - MAXBSIZE, RL_NSEG_NEW, /* maxsize, nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ - BUS_DMA_ALLOCNOW, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->rl_parent_tag); - if (error) + if ((error = rl_dma_alloc(sc)) != 0) goto fail; - /* - * Now allocate a tag for the DMA descriptor lists. - * All of our lists are allocated as a contiguous block - * of memory. - */ - error = bus_dma_tag_create(sc->rl_parent_tag, /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - RL_RXBUFLEN + 1518, 1, /* maxsize,nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ - BUS_DMA_ALLOCNOW, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->rl_tag); - if (error) - goto fail; - - /* - * Now allocate a chunk of DMA-able memory based on the - * tag we just created. - */ - error = bus_dmamem_alloc(sc->rl_tag, - (void **)&sc->rl_cdata.rl_rx_buf, BUS_DMA_NOWAIT | BUS_DMA_ZERO, - &sc->rl_cdata.rl_rx_dmamap); - if (error) { - device_printf(dev, "no memory for list buffers!\n"); - bus_dma_tag_destroy(sc->rl_tag); - sc->rl_tag = NULL; - goto fail; - } - - /* Leave a few bytes before the start of the RX ring buffer. */ - sc->rl_cdata.rl_rx_buf_ptr = sc->rl_cdata.rl_rx_buf; - sc->rl_cdata.rl_rx_buf += sizeof(uint64_t); - ifp = sc->rl_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { device_printf(dev, "can not if_alloc()\n"); @@ -1013,20 +967,155 @@ rl_detach(device_t dev) if (ifp) if_free(ifp); - if (sc->rl_tag) { - bus_dmamap_unload(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap); - bus_dmamem_free(sc->rl_tag, sc->rl_cdata.rl_rx_buf, - sc->rl_cdata.rl_rx_dmamap); - bus_dma_tag_destroy(sc->rl_tag); - } - if (sc->rl_parent_tag) - bus_dma_tag_destroy(sc->rl_parent_tag); + rl_dma_free(sc); mtx_destroy(&sc->rl_mtx); return (0); } +static int +rl_dma_alloc(struct rl_softc *sc) +{ + struct rl_dmamap_arg ctx; + int error, i; + + /* + * Allocate the parent bus DMA tag appropriate for PCI. + */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->rl_dev), /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE_32BIT, 0, /* maxsize, nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->rl_parent_tag); + if (error) { + device_printf(sc->rl_dev, + "failed to create parent DMA tag.\n"); + goto fail; + } + /* Create DMA tag for Rx memory block. */ + error = bus_dma_tag_create(sc->rl_parent_tag, /* parent */ + RL_RX_8139_BUF_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + RL_RXBUFLEN + RL_RX_8139_BUF_GUARD_SZ, 1, /* maxsize,nsegments */ + RL_RXBUFLEN + RL_RX_8139_BUF_GUARD_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->rl_cdata.rl_rx_tag); + if (error) { + device_printf(sc->rl_dev, + "failed to create Rx memory block DMA tag.\n"); + goto fail; + } + /* Create DMA tag for Tx buffer. */ + error = bus_dma_tag_create(sc->rl_parent_tag, /* parent */ + RL_TX_8139_BUF_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES, 1, /* maxsize, nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->rl_cdata.rl_tx_tag); + if (error) { + device_printf(sc->rl_dev, "failed to create Tx DMA tag.\n"); + goto fail; + } + + /* + * Allocate DMA'able memory and load DMA map for Rx memory block. + */ + error = bus_dmamem_alloc(sc->rl_cdata.rl_rx_tag, + (void **)&sc->rl_cdata.rl_rx_buf, BUS_DMA_WAITOK | + BUS_DMA_COHERENT | BUS_DMA_ZERO, &sc->rl_cdata.rl_rx_dmamap); + if (error != 0) { + device_printf(sc->rl_dev, + "failed to allocate Rx DMA memory block.\n"); + goto fail; + } + ctx.rl_busaddr = 0; + error = bus_dmamap_load(sc->rl_cdata.rl_rx_tag, + sc->rl_cdata.rl_rx_dmamap, sc->rl_cdata.rl_rx_buf, + RL_RXBUFLEN + RL_RX_8139_BUF_GUARD_SZ, rl_dmamap_cb, &ctx, + BUS_DMA_NOWAIT); + if (error != 0 || ctx.rl_busaddr == 0) { + device_printf(sc->rl_dev, + "could not load Rx DMA memory block.\n"); + goto fail; + } + sc->rl_cdata.rl_rx_buf_paddr = ctx.rl_busaddr; + + /* Create DMA maps for Tx buffers. */ + for (i = 0; i < RL_TX_LIST_CNT; i++) { + sc->rl_cdata.rl_tx_chain[i] = NULL; + sc->rl_cdata.rl_tx_dmamap[i] = NULL; + error = bus_dmamap_create(sc->rl_cdata.rl_tx_tag, 0, + &sc->rl_cdata.rl_tx_dmamap[i]); + if (error != 0) { + device_printf(sc->rl_dev, + "could not create Tx dmamap.\n"); + goto fail; + } + } + + /* Leave a few bytes before the start of the RX ring buffer. */ + sc->rl_cdata.rl_rx_buf_ptr = sc->rl_cdata.rl_rx_buf; + sc->rl_cdata.rl_rx_buf += RL_RX_8139_BUF_RESERVE; + +fail: + return (error); +} + +static void +rl_dma_free(struct rl_softc *sc) +{ + int i; + + /* Rx memory block. */ + if (sc->rl_cdata.rl_rx_tag != NULL) { + if (sc->rl_cdata.rl_rx_dmamap != NULL) + bus_dmamap_unload(sc->rl_cdata.rl_rx_tag, + sc->rl_cdata.rl_rx_dmamap); + if (sc->rl_cdata.rl_rx_dmamap != NULL && + sc->rl_cdata.rl_rx_buf_ptr != NULL) + bus_dmamem_free(sc->rl_cdata.rl_rx_tag, + sc->rl_cdata.rl_rx_buf_ptr, + sc->rl_cdata.rl_rx_dmamap); + sc->rl_cdata.rl_rx_buf_ptr = NULL; + sc->rl_cdata.rl_rx_buf = NULL; + sc->rl_cdata.rl_rx_dmamap = NULL; + bus_dma_tag_destroy(sc->rl_cdata.rl_rx_tag); + sc->rl_cdata.rl_tx_tag = NULL; + } + + /* Tx buffers. */ + if (sc->rl_cdata.rl_tx_tag != NULL) { + for (i = 0; i < RL_TX_LIST_CNT; i++) { + if (sc->rl_cdata.rl_tx_dmamap[i] != NULL) { + bus_dmamap_destroy( + sc->rl_cdata.rl_tx_tag, + sc->rl_cdata.rl_tx_dmamap[i]); + sc->rl_cdata.rl_tx_dmamap[i] = NULL; + } + bus_dma_tag_destroy(sc->rl_cdata.rl_tx_tag); + sc->rl_cdata.rl_tx_tag = NULL; + } + } + + if (sc->rl_parent_tag != NULL) { + bus_dma_tag_destroy(sc->rl_parent_tag); + sc->rl_parent_tag = NULL; + } +} + /* * Initialize the transmit descriptors. */ @@ -1051,6 +1140,20 @@ rl_list_tx_init(struct rl_softc *sc) return (0); } +static int +rl_list_rx_init(struct rl_softc *sc) +{ + + RL_LOCK_ASSERT(sc); + + bzero(sc->rl_cdata.rl_rx_buf_ptr, + RL_RXBUFLEN + RL_RX_8139_BUF_GUARD_SZ); + bus_dmamap_sync(sc->rl_cdata.rl_tx_tag, sc->rl_cdata.rl_rx_dmamap, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + + return (0); +} + /* * A frame has been uploaded: pass the resulting mbuf chain up to * the higher level protocols. @@ -1087,8 +1190,8 @@ rl_rxeof(struct rl_softc *sc) RL_LOCK_ASSERT(sc); - bus_dmamap_sync(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap, - BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(sc->rl_cdata.rl_rx_tag, sc->rl_cdata.rl_rx_dmamap, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); cur_rx = (CSR_READ_2(sc, RL_CURRXADDR) + 16) % RL_RXBUFLEN; @@ -1186,6 +1289,8 @@ rl_rxeof(struct rl_softc *sc) (*ifp->if_input)(ifp, m); RL_LOCK(sc); } + + /* No need to sync Rx memory block as we didn't mofify it. */ } /* @@ -1214,8 +1319,9 @@ rl_txeof(struct rl_softc *sc) ifp->if_collisions += (txstat & RL_TXSTAT_COLLCNT) >> 24; - bus_dmamap_unload(sc->rl_tag, RL_LAST_DMAMAP(sc)); - bus_dmamap_destroy(sc->rl_tag, RL_LAST_DMAMAP(sc)); + bus_dmamap_sync(sc->rl_cdata.rl_tx_tag, RL_LAST_DMAMAP(sc), + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->rl_cdata.rl_tx_tag, RL_LAST_DMAMAP(sc)); m_freem(RL_LAST_TXMBUF(sc)); RL_LAST_TXMBUF(sc) = NULL; /* @@ -1363,41 +1469,64 @@ done_locked: * pointers to the fragment pointers. */ static int -rl_encap(struct rl_softc *sc, struct mbuf *m_head) +rl_encap(struct rl_softc *sc, struct mbuf **m_head) { - struct mbuf *m_new = NULL; + struct mbuf *m; + bus_dma_segment_t txsegs[1]; + int error, nsegs, padlen; RL_LOCK_ASSERT(sc); + m = *m_head; + padlen = 0; + /* + * Hardware doesn't auto-pad, so we have to make sure + * pad short frames out to the minimum frame length. + */ + if (m->m_pkthdr.len < RL_MIN_FRAMELEN) + padlen = RL_MIN_FRAMELEN - m->m_pkthdr.len; /* * The RealTek is brain damaged and wants longword-aligned * TX buffers, plus we can only have one fragment buffer * per packet. We have to copy pretty much all the time. */ - m_new = m_defrag(m_head, M_DONTWAIT); - - if (m_new == NULL) { - m_freem(m_head); - return (1); + if (m->m_next != NULL || (mtod(m, uintptr_t) & 3) != 0 || + (padlen > 0 && M_TRAILINGSPACE(m) < padlen)) { + m = m_defrag(*m_head, M_DONTWAIT); + if (m == NULL) { + m_freem(*m_head); + *m_head = NULL; + return (ENOMEM); + } } - m_head = m_new; + *m_head = m; - /* Pad frames to at least 60 bytes. */ - if (m_head->m_pkthdr.len < RL_MIN_FRAMELEN) { + if (padlen > 0) { /* * Make security concious people happy: zero out the * bytes in the pad area, since we don't know what * this mbuf cluster buffer's previous user might * have left in it. */ - bzero(mtod(m_head, char *) + m_head->m_pkthdr.len, - RL_MIN_FRAMELEN - m_head->m_pkthdr.len); - m_head->m_pkthdr.len += - (RL_MIN_FRAMELEN - m_head->m_pkthdr.len); - m_head->m_len = m_head->m_pkthdr.len; + bzero(mtod(m, char *) + m->m_pkthdr.len, padlen); + m->m_pkthdr.len += padlen; + m->m_len = m->m_pkthdr.len; + } + + error = bus_dmamap_load_mbuf_sg(sc->rl_cdata.rl_tx_tag, + RL_CUR_DMAMAP(sc), m, txsegs, &nsegs, 0); + if (error != 0) + return (error); + if (nsegs == 0) { + m_freem(*m_head); + *m_head = NULL; + return (EIO); } - RL_CUR_TXMBUF(sc) = m_head; + RL_CUR_TXMBUF(sc) = m; + bus_dmamap_sync(sc->rl_cdata.rl_tx_tag, RL_CUR_DMAMAP(sc), + BUS_DMASYNC_PREWRITE); + CSR_WRITE_4(sc, RL_CUR_TXADDR(sc), RL_ADDR_LO(txsegs[0].ds_addr)); return (0); } @@ -1430,19 +1559,18 @@ rl_start_locked(struct ifnet *ifp) if (m_head == NULL) break; - if (rl_encap(sc, m_head)) + if (rl_encap(sc, &m_head)) { + if (m_head == NULL) + break; + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; + } /* Pass a copy of this mbuf chain to the bpf subsystem. */ BPF_MTAP(ifp, RL_CUR_TXMBUF(sc)); /* Transmit the frame. */ - bus_dmamap_create(sc->rl_tag, 0, &RL_CUR_DMAMAP(sc)); - bus_dmamap_load(sc->rl_tag, RL_CUR_DMAMAP(sc), - mtod(RL_CUR_TXMBUF(sc), void *), - RL_CUR_TXMBUF(sc)->m_pkthdr.len, rl_dma_map_txbuf, sc, 0); - bus_dmamap_sync(sc->rl_tag, RL_CUR_DMAMAP(sc), - BUS_DMASYNC_PREREAD); CSR_WRITE_4(sc, RL_CUR_TXSTAT(sc), RL_TXTHRESH(sc->rl_txthresh) | RL_CUR_TXMBUF(sc)->m_pkthdr.len); @@ -1501,14 +1629,13 @@ rl_init_locked(struct rl_softc *sc) CSR_WRITE_STREAM_4(sc, RL_IDR4, eaddr[1]); CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF); - /* Init the RX buffer pointer register. */ - bus_dmamap_load(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap, - sc->rl_cdata.rl_rx_buf, RL_RXBUFLEN, rl_dma_map_rxbuf, sc, 0); - bus_dmamap_sync(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap, - BUS_DMASYNC_PREWRITE); - + /* Init the RX memory block pointer register. */ + CSR_WRITE_4(sc, RL_RXADDR, sc->rl_cdata.rl_rx_buf_paddr + + RL_RX_8139_BUF_RESERVE); /* Init TX descriptors. */ rl_list_tx_init(sc); + /* Init Rx memory block. */ + rl_list_rx_init(sc); /* * Enable transmit and receive. @@ -1712,19 +1839,21 @@ rl_stop(struct rl_softc *sc) CSR_WRITE_1(sc, RL_COMMAND, 0x00); CSR_WRITE_2(sc, RL_IMR, 0x0000); - bus_dmamap_unload(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap); /* * Free the TX list buffers. */ for (i = 0; i < RL_TX_LIST_CNT; i++) { if (sc->rl_cdata.rl_tx_chain[i] != NULL) { - bus_dmamap_unload(sc->rl_tag, - sc->rl_cdata.rl_tx_dmamap[i]); - bus_dmamap_destroy(sc->rl_tag, - sc->rl_cdata.rl_tx_dmamap[i]); - m_freem(sc->rl_cdata.rl_tx_chain[i]); - sc->rl_cdata.rl_tx_chain[i] = NULL; + if (sc->rl_cdata.rl_tx_chain[i] != NULL) { + bus_dmamap_sync(sc->rl_cdata.rl_tx_tag, + sc->rl_cdata.rl_tx_dmamap[i], + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->rl_cdata.rl_tx_tag, + sc->rl_cdata.rl_tx_dmamap[i]); + m_freem(sc->rl_cdata.rl_tx_chain[i]); + sc->rl_cdata.rl_tx_chain[i] = NULL; + } CSR_WRITE_4(sc, RL_TXADDR0 + (i * sizeof(uint32_t)), 0x0000000); } Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Sat Oct 25 01:46:29 2008 (r184239) +++ head/sys/pci/if_rlreg.h Sat Oct 25 02:36:08 2008 (r184240) @@ -501,6 +501,11 @@ #define RL_RXBUFLEN (1 << ((RL_RX_BUF_SZ >> 11) + 13)) #define RL_TX_LIST_CNT 4 #define RL_MIN_FRAMELEN 60 +#define RL_TX_8139_BUF_ALIGN 4 +#define RL_RX_8139_BUF_ALIGN 8 +#define RL_RX_8139_BUF_RESERVE sizeof(int64_t) +#define RL_RX_8139_BUF_GUARD_SZ \ + (ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN + RL_RX_8139_BUF_RESERVE) #define RL_TXTHRESH(x) ((x) << 11) #define RL_TX_THRESH_INIT 96 #define RL_RX_FIFOTHRESH RL_RXFIFO_NOTHRESH @@ -522,10 +527,13 @@ struct rl_chain_data { uint16_t cur_rx; uint8_t *rl_rx_buf; uint8_t *rl_rx_buf_ptr; - bus_dmamap_t rl_rx_dmamap; struct mbuf *rl_tx_chain[RL_TX_LIST_CNT]; bus_dmamap_t rl_tx_dmamap[RL_TX_LIST_CNT]; + bus_dma_tag_t rl_tx_tag; + bus_dma_tag_t rl_rx_tag; + bus_dmamap_t rl_rx_dmamap; + bus_addr_t rl_rx_buf_paddr; uint8_t last_tx; uint8_t cur_tx; }; @@ -813,7 +821,6 @@ struct rl_softc { void *rl_intrhand[RL_MSI_MESSAGES]; device_t rl_miibus; bus_dma_tag_t rl_parent_tag; - bus_dma_tag_t rl_tag; uint8_t rl_type; int rl_eecmd_read; int rl_eewidth; From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 02:41:11 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 625D81065676; Sat, 25 Oct 2008 02:41:11 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 509738FC19; Sat, 25 Oct 2008 02:41:11 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9P2fBoJ005366; Sat, 25 Oct 2008 02:41:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9P2fBUH005365; Sat, 25 Oct 2008 02:41:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200810250241.m9P2fBUH005365@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 25 Oct 2008 02:41: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: r184241 - head/sys/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 02:41:11 -0000 Author: yongari Date: Sat Oct 25 02:41:11 2008 New Revision: 184241 URL: http://svn.freebsd.org/changeset/base/184241 Log: Don't rearm watchdog timer in rl_txeof(). The watchdog timer was already set in rl_start_locked(). Touching the watchdog timer in other places will hide the root cause of watchdog timeouts. Modified: head/sys/pci/if_rl.c Modified: head/sys/pci/if_rl.c ============================================================================== --- head/sys/pci/if_rl.c Sat Oct 25 02:36:08 2008 (r184240) +++ head/sys/pci/if_rl.c Sat Oct 25 02:41:11 2008 (r184241) @@ -1354,8 +1354,6 @@ rl_txeof(struct rl_softc *sc) if (RL_LAST_TXMBUF(sc) == NULL) sc->rl_watchdog_timer = 0; - else if (sc->rl_watchdog_timer == 0) - sc->rl_watchdog_timer = 5; } static void From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 02:52:07 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 576B21065676; Sat, 25 Oct 2008 02:52:07 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4586F8FC17; Sat, 25 Oct 2008 02:52:07 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9P2q66Q005703; Sat, 25 Oct 2008 02:52:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9P2q6b5005702; Sat, 25 Oct 2008 02:52:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200810250252.m9P2q6b5005702@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 25 Oct 2008 02:52: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: r184242 - head/sys/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 02:52:07 -0000 Author: yongari Date: Sat Oct 25 02:52:06 2008 New Revision: 184242 URL: http://svn.freebsd.org/changeset/base/184242 Log: Make rl_init_locked() call rl_reset. This will put hardware into sane state after resume/watchdog timeouts. Modified: head/sys/pci/if_rl.c Modified: head/sys/pci/if_rl.c ============================================================================== --- head/sys/pci/if_rl.c Sat Oct 25 02:41:11 2008 (r184241) +++ head/sys/pci/if_rl.c Sat Oct 25 02:52:06 2008 (r184242) @@ -1342,7 +1342,6 @@ rl_txeof(struct rl_softc *sc) CSR_WRITE_4(sc, RL_TXCFG, RL_TXCFG_CONFIG); oldthresh = sc->rl_txthresh; /* error recovery */ - rl_reset(sc); rl_init_locked(sc); /* restore original threshold */ sc->rl_txthresh = oldthresh; @@ -1409,10 +1408,8 @@ rl_poll_locked(struct ifnet *ifp, enum p /* XXX We should check behaviour on receiver stalls. */ - if (status & RL_ISR_SYSTEM_ERR) { - rl_reset(sc); + if (status & RL_ISR_SYSTEM_ERR) rl_init_locked(sc); - } } } #endif /* DEVICE_POLLING */ @@ -1449,10 +1446,8 @@ rl_intr(void *arg) rl_rxeof(sc); if ((status & RL_ISR_TX_OK) || (status & RL_ISR_TX_ERR)) rl_txeof(sc); - if (status & RL_ISR_SYSTEM_ERR) { - rl_reset(sc); + if (status & RL_ISR_SYSTEM_ERR) rl_init_locked(sc); - } } if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -1615,6 +1610,8 @@ rl_init_locked(struct rl_softc *sc) */ rl_stop(sc); + rl_reset(sc); + /* * Init our MAC address. Even though the chipset * documentation doesn't mention it, we need to enter "Config From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 03:06:48 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F49F106566B; Sat, 25 Oct 2008 03:06:48 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1AC18FC1D; Sat, 25 Oct 2008 03:06:47 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9P36lDl008771; Sat, 25 Oct 2008 03:06:47 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9P36l58008770; Sat, 25 Oct 2008 03:06:47 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200810250306.m9P36l58008770@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 25 Oct 2008 03:06:47 +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: r184243 - head/sys/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 03:06:48 -0000 Author: yongari Date: Sat Oct 25 03:06:47 2008 New Revision: 184243 URL: http://svn.freebsd.org/changeset/base/184243 Log: After sending stop command to MAC, give hardware chance to drain active DMA operation. Modified: head/sys/pci/if_rl.c Modified: head/sys/pci/if_rl.c ============================================================================== --- head/sys/pci/if_rl.c Sat Oct 25 02:52:06 2008 (r184242) +++ head/sys/pci/if_rl.c Sat Oct 25 03:06:47 2008 (r184243) @@ -1834,6 +1834,14 @@ rl_stop(struct rl_softc *sc) CSR_WRITE_1(sc, RL_COMMAND, 0x00); CSR_WRITE_2(sc, RL_IMR, 0x0000); + for (i = 0; i < RL_TIMEOUT; i++) { + DELAY(10); + if ((CSR_READ_1(sc, RL_COMMAND) & + (RL_CMD_RX_ENB | RL_CMD_TX_ENB)) == 0) + break; + } + if (i == RL_TIMEOUT) + device_printf(sc->rl_dev, "Unable to stop Tx/Rx MAC\n"); /* * Free the TX list buffers. From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 03:36:22 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62B4D106566C; Sat, 25 Oct 2008 03:36:22 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50C508FC0C; Sat, 25 Oct 2008 03:36:22 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9P3aMpx014392; Sat, 25 Oct 2008 03:36:22 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9P3aLPE014391; Sat, 25 Oct 2008 03:36:22 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200810250336.m9P3aLPE014391@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 25 Oct 2008 03:36: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: r184244 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 03:36:22 -0000 Author: marcel Date: Sat Oct 25 03:36:21 2008 New Revision: 184244 URL: http://svn.freebsd.org/changeset/base/184244 Log: In mmu_booke_mapdev(), handle mappings that cannot be represented by a single TLB entry. The boot ROM on the MPC85555CDS is 8MB, for example, and in order to map that we need 2 4MB TLB entries. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Oct 25 03:06:47 2008 (r184243) +++ head/sys/powerpc/booke/pmap.c Sat Oct 25 03:36:21 2008 (r184244) @@ -2296,14 +2296,25 @@ mmu_booke_dev_direct_mapped(mmu_t mmu, v static void * mmu_booke_mapdev(mmu_t mmu, vm_offset_t pa, vm_size_t size) { + void *res; uintptr_t va; + vm_size_t sz; va = (pa >= 0x80000000) ? pa : (0xe2000000 + pa); - if (bootverbose) - printf("Wiring VA=%x to PA=%x (size=%x), using TLB1[%d]\n", - va, pa, size, tlb1_idx); - tlb1_set_entry(va, pa, size, _TLB_ENTRY_IO); - return ((void *)va); + res = (void *)va; + + do { + sz = 1 << (ilog2(size) & ~1); + if (bootverbose) + printf("Wiring VA=%x to PA=%x (size=%x), " + "using TLB1[%d]\n", va, pa, sz, tlb1_idx); + tlb1_set_entry(va, pa, sz, _TLB_ENTRY_IO); + size -= sz; + pa += sz; + va += sz; + } while (size > 0); + + return (res); } /* From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 03:41:36 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E075C106566B; Sat, 25 Oct 2008 03:41:36 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEAF18FC12; Sat, 25 Oct 2008 03:41:36 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9P3faOI015428; Sat, 25 Oct 2008 03:41:36 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9P3faHB015427; Sat, 25 Oct 2008 03:41:36 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200810250341.m9P3faHB015427@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 25 Oct 2008 03:41:36 +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: r184245 - head/sys/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 03:41:37 -0000 Author: yongari Date: Sat Oct 25 03:41:36 2008 New Revision: 184245 URL: http://svn.freebsd.org/changeset/base/184245 Log: Implement miibus_statchg handler. It detects whether rl(4) established a valid link or not. In rl_start_locked, don't try to send packets unless we have valid link. While I'm here add a check that verifies whether driver can accept Tx requests by inspecting IFF_DRV_OACTIVE/IFF_DRV_RUNNING flag. Modified: head/sys/pci/if_rl.c Modified: head/sys/pci/if_rl.c ============================================================================== --- head/sys/pci/if_rl.c Sat Oct 25 03:36:21 2008 (r184244) +++ head/sys/pci/if_rl.c Sat Oct 25 03:41:36 2008 (r184245) @@ -636,6 +636,34 @@ rl_miibus_writereg(device_t dev, int phy static void rl_miibus_statchg(device_t dev) { + struct rl_softc *sc; + struct ifnet *ifp; + struct mii_data *mii; + + sc = device_get_softc(dev); + mii = device_get_softc(sc->rl_miibus); + ifp = sc->rl_ifp; + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + + sc->rl_flags &= ~RL_FLAG_LINK; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + sc->rl_flags |= RL_FLAG_LINK; + break; + default: + break; + } + } + /* + * RealTek controllers do not provide any interface to + * Tx/Rx MACs for resolved speed, duplex and flow-control + * parameters. + */ } /* @@ -1545,6 +1573,10 @@ rl_start_locked(struct ifnet *ifp) RL_LOCK_ASSERT(sc); + if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING || (sc->rl_flags & RL_FLAG_LINK) == 0) + return; + while (RL_CUR_TXMBUF(sc) == NULL) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); @@ -1686,6 +1718,7 @@ rl_init_locked(struct rl_softc *sc) /* Enable receiver and transmitter. */ CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB|RL_CMD_RX_ENB); + sc->rl_flags &= ~RL_FLAG_LINK; mii_mediachg(mii); CSR_WRITE_1(sc, RL_CFG1, RL_CFG1_DRVLOAD|RL_CFG1_FULLDUPLEX); @@ -1831,6 +1864,7 @@ rl_stop(struct rl_softc *sc) sc->rl_watchdog_timer = 0; callout_stop(&sc->rl_stat_callout); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + sc->rl_flags &= ~RL_FLAG_LINK; CSR_WRITE_1(sc, RL_COMMAND, 0x00); CSR_WRITE_2(sc, RL_IMR, 0x0000); From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 03:55:31 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4AE71065670; Sat, 25 Oct 2008 03:55:31 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 9A8108FC14; Sat, 25 Oct 2008 03:55:31 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id m9P3sZMf015679; Fri, 24 Oct 2008 21:54:36 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 24 Oct 2008 21:54:35 -0600 (MDT) Message-Id: <20081024.215435.74734191.imp@bsdimp.com> To: xcllnt@mac.com From: Warner Losh In-Reply-To: References: <20081024.165035.41635952.imp@bsdimp.com> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, marcel@FreeBSD.org, bms@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184194 - in head/sys: conf mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 03:55:32 -0000 From: Marcel Moolenaar Subject: Re: svn commit: r184194 - in head/sys: conf mips/conf Date: Fri, 24 Oct 2008 16:04:44 -0700 > On Oct 24, 2008, at 3:50 PM, Warner Losh wrote: > > >> Please provide other grounds for reversal. > > > > (1) You didn't ask us first. > > This is no grounds for reversal. It is weak.. > > (2) Others have said this is a bad idea. > > People were confused about the change. Some people were confused, but others knew exactly what you did and still didn't like it. > > (3) There's appears to be a conensus that we should move the other way > > from what you are doing. > > Ok, this I buy. If people agree, we can discuss the > scope and impact of the new route. If it's not too > big a job I'll do the back-out by implementing it or > otherwise I'll just back out this change and forget > about it. Does that sound like a plan? Sounds good. Let's figure out where we want to go, and live with this in the interim. If we can't agree by, say, the end of MeetBSD, then backing out sounds like a plan. Would you like for me to write up what I had in mind as a starting point since I objected to this solution? Warner From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 04:09:37 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04CC7106567A; Sat, 25 Oct 2008 04:09:37 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout016.mac.com (asmtpout016.mac.com [17.148.16.91]) by mx1.freebsd.org (Postfix) with ESMTP id DD0778FC0C; Sat, 25 Oct 2008 04:09:36 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from b45ct31-3633.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp016.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0K9A003O30VYXF50@asmtp016.mac.com>; Fri, 24 Oct 2008 21:09:36 -0700 (PDT) Message-id: From: Marcel Moolenaar To: Warner Losh In-reply-to: <20081024.215435.74734191.imp@bsdimp.com> Date: Fri, 24 Oct 2008 21:09:34 -0700 References: <20081024.165035.41635952.imp@bsdimp.com> <20081024.215435.74734191.imp@bsdimp.com> X-Mailer: Apple Mail (2.929.2) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, marcel@FreeBSD.org, bms@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r184194 - in head/sys: conf mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 04:09:37 -0000 On Oct 24, 2008, at 8:54 PM, Warner Losh wrote: >>> (3) There's appears to be a conensus that we should move the other >>> way >>> from what you are doing. >> >> Ok, this I buy. If people agree, we can discuss the >> scope and impact of the new route. If it's not too >> big a job I'll do the back-out by implementing it or >> otherwise I'll just back out this change and forget >> about it. Does that sound like a plan? > > Sounds good. Let's figure out where we want to go, and live with this > in the interim. If we can't agree by, say, the end of MeetBSD, then > backing out sounds like a plan. Ok. > Would you like for me to write up what I had in mind as a starting > point since I objected to this solution? Yes, please. I don't know if you envision it to apply to all platforms, but do consider embedded PowerPC if not. -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 04:46:02 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5056106566B; Sat, 25 Oct 2008 04:46:02 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D35388FC20; Sat, 25 Oct 2008 04:46:02 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9P4k211021628; Sat, 25 Oct 2008 04:46:02 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9P4k2T9021627; Sat, 25 Oct 2008 04:46:02 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200810250446.m9P4k2T9021627@svn.freebsd.org> From: Kip Macy Date: Sat, 25 Oct 2008 04:46: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: r184248 - head/sys/i386/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 04:46:03 -0000 Author: kmacy Date: Sat Oct 25 04:46:02 2008 New Revision: 184248 URL: http://svn.freebsd.org/changeset/base/184248 Log: handle case where eflags represents actual flags value when restoring interrupts Modified: head/sys/i386/xen/xen_machdep.c Modified: head/sys/i386/xen/xen_machdep.c ============================================================================== --- head/sys/i386/xen/xen_machdep.c Sat Oct 25 04:44:22 2008 (r184247) +++ head/sys/i386/xen/xen_machdep.c Sat Oct 25 04:46:02 2008 (r184248) @@ -345,6 +345,8 @@ xen_load_cr3(u_int val) void xen_restore_flags(u_int eflags) { + if (eflags > 1) + eflags = ((eflags & PSL_I) == 0); __restore_flags(eflags); } From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 05:57:37 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 250E51065670; Sat, 25 Oct 2008 05:57:37 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 139BC8FC17; Sat, 25 Oct 2008 05:57:37 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9P5vaUg022941; Sat, 25 Oct 2008 05:57:36 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9P5vaVV022940; Sat, 25 Oct 2008 05:57:36 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200810250557.m9P5vaVV022940@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 25 Oct 2008 05:57:36 +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: r184249 - head/sys/powerpc/mpc85xx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 05:57:37 -0000 Author: marcel Date: Sat Oct 25 05:57:36 2008 New Revision: 184249 URL: http://svn.freebsd.org/changeset/base/184249 Log: Assign 0xff800000-0xffffffff to the LBC controller. That's where the NOR flash lives by default. Modified: head/sys/powerpc/mpc85xx/ocpbus.c Modified: head/sys/powerpc/mpc85xx/ocpbus.c ============================================================================== --- head/sys/powerpc/mpc85xx/ocpbus.c Sat Oct 25 04:46:02 2008 (r184248) +++ head/sys/powerpc/mpc85xx/ocpbus.c Sat Oct 25 05:57:36 2008 (r184249) @@ -172,6 +172,10 @@ ocpbus_write_law(int trgt, int type, u_l addr = 0xA0000000; size = 0x10000000; break; + case OCP85XX_TGTIF_LBC: + addr = 0xff800000; + size = 0x00800000; + break; default: return (EINVAL); } From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 06:03:41 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53887106566C; Sat, 25 Oct 2008 06:03:41 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 408538FC26; Sat, 25 Oct 2008 06:03:41 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9P63f7h023102; Sat, 25 Oct 2008 06:03:41 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9P63fCW023099; Sat, 25 Oct 2008 06:03:41 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200810250603.m9P63fCW023099@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 25 Oct 2008 06:03:41 +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: r184250 - in head/sys: conf powerpc/mpc85xx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 06:03:41 -0000 Author: marcel Date: Sat Oct 25 06:03:40 2008 New Revision: 184250 URL: http://svn.freebsd.org/changeset/base/184250 Log: Add a driver for the Local Bus Controller. Obtained from: Juniper Networks, Inc. Added: head/sys/powerpc/mpc85xx/lbc.c (contents, props changed) head/sys/powerpc/mpc85xx/lbc.h (contents, props changed) Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sat Oct 25 05:57:36 2008 (r184249) +++ head/sys/conf/files.powerpc Sat Oct 25 06:03:40 2008 (r184250) @@ -99,6 +99,7 @@ powerpc/fpu/fpu_implode.c optional fpu_e powerpc/fpu/fpu_mul.c optional fpu_emu powerpc/fpu/fpu_sqrt.c optional fpu_emu powerpc/fpu/fpu_subr.c optional fpu_emu +powerpc/mpc85xx/lbc.c optional mpc85xx powerpc/mpc85xx/mpc85xx.c optional mpc85xx powerpc/mpc85xx/nexus.c optional mpc85xx powerpc/mpc85xx/ocpbus.c optional mpc85xx Added: head/sys/powerpc/mpc85xx/lbc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/mpc85xx/lbc.c Sat Oct 25 06:03:40 2008 (r184250) @@ -0,0 +1,328 @@ +/*- + * Copyright (c) 2006-2008, Juniper Networks, Inc. + * 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. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * 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 + +struct lbc_softc { + device_t sc_dev; + + struct resource *sc_res; + bus_space_handle_t sc_bsh; + bus_space_tag_t sc_bst; + int sc_rid; + + struct rman sc_rman; + uintptr_t sc_kva; +}; + +struct lbc_devinfo { + int lbc_devtype; + int lbc_memtype; + /* Also the BAR number */ + int lbc_unit; +}; + +static int lbc_probe(device_t); +static int lbc_attach(device_t); +static int lbc_shutdown(device_t); +static int lbc_get_resource(device_t, device_t, int, int, u_long *, + u_long *); +static struct resource *lbc_alloc_resource(device_t, device_t, int, int *, + u_long, u_long, u_long, u_int); +static int lbc_print_child(device_t, device_t); +static int lbc_release_resource(device_t, device_t, int, int, + struct resource *); +static int lbc_read_ivar(device_t, device_t, int, uintptr_t *); + +/* + * Bus interface definition + */ +static device_method_t lbc_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, lbc_probe), + DEVMETHOD(device_attach, lbc_attach), + DEVMETHOD(device_shutdown, lbc_shutdown), + + /* Bus interface */ + DEVMETHOD(bus_print_child, lbc_print_child), + DEVMETHOD(bus_read_ivar, lbc_read_ivar), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, NULL), + + DEVMETHOD(bus_get_resource, NULL), + DEVMETHOD(bus_alloc_resource, lbc_alloc_resource), + DEVMETHOD(bus_release_resource, lbc_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + + { 0, 0 } +}; + +static driver_t lbc_driver = { + "lbc", + lbc_methods, + sizeof(struct lbc_softc) +}; +devclass_t lbc_devclass; +DRIVER_MODULE(lbc, ocpbus, lbc_driver, lbc_devclass, 0, 0); + +static device_t +lbc_mk_child(device_t dev, int type, int mtype, int unit) +{ + struct lbc_devinfo *dinfo; + device_t child; + + child = device_add_child(dev, NULL, -1); + if (child == NULL) { + device_printf(dev, "could not add child device\n"); + return (NULL); + } + dinfo = malloc(sizeof(struct lbc_devinfo), M_DEVBUF, M_WAITOK | M_ZERO); + dinfo->lbc_devtype = type; + dinfo->lbc_memtype = mtype; + dinfo->lbc_unit = unit; + device_set_ivars(child, dinfo); + return (child); +} + +static int +lbc_probe(device_t dev) +{ + device_t parent; + uintptr_t devtype; + int error; + + parent = device_get_parent(dev); + error = BUS_READ_IVAR(parent, dev, OCPBUS_IVAR_DEVTYPE, &devtype); + if (error) + return (error); + if (devtype != OCPBUS_DEVTYPE_LBC) + return (ENXIO); + + device_set_desc(dev, "Freescale MPC85xx Local Bus Controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +lbc_attach(device_t dev) +{ + struct lbc_softc *sc; + struct rman *rm; + u_long start, size; + int error; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + sc->sc_rid = 0; + sc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_rid, + RF_ACTIVE); + if (sc->sc_res == NULL) + return (ENXIO); + + sc->sc_bst = rman_get_bustag(sc->sc_res); + sc->sc_bsh = rman_get_bushandle(sc->sc_res); + + error = bus_get_resource(dev, SYS_RES_MEMORY, 1, &start, &size); + if (error) + goto fail; + + rm = &sc->sc_rman; + rm->rm_type = RMAN_ARRAY; + rm->rm_descr = "MPC85XX Local Bus Space"; + rm->rm_start = start; + rm->rm_end = start + size - 1; + error = rman_init(rm); + if (error) + goto fail; + + error = rman_manage_region(rm, rm->rm_start, rm->rm_end); + if (error) { + rman_fini(rm); + goto fail; + } + + sc->sc_kva = (uintptr_t)pmap_mapdev(start, size); + + lbc_mk_child(dev, LBC_DEVTYPE_CFI, 0, 0); + + return (bus_generic_attach(dev)); + + fail: + bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_rid, sc->sc_res); + return (error); +} + +static int +lbc_shutdown(device_t dev) +{ + + /* TODO */ + return(0); +} + +static struct resource * +lbc_alloc_resource(device_t dev, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct lbc_softc *sc; + struct resource *rv; + struct rman *rm; + int error; + + sc = device_get_softc(dev); + + if (type != SYS_RES_MEMORY && type != SYS_RES_IRQ) + return (NULL); + + /* We only support default allocations. */ + if (start != 0ul || end != ~0ul) + return (NULL); + + if (type == SYS_RES_IRQ) + return (bus_alloc_resource(dev, type, rid, start, end, count, + flags)); + + error = lbc_get_resource(dev, child, type, *rid, &start, &count); + if (error) + return (NULL); + + rm = &sc->sc_rman; + end = start + count - 1; + rv = rman_reserve_resource(rm, start, end, count, flags, child); + if (rv != NULL) { + rman_set_bustag(rv, &bs_be_tag); + rman_set_bushandle(rv, sc->sc_kva + rman_get_start(rv) - + rm->rm_start); + } + return (rv); +} + +static int +lbc_print_child(device_t dev, device_t child) +{ + u_long size, start; + int error, retval, rid; + + retval = bus_print_child_header(dev, child); + + rid = 0; + while (1) { + error = lbc_get_resource(dev, child, SYS_RES_MEMORY, rid, + &start, &size); + if (error) + break; + retval += (rid == 0) ? printf(" iomem ") : printf(","); + retval += printf("%#lx", start); + if (size > 1) + retval += printf("-%#lx", start + size - 1); + rid++; + } + + retval += bus_print_child_footer(dev, child); + return (retval); +} + +static int +lbc_read_ivar(device_t dev, device_t child, int index, uintptr_t *result) +{ + struct lbc_devinfo *dinfo; + + if (device_get_parent(child) != dev) + return (EINVAL); + + dinfo = device_get_ivars(child); + + switch (index) { + case LBC_IVAR_DEVTYPE: + *result = dinfo->lbc_devtype; + return (0); + case LBC_IVAR_CLOCK: + *result = 1843200; + return (0); + case LBC_IVAR_REGSHIFT: + *result = 0; + return (0); + default: + break; + } + return (EINVAL); +} + +static int +lbc_release_resource(device_t dev, device_t child, int type, int rid, + struct resource *res) +{ + + return (rman_release_resource(res)); +} + +static int +lbc_get_resource(device_t dev, device_t child, int type, int rid, + u_long *startp, u_long *countp) +{ + struct lbc_softc *sc; + struct lbc_devinfo *dinfo; + + if (type != SYS_RES_MEMORY) + return (ENOENT); + + /* Currently all devices have a single RID per type. */ + if (rid != 0) + return (ENOENT); + + sc = device_get_softc(dev); + dinfo = device_get_ivars(child); + + switch (dinfo->lbc_devtype) { + case LBC_DEVTYPE_CFI: + *startp = sc->sc_rman.rm_start; + *countp = sc->sc_rman.rm_end - sc->sc_rman.rm_start + 1; + break; + default: + return(EDOOFUS); + } + return(0); +} Added: head/sys/powerpc/mpc85xx/lbc.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/mpc85xx/lbc.h Sat Oct 25 06:03:40 2008 (r184250) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2006-2008, Juniper Networks, Inc. + * 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 ``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. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_LBC_H_ +#define _MACHINE_LBC_H_ + +#define LBC_IVAR_DEVTYPE 1 +#define LBC_IVAR_CLOCK 2 +#define LBC_IVAR_REGSHIFT 3 + +/* Device types. */ +#define LBC_DEVTYPE_CFI 1 +#define LBC_DEVTYPE_UART 2 + +#endif /* _MACHINE_LBC_H_ */ From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 06:18:12 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E14211065672; Sat, 25 Oct 2008 06:18:12 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDE078FC19; Sat, 25 Oct 2008 06:18:12 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9P6ICHK023378; Sat, 25 Oct 2008 06:18:12 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9P6ICWl023370; Sat, 25 Oct 2008 06:18:12 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200810250618.m9P6ICWl023370@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 25 Oct 2008 06:18: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: r184251 - in head/sys: conf dev/cfi sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 06:18:13 -0000 Author: marcel Date: Sat Oct 25 06:18:12 2008 New Revision: 184251 URL: http://svn.freebsd.org/changeset/base/184251 Log: Add a driver for flash memory that implements to the Common Flash Memory Interface (CFI). The flash memory can be read and written to through /dev/cfi# and an ioctl() exists so processes can read the query information. The driver supports the AMD and Intel command set, though only the AMD command has been tested. Obtained from: Juniper Networks, Inc. Added: head/sys/dev/cfi/ head/sys/dev/cfi/cfi_bus_lbc.c (contents, props changed) head/sys/dev/cfi/cfi_core.c (contents, props changed) head/sys/dev/cfi/cfi_dev.c (contents, props changed) head/sys/dev/cfi/cfi_reg.h (contents, props changed) head/sys/dev/cfi/cfi_var.h (contents, props changed) head/sys/sys/cfictl.h (contents, props changed) Modified: head/sys/conf/files head/sys/conf/files.powerpc Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Oct 25 06:03:40 2008 (r184250) +++ head/sys/conf/files Sat Oct 25 06:18:12 2008 (r184251) @@ -532,6 +532,8 @@ dev/buslogic/bt_pci.c optional bt pci dev/cardbus/cardbus.c optional cardbus dev/cardbus/cardbus_cis.c optional cardbus dev/cardbus/cardbus_device.c optional cardbus +dev/cfi/cfi_core.c optional cfi +dev/cfi/cfi_dev.c optional cfi dev/ciss/ciss.c optional ciss dev/cm/smc90cx6.c optional cm dev/cmx/cmx.c optional cmx Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sat Oct 25 06:03:40 2008 (r184250) +++ head/sys/conf/files.powerpc Sat Oct 25 06:18:12 2008 (r184251) @@ -28,6 +28,7 @@ opt_ah.h optional ath_hal \ crypto/blowfish/bf_enc.c optional crypto | ipsec crypto/des/des_enc.c optional crypto | ipsec | netsmb dev/bm/if_bm.c optional bm powermac +dev/cfi/cfi_bus_lbc.c optional cfi dev/fb/fb.c optional sc dev/hwpmc/hwpmc_powerpc.c optional hwpmc dev/kbd/kbd.c optional sc Added: head/sys/dev/cfi/cfi_bus_lbc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cfi/cfi_bus_lbc.c Sat Oct 25 06:18:12 2008 (r184251) @@ -0,0 +1,83 @@ +/*- + * Copyright (c) 2007, Juniper Networks, Inc. + * 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. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 + +static int cfi_lbc_probe(device_t); + +static device_method_t cfi_lbc_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, cfi_lbc_probe), + DEVMETHOD(device_attach, cfi_attach), + DEVMETHOD(device_detach, cfi_detach), + + {0, 0} +}; + +static driver_t cfi_lbc_driver = { + cfi_driver_name, + cfi_lbc_methods, + sizeof(struct cfi_softc), +}; + +DRIVER_MODULE (cfi, lbc, cfi_lbc_driver, cfi_devclass, 0, 0); + +static int +cfi_lbc_probe(device_t dev) +{ + uintptr_t devtype; + int error; + + error = BUS_READ_IVAR(device_get_parent(dev), dev, LBC_IVAR_DEVTYPE, + &devtype); + if (error) + return (error); + + if (devtype != LBC_DEVTYPE_CFI) + return (EINVAL); + + return (cfi_probe(dev)); +} Added: head/sys/dev/cfi/cfi_core.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cfi/cfi_core.c Sat Oct 25 06:18:12 2008 (r184251) @@ -0,0 +1,419 @@ +/*- + * Copyright (c) 2007, Juniper Networks, Inc. + * 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. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 + +extern struct cdevsw cfi_cdevsw; + +char cfi_driver_name[] = "cfi"; +devclass_t cfi_devclass; + +uint32_t +cfi_read(struct cfi_softc *sc, u_int ofs) +{ + uint32_t val; + + ofs &= ~(sc->sc_width - 1); + switch (sc->sc_width) { + case 1: + val = bus_space_read_1(sc->sc_tag, sc->sc_handle, ofs); + break; + case 2: + val = bus_space_read_2(sc->sc_tag, sc->sc_handle, ofs); + break; + case 4: + val = bus_space_read_4(sc->sc_tag, sc->sc_handle, ofs); + break; + default: + val = ~0; + break; + } + + return (val); +} + +static void +cfi_write(struct cfi_softc *sc, u_int ofs, u_int val) +{ + + ofs &= ~(sc->sc_width - 1); + switch (sc->sc_width) { + case 1: + bus_space_write_1(sc->sc_tag, sc->sc_handle, ofs, val); + break; + case 2: + bus_space_write_2(sc->sc_tag, sc->sc_handle, ofs, val); + break; + case 4: + bus_space_write_4(sc->sc_tag, sc->sc_handle, ofs, val); + break; + } +} + +uint8_t +cfi_read_qry(struct cfi_softc *sc, u_int ofs) +{ + uint8_t val; + + cfi_write(sc, CFI_QRY_CMD_ADDR * sc->sc_width, CFI_QRY_CMD_DATA); + val = cfi_read(sc, ofs * sc->sc_width); + cfi_write(sc, 0, CFI_BCS_READ_ARRAY); + return (val); +} + +static void +cfi_amd_write(struct cfi_softc *sc, u_int ofs, u_int addr, u_int data) +{ + + cfi_write(sc, ofs + AMD_ADDR_START, CFI_AMD_UNLOCK); + cfi_write(sc, ofs + AMD_ADDR_ACK, CFI_AMD_UNLOCK_ACK); + cfi_write(sc, ofs + addr, data); +} + +static char * +cfi_fmtsize(uint32_t sz) +{ + static char buf[8]; + static const char *sfx[] = { "", "K", "M", "G" }; + int sfxidx; + + sfxidx = 0; + while (sfxidx < 3 && sz > 1023) { + sz /= 1024; + sfxidx++; + } + + sprintf(buf, "%u%sB", sz, sfx[sfxidx]); + return (buf); +} + +int +cfi_probe(device_t dev) +{ + char desc[80]; + struct cfi_softc *sc; + char *vend_str; + int error; + uint16_t iface, vend; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + sc->sc_rid = 0; + sc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_rid, + RF_ACTIVE); + if (sc->sc_res == NULL) + return (ENXIO); + + sc->sc_tag = rman_get_bustag(sc->sc_res); + sc->sc_handle = rman_get_bushandle(sc->sc_res); + + sc->sc_width = 1; + while (sc->sc_width <= 4) { + if (cfi_read_qry(sc, CFI_QRY_IDENT) == 'Q') + break; + sc->sc_width <<= 1; + } + if (sc->sc_width > 4) { + error = ENXIO; + goto out; + } + + /* We got a Q. Check if we also have the R and the Y. */ + if (cfi_read_qry(sc, CFI_QRY_IDENT + 1) != 'R' || + cfi_read_qry(sc, CFI_QRY_IDENT + 2) != 'Y') { + error = ENXIO; + goto out; + } + + /* Get the vendor and command set. */ + vend = cfi_read_qry(sc, CFI_QRY_VEND) | + (cfi_read_qry(sc, CFI_QRY_VEND + 1) << 8); + + sc->sc_cmdset = vend; + + switch (vend) { + case CFI_VEND_AMD_ECS: + case CFI_VEND_AMD_SCS: + vend_str = "AMD/Fujitsu"; + break; + case CFI_VEND_INTEL_ECS: + vend_str = "Intel/Sharp"; + break; + case CFI_VEND_INTEL_SCS: + vend_str = "Intel"; + break; + case CFI_VEND_MITSUBISHI_ECS: + case CFI_VEND_MITSUBISHI_SCS: + vend_str = "Mitsubishi"; + break; + default: + vend_str = "Unknown vendor"; + break; + } + + /* Get the device size. */ + sc->sc_size = 1U << cfi_read_qry(sc, CFI_QRY_SIZE); + + /* Sanity-check the I/F */ + iface = cfi_read_qry(sc, CFI_QRY_IFACE) | + (cfi_read_qry(sc, CFI_QRY_IFACE + 1) << 8); + + /* + * Adding 1 to iface will give us a bit-wise "switch" + * that allows us to test for the interface width by + * testing a single bit. + */ + iface++; + + error = (iface & sc->sc_width) ? 0 : EINVAL; + if (error) + goto out; + + snprintf(desc, sizeof(desc), "%s - %s", vend_str, + cfi_fmtsize(sc->sc_size)); + device_set_desc_copy(dev, desc); + + out: + bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_rid, sc->sc_res); + return (error); +} + +int +cfi_attach(device_t dev) +{ + struct cfi_softc *sc; + u_int blksz, blocks; + u_int r, u; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + sc->sc_rid = 0; + sc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_rid, + RF_ACTIVE); + if (sc->sc_res == NULL) + return (ENXIO); + + sc->sc_tag = rman_get_bustag(sc->sc_res); + sc->sc_handle = rman_get_bushandle(sc->sc_res); + + /* Get time-out values for erase and write. */ + sc->sc_write_timeout = 1 << cfi_read_qry(sc, CFI_QRY_TTO_WRITE); + sc->sc_erase_timeout = 1 << cfi_read_qry(sc, CFI_QRY_TTO_ERASE); + sc->sc_write_timeout *= 1 << cfi_read_qry(sc, CFI_QRY_MTO_WRITE); + sc->sc_erase_timeout *= 1 << cfi_read_qry(sc, CFI_QRY_MTO_ERASE); + + /* Get erase regions. */ + sc->sc_regions = cfi_read_qry(sc, CFI_QRY_NREGIONS); + sc->sc_region = malloc(sc->sc_regions * sizeof(struct cfi_region), + M_TEMP, M_WAITOK | M_ZERO); + for (r = 0; r < sc->sc_regions; r++) { + blocks = cfi_read_qry(sc, CFI_QRY_REGION(r)) | + (cfi_read_qry(sc, CFI_QRY_REGION(r) + 1) << 8); + sc->sc_region[r].r_blocks = blocks + 1; + + blksz = cfi_read_qry(sc, CFI_QRY_REGION(r) + 2) | + (cfi_read_qry(sc, CFI_QRY_REGION(r) + 3) << 8); + sc->sc_region[r].r_blksz = (blksz == 0) ? 128 : + blksz * 256; + } + + /* Reset the device to a default state. */ + cfi_write(sc, 0, CFI_BCS_CLEAR_STATUS); + + if (bootverbose) { + device_printf(dev, "["); + for (r = 0; r < sc->sc_regions; r++) { + printf("%ux%s%s", sc->sc_region[r].r_blocks, + cfi_fmtsize(sc->sc_region[r].r_blksz), + (r == sc->sc_regions - 1) ? "]\n" : ","); + } + } + + u = device_get_unit(dev); + sc->sc_nod = make_dev(&cfi_cdevsw, u, UID_ROOT, GID_WHEEL, 0600, + "%s%u", cfi_driver_name, u); + sc->sc_nod->si_drv1 = sc; + + return (0); +} + +int +cfi_detach(device_t dev) +{ + struct cfi_softc *sc; + + sc = device_get_softc(dev); + + destroy_dev(sc->sc_nod); + free(sc->sc_region, M_TEMP); + bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_rid, sc->sc_res); + return (0); +} + +static int +cfi_wait_ready(struct cfi_softc *sc, u_int timeout) +{ + int done, error; + uint32_t st0, st; + + done = 0; + error = 0; + timeout *= 10; + while (!done && !error && timeout) { + DELAY(100); + timeout--; + + switch (sc->sc_cmdset) { + case CFI_VEND_INTEL_ECS: + case CFI_VEND_INTEL_SCS: + st = cfi_read(sc, sc->sc_wrofs); + done = (st & 0x80); + if (done) { + if (st & 0x02) + error = EPERM; + else if (st & 0x10) + error = EIO; + else if (st & 0x20) + error = ENXIO; + } + break; + case CFI_VEND_AMD_SCS: + case CFI_VEND_AMD_ECS: + st0 = cfi_read(sc, sc->sc_wrofs); + st = cfi_read(sc, sc->sc_wrofs); + done = ((st & 0x40) == (st0 & 0x40)) ? 1 : 0; + break; + } + } + if (!done && !error) + error = ETIMEDOUT; + if (error) + printf("\nerror=%d\n", error); + return (error); +} + +int +cfi_write_block(struct cfi_softc *sc) +{ + union { + uint8_t *x8; + uint16_t *x16; + uint32_t *x32; + } ptr; + register_t intr; + int error, i; + + /* Erase the block. */ + switch (sc->sc_cmdset) { + case CFI_VEND_INTEL_ECS: + case CFI_VEND_INTEL_SCS: + cfi_write(sc, sc->sc_wrofs, CFI_BCS_BLOCK_ERASE); + cfi_write(sc, sc->sc_wrofs, CFI_BCS_CONFIRM); + break; + case CFI_VEND_AMD_SCS: + case CFI_VEND_AMD_ECS: + cfi_amd_write(sc, sc->sc_wrofs, AMD_ADDR_START, + CFI_AMD_ERASE_SECTOR); + cfi_amd_write(sc, sc->sc_wrofs, 0, CFI_AMD_BLOCK_ERASE); + break; + default: + /* Better safe than sorry... */ + return (ENODEV); + } + error = cfi_wait_ready(sc, sc->sc_erase_timeout); + if (error) + goto out; + + /* Write the block. */ + ptr.x8 = sc->sc_wrbuf; + for (i = 0; i < sc->sc_wrbufsz; i += sc->sc_width) { + + /* + * Make sure the command to start a write and the + * actual write happens back-to-back without any + * excessive delays. + */ + intr = intr_disable(); + + switch (sc->sc_cmdset) { + case CFI_VEND_INTEL_ECS: + case CFI_VEND_INTEL_SCS: + cfi_write(sc, sc->sc_wrofs + i, CFI_BCS_PROGRAM); + break; + case CFI_VEND_AMD_SCS: + case CFI_VEND_AMD_ECS: + cfi_amd_write(sc, 0, AMD_ADDR_START, CFI_AMD_PROGRAM); + break; + } + switch (sc->sc_width) { + case 1: + bus_space_write_1(sc->sc_tag, sc->sc_handle, + sc->sc_wrofs + i, *(ptr.x8)++); + break; + case 2: + bus_space_write_2(sc->sc_tag, sc->sc_handle, + sc->sc_wrofs + i, *(ptr.x16)++); + break; + case 4: + bus_space_write_4(sc->sc_tag, sc->sc_handle, + sc->sc_wrofs + i, *(ptr.x32)++); + break; + } + + intr_restore(intr); + + error = cfi_wait_ready(sc, sc->sc_write_timeout); + if (error) + goto out; + } + + /* error is 0. */ + + out: + cfi_write(sc, 0, CFI_BCS_READ_ARRAY); + return (error); +} Added: head/sys/dev/cfi/cfi_dev.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cfi/cfi_dev.c Sat Oct 25 06:18:12 2008 (r184251) @@ -0,0 +1,277 @@ +/*- + * Copyright (c) 2007, Juniper Networks, Inc. + * 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. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 + +static d_open_t cfi_devopen; +static d_close_t cfi_devclose; +static d_read_t cfi_devread; +static d_write_t cfi_devwrite; +static d_ioctl_t cfi_devioctl; + +struct cdevsw cfi_cdevsw = { + .d_version = D_VERSION, + .d_flags = 0, + .d_name = cfi_driver_name, + .d_open = cfi_devopen, + .d_close = cfi_devclose, + .d_read = cfi_devread, + .d_write = cfi_devwrite, + .d_ioctl = cfi_devioctl, +}; + +/* + * Begin writing into a new block/sector. We read the sector into + * memory and keep updating that, until we move into another sector + * or the process stops writing. At that time we write the whole + * sector to flash (see cfi_block_finish). + */ +static int +cfi_block_start(struct cfi_softc *sc, u_int ofs) +{ + union { + uint8_t *x8; + uint16_t *x16; + uint32_t *x32; + } ptr; + u_int rofs, rsz; + uint32_t val; + int r; + + rofs = 0; + for (r = 0; r < sc->sc_regions; r++) { + rsz = sc->sc_region[r].r_blocks * sc->sc_region[r].r_blksz; + if (ofs < rofs + rsz) + break; + rofs += rsz; + } + if (r == sc->sc_regions) + return (EFAULT); + + sc->sc_wrbufsz = sc->sc_region[r].r_blksz; + sc->sc_wrbuf = malloc(sc->sc_wrbufsz, M_TEMP, M_WAITOK); + sc->sc_wrofs = ofs - (ofs - rofs) % sc->sc_wrbufsz; + + /* Read the block from flash for byte-serving. */ + ptr.x8 = sc->sc_wrbuf; + for (r = 0; r < sc->sc_wrbufsz; r += sc->sc_width) { + val = cfi_read(sc, sc->sc_wrofs + r); + switch (sc->sc_width) { + case 1: + *(ptr.x8)++ = val; + break; + case 2: + *(ptr.x16)++ = val; + break; + case 4: + *(ptr.x32)++ = val; + break; + } + } + sc->sc_writing = 1; + return (0); +} + +/* + * Finish updating the current block/sector by writing the compound + * set of changes to the flash. + */ +static int +cfi_block_finish(struct cfi_softc *sc) +{ + int error; + + error = cfi_write_block(sc); + free(sc->sc_wrbuf, M_TEMP); + sc->sc_wrbuf = NULL; + sc->sc_wrbufsz = 0; + sc->sc_wrofs = 0; + sc->sc_writing = 0; + return (error); +} + +static int +cfi_devopen(struct cdev *dev, int oflags, int devtype, struct thread *td) +{ + struct cfi_softc *sc; + + sc = dev->si_drv1; + /* We allow only 1 open. */ + if (!atomic_cmpset_acq_ptr(&sc->sc_opened, NULL, td->td_proc)) + return (EBUSY); + return (0); +} + +static int +cfi_devclose(struct cdev *dev, int fflag, int devtype, struct thread *td) +{ + struct cfi_softc *sc; + int error; + + sc = dev->si_drv1; + /* Sanity. Not really necessary. */ + if (sc->sc_opened != td->td_proc) + return (ENXIO); + + error = (sc->sc_writing) ? cfi_block_finish(sc) : 0; + sc->sc_opened = NULL; + return (error); +} + +static int +cfi_devread(struct cdev *dev, struct uio *uio, int ioflag) +{ + union { + uint8_t x8[4]; + uint16_t x16[2]; + uint32_t x32[1]; + } buf; + struct cfi_softc *sc; + u_int ofs; + uint32_t val; + int error; + + sc = dev->si_drv1; + + error = (sc->sc_writing) ? cfi_block_finish(sc) : 0; + if (!error) + error = (uio->uio_offset > sc->sc_size) ? EIO : 0; + + while (error == 0 && uio->uio_resid > 0 && + uio->uio_offset < sc->sc_size) { + ofs = uio->uio_offset; + val = cfi_read(sc, ofs); + switch (sc->sc_width) { + case 1: + buf.x8[0] = val; + break; + case 2: + buf.x16[0] = val; + break; + case 4: + buf.x32[0] = val; + break; + } + ofs &= sc->sc_width - 1; + error = uiomove(buf.x8 + ofs, + MIN(uio->uio_resid, sc->sc_width - ofs), uio); + } + return (error); +} + +static int +cfi_devwrite(struct cdev *dev, struct uio *uio, int ioflag) +{ + struct cfi_softc *sc; + u_int ofs, top; + int error; + + sc = dev->si_drv1; + + error = (uio->uio_offset > sc->sc_size) ? EIO : 0; + while (error == 0 && uio->uio_resid > 0 && + uio->uio_offset < sc->sc_size) { + ofs = uio->uio_offset; + + /* + * Finish the current block if we're about to write + * to a different block. + */ + if (sc->sc_writing) { + top = sc->sc_wrofs + sc->sc_wrbufsz; + if (ofs < sc->sc_wrofs || ofs >= top) + cfi_block_finish(sc); + } + + /* Start writing to a (new) block if applicable. */ + if (!sc->sc_writing) { + error = cfi_block_start(sc, uio->uio_offset); + if (error) + break; + } + + top = sc->sc_wrofs + sc->sc_wrbufsz; + error = uiomove(sc->sc_wrbuf + ofs - sc->sc_wrofs, + MIN(top - ofs, uio->uio_resid), uio); + } + return (error); +} + +static int +cfi_devioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, + struct thread *td) +{ + struct cfi_softc *sc; + struct cfiocqry *rq; + int error; + u_char val; + + if (cmd != CFIOCQRY) + return (ENOIOCTL); + + sc = dev->si_drv1; + + error = (sc->sc_writing) ? cfi_block_finish(sc) : 0; + if (error) + return (error); + + rq = (struct cfiocqry *)data; + + if (rq->offset >= sc->sc_size / sc->sc_width) + return (ESPIPE); + if (rq->offset + rq->count > sc->sc_size / sc->sc_width) + return (ENOSPC); + + while (!error && rq->count--) { + val = cfi_read_qry(sc, rq->offset++); + error = copyout(&val, rq->buffer++, 1); + } + + return (error); +} Added: head/sys/dev/cfi/cfi_reg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cfi/cfi_reg.h Sat Oct 25 06:18:12 2008 (r184251) @@ -0,0 +1,117 @@ +/*- + * Copyright (c) 2007, Juniper Networks, Inc. + * 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. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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. + * + * $FreeBSD$ + */ + +#ifndef _DEV_CFI_REG_H_ +#define _DEV_CFI_REG_H_ + +struct cfi_qry { + u_char reserved[16]; + u_char ident[3]; /* "QRY" */ + u_char pri_vend[2]; + u_char pri_vend_eqt[2]; + u_char alt_vend[2]; + u_char alt_vend_eqt[2]; + /* System Interface Information. */ + u_char min_vcc; + u_char max_vcc; + u_char min_vpp; + u_char max_vpp; + u_char tto_byte_write; /* 2**n milliseconds. */ + u_char tto_buf_write; /* 2**n milliseconds. */ + u_char tto_block_erase; /* 2**n milliseconds. */ + u_char tto_chip_erase; /* 2**n milliseconds. */ + u_char mto_byte_write; /* 2**n times typical t/o. */ + u_char mto_buf_write; /* 2**n times typical t/o. */ + u_char mto_block_erase; /* 2**n times typical t/o. */ + u_char mto_chip_erase; /* 2**n times typical t/o. */ + /* Device Geometry Definition. */ + u_char size; /* 2**n bytes. */ + u_char iface[2]; + u_char max_buf_write_size[2]; /* 2**n. */ + u_char nregions; /* Number of erase regions. */ + u_char region[4]; /* Single entry. */ + /* Additional entries follow. */ + /* Primary Vendor-specific Extended Query table follows. */ + /* Alternate Vendor-specific Extended Query table follows. */ +}; + +#define CFI_QRY_CMD_ADDR 0x55 +#define CFI_QRY_CMD_DATA 0x98 + +#define CFI_QRY_IDENT offsetof(struct cfi_qry, ident) +#define CFI_QRY_VEND offsetof(struct cfi_qry, pri_vend) + +#define CFI_QRY_TTO_WRITE offsetof(struct cfi_qry, tto_byte_write) +#define CFI_QRY_TTO_ERASE offsetof(struct cfi_qry, tto_block_erase) +#define CFI_QRY_MTO_WRITE offsetof(struct cfi_qry, mto_byte_write) +#define CFI_QRY_MTO_ERASE offsetof(struct cfi_qry, mto_block_erase) + +#define CFI_QRY_SIZE offsetof(struct cfi_qry, size) +#define CFI_QRY_IFACE offsetof(struct cfi_qry, iface) +#define CFI_QRY_NREGIONS offsetof(struct cfi_qry, nregions) +#define CFI_QRY_REGION0 offsetof(struct cfi_qry, region) +#define CFI_QRY_REGION(x) (CFI_QRY_REGION0 + (x) * 4) + +#define CFI_VEND_NONE 0x0000 +#define CFI_VEND_INTEL_ECS 0x0001 +#define CFI_VEND_AMD_SCS 0x0002 +#define CFI_VEND_INTEL_SCS 0x0003 +#define CFI_VEND_AMD_ECS 0x0004 +#define CFI_VEND_MITSUBISHI_SCS 0x0100 +#define CFI_VEND_MITSUBISHI_ECS 0x0101 + +#define CFI_IFACE_X8 0x0000 +#define CFI_IFACE_X16 0x0001 +#define CFI_IFACE_X8X16 0x0002 +#define CFI_IFACE_X32 0x0003 +#define CFI_IFACE_X16X32 0x0005 + +/* Standard Command Set (aka Basic Command Set) */ +#define CFI_BCS_BLOCK_ERASE 0x20 +#define CFI_BCS_PROGRAM 0x40 +#define CFI_BCS_CLEAR_STATUS 0x50 +#define CFI_BCS_READ_STATUS 0x70 +#define CFI_BCS_ERASE_SUSPEND 0xb0 +#define CFI_BCS_ERASE_RESUME 0xd0 /* Equals CONFIRM */ +#define CFI_BCS_CONFIRM 0xd0 +#define CFI_BCS_READ_ARRAY 0xff + +/* AMD commands. */ +#define CFI_AMD_BLOCK_ERASE 0x30 +#define CFI_AMD_UNLOCK_ACK 0x55 +#define CFI_AMD_ERASE_SECTOR 0x80 +#define CFI_AMD_PROGRAM 0xa0 +#define CFI_AMD_UNLOCK 0xaa + +#define AMD_ADDR_START 0xaaa +#define AMD_ADDR_ACK 0x555 + +#endif /* _DEV_CFI_REG_H_ */ Added: head/sys/dev/cfi/cfi_var.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cfi/cfi_var.h Sat Oct 25 06:18:12 2008 (r184251) @@ -0,0 +1,77 @@ +/*- + * Copyright (c) 2007, Juniper Networks, Inc. + * 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. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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. + * + * $FreeBSD$ + */ + +#ifndef _DEV_CFI_VAR_H_ +#define _DEV_CFI_VAR_H_ + +struct cfi_region { + u_int r_blocks; + u_int r_blksz; +}; + +struct cfi_softc { + device_t sc_dev; + + struct resource *sc_res; + bus_space_handle_t sc_handle; + bus_space_tag_t sc_tag; + int sc_rid; + + u_int sc_size; /* Flash size. */ + u_int sc_width; /* Interface width. */ + u_int sc_regions; /* Erase regions. */ + struct cfi_region *sc_region; /* Array of region info. */ + + u_int sc_cmdset; + u_int sc_erase_timeout; + u_int sc_write_timeout; + + struct cdev *sc_nod; + struct proc *sc_opened; /* Process that has us opened. */ + + u_char *sc_wrbuf; + u_int sc_wrbufsz; + u_int sc_wrofs; + u_int sc_writing; +}; + +extern char cfi_driver_name[]; +extern devclass_t cfi_devclass; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 06:25:16 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 125F71065670; Sat, 25 Oct 2008 06:25:16 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBFD18FC1F; Sat, 25 Oct 2008 06:25:15 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9P6PFB2023541; Sat, 25 Oct 2008 06:25:15 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9P6PFA1023540; Sat, 25 Oct 2008 06:25:15 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200810250625.m9P6PFA1023540@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 25 Oct 2008 06:25: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: r184252 - head/sys/powerpc/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 06:25:16 -0000 Author: marcel Date: Sat Oct 25 06:25:15 2008 New Revision: 184252 URL: http://svn.freebsd.org/changeset/base/184252 Log: Enable the cfi(4) driver. Modified: head/sys/powerpc/conf/MPC85XX Modified: head/sys/powerpc/conf/MPC85XX ============================================================================== --- head/sys/powerpc/conf/MPC85XX Sat Oct 25 06:18:12 2008 (r184251) +++ head/sys/powerpc/conf/MPC85XX Sat Oct 25 06:25:15 2008 (r184252) @@ -50,6 +50,7 @@ options WITNESS_SKIPSPIN device ata device atadisk device bpf +device cfi device da device em device ether From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 06:39:17 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86F521065670; Sat, 25 Oct 2008 06:39:17 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75BD78FC0C; Sat, 25 Oct 2008 06:39:17 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9P6dH6Y023803; Sat, 25 Oct 2008 06:39:17 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9P6dHCd023802; Sat, 25 Oct 2008 06:39:17 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200810250639.m9P6dHCd023802@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 25 Oct 2008 06:39: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: r184253 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 06:39:17 -0000 Author: yongari Date: Sat Oct 25 06:39:17 2008 New Revision: 184253 URL: http://svn.freebsd.org/changeset/base/184253 Log: Use auto-negotiation for manual media type selection. This fixes establishment of 10/100Mbps link on Atheros AR8121(L1E). Modified: head/sys/dev/mii/atphy.c Modified: head/sys/dev/mii/atphy.c ============================================================================== --- head/sys/dev/mii/atphy.c Sat Oct 25 06:25:15 2008 (r184252) +++ head/sys/dev/mii/atphy.c Sat Oct 25 06:39:17 2008 (r184253) @@ -217,7 +217,8 @@ atphy_service(struct mii_softc *sc, stru /* * Reset the PHY so all changes take effect. */ - PHY_WRITE(sc, MII_BMCR, bmcr | BMCR_RESET); + PHY_WRITE(sc, MII_BMCR, bmcr | BMCR_RESET | BMCR_AUTOEN | + BMCR_STARTNEG); done: break; From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 08:31:21 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C76E1065674; Sat, 25 Oct 2008 08:31:21 +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 2ACD28FC23; Sat, 25 Oct 2008 08:31:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9P8VLra025749; Sat, 25 Oct 2008 08:31:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9P8VLD5025748; Sat, 25 Oct 2008 08:31:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810250831.m9P8VLD5025748@svn.freebsd.org> From: Alexander Motin Date: Sat, 25 Oct 2008 08:31: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: r184254 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 08:31:21 -0000 Author: mav Date: Sat Oct 25 08:31:20 2008 New Revision: 184254 URL: http://svn.freebsd.org/changeset/base/184254 Log: Fix spelling in comment. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Sat Oct 25 06:39:17 2008 (r184253) +++ head/sys/dev/sound/pci/hda/hdac.c Sat Oct 25 08:31:20 2008 (r184254) @@ -4513,7 +4513,7 @@ hdac_vendor_patch_parse(struct hdac_devi case HDA_CODEC_AD1981HD: /* * This codec has very unusual design with several - * points unappropriate for the present parser. + * points inappropriate for the present parser. */ /* Disable recording from mono playback mix. */ w = hdac_widget_get(devinfo, 21); From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 08:53:54 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B738106567E; Sat, 25 Oct 2008 08:53:54 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by mx1.freebsd.org (Postfix) with ESMTP id E04A08FC08; Sat, 25 Oct 2008 08:53:53 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 143D3182CEE; Sat, 25 Oct 2008 04:53:53 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 25 Oct 2008 04:53:53 -0400 X-Sasl-enc: A03HDCR5/cFf8rHDqN25LyeI2Sd4MBWW6jXdbUqN9j+p 1224924832 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id E2E2F193B; Sat, 25 Oct 2008 04:53:51 -0400 (EDT) Message-ID: <4902DE9E.2090004@FreeBSD.org> Date: Sat, 25 Oct 2008 09:53:50 +0100 From: "Bruce M. Simpson" User-Agent: Thunderbird 2.0.0.14 (X11/20080514) MIME-Version: 1.0 To: Marcel Moolenaar References: <200810250618.m9P6ICWl023370@svn.freebsd.org> In-Reply-To: <200810250618.m9P6ICWl023370@svn.freebsd.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184251 - in head/sys: conf dev/cfi sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 08:53:54 -0000 Thanks for bringing this code in. Hopefully it shouldn't be too hard to add MTD-like support on top, and/or port it to other parts. From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 10:55:50 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 153BB106566C; Sat, 25 Oct 2008 10:55:50 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03BA28FC0C; Sat, 25 Oct 2008 10:55:50 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PAtnhG030661; Sat, 25 Oct 2008 10:55:49 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PAtngN030660; Sat, 25 Oct 2008 10:55:49 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810251055.m9PAtngN030660@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 25 Oct 2008 10:55: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: r184258 - head/sys/dev/puc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 10:55:50 -0000 Author: des Date: Sat Oct 25 10:55:49 2008 New Revision: 184258 URL: http://svn.freebsd.org/changeset/base/184258 Log: Add an entry for the "SIIG Cyber 4 PCI 16550", which is a four-port card based on the OX16PCI954 chip with a non-standard clock. MFC after: 3 days Modified: head/sys/dev/puc/pucdata.c Modified: head/sys/dev/puc/pucdata.c ============================================================================== --- head/sys/dev/puc/pucdata.c Sat Oct 25 10:54:28 2008 (r184257) +++ head/sys/dev/puc/pucdata.c Sat Oct 25 10:55:49 2008 (r184258) @@ -596,6 +596,12 @@ const struct puc_cfg puc_pci_devices[] = * I/O Flex PCI I/O Card Model-223 with 4 serial and 1 parallel ports. */ + { 0x1415, 0x9501, 0x131f, 0x2050, + "SIIG Cyber 4 PCI 16550", + DEFAULT_RCLK * 10, + PUC_PORT_4S, 0x10, 0, 8, + }, + { 0x1415, 0x9501, 0x131f, 0x2051, "SIIG Cyber 4S PCI 16C650 (20x family)", DEFAULT_RCLK * 10, From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 16:29:28 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D436D106566B; Sat, 25 Oct 2008 16:29:28 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C22EA8FC17; Sat, 25 Oct 2008 16:29:28 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PGTS6X037247; Sat, 25 Oct 2008 16:29:28 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PGTSrj037246; Sat, 25 Oct 2008 16:29:28 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200810251629.m9PGTSrj037246@svn.freebsd.org> From: Robert Noland Date: Sat, 25 Oct 2008 16:29: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: r184263 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 16:29:29 -0000 Author: rnoland Date: Sat Oct 25 16:29:28 2008 New Revision: 184263 URL: http://svn.freebsd.org/changeset/base/184263 Log: drm/i915: fix ioremap of a user address for non-root (CVE-2008-3831) Olaf Kirch noticed that the i915_set_status_page() function of the i915 kernel driver calls ioremap with an address offset that is supplied by userspace via ioctl. The function zeroes the mapped memory via memset and tells the hardware about the address. Turns out that access to that ioctl is not restricted to root so users could probably exploit that to do nasty things. We haven't tried to write actual exploit code though. It only affects the Intel G33 series and newer. Approved by: bz (secteam) Obtained from: Intel drm repo Security: CVE-2008-3831 Modified: head/sys/dev/drm/i915_dma.c Modified: head/sys/dev/drm/i915_dma.c ============================================================================== --- head/sys/dev/drm/i915_dma.c Sat Oct 25 14:01:29 2008 (r184262) +++ head/sys/dev/drm/i915_dma.c Sat Oct 25 16:29:28 2008 (r184263) @@ -1228,7 +1228,7 @@ struct drm_ioctl_desc i915_ioctls[] = { DRM_IOCTL_DEF(DRM_I915_GET_VBLANK_PIPE, i915_vblank_pipe_get, DRM_AUTH ), DRM_IOCTL_DEF(DRM_I915_VBLANK_SWAP, i915_vblank_swap, DRM_AUTH), DRM_IOCTL_DEF(DRM_I915_MMIO, i915_mmio, DRM_AUTH), - DRM_IOCTL_DEF(DRM_I915_HWS_ADDR, i915_set_status_page, DRM_AUTH), + DRM_IOCTL_DEF(DRM_I915_HWS_ADDR, i915_set_status_page, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), #ifdef I915_HAVE_BUFFER DRM_IOCTL_DEF(DRM_I915_EXECBUFFER, i915_execbuffer, DRM_AUTH), #endif From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 17:21:46 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D729E1065670; Sat, 25 Oct 2008 17:21:46 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C592C8FC1E; Sat, 25 Oct 2008 17:21:46 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PHLkgx040568; Sat, 25 Oct 2008 17:21:46 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PHLkLx040567; Sat, 25 Oct 2008 17:21:46 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200810251721.m9PHLkLx040567@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 25 Oct 2008 17:21: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: r184264 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 17:21:47 -0000 Author: marcel Date: Sat Oct 25 17:21:46 2008 New Revision: 184264 URL: http://svn.freebsd.org/changeset/base/184264 Log: Invalid BSD disklabels have been created by sysinstall and are possibly still being created. The d_secperunit field contains the number of sectors of the disk and not of the slice/partition to which the disklabel applies. Rather than reject the disklabel, we now silently adjust the field. Existing code, like bslabel(8), does not seem to check the label that extensively and seems to adjust fields as a side-effect as well. In other words, it's not that important apparently, so gpart should not be too strict about it. Reported by: nyan@ Reported by: Andriy Gapon Modified: head/sys/geom/part/g_part_bsd.c Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Sat Oct 25 16:29:28 2008 (r184263) +++ head/sys/geom/part/g_part_bsd.c Sat Oct 25 17:21:46 2008 (r184264) @@ -341,8 +341,13 @@ g_part_bsd_read(struct g_part_table *bas printf("GEOM: %s: geometry does not match label.\n", pp->name); chs = le32dec(buf + 60); - if (chs < 1 || chs > msize) + if (chs < 1) goto invalid_label; + /* Fix-up a sysinstall bug. */ + if (chs > msize) { + chs = msize; + le32enc(buf + 60, msize); + } if (chs != msize) printf("GEOM: %s: media size does not match label.\n", pp->name); From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 18:45:40 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9316E106567A; Sat, 25 Oct 2008 18:45:40 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 813E28FC1C; Sat, 25 Oct 2008 18:45:40 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PIjeLE048005; Sat, 25 Oct 2008 18:45:40 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PIjesE048003; Sat, 25 Oct 2008 18:45:40 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200810251845.m9PIjesE048003@svn.freebsd.org> From: Ed Schouten Date: Sat, 25 Oct 2008 18:45: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: r184265 - head/etc/periodic/security X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 18:45:40 -0000 Author: ed Date: Sat Oct 25 18:45:40 2008 New Revision: 184265 URL: http://svn.freebsd.org/changeset/base/184265 Log: Sort `mount -p' output by name before checking for any differences. I noticed on a system at home that restarting named(8) causes the /var/named/dev mount to be moved to the bottom of the mount list, because it gets remounted. When I received the daily security email this morning, I was quite amazed to see that the security report listed the differences, while it was nothing out of the ordinary. If we just throw the `mount -p' output through sort(1), we'll only receive notifications about changes to mounts if something has really changed. Modified: head/etc/periodic/security/200.chkmounts Modified: head/etc/periodic/security/200.chkmounts ============================================================================== --- head/etc/periodic/security/200.chkmounts Sat Oct 25 17:21:46 2008 (r184264) +++ head/etc/periodic/security/200.chkmounts Sat Oct 25 18:45:40 2008 (r184265) @@ -50,7 +50,7 @@ case "$daily_status_security_chkmounts_e ignore="${ignore}|^amd:" esac [ -n "$ignore" ] && cmd="egrep -v ${ignore#|}" || cmd=cat - mount -p | ${cmd} | + mount -p | sort | ${cmd} | check_diff mount - "${host} changes in mounted filesystems:" rc=$?;; *) rc=0;; From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 19:39:28 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C61431065670; Sat, 25 Oct 2008 19:39:28 +0000 (UTC) (envelope-from ceri@submonkey.net) Received: from scuttle.submonkey.net (scuttle.submonkey.net [208.111.43.184]) by mx1.freebsd.org (Postfix) with ESMTP id A6E5F8FC20; Sat, 25 Oct 2008 19:39:28 +0000 (UTC) (envelope-from ceri@submonkey.net) Received: from cpc1-cdif1-0-0-cust63.cdif.cable.ntl.com ([81.104.164.64] helo=shrike.submonkey.net) by scuttle.submonkey.net with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1Ktod9-0004QJ-B4; Sat, 25 Oct 2008 19:16:59 +0000 Received: from ceri by shrike.submonkey.net with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1Ktod6-00004r-JT; Sat, 25 Oct 2008 20:16:56 +0100 Date: Sat, 25 Oct 2008 20:16:56 +0100 From: Ceri Davies To: Ed Schouten Message-ID: <20081025191656.GB5855@submonkey.net> References: <200810251845.m9PIjesE048003@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dc+cDN39EJAMEtIO" Content-Disposition: inline In-Reply-To: <200810251845.m9PIjesE048003@svn.freebsd.org> X-PGP: finger ceri@FreeBSD.org User-Agent: Mutt/1.5.18 (2008-05-17) Sender: Ceri Davies Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r184265 - head/etc/periodic/security X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 19:39:28 -0000 --dc+cDN39EJAMEtIO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 25, 2008 at 06:45:40PM +0000, Ed Schouten wrote: > Author: ed > Date: Sat Oct 25 18:45:40 2008 > New Revision: 184265 > URL: http://svn.freebsd.org/changeset/base/184265 >=20 > Log: > Sort `mount -p' output by name before checking for any differences. > =20 > I noticed on a system at home that restarting named(8) causes the > /var/named/dev mount to be moved to the bottom of the mount list, > because it gets remounted. When I received the daily security email this > morning, I was quite amazed to see that the security report listed the > differences, while it was nothing out of the ordinary. > =20 > If we just throw the `mount -p' output through sort(1), we'll only > receive notifications about changes to mounts if something has really > changed. Hmm. I've always found it useful to know that the mount list has changed, so that I can work out if I did anything to cause it to happen or not - if not, I have something to worry about. I want to see this every time. Ceri --=20 That must be wonderful! I don't understand it at all. -- Moliere --dc+cDN39EJAMEtIO Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFJA3CoocfcwTS3JF8RArkHAJ93S4n3ZezxUY97phIkJFTx9z6yAQCdH34J tVDsTo8Q9jdedIULoEf//GM= =lbRt -----END PGP SIGNATURE----- --dc+cDN39EJAMEtIO-- From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 19:43:07 2008 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 237AE106567D; Sat, 25 Oct 2008 19:43:07 +0000 (UTC) (envelope-from maxim@macomnet.ru) Received: from mp2.macomnet.net (cl-2958.ham-01.de.sixxs.net [IPv6:2001:6f8:900:b8d::2]) by mx1.freebsd.org (Postfix) with ESMTP id 94A658FC2F; Sat, 25 Oct 2008 19:43:06 +0000 (UTC) (envelope-from maxim@macomnet.ru) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.14.2/8.14.2) with ESMTP id m9PJh5rK021673; Sat, 25 Oct 2008 23:43:05 +0400 (MSD) (envelope-from maxim@macomnet.ru) Date: Sat, 25 Oct 2008 23:43:05 +0400 (MSD) From: Maxim Konovalov To: Ceri Davies In-Reply-To: <20081025191656.GB5855@submonkey.net> Message-ID: <20081025234159.G17979@mp2.macomnet.net> References: <200810251845.m9PIjesE048003@svn.freebsd.org> <20081025191656.GB5855@submonkey.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Ed Schouten Subject: Re: svn commit: r184265 - head/etc/periodic/security X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 19:43:07 -0000 On Sat, 25 Oct 2008, 20:16+0100, Ceri Davies wrote: > On Sat, Oct 25, 2008 at 06:45:40PM +0000, Ed Schouten wrote: > > Author: ed > > Date: Sat Oct 25 18:45:40 2008 > > New Revision: 184265 > > URL: http://svn.freebsd.org/changeset/base/184265 > > > > Log: > > Sort `mount -p' output by name before checking for any differences. > > > > I noticed on a system at home that restarting named(8) causes the > > /var/named/dev mount to be moved to the bottom of the mount list, > > because it gets remounted. When I received the daily security email this > > morning, I was quite amazed to see that the security report listed the > > differences, while it was nothing out of the ordinary. > > > > If we just throw the `mount -p' output through sort(1), we'll only > > receive notifications about changes to mounts if something has really > > changed. > > Hmm. I've always found it useful to know that the mount list has > changed, so that I can work out if I did anything to cause it to > happen or not - if not, I have something to worry about. I want to > see this every time. > Seconded. From the sysadmin point of view it's better to be on the safe side. -- Maxim Konovalov From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 20:42:10 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F018B1065671; Sat, 25 Oct 2008 20:42:10 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD94A8FC21; Sat, 25 Oct 2008 20:42:10 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PKgAPo052919; Sat, 25 Oct 2008 20:42:10 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PKgAbE052918; Sat, 25 Oct 2008 20:42:10 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200810252042.m9PKgAbE052918@svn.freebsd.org> From: Kip Macy Date: Sat, 25 Oct 2008 20:42: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: r184266 - head/sys/i386/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 20:42:11 -0000 Author: kmacy Date: Sat Oct 25 20:42:10 2008 New Revision: 184266 URL: http://svn.freebsd.org/changeset/base/184266 Log: only call hardclock on cpu0 pointed out by: Scott Long Modified: head/sys/i386/xen/clock.c Modified: head/sys/i386/xen/clock.c ============================================================================== --- head/sys/i386/xen/clock.c Sat Oct 25 18:45:40 2008 (r184265) +++ head/sys/i386/xen/clock.c Sat Oct 25 20:42:10 2008 (r184266) @@ -315,7 +315,10 @@ clkintr(void *arg) processed_system_time += (delta / NS_PER_TICK) * NS_PER_TICK; per_cpu(processed_system_time, cpu) += (delta_cpu / NS_PER_TICK) * NS_PER_TICK; } - hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); + if (PCPU_GET(cpuid) == 0) + hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); + else + hardclock_cpu(TRAPF_USERMODE(frame)); /* * Take synchronised time from Xen once a minute if we're not From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 23:23:41 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DA331065680; Sat, 25 Oct 2008 23:23:41 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C1EB8FC18; Sat, 25 Oct 2008 23:23:41 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PNNfvQ060028; Sat, 25 Oct 2008 23:23:41 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PNNfTh060025; Sat, 25 Oct 2008 23:23:41 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200810252323.m9PNNfTh060025@svn.freebsd.org> From: Sam Leffler Date: Sat, 25 Oct 2008 23:23:41 +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: r184268 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 23:23:41 -0000 Author: sam Date: Sat Oct 25 23:23:41 2008 New Revision: 184268 URL: http://svn.freebsd.org/changeset/base/184268 Log: add/improve debug msgs Modified: head/sys/net80211/ieee80211_adhoc.c head/sys/net80211/ieee80211_crypto.c head/sys/net80211/ieee80211_sta.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Sat Oct 25 21:42:43 2008 (r184267) +++ head/sys/net80211/ieee80211_adhoc.c Sat Oct 25 23:23:41 2008 (r184268) @@ -209,8 +209,8 @@ adhoc_newstate(struct ieee80211vap *vap, break; default: invalid: - IEEE80211_DPRINTF(vap, IEEE80211_MSG_ANY, - "%s: invalid state transition %s -> %s\n", __func__, + IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, + "%s: unexpected state transition %s -> %s\n", __func__, ieee80211_state_name[ostate], ieee80211_state_name[nstate]); break; } @@ -735,11 +735,16 @@ adhoc_recv_mgmt(struct ieee80211_node *n case IEEE80211_FC0_SUBTYPE_PROBE_REQ: if (vap->iv_state != IEEE80211_S_RUN) { + IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, + wh, NULL, "wrong state %s", + ieee80211_state_name[vap->iv_state]); vap->iv_stats.is_rx_mgtdiscard++; return; } if (IEEE80211_IS_MULTICAST(wh->i_addr2)) { /* frame must be directed */ + IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, + wh, NULL, "%s", "not unicast"); vap->iv_stats.is_rx_mgtdiscard++; /* XXX stat */ return; } @@ -798,6 +803,9 @@ adhoc_recv_mgmt(struct ieee80211_node *n const struct ieee80211_action *ia; if (vap->iv_state != IEEE80211_S_RUN) { + IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, + wh, NULL, "wrong state %s", + ieee80211_state_name[vap->iv_state]); vap->iv_stats.is_rx_mgtdiscard++; return; } @@ -857,6 +865,8 @@ adhoc_recv_mgmt(struct ieee80211_node *n case IEEE80211_FC0_SUBTYPE_REASSOC_RESP: case IEEE80211_FC0_SUBTYPE_DEAUTH: case IEEE80211_FC0_SUBTYPE_DISASSOC: + IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, + wh, NULL, "%s", "not handled"); vap->iv_stats.is_rx_mgtdiscard++; return; Modified: head/sys/net80211/ieee80211_crypto.c ============================================================================== --- head/sys/net80211/ieee80211_crypto.c Sat Oct 25 21:42:43 2008 (r184267) +++ head/sys/net80211/ieee80211_crypto.c Sat Oct 25 23:23:41 2008 (r184268) @@ -267,6 +267,10 @@ ieee80211_crypto_newkey(struct ieee80211 void *keyctx; int oflags; + IEEE80211_DPRINTF(vap, IEEE80211_MSG_CRYPTO, + "%s: cipher %u flags 0x%x keyix %u\n", + __func__, cipher, flags, key->wk_keyix); + /* * Validate cipher and set reference to cipher routines. */ Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Sat Oct 25 21:42:43 2008 (r184267) +++ head/sys/net80211/ieee80211_sta.c Sat Oct 25 23:23:41 2008 (r184268) @@ -406,8 +406,8 @@ sta_newstate(struct ieee80211vap *vap, e break; default: invalid: - IEEE80211_DPRINTF(vap, IEEE80211_MSG_ANY, - "%s: invalid state transition %s -> %s\n", __func__, + IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, + "%s: unexpected state transition %s -> %s\n", __func__, ieee80211_state_name[ostate], ieee80211_state_name[nstate]); break; } From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 23:24:49 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C1E6106567E; Sat, 25 Oct 2008 23:24:49 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B5ED8FC16; Sat, 25 Oct 2008 23:24:49 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PNOnI8060081; Sat, 25 Oct 2008 23:24:49 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PNOnvY060080; Sat, 25 Oct 2008 23:24:49 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200810252324.m9PNOnvY060080@svn.freebsd.org> From: Sam Leffler Date: Sat, 25 Oct 2008 23:24: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: r184269 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 23:24:49 -0000 Author: sam Date: Sat Oct 25 23:24:49 2008 New Revision: 184269 URL: http://svn.freebsd.org/changeset/base/184269 Log: add 1/2 and 1/4 channel flags to IEEE80211_CHAN_ALL so that operations like ieee80211_find_channel are more useful Modified: head/sys/net80211/_ieee80211.h Modified: head/sys/net80211/_ieee80211.h ============================================================================== --- head/sys/net80211/_ieee80211.h Sat Oct 25 23:23:41 2008 (r184268) +++ head/sys/net80211/_ieee80211.h Sat Oct 25 23:24:49 2008 (r184269) @@ -192,6 +192,7 @@ struct ieee80211_channel { #define IEEE80211_CHAN_ALL \ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_GFSK | \ IEEE80211_CHAN_CCK | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_DYN | \ + IEEE80211_CHAN_HALF | IEEE80211_CHAN_QUARTER | \ IEEE80211_CHAN_HT) #define IEEE80211_CHAN_ALLTURBO \ (IEEE80211_CHAN_ALL | IEEE80211_CHAN_TURBO | IEEE80211_CHAN_STURBO) From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 23:26:58 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03A781065671; Sat, 25 Oct 2008 23:26:58 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E73058FC1B; Sat, 25 Oct 2008 23:26:57 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PNQvC8060151; Sat, 25 Oct 2008 23:26:57 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PNQvtw060150; Sat, 25 Oct 2008 23:26:57 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200810252326.m9PNQvtw060150@svn.freebsd.org> From: Sam Leffler Date: Sat, 25 Oct 2008 23:26:57 +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: r184270 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 23:26:58 -0000 Author: sam Date: Sat Oct 25 23:26:57 2008 New Revision: 184270 URL: http://svn.freebsd.org/changeset/base/184270 Log: ignore IEEE80211_ELEMID_PWRCNSTR when parsing beacon/probe response frames to avoid counting it as an unknown elemid (we often beacon this so it shows up as a "false positive") Modified: head/sys/net80211/ieee80211_input.c Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Sat Oct 25 23:24:49 2008 (r184269) +++ head/sys/net80211/ieee80211_input.c Sat Oct 25 23:26:57 2008 (r184270) @@ -603,6 +603,7 @@ ieee80211_parse_beacon(struct ieee80211_ break; case IEEE80211_ELEMID_IBSSPARMS: case IEEE80211_ELEMID_CFPARMS: + case IEEE80211_ELEMID_PWRCNSTR: /* NB: avoid debugging complaints */ break; case IEEE80211_ELEMID_XRATES: From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 23:28:04 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB5B2106567A; Sat, 25 Oct 2008 23:28:04 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AA768FC14; Sat, 25 Oct 2008 23:28:04 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PNS400060206; Sat, 25 Oct 2008 23:28:04 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PNS4n4060205; Sat, 25 Oct 2008 23:28:04 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200810252328.m9PNS4n4060205@svn.freebsd.org> From: Sam Leffler Date: Sat, 25 Oct 2008 23:28:04 +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: r184271 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 23:28:04 -0000 Author: sam Date: Sat Oct 25 23:28:04 2008 New Revision: 184271 URL: http://svn.freebsd.org/changeset/base/184271 Log: fix associd check for adhoc mode Reviewed by: jhay Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Sat Oct 25 23:26:57 2008 (r184270) +++ head/sys/net80211/ieee80211_output.c Sat Oct 25 23:28:04 2008 (r184271) @@ -203,24 +203,19 @@ ieee80211_start(struct ifnet *ifp) continue; } /* XXX AUTH'd */ - if (ni->ni_associd == 0) { - /* - * Destination is not associated; must special - * case DWDS where we point iv_bss at the node - * for the associated station. - * XXX adhoc mode? - */ - if (ni != vap->iv_bss || IS_DWDS(vap)) { - IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_OUTPUT, - eh->ether_dhost, NULL, - "sta not associated (type 0x%04x)", - htons(eh->ether_type)); - vap->iv_stats.is_tx_notassoc++; - ifp->if_oerrors++; - m_freem(m); - ieee80211_free_node(ni); - continue; - } + /* XXX mark vap to identify if associd is required */ + if (ni->ni_associd == 0 && + (vap->iv_opmode == IEEE80211_M_STA || + vap->iv_opmode == IEEE80211_M_HOSTAP || IS_DWDS(vap))) { + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_OUTPUT, + eh->ether_dhost, NULL, + "sta not associated (type 0x%04x)", + htons(eh->ether_type)); + vap->iv_stats.is_tx_notassoc++; + ifp->if_oerrors++; + m_freem(m); + ieee80211_free_node(ni); + continue; } if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) && (m->m_flags & M_PWR_SAV) == 0) { From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 23:28:25 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 180D71065680; Sat, 25 Oct 2008 23:28:25 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 070DD8FC2C; Sat, 25 Oct 2008 23:28:25 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PNSOHm060250; Sat, 25 Oct 2008 23:28:24 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PNSOPI060249; Sat, 25 Oct 2008 23:28:24 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200810252328.m9PNSOPI060249@svn.freebsd.org> From: Sam Leffler Date: Sat, 25 Oct 2008 23:28: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: r184272 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 23:28:25 -0000 Author: sam Date: Sat Oct 25 23:28:24 2008 New Revision: 184272 URL: http://svn.freebsd.org/changeset/base/184272 Log: add debug msgs Modified: head/sys/net80211/ieee80211_regdomain.c Modified: head/sys/net80211/ieee80211_regdomain.c ============================================================================== --- head/sys/net80211/ieee80211_regdomain.c Sat Oct 25 23:28:04 2008 (r184271) +++ head/sys/net80211/ieee80211_regdomain.c Sat Oct 25 23:28:24 2008 (r184272) @@ -327,12 +327,23 @@ ieee80211_setregdomain(struct ieee80211v int error, i; if (reg->rd.location != 'I' && reg->rd.location != 'O' && - reg->rd.location != ' ') + reg->rd.location != ' ') { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_IOCTL, + "%s: invalid location 0x%x\n", __func__, reg->rd.location); return EINVAL; - if (reg->rd.isocc[0] == '\0' || reg->rd.isocc[1] == '\0') + } + if (reg->rd.isocc[0] == '\0' || reg->rd.isocc[1] == '\0') { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_IOCTL, + "%s: invalid iso cc 0x%x:0x%x\n", __func__, + reg->rd.isocc[0], reg->rd.isocc[1]); return EINVAL; - if (reg->chaninfo.ic_nchans >= IEEE80211_CHAN_MAX) + } + if (reg->chaninfo.ic_nchans >= IEEE80211_CHAN_MAX) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_IOCTL, + "%s: too many channels %u, max %u\n", __func__, + reg->chaninfo.ic_nchans, IEEE80211_CHAN_MAX); return EINVAL; + } /* * Calculate freq<->IEEE mapping and default max tx power * for channels not setup. The driver can override these @@ -340,10 +351,18 @@ ieee80211_setregdomain(struct ieee80211v */ for (i = 0; i < reg->chaninfo.ic_nchans; i++) { c = ®->chaninfo.ic_chans[i]; - if (c->ic_freq == 0 || c->ic_flags == 0) + if (c->ic_freq == 0 || c->ic_flags == 0) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_IOCTL, + "%s: invalid channel spec at [%u]\n", __func__, i); return EINVAL; - if (c->ic_maxregpower == 0) + } + if (c->ic_maxregpower == 0) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_IOCTL, + "%s: invalid channel spec, zero maxregpower, " + "freq %u flags 0x%x\n", __func__, + c->ic_freq, c->ic_flags); return EINVAL; + } if (c->ic_ieee == 0) c->ic_ieee = ieee80211_mhz2ieee(c->ic_freq,c->ic_flags); if (IEEE80211_IS_CHAN_HT40(c) && c->ic_extieee == 0) @@ -358,11 +377,15 @@ ieee80211_setregdomain(struct ieee80211v reg->chaninfo.ic_nchans, reg->chaninfo.ic_chans); if (error != 0) { IEEE80211_UNLOCK(ic); + IEEE80211_DPRINTF(vap, IEEE80211_MSG_IOCTL, + "%s: driver rejected request, error %u\n", __func__, error); return error; } /* XXX bandaid; a running vap will likely crash */ if (!allvapsdown(ic)) { IEEE80211_UNLOCK(ic); + IEEE80211_DPRINTF(vap, IEEE80211_MSG_IOCTL, + "%s: reject: vaps are running\n", __func__); return EBUSY; } /* From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 23:31:20 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1A661065674; Sat, 25 Oct 2008 23:31:20 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A076D8FC08; Sat, 25 Oct 2008 23:31:20 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PNVKnx060339; Sat, 25 Oct 2008 23:31:20 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PNVK8Z060338; Sat, 25 Oct 2008 23:31:20 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200810252331.m9PNVK8Z060338@svn.freebsd.org> From: Sam Leffler Date: Sat, 25 Oct 2008 23:31: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: r184273 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 23:31:20 -0000 Author: sam Date: Sat Oct 25 23:31:20 2008 New Revision: 184273 URL: http://svn.freebsd.org/changeset/base/184273 Log: o add support for ifconfig wlanX mode foo o yank useless code for setting fixed rate through media opts: this mechanism didn't scale to HT rates and couldn't handle multiple bands; fixed tx rates are set with the IEEE80211_IOC_TXPARAMS ioctl Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Sat Oct 25 23:28:24 2008 (r184272) +++ head/sys/net80211/ieee80211.c Sat Oct 25 23:31:20 2008 (r184273) @@ -1065,8 +1065,7 @@ ieee80211_announce_channels(struct ieee8 } static int -media2mode(const struct ieee80211com *ic, - const struct ifmedia_entry *ime, enum ieee80211_phymode *mode) +media2mode(const struct ifmedia_entry *ime, uint32_t flags, uint16_t *mode) { switch (IFM_MODE(ime->ifm_media)) { case IFM_IEEE80211_11A: @@ -1099,7 +1098,7 @@ media2mode(const struct ieee80211com *ic */ if (ime->ifm_media & IFM_IEEE80211_TURBO) { if (*mode == IEEE80211_MODE_11A) { - if (ic->ic_flags & IEEE80211_F_TURBOP) + if (flags & IEEE80211_F_TURBOP) *mode = IEEE80211_MODE_TURBO_A; else *mode = IEEE80211_MODE_STURBO_A; @@ -1113,51 +1112,12 @@ media2mode(const struct ieee80211com *ic } /* - * Handle a media change request on the underlying - * interface; we accept mode changes only. + * Handle a media change request on the underlying interface. */ int ieee80211com_media_change(struct ifnet *ifp) { - struct ieee80211com *ic = ifp->if_l2com; - struct ifmedia_entry *ime = ic->ic_media.ifm_cur; - enum ieee80211_phymode newphymode; - int error = 0; - - /* - * First, identify the phy mode. - */ - if (!media2mode(ic, ime, &newphymode)) - return EINVAL; - /* NB: mode must be supported, no need to check */ - - /* - * Handle phy mode change. - */ - IEEE80211_LOCK(ic); - if (ic->ic_curmode != newphymode) { /* change phy mode */ - struct ieee80211vap *vap; - - (void) ieee80211_setmode(ic, newphymode); - /* - * Propagate new state to each vap. - */ - TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { - } - } - IEEE80211_UNLOCK(ic); - return error; -} - -static int -findrate(const struct ieee80211com *ic, enum ieee80211_phymode m, int r) -{ - int i, nrates; - - for (i = 0, nrates = ic->ic_sup_rates[m].rs_nrates; i < nrates; i++) - if ((ic->ic_sup_rates[m].rs_rates[i] & IEEE80211_RATE_VAL) == r) - return i; - return -1; + return EINVAL; } /* @@ -1168,26 +1128,12 @@ ieee80211_media_change(struct ifnet *ifp { struct ieee80211vap *vap = ifp->if_softc; struct ifmedia_entry *ime = vap->iv_media.ifm_cur; - struct ieee80211com *ic = vap->iv_ic; - int newrate; + uint16_t newmode; - /* XXX this won't work unless ic_curmode is != IEEE80211_MODE_AUTO */ - if (ic->ic_curmode == IEEE80211_MODE_AUTO) + if (!media2mode(ime, vap->iv_flags, &newmode)) return EINVAL; - if (IFM_SUBTYPE(ime->ifm_media) != IFM_AUTO) { - /* - * NB: this can only be used to specify a legacy rate. - */ - newrate = ieee80211_media2rate(ime->ifm_media); - if (newrate == 0) - return EINVAL; - if (findrate(ic, ic->ic_curmode, newrate) == -1) - return EINVAL; - } else { - newrate = IEEE80211_FIXED_RATE_NONE; - } - if (newrate != vap->iv_txparms[ic->ic_curmode].ucastrate) { - vap->iv_txparms[ic->ic_curmode].ucastrate = newrate; + if (vap->iv_des_mode != newmode) { + vap->iv_des_mode = newmode; return ENETRESET; } return 0; From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 23:32:24 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C40E5106566B; Sat, 25 Oct 2008 23:32:24 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B29B98FC0C; Sat, 25 Oct 2008 23:32:24 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PNWOOI060395; Sat, 25 Oct 2008 23:32:24 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PNWO6D060391; Sat, 25 Oct 2008 23:32:24 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200810252332.m9PNWO6D060391@svn.freebsd.org> From: Sam Leffler Date: Sat, 25 Oct 2008 23:32: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: r184274 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 23:32:25 -0000 Author: sam Date: Sat Oct 25 23:32:24 2008 New Revision: 184274 URL: http://svn.freebsd.org/changeset/base/184274 Log: change ieee80211_sta_join to take an explicit channel instead of using the value in the scan parameters; this will be used to fix issues with 11b operation Modified: head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_node.c head/sys/net80211/ieee80211_node.h head/sys/net80211/ieee80211_scan_sta.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Sat Oct 25 23:31:20 2008 (r184273) +++ head/sys/net80211/ieee80211_ioctl.c Sat Oct 25 23:32:24 2008 (r184274) @@ -1463,7 +1463,7 @@ setmlme_assoc(struct ieee80211vap *vap, if (lookup.se == NULL) return ENOENT; mlmedebug(vap, mac, IEEE80211_MLME_ASSOC, 0); - if (!ieee80211_sta_join(vap, lookup.se)) + if (!ieee80211_sta_join(vap, lookup.se->se_chan, lookup.se)) return EIO; /* XXX unique but could be better */ return 0; } Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Sat Oct 25 23:31:20 2008 (r184273) +++ head/sys/net80211/ieee80211_node.c Sat Oct 25 23:32:24 2008 (r184274) @@ -687,7 +687,7 @@ ieee80211_sta_join1(struct ieee80211_nod } int -ieee80211_sta_join(struct ieee80211vap *vap, +ieee80211_sta_join(struct ieee80211vap *vap, struct ieee80211_channel *chan, const struct ieee80211_scan_entry *se) { struct ieee80211com *ic = vap->iv_ic; @@ -709,7 +709,7 @@ ieee80211_sta_join(struct ieee80211vap * ni->ni_tstamp.tsf = se->se_tstamp.tsf; ni->ni_intval = se->se_intval; ni->ni_capinfo = se->se_capinfo; - ni->ni_chan = se->se_chan; + ni->ni_chan = chan; ni->ni_timoff = se->se_timoff; ni->ni_fhdwell = se->se_fhdwell; ni->ni_fhindex = se->se_fhindex; Modified: head/sys/net80211/ieee80211_node.h ============================================================================== --- head/sys/net80211/ieee80211_node.h Sat Oct 25 23:31:20 2008 (r184273) +++ head/sys/net80211/ieee80211_node.h Sat Oct 25 23:32:24 2008 (r184274) @@ -282,7 +282,7 @@ void ieee80211_sync_curchan(struct ieee8 void ieee80211_setcurchan(struct ieee80211com *, struct ieee80211_channel *); int ieee80211_ibss_merge(struct ieee80211_node *); struct ieee80211_scan_entry; -int ieee80211_sta_join(struct ieee80211vap *, +int ieee80211_sta_join(struct ieee80211vap *, struct ieee80211_channel *, const struct ieee80211_scan_entry *); void ieee80211_sta_leave(struct ieee80211_node *); void ieee80211_node_deauth(struct ieee80211_node *, int); Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Sat Oct 25 23:31:20 2008 (r184273) +++ head/sys/net80211/ieee80211_scan_sta.c Sat Oct 25 23:32:24 2008 (r184274) @@ -1014,6 +1014,7 @@ sta_pick_bss(struct ieee80211_scan_state { struct sta_table *st = ss->ss_priv; struct sta_entry *selbs; + struct ieee80211_channel *chan; KASSERT(vap->iv_opmode == IEEE80211_M_STA, ("wrong mode %u", vap->iv_opmode)); @@ -1056,7 +1057,10 @@ notfound: selbs = select_bss(ss, vap, IEEE80211_MSG_SCAN); if (ss->ss_flags & IEEE80211_SCAN_NOJOIN) return (selbs != NULL); - if (selbs == NULL || !ieee80211_sta_join(vap, &selbs->base)) + if (selbs == NULL) + goto notfound; + chan = selbs->base.se_chan; + if (!ieee80211_sta_join(vap, chan, &selbs->base)) goto notfound; return 1; /* terminate scan */ } @@ -1138,12 +1142,16 @@ sta_roam_check(struct ieee80211_scan_sta se->base.se_rssi = curRssi; selbs = select_bss(ss, vap, IEEE80211_MSG_ROAM); if (selbs != NULL && selbs != se) { + struct ieee80211_channel *chan; + IEEE80211_DPRINTF(vap, IEEE80211_MSG_ROAM | IEEE80211_MSG_DEBUG, "%s: ROAM: curRate %u, roamRate %u, " "curRssi %d, roamRssi %d\n", __func__, curRate, roamRate, curRssi, roamRssi); - ieee80211_sta_join(vap, &selbs->base); + + chan = selbs->base.se_chan; + (void) ieee80211_sta_join(vap, chan, &selbs->base); } } } @@ -1419,7 +1427,10 @@ notfound: selbs = select_bss(ss, vap, IEEE80211_MSG_SCAN); if (ss->ss_flags & IEEE80211_SCAN_NOJOIN) return (selbs != NULL); - if (selbs == NULL || !ieee80211_sta_join(vap, &selbs->base)) + if (selbs == NULL) + goto notfound; + chan = selbs->base.se_chan; + if (!ieee80211_sta_join(vap, chan, &selbs->base)) goto notfound; return 1; /* terminate scan */ } From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 23:39:19 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 170991065671; Sat, 25 Oct 2008 23:39:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0641F8FC1C; Sat, 25 Oct 2008 23:39:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PNdILL060548; Sat, 25 Oct 2008 23:39:18 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PNdIxI060547; Sat, 25 Oct 2008 23:39:18 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200810252339.m9PNdIxI060547@svn.freebsd.org> From: Sam Leffler Date: Sat, 25 Oct 2008 23:39: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: r184275 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 23:39:19 -0000 Author: sam Date: Sat Oct 25 23:39:18 2008 New Revision: 184275 URL: http://svn.freebsd.org/changeset/base/184275 Log: expand captured ie's before calling match_bss so they can potentially be used in the process Modified: head/sys/net80211/ieee80211_scan_sta.c Modified: head/sys/net80211/ieee80211_scan_sta.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sta.c Sat Oct 25 23:32:24 2008 (r184274) +++ head/sys/net80211/ieee80211_scan_sta.c Sat Oct 25 23:39:18 2008 (r184275) @@ -992,8 +992,8 @@ select_bss(struct ieee80211_scan_state * "macaddr bssid chan rssi rate flag wep essid"); mtx_lock(&st->st_lock); TAILQ_FOREACH(se, &st->st_entry, se_list) { + ieee80211_ies_expand(&se->base.se_ies); if (match_bss(vap, ss, se, debug) == 0) { - ieee80211_ies_expand(&se->base.se_ies); if (selbs == NULL) selbs = se; else if (sta_compare(se, selbs) > 0) From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 23:40:29 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6865B106566C; Sat, 25 Oct 2008 23:40:29 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57CBB8FC12; Sat, 25 Oct 2008 23:40:29 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PNeTZm060606; Sat, 25 Oct 2008 23:40:29 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PNeTNd060605; Sat, 25 Oct 2008 23:40:29 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200810252340.m9PNeTNd060605@svn.freebsd.org> From: Sam Leffler Date: Sat, 25 Oct 2008 23:40: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: r184276 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 23:40:29 -0000 Author: sam Date: Sat Oct 25 23:40:29 2008 New Revision: 184276 URL: http://svn.freebsd.org/changeset/base/184276 Log: use a private mgt frame recv handler for ahdemo mode instead of an inline test in the adhoc mode rx path so classes derived from ahdemo mode can override the default behaviour Modified: head/sys/net80211/ieee80211_adhoc.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Sat Oct 25 23:39:18 2008 (r184275) +++ head/sys/net80211/ieee80211_adhoc.c Sat Oct 25 23:40:29 2008 (r184276) @@ -66,6 +66,8 @@ static int adhoc_input(struct ieee80211_ int rssi, int noise, uint32_t rstamp); static void adhoc_recv_mgmt(struct ieee80211_node *, struct mbuf *, int subtype, int rssi, int noise, uint32_t rstamp); +static void ahdemo_recv_mgmt(struct ieee80211_node *, struct mbuf *, + int subtype, int rssi, int noise, uint32_t rstamp); void ieee80211_adhoc_attach(struct ieee80211com *ic) @@ -89,7 +91,10 @@ adhoc_vattach(struct ieee80211vap *vap) { vap->iv_newstate = adhoc_newstate; vap->iv_input = adhoc_input; - vap->iv_recv_mgmt = adhoc_recv_mgmt; + if (vap->iv_opmode == IEEE80211_M_IBSS) + vap->iv_recv_mgmt = adhoc_recv_mgmt; + else + vap->iv_recv_mgmt = ahdemo_recv_mgmt; vap->iv_opdetach = adhoc_vdetach; } @@ -609,9 +614,7 @@ adhoc_input(struct ieee80211_node *ni, s } if (bpf_peers_present(vap->iv_rawbpf)) bpf_mtap(vap->iv_rawbpf, m); - /* NB: only IBSS mode gets mgt frames */ - if (vap->iv_opmode == IEEE80211_M_IBSS) - vap->iv_recv_mgmt(ni, m, subtype, rssi, noise, rstamp); + vap->iv_recv_mgmt(ni, m, subtype, rssi, noise, rstamp); m_freem(m); return IEEE80211_FC0_TYPE_MGT; @@ -879,3 +882,20 @@ adhoc_recv_mgmt(struct ieee80211_node *n } #undef IEEE80211_VERIFY_LENGTH #undef IEEE80211_VERIFY_ELEMENT + +static void +ahdemo_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, + int subtype, int rssi, int noise, uint32_t rstamp) +{ + struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211com *ic = ni->ni_ic; + + /* + * Process management frames when scanning; useful for doing + * a site-survey. + */ + if (ic->ic_flags & IEEE80211_F_SCAN) + adhoc_recv_mgmt(ni, m0, subtype, rssi, noise, rstamp); + else + vap->iv_stats.is_rx_mgtdiscard++; +} From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 23:40:48 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A76AE1065676; Sat, 25 Oct 2008 23:40:48 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DD298FC1C; Sat, 25 Oct 2008 23:40:48 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PNem7a060644; Sat, 25 Oct 2008 23:40:48 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PNemSH060643; Sat, 25 Oct 2008 23:40:48 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200810252340.m9PNemSH060643@svn.freebsd.org> From: Sam Leffler Date: Sat, 25 Oct 2008 23:40: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: r184277 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 23:40:48 -0000 Author: sam Date: Sat Oct 25 23:40:48 2008 New Revision: 184277 URL: http://svn.freebsd.org/changeset/base/184277 Log: improve inactivity handling debug support Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Sat Oct 25 23:40:29 2008 (r184276) +++ head/sys/net80211/ieee80211_node.c Sat Oct 25 23:40:48 2008 (r184277) @@ -135,6 +135,11 @@ ieee80211_node_vattach(struct ieee80211v vap->iv_inact_auth = IEEE80211_INACT_AUTH; vap->iv_inact_run = IEEE80211_INACT_RUN; vap->iv_inact_probe = IEEE80211_INACT_PROBE; + + IEEE80211_DPRINTF(vap, IEEE80211_MSG_INACT, + "%s: init %u auth %u run %u probe %u\n", __func__, + vap->iv_inact_init, vap->iv_inact_auth, + vap->iv_inact_run, vap->iv_inact_probe); } void @@ -187,18 +192,29 @@ ieee80211_node_vdetach(struct ieee80211v void ieee80211_node_authorize(struct ieee80211_node *ni) { + struct ieee80211vap *vap = ni->ni_vap; + ni->ni_flags |= IEEE80211_NODE_AUTH; - ni->ni_inact_reload = ni->ni_vap->iv_inact_run; + ni->ni_inact_reload = vap->iv_inact_run; ni->ni_inact = ni->ni_inact_reload; + + IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni, + "%s: inact_reload %u", __func__, ni->ni_inact_reload); } void ieee80211_node_unauthorize(struct ieee80211_node *ni) { + struct ieee80211vap *vap = ni->ni_vap; + ni->ni_flags &= ~IEEE80211_NODE_AUTH; - ni->ni_inact_reload = ni->ni_vap->iv_inact_auth; + ni->ni_inact_reload = vap->iv_inact_auth; if (ni->ni_inact > ni->ni_inact_reload) ni->ni_inact = ni->ni_inact_reload; + + IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni, + "%s: inact_reload %u inact %u", __func__, + ni->ni_inact_reload, ni->ni_inact); } /* @@ -1023,6 +1039,9 @@ ieee80211_alloc_node(struct ieee80211_no ni->ni_ic = ic; IEEE80211_NODE_UNLOCK(nt); + IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni, + "%s: inact_reload %u", __func__, ni->ni_inact_reload); + return ni; } @@ -1903,8 +1922,13 @@ restart: m_freem(ni->ni_rxfrag[0]); ni->ni_rxfrag[0] = NULL; } - if (ni->ni_inact > 0) + if (ni->ni_inact > 0) { ni->ni_inact--; + IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni, + "%s: inact %u inact_reload %u nrates %u", + __func__, ni->ni_inact, ni->ni_inact_reload, + ni->ni_rates.rs_nrates); + } /* * Special case ourself; we may be idle for extended periods * of time and regardless reclaiming our state is wrong. @@ -2119,8 +2143,8 @@ ieee80211_dump_node(struct ieee80211_nod ether_sprintf(ni->ni_bssid), ni->ni_esslen, ni->ni_essid, ni->ni_chan->ic_freq, ni->ni_chan->ic_flags); - printf("\tinact %u txrate %u\n", - ni->ni_inact, ni->ni_txrate); + printf("\tinact %u inact_reload %u txrate %u\n", + ni->ni_inact, ni->ni_inact_reload, ni->ni_txrate); printf("\thtcap %x htparam %x htctlchan %u ht2ndchan %u\n", ni->ni_htcap, ni->ni_htparam, ni->ni_htctlchan, ni->ni_ht2ndchan); From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 23:43:08 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B865C1065681; Sat, 25 Oct 2008 23:43:08 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A79D58FC0A; Sat, 25 Oct 2008 23:43:08 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PNh88F060716; Sat, 25 Oct 2008 23:43:08 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PNh8gu060715; Sat, 25 Oct 2008 23:43:08 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200810252343.m9PNh8gu060715@svn.freebsd.org> From: Sam Leffler Date: Sat, 25 Oct 2008 23:43:08 +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: r184278 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 23:43:08 -0000 Author: sam Date: Sat Oct 25 23:43:08 2008 New Revision: 184278 URL: http://svn.freebsd.org/changeset/base/184278 Log: honor IEEE80211_CLONE_NOBEACONS for type of vap, not just a sta mode vap Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Sat Oct 25 23:40:48 2008 (r184277) +++ head/sys/net80211/ieee80211.c Sat Oct 25 23:43:08 2008 (r184278) @@ -350,11 +350,6 @@ ieee80211_vap_setup(struct ieee80211com vap->iv_opmode = opmode; vap->iv_caps |= ieee80211_opcap[opmode]; switch (opmode) { - case IEEE80211_M_STA: - /* auto-enable s/w beacon miss support */ - if (flags & IEEE80211_CLONE_NOBEACONS) - vap->iv_flags_ext |= IEEE80211_FEXT_SWBMISS; - break; case IEEE80211_M_WDS: /* * WDS links must specify the bssid of the far end. @@ -370,6 +365,9 @@ ieee80211_vap_setup(struct ieee80211com vap->iv_flags_ext |= IEEE80211_FEXT_WDSLEGACY; break; } + /* auto-enable s/w beacon miss support */ + if (flags & IEEE80211_CLONE_NOBEACONS) + vap->iv_flags_ext |= IEEE80211_FEXT_SWBMISS; /* * Enable various functionality by default if we're * capable; the driver can override us if it knows better. From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 23:44:25 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 704FB106566C; Sat, 25 Oct 2008 23:44:25 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FC568FC12; Sat, 25 Oct 2008 23:44:25 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PNiPqN060790; Sat, 25 Oct 2008 23:44:25 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PNiPod060789; Sat, 25 Oct 2008 23:44:25 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200810252344.m9PNiPod060789@svn.freebsd.org> From: Sam Leffler Date: Sat, 25 Oct 2008 23:44: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: r184279 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 23:44:25 -0000 Author: sam Date: Sat Oct 25 23:44:25 2008 New Revision: 184279 URL: http://svn.freebsd.org/changeset/base/184279 Log: set erp flag and tx parameter state when joining a bss; this allows drivers to use ni_txparms Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Sat Oct 25 23:43:08 2008 (r184278) +++ head/sys/net80211/ieee80211_node.c Sat Oct 25 23:44:25 2008 (r184279) @@ -749,6 +749,9 @@ ieee80211_sta_join(struct ieee80211vap * /* NB: must be after ni_chan is setup */ ieee80211_setup_rates(ni, se->se_rates, se->se_xrates, IEEE80211_F_DOSORT); + if (ieee80211_iserp_rateset(&ni->ni_rates)) + ni->ni_flags |= IEEE80211_NODE_ERP; + node_setuptxparms(ni); return ieee80211_sta_join1(ieee80211_ref_node(ni)); } From owner-svn-src-head@FreeBSD.ORG Sat Oct 25 23:59:00 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 549E91065681; Sat, 25 Oct 2008 23:59:00 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42FE98FC17; Sat, 25 Oct 2008 23:59:00 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9PNx0FK061054; Sat, 25 Oct 2008 23:59:00 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9PNx0Es061051; Sat, 25 Oct 2008 23:59:00 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200810252359.m9PNx0Es061051@svn.freebsd.org> From: Sam Leffler Date: Sat, 25 Oct 2008 23:59: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: r184280 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 23:59:00 -0000 Author: sam Date: Sat Oct 25 23:58:59 2008 New Revision: 184280 URL: http://svn.freebsd.org/changeset/base/184280 Log: Sync BAR frame handling with out of tree work: o correct BAR frame construction for AMPDU o retransmit BAR frames until ACK'd or timeout (use tunables to control behaviour, default is very aggressive) o defer seq# update until BAR frame is ACK'd o add BAR response handling callback for driver to interpose and push new state to device or push pending aggregates While here also: o add backpointer to node in the per-tid tx aggregation data structure o move ampdu tx state setup/teardown work to separate functions Modified: head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_ht.h head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Sat Oct 25 23:44:25 2008 (r184279) +++ head/sys/net80211/ieee80211_ht.c Sat Oct 25 23:58:59 2008 (r184280) @@ -86,6 +86,8 @@ int ieee80211_recv_bar_ena = 1; int ieee80211_addba_timeout = -1; /* timeout waiting for ADDBA response */ int ieee80211_addba_backoff = -1; /* backoff after max ADDBA requests */ int ieee80211_addba_maxtries = 3; /* max ADDBA requests before backoff */ +int ieee80211_bar_timeout = -1; /* timeout waiting for BAR response */ +int ieee80211_bar_maxtries = 50; /* max BAR requests before DELBA */ /* * Setup HT parameters that depends on the clock frequency. @@ -98,6 +100,7 @@ ieee80211_ht_setup(void) #endif ieee80211_addba_timeout = msecs_to_ticks(250); ieee80211_addba_backoff = msecs_to_ticks(10*1000); + ieee80211_bar_timeout = msecs_to_ticks(250); } SYSINIT(wlan_ht, SI_SUB_DRIVERS, SI_ORDER_FIRST, ieee80211_ht_setup, NULL); @@ -113,6 +116,10 @@ static void ieee80211_addba_stop(struct struct ieee80211_tx_ampdu *tap); static void ieee80211_aggr_recv_action(struct ieee80211_node *ni, const uint8_t *frm, const uint8_t *efrm); +static void ieee80211_bar_response(struct ieee80211_node *ni, + struct ieee80211_tx_ampdu *tap, int status); +static void ampdu_tx_stop(struct ieee80211_tx_ampdu *tap); +static void bar_stop_timer(struct ieee80211_tx_ampdu *tap); void ieee80211_ht_attach(struct ieee80211com *ic) @@ -124,6 +131,7 @@ ieee80211_ht_attach(struct ieee80211com ic->ic_addba_request = ieee80211_addba_request; ic->ic_addba_response = ieee80211_addba_response; ic->ic_addba_stop = ieee80211_addba_stop; + ic->ic_bar_response = ieee80211_bar_response; ic->ic_htprotmode = IEEE80211_PROT_RTSCTS; ic->ic_curhtprotmode = IEEE80211_HTINFO_OPMODE_PURE; @@ -534,7 +542,6 @@ ieee80211_ampdu_reorder(struct ieee80211 */ return PROCESS; } - if ((wh->i_fc[1] & IEEE80211_FC1_DIR_MASK) == IEEE80211_FC1_DIR_DSTODS) tid = ((struct ieee80211_qosframe_addr4 *)wh)->i_qos[0]; else @@ -803,6 +810,7 @@ ieee80211_ht_node_init(struct ieee80211_ for (ac = 0; ac < WME_NUM_AC; ac++) { tap = &ni->ni_tx_ampdu[ac]; tap->txa_ac = ac; + tap->txa_ni = ni; /* NB: further initialization deferred */ } ni->ni_flags |= IEEE80211_NODE_HT | IEEE80211_NODE_AMPDU; @@ -815,7 +823,6 @@ ieee80211_ht_node_init(struct ieee80211_ void ieee80211_ht_node_cleanup(struct ieee80211_node *ni) { - struct ieee80211com *ic = ni->ni_ic; int i; KASSERT(ni->ni_flags & IEEE80211_NODE_HT, ("not an HT node")); @@ -823,18 +830,8 @@ ieee80211_ht_node_cleanup(struct ieee802 /* XXX optimize this */ for (i = 0; i < WME_NUM_AC; i++) { struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[i]; - if (tap->txa_flags & IEEE80211_AGGR_SETUP) { - /* - * Stop BA stream if setup so driver has a chance - * to reclaim any resources it might have allocated. - */ - ic->ic_addba_stop(ni, &ni->ni_tx_ampdu[i]); - tap->txa_lastsample = 0; - tap->txa_avgpps = 0; - /* NB: clearing NAK means we may re-send ADDBA */ - tap->txa_flags &= - ~(IEEE80211_AGGR_SETUP | IEEE80211_AGGR_NAK); - } + if (tap->txa_flags & IEEE80211_AGGR_SETUP) + ampdu_tx_stop(tap); } for (i = 0; i < WME_NUM_TID; i++) ampdu_rx_stop(&ni->ni_rx_ampdu[i]); @@ -1422,6 +1419,38 @@ ieee80211_setup_basic_htrates(struct iee } static void +ampdu_tx_setup(struct ieee80211_tx_ampdu *tap) +{ + callout_init(&tap->txa_timer, CALLOUT_MPSAFE); + tap->txa_flags |= IEEE80211_AGGR_SETUP; +} + +static void +ampdu_tx_stop(struct ieee80211_tx_ampdu *tap) +{ + struct ieee80211_node *ni = tap->txa_ni; + struct ieee80211com *ic = ni->ni_ic; + + KASSERT(tap->txa_flags & IEEE80211_AGGR_SETUP, + ("txa_flags 0x%x ac %d", tap->txa_flags, tap->txa_ac)); + + /* + * Stop BA stream if setup so driver has a chance + * to reclaim any resources it might have allocated. + */ + ic->ic_addba_stop(ni, tap); + /* + * Stop any pending BAR transmit. + */ + bar_stop_timer(tap); + + tap->txa_lastsample = 0; + tap->txa_avgpps = 0; + /* NB: clearing NAK means we may re-send ADDBA */ + tap->txa_flags &= ~(IEEE80211_AGGR_SETUP | IEEE80211_AGGR_NAK); +} + +static void addba_timeout(void *arg) { struct ieee80211_tx_ampdu *tap = arg; @@ -1483,7 +1512,7 @@ ieee80211_addba_response(struct ieee8021 struct ieee80211_tx_ampdu *tap, int status, int baparamset, int batimeout) { - int bufsiz; + int bufsiz, tid; /* XXX locking */ addba_stop_timeout(tap); @@ -1492,7 +1521,10 @@ ieee80211_addba_response(struct ieee8021 /* XXX override our request? */ tap->txa_wnd = (bufsiz == 0) ? IEEE80211_AGGR_BAWMAX : min(bufsiz, IEEE80211_AGGR_BAWMAX); + /* XXX AC/TID */ + tid = MS(baparamset, IEEE80211_BAPS_TID); tap->txa_flags |= IEEE80211_AGGR_RUNNING; + tap->txa_attempts = 0; } else { /* mark tid so we don't try again */ tap->txa_flags |= IEEE80211_AGGR_NAK; @@ -1648,7 +1680,6 @@ ieee80211_aggr_recv_action(struct ieee80 return; } #endif - IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, "recv ADDBA response: dialogtoken %u code %d " @@ -1817,8 +1848,7 @@ ieee80211_ampdu_request(struct ieee80211 /* XXX locking */ if ((tap->txa_flags & IEEE80211_AGGR_SETUP) == 0) { /* do deferred setup of state */ - callout_init(&tap->txa_timer, CALLOUT_MPSAFE); - tap->txa_flags |= IEEE80211_AGGR_SETUP; + ampdu_tx_setup(tap); } /* XXX hack for not doing proper locking */ tap->txa_flags &= ~IEEE80211_AGGR_NAK; @@ -1827,7 +1857,6 @@ ieee80211_ampdu_request(struct ieee80211 tid = WME_AC_TO_TID(tap->txa_ac); tap->txa_start = ni->ni_txseqs[tid]; - tid = WME_AC_TO_TID(tap->txa_ac); args[0] = dialogtoken; args[1] = IEEE80211_BAPS_POLICY_IMMEDIATE | SM(tid, IEEE80211_BAPS_TID) @@ -1869,6 +1898,7 @@ ieee80211_ampdu_stop(struct ieee80211_no uint16_t args[4]; /* XXX locking */ + tap->txa_flags &= ~IEEE80211_AGGR_BARPEND; if (IEEE80211_AMPDU_RUNNING(tap)) { IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, "%s: stop BA stream for AC %d (reason %d)", @@ -1889,72 +1919,171 @@ ieee80211_ampdu_stop(struct ieee80211_no } } +static void +bar_timeout(void *arg) +{ + struct ieee80211_tx_ampdu *tap = arg; + struct ieee80211_node *ni = tap->txa_ni; + + KASSERT((tap->txa_flags & IEEE80211_AGGR_XCHGPEND) == 0, + ("bar/addba collision, flags 0x%x", tap->txa_flags)); + + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, + ni, "%s: tid %u flags 0x%x attempts %d", __func__, + tap->txa_ac, tap->txa_flags, tap->txa_attempts); + + /* guard against race with bar_tx_complete */ + if ((tap->txa_flags & IEEE80211_AGGR_BARPEND) == 0) + return; + /* XXX ? */ + if (tap->txa_attempts >= ieee80211_bar_maxtries) + ieee80211_ampdu_stop(ni, tap, IEEE80211_REASON_TIMEOUT); + else + ieee80211_send_bar(ni, tap, tap->txa_seqpending); +} + +static void +bar_start_timer(struct ieee80211_tx_ampdu *tap) +{ + callout_reset(&tap->txa_timer, ieee80211_bar_timeout, bar_timeout, tap); +} + +static void +bar_stop_timer(struct ieee80211_tx_ampdu *tap) +{ + callout_stop(&tap->txa_timer); +} + +static void +bar_tx_complete(struct ieee80211_node *ni, void *arg, int status) +{ + struct ieee80211_tx_ampdu *tap = arg; + + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, + ni, "%s: tid %u flags 0x%x pending %d status %d", + __func__, tap->txa_ac, tap->txa_flags, + callout_pending(&tap->txa_timer), status); + + /* XXX locking */ + if ((tap->txa_flags & IEEE80211_AGGR_BARPEND) && + callout_pending(&tap->txa_timer)) { + struct ieee80211com *ic = ni->ni_ic; + + if (status) /* ACK'd */ + bar_stop_timer(tap); + ic->ic_bar_response(ni, tap, status); + /* NB: just let timer expire so we pace requests */ + } +} + +static void +ieee80211_bar_response(struct ieee80211_node *ni, + struct ieee80211_tx_ampdu *tap, int status) +{ + + if (status != 0) { /* got ACK */ + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, + ni, "BAR moves BA win <%u:%u> (%u frames) txseq %u tid %u", + tap->txa_start, + IEEE80211_SEQ_ADD(tap->txa_start, tap->txa_wnd-1), + tap->txa_qframes, tap->txa_seqpending, + WME_AC_TO_TID(tap->txa_ac)); + + /* NB: timer already stopped in bar_tx_complete */ + tap->txa_start = tap->txa_seqpending; + tap->txa_flags &= ~IEEE80211_AGGR_BARPEND; + } +} + /* * Transmit a BAR frame to the specified node. The * BAR contents are drawn from the supplied aggregation * state associated with the node. + * + * NB: we only handle immediate ACK w/ compressed bitmap. */ int ieee80211_send_bar(struct ieee80211_node *ni, - const struct ieee80211_tx_ampdu *tap) + struct ieee80211_tx_ampdu *tap, ieee80211_seq seq) { #define senderr(_x, _v) do { vap->iv_stats._v++; ret = _x; goto bad; } while (0) -#define ADDSHORT(frm, v) do { \ - frm[0] = (v) & 0xff; \ - frm[1] = (v) >> 8; \ - frm += 2; \ -} while (0) struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; - struct ieee80211_frame_min *wh; + struct ieee80211_frame_bar *bar; struct mbuf *m; - uint8_t *frm; uint16_t barctl, barseqctl; + uint8_t *frm; int tid, ret; + if ((tap->txa_flags & IEEE80211_AGGR_RUNNING) == 0) { + /* no ADDBA response, should not happen */ + /* XXX stat+msg */ + return EINVAL; + } + /* XXX locking */ + bar_stop_timer(tap); + ieee80211_ref_node(ni); - m = ieee80211_getmgtframe(&frm, - ic->ic_headroom + sizeof(struct ieee80211_frame_min), - sizeof(struct ieee80211_ba_request) - ); + m = ieee80211_getmgtframe(&frm, ic->ic_headroom, sizeof(*bar)); if (m == NULL) senderr(ENOMEM, is_tx_nobuf); - wh = mtod(m, struct ieee80211_frame_min *); - wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | + if (!ieee80211_add_callback(m, bar_tx_complete, tap)) { + m_freem(m); + senderr(ENOMEM, is_tx_nobuf); /* XXX */ + /* NOTREACHED */ + } + + bar = mtod(m, struct ieee80211_frame_bar *); + bar->i_fc[0] = IEEE80211_FC0_VERSION_0 | IEEE80211_FC0_TYPE_CTL | IEEE80211_FC0_SUBTYPE_BAR; - wh->i_fc[1] = 0; - IEEE80211_ADDR_COPY(wh->i_addr1, ni->ni_macaddr); - IEEE80211_ADDR_COPY(wh->i_addr2, vap->iv_myaddr); + bar->i_fc[1] = 0; + IEEE80211_ADDR_COPY(bar->i_ra, ni->ni_macaddr); + IEEE80211_ADDR_COPY(bar->i_ta, vap->iv_myaddr); tid = WME_AC_TO_TID(tap->txa_ac); barctl = (tap->txa_flags & IEEE80211_AGGR_IMMEDIATE ? - IEEE80211_BAPS_POLICY_IMMEDIATE : - IEEE80211_BAPS_POLICY_DELAYED) - | SM(tid, IEEE80211_BAPS_TID) - | SM(tap->txa_wnd, IEEE80211_BAPS_BUFSIZ) - ; - barseqctl = SM(tap->txa_start, IEEE80211_BASEQ_START) - | SM(0, IEEE80211_BASEQ_FRAG) + 0 : IEEE80211_BAR_NOACK) + | IEEE80211_BAR_COMP + | SM(tid, IEEE80211_BAR_TID) ; - ADDSHORT(frm, barctl); - ADDSHORT(frm, barseqctl); - m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); + barseqctl = SM(seq, IEEE80211_BAR_SEQ_START); + /* NB: known to have proper alignment */ + bar->i_ctl = htole16(barctl); + bar->i_seq = htole16(barseqctl); + m->m_pkthdr.len = m->m_len = sizeof(struct ieee80211_frame_bar); M_WME_SETAC(m, WME_AC_VO); IEEE80211_NODE_STAT(ni, tx_mgmt); /* XXX tx_ctl? */ - IEEE80211_NOTE(vap, IEEE80211_MSG_DEBUG | IEEE80211_MSG_DUMPPKTS, - ni, "send bar frame (tid %u start %u) on channel %u", - tid, tap->txa_start, ieee80211_chan2ieee(ic, ic->ic_curchan)); - - return ic->ic_raw_xmit(ni, m, NULL); + /* XXX locking */ + /* init/bump attempts counter */ + if ((tap->txa_flags & IEEE80211_AGGR_BARPEND) == 0) + tap->txa_attempts = 1; + else + tap->txa_attempts++; + tap->txa_seqpending = seq; + tap->txa_flags |= IEEE80211_AGGR_BARPEND; + + IEEE80211_NOTE(vap, IEEE80211_MSG_DEBUG | IEEE80211_MSG_11N, + ni, "send BAR: tid %u ctl 0x%x start %u (attempt %d)", + tid, barctl, seq, tap->txa_attempts); + + ret = ic->ic_raw_xmit(ni, m, NULL); + if (ret != 0) { + /* xmit failed, clear state flag */ + tap->txa_flags &= ~IEEE80211_AGGR_BARPEND; + goto bad; + } + /* XXX hack against tx complete happening before timer is started */ + if (tap->txa_flags & IEEE80211_AGGR_BARPEND) + bar_start_timer(tap); + return 0; bad: ieee80211_free_node(ni); return ret; -#undef ADDSHORT #undef senderr } Modified: head/sys/net80211/ieee80211_ht.h ============================================================================== --- head/sys/net80211/ieee80211_ht.h Sat Oct 25 23:44:25 2008 (r184279) +++ head/sys/net80211/ieee80211_ht.h Sat Oct 25 23:58:59 2008 (r184280) @@ -38,12 +38,14 @@ typedef uint16_t ieee80211_seq; struct ieee80211_tx_ampdu { + struct ieee80211_node *txa_ni; /* back pointer */ u_short txa_flags; #define IEEE80211_AGGR_IMMEDIATE 0x0001 /* BA policy */ #define IEEE80211_AGGR_XCHGPEND 0x0002 /* ADDBA response pending */ #define IEEE80211_AGGR_RUNNING 0x0004 /* ADDBA response received */ #define IEEE80211_AGGR_SETUP 0x0008 /* deferred state setup */ #define IEEE80211_AGGR_NAK 0x0010 /* peer NAK'd ADDBA request */ +#define IEEE80211_AGGR_BARPEND 0x0020 /* BAR response pending */ uint8_t txa_ac; uint8_t txa_token; /* dialog token */ int txa_lastsample; /* ticks @ last traffic sample */ @@ -54,8 +56,8 @@ struct ieee80211_tx_ampdu { ieee80211_seq txa_start; /* BA window left edge */ ieee80211_seq txa_seqpending; /* new txa_start pending BAR response */ uint16_t txa_wnd; /* BA window size */ - uint8_t txa_attempts; /* # ADDBA requests w/o a response */ - int txa_nextrequest;/* soonest to make next ADDBA request */ + uint8_t txa_attempts; /* # ADDBA/BAR requests w/o a response*/ + int txa_nextrequest;/* soonest to make next request */ struct callout txa_timer; void *txa_private; /* driver-private storage */ }; @@ -187,8 +189,8 @@ int ieee80211_ampdu_request(struct ieee8 struct ieee80211_tx_ampdu *); void ieee80211_ampdu_stop(struct ieee80211_node *, struct ieee80211_tx_ampdu *, int); -int ieee80211_send_bar(struct ieee80211_node *, - const struct ieee80211_tx_ampdu *); +int ieee80211_send_bar(struct ieee80211_node *, struct ieee80211_tx_ampdu *, + ieee80211_seq); int ieee80211_send_action(struct ieee80211_node *, int, int, uint16_t [4]); uint8_t *ieee80211_add_htcap(uint8_t *, struct ieee80211_node *); Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Sat Oct 25 23:44:25 2008 (r184279) +++ head/sys/net80211/ieee80211_var.h Sat Oct 25 23:58:59 2008 (r184280) @@ -273,6 +273,9 @@ struct ieee80211com { int status, int baparamset, int batimeout); void (*ic_addba_stop)(struct ieee80211_node *, struct ieee80211_tx_ampdu *); + /* BAR response received */ + void (*ic_bar_response)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *, int status); }; struct ieee80211_aclator;