From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 05:58:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6869D106566B; Sun, 4 Jul 2010 05:58:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 567ED8FC12; Sun, 4 Jul 2010 05:58:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o645wI8p042217; Sun, 4 Jul 2010 05:58:18 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o645wIFT042216; Sun, 4 Jul 2010 05:58:18 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201007040558.o645wIFT042216@svn.freebsd.org> From: Warner Losh Date: Sun, 4 Jul 2010 05:58: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: r209682 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 05:58:18 -0000 Author: imp Date: Sun Jul 4 05:58:17 2010 New Revision: 209682 URL: http://svn.freebsd.org/changeset/base/209682 Log: Minor formatting nits. Modified: head/sys/dev/ata/ata-card.c Modified: head/sys/dev/ata/ata-card.c ============================================================================== --- head/sys/dev/ata/ata-card.c Sun Jul 4 02:44:32 2010 (r209681) +++ head/sys/dev/ata/ata-card.c Sun Jul 4 05:58:17 2010 (r209682) @@ -135,9 +135,9 @@ ata_pccard_attach(device_t dev) ch->unit = 0; ch->flags |= ATA_USE_16BIT; funce = 0; /* Default to sane setting of FUNCE */ - pccard_get_funce_disk(dev, &funce); + pccard_get_funce_disk(dev, &funce); if (!(funce & PFD_I_D)) - ch-> flags |= ATA_NO_SLAVE; + ch-> flags |= ATA_NO_SLAVE; ata_generic_hw(dev); err = ata_probe(dev); if (err) From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 07:42:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE6BE106566B; Sun, 4 Jul 2010 07:42:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A48EC8FC1E; Sun, 4 Jul 2010 07:42:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o647gqCI064981; Sun, 4 Jul 2010 07:42:52 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o647gqpQ064979; Sun, 4 Jul 2010 07:42:52 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201007040742.o647gqpQ064979@svn.freebsd.org> From: Warner Losh Date: Sun, 4 Jul 2010 07:42: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: r209683 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 07:42:52 -0000 Author: imp Date: Sun Jul 4 07:42:52 2010 New Revision: 209683 URL: http://svn.freebsd.org/changeset/base/209683 Log: Add a safety-belt. If the identified disk has 0 blocks, don't attach it. This can happen in some cases when plugging in SD/SmartCard PC Cards with empty slots. It is better to detect this bogosity, and refuse to attach rather than panic with a division by zero (in one of many places) down stream. Modified: head/sys/dev/ata/ata-disk.c Modified: head/sys/dev/ata/ata-disk.c ============================================================================== --- head/sys/dev/ata/ata-disk.c Sun Jul 4 05:58:17 2010 (r209682) +++ head/sys/dev/ata/ata-disk.c Sun Jul 4 07:42:52 2010 (r209683) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); /* prototypes */ static void ad_init(device_t dev); -static void ad_get_geometry(device_t dev); +static int ad_get_geometry(device_t dev); static void ad_set_geometry(device_t dev); static void ad_done(struct ata_request *request); static void ad_describe(device_t dev); @@ -106,7 +106,8 @@ ad_attach(device_t dev) device_set_ivars(dev, adp); /* get device geometry into internal structs */ - ad_get_geometry(dev); + if (ad_get_geometry(dev)) + return ENXIO; /* set the max size if configured */ if (ata_setmax) @@ -410,7 +411,7 @@ ad_init(device_t dev) atadev->max_iosize = DEV_BSIZE; } -static void +static int ad_get_geometry(device_t dev) { struct ata_device *atadev = device_get_softc(dev); @@ -432,6 +433,9 @@ ad_get_geometry(device_t dev) } lbasize = (u_int32_t)atadev->param.lba_size_1 | ((u_int32_t)atadev->param.lba_size_2 << 16); + /* This device exists, but has no size. Filter out this bogus device. */ + if (!lbasize && !adp->total_secs) + return ENXIO; /* does this device need oldstyle CHS addressing */ if (!ad_version(atadev->param.version_major) || !lbasize) @@ -449,6 +453,7 @@ ad_get_geometry(device_t dev) if ((atadev->param.support.command2 & ATA_SUPPORT_ADDRESS48) && lbasize48 > ATA_MAX_28BIT_LBA) adp->total_secs = lbasize48; + return 0; } static void From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 08:09:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1470106566B; Sun, 4 Jul 2010 08:09:33 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D6A6F8FC21; Sun, 4 Jul 2010 08:09:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6489X4X070806; Sun, 4 Jul 2010 08:09:33 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6489XgM070802; Sun, 4 Jul 2010 08:09:33 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201007040809.o6489XgM070802@svn.freebsd.org> From: Bruce Cran Date: Sun, 4 Jul 2010 08:09: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: r209684 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 08:09:34 -0000 Author: brucec Date: Sun Jul 4 08:09:33 2010 New Revision: 209684 URL: http://svn.freebsd.org/changeset/base/209684 Log: Use ISO C99 integer types instead of the BSD-specific u_int*_t. Approved by: rrs (mentor) Modified: head/lib/libc/net/sctp_recvmsg.3 head/lib/libc/net/sctp_send.3 head/lib/libc/net/sctp_sys_calls.c Modified: head/lib/libc/net/sctp_recvmsg.3 ============================================================================== --- head/lib/libc/net/sctp_recvmsg.3 Sun Jul 4 07:42:52 2010 (r209683) +++ head/lib/libc/net/sctp_recvmsg.3 Sun Jul 4 08:09:33 2010 (r209684) @@ -146,14 +146,14 @@ The argument is defined as follows. .Bd -literal struct sctp_sndrcvinfo { - u_int16_t sinfo_stream; /* Stream arriving on */ - u_int16_t sinfo_ssn; /* Stream Sequence Number */ - u_int16_t sinfo_flags; /* Flags on the incoming message */ - u_int32_t sinfo_ppid; /* The ppid field */ - u_int32_t sinfo_context; /* context field */ - u_int32_t sinfo_timetolive; /* not used by sctp_recvmsg */ - u_int32_t sinfo_tsn; /* The transport sequence number */ - u_int32_t sinfo_cumtsn; /* The cumulative acknowledgment point */ + uint16_t sinfo_stream; /* Stream arriving on */ + uint16_t sinfo_ssn; /* Stream Sequence Number */ + uint16_t sinfo_flags; /* Flags on the incoming message */ + uint32_t sinfo_ppid; /* The ppid field */ + uint32_t sinfo_context; /* context field */ + uint32_t sinfo_timetolive; /* not used by sctp_recvmsg */ + uint32_t sinfo_tsn; /* The transport sequence number */ + uint32_t sinfo_cumtsn; /* The cumulative acknowledgment point */ sctp_assoc_t sinfo_assoc_id; /* The association id of the peer */ }; .Ed Modified: head/lib/libc/net/sctp_send.3 ============================================================================== --- head/lib/libc/net/sctp_send.3 Sun Jul 4 07:42:52 2010 (r209683) +++ head/lib/libc/net/sctp_send.3 Sun Jul 4 08:09:33 2010 (r209684) @@ -94,14 +94,14 @@ structure is used to control various SCT and has the following format: .Bd -literal struct sctp_sndrcvinfo { - u_int16_t sinfo_stream; /* Stream sending to */ - u_int16_t sinfo_ssn; /* valid for recv only */ - u_int16_t sinfo_flags; /* flags to control sending */ - u_int32_t sinfo_ppid; /* ppid field */ - u_int32_t sinfo_context; /* context field */ - u_int32_t sinfo_timetolive; /* timetolive for PR-SCTP */ - u_int32_t sinfo_tsn; /* valid for recv only */ - u_int32_t sinfo_cumtsn; /* valid for recv only */ + uint16_t sinfo_stream; /* Stream sending to */ + uint16_t sinfo_ssn; /* valid for recv only */ + uint16_t sinfo_flags; /* flags to control sending */ + uint32_t sinfo_ppid; /* ppid field */ + uint32_t sinfo_context; /* context field */ + uint32_t sinfo_timetolive; /* timetolive for PR-SCTP */ + uint32_t sinfo_tsn; /* valid for recv only */ + uint32_t sinfo_cumtsn; /* valid for recv only */ sctp_assoc_t sinfo_assoc_id; /* The association id */ }; .Ed Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Sun Jul 4 07:42:52 2010 (r209683) +++ head/lib/libc/net/sctp_sys_calls.c Sun Jul 4 08:09:33 2010 (r209684) @@ -49,9 +49,9 @@ __FBSDID("$FreeBSD$"); #ifndef IN6_IS_ADDR_V4MAPPED #define IN6_IS_ADDR_V4MAPPED(a) \ - ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) + ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ + (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ + (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) #endif @@ -533,11 +533,11 @@ sctp_sendmsg(int s, size_t len, const struct sockaddr *to, socklen_t tolen, - u_int32_t ppid, - u_int32_t flags, - u_int16_t stream_no, - u_int32_t timetolive, - u_int32_t context) + uint32_t ppid, + uint32_t flags, + uint16_t stream_no, + uint32_t timetolive, + uint32_t context) { #ifdef SYS_sctp_generic_sendmsg struct sctp_sndrcvinfo sinfo; @@ -814,11 +814,11 @@ sctp_sendmsgx(int sd, size_t len, struct sockaddr *addrs, int addrcnt, - u_int32_t ppid, - u_int32_t flags, - u_int16_t stream_no, - u_int32_t timetolive, - u_int32_t context) + uint32_t ppid, + uint32_t flags, + uint16_t stream_no, + uint32_t timetolive, + uint32_t context) { struct sctp_sndrcvinfo sinfo; From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 11:13:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B812710656C3; Sun, 4 Jul 2010 11:13: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 A73AE8FC15; Sun, 4 Jul 2010 11:13:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64BDXeK011865; Sun, 4 Jul 2010 11:13:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64BDXiF011860; Sun, 4 Jul 2010 11:13:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201007041113.o64BDXiF011860@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 Jul 2010 11:13: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: r209685 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 11:13:33 -0000 Author: kib Date: Sun Jul 4 11:13:33 2010 New Revision: 209685 URL: http://svn.freebsd.org/changeset/base/209685 Log: Introduce a helper function vm_page_find_least(). Use it in several places, which inline the function. Reviewed by: alc Tested by: pho MFC after: 1 week Modified: head/sys/vm/vm_map.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sun Jul 4 08:09:33 2010 (r209684) +++ head/sys/vm/vm_map.c Sun Jul 4 11:13:33 2010 (r209685) @@ -1750,13 +1750,7 @@ vm_map_pmap_enter(vm_map_t map, vm_offse start = 0; p_start = NULL; - if ((p = TAILQ_FIRST(&object->memq)) != NULL) { - if (p->pindex < pindex) { - p = vm_page_splay(pindex, object->root); - if ((object->root = p)->pindex < pindex) - p = TAILQ_NEXT(p, listq); - } - } + p = vm_page_find_least(object, pindex); /* * Assert: the variable p is either (1) the page with the * least pindex greater than or equal to the parameter pindex Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun Jul 4 08:09:33 2010 (r209684) +++ head/sys/vm/vm_object.c Sun Jul 4 11:13:33 2010 (r209685) @@ -1400,13 +1400,7 @@ vm_object_split(vm_map_entry_t entry) orig_object->charge -= ptoa(size); } retry: - if ((m = TAILQ_FIRST(&orig_object->memq)) != NULL) { - if (m->pindex < offidxstart) { - m = vm_page_splay(offidxstart, orig_object->root); - if ((orig_object->root = m)->pindex < offidxstart) - m = TAILQ_NEXT(m, listq); - } - } + m = vm_page_find_least(orig_object, offidxstart); for (; m != NULL && (idx = m->pindex - offidxstart) < size; m = m_next) { m_next = TAILQ_NEXT(m, listq); @@ -1910,13 +1904,7 @@ vm_object_page_remove(vm_object_t object vm_object_pip_add(object, 1); again: - if ((p = TAILQ_FIRST(&object->memq)) != NULL) { - if (p->pindex < start) { - p = vm_page_splay(start, object->root); - if ((object->root = p)->pindex < start) - p = TAILQ_NEXT(p, listq); - } - } + p = vm_page_find_least(object, start); /* * Assert: the variable p is either (1) the page with the Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Jul 4 08:09:33 2010 (r209684) +++ head/sys/vm/vm_page.c Sun Jul 4 11:13:33 2010 (r209685) @@ -879,6 +879,31 @@ vm_page_lookup(vm_object_t object, vm_pi } /* + * vm_page_find_least: + * + * Returns the page associated with the object with least pindex + * greater than or equal to the parameter pindex, or NULL. + * + * The object must be locked. + * The routine may not block. + */ +vm_page_t +vm_page_find_least(vm_object_t object, vm_pindex_t pindex) +{ + vm_page_t m; + + VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + if ((m = TAILQ_FIRST(&object->memq)) != NULL) { + if (m->pindex < pindex) { + m = vm_page_splay(pindex, object->root); + if ((object->root = m)->pindex < pindex) + m = TAILQ_NEXT(m, listq); + } + } + return (m); +} + +/* * Returns the given page's successor (by pindex) within the object if it is * resident; if none is found, NULL is returned. * Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sun Jul 4 08:09:33 2010 (r209684) +++ head/sys/vm/vm_page.h Sun Jul 4 11:13:33 2010 (r209685) @@ -345,6 +345,7 @@ int vm_page_try_to_cache (vm_page_t); int vm_page_try_to_free (vm_page_t); void vm_page_dontneed(vm_page_t); void vm_page_deactivate (vm_page_t); +vm_page_t vm_page_find_least(vm_object_t, vm_pindex_t); void vm_page_insert (vm_page_t, vm_object_t, vm_pindex_t); vm_page_t vm_page_lookup (vm_object_t, vm_pindex_t); vm_page_t vm_page_next(vm_page_t m); From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 11:26:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C03271065670; Sun, 4 Jul 2010 11:26:56 +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 AE5448FC0A; Sun, 4 Jul 2010 11:26:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64BQus7014803; Sun, 4 Jul 2010 11:26:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64BQumt014799; Sun, 4 Jul 2010 11:26:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201007041126.o64BQumt014799@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 Jul 2010 11:26: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: r209686 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 11:26:56 -0000 Author: kib Date: Sun Jul 4 11:26:56 2010 New Revision: 209686 URL: http://svn.freebsd.org/changeset/base/209686 Log: Reimplement vm_object_page_clean(), using the fact that vm object memq is ordered by page index. This greatly simplifies the implementation, since we no longer need to mark the pages with VPO_CLEANCHK to denote the progress. It is enough to remember the current position by index before dropping the object lock. Remove VPO_CLEANCHK and VM_PAGER_IGNORE_CLEANCHK as unused. Garbage-collect vm.msync_flush_flags sysctl. Suggested and reviewed by: alc Tested by: pho Modified: head/sys/vm/vm_object.c head/sys/vm/vm_page.h head/sys/vm/vm_pager.h Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun Jul 4 11:13:33 2010 (r209685) +++ head/sys/vm/vm_object.c Sun Jul 4 11:26:56 2010 (r209686) @@ -101,13 +101,6 @@ __FBSDID("$FreeBSD$"); #define MSYNC_FLUSH_HARDSEQ 0x01 #define MSYNC_FLUSH_SOFTSEQ 0x02 -/* - * msync / VM object flushing optimizations - */ -static int msync_flush_flags = MSYNC_FLUSH_HARDSEQ | MSYNC_FLUSH_SOFTSEQ; -SYSCTL_INT(_vm, OID_AUTO, msync_flush_flags, CTLFLAG_RW, &msync_flush_flags, 0, - "Enable sequential iteration optimization"); - static int old_msync; SYSCTL_INT(_vm, OID_AUTO, old_msync, CTLFLAG_RW, &old_msync, 0, "Use old (insecure) msync behavior"); @@ -762,276 +755,167 @@ vm_object_terminate(vm_object_t object) * The object must be locked. */ void -vm_object_page_clean(vm_object_t object, vm_pindex_t start, vm_pindex_t end, int flags) +vm_object_page_clean(vm_object_t object, vm_pindex_t start, vm_pindex_t end, + int flags) { - vm_page_t p, np; - vm_pindex_t tstart, tend; - vm_pindex_t pi; - int clearobjflags; - int pagerflags; - int curgeneration; + vm_page_t np, p; + vm_pindex_t pi, tend; + int clearobjflags, curgeneration, n, pagerflags; mtx_assert(&vm_page_queue_mtx, MA_NOTOWNED); VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - if ((object->flags & OBJ_MIGHTBEDIRTY) == 0) + if ((object->flags & OBJ_MIGHTBEDIRTY) == 0 || + object->resident_page_count == 0) return; KASSERT(object->type == OBJT_VNODE, ("Not a vnode object")); - pagerflags = (flags & (OBJPC_SYNC | OBJPC_INVAL)) ? VM_PAGER_PUT_SYNC : VM_PAGER_CLUSTER_OK; - pagerflags |= (flags & OBJPC_INVAL) ? VM_PAGER_PUT_INVAL : 0; + pagerflags = (flags & (OBJPC_SYNC | OBJPC_INVAL)) != 0 ? + VM_PAGER_PUT_SYNC : VM_PAGER_CLUSTER_OK; + pagerflags |= (flags & OBJPC_INVAL) != 0 ? VM_PAGER_PUT_INVAL : 0; - vm_object_set_flag(object, OBJ_CLEANING); - - tstart = start; - if (end == 0) { - tend = object->size; - } else { - tend = end; - } - - /* - * If the caller is smart and only msync()s a range he knows is - * dirty, we may be able to avoid an object scan. This results in - * a phenominal improvement in performance. We cannot do this - * as a matter of course because the object may be huge - e.g. - * the size might be in the gigabytes or terrabytes. - */ - if (msync_flush_flags & MSYNC_FLUSH_HARDSEQ) { - vm_pindex_t tscan; - int scanlimit; - int scanreset; - - scanreset = object->resident_page_count / EASY_SCAN_FACTOR; - if (scanreset < 16) - scanreset = 16; - pagerflags |= VM_PAGER_IGNORE_CLEANCHK; - - scanlimit = scanreset; - tscan = tstart; - while (tscan < tend) { - curgeneration = object->generation; - p = vm_page_lookup(object, tscan); - if (p == NULL || p->valid == 0) { - if (--scanlimit == 0) - break; - ++tscan; - continue; - } - vm_page_test_dirty(p); - if (p->dirty == 0) { - if (--scanlimit == 0) - break; - ++tscan; - continue; - } - /* - * If we have been asked to skip nosync pages and - * this is a nosync page, we can't continue. - */ - if ((flags & OBJPC_NOSYNC) && (p->oflags & VPO_NOSYNC)) { - if (--scanlimit == 0) - break; - ++tscan; - continue; - } - scanlimit = scanreset; + tend = (end == 0) ? object->size : end; - /* - * This returns 0 if it was unable to busy the first - * page (i.e. had to sleep). - */ - tscan += vm_object_page_collect_flush(object, p, curgeneration, pagerflags); - - } - - /* - * If everything was dirty and we flushed it successfully, - * and the requested range is not the entire object, we - * don't have to mess with CLEANCHK or MIGHTBEDIRTY and can - * return immediately. - */ - if (tscan >= tend && (tstart || tend < object->size)) { - vm_object_clear_flag(object, OBJ_CLEANING); - return; - } - pagerflags &= ~VM_PAGER_IGNORE_CLEANCHK; - } + vm_object_set_flag(object, OBJ_CLEANING); /* - * Generally set CLEANCHK interlock and make the page read-only so - * we can then clear the object flags. + * Make the page read-only so we can then clear the object flags. * * However, if this is a nosync mmap then the object is likely to * stay dirty so do not mess with the page and do not clear the * object flags. */ clearobjflags = 1; - TAILQ_FOREACH(p, &object->memq, listq) { - p->oflags |= VPO_CLEANCHK; - if ((flags & OBJPC_NOSYNC) && (p->oflags & VPO_NOSYNC)) + for (p = vm_page_find_least(object, start); + p != NULL && p->pindex < tend; p = TAILQ_NEXT(p, listq)) { + if ((flags & OBJPC_NOSYNC) != 0 && + (p->oflags & VPO_NOSYNC) != 0) clearobjflags = 0; else pmap_remove_write(p); } - if (clearobjflags && (tstart == 0) && (tend == object->size)) + if (clearobjflags && (start == 0) && (tend == object->size)) vm_object_clear_flag(object, OBJ_MIGHTBEDIRTY); rescan: + p = vm_page_find_least(object, start); curgeneration = object->generation; - for (p = TAILQ_FIRST(&object->memq); p; p = np) { - int n; - - np = TAILQ_NEXT(p, listq); - -again: + for (; p != NULL; p = np) { pi = p->pindex; - if ((p->oflags & VPO_CLEANCHK) == 0 || - (pi < tstart) || (pi >= tend) || - p->valid == 0) { - p->oflags &= ~VPO_CLEANCHK; + if (pi >= tend) + break; + np = TAILQ_NEXT(p, listq); + if (p->valid == 0) continue; + while (vm_page_sleep_if_busy(p, TRUE, "vpcwai")) { + if (object->generation != curgeneration) + goto rescan; } - vm_page_test_dirty(p); - if (p->dirty == 0) { - p->oflags &= ~VPO_CLEANCHK; + if (p->dirty == 0) continue; - } + /* * If we have been asked to skip nosync pages and this is a * nosync page, skip it. Note that the object flags were * not cleared in this case so we do not have to set them. */ - if ((flags & OBJPC_NOSYNC) && (p->oflags & VPO_NOSYNC)) { - p->oflags &= ~VPO_CLEANCHK; + if ((flags & OBJPC_NOSYNC) != 0 && + (p->oflags & VPO_NOSYNC) != 0) continue; - } n = vm_object_page_collect_flush(object, p, - curgeneration, pagerflags); - if (n == 0) - goto rescan; - + curgeneration, pagerflags); + KASSERT(n > 0, ("vm_object_page_collect_flush failed")); if (object->generation != curgeneration) goto rescan; - - /* - * Try to optimize the next page. If we can't we pick up - * our (random) scan where we left off. - */ - if (msync_flush_flags & MSYNC_FLUSH_SOFTSEQ) - if ((p = vm_page_lookup(object, pi + n)) != NULL) - goto again; + np = vm_page_find_least(object, pi + n); } #if 0 - VOP_FSYNC(vp, (pagerflags & VM_PAGER_PUT_SYNC)?MNT_WAIT:0, curproc); + VOP_FSYNC(vp, (pagerflags & VM_PAGER_PUT_SYNC) ? MNT_WAIT : 0); #endif vm_object_clear_flag(object, OBJ_CLEANING); - return; } static int -vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int curgeneration, int pagerflags) +vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int curgeneration, + int pagerflags) { int runlen; int maxf; int chkb; int maxb; - int i; + int i, index; vm_pindex_t pi; vm_page_t maf[vm_pageout_page_count]; vm_page_t mab[vm_pageout_page_count]; vm_page_t ma[vm_pageout_page_count]; + vm_page_t tp, p1; mtx_assert(&vm_page_queue_mtx, MA_NOTOWNED); vm_page_lock_assert(p, MA_NOTOWNED); VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); pi = p->pindex; - while (vm_page_sleep_if_busy(p, TRUE, "vpcwai")) { - if (object->generation != curgeneration) { - return(0); - } - } maxf = 0; - for(i = 1; i < vm_pageout_page_count; i++) { - vm_page_t tp; - - if ((tp = vm_page_lookup(object, pi + i)) != NULL) { - if ((tp->oflags & VPO_BUSY) || - ((pagerflags & VM_PAGER_IGNORE_CLEANCHK) == 0 && - (tp->oflags & VPO_CLEANCHK) == 0) || - (tp->busy != 0)) - break; - vm_page_test_dirty(tp); - if (tp->dirty == 0) { - tp->oflags &= ~VPO_CLEANCHK; - break; - } - maf[ i - 1 ] = tp; - maxf++; - continue; - } - break; + for (i = 1, p1 = p; i < vm_pageout_page_count; i++) { + tp = vm_page_next(p1); + if (tp == NULL || tp->busy != 0 || (tp->oflags & VPO_BUSY) != 0) + break; + vm_page_test_dirty(tp); + if (tp->dirty == 0) + break; + maf[i - 1] = p1 = tp; + maxf++; } maxb = 0; chkb = vm_pageout_page_count - maxf; - if (chkb) { - for(i = 1; i < chkb;i++) { - vm_page_t tp; - - if ((tp = vm_page_lookup(object, pi - i)) != NULL) { - if ((tp->oflags & VPO_BUSY) || - ((pagerflags & VM_PAGER_IGNORE_CLEANCHK) == 0 && - (tp->oflags & VPO_CLEANCHK) == 0) || - (tp->busy != 0)) - break; - vm_page_test_dirty(tp); - if (tp->dirty == 0) { - tp->oflags &= ~VPO_CLEANCHK; - break; - } - mab[ i - 1 ] = tp; - maxb++; - continue; - } + for (i = 1, p1 = p; i < chkb; i++) { + tp = vm_page_prev(p1); + if (tp == NULL || tp->busy != 0 || (tp->oflags & VPO_BUSY) != 0) break; - } + vm_page_test_dirty(tp); + if (tp->dirty == 0) + break; + mab[i - 1] = p1 = tp; + maxb++; } - for(i = 0; i < maxb; i++) { - int index = (maxb - i) - 1; + for (i = 0; i < maxb; i++) { + index = (maxb - i) - 1; ma[index] = mab[i]; - ma[index]->oflags &= ~VPO_CLEANCHK; } - p->oflags &= ~VPO_CLEANCHK; ma[maxb] = p; - for(i = 0; i < maxf; i++) { - int index = (maxb + i) + 1; + for (i = 0; i < maxf; i++) { + index = (maxb + i) + 1; ma[index] = maf[i]; - ma[index]->oflags &= ~VPO_CLEANCHK; } runlen = maxb + maxf + 1; vm_pageout_flush(ma, runlen, pagerflags); for (i = 0; i < runlen; i++) { - if (ma[i]->dirty) { - pmap_remove_write(ma[i]); - ma[i]->oflags |= VPO_CLEANCHK; - + if (ma[i]->dirty != 0) { + KASSERT((ma[i]->flags & PG_WRITEABLE) == 0, + ("vm_object_page_collect_flush: page %p is not write protected", + ma[i])); + } + } + for (i = 0; i < maxf; i++) { + if (ma[i + maxb + 1]->dirty != 0) { /* * maxf will end up being the actual number of pages * we wrote out contiguously, non-inclusive of the * first page. We do not count look-behind pages. */ - if (i >= maxb + 1 && (maxf > i - maxb - 1)) - maxf = i - maxb - 1; + if (maxf > i) { + maxf = i; + break; + } } } - return(maxf + 1); + return (maxf + 1); } /* Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sun Jul 4 11:13:33 2010 (r209685) +++ head/sys/vm/vm_page.h Sun Jul 4 11:26:56 2010 (r209686) @@ -143,7 +143,6 @@ struct vm_page { */ #define VPO_BUSY 0x0001 /* page is in transit */ #define VPO_WANTED 0x0002 /* someone is waiting for page */ -#define VPO_CLEANCHK 0x0100 /* page will be checked for cleaning */ #define VPO_SWAPINPROG 0x0200 /* swap I/O in progress on page */ #define VPO_NOSYNC 0x0400 /* do not collect for syncer */ Modified: head/sys/vm/vm_pager.h ============================================================================== --- head/sys/vm/vm_pager.h Sun Jul 4 11:13:33 2010 (r209685) +++ head/sys/vm/vm_pager.h Sun Jul 4 11:26:56 2010 (r209686) @@ -90,7 +90,6 @@ extern struct pagerops sgpagerops; #define VM_PAGER_PUT_SYNC 0x0001 #define VM_PAGER_PUT_INVAL 0x0002 -#define VM_PAGER_IGNORE_CLEANCHK 0x0004 #define VM_PAGER_CLUSTER_OK 0x0008 #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 11:43:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAB00106566B; Sun, 4 Jul 2010 11:43:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA0BA8FC15; Sun, 4 Jul 2010 11:43:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64Bhrlq018514; Sun, 4 Jul 2010 11:43:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64BhrmW018511; Sun, 4 Jul 2010 11:43:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201007041143.o64BhrmW018511@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 Jul 2010 11:43: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: r209687 - head/sys/compat/freebsd32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 11:43:53 -0000 Author: kib Date: Sun Jul 4 11:43:53 2010 New Revision: 209687 URL: http://svn.freebsd.org/changeset/base/209687 Log: Constify source argument for siginfo_to_siginfo32(). MFC after: 1 week Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/freebsd32_signal.h Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sun Jul 4 11:26:56 2010 (r209686) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sun Jul 4 11:43:53 2010 (r209687) @@ -2208,7 +2208,7 @@ freebsd32_thr_suspend(struct thread *td, } void -siginfo_to_siginfo32(siginfo_t *src, struct siginfo32 *dst) +siginfo_to_siginfo32(const siginfo_t *src, struct siginfo32 *dst) { bzero(dst, sizeof(*dst)); dst->si_signo = src->si_signo; Modified: head/sys/compat/freebsd32/freebsd32_signal.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_signal.h Sun Jul 4 11:26:56 2010 (r209686) +++ head/sys/compat/freebsd32/freebsd32_signal.h Sun Jul 4 11:43:53 2010 (r209687) @@ -96,6 +96,6 @@ struct sigevent32 { } _sigev_un; }; -void siginfo_to_siginfo32(siginfo_t *src, struct siginfo32 *dst); +void siginfo_to_siginfo32(const siginfo_t *src, struct siginfo32 *dst); #endif /* !_COMPAT_FREEBSD32_SIGNAL_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 11:48:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0127106564A; Sun, 4 Jul 2010 11:48:30 +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 AEC8A8FC15; Sun, 4 Jul 2010 11:48:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64BmUae019605; Sun, 4 Jul 2010 11:48:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64BmU9g019600; Sun, 4 Jul 2010 11:48:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201007041148.o64BmU9g019600@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 Jul 2010 11:48: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: r209688 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 11:48:30 -0000 Author: kib Date: Sun Jul 4 11:48:30 2010 New Revision: 209688 URL: http://svn.freebsd.org/changeset/base/209688 Log: Extend ptrace(PT_LWPINFO) to report siginfo for the signal that caused debugee stop. The change should keep the ABI. Take care of compat32. Discussed with: davidxu, jhb MFC after: 2 weeks Modified: head/sys/kern/kern_sig.c head/sys/kern/sys_process.c head/sys/sys/proc.h head/sys/sys/ptrace.h Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sun Jul 4 11:43:53 2010 (r209687) +++ head/sys/kern/kern_sig.c Sun Jul 4 11:48:30 2010 (r209688) @@ -2522,7 +2522,6 @@ issignal(struct thread *td, int stop_all struct sigacts *ps; struct sigqueue *queue; sigset_t sigpending; - ksiginfo_t ksi; int sig, prop, newsig; p = td->td_proc; @@ -2565,10 +2564,10 @@ issignal(struct thread *td, int stop_all * be thrown away. */ queue = &td->td_sigqueue; - ksi.ksi_signo = 0; - if (sigqueue_get(queue, sig, &ksi) == 0) { + td->td_dbgksi.ksi_signo = 0; + if (sigqueue_get(queue, sig, &td->td_dbgksi) == 0) { queue = &p->p_sigqueue; - sigqueue_get(queue, sig, &ksi); + sigqueue_get(queue, sig, &td->td_dbgksi); } mtx_unlock(&ps->ps_mtx); @@ -2595,13 +2594,13 @@ issignal(struct thread *td, int stop_all continue; signotify(td); } else { - if (ksi.ksi_signo != 0) { - ksi.ksi_flags |= KSI_HEAD; + if (td->td_dbgksi.ksi_signo != 0) { + td->td_dbgksi.ksi_flags |= KSI_HEAD; if (sigqueue_add(&td->td_sigqueue, sig, - &ksi) != 0) - ksi.ksi_signo = 0; + &td->td_dbgksi) != 0) + td->td_dbgksi.ksi_signo = 0; } - if (ksi.ksi_signo == 0) + if (td->td_dbgksi.ksi_signo == 0) sigqueue_add(&td->td_sigqueue, sig, NULL); } Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Sun Jul 4 11:43:53 2010 (r209687) +++ head/sys/kern/sys_process.c Sun Jul 4 11:48:30 2010 (r209688) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #ifdef COMPAT_FREEBSD32 #include +#include struct ptrace_io_desc32 { int piod_op; @@ -85,6 +86,15 @@ struct ptrace_vm_entry32 { uint32_t pve_path; }; +struct ptrace_lwpinfo32 { + lwpid_t pl_lwpid; /* LWP described. */ + int pl_event; /* Event that stopped the LWP. */ + int pl_flags; /* LWP flags. */ + sigset_t pl_sigmask; /* LWP signal mask */ + sigset_t pl_siglist; /* LWP pending signal */ + struct siginfo32 pl_siginfo; /* siginfo for signal */ +}; + #endif /* @@ -498,6 +508,19 @@ ptrace_vm_entry32(struct thread *td, str pve32->pve_pathlen = pve.pve_pathlen; return (error); } + +static void +ptrace_lwpinfo_to32(const struct ptrace_lwpinfo *pl, + struct ptrace_lwpinfo32 *pl32) +{ + + pl32->pl_lwpid = pl->pl_lwpid; + pl32->pl_event = pl->pl_event; + pl32->pl_flags = pl->pl_flags; + pl32->pl_sigmask = pl->pl_sigmask; + pl32->pl_siglist = pl->pl_siglist; + siginfo_to_siginfo32(&pl->pl_siginfo, &pl32->pl_siginfo); +} #endif /* COMPAT_FREEBSD32 */ /* @@ -552,6 +575,7 @@ ptrace(struct thread *td, struct ptrace_ struct fpreg32 fpreg32; struct reg32 reg32; struct ptrace_io_desc32 piod32; + struct ptrace_lwpinfo32 pl32; struct ptrace_vm_entry32 pve32; #endif } r; @@ -662,6 +686,8 @@ kern_ptrace(struct thread *td, int req, #ifdef COMPAT_FREEBSD32 int wrap32 = 0, safe = 0; struct ptrace_io_desc32 *piod32 = NULL; + struct ptrace_lwpinfo32 *pl32 = NULL; + struct ptrace_lwpinfo plr; #endif curp = td->td_proc; @@ -1103,15 +1129,44 @@ kern_ptrace(struct thread *td, int req, break; case PT_LWPINFO: - if (data <= 0 || data > sizeof(*pl)) { + if (data <= 0 || +#ifdef COMPAT_FREEBSD32 + (!wrap32 && data > sizeof(*pl)) || + (wrap32 && data > sizeof(*pl32))) { +#else + data > sizeof(*pl)) { +#endif error = EINVAL; break; } +#ifdef COMPAT_FREEBSD32 + if (wrap32) { + pl = &plr; + pl32 = addr; + } else +#endif pl = addr; pl->pl_lwpid = td2->td_tid; - if (td2->td_dbgflags & TDB_XSIG) - pl->pl_event = PL_EVENT_SIGNAL; pl->pl_flags = 0; + if (td2->td_dbgflags & TDB_XSIG) { + pl->pl_event = PL_EVENT_SIGNAL; + if (td2->td_dbgksi.ksi_signo != 0 && +#ifdef COMPAT_FREEBSD32 + ((!wrap32 && data >= offsetof(struct ptrace_lwpinfo, + pl_siginfo) + sizeof(pl->pl_siginfo)) || + (wrap32 && data >= offsetof(struct ptrace_lwpinfo32, + pl_siginfo) + sizeof(struct siginfo32))) +#else + data >= offsetof(struct ptrace_lwpinfo, pl_siginfo) + + sizeof(pl->pl_siginfo) +#endif + ){ + pl->pl_flags |= PL_FLAG_SI; + pl->pl_siginfo = td2->td_dbgksi.ksi_info; + } + } + if ((pl->pl_flags & PL_FLAG_SI) == 0) + bzero(&pl->pl_siginfo, sizeof(pl->pl_siginfo)); if (td2->td_dbgflags & TDB_SCE) pl->pl_flags |= PL_FLAG_SCE; else if (td2->td_dbgflags & TDB_SCX) @@ -1120,6 +1175,10 @@ kern_ptrace(struct thread *td, int req, pl->pl_flags |= PL_FLAG_EXEC; pl->pl_sigmask = td2->td_sigmask; pl->pl_siglist = td2->td_siglist; +#ifdef COMPAT_FREEBSD32 + if (wrap32) + ptrace_lwpinfo_to32(pl, pl32); +#endif break; case PT_GETNUMLWPS: Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sun Jul 4 11:43:53 2010 (r209687) +++ head/sys/sys/proc.h Sun Jul 4 11:48:30 2010 (r209688) @@ -259,6 +259,7 @@ struct thread { char td_name[MAXCOMLEN + 1]; /* (*) Thread name. */ struct file *td_fpop; /* (k) file referencing cdev under op */ int td_dbgflags; /* (c) Userland debugger flags */ + struct ksiginfo td_dbgksi; /* (c) ksi reflected to debugger. */ int td_ng_outbound; /* (k) Thread entered ng from above. */ struct osd td_osd; /* (k) Object specific data. */ #define td_endzero td_base_pri Modified: head/sys/sys/ptrace.h ============================================================================== --- head/sys/sys/ptrace.h Sun Jul 4 11:43:53 2010 (r209687) +++ head/sys/sys/ptrace.h Sun Jul 4 11:48:30 2010 (r209688) @@ -33,7 +33,7 @@ #ifndef _SYS_PTRACE_H_ #define _SYS_PTRACE_H_ -#include +#include #include #define PT_TRACE_ME 0 /* child declares it's being traced */ @@ -102,8 +102,10 @@ struct ptrace_lwpinfo { #define PL_FLAG_SCE 0x04 /* syscall enter point */ #define PL_FLAG_SCX 0x08 /* syscall leave point */ #define PL_FLAG_EXEC 0x10 /* exec(2) succeeded */ +#define PL_FLAG_SI 0x20 /* siginfo is valid */ sigset_t pl_sigmask; /* LWP signal mask */ sigset_t pl_siglist; /* LWP pending signal */ + struct __siginfo pl_siginfo; /* siginfo for signal */ }; /* Argument structure for PT_VM_ENTRY. */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 12:08:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35F4B106566B; Sun, 4 Jul 2010 12:08:05 +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 248258FC0C; Sun, 4 Jul 2010 12:08:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64C84DI023926; Sun, 4 Jul 2010 12:08:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64C84SH023919; Sun, 4 Jul 2010 12:08:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201007041208.o64C84SH023919@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 Jul 2010 12:08: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: r209689 - head/lib/libthread_db X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 12:08:05 -0000 Author: kib Date: Sun Jul 4 12:08:04 2010 New Revision: 209689 URL: http://svn.freebsd.org/changeset/base/209689 Log: Extend the td_thrinfo_t to include siginfo for the signal that stopped the target. Take care of ABI. Suggested by: davidxu MFC after: 2 weeks Modified: head/lib/libthread_db/Symbol.map head/lib/libthread_db/libpthread_db.c head/lib/libthread_db/libthr_db.c head/lib/libthread_db/thread_db.c head/lib/libthread_db/thread_db.h head/lib/libthread_db/thread_db_int.h Modified: head/lib/libthread_db/Symbol.map ============================================================================== --- head/lib/libthread_db/Symbol.map Sun Jul 4 11:48:30 2010 (r209688) +++ head/lib/libthread_db/Symbol.map Sun Jul 4 12:08:04 2010 (r209689) @@ -19,7 +19,6 @@ FBSD_1.0 { td_thr_dbsuspend; td_thr_event_enable; td_thr_event_getmsg; - td_thr_get_info; td_thr_getfpregs; td_thr_getgregs; #if defined(i386) @@ -33,3 +32,7 @@ FBSD_1.0 { td_thr_tls_get_addr; td_thr_validate; }; + +FBSD_1.2 { + td_thr_get_info; +}; Modified: head/lib/libthread_db/libpthread_db.c ============================================================================== --- head/lib/libthread_db/libpthread_db.c Sun Jul 4 11:48:30 2010 (r209688) +++ head/lib/libthread_db/libpthread_db.c Sun Jul 4 12:08:04 2010 (r209689) @@ -570,7 +570,7 @@ pt_thr_validate(const td_thrhandle_t *th } static td_err_e -pt_thr_get_info(const td_thrhandle_t *th, td_thrinfo_t *info) +pt_thr_old_get_info(const td_thrhandle_t *th, td_old_thrinfo_t *info) { const td_thragent_t *ta = th->th_ta; struct ptrace_lwpinfo linfo; @@ -659,6 +659,16 @@ pt_thr_get_info(const td_thrhandle_t *th return (0); } +static td_err_e +pt_thr_get_info(const td_thrhandle_t *th, td_thrinfo_t *info) +{ + td_err_e e; + + e = pt_thr_old_get_info(th, (td_old_thrinfo_t *)info); + bzero(&info->ti_siginfo, sizeof(info->ti_siginfo)); + return (e); +} + #ifdef __i386__ static td_err_e pt_thr_getxmmregs(const td_thrhandle_t *th, char *fxsave) @@ -1114,6 +1124,7 @@ struct ta_ops libpthread_db_ops = { .to_thr_dbsuspend = pt_thr_dbsuspend, .to_thr_event_enable = pt_thr_event_enable, .to_thr_event_getmsg = pt_thr_event_getmsg, + .to_thr_old_get_info = pt_thr_old_get_info, .to_thr_get_info = pt_thr_get_info, .to_thr_getfpregs = pt_thr_getfpregs, .to_thr_getgregs = pt_thr_getgregs, Modified: head/lib/libthread_db/libthr_db.c ============================================================================== --- head/lib/libthread_db/libthr_db.c Sun Jul 4 11:48:30 2010 (r209688) +++ head/lib/libthread_db/libthr_db.c Sun Jul 4 12:08:04 2010 (r209689) @@ -453,7 +453,7 @@ pt_thr_validate(const td_thrhandle_t *th } static td_err_e -pt_thr_get_info(const td_thrhandle_t *th, td_thrinfo_t *info) +pt_thr_get_info_common(const td_thrhandle_t *th, td_thrinfo_t *info, int old) { const td_thragent_t *ta = th->th_ta; struct ptrace_lwpinfo linfo; @@ -489,6 +489,13 @@ pt_thr_get_info(const td_thrhandle_t *th if (ret == PS_OK) { info->ti_sigmask = linfo.pl_sigmask; info->ti_pending = linfo.pl_siglist; + if (!old) { + if ((linfo.pl_flags & PL_FLAG_SI) != 0) + info->ti_siginfo = linfo.pl_siginfo; + else + bzero(&info->ti_siginfo, + sizeof(info->ti_siginfo)); + } } else return (ret); if (state == ta->thread_state_running) @@ -501,6 +508,20 @@ pt_thr_get_info(const td_thrhandle_t *th return (0); } +static td_err_e +pt_thr_old_get_info(const td_thrhandle_t *th, td_old_thrinfo_t *info) +{ + + return (pt_thr_get_info_common(th, (td_thrinfo_t *)info, 1)); +} + +static td_err_e +pt_thr_get_info(const td_thrhandle_t *th, td_thrinfo_t *info) +{ + + return (pt_thr_get_info_common(th, info, 0)); +} + #ifdef __i386__ static td_err_e pt_thr_getxmmregs(const td_thrhandle_t *th, char *fxsave) @@ -761,6 +782,7 @@ struct ta_ops libthr_db_ops = { .to_thr_dbsuspend = pt_thr_dbsuspend, .to_thr_event_enable = pt_thr_event_enable, .to_thr_event_getmsg = pt_thr_event_getmsg, + .to_thr_old_get_info = pt_thr_old_get_info, .to_thr_get_info = pt_thr_get_info, .to_thr_getfpregs = pt_thr_getfpregs, .to_thr_getgregs = pt_thr_getgregs, Modified: head/lib/libthread_db/thread_db.c ============================================================================== --- head/lib/libthread_db/thread_db.c Sun Jul 4 11:48:30 2010 (r209688) +++ head/lib/libthread_db/thread_db.c Sun Jul 4 12:08:04 2010 (r209689) @@ -176,6 +176,14 @@ td_thr_event_getmsg(const td_thrhandle_t } td_err_e +td_thr_old_get_info(const td_thrhandle_t *th, td_old_thrinfo_t *info) +{ + const td_thragent_t *ta = th->th_ta; + return (ta->ta_ops->to_thr_old_get_info(th, info)); +} +__sym_compat(td_thr_get_info, td_thr_old_get_info, FBSD_1.0); + +td_err_e td_thr_get_info(const td_thrhandle_t *th, td_thrinfo_t *info) { const td_thragent_t *ta = th->th_ta; Modified: head/lib/libthread_db/thread_db.h ============================================================================== --- head/lib/libthread_db/thread_db.h Sun Jul 4 11:48:30 2010 (r209688) +++ head/lib/libthread_db/thread_db.h Sun Jul 4 12:08:04 2010 (r209689) @@ -191,6 +191,7 @@ typedef struct { psaddr_t ti_startfunc; psaddr_t ti_stkbase; size_t ti_stksize; + siginfo_t ti_siginfo; } td_thrinfo_t; /* Modified: head/lib/libthread_db/thread_db_int.h ============================================================================== --- head/lib/libthread_db/thread_db_int.h Sun Jul 4 11:48:30 2010 (r209688) +++ head/lib/libthread_db/thread_db_int.h Sun Jul 4 12:08:04 2010 (r209689) @@ -32,6 +32,25 @@ #include #include +typedef struct { + const td_thragent_t *ti_ta_p; + thread_t ti_tid; + psaddr_t ti_thread; + td_thr_state_e ti_state; + td_thr_type_e ti_type; + td_thr_events_t ti_events; + int ti_pri; + lwpid_t ti_lid; + char ti_db_suspended; + char ti_traceme; + sigset_t ti_sigmask; + sigset_t ti_pending; + psaddr_t ti_tls; + psaddr_t ti_startfunc; + psaddr_t ti_stkbase; + size_t ti_stksize; +} td_old_thrinfo_t; + #define TD_THRAGENT_FIELDS \ struct ta_ops *ta_ops; \ TAILQ_ENTRY(td_thragent) ta_next; \ @@ -65,6 +84,8 @@ struct ta_ops { td_err_e (*to_thr_event_enable)(const td_thrhandle_t *, int); td_err_e (*to_thr_event_getmsg)(const td_thrhandle_t *, td_event_msg_t *); + td_err_e (*to_thr_old_get_info)(const td_thrhandle_t *, + td_old_thrinfo_t *); td_err_e (*to_thr_get_info)(const td_thrhandle_t *, td_thrinfo_t *); td_err_e (*to_thr_getfpregs)(const td_thrhandle_t *, prfpregset_t *); td_err_e (*to_thr_getgregs)(const td_thrhandle_t *, prgregset_t); @@ -103,4 +124,6 @@ int thr_pwrite_int(const struct td_thrag int thr_pwrite_long(const struct td_thragent *, psaddr_t, uint64_t); int thr_pwrite_ptr(const struct td_thragent *, psaddr_t, psaddr_t); +td_err_e td_thr_old_get_info(const td_thrhandle_t *th, td_old_thrinfo_t *info); + #endif /* _THREAD_DB_INT_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 12:09:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2C39106564A; Sun, 4 Jul 2010 12:09:30 +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 D205F8FC0A; Sun, 4 Jul 2010 12:09:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64C9U8R024283; Sun, 4 Jul 2010 12:09:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64C9UL7024281; Sun, 4 Jul 2010 12:09:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201007041209.o64C9UL7024281@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 Jul 2010 12:09: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: r209690 - head/gnu/usr.bin/gdb/libgdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 12:09:31 -0000 Author: kib Date: Sun Jul 4 12:09:30 2010 New Revision: 209690 URL: http://svn.freebsd.org/changeset/base/209690 Log: For "thread signal" command, print some information from siginfo when available. Suggested by: davidxu MFC after: 2 weeks Modified: head/gnu/usr.bin/gdb/libgdb/fbsd-threads.c Modified: head/gnu/usr.bin/gdb/libgdb/fbsd-threads.c ============================================================================== --- head/gnu/usr.bin/gdb/libgdb/fbsd-threads.c Sun Jul 4 12:08:04 2010 (r209689) +++ head/gnu/usr.bin/gdb/libgdb/fbsd-threads.c Sun Jul 4 12:09:30 2010 (r209690) @@ -1299,6 +1299,7 @@ fbsd_thread_signal_cmd (char *exp, int f td_thrhandle_t th; td_thrinfo_t ti; td_err_e err; + const char *code; if (!fbsd_thread_active || !IS_THREAD(inferior_ptid)) return; @@ -1315,6 +1316,42 @@ fbsd_thread_signal_cmd (char *exp, int f fbsd_print_sigset(&ti.ti_sigmask); printf_filtered("signal pending:\n"); fbsd_print_sigset(&ti.ti_pending); + if (ti.ti_siginfo.si_signo != 0) { + printf_filtered("si_signo %d si_errno %d", ti.ti_siginfo.si_signo, + ti.ti_siginfo.si_errno); + if (ti.ti_siginfo.si_errno != 0) + printf_filtered(" (%s)", strerror(ti.ti_siginfo.si_errno)); + printf_filtered("\n"); + switch (ti.ti_siginfo.si_code) { + case SI_NOINFO: + code = "NOINFO"; + break; + case SI_USER: + code = "USER"; + break; + case SI_QUEUE: + code = "QUEUE"; + break; + case SI_TIMER: + code = "TIMER"; + break; + case SI_ASYNCIO: + code = "ASYNCIO"; + break; + case SI_MESGQ: + code = "MESGQ"; + break; + case SI_KERNEL: + code = "KERNEL"; + break; + default: + code = "UNKNOWN"; + break; + } + printf_filtered("si_code %s si_pid %d si_uid %d si_status %x si_addr %p\n", + code, ti.ti_siginfo.si_pid, ti.ti_siginfo.si_uid, ti.ti_siginfo.si_status, + ti.ti_siginfo.si_addr); + } } static int From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 12:22:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 766951065670; Sun, 4 Jul 2010 12:22:18 +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 653C88FC21; Sun, 4 Jul 2010 12:22:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64CMIfD027176; Sun, 4 Jul 2010 12:22:18 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64CMIhx027174; Sun, 4 Jul 2010 12:22:18 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201007041222.o64CMIhx027174@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 4 Jul 2010 12:22:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209691 - stable/8/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 12:22:18 -0000 Author: bz Date: Sun Jul 4 12:22:17 2010 New Revision: 209691 URL: http://svn.freebsd.org/changeset/base/209691 Log: MFC r208508: MFp4 @178283: Improve IPsec flow distribution for better netisr parallelism. Instead of using the pointer that would have the last bits masked in a % statement in netisr_select_cpuid() to select the queue, use the SPI. Reviewed by: rwatson Modified: stable/8/sys/netipsec/ipsec_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netipsec/ipsec_input.c ============================================================================== --- stable/8/sys/netipsec/ipsec_input.c Sun Jul 4 12:09:30 2010 (r209690) +++ stable/8/sys/netipsec/ipsec_input.c Sun Jul 4 12:22:17 2010 (r209691) @@ -489,7 +489,7 @@ ipsec4_common_input_cb(struct mbuf *m, s /* * Re-dispatch via software interrupt. */ - if ((error = netisr_queue_src(NETISR_IP, (uintptr_t)sav, m))) { + if ((error = netisr_queue_src(NETISR_IP, (uintptr_t)sav->spi, m))) { IPSEC_ISTAT(sproto, V_espstat.esps_qfull, V_ahstat.ahs_qfull, V_ipcompstat.ipcomps_qfull); From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 12:27:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4661B106566B; Sun, 4 Jul 2010 12:27:19 +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 34A568FC12; Sun, 4 Jul 2010 12:27:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64CRJvm028323; Sun, 4 Jul 2010 12:27:19 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64CRJ2K028318; Sun, 4 Jul 2010 12:27:19 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201007041227.o64CRJ2K028318@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 4 Jul 2010 12:27:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209692 - in stable/8: share/man/man4 sys/ddb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 12:27:19 -0000 Author: bz Date: Sun Jul 4 12:27:18 2010 New Revision: 209692 URL: http://svn.freebsd.org/changeset/base/209692 Log: MFC r208509: MFp4 @178364: Implement an optional delay to the ddb reset/reboot command. This allows textdumps to be run automatically with unattended reboots after a resonable timeout, while still permitting an administrator to break into debugger if attached to the console at the time of the event for further debugging. Cap the maximum delay at 1 week to avoid highly accidental results, and default to 15s in case of problems parsing the timeout value. Move hex2dec helper function from db_thread.c to db_command.c to make it generally available and prefix it with a "db_" to avoid namespace collisions. Reviewed by: rwatson Modified: stable/8/share/man/man4/ddb.4 stable/8/sys/ddb/db_command.c stable/8/sys/ddb/db_command.h stable/8/sys/ddb/db_thread.c Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/share/man/man4/ddb.4 ============================================================================== --- stable/8/share/man/man4/ddb.4 Sun Jul 4 12:22:17 2010 (r209691) +++ stable/8/share/man/man4/ddb.4 Sun Jul 4 12:27:18 2010 (r209692) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2008 +.Dd May 24, 2010 .Dt DDB 4 .Os .Sh NAME @@ -1092,9 +1092,13 @@ for a list of signals. Note that the arguments are reversed relative to .Xr kill 2 . .Pp -.It Ic reboot -.It Ic reset +.It Ic reboot Op Ar seconds +.It Ic reset Op Ar seconds Hard reset the system. +If the optional argument +.Ar seconds +is given, the debugger will wait for this long, at most a week, +before rebooting. .Pp .It Ic help Print a short summary of the available commands and command Modified: stable/8/sys/ddb/db_command.c ============================================================================== --- stable/8/sys/ddb/db_command.c Sun Jul 4 12:22:17 2010 (r209691) +++ stable/8/sys/ddb/db_command.c Sun Jul 4 12:27:18 2010 (r209692) @@ -661,13 +661,42 @@ out: #undef DB_ERROR } +/* + * Reboot. In case there is an additional argument, take it as delay in + * seconds. Default to 15s if we cannot parse it and make sure we will + * never wait longer than 1 week. Some code is similar to + * kern_shutdown.c:shutdown_panic(). + */ +#ifndef DB_RESET_MAXDELAY +#define DB_RESET_MAXDELAY (3600 * 24 * 7) +#endif + static void -db_reset(dummy1, dummy2, dummy3, dummy4) - db_expr_t dummy1; - boolean_t dummy2; - db_expr_t dummy3; - char * dummy4; +db_reset(db_expr_t addr, boolean_t have_addr, db_expr_t count __unused, + char *modif __unused) { + int delay, loop; + + if (have_addr) { + delay = (int)db_hex2dec(addr); + + /* If we parse to fail, use 15s. */ + if (delay == -1) + delay = 15; + + /* Cap at one week. */ + if ((uintmax_t)delay > (uintmax_t)DB_RESET_MAXDELAY) + delay = DB_RESET_MAXDELAY; + + db_printf("Automatic reboot in %d seconds - " + "press a key on the console to abort\n", delay); + for (loop = delay * 10; loop > 0; --loop) { + DELAY(1000 * 100); /* 1/10th second */ + /* Did user type a key? */ + if (cncheckc() != -1) + return; + } + } cpu_reset(); } @@ -771,3 +800,28 @@ db_stack_trace_all(db_expr_t dummy, bool kdb_jmpbuf(prev_jb); } } + +/* + * Take the parsed expression value from the command line that was parsed + * as a hexadecimal value and convert it as if the expression was parsed + * as a decimal value. Returns -1 if the expression was not a valid + * decimal value. + */ +db_expr_t +db_hex2dec(db_expr_t expr) +{ + uintptr_t x, y; + db_expr_t val; + + y = 1; + val = 0; + x = expr; + while (x != 0) { + if (x % 16 > 9) + return (-1); + val += (x % 16) * (y); + x >>= 4; + y *= 10; + } + return (val); +} Modified: stable/8/sys/ddb/db_command.h ============================================================================== --- stable/8/sys/ddb/db_command.h Sun Jul 4 12:22:17 2010 (r209691) +++ stable/8/sys/ddb/db_command.h Sun Jul 4 12:27:18 2010 (r209692) @@ -33,6 +33,12 @@ * Author: David B. Golub, Carnegie Mellon University * Date: 7/90 */ + +/* + * Helper functions. + */ +db_expr_t db_hex2dec(db_expr_t expr); + /* * Command loop declarations. */ Modified: stable/8/sys/ddb/db_thread.c ============================================================================== --- stable/8/sys/ddb/db_thread.c Sun Jul 4 12:22:17 2010 (r209691) +++ stable/8/sys/ddb/db_thread.c Sun Jul 4 12:27:18 2010 (r209692) @@ -38,8 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -static db_expr_t hex2dec(db_expr_t expr); - void db_print_thread(void) { @@ -108,31 +106,6 @@ db_show_threads(db_expr_t addr, boolean_ } /* - * Take the parsed expression value from the command line that was parsed - * as a hexadecimal value and convert it as if the expression was parsed - * as a decimal value. Returns -1 if the expression was not a valid - * decimal value. - */ -static db_expr_t -hex2dec(db_expr_t expr) -{ - uintptr_t x, y; - db_expr_t val; - - y = 1; - val = 0; - x = expr; - while (x != 0) { - if (x % 16 > 9) - return (-1); - val += (x % 16) * (y); - x >>= 4; - y *= 10; - } - return (val); -} - -/* * Lookup a thread based on a db expression address. We assume that the * address was parsed in hexadecimal. We reparse the address in decimal * first and try to treat it as a thread ID to find an associated thread. @@ -151,7 +124,7 @@ db_lookup_thread(db_expr_t addr, boolean * If the parsed address was not a valid decimal expression, * assume it is a thread pointer. */ - decaddr = hex2dec(addr); + decaddr = db_hex2dec(addr); if (decaddr == -1) return ((struct thread *)addr); @@ -183,7 +156,7 @@ db_lookup_proc(db_expr_t addr) db_expr_t decaddr; struct proc *p; - decaddr = hex2dec(addr); + decaddr = db_hex2dec(addr); if (decaddr != -1) { FOREACH_PROC_IN_SYSTEM(p) { if (p->p_pid == decaddr) From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 12:28:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D99E106566C; Sun, 4 Jul 2010 12:28:03 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 440CA8FC12; Sun, 4 Jul 2010 12:28:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64CS3DY028527; Sun, 4 Jul 2010 12:28:03 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64CS39c028525; Sun, 4 Jul 2010 12:28:03 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201007041228.o64CS39c028525@svn.freebsd.org> From: Rui Paulo Date: Sun, 4 Jul 2010 12:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209693 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 12:28:03 -0000 Author: rpaulo Date: Sun Jul 4 12:28:02 2010 New Revision: 209693 URL: http://svn.freebsd.org/changeset/base/209693 Log: Release bschmidt from mentorship. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Sun Jul 4 12:27:18 2010 (r209692) +++ svnadmin/conf/mentors Sun Jul 4 12:28:02 2010 (r209693) @@ -13,7 +13,6 @@ ae mav Co-mentor: kib anchie bz brucec rrs -bschmidt rpaulo Co-mentor: thompsa cbzimmer sam dchagin kib eri mlaier Co-mentor: thompsa From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 12:30:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E08C8106566B; Sun, 4 Jul 2010 12:30:55 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF4C38FC12; Sun, 4 Jul 2010 12:30:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64CUtVT029199; Sun, 4 Jul 2010 12:30:55 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64CUt0K029197; Sun, 4 Jul 2010 12:30:55 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201007041230.o64CUt0K029197@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 4 Jul 2010 12:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209694 - stable/8/sys/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 12:30:56 -0000 Author: bschmidt Date: Sun Jul 4 12:30:55 2010 New Revision: 209694 URL: http://svn.freebsd.org/changeset/base/209694 Log: MFC r209169: Fix TX retry rate handling. tx->linkq is an index to a rate table beginning with the highest available rate. Currently we always use 54m for the first retry no matter what AMRR has choosen. Fix this by setting the index to the next lower rate. Approved by: rpaulo (mentor) Tested by: Brandon Gooch Modified: stable/8/sys/dev/iwn/if_iwn.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/8/sys/dev/iwn/if_iwn.c Sun Jul 4 12:28:02 2010 (r209693) +++ stable/8/sys/dev/iwn/if_iwn.c Sun Jul 4 12:30:55 2010 (r209694) @@ -3007,7 +3007,7 @@ iwn_tx_data(struct iwn_softc *sc, struct txant = IWN_LSB(sc->txchainmask); tx->rflags |= IWN_RFLAG_ANT(txant); } else { - tx->linkq = 0; + tx->linkq = IWN_RIDX_OFDM54 - ridx; flags |= IWN_TX_LINKQ; /* enable MRR */ } From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 12:43:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA0771065670; Sun, 4 Jul 2010 12:43:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9921B8FC1B; Sun, 4 Jul 2010 12:43:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64ChCgI032924; Sun, 4 Jul 2010 12:43:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64ChCEG032922; Sun, 4 Jul 2010 12:43:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201007041243.o64ChCEG032922@svn.freebsd.org> From: Marius Strobl Date: Sun, 4 Jul 2010 12:43: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: r209695 - head/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 12:43:12 -0000 Author: marius Date: Sun Jul 4 12:43:12 2010 New Revision: 209695 URL: http://svn.freebsd.org/changeset/base/209695 Log: - Pin the IPI cache and TLB demap functions in order to prevent migration between determining the other CPUs and calling cpu_ipi_selected(), which apart from generally doing the wrong thing can lead to a panic when a CPU is told to IPI itself (which sun4u doesn't support). Reported and tested by: Nathaniel W Filardo - Add __unused where appropriate. MFC after: 3 days Modified: head/sys/sparc64/include/smp.h Modified: head/sys/sparc64/include/smp.h ============================================================================== --- head/sys/sparc64/include/smp.h Sun Jul 4 12:30:55 2010 (r209694) +++ head/sys/sparc64/include/smp.h Sun Jul 4 12:43:12 2010 (r209695) @@ -38,6 +38,9 @@ #ifndef LOCORE +#include +#include + #include #include #include @@ -139,6 +142,7 @@ ipi_dcache_page_inval(void *func, vm_pad if (smp_cpus == 1) return (NULL); + sched_pin(); ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); ica->ica_mask = all_cpus; @@ -154,6 +158,7 @@ ipi_icache_page_inval(void *func, vm_pad if (smp_cpus == 1) return (NULL); + sched_pin(); ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); ica->ica_mask = all_cpus; @@ -170,8 +175,11 @@ ipi_tlb_context_demap(struct pmap *pm) if (smp_cpus == 1) return (NULL); - if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) + sched_pin(); + if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) { + sched_unpin(); return (NULL); + } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus | PCPU_GET(cpumask); @@ -189,8 +197,11 @@ ipi_tlb_page_demap(struct pmap *pm, vm_o if (smp_cpus == 1) return (NULL); - if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) + sched_pin(); + if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) { + sched_unpin(); return (NULL); + } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus | PCPU_GET(cpumask); @@ -208,8 +219,11 @@ ipi_tlb_range_demap(struct pmap *pm, vm_ if (smp_cpus == 1) return (NULL); - if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) + sched_pin(); + if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) { + sched_unpin(); return (NULL); + } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus | PCPU_GET(cpumask); @@ -230,6 +244,7 @@ ipi_wait(void *cookie) while (*mask != 0) ; mtx_unlock_spin(&ipi_mtx); + sched_unpin(); } } @@ -242,35 +257,36 @@ ipi_wait(void *cookie) #ifndef LOCORE static __inline void * -ipi_dcache_page_inval(void *func, vm_paddr_t pa) +ipi_dcache_page_inval(void *func __unused, vm_paddr_t pa __unused) { return (NULL); } static __inline void * -ipi_icache_page_inval(void *func, vm_paddr_t pa) +ipi_icache_page_inval(void *func __unused, vm_paddr_t pa __unused) { return (NULL); } static __inline void * -ipi_tlb_context_demap(struct pmap *pm) +ipi_tlb_context_demap(struct pmap *pm __unused) { return (NULL); } static __inline void * -ipi_tlb_page_demap(struct pmap *pm, vm_offset_t va) +ipi_tlb_page_demap(struct pmap *pm __unused, vm_offset_t va __unused) { return (NULL); } static __inline void * -ipi_tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end) +ipi_tlb_range_demap(struct pmap *pm __unused, vm_offset_t start __unused, + __unused vm_offset_t end) { return (NULL); From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 18:16:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE40E106564A; Sun, 4 Jul 2010 18:16:17 +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 CC6F08FC1E; Sun, 4 Jul 2010 18:16:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64IGHZx007312; Sun, 4 Jul 2010 18:16:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64IGHvV007310; Sun, 4 Jul 2010 18:16:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201007041816.o64IGHvV007310@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 Jul 2010 18:16: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: r209697 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 18:16:18 -0000 Author: kib Date: Sun Jul 4 18:16:17 2010 New Revision: 209697 URL: http://svn.freebsd.org/changeset/base/209697 Log: Obey sv_syscallnames bounds in syscallname(). Reported and tested by: pho Modified: head/sys/kern/subr_trap.c Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Sun Jul 4 17:37:28 2010 (r209696) +++ head/sys/kern/subr_trap.c Sun Jul 4 18:16:17 2010 (r209697) @@ -245,10 +245,12 @@ const char * syscallname(struct proc *p, u_int code) { static const char unknown[] = "unknown"; + struct sysentvec *sv; - if (p->p_sysent->sv_syscallnames == NULL) + sv = p->p_sysent; + if (sv->sv_syscallnames == NULL || code >= sv->sv_size) return (unknown); - return (p->p_sysent->sv_syscallnames[code]); + return (sv->sv_syscallnames[code]); } int From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 18:41:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D314106564A; Sun, 4 Jul 2010 18:41:00 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79ED28FC0C; Sun, 4 Jul 2010 18:41:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64If0OE012891; Sun, 4 Jul 2010 18:41:00 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64If0A1012889; Sun, 4 Jul 2010 18:41:00 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201007041841.o64If0A1012889@svn.freebsd.org> From: Christian Brueffer Date: Sun, 4 Jul 2010 18:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209698 - stable/8/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 18:41:00 -0000 Author: brueffer Date: Sun Jul 4 18:41:00 2010 New Revision: 209698 URL: http://svn.freebsd.org/changeset/base/209698 Log: MFC: r207946 The previous revision actually removed the bug being hinted at, so go ahead and remove the hint. Modified: stable/8/lib/libc/stdlib/strtod.3 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/stdlib/strtod.3 ============================================================================== --- stable/8/lib/libc/stdlib/strtod.3 Sun Jul 4 18:16:17 2010 (r209697) +++ stable/8/lib/libc/stdlib/strtod.3 Sun Jul 4 18:41:00 2010 (r209698) @@ -32,7 +32,7 @@ .\" @(#)strtod.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 2, 2003 +.Dd May 11, 2010 .Dt STRTOD 3 .Os .Sh NAME @@ -169,8 +169,7 @@ The .Fn strtod function conforms to -.St -isoC-99 , -with the exception of the bug noted below. +.St -isoC-99 . .Sh AUTHORS The author of this software is .An David M. Gay . From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 18:44:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AC89106564A; Sun, 4 Jul 2010 18:44:32 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67BBD8FC08; Sun, 4 Jul 2010 18:44:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64IiWNZ013744; Sun, 4 Jul 2010 18:44:32 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64IiW6f013742; Sun, 4 Jul 2010 18:44:32 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201007041844.o64IiW6f013742@svn.freebsd.org> From: Christian Brueffer Date: Sun, 4 Jul 2010 18:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209699 - stable/7/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 18:44:32 -0000 Author: brueffer Date: Sun Jul 4 18:44:32 2010 New Revision: 209699 URL: http://svn.freebsd.org/changeset/base/209699 Log: MFC: r207946 The previous revision actually removed the bug being hinted at, so go ahead and remove the hint. Modified: stable/7/lib/libc/stdlib/strtod.3 Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/stdlib/strtod.3 ============================================================================== --- stable/7/lib/libc/stdlib/strtod.3 Sun Jul 4 18:41:00 2010 (r209698) +++ stable/7/lib/libc/stdlib/strtod.3 Sun Jul 4 18:44:32 2010 (r209699) @@ -32,7 +32,7 @@ .\" @(#)strtod.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 2, 2003 +.Dd May 11, 2010 .Dt STRTOD 3 .Os .Sh NAME @@ -148,8 +148,7 @@ The .Fn strtod function conforms to -.St -isoC-99 , -with the exception of the bug noted below. +.St -isoC-99 . .Sh AUTHORS The author of this software is .An David M. Gay . From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 18:48:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B7C2106564A; Sun, 4 Jul 2010 18:48:44 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E91F8FC0C; Sun, 4 Jul 2010 18:48:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64Imh2O014739; Sun, 4 Jul 2010 18:48:44 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64Imh6r014737; Sun, 4 Jul 2010 18:48:43 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201007041848.o64Imh6r014737@svn.freebsd.org> From: Christian Brueffer Date: Sun, 4 Jul 2010 18:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209700 - stable/8/usr.bin/make X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 18:48:44 -0000 Author: brueffer Date: Sun Jul 4 18:48:43 2010 New Revision: 209700 URL: http://svn.freebsd.org/changeset/base/209700 Log: MFC: r207948 - Missing full stops - Upper case the first character of an description - Section headings do not need to be quoted. From OpenBSD's make.1, revision 1.81 - Plural of suffix is suffixes. From OpenBSD's make.1, revision 1.61 - s/seperating/separating/ Modified: stable/8/usr.bin/make/make.1 Directory Properties: stable/8/usr.bin/make/ (props changed) Modified: stable/8/usr.bin/make/make.1 ============================================================================== --- stable/8/usr.bin/make/make.1 Sun Jul 4 18:44:32 2010 (r209699) +++ stable/8/usr.bin/make/make.1 Sun Jul 4 18:48:43 2010 (r209700) @@ -960,7 +960,7 @@ Otherwise is the substring of .Ar old_string to be replaced in -.Ar new_string +.Ar new_string . .It Cm T Replaces each word in the variable with its last component. .It Cm U @@ -1108,7 +1108,7 @@ The may be any one of the following: .Bl -tag -width "Cm XX" .It Cm || -logical +Logical .Tn OR .It Cm && Logical @@ -1298,7 +1298,7 @@ made before the sources that succeed it Loops are not being detected and targets that form loops will be silently ignored. .El -.Sh "SPECIAL TARGETS" +.Sh SPECIAL TARGETS Special targets may not be included with other targets, i.e., they must be the only target specified. .Bl -tag -width Ic @@ -1590,7 +1590,7 @@ command in the file. .It Ic .SUFFIXES Each source specifies a suffix to .Nm . -If no sources are specified, any previous specified suffices are deleted. +If no sources are specified, any previous specified suffixes are deleted. .It Ic .WARN Each source specifies a warning flag as previously described for the .Fl x @@ -1603,7 +1603,7 @@ environment variables so that a warning line will influence all sub-makes. Several flags can be specified on a single .Ic .WARN -target by seperating them with blanks. +target by separating them with blanks. .El .Sh REMAKING MAKEFILES If the special target @@ -1748,7 +1748,7 @@ The evaluation of .Ar expression in a test is very simple-minded. Currently, the only form that works is -.Ql .if ${VAR} op something +.Ql .if ${VAR} op something . For instance, you should write tests as .Ql .if ${VAR} == "string" not the other way around, which would give you an error. From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 18:49:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61DE41065743; Sun, 4 Jul 2010 18:49:16 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 353D68FC1B; Sun, 4 Jul 2010 18:49:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64InGg4014888; Sun, 4 Jul 2010 18:49:16 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64InGVp014886; Sun, 4 Jul 2010 18:49:16 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201007041849.o64InGVp014886@svn.freebsd.org> From: Christian Brueffer Date: Sun, 4 Jul 2010 18:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209701 - stable/7/usr.bin/make X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 18:49:16 -0000 Author: brueffer Date: Sun Jul 4 18:49:15 2010 New Revision: 209701 URL: http://svn.freebsd.org/changeset/base/209701 Log: MFC: r207948 - Missing full stops - Upper case the first character of an description - Section headings do not need to be quoted. From OpenBSD's make.1, revision 1.81 - Plural of suffix is suffixes. From OpenBSD's make.1, revision 1.61 - s/seperating/separating/ Modified: stable/7/usr.bin/make/make.1 Directory Properties: stable/7/usr.bin/make/ (props changed) Modified: stable/7/usr.bin/make/make.1 ============================================================================== --- stable/7/usr.bin/make/make.1 Sun Jul 4 18:48:43 2010 (r209700) +++ stable/7/usr.bin/make/make.1 Sun Jul 4 18:49:15 2010 (r209701) @@ -960,7 +960,7 @@ Otherwise is the substring of .Ar old_string to be replaced in -.Ar new_string +.Ar new_string . .It Cm T Replaces each word in the variable with its last component. .It Cm U @@ -1108,7 +1108,7 @@ The may be any one of the following: .Bl -tag -width "Cm XX" .It Cm || -logical +Logical .Tn OR .It Cm && Logical @@ -1298,7 +1298,7 @@ made before the sources that succeed it Loops are not being detected and targets that form loops will be silently ignored. .El -.Sh "SPECIAL TARGETS" +.Sh SPECIAL TARGETS Special targets may not be included with other targets, i.e., they must be the only target specified. .Bl -tag -width Ic @@ -1590,7 +1590,7 @@ command in the file. .It Ic .SUFFIXES Each source specifies a suffix to .Nm . -If no sources are specified, any previous specified suffices are deleted. +If no sources are specified, any previous specified suffixes are deleted. .It Ic .WARN Each source specifies a warning flag as previously described for the .Fl x @@ -1603,7 +1603,7 @@ environment variables so that a warning line will influence all sub-makes. Several flags can be specified on a single .Ic .WARN -target by seperating them with blanks. +target by separating them with blanks. .El .Sh REMAKING MAKEFILES If the special target @@ -1748,7 +1748,7 @@ The evaluation of .Ar expression in a test is very simple-minded. Currently, the only form that works is -.Ql .if ${VAR} op something +.Ql .if ${VAR} op something . For instance, you should write tests as .Ql .if ${VAR} == "string" not the other way around, which would give you an error. From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 19:02:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65CAA106564A; Sun, 4 Jul 2010 19:02: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 3A31A8FC0C; Sun, 4 Jul 2010 19:02:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64J2Wi1017927; Sun, 4 Jul 2010 19:02:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64J2WBn017925; Sun, 4 Jul 2010 19:02:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201007041902.o64J2WBn017925@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 Jul 2010 19:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209702 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 19:02:33 -0000 Author: kib Date: Sun Jul 4 19:02:32 2010 New Revision: 209702 URL: http://svn.freebsd.org/changeset/base/209702 Log: Several cleanups for the r209686: - remove unused defines; - remove unused curgeneration argument for vm_object_page_collect_flush(); - always assert that vm_object_page_clean() is called for OBJT_VNODE; - move vm_page_find_least() into for() statement initial clause. Submitted by: alc Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun Jul 4 18:49:15 2010 (r209701) +++ head/sys/vm/vm_object.c Sun Jul 4 19:02:32 2010 (r209702) @@ -96,17 +96,13 @@ __FBSDID("$FreeBSD$"); #include #include -#define EASY_SCAN_FACTOR 8 - -#define MSYNC_FLUSH_HARDSEQ 0x01 -#define MSYNC_FLUSH_SOFTSEQ 0x02 - static int old_msync; SYSCTL_INT(_vm, OID_AUTO, old_msync, CTLFLAG_RW, &old_msync, 0, "Use old (insecure) msync behavior"); +static int vm_object_page_collect_flush(vm_object_t object, vm_page_t p, + int pagerflags); static void vm_object_qcollapse(vm_object_t object); -static int vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int curgeneration, int pagerflags); static void vm_object_vndeallocate(vm_object_t object); /* @@ -764,10 +760,10 @@ vm_object_page_clean(vm_object_t object, mtx_assert(&vm_page_queue_mtx, MA_NOTOWNED); VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + KASSERT(object->type == OBJT_VNODE, ("Not a vnode object")); if ((object->flags & OBJ_MIGHTBEDIRTY) == 0 || object->resident_page_count == 0) return; - KASSERT(object->type == OBJT_VNODE, ("Not a vnode object")); pagerflags = (flags & (OBJPC_SYNC | OBJPC_INVAL)) != 0 ? VM_PAGER_PUT_SYNC : VM_PAGER_CLUSTER_OK; @@ -798,10 +794,9 @@ vm_object_page_clean(vm_object_t object, vm_object_clear_flag(object, OBJ_MIGHTBEDIRTY); rescan: - p = vm_page_find_least(object, start); curgeneration = object->generation; - for (; p != NULL; p = np) { + for (p = vm_page_find_least(object, start); p != NULL; p = np) { pi = p->pindex; if (pi >= tend) break; @@ -825,8 +820,7 @@ rescan: (p->oflags & VPO_NOSYNC) != 0) continue; - n = vm_object_page_collect_flush(object, p, - curgeneration, pagerflags); + n = vm_object_page_collect_flush(object, p, pagerflags); KASSERT(n > 0, ("vm_object_page_collect_flush failed")); if (object->generation != curgeneration) goto rescan; @@ -840,8 +834,7 @@ rescan: } static int -vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int curgeneration, - int pagerflags) +vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int pagerflags) { int runlen; int maxf; From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 20:39:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AD51106564A; Sun, 4 Jul 2010 20:39:07 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69AA38FC13; Sun, 4 Jul 2010 20:39:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64Kd707039039; Sun, 4 Jul 2010 20:39:07 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64Kd7p7039037; Sun, 4 Jul 2010 20:39:07 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201007042039.o64Kd7p7039037@svn.freebsd.org> From: Benedict Reuschling Date: Sun, 4 Jul 2010 20:39: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: r209703 - head/sbin/reboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 20:39:07 -0000 Author: bcr (doc committer) Date: Sun Jul 4 20:39:07 2010 New Revision: 209703 URL: http://svn.freebsd.org/changeset/base/209703 Log: Let boot(8) refer to the uart(4) serial driver, which is the replacement for the obsolete sio(4) driver. PR: docs/144498 Submitted by: Bruce Cran (bruce at cran dot org dot uk) Approved by: marcel MFC after: 2 weeks Modified: head/sbin/reboot/boot_i386.8 Modified: head/sbin/reboot/boot_i386.8 ============================================================================== --- head/sbin/reboot/boot_i386.8 Sun Jul 4 19:02:32 2010 (r209702) +++ head/sbin/reboot/boot_i386.8 Sun Jul 4 20:39:07 2010 (r209703) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 18, 2005 +.Dd July 4, 2010 .Dt BOOT 8 i386 .Os .Sh NAME @@ -220,14 +220,14 @@ you can use the option to force the kernel to use the serial port as its console device. The serial port driver -.Xr sio 4 +.Xr uart 4 has a flag (0x20) to override this option. If that flag is set, the serial port will always be used as the console, regardless of the .Fl h option described here. See the man page for -.Xr sio 4 +.Xr uart 4 for more details. .It Fl m mute the console to suppress all console input and output during the From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 22:17:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71BE3106566B; Sun, 4 Jul 2010 22:17:57 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6013F8FC13; Sun, 4 Jul 2010 22:17:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o64MHvCK061520; Sun, 4 Jul 2010 22:17:57 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o64MHv3l061519; Sun, 4 Jul 2010 22:17:57 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201007042217.o64MHv3l061519@svn.freebsd.org> From: Matt Jacob Date: Sun, 4 Jul 2010 22:17: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: r209704 - head/sbin/geom/class/multipath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 22:17:57 -0000 Author: mjacob Date: Sun Jul 4 22:17:56 2010 New Revision: 209704 URL: http://svn.freebsd.org/changeset/base/209704 Log: Fix the clear function which has been broken for a bit. MFC after: 1 week Modified: head/sbin/geom/class/multipath/geom_multipath.c Modified: head/sbin/geom/class/multipath/geom_multipath.c ============================================================================== --- head/sbin/geom/class/multipath/geom_multipath.c Sun Jul 4 20:39:07 2010 (r209703) +++ head/sbin/geom/class/multipath/geom_multipath.c Sun Jul 4 22:17:56 2010 (r209704) @@ -222,17 +222,28 @@ mp_label(struct gctl_req *req) } } + static void mp_clear(struct gctl_req *req) { const char *name; - int error; + int error, i, nargs; + + nargs = gctl_get_int(req, "nargs"); + if (nargs < 1) { + gctl_error(req, "Too few arguments."); + return; + } - name = gctl_get_ascii(req, "arg1"); - error = g_metadata_clear(name, G_MULTIPATH_MAGIC); - if (error != 0) { - fprintf(stderr, "Can't clear metadata on %s: %s.\n", name, strerror(error)); - gctl_error(req, "Not fully done."); + for (i = 0; i < nargs; i++) { + name = gctl_get_ascii(req, "arg%d", i); + error = g_metadata_clear(name, G_MULTIPATH_MAGIC); + if (error != 0) { + fprintf(stderr, "Can't clear metadata on %s: %s.\n", + name, strerror(error)); + gctl_error(req, "Not fully done."); + continue; + } } } From owner-svn-src-all@FreeBSD.ORG Sun Jul 4 23:28:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D01F106564A; Sun, 4 Jul 2010 23:28:43 +0000 (UTC) (envelope-from anders@FreeBSD.org) Received: from fupp.net (totem.fix.no [80.91.36.20]) by mx1.freebsd.org (Postfix) with ESMTP id 2AAD58FC16; Sun, 4 Jul 2010 23:28:42 +0000 (UTC) Received: from localhost (totem.fix.no [80.91.36.20]) by fupp.net (Postfix) with ESMTP id 9D38647229; Mon, 5 Jul 2010 01:28:39 +0200 (CEST) Received: from fupp.net ([80.91.36.20]) by localhost (totem.fix.no [80.91.36.20]) (amavisd-new, port 10024) with LMTP id GTGl+FN0eE6b; Mon, 5 Jul 2010 01:28:39 +0200 (CEST) Received: by fupp.net (Postfix, from userid 1000) id 098DC47228; Mon, 5 Jul 2010 01:28:39 +0200 (CEST) Date: Mon, 5 Jul 2010 01:28:39 +0200 From: Anders Nordby To: Pyun YongHyeon Message-ID: <20100704232838.GA13281@fupp.net> References: <201006101804.o5AI4PEX024259@svn.freebsd.org> <20100629074831.GA75332@fupp.net> <1277820825.55649.7.camel@bauer.cse.buffalo.edu> <20100701215218.GC7090@michelle.cdnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20100701215218.GC7090@michelle.cdnetworks.com> User-Agent: Mutt/1.4.2.3i X-PGP-Key: http://anders.fix.no/pgp/ X-PGP-Key-FingerPrint: 1E0F C53C D8DF 6A8F EAAD 19C5 D12A BC9F 0083 5956 Cc: src-committers@freebsd.org, Ken Smith , jdc@parodius.com, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-7@freebsd.org, marcel@freebsd.org, Pyun YongHyeon Subject: Re: svn commit: r208995 - stable/7/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jul 2010 23:28:43 -0000 Hi, On Thu, Jul 01, 2010 at 02:52:18PM -0700, Pyun YongHyeon wrote: > > > Is it possible to get this fix into FreeBSD 7.3-RELEASE? > > We typically rely on developers to decide if fixes might warrant > > consideration as an Errata Notice and send email to re@ suggesting > > it. It's hard for us to judge on our own - factors include things > > like the individual developers' confidence level in the fix, etc. > Even though I didn't receive positive feedback from jumbo frame > users I'm pretty sure the change set will fix regression introduced > in r199011. As you might know, the bug was not detected for a very > long time(about 6 months) so I think it's better to wait 2 or 3 > weeks to get more confidence on the patch. Upgrade cycles sometimes go slow. The only release to have this bug is 7.3 from march (our only release this year so far), all other releases are from before the bug was introduced or will not have the bug (8.1). For me 7.3 seems unusable without this patch, on all our HP ProLiant DL 380 G4 servers. These have have built-in bge NICs. I manually apply the patch on production servers for now, which works for me. If/when Pyun feels confident about it, I think it should be fixed in 7.3. Regards, -- Anders. From owner-svn-src-all@FreeBSD.ORG Mon Jul 5 01:10:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74DC21065678 for ; Mon, 5 Jul 2010 01:10:23 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id D99C48FC18 for ; Mon, 5 Jul 2010 01:10:22 +0000 (UTC) Received: (qmail 13463 invoked by uid 399); 5 Jul 2010 01:10:21 -0000 Received: from localhost (HELO ?192.168.0.143?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 5 Jul 2010 01:10:21 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Date: Sun, 4 Jul 2010 18:10:19 -0700 (PDT) From: Doug Barton To: Alexander Motin In-Reply-To: <201007011851.o61IpI9r054345@svn.freebsd.org> Message-ID: References: <201007011851.o61IpI9r054345@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-message-flag: Outlook -- Not just for spreading viruses anymore! OpenPGP: id=1A1ABC84 Organization: http://SupersetSolutions.com/ MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209634 - head/sys/x86/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jul 2010 01:10:23 -0000 This commit results in a panic at boot time for me very early on. Screenshots at: http://people.freebsd.org/~dougb/panic-01.jpg http://people.freebsd.org/~dougb/panic-02.jpg http://people.freebsd.org/~dougb/panic-03.jpg Not sure if it's relevant or not, but after the trace is done I typed 'call reboot()' and it said "panic: privcheck td != curthread" This is on -current, Core 2 Duo, i386, SMP. Updating to the revision immediately before this one is fine, so I'm sure this is the change that is causing the panic. Doug On Thu, 1 Jul 2010, Alexander Motin wrote: > Author: mav > Date: Thu Jul 1 18:51:18 2010 > New Revision: 209634 > URL: http://svn.freebsd.org/changeset/base/209634 > > Log: > Rework r209456: > Instead of using fake rid (which ISA doesn't like), delete untrusted > IRQ resource and let it be recreated. > > Modified: > head/sys/x86/isa/atrtc.c > head/sys/x86/isa/clock.c > > Modified: head/sys/x86/isa/atrtc.c > ============================================================================== > --- head/sys/x86/isa/atrtc.c Thu Jul 1 17:46:12 2010 (r209633) > +++ head/sys/x86/isa/atrtc.c Thu Jul 1 18:51:18 2010 (r209634) > @@ -259,7 +259,8 @@ atrtc_attach(device_t dev) > if (!atrtcclock_disable && > (resource_int_value(device_get_name(dev), device_get_unit(dev), > "clock", &i) != 0 || i != 0)) { > - sc->intr_rid = -1; > + sc->intr_rid = 0; > + bus_delete_resource(dev, SYS_RES_IRQ, sc->intr_rid); > if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, > &sc->intr_rid, 8, 8, 1, RF_ACTIVE))) { > device_printf(dev,"Can't map interrupt.\n"); > > Modified: head/sys/x86/isa/clock.c > ============================================================================== > --- head/sys/x86/isa/clock.c Thu Jul 1 17:46:12 2010 (r209633) > +++ head/sys/x86/isa/clock.c Thu Jul 1 18:51:18 2010 (r209634) > @@ -535,7 +535,8 @@ attimer_attach(device_t dev) > tc_init(&sc->tc); > if (resource_int_value(device_get_name(dev), device_get_unit(dev), > "clock", &i) != 0 || i != 0) { > - sc->intr_rid = -1; > + sc->intr_rid = 0; > + bus_delete_resource(dev, SYS_RES_IRQ, sc->intr_rid); > if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, > &sc->intr_rid, 0, 0, 1, RF_ACTIVE))) { > device_printf(dev,"Can't map interrupt.\n"); > > -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso From owner-svn-src-all@FreeBSD.ORG Mon Jul 5 03:55:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A0CD106566C; Mon, 5 Jul 2010 03:55:49 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A3C98FC08; Mon, 5 Jul 2010 03:55:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o653tn5w035760; Mon, 5 Jul 2010 03:55:49 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o653tnjA035758; Mon, 5 Jul 2010 03:55:49 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201007050355.o653tnjA035758@svn.freebsd.org> From: Bruce Cran Date: Mon, 5 Jul 2010 03: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: r209709 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jul 2010 03:55:49 -0000 Author: brucec Date: Mon Jul 5 03:55:49 2010 New Revision: 209709 URL: http://svn.freebsd.org/changeset/base/209709 Log: Increment 'sa' at the end of the loop; otherwise, only the first address ever gets checked. Approved by: rrs (mentor) MFC after: 1 month Modified: head/lib/libc/net/sctp_sys_calls.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Mon Jul 5 01:14:32 2010 (r209708) +++ head/lib/libc/net/sctp_sys_calls.c Mon Jul 5 03:55:49 2010 (r209709) @@ -304,7 +304,7 @@ sctp_bindx(int sd, struct sockaddr *addr goto out_error; } - + sa = (struct sockaddr *)((caddr_t)sa + sz); } sa = addrs; /* From owner-svn-src-all@FreeBSD.ORG Mon Jul 5 16:23:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58F14106564A; Mon, 5 Jul 2010 16:23:56 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 471FA8FC1E; Mon, 5 Jul 2010 16:23:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o65GNtD2002142; Mon, 5 Jul 2010 16:23:55 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o65GNtAA002140; Mon, 5 Jul 2010 16:23:55 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201007051623.o65GNtAA002140@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 5 Jul 2010 16:23: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: r209710 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jul 2010 16:23:56 -0000 Author: jh Date: Mon Jul 5 16:23:55 2010 New Revision: 209710 URL: http://svn.freebsd.org/changeset/base/209710 Log: Extend the kernel unit number allocator for allocating specific unit numbers. This change adds a new function alloc_unr_specific() which returns the requested unit number if it is free. If the number is already allocated or out of the range, -1 is returned. Update alloc_unr(9) manual page accordingly and add a MLINK for alloc_unr_specific(9). Discussed on: freebsd-hackers Modified: head/share/man/man9/Makefile head/share/man/man9/alloc_unr.9 head/sys/kern/subr_unit.c head/sys/sys/systm.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Jul 5 03:55:49 2010 (r209709) +++ head/share/man/man9/Makefile Mon Jul 5 16:23:55 2010 (r209710) @@ -374,6 +374,7 @@ MAN= accept_filter.9 \ zone.9 MLINKS= alloc_unr.9 alloc_unrl.9 \ + alloc_unr.9 alloc_unr_specific.9 \ alloc_unr.9 delete_unrhdr.9 \ alloc_unr.9 free_unr.9 \ alloc_unr.9 new_unrhdr.9 Modified: head/share/man/man9/alloc_unr.9 ============================================================================== --- head/share/man/man9/alloc_unr.9 Mon Jul 5 03:55:49 2010 (r209709) +++ head/share/man/man9/alloc_unr.9 Mon Jul 5 16:23:55 2010 (r209710) @@ -24,13 +24,14 @@ .\" .\" $FreeBSD$ .\" -.Dd February 7, 2010 +.Dd July 5, 2010 .Dt ALLOC_UNR 9 .Os .Sh NAME .Nm new_unrhdr , .Nm delete_unrhdr , .Nm alloc_unr , +.Nm alloc_unr_specific , .Nm free_unr .Nd "kernel unit number allocator" .Sh SYNOPSIS @@ -43,6 +44,8 @@ .Fn alloc_unr "struct unrhdr *uh" .Ft int .Fn alloc_unrl "struct unrhdr *uh" +.Ft int +.Fn alloc_unr_specific "struct unrhdr *uh" "u_int item" .Ft void .Fn free_unr "struct unrhdr *uh" "u_int item" .Sh DESCRIPTION @@ -81,6 +84,13 @@ is returned. Same as .Fn alloc_unr except that mutex is assumed to be already locked and thus is not used. +.It Fn alloc_unr_specific uh item +Allocate a specific unit number. +This function allocates memory and thus may sleep. +The allocated unit number is returned on success. +If the specified number is already allocated or out of the range, +.Li \-1 +is returned. .It Fn free_unr uh item Free a previously allocated unit number. This function may require allocating memory, and thus it can sleep. Modified: head/sys/kern/subr_unit.c ============================================================================== --- head/sys/kern/subr_unit.c Mon Jul 5 03:55:49 2010 (r209709) +++ head/sys/kern/subr_unit.c Mon Jul 5 16:23:55 2010 (r209710) @@ -628,6 +628,132 @@ alloc_unr(struct unrhdr *uh) return (i); } +static int +alloc_unr_specificl(struct unrhdr *uh, u_int item, void **p1, void **p2) +{ + struct unr *up, *upn; + struct unrb *ub; + u_int i, last, tl; + + mtx_assert(uh->mtx, MA_OWNED); + + if (item < uh->low + uh->first || item > uh->high) + return (-1); + + up = TAILQ_FIRST(&uh->head); + /* Ideal split. */ + if (up == NULL && item - uh->low == uh->first) { + uh->first++; + uh->last--; + uh->busy++; + check_unrhdr(uh, __LINE__); + return (item); + } + + i = item - uh->low - uh->first; + + if (up == NULL) { + up = new_unr(uh, p1, p2); + up->ptr = NULL; + up->len = i; + TAILQ_INSERT_TAIL(&uh->head, up, list); + up = new_unr(uh, p1, p2); + up->ptr = uh; + up->len = 1; + TAILQ_INSERT_TAIL(&uh->head, up, list); + uh->last = uh->high - uh->low - i; + uh->busy++; + check_unrhdr(uh, __LINE__); + return (item); + } else { + /* Find the item which contains the unit we want to allocate. */ + TAILQ_FOREACH(up, &uh->head, list) { + if (up->len > i) + break; + i -= up->len; + } + } + + if (up == NULL) { + if (i > 0) { + up = new_unr(uh, p1, p2); + up->ptr = NULL; + up->len = i; + TAILQ_INSERT_TAIL(&uh->head, up, list); + } + up = new_unr(uh, p1, p2); + up->ptr = uh; + up->len = 1; + TAILQ_INSERT_TAIL(&uh->head, up, list); + goto done; + } + + if (is_bitmap(uh, up)) { + ub = up->ptr; + if (bit_test(ub->map, i) == 0) { + bit_set(ub->map, i); + ub->busy++; + goto done; + } else + return (-1); + } else if (up->ptr == uh) + return (-1); + + KASSERT(up->ptr == NULL, + ("alloc_unr_specificl: up->ptr != NULL (up=%p)", up)); + + /* Split off the tail end, if any. */ + tl = up->len - (1 + i); + if (tl > 0) { + upn = new_unr(uh, p1, p2); + upn->ptr = NULL; + upn->len = tl; + TAILQ_INSERT_AFTER(&uh->head, up, upn, list); + } + + /* Split off head end, if any */ + if (i > 0) { + upn = new_unr(uh, p1, p2); + upn->len = i; + upn->ptr = NULL; + TAILQ_INSERT_BEFORE(up, upn, list); + } + up->len = 1; + up->ptr = uh; + +done: + last = uh->high - uh->low - (item - uh->low); + if (uh->last > last) + uh->last = last; + uh->busy++; + collapse_unr(uh, up); + check_unrhdr(uh, __LINE__); + return (item); +} + +int +alloc_unr_specific(struct unrhdr *uh, u_int item) +{ + void *p1, *p2; + int i; + + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "alloc_unr_specific"); + + p1 = Malloc(sizeof(struct unr)); + p2 = Malloc(sizeof(struct unr)); + + mtx_lock(uh->mtx); + i = alloc_unr_specificl(uh, item, &p1, &p2); + mtx_unlock(uh->mtx); + + if (p1 != NULL) + Free(p1); + if (p2 != NULL) + Free(p2); + + return (i); +} + /* * Free a unr. * @@ -810,6 +936,42 @@ print_unrhdr(struct unrhdr *uh) } } +static void +test_alloc_unr(struct unrhdr *uh, u_int i, char a[]) +{ + int j; + + if (a[i]) { + printf("F %u\n", i); + free_unr(uh, i); + a[i] = 0; + } else { + no_alloc = 1; + j = alloc_unr(uh); + if (j != -1) { + a[j] = 1; + printf("A %d\n", j); + } + no_alloc = 0; + } +} + +static void +test_alloc_unr_specific(struct unrhdr *uh, u_int i, char a[]) +{ + int j; + + j = alloc_unr_specific(uh, i); + if (j == -1) { + printf("F %u\n", i); + a[i] = 0; + free_unr(uh, i); + } else { + a[i] = 1; + printf("A %d\n", j); + } +} + /* Number of unrs to test */ #define NN 10000 @@ -825,6 +987,7 @@ main(int argc __unused, const char **arg print_unrhdr(uh); memset(a, 0, sizeof a); + srandomdev(); fprintf(stderr, "sizeof(struct unr) %zu\n", sizeof(struct unr)); fprintf(stderr, "sizeof(struct unrb) %zu\n", sizeof(struct unrb)); @@ -838,19 +1001,11 @@ main(int argc __unused, const char **arg if (a[i] && (j & 1)) continue; #endif - if (a[i]) { - printf("F %u\n", i); - free_unr(uh, i); - a[i] = 0; - } else { - no_alloc = 1; - i = alloc_unr(uh); - if (i != -1) { - a[i] = 1; - printf("A %u\n", i); - } - no_alloc = 0; - } + if ((random() & 1) != 0) + test_alloc_unr(uh, i, a); + else + test_alloc_unr_specific(uh, i, a); + if (1) /* XXX: change this for detailed debug printout */ print_unrhdr(uh); check_unrhdr(uh, __LINE__); Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Mon Jul 5 03:55:49 2010 (r209709) +++ head/sys/sys/systm.h Mon Jul 5 16:23:55 2010 (r209710) @@ -363,6 +363,7 @@ void delete_unrhdr(struct unrhdr *uh); void clean_unrhdr(struct unrhdr *uh); void clean_unrhdrl(struct unrhdr *uh); int alloc_unr(struct unrhdr *uh); +int alloc_unr_specific(struct unrhdr *uh, u_int item); int alloc_unrl(struct unrhdr *uh); void free_unr(struct unrhdr *uh, u_int item); From owner-svn-src-all@FreeBSD.ORG Mon Jul 5 18:46:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DE0F1065673; Mon, 5 Jul 2010 18:46:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BCA58FC1A; Mon, 5 Jul 2010 18:46:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o65IjxuO033277; Mon, 5 Jul 2010 18:45:59 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o65IjxR4033275; Mon, 5 Jul 2010 18:45:59 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201007051845.o65IjxR4033275@svn.freebsd.org> From: Michael Tuexen Date: Mon, 5 Jul 2010 18:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209711 - releng/8.1/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jul 2010 18:46:00 -0000 Author: tuexen Date: Mon Jul 5 18:45:59 2010 New Revision: 209711 URL: http://svn.freebsd.org/changeset/base/209711 Log: MFC r209624 * Do not dereference a NULL pointer when calling an SCTP send syscall not providing a destination address and using ktrace. * Do not copy out kernel memory when providing sinfo for sctp_recvmsg(). Both bugs where reported by Valentin Nechayev. The first bug results in a kernel panic. Approved by: re@ Modified: releng/8.1/sys/kern/uipc_syscalls.c Directory Properties: releng/8.1/sys/ (props changed) releng/8.1/sys/amd64/include/xen/ (props changed) releng/8.1/sys/cddl/contrib/opensolaris/ (props changed) releng/8.1/sys/contrib/dev/acpica/ (props changed) releng/8.1/sys/contrib/pf/ (props changed) releng/8.1/sys/dev/ixgbe/ (props changed) releng/8.1/sys/dev/xen/xenpci/ (props changed) releng/8.1/sys/geom/sched/ (props changed) Modified: releng/8.1/sys/kern/uipc_syscalls.c ============================================================================== --- releng/8.1/sys/kern/uipc_syscalls.c Mon Jul 5 16:23:55 2010 (r209710) +++ releng/8.1/sys/kern/uipc_syscalls.c Mon Jul 5 18:45:59 2010 (r209711) @@ -2413,7 +2413,7 @@ sctp_generic_sendmsg (td, uap) if (error) goto sctp_bad; #ifdef KTRACE - if (KTRPOINT(td, KTR_STRUCT)) + if (to && (KTRPOINT(td, KTR_STRUCT))) ktrsockaddr(to); #endif @@ -2527,7 +2527,7 @@ sctp_generic_sendmsg_iov(td, uap) if (error) goto sctp_bad1; #ifdef KTRACE - if (KTRPOINT(td, KTR_STRUCT)) + if (to && (KTRPOINT(td, KTR_STRUCT))) ktrsockaddr(to); #endif @@ -2681,6 +2681,7 @@ sctp_generic_recvmsg(td, uap) if (KTRPOINT(td, KTR_GENIO)) ktruio = cloneuio(&auio); #endif /* KTRACE */ + memset(&sinfo, 0, sizeof(struct sctp_sndrcvinfo)); CURVNET_SET(so->so_vnet); error = sctp_sorecvmsg(so, &auio, (struct mbuf **)NULL, fromsa, fromlen, &msg_flags, From owner-svn-src-all@FreeBSD.ORG Mon Jul 5 19:01:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B039106566B; Mon, 5 Jul 2010 19:01:10 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89E8D8FC12; Mon, 5 Jul 2010 19:01:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o65J1Avn036635; Mon, 5 Jul 2010 19:01:10 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o65J1Agd036633; Mon, 5 Jul 2010 19:01:10 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201007051901.o65J1Agd036633@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 5 Jul 2010 19:01: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: r209712 - head/lib/libc/posix1e X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jul 2010 19:01:10 -0000 Author: trasz Date: Mon Jul 5 19:01:10 2010 New Revision: 209712 URL: http://svn.freebsd.org/changeset/base/209712 Log: Remove comment which didn't match reality for a long time. Reviewed by: rwatson Modified: head/lib/libc/posix1e/acl_from_text.c Modified: head/lib/libc/posix1e/acl_from_text.c ============================================================================== --- head/lib/libc/posix1e/acl_from_text.c Mon Jul 5 18:45:59 2010 (r209711) +++ head/lib/libc/posix1e/acl_from_text.c Mon Jul 5 19:01:10 2010 (r209712) @@ -271,9 +271,6 @@ error_label: * XXX NOT THREAD SAFE, RELIES ON GETPWNAM, GETGRNAM * XXX USES *PW* AND *GR* WHICH ARE STATEFUL AND THEREFORE THIS ROUTINE * MAY HAVE SIDE-EFFECTS - * - * XXX currently doesn't deal correctly with a numeric uid being passed - * instead of a username. What is correct behavior here? Check chown. */ static int _posix1e_acl_name_to_id(acl_tag_t tag, char *name, uid_t *id) From owner-svn-src-all@FreeBSD.ORG Mon Jul 5 21:13:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7859A106566B; Mon, 5 Jul 2010 21:13: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 66D918FC13; Mon, 5 Jul 2010 21:13:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o65LDXdF066162; Mon, 5 Jul 2010 21:13:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o65LDXFG066161; Mon, 5 Jul 2010 21:13:33 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201007052113.o65LDXFG066161@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 5 Jul 2010 21:13: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: r209713 - in head/sys: kern vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jul 2010 21:13:33 -0000 Author: kib Date: Mon Jul 5 21:13:32 2010 New Revision: 209713 URL: http://svn.freebsd.org/changeset/base/209713 Log: Add the ability for the allocflag argument of the vm_page_grab() to specify the increment of vm_pageout_deficit when sleeping due to page shortage. Then, in allocbuf(), the code to allocate pages when extending vmio buffer can be replaced by a call to vm_page_grab(). Suggested and reviewed by: alc MFC after: 2 weeks Modified: head/sys/kern/vfs_bio.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Jul 5 19:01:10 2010 (r209712) +++ head/sys/kern/vfs_bio.c Mon Jul 5 21:13:32 2010 (r209713) @@ -3013,63 +3013,24 @@ allocbuf(struct buf *bp, int size) VM_OBJECT_LOCK(obj); while (bp->b_npages < desiredpages) { vm_page_t m; - vm_pindex_t pi; - - pi = OFF_TO_IDX(bp->b_offset) + bp->b_npages; - if ((m = vm_page_lookup(obj, pi)) == NULL) { - /* - * note: must allocate system pages - * since blocking here could intefere - * with paging I/O, no matter which - * process we are. - */ - m = vm_page_alloc(obj, pi, - VM_ALLOC_NOBUSY | VM_ALLOC_SYSTEM | - VM_ALLOC_WIRED); - if (m == NULL) { - atomic_add_int(&vm_pageout_deficit, - desiredpages - bp->b_npages); - VM_OBJECT_UNLOCK(obj); - VM_WAIT; - VM_OBJECT_LOCK(obj); - } else { - if (m->valid == 0) - bp->b_flags &= ~B_CACHE; - bp->b_pages[bp->b_npages] = m; - ++bp->b_npages; - } - continue; - } /* - * We found a page. If we have to sleep on it, - * retry because it might have gotten freed out - * from under us. + * We must allocate system pages since blocking + * here could intefere with paging I/O, no + * matter which process we are. * * We can only test VPO_BUSY here. Blocking on * m->busy might lead to a deadlock: - * * vm_fault->getpages->cluster_read->allocbuf - * - */ - if ((m->oflags & VPO_BUSY) != 0) { - /* - * Reference the page before unlocking - * and sleeping so that the page daemon - * is less likely to reclaim it. - */ - vm_page_lock_queues(); - vm_page_flag_set(m, PG_REFERENCED); - vm_page_sleep(m, "pgtblk"); - continue; - } - - /* - * We have a good page. + * Thus, we specify VM_ALLOC_IGN_SBUSY. */ - vm_page_lock(m); - vm_page_wire(m); - vm_page_unlock(m); + m = vm_page_grab(obj, OFF_TO_IDX(bp->b_offset) + + bp->b_npages, VM_ALLOC_NOBUSY | + VM_ALLOC_SYSTEM | VM_ALLOC_WIRED | + VM_ALLOC_RETRY | VM_ALLOC_IGN_SBUSY | + VM_ALLOC_COUNT(desiredpages - bp->b_npages)); + if (m->valid == 0) + bp->b_flags &= ~B_CACHE; bp->b_pages[bp->b_npages] = m; ++bp->b_npages; } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Mon Jul 5 19:01:10 2010 (r209712) +++ head/sys/vm/vm_page.c Mon Jul 5 21:13:32 2010 (r209713) @@ -2038,11 +2038,13 @@ vm_page_t vm_page_grab(vm_object_t object, vm_pindex_t pindex, int allocflags) { vm_page_t m; + u_int count; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); retrylookup: if ((m = vm_page_lookup(object, pindex)) != NULL) { - if ((m->oflags & VPO_BUSY) != 0 || m->busy != 0) { + if ((m->oflags & VPO_BUSY) != 0 || + ((allocflags & VM_ALLOC_IGN_SBUSY) == 0 && m->busy != 0)) { if ((allocflags & VM_ALLOC_RETRY) != 0) { /* * Reference the page before unlocking and @@ -2067,9 +2069,13 @@ retrylookup: return (m); } } - m = vm_page_alloc(object, pindex, allocflags & ~VM_ALLOC_RETRY); + m = vm_page_alloc(object, pindex, allocflags & ~(VM_ALLOC_RETRY | + VM_ALLOC_IGN_SBUSY | VM_ALLOC_COUNT_MASK)); if (m == NULL) { VM_OBJECT_UNLOCK(object); + count = (u_int)allocflags >> VM_ALLOC_COUNT_SHIFT; + if (count > 0) + atomic_add_int(&vm_pageout_deficit, count); VM_WAIT; VM_OBJECT_LOCK(object); if ((allocflags & VM_ALLOC_RETRY) == 0) Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Mon Jul 5 19:01:10 2010 (r209712) +++ head/sys/vm/vm_page.h Mon Jul 5 21:13:32 2010 (r209713) @@ -317,6 +317,11 @@ extern struct vpglocks vm_page_queue_loc #define VM_ALLOC_NOBUSY 0x0200 /* Do not busy the page */ #define VM_ALLOC_IFCACHED 0x0400 /* Fail if the page is not cached */ #define VM_ALLOC_IFNOTCACHED 0x0800 /* Fail if the page is cached */ +#define VM_ALLOC_IGN_SBUSY 0x1000 /* vm_page_grab() only */ + +#define VM_ALLOC_COUNT_SHIFT 16 +#define VM_ALLOC_COUNT(count) ((count) << VM_ALLOC_COUNT_SHIFT) +#define VM_ALLOC_COUNT_MASK VM_ALLOC_COUNT(0xffff) void vm_page_flag_set(vm_page_t m, unsigned short bits); void vm_page_flag_clear(vm_page_t m, unsigned short bits); From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 02:07:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72937106566B; Tue, 6 Jul 2010 02:07:59 +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 62A268FC21; Tue, 6 Jul 2010 02:07:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6627xoV030696; Tue, 6 Jul 2010 02:07:59 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6627x6i030694; Tue, 6 Jul 2010 02:07:59 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201007060207.o6627x6i030694@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 6 Jul 2010 02:07: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: r209714 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 02:07:59 -0000 Author: yongari Date: Tue Jul 6 02:07:59 2010 New Revision: 209714 URL: http://svn.freebsd.org/changeset/base/209714 Log: It seems read DMA mode register requires both IPv4 TSO and IPv6 TSO configuration to get IPv4 TSO work on BCM57780. While I'm here apply the same fix to BCM5785 which shares similar hardware feature of BCM57780. This change makes TSO work on BCM57780. Tested by: Tong Liu gmail dot com> Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Mon Jul 5 21:13:32 2010 (r209713) +++ head/sys/dev/bge/if_bge.c Tue Jul 6 02:07:59 2010 (r209714) @@ -1834,8 +1834,12 @@ bge_blockinit(struct bge_softc *sc) BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN; if (sc->bge_flags & BGE_FLAG_PCIE) val |= BGE_RDMAMODE_FIFO_LONG_BURST; - if (sc->bge_flags & BGE_FLAG_TSO) + if (sc->bge_flags & BGE_FLAG_TSO) { val |= BGE_RDMAMODE_TSO4_ENABLE; + if (sc->bge_asicrev == BGE_ASICREV_BCM5785 || + sc->bge_asicrev == BGE_ASICREV_BCM57780) + val |= BGE_RDMAMODE_TSO6_ENABLE; + } CSR_WRITE_4(sc, BGE_RDMA_MODE, val); DELAY(40); From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 03:48:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9985F106566B; Tue, 6 Jul 2010 03:48:46 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88A6F8FC13; Tue, 6 Jul 2010 03:48:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o663mknf052915; Tue, 6 Jul 2010 03:48:46 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o663mkUV052913; Tue, 6 Jul 2010 03:48:46 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201007060348.o663mkUV052913@svn.freebsd.org> From: Maxim Konovalov Date: Tue, 6 Jul 2010 03:48: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: r209715 - head/include/arpa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 03:48:46 -0000 Author: maxim Date: Tue Jul 6 03:48:46 2010 New Revision: 209715 URL: http://svn.freebsd.org/changeset/base/209715 Log: o addr2ascii(3) was removed ages ago. Fix the comment. PR: docs/148383 Submitted by: pluknet MFC after: 1 week Modified: head/include/arpa/inet.h Modified: head/include/arpa/inet.h ============================================================================== --- head/include/arpa/inet.h Tue Jul 6 02:07:59 2010 (r209714) +++ head/include/arpa/inet.h Tue Jul 6 03:48:46 2010 (r209715) @@ -58,7 +58,7 @@ #ifndef _ARPA_INET_H_ #define _ARPA_INET_H_ -/* External definitions for functions in inet(3), addr2ascii(3) */ +/* External definitions for functions in inet(3). */ #include #include From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 07:07:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D682C1065687; Tue, 6 Jul 2010 07:07:29 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C41718FC18; Tue, 6 Jul 2010 07:07:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6677TPq096705; Tue, 6 Jul 2010 07:07:29 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6677T3u096703; Tue, 6 Jul 2010 07:07:29 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201007060707.o6677T3u096703@svn.freebsd.org> From: Jeff Roberson Date: Tue, 6 Jul 2010 07:07: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: r209716 - head/sbin/fsck_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 07:07:29 -0000 Author: jeff Date: Tue Jul 6 07:07:29 2010 New Revision: 209716 URL: http://svn.freebsd.org/changeset/base/209716 Log: - Permit zero length directories as a handled inconsistency. This allows directory truncation to proceed before the link has been cleared. This is accomplished by detecting a directory with no . or .. links and clearing the named directory entry in the parent. - Add a new function ino_remref() which handles the details of removing a reference to an inode as a result of a lost directory. There were some minor errors in various subcases of this routine. Modified: head/sbin/fsck_ffs/suj.c Modified: head/sbin/fsck_ffs/suj.c ============================================================================== --- head/sbin/fsck_ffs/suj.c Tue Jul 6 03:48:46 2010 (r209715) +++ head/sbin/fsck_ffs/suj.c Tue Jul 6 07:07:29 2010 (r209716) @@ -808,6 +808,44 @@ blk_isat(ino_t ino, ufs_lbn_t lbn, ufs2_ } /* + * Clear the directory entry at diroff that should point to child. Minimal + * checking is done and it is assumed that this path was verified with isat. + */ +static void +ino_clrat(ino_t parent, off_t diroff, ino_t child) +{ + union dinode *dip; + struct direct *dp; + ufs2_daddr_t blk; + uint8_t *block; + ufs_lbn_t lbn; + int blksize; + int frags; + int doff; + + if (debug) + printf("Clearing inode %d from parent %d at offset %jd\n", + child, parent, diroff); + + lbn = lblkno(fs, diroff); + doff = blkoff(fs, diroff); + dip = ino_read(parent); + blk = ino_blkatoff(dip, parent, lbn, &frags); + blksize = sblksize(fs, DIP(dip, di_size), lbn); + block = dblk_read(blk, blksize); + dp = (struct direct *)&block[doff]; + if (dp->d_ino != child) + errx(1, "Inode %d does not exist in %d at %jd", + child, parent, diroff); + dp->d_ino = 0; + dblk_dirty(blk); + /* + * The actual .. reference count will already have been removed + * from the parent by the .. remref record. + */ +} + +/* * Determines whether a pointer to an inode exists within a directory * at a specified offset. Returns the mode of the found entry. */ @@ -1134,6 +1172,57 @@ ino_setskip(struct suj_ino *sino, ino_t sino->si_skipparent = 1; } +static void +ino_remref(ino_t parent, ino_t child, uint64_t diroff, int isdotdot) +{ + struct suj_ino *sino; + struct suj_rec *srec; + struct jrefrec *rrec; + + /* + * Lookup this inode to see if we have a record for it. + */ + sino = ino_lookup(child, 0); + /* + * Tell any child directories we've already removed their + * parent link cnt. Don't try to adjust our link down again. + */ + if (sino != NULL && isdotdot == 0) + ino_setskip(sino, parent); + /* + * No valid record for this inode. Just drop the on-disk + * link by one. + */ + if (sino == NULL || sino->si_hasrecs == 0) { + ino_decr(child); + return; + } + /* + * Use ino_adjust() if ino_check() has already processed this + * child. If we lose the last non-dot reference to a + * directory it will be discarded. + */ + if (sino->si_linkadj) { + sino->si_nlink--; + if (isdotdot) + sino->si_dotlinks--; + ino_adjust(sino); + return; + } + /* + * If we haven't yet processed this inode we need to make + * sure we will successfully discover the lost path. If not + * use nlinkadj to remember. + */ + TAILQ_FOREACH(srec, &sino->si_recs, sr_next) { + rrec = (struct jrefrec *)srec->sr_rec; + if (rrec->jr_parent == parent && + rrec->jr_diroff == diroff) + return; + } + sino->si_nlinkadj++; +} + /* * Free the children of a directory when the directory is discarded. */ @@ -1141,13 +1230,11 @@ static void ino_free_children(ino_t ino, ufs_lbn_t lbn, ufs2_daddr_t blk, int frags) { struct suj_ino *sino; - struct suj_rec *srec; - struct jrefrec *rrec; struct direct *dp; off_t diroff; uint8_t *block; int skipparent; - int isparent; + int isdotdot; int dpoff; int size; @@ -1165,53 +1252,15 @@ ino_free_children(ino_t ino, ufs_lbn_t l continue; if (dp->d_namlen == 1 && dp->d_name[0] == '.') continue; - isparent = dp->d_namlen == 2 && dp->d_name[0] == '.' && + isdotdot = dp->d_namlen == 2 && dp->d_name[0] == '.' && dp->d_name[1] == '.'; - if (isparent && skipparent == 1) + if (isdotdot && skipparent == 1) continue; if (debug) printf("Directory %d removing ino %d name %s\n", ino, dp->d_ino, dp->d_name); - /* - * Lookup this inode to see if we have a record for it. - * If not, we've already adjusted it assuming this path - * was valid and we have to adjust once more. - */ - sino = ino_lookup(dp->d_ino, 0); - if (sino == NULL || sino->si_hasrecs == 0) { - ino_decr(ino); - continue; - } - /* - * Use ino_adjust() so if we lose the last non-dot reference - * to a directory it can be discarded. - */ - if (sino->si_linkadj) { - sino->si_nlink--; - if (isparent) - sino->si_dotlinks--; - ino_adjust(sino); - } - /* - * Tell any child directories we've already removed their - * parent. Don't try to adjust our link down again. - */ - if (isparent == 0) - ino_setskip(sino, ino); - /* - * If we haven't yet processed this inode we need to make - * sure we will successfully discover the lost path. If not - * use nlinkadj to remember. - */ diroff = lblktosize(fs, lbn) + dpoff; - TAILQ_FOREACH(srec, &sino->si_recs, sr_next) { - rrec = (struct jrefrec *)srec->sr_rec; - if (rrec->jr_parent == ino && - rrec->jr_diroff == diroff) - break; - } - if (srec == NULL) - sino->si_nlinkadj++; + ino_remref(ino, dp->d_ino, diroff, isdotdot); } } @@ -1293,18 +1342,38 @@ ino_adjust(struct suj_ino *sino) struct suj_ino *stmp; union dinode *ip; nlink_t nlink; + int recmode; int reqlink; + int isdot; int mode; ino_t ino; nlink = sino->si_nlink; ino = sino->si_ino; + mode = sino->si_mode & IFMT; + /* + * If it's a directory with no dot links, it was truncated before + * the name was cleared. We need to clear the dirent that + * points at it. + */ + if (mode == IFDIR && nlink == 1 && sino->si_dotlinks == 0) { + sino->si_nlink = nlink = 0; + TAILQ_FOREACH(srec, &sino->si_recs, sr_next) { + rrec = (struct jrefrec *)srec->sr_rec; + if (ino_isat(rrec->jr_parent, rrec->jr_diroff, ino, + &recmode, &isdot) == 0) + continue; + ino_clrat(rrec->jr_parent, rrec->jr_diroff, ino); + break; + } + if (srec == NULL) + errx(1, "Directory %d name not found", ino); + } /* * If it's a directory with no real names pointing to it go ahead * and truncate it. This will free any children. */ - if ((sino->si_mode & IFMT) == IFDIR && - nlink - sino->si_dotlinks == 0) { + if (mode == IFDIR && nlink - sino->si_dotlinks == 0) { sino->si_nlink = nlink = 0; /* * Mark any .. links so they know not to free this inode From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 07:11:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44C7E106566B; Tue, 6 Jul 2010 07:11:05 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31A8F8FC08; Tue, 6 Jul 2010 07:11:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o667B5h0097549; Tue, 6 Jul 2010 07:11:05 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o667B5t3097539; Tue, 6 Jul 2010 07:11:05 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201007060711.o667B5t3097539@svn.freebsd.org> From: Jeff Roberson Date: Tue, 6 Jul 2010 07:11: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: r209717 - in head/sys/ufs: ffs ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 07:11:05 -0000 Author: jeff Date: Tue Jul 6 07:11:04 2010 New Revision: 209717 URL: http://svn.freebsd.org/changeset/base/209717 Log: - Handle the truncation of an inode with an effective link count of 0 in the context of the process that reduced the effective count. Previously all truncation as a result of unlink happened in the softdep flush thread. This had the effect of being impossible to rate limit properly with the journal code. Now the process issuing unlinks is suspended when the journal files. This has a side-effect of improving rm performance by allowing more concurrent work. - Handle two cases in inactive, one for effnlink == 0 and another when nlink finally reaches 0. - Eliminate the SPACECOUNTED related code since the truncation is no longer delayed. Discussed with: mckusick Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vnops.c head/sys/ufs/ffs/softdep.h head/sys/ufs/ufs/inode.h head/sys/ufs/ufs/ufs_inode.c head/sys/ufs/ufs/ufs_lookup.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Tue Jul 6 07:07:29 2010 (r209716) +++ head/sys/ufs/ffs/ffs_alloc.c Tue Jul 6 07:11:04 2010 (r209717) @@ -191,11 +191,6 @@ retry: bno = ffs_hashalloc(ip, cg, bpref, size, size, ffs_alloccg); if (bno > 0) { delta = btodb(size); - if (ip->i_flag & IN_SPACECOUNTED) { - UFS_LOCK(ump); - fs->fs_pendingblocks += delta; - UFS_UNLOCK(ump); - } DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + delta); if (flags & IO_EXT) ip->i_flag |= IN_CHANGE; @@ -321,11 +316,6 @@ retry: if (bp->b_blkno != fsbtodb(fs, bno)) panic("ffs_realloccg: bad blockno"); delta = btodb(nsize - osize); - if (ip->i_flag & IN_SPACECOUNTED) { - UFS_LOCK(ump); - fs->fs_pendingblocks += delta; - UFS_UNLOCK(ump); - } DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + delta); if (flags & IO_EXT) ip->i_flag |= IN_CHANGE; @@ -394,11 +384,6 @@ retry: ffs_blkfree(ump, fs, ip->i_devvp, bprev, (long)osize, ip->i_number, NULL); delta = btodb(nsize - osize); - if (ip->i_flag & IN_SPACECOUNTED) { - UFS_LOCK(ump); - fs->fs_pendingblocks += delta; - UFS_UNLOCK(ump); - } DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + delta); if (flags & IO_EXT) ip->i_flag |= IN_CHANGE; @@ -2422,11 +2407,6 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) if ((error = ffs_vget(mp, (ino_t)cmd.value, LK_EXCLUSIVE, &vp))) break; ip = VTOI(vp); - if (ip->i_flag & IN_SPACECOUNTED) { - UFS_LOCK(ump); - fs->fs_pendingblocks += cmd.size; - UFS_UNLOCK(ump); - } DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + cmd.size); ip->i_flag |= IN_CHANGE; vput(vp); Modified: head/sys/ufs/ffs/ffs_inode.c ============================================================================== --- head/sys/ufs/ffs/ffs_inode.c Tue Jul 6 07:07:29 2010 (r209716) +++ head/sys/ufs/ffs/ffs_inode.c Tue Jul 6 07:11:04 2010 (r209717) @@ -180,6 +180,8 @@ ffs_truncate(vp, length, flags, cred, td */ if ((flags & (IO_EXT | IO_NORMAL)) == 0) flags |= IO_NORMAL; + if (!DOINGSOFTDEP(vp) && !DOINGASYNC(vp)) + flags |= IO_SYNC; /* * If we are truncating the extended-attributes, and cannot * do it with soft updates, then do it slowly here. If we are @@ -310,10 +312,6 @@ ffs_truncate(vp, length, flags, cred, td */ if ((error = ffs_syncvnode(vp, MNT_WAIT)) != 0) goto out; - UFS_LOCK(ump); - if (ip->i_flag & IN_SPACECOUNTED) - fs->fs_pendingblocks -= datablocks; - UFS_UNLOCK(ump); /* * We have to journal the truncation before we change * any blocks so we don't leave the file partially Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Tue Jul 6 07:07:29 2010 (r209716) +++ head/sys/ufs/ffs/ffs_softdep.c Tue Jul 6 07:11:04 2010 (r209717) @@ -5183,16 +5183,9 @@ softdep_setup_freeblocks(ip, length, fla fs->fs_frag, needj); lbn += tmpval; } - /* - * If the file was removed, then the space being freed was - * accounted for then (see softdep_releasefile()). If the - * file is merely being truncated, then we account for it now. - */ - if ((ip->i_flag & IN_SPACECOUNTED) == 0) { - UFS_LOCK(ip->i_ump); - fs->fs_pendingblocks += datablocks; - UFS_UNLOCK(ip->i_ump); - } + UFS_LOCK(ip->i_ump); + fs->fs_pendingblocks += datablocks; + UFS_UNLOCK(ip->i_ump); } if ((flags & IO_EXT) != 0) { oldextsize = ip->i_din2->di_extsize; @@ -5674,11 +5667,9 @@ softdep_freefile(pvp, ino, mode) freefile->fx_oldinum = ino; freefile->fx_devvp = ip->i_devvp; LIST_INIT(&freefile->fx_jwork); - if ((ip->i_flag & IN_SPACECOUNTED) == 0) { - UFS_LOCK(ip->i_ump); - ip->i_fs->fs_pendinginodes += 1; - UFS_UNLOCK(ip->i_ump); - } + UFS_LOCK(ip->i_ump); + ip->i_fs->fs_pendinginodes += 1; + UFS_UNLOCK(ip->i_ump); /* * If the inodedep does not exist, then the zero'ed inode has @@ -7379,55 +7370,6 @@ softdep_change_linkcnt(ip) } /* - * Called when the effective link count and the reference count - * on an inode drops to zero. At this point there are no names - * referencing the file in the filesystem and no active file - * references. The space associated with the file will be freed - * as soon as the necessary soft dependencies are cleared. - */ -void -softdep_releasefile(ip) - struct inode *ip; /* inode with the zero effective link count */ -{ - struct inodedep *inodedep; - struct fs *fs; - int extblocks; - - if (ip->i_effnlink > 0) - panic("softdep_releasefile: file still referenced"); - /* - * We may be called several times as the on-disk link count - * drops to zero. We only want to account for the space once. - */ - if (ip->i_flag & IN_SPACECOUNTED) - return; - /* - * We have to deactivate a snapshot otherwise copyonwrites may - * add blocks and the cleanup may remove blocks after we have - * tried to account for them. - */ - if ((ip->i_flags & SF_SNAPSHOT) != 0) - ffs_snapremove(ITOV(ip)); - /* - * If we are tracking an nlinkdelta, we have to also remember - * whether we accounted for the freed space yet. - */ - ACQUIRE_LOCK(&lk); - if ((inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, 0, &inodedep))) - inodedep->id_state |= SPACECOUNTED; - FREE_LOCK(&lk); - fs = ip->i_fs; - extblocks = 0; - if (fs->fs_magic == FS_UFS2_MAGIC) - extblocks = btodb(fragroundup(fs, ip->i_din2->di_extsize)); - UFS_LOCK(ip->i_ump); - ip->i_fs->fs_pendingblocks += DIP(ip, i_blocks) - extblocks; - ip->i_fs->fs_pendinginodes += 1; - UFS_UNLOCK(ip->i_ump); - ip->i_flag |= IN_SPACECOUNTED; -} - -/* * Attach a sbdep dependency to the superblock buf so that we can keep * track of the head of the linked list of referenced but unlinked inodes. */ @@ -7735,7 +7677,6 @@ handle_workitem_remove(dirrem, xp) struct dirrem *dirrem; struct vnode *xp; { - struct thread *td = curthread; struct inodedep *inodedep; struct workhead dotdotwk; struct worklist *wk; @@ -7808,9 +7749,8 @@ handle_workitem_remove(dirrem, xp) /* * Directory deletion. Decrement reference count for both the * just deleted parent directory entry and the reference for ".". - * Next truncate the directory to length zero. When the - * truncation completes, arrange to have the reference count on - * the parent decremented to account for the loss of "..". + * Arrange to have the reference count on the parent decremented + * to account for the loss of "..". */ ip->i_nlink -= 2; DIP_SET(ip, i_nlink, ip->i_nlink); @@ -7820,10 +7760,6 @@ handle_workitem_remove(dirrem, xp) if (ip->i_nlink == 0) unlinked_inodedep(mp, inodedep); inodedep->id_nlinkdelta = ip->i_nlink - ip->i_effnlink; - FREE_LOCK(&lk); - if ((error = ffs_truncate(vp, (off_t)0, 0, td->td_ucred, td)) != 0) - softdep_error("handle_workitem_remove: truncate", error); - ACQUIRE_LOCK(&lk); /* * Rename a directory to a new parent. Since, we are both deleting * and creating a new directory entry, the link count on the new @@ -9899,8 +9835,6 @@ softdep_load_inodeblock(ip) return; } ip->i_effnlink -= inodedep->id_nlinkdelta; - if (inodedep->id_state & SPACECOUNTED) - ip->i_flag |= IN_SPACECOUNTED; FREE_LOCK(&lk); } Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Tue Jul 6 07:07:29 2010 (r209716) +++ head/sys/ufs/ffs/ffs_vnops.c Tue Jul 6 07:11:04 2010 (r209717) @@ -1036,9 +1036,6 @@ ffs_extwrite(struct vnode *vp, struct ui fs = ip->i_fs; dp = ip->i_din2; - KASSERT(!(ip->i_flag & IN_SPACECOUNTED), ("inode %u: inode is dead", - ip->i_number)); - #ifdef INVARIANTS if (uio->uio_rw != UIO_WRITE || fs->fs_magic != FS_UFS2_MAGIC) panic("ffs_extwrite: mode"); Modified: head/sys/ufs/ffs/softdep.h ============================================================================== --- head/sys/ufs/ffs/softdep.h Tue Jul 6 07:07:29 2010 (r209716) +++ head/sys/ufs/ffs/softdep.h Tue Jul 6 07:11:04 2010 (r209717) @@ -118,7 +118,7 @@ #define DIRCHG 0x000080 /* diradd, dirrem only */ #define GOINGAWAY 0x000100 /* indirdep, jremref only */ #define IOSTARTED 0x000200 /* inodedep, pagedep, bmsafemap only */ -#define SPACECOUNTED 0x000400 /* inodedep only */ +#define UNUSED400 0x000400 /* currently available. */ #define NEWBLOCK 0x000800 /* pagedep, jaddref only */ #define INPROGRESS 0x001000 /* dirrem, freeblks, freefrag, freefile only */ #define UFS1FMT 0x002000 /* indirdep only */ Modified: head/sys/ufs/ufs/inode.h ============================================================================== --- head/sys/ufs/ufs/inode.h Tue Jul 6 07:07:29 2010 (r209716) +++ head/sys/ufs/ufs/inode.h Tue Jul 6 07:11:04 2010 (r209717) @@ -122,7 +122,6 @@ struct inode { #define IN_MODIFIED 0x0008 /* Inode has been modified. */ #define IN_NEEDSYNC 0x0010 /* Inode requires fsync. */ #define IN_LAZYMOD 0x0040 /* Modified, but don't write yet. */ -#define IN_SPACECOUNTED 0x0080 /* Blocks to be freed in free count. */ #define IN_LAZYACCESS 0x0100 /* Process IN_ACCESS after the suspension finished */ #define IN_EA_LOCKED 0x0200 Modified: head/sys/ufs/ufs/ufs_inode.c ============================================================================== --- head/sys/ufs/ufs/ufs_inode.c Tue Jul 6 07:07:29 2010 (r209716) +++ head/sys/ufs/ufs/ufs_inode.c Tue Jul 6 07:11:04 2010 (r209717) @@ -76,6 +76,7 @@ ufs_inactive(ap) struct thread *td = ap->a_td; mode_t mode; int error = 0; + int isize; struct mount *mp; mp = NULL; @@ -118,18 +119,21 @@ ufs_inactive(ap) } } } - if (ip->i_effnlink == 0 && DOINGSOFTDEP(vp)) - softdep_releasefile(ip); - if (ip->i_nlink <= 0 && !UFS_RDONLY(ip)) { + isize = ip->i_size; + if (ip->i_ump->um_fstype == UFS2) + isize += ip->i_din2->di_extsize; + if (ip->i_effnlink <= 0 && isize && !UFS_RDONLY(ip)) { #ifdef QUOTA if (!getinoquota(ip)) (void)chkiq(ip, -1, NOCRED, FORCE); #endif + error = UFS_TRUNCATE(vp, (off_t)0, IO_EXT | IO_NORMAL, + NOCRED, td); + } + if (ip->i_nlink <= 0 && ip->i_mode && !UFS_RDONLY(ip)) { #ifdef UFS_EXTATTR ufs_extattr_vnode_inactive(vp, td); #endif - error = UFS_TRUNCATE(vp, (off_t)0, IO_EXT | IO_NORMAL, - NOCRED, td); /* * Setting the mode to zero needs to wait for the inode * to be written just as does a change to the link count. Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Tue Jul 6 07:07:29 2010 (r209716) +++ head/sys/ufs/ufs/ufs_lookup.c Tue Jul 6 07:11:04 2010 (r209717) @@ -248,6 +248,8 @@ ufs_lookup_ino(struct vnode *vdp, struct *vpp = NULL; dp = VTOI(vdp); + if (dp->i_effnlink == 0) + return (ENOENT); /* * Create a vm object if vmiodirenable is enabled. Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Tue Jul 6 07:07:29 2010 (r209716) +++ head/sys/ufs/ufs/ufs_vnops.c Tue Jul 6 07:11:04 2010 (r209717) @@ -1119,7 +1119,7 @@ ufs_rename(ap) struct direct newdir; off_t endoff; int doingdirectory, newparent; - int error = 0, ioflag; + int error = 0; struct mount *mp; ino_t ino; @@ -1443,8 +1443,8 @@ relock: } if (doingdirectory && !DOINGSOFTDEP(tvp)) { /* - * Truncate inode. The only stuff left in the directory - * is "." and "..". The "." reference is inconsequential + * The only stuff left in the directory is "." + * and "..". The "." reference is inconsequential * since we are quashing it. We have removed the "." * reference and the reference in the parent directory, * but there may be other hard links. The soft @@ -1461,13 +1461,6 @@ relock: tip->i_nlink--; DIP_SET(tip, i_nlink, tip->i_nlink); tip->i_flag |= IN_CHANGE; - ioflag = IO_NORMAL; - if (!DOINGASYNC(tvp)) - ioflag |= IO_SYNC; - /* Don't go to bad here as the new link exists. */ - if ((error = UFS_TRUNCATE(tvp, (off_t)0, ioflag, - tcnp->cn_cred, tcnp->cn_thread)) != 0) - goto unlockout; } } @@ -1993,7 +1986,7 @@ ufs_rmdir(ap) struct vnode *dvp = ap->a_dvp; struct componentname *cnp = ap->a_cnp; struct inode *ip, *dp; - int error, ioflag; + int error; ip = VTOI(vp); dp = VTOI(dvp); @@ -2049,10 +2042,10 @@ ufs_rmdir(ap) } cache_purge(dvp); /* - * Truncate inode. The only stuff left in the directory is "." and - * "..". The "." reference is inconsequential since we are quashing - * it. The soft dependency code will arrange to do these operations - * after the parent directory entry has been deleted on disk, so + * The only stuff left in the directory is "." and "..". The "." + * reference is inconsequential since we are quashing it. The soft + * dependency code will arrange to do these operations after + * the parent directory entry has been deleted on disk, so * when running with that code we avoid doing them now. */ if (!DOINGSOFTDEP(vp)) { @@ -2062,11 +2055,6 @@ ufs_rmdir(ap) ip->i_nlink--; DIP_SET(ip, i_nlink, ip->i_nlink); ip->i_flag |= IN_CHANGE; - ioflag = IO_NORMAL; - if (!DOINGASYNC(vp)) - ioflag |= IO_SYNC; - error = UFS_TRUNCATE(vp, (off_t)0, ioflag, cnp->cn_cred, - cnp->cn_thread); } cache_purge(vp); #ifdef UFS_DIRHASH @@ -2137,6 +2125,7 @@ ufs_readdir(ap) } */ *ap; { struct uio *uio = ap->a_uio; + struct inode *ip; int error; size_t count, lost; off_t off; @@ -2147,6 +2136,9 @@ ufs_readdir(ap) * the cookies to determine where in the block to start. */ uio->uio_offset &= ~(DIRBLKSIZ - 1); + ip = VTOI(ap->a_vp); + if (ip->i_effnlink == 0) + return (0); off = uio->uio_offset; count = uio->uio_resid; /* Make sure we don't return partial entries. */ From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 08:56:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 754411065672; Tue, 6 Jul 2010 08:56:34 +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 656528FC0A; Tue, 6 Jul 2010 08:56:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o668uYlT020725; Tue, 6 Jul 2010 08:56:34 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o668uYth020723; Tue, 6 Jul 2010 08:56:34 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201007060856.o668uYth020723@svn.freebsd.org> From: Ed Schouten Date: Tue, 6 Jul 2010 08:56: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: r209718 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 08:56:34 -0000 Author: ed Date: Tue Jul 6 08:56:34 2010 New Revision: 209718 URL: http://svn.freebsd.org/changeset/base/209718 Log: Fix a race condition, where a TTY could be destroyed twice. There are special cases where tty_rel_free() can be called twice in a row, namely when closing and revoking the TTY at the same moment. Only call destroy_dev_sched_cb() once. Reported by: Jeremie Le Hen MFC after: 1 week Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Tue Jul 6 07:11:04 2010 (r209717) +++ head/sys/kern/tty.c Tue Jul 6 08:56:34 2010 (r209718) @@ -1040,7 +1040,8 @@ tty_rel_free(struct tty *tp) tp->t_dev = NULL; tty_unlock(tp); - destroy_dev_sched_cb(dev, tty_dealloc, tp); + if (dev != NULL) + destroy_dev_sched_cb(dev, tty_dealloc, tp); } void From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 10:22:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEC991065673; Tue, 6 Jul 2010 10:22:17 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC4B78FC1D; Tue, 6 Jul 2010 10:22:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66AMHEU039630; Tue, 6 Jul 2010 10:22:17 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66AMHTA039627; Tue, 6 Jul 2010 10:22:17 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201007061022.o66AMHTA039627@svn.freebsd.org> From: Rui Paulo Date: Tue, 6 Jul 2010 10:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209720 - in vendor-sys/opensolaris/dist/uts: intel/dtrace sparc/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 10:22:17 -0000 Author: rpaulo Date: Tue Jul 6 10:22:17 2010 New Revision: 209720 URL: http://svn.freebsd.org/changeset/base/209720 Log: Import fasttrap_isa.c from OpenSolaris. Added: vendor-sys/opensolaris/dist/uts/intel/dtrace/ vendor-sys/opensolaris/dist/uts/intel/dtrace/fasttrap_isa.c (contents, props changed) vendor-sys/opensolaris/dist/uts/sparc/dtrace/ vendor-sys/opensolaris/dist/uts/sparc/dtrace/fasttrap_isa.c (contents, props changed) Added: vendor-sys/opensolaris/dist/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/opensolaris/dist/uts/intel/dtrace/fasttrap_isa.c Tue Jul 6 10:22:17 2010 (r209720) @@ -0,0 +1,1745 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Lossless User-Land Tracing on x86 + * --------------------------------- + * + * The execution of most instructions is not dependent on the address; for + * these instructions it is sufficient to copy them into the user process's + * address space and execute them. To effectively single-step an instruction + * in user-land, we copy out the following sequence of instructions to scratch + * space in the user thread's ulwp_t structure. + * + * We then set the program counter (%eip or %rip) to point to this scratch + * space. Once execution resumes, the original instruction is executed and + * then control flow is redirected to what was originally the subsequent + * instruction. If the kernel attemps to deliver a signal while single- + * stepping, the signal is deferred and the program counter is moved into the + * second sequence of instructions. The second sequence ends in a trap into + * the kernel where the deferred signal is then properly handled and delivered. + * + * For instructions whose execute is position dependent, we perform simple + * emulation. These instructions are limited to control transfer + * instructions in 32-bit mode, but in 64-bit mode there's the added wrinkle + * of %rip-relative addressing that means that almost any instruction can be + * position dependent. For all the details on how we emulate generic + * instructions included %rip-relative instructions, see the code in + * fasttrap_pid_probe() below where we handle instructions of type + * FASTTRAP_T_COMMON (under the header: Generic Instruction Tracing). + */ + +#define FASTTRAP_MODRM_MOD(modrm) (((modrm) >> 6) & 0x3) +#define FASTTRAP_MODRM_REG(modrm) (((modrm) >> 3) & 0x7) +#define FASTTRAP_MODRM_RM(modrm) ((modrm) & 0x7) +#define FASTTRAP_MODRM(mod, reg, rm) (((mod) << 6) | ((reg) << 3) | (rm)) + +#define FASTTRAP_SIB_SCALE(sib) (((sib) >> 6) & 0x3) +#define FASTTRAP_SIB_INDEX(sib) (((sib) >> 3) & 0x7) +#define FASTTRAP_SIB_BASE(sib) ((sib) & 0x7) + +#define FASTTRAP_REX_W(rex) (((rex) >> 3) & 1) +#define FASTTRAP_REX_R(rex) (((rex) >> 2) & 1) +#define FASTTRAP_REX_X(rex) (((rex) >> 1) & 1) +#define FASTTRAP_REX_B(rex) ((rex) & 1) +#define FASTTRAP_REX(w, r, x, b) \ + (0x40 | ((w) << 3) | ((r) << 2) | ((x) << 1) | (b)) + +/* + * Single-byte op-codes. + */ +#define FASTTRAP_PUSHL_EBP 0x55 + +#define FASTTRAP_JO 0x70 +#define FASTTRAP_JNO 0x71 +#define FASTTRAP_JB 0x72 +#define FASTTRAP_JAE 0x73 +#define FASTTRAP_JE 0x74 +#define FASTTRAP_JNE 0x75 +#define FASTTRAP_JBE 0x76 +#define FASTTRAP_JA 0x77 +#define FASTTRAP_JS 0x78 +#define FASTTRAP_JNS 0x79 +#define FASTTRAP_JP 0x7a +#define FASTTRAP_JNP 0x7b +#define FASTTRAP_JL 0x7c +#define FASTTRAP_JGE 0x7d +#define FASTTRAP_JLE 0x7e +#define FASTTRAP_JG 0x7f + +#define FASTTRAP_NOP 0x90 + +#define FASTTRAP_MOV_EAX 0xb8 +#define FASTTRAP_MOV_ECX 0xb9 + +#define FASTTRAP_RET16 0xc2 +#define FASTTRAP_RET 0xc3 + +#define FASTTRAP_LOOPNZ 0xe0 +#define FASTTRAP_LOOPZ 0xe1 +#define FASTTRAP_LOOP 0xe2 +#define FASTTRAP_JCXZ 0xe3 + +#define FASTTRAP_CALL 0xe8 +#define FASTTRAP_JMP32 0xe9 +#define FASTTRAP_JMP8 0xeb + +#define FASTTRAP_INT3 0xcc +#define FASTTRAP_INT 0xcd + +#define FASTTRAP_2_BYTE_OP 0x0f +#define FASTTRAP_GROUP5_OP 0xff + +/* + * Two-byte op-codes (second byte only). + */ +#define FASTTRAP_0F_JO 0x80 +#define FASTTRAP_0F_JNO 0x81 +#define FASTTRAP_0F_JB 0x82 +#define FASTTRAP_0F_JAE 0x83 +#define FASTTRAP_0F_JE 0x84 +#define FASTTRAP_0F_JNE 0x85 +#define FASTTRAP_0F_JBE 0x86 +#define FASTTRAP_0F_JA 0x87 +#define FASTTRAP_0F_JS 0x88 +#define FASTTRAP_0F_JNS 0x89 +#define FASTTRAP_0F_JP 0x8a +#define FASTTRAP_0F_JNP 0x8b +#define FASTTRAP_0F_JL 0x8c +#define FASTTRAP_0F_JGE 0x8d +#define FASTTRAP_0F_JLE 0x8e +#define FASTTRAP_0F_JG 0x8f + +#define FASTTRAP_EFLAGS_OF 0x800 +#define FASTTRAP_EFLAGS_DF 0x400 +#define FASTTRAP_EFLAGS_SF 0x080 +#define FASTTRAP_EFLAGS_ZF 0x040 +#define FASTTRAP_EFLAGS_AF 0x010 +#define FASTTRAP_EFLAGS_PF 0x004 +#define FASTTRAP_EFLAGS_CF 0x001 + +/* + * Instruction prefixes. + */ +#define FASTTRAP_PREFIX_OPERAND 0x66 +#define FASTTRAP_PREFIX_ADDRESS 0x67 +#define FASTTRAP_PREFIX_CS 0x2E +#define FASTTRAP_PREFIX_DS 0x3E +#define FASTTRAP_PREFIX_ES 0x26 +#define FASTTRAP_PREFIX_FS 0x64 +#define FASTTRAP_PREFIX_GS 0x65 +#define FASTTRAP_PREFIX_SS 0x36 +#define FASTTRAP_PREFIX_LOCK 0xF0 +#define FASTTRAP_PREFIX_REP 0xF3 +#define FASTTRAP_PREFIX_REPNE 0xF2 + +#define FASTTRAP_NOREG 0xff + +/* + * Map between instruction register encodings and the kernel constants which + * correspond to indicies into struct regs. + */ +#ifdef __amd64 +static const uint8_t regmap[16] = { + REG_RAX, REG_RCX, REG_RDX, REG_RBX, REG_RSP, REG_RBP, REG_RSI, REG_RDI, + REG_R8, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, +}; +#else +static const uint8_t regmap[8] = { + EAX, ECX, EDX, EBX, UESP, EBP, ESI, EDI +}; +#endif + +static ulong_t fasttrap_getreg(struct regs *, uint_t); + +static uint64_t +fasttrap_anarg(struct regs *rp, int function_entry, int argno) +{ + uint64_t value; + int shift = function_entry ? 1 : 0; + +#ifdef __amd64 + if (curproc->p_model == DATAMODEL_LP64) { + uintptr_t *stack; + + /* + * In 64-bit mode, the first six arguments are stored in + * registers. + */ + if (argno < 6) + return ((&rp->r_rdi)[argno]); + + stack = (uintptr_t *)rp->r_sp; + DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); + value = dtrace_fulword(&stack[argno - 6 + shift]); + DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT | CPU_DTRACE_BADADDR); + } else { +#endif + uint32_t *stack = (uint32_t *)rp->r_sp; + DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); + value = dtrace_fuword32(&stack[argno + shift]); + DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT | CPU_DTRACE_BADADDR); +#ifdef __amd64 + } +#endif + + return (value); +} + +/*ARGSUSED*/ +int +fasttrap_tracepoint_init(proc_t *p, fasttrap_tracepoint_t *tp, uintptr_t pc, + fasttrap_probe_type_t type) +{ + uint8_t instr[FASTTRAP_MAX_INSTR_SIZE + 10]; + size_t len = FASTTRAP_MAX_INSTR_SIZE; + size_t first = MIN(len, PAGESIZE - (pc & PAGEOFFSET)); + uint_t start = 0; + int rmindex, size; + uint8_t seg, rex = 0; + + /* + * Read the instruction at the given address out of the process's + * address space. We don't have to worry about a debugger + * changing this instruction before we overwrite it with our trap + * instruction since P_PR_LOCK is set. Since instructions can span + * pages, we potentially read the instruction in two parts. If the + * second part fails, we just zero out that part of the instruction. + */ + if (uread(p, &instr[0], first, pc) != 0) + return (-1); + if (len > first && + uread(p, &instr[first], len - first, pc + first) != 0) { + bzero(&instr[first], len - first); + len = first; + } + + /* + * If the disassembly fails, then we have a malformed instruction. + */ + if ((size = dtrace_instr_size_isa(instr, p->p_model, &rmindex)) <= 0) + return (-1); + + /* + * Make sure the disassembler isn't completely broken. + */ + ASSERT(-1 <= rmindex && rmindex < size); + + /* + * If the computed size is greater than the number of bytes read, + * then it was a malformed instruction possibly because it fell on a + * page boundary and the subsequent page was missing or because of + * some malicious user. + */ + if (size > len) + return (-1); + + tp->ftt_size = (uint8_t)size; + tp->ftt_segment = FASTTRAP_SEG_NONE; + + /* + * Find the start of the instruction's opcode by processing any + * legacy prefixes. + */ + for (;;) { + seg = 0; + switch (instr[start]) { + case FASTTRAP_PREFIX_SS: + seg++; + /*FALLTHRU*/ + case FASTTRAP_PREFIX_GS: + seg++; + /*FALLTHRU*/ + case FASTTRAP_PREFIX_FS: + seg++; + /*FALLTHRU*/ + case FASTTRAP_PREFIX_ES: + seg++; + /*FALLTHRU*/ + case FASTTRAP_PREFIX_DS: + seg++; + /*FALLTHRU*/ + case FASTTRAP_PREFIX_CS: + seg++; + /*FALLTHRU*/ + case FASTTRAP_PREFIX_OPERAND: + case FASTTRAP_PREFIX_ADDRESS: + case FASTTRAP_PREFIX_LOCK: + case FASTTRAP_PREFIX_REP: + case FASTTRAP_PREFIX_REPNE: + if (seg != 0) { + /* + * It's illegal for an instruction to specify + * two segment prefixes -- give up on this + * illegal instruction. + */ + if (tp->ftt_segment != FASTTRAP_SEG_NONE) + return (-1); + + tp->ftt_segment = seg; + } + start++; + continue; + } + break; + } + +#ifdef __amd64 + /* + * Identify the REX prefix on 64-bit processes. + */ + if (p->p_model == DATAMODEL_LP64 && (instr[start] & 0xf0) == 0x40) + rex = instr[start++]; +#endif + + /* + * Now that we're pretty sure that the instruction is okay, copy the + * valid part to the tracepoint. + */ + bcopy(instr, tp->ftt_instr, FASTTRAP_MAX_INSTR_SIZE); + + tp->ftt_type = FASTTRAP_T_COMMON; + if (instr[start] == FASTTRAP_2_BYTE_OP) { + switch (instr[start + 1]) { + case FASTTRAP_0F_JO: + case FASTTRAP_0F_JNO: + case FASTTRAP_0F_JB: + case FASTTRAP_0F_JAE: + case FASTTRAP_0F_JE: + case FASTTRAP_0F_JNE: + case FASTTRAP_0F_JBE: + case FASTTRAP_0F_JA: + case FASTTRAP_0F_JS: + case FASTTRAP_0F_JNS: + case FASTTRAP_0F_JP: + case FASTTRAP_0F_JNP: + case FASTTRAP_0F_JL: + case FASTTRAP_0F_JGE: + case FASTTRAP_0F_JLE: + case FASTTRAP_0F_JG: + tp->ftt_type = FASTTRAP_T_JCC; + tp->ftt_code = (instr[start + 1] & 0x0f) | FASTTRAP_JO; + tp->ftt_dest = pc + tp->ftt_size + + /* LINTED - alignment */ + *(int32_t *)&instr[start + 2]; + break; + } + } else if (instr[start] == FASTTRAP_GROUP5_OP) { + uint_t mod = FASTTRAP_MODRM_MOD(instr[start + 1]); + uint_t reg = FASTTRAP_MODRM_REG(instr[start + 1]); + uint_t rm = FASTTRAP_MODRM_RM(instr[start + 1]); + + if (reg == 2 || reg == 4) { + uint_t i, sz; + + if (reg == 2) + tp->ftt_type = FASTTRAP_T_CALL; + else + tp->ftt_type = FASTTRAP_T_JMP; + + if (mod == 3) + tp->ftt_code = 2; + else + tp->ftt_code = 1; + + ASSERT(p->p_model == DATAMODEL_LP64 || rex == 0); + + /* + * See AMD x86-64 Architecture Programmer's Manual + * Volume 3, Section 1.2.7, Table 1-12, and + * Appendix A.3.1, Table A-15. + */ + if (mod != 3 && rm == 4) { + uint8_t sib = instr[start + 2]; + uint_t index = FASTTRAP_SIB_INDEX(sib); + uint_t base = FASTTRAP_SIB_BASE(sib); + + tp->ftt_scale = FASTTRAP_SIB_SCALE(sib); + + tp->ftt_index = (index == 4) ? + FASTTRAP_NOREG : + regmap[index | (FASTTRAP_REX_X(rex) << 3)]; + tp->ftt_base = (mod == 0 && base == 5) ? + FASTTRAP_NOREG : + regmap[base | (FASTTRAP_REX_B(rex) << 3)]; + + i = 3; + sz = mod == 1 ? 1 : 4; + } else { + /* + * In 64-bit mode, mod == 0 and r/m == 5 + * denotes %rip-relative addressing; in 32-bit + * mode, the base register isn't used. In both + * modes, there is a 32-bit operand. + */ + if (mod == 0 && rm == 5) { +#ifdef __amd64 + if (p->p_model == DATAMODEL_LP64) + tp->ftt_base = REG_RIP; + else +#endif + tp->ftt_base = FASTTRAP_NOREG; + sz = 4; + } else { + uint8_t base = rm | + (FASTTRAP_REX_B(rex) << 3); + + tp->ftt_base = regmap[base]; + sz = mod == 1 ? 1 : mod == 2 ? 4 : 0; + } + tp->ftt_index = FASTTRAP_NOREG; + i = 2; + } + + if (sz == 1) { + tp->ftt_dest = *(int8_t *)&instr[start + i]; + } else if (sz == 4) { + /* LINTED - alignment */ + tp->ftt_dest = *(int32_t *)&instr[start + i]; + } else { + tp->ftt_dest = 0; + } + } + } else { + switch (instr[start]) { + case FASTTRAP_RET: + tp->ftt_type = FASTTRAP_T_RET; + break; + + case FASTTRAP_RET16: + tp->ftt_type = FASTTRAP_T_RET16; + /* LINTED - alignment */ + tp->ftt_dest = *(uint16_t *)&instr[start + 1]; + break; + + case FASTTRAP_JO: + case FASTTRAP_JNO: + case FASTTRAP_JB: + case FASTTRAP_JAE: + case FASTTRAP_JE: + case FASTTRAP_JNE: + case FASTTRAP_JBE: + case FASTTRAP_JA: + case FASTTRAP_JS: + case FASTTRAP_JNS: + case FASTTRAP_JP: + case FASTTRAP_JNP: + case FASTTRAP_JL: + case FASTTRAP_JGE: + case FASTTRAP_JLE: + case FASTTRAP_JG: + tp->ftt_type = FASTTRAP_T_JCC; + tp->ftt_code = instr[start]; + tp->ftt_dest = pc + tp->ftt_size + + (int8_t)instr[start + 1]; + break; + + case FASTTRAP_LOOPNZ: + case FASTTRAP_LOOPZ: + case FASTTRAP_LOOP: + tp->ftt_type = FASTTRAP_T_LOOP; + tp->ftt_code = instr[start]; + tp->ftt_dest = pc + tp->ftt_size + + (int8_t)instr[start + 1]; + break; + + case FASTTRAP_JCXZ: + tp->ftt_type = FASTTRAP_T_JCXZ; + tp->ftt_dest = pc + tp->ftt_size + + (int8_t)instr[start + 1]; + break; + + case FASTTRAP_CALL: + tp->ftt_type = FASTTRAP_T_CALL; + tp->ftt_dest = pc + tp->ftt_size + + /* LINTED - alignment */ + *(int32_t *)&instr[start + 1]; + tp->ftt_code = 0; + break; + + case FASTTRAP_JMP32: + tp->ftt_type = FASTTRAP_T_JMP; + tp->ftt_dest = pc + tp->ftt_size + + /* LINTED - alignment */ + *(int32_t *)&instr[start + 1]; + break; + case FASTTRAP_JMP8: + tp->ftt_type = FASTTRAP_T_JMP; + tp->ftt_dest = pc + tp->ftt_size + + (int8_t)instr[start + 1]; + break; + + case FASTTRAP_PUSHL_EBP: + if (start == 0) + tp->ftt_type = FASTTRAP_T_PUSHL_EBP; + break; + + case FASTTRAP_NOP: +#ifdef __amd64 + ASSERT(p->p_model == DATAMODEL_LP64 || rex == 0); + + /* + * On amd64 we have to be careful not to confuse a nop + * (actually xchgl %eax, %eax) with an instruction using + * the same opcode, but that does something different + * (e.g. xchgl %r8d, %eax or xcghq %r8, %rax). + */ + if (FASTTRAP_REX_B(rex) == 0) +#endif + tp->ftt_type = FASTTRAP_T_NOP; + break; + + case FASTTRAP_INT3: + /* + * The pid provider shares the int3 trap with debugger + * breakpoints so we can't instrument them. + */ + ASSERT(instr[start] == FASTTRAP_INSTR); + return (-1); + + case FASTTRAP_INT: + /* + * Interrupts seem like they could be traced with + * no negative implications, but it's possible that + * a thread could be redirected by the trap handling + * code which would eventually return to the + * instruction after the interrupt. If the interrupt + * were in our scratch space, the subsequent + * instruction might be overwritten before we return. + * Accordingly we refuse to instrument any interrupt. + */ + return (-1); + } + } + +#ifdef __amd64 + if (p->p_model == DATAMODEL_LP64 && tp->ftt_type == FASTTRAP_T_COMMON) { + /* + * If the process is 64-bit and the instruction type is still + * FASTTRAP_T_COMMON -- meaning we're going to copy it out an + * execute it -- we need to watch for %rip-relative + * addressing mode. See the portion of fasttrap_pid_probe() + * below where we handle tracepoints with type + * FASTTRAP_T_COMMON for how we emulate instructions that + * employ %rip-relative addressing. + */ + if (rmindex != -1) { + uint_t mod = FASTTRAP_MODRM_MOD(instr[rmindex]); + uint_t reg = FASTTRAP_MODRM_REG(instr[rmindex]); + uint_t rm = FASTTRAP_MODRM_RM(instr[rmindex]); + + ASSERT(rmindex > start); + + if (mod == 0 && rm == 5) { + /* + * We need to be sure to avoid other + * registers used by this instruction. While + * the reg field may determine the op code + * rather than denoting a register, assuming + * that it denotes a register is always safe. + * We leave the REX field intact and use + * whatever value's there for simplicity. + */ + if (reg != 0) { + tp->ftt_ripmode = FASTTRAP_RIP_1 | + (FASTTRAP_RIP_X * + FASTTRAP_REX_B(rex)); + rm = 0; + } else { + tp->ftt_ripmode = FASTTRAP_RIP_2 | + (FASTTRAP_RIP_X * + FASTTRAP_REX_B(rex)); + rm = 1; + } + + tp->ftt_modrm = tp->ftt_instr[rmindex]; + tp->ftt_instr[rmindex] = + FASTTRAP_MODRM(2, reg, rm); + } + } + } +#endif + + return (0); +} + +int +fasttrap_tracepoint_install(proc_t *p, fasttrap_tracepoint_t *tp) +{ + fasttrap_instr_t instr = FASTTRAP_INSTR; + + if (uwrite(p, &instr, 1, tp->ftt_pc) != 0) + return (-1); + + return (0); +} + +int +fasttrap_tracepoint_remove(proc_t *p, fasttrap_tracepoint_t *tp) +{ + uint8_t instr; + + /* + * Distinguish between read or write failures and a changed + * instruction. + */ + if (uread(p, &instr, 1, tp->ftt_pc) != 0) + return (0); + if (instr != FASTTRAP_INSTR) + return (0); + if (uwrite(p, &tp->ftt_instr[0], 1, tp->ftt_pc) != 0) + return (-1); + + return (0); +} + +#ifdef __amd64 +static uintptr_t +fasttrap_fulword_noerr(const void *uaddr) +{ + uintptr_t ret; + + if (fasttrap_fulword(uaddr, &ret) == 0) + return (ret); + + return (0); +} +#endif + +static uint32_t +fasttrap_fuword32_noerr(const void *uaddr) +{ + uint32_t ret; + + if (fasttrap_fuword32(uaddr, &ret) == 0) + return (ret); + + return (0); +} + +static void +fasttrap_return_common(struct regs *rp, uintptr_t pc, pid_t pid, + uintptr_t new_pc) +{ + fasttrap_tracepoint_t *tp; + fasttrap_bucket_t *bucket; + fasttrap_id_t *id; + kmutex_t *pid_mtx; + + pid_mtx = &cpu_core[CPU->cpu_id].cpuc_pid_lock; + mutex_enter(pid_mtx); + bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; + + for (tp = bucket->ftb_data; tp != NULL; tp = tp->ftt_next) { + if (pid == tp->ftt_pid && pc == tp->ftt_pc && + tp->ftt_proc->ftpc_acount != 0) + break; + } + + /* + * Don't sweat it if we can't find the tracepoint again; unlike + * when we're in fasttrap_pid_probe(), finding the tracepoint here + * is not essential to the correct execution of the process. + */ + if (tp == NULL) { + mutex_exit(pid_mtx); + return; + } + + for (id = tp->ftt_retids; id != NULL; id = id->fti_next) { + /* + * If there's a branch that could act as a return site, we + * need to trace it, and check here if the program counter is + * external to the function. + */ + if (tp->ftt_type != FASTTRAP_T_RET && + tp->ftt_type != FASTTRAP_T_RET16 && + new_pc - id->fti_probe->ftp_faddr < + id->fti_probe->ftp_fsize) + continue; + + dtrace_probe(id->fti_probe->ftp_id, + pc - id->fti_probe->ftp_faddr, + rp->r_r0, rp->r_r1, 0, 0); + } + + mutex_exit(pid_mtx); +} + +static void +fasttrap_sigsegv(proc_t *p, kthread_t *t, uintptr_t addr) +{ + sigqueue_t *sqp = kmem_zalloc(sizeof (sigqueue_t), KM_SLEEP); + + sqp->sq_info.si_signo = SIGSEGV; + sqp->sq_info.si_code = SEGV_MAPERR; + sqp->sq_info.si_addr = (caddr_t)addr; + + mutex_enter(&p->p_lock); + sigaddqa(p, t, sqp); + mutex_exit(&p->p_lock); + + if (t != NULL) + aston(t); +} + +#ifdef __amd64 +static void +fasttrap_usdt_args64(fasttrap_probe_t *probe, struct regs *rp, int argc, + uintptr_t *argv) +{ + int i, x, cap = MIN(argc, probe->ftp_nargs); + uintptr_t *stack = (uintptr_t *)rp->r_sp; + + for (i = 0; i < cap; i++) { + x = probe->ftp_argmap[i]; + + if (x < 6) + argv[i] = (&rp->r_rdi)[x]; + else + argv[i] = fasttrap_fulword_noerr(&stack[x]); + } + + for (; i < argc; i++) { + argv[i] = 0; + } +} +#endif + +static void +fasttrap_usdt_args32(fasttrap_probe_t *probe, struct regs *rp, int argc, + uint32_t *argv) +{ + int i, x, cap = MIN(argc, probe->ftp_nargs); + uint32_t *stack = (uint32_t *)rp->r_sp; + + for (i = 0; i < cap; i++) { + x = probe->ftp_argmap[i]; + + argv[i] = fasttrap_fuword32_noerr(&stack[x]); + } + + for (; i < argc; i++) { + argv[i] = 0; + } +} + +static int +fasttrap_do_seg(fasttrap_tracepoint_t *tp, struct regs *rp, uintptr_t *addr) +{ + proc_t *p = curproc; + user_desc_t *desc; + uint16_t sel, ndx, type; + uintptr_t limit; + + switch (tp->ftt_segment) { + case FASTTRAP_SEG_CS: + sel = rp->r_cs; + break; + case FASTTRAP_SEG_DS: + sel = rp->r_ds; + break; + case FASTTRAP_SEG_ES: + sel = rp->r_es; + break; + case FASTTRAP_SEG_FS: + sel = rp->r_fs; + break; + case FASTTRAP_SEG_GS: + sel = rp->r_gs; + break; + case FASTTRAP_SEG_SS: + sel = rp->r_ss; + break; + } + + /* + * Make sure the given segment register specifies a user priority + * selector rather than a kernel selector. + */ + if (!SELISUPL(sel)) + return (-1); + + ndx = SELTOIDX(sel); + + /* + * Check the bounds and grab the descriptor out of the specified + * descriptor table. + */ + if (SELISLDT(sel)) { + if (ndx > p->p_ldtlimit) + return (-1); + + desc = p->p_ldt + ndx; + + } else { + if (ndx >= NGDT) + return (-1); + + desc = cpu_get_gdt() + ndx; + } + + /* + * The descriptor must have user privilege level and it must be + * present in memory. + */ + if (desc->usd_dpl != SEL_UPL || desc->usd_p != 1) + return (-1); + + type = desc->usd_type; + + /* + * If the S bit in the type field is not set, this descriptor can + * only be used in system context. + */ + if ((type & 0x10) != 0x10) + return (-1); + + limit = USEGD_GETLIMIT(desc) * (desc->usd_gran ? PAGESIZE : 1); + + if (tp->ftt_segment == FASTTRAP_SEG_CS) { + /* + * The code/data bit and readable bit must both be set. + */ + if ((type & 0xa) != 0xa) + return (-1); + + if (*addr > limit) + return (-1); + } else { + /* + * The code/data bit must be clear. + */ + if ((type & 0x8) != 0) + return (-1); + + /* + * If the expand-down bit is clear, we just check the limit as + * it would naturally be applied. Otherwise, we need to check + * that the address is the range [limit + 1 .. 0xffff] or + * [limit + 1 ... 0xffffffff] depending on if the default + * operand size bit is set. + */ + if ((type & 0x4) == 0) { + if (*addr > limit) + return (-1); + } else if (desc->usd_def32) { + if (*addr < limit + 1 || 0xffff < *addr) + return (-1); + } else { + if (*addr < limit + 1 || 0xffffffff < *addr) + return (-1); + } + } + + *addr += USEGD_GETBASE(desc); + + return (0); +} + +int +fasttrap_pid_probe(struct regs *rp) +{ + proc_t *p = curproc; + uintptr_t pc = rp->r_pc - 1, new_pc = 0; + fasttrap_bucket_t *bucket; + kmutex_t *pid_mtx; + fasttrap_tracepoint_t *tp, tp_local; + pid_t pid; + dtrace_icookie_t cookie; + uint_t is_enabled = 0; + + /* + * It's possible that a user (in a veritable orgy of bad planning) + * could redirect this thread's flow of control before it reached the + * return probe fasttrap. In this case we need to kill the process + * since it's in a unrecoverable state. + */ + if (curthread->t_dtrace_step) { + ASSERT(curthread->t_dtrace_on); + fasttrap_sigtrap(p, curthread, pc); + return (0); + } + + /* + * Clear all user tracing flags. + */ + curthread->t_dtrace_ft = 0; + curthread->t_dtrace_pc = 0; + curthread->t_dtrace_npc = 0; + curthread->t_dtrace_scrpc = 0; + curthread->t_dtrace_astpc = 0; +#ifdef __amd64 + curthread->t_dtrace_regv = 0; +#endif + + /* + * Treat a child created by a call to vfork(2) as if it were its + * parent. We know that there's only one thread of control in such a + * process: this one. + */ + while (p->p_flag & SVFORK) { + p = p->p_parent; + } + + pid = p->p_pid; + pid_mtx = &cpu_core[CPU->cpu_id].cpuc_pid_lock; + mutex_enter(pid_mtx); + bucket = &fasttrap_tpoints.fth_table[FASTTRAP_TPOINTS_INDEX(pid, pc)]; + + /* + * Lookup the tracepoint that the process just hit. + */ + for (tp = bucket->ftb_data; tp != NULL; tp = tp->ftt_next) { + if (pid == tp->ftt_pid && pc == tp->ftt_pc && + tp->ftt_proc->ftpc_acount != 0) + break; + } + + /* + * If we couldn't find a matching tracepoint, either a tracepoint has + * been inserted without using the pid ioctl interface (see + * fasttrap_ioctl), or somehow we have mislaid this tracepoint. + */ + if (tp == NULL) { + mutex_exit(pid_mtx); + return (-1); + } + + /* + * Set the program counter to the address of the traced instruction + * so that it looks right in ustack() output. + */ + rp->r_pc = pc; + + if (tp->ftt_ids != NULL) { + fasttrap_id_t *id; + +#ifdef __amd64 + if (p->p_model == DATAMODEL_LP64) { + for (id = tp->ftt_ids; id != NULL; id = id->fti_next) { + fasttrap_probe_t *probe = id->fti_probe; + + if (id->fti_ptype == DTFTP_ENTRY) { + /* + * We note that this was an entry + * probe to help ustack() find the + * first caller. + */ + cookie = dtrace_interrupt_disable(); + DTRACE_CPUFLAG_SET(CPU_DTRACE_ENTRY); + dtrace_probe(probe->ftp_id, rp->r_rdi, + rp->r_rsi, rp->r_rdx, rp->r_rcx, + rp->r_r8); + DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_ENTRY); + dtrace_interrupt_enable(cookie); + } else if (id->fti_ptype == DTFTP_IS_ENABLED) { + /* + * Note that in this case, we don't + * call dtrace_probe() since it's only + * an artificial probe meant to change + * the flow of control so that it + * encounters the true probe. + */ + is_enabled = 1; + } else if (probe->ftp_argmap == NULL) { + dtrace_probe(probe->ftp_id, rp->r_rdi, + rp->r_rsi, rp->r_rdx, rp->r_rcx, + rp->r_r8); + } else { + uintptr_t t[5]; + + fasttrap_usdt_args64(probe, rp, + sizeof (t) / sizeof (t[0]), t); + + dtrace_probe(probe->ftp_id, t[0], t[1], + t[2], t[3], t[4]); + } + } + } else { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 10:28:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5080A106564A; Tue, 6 Jul 2010 10:28:20 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E39B8FC13; Tue, 6 Jul 2010 10:28:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66ASKFe040994; Tue, 6 Jul 2010 10:28:20 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66ASKkH040992; Tue, 6 Jul 2010 10:28:20 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201007061028.o66ASKkH040992@svn.freebsd.org> From: Rui Paulo Date: Tue, 6 Jul 2010 10:28: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: r209721 - in head/sys/cddl/contrib/opensolaris/uts: common/sys intel/dtrace sparc/dtrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 10:28:20 -0000 Author: rpaulo Date: Tue Jul 6 10:28:19 2010 New Revision: 209721 URL: http://svn.freebsd.org/changeset/base/209721 Log: Merge from vendor-sys/opensolaris: * add fasttrap files Added: head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h - copied unchanged from r209720, vendor-sys/opensolaris/dist/uts/common/sys/fasttrap_impl.h head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/ - copied from r209720, vendor-sys/opensolaris/dist/uts/intel/dtrace/ head/sys/cddl/contrib/opensolaris/uts/sparc/dtrace/ - copied from r209720, vendor-sys/opensolaris/dist/uts/sparc/dtrace/ Modified: Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Copied: head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h (from r209720, vendor-sys/opensolaris/dist/uts/common/sys/fasttrap_impl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Tue Jul 6 10:28:19 2010 (r209721, copy of r209720, vendor-sys/opensolaris/dist/uts/common/sys/fasttrap_impl.h) @@ -0,0 +1,192 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _FASTTRAP_IMPL_H +#define _FASTTRAP_IMPL_H + +#pragma ident "%Z%%M% %I% %E% SMI" + +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Fasttrap Providers, Probes and Tracepoints + * + * Each Solaris process can have multiple providers -- the pid provider as + * well as any number of user-level statically defined tracing (USDT) + * providers. Those providers are each represented by a fasttrap_provider_t. + * All providers for a given process have a pointer to a shared + * fasttrap_proc_t. The fasttrap_proc_t has two states: active or defunct. + * When the count of active providers goes to zero it becomes defunct; a + * provider drops its active count when it is removed individually or as part + * of a mass removal when a process exits or performs an exec. + * + * Each probe is represented by a fasttrap_probe_t which has a pointer to + * its associated provider as well as a list of fasttrap_id_tp_t structures + * which are tuples combining a fasttrap_id_t and a fasttrap_tracepoint_t. + * A fasttrap_tracepoint_t represents the actual point of instrumentation + * and it contains two lists of fasttrap_id_t structures (to be fired pre- + * and post-instruction emulation) that identify the probes attached to the + * tracepoint. Tracepoints also have a pointer to the fasttrap_proc_t for the + * process they trace which is used when looking up a tracepoint both when a + * probe fires and when enabling and disabling probes. + * + * It's important to note that probes are preallocated with the necessary + * number of tracepoints, but that tracepoints can be shared by probes and + * swapped between probes. If a probe's preallocated tracepoint is enabled + * (and, therefore, the associated probe is enabled), and that probe is + * then disabled, ownership of that tracepoint may be exchanged for an + * unused tracepoint belonging to another probe that was attached to the + * enabled tracepoint. + */ + +typedef struct fasttrap_proc { + pid_t ftpc_pid; /* process ID for this proc */ + uint64_t ftpc_acount; /* count of active providers */ + uint64_t ftpc_rcount; /* count of extant providers */ + kmutex_t ftpc_mtx; /* lock on all but acount */ + struct fasttrap_proc *ftpc_next; /* next proc in hash chain */ +} fasttrap_proc_t; + +typedef struct fasttrap_provider { + pid_t ftp_pid; /* process ID for this prov */ + char ftp_name[DTRACE_PROVNAMELEN]; /* prov name (w/o the pid) */ + dtrace_provider_id_t ftp_provid; /* DTrace provider handle */ + uint_t ftp_marked; /* mark for possible removal */ + uint_t ftp_retired; /* mark when retired */ + kmutex_t ftp_mtx; /* provider lock */ + kmutex_t ftp_cmtx; /* lock on creating probes */ + uint64_t ftp_rcount; /* enabled probes ref count */ + uint64_t ftp_ccount; /* consumers creating probes */ + uint64_t ftp_mcount; /* meta provider count */ + fasttrap_proc_t *ftp_proc; /* shared proc for all provs */ + struct fasttrap_provider *ftp_next; /* next prov in hash chain */ +} fasttrap_provider_t; + +typedef struct fasttrap_id fasttrap_id_t; +typedef struct fasttrap_probe fasttrap_probe_t; +typedef struct fasttrap_tracepoint fasttrap_tracepoint_t; + +struct fasttrap_id { + fasttrap_probe_t *fti_probe; /* referrring probe */ + fasttrap_id_t *fti_next; /* enabled probe list on tp */ + fasttrap_probe_type_t fti_ptype; /* probe type */ +}; + +typedef struct fasttrap_id_tp { + fasttrap_id_t fit_id; + fasttrap_tracepoint_t *fit_tp; +} fasttrap_id_tp_t; + +struct fasttrap_probe { + dtrace_id_t ftp_id; /* DTrace probe identifier */ + pid_t ftp_pid; /* pid for this probe */ + fasttrap_provider_t *ftp_prov; /* this probe's provider */ + uintptr_t ftp_faddr; /* associated function's addr */ + size_t ftp_fsize; /* associated function's size */ + uint64_t ftp_gen; /* modification generation */ + uint64_t ftp_ntps; /* number of tracepoints */ + uint8_t *ftp_argmap; /* native to translated args */ + uint8_t ftp_nargs; /* translated argument count */ + uint8_t ftp_enabled; /* is this probe enabled */ + char *ftp_xtypes; /* translated types index */ + char *ftp_ntypes; /* native types index */ + fasttrap_id_tp_t ftp_tps[1]; /* flexible array */ +}; + +#define FASTTRAP_ID_INDEX(id) \ +((fasttrap_id_tp_t *)(((char *)(id) - offsetof(fasttrap_id_tp_t, fit_id))) - \ +&(id)->fti_probe->ftp_tps[0]) + +struct fasttrap_tracepoint { + fasttrap_proc_t *ftt_proc; /* associated process struct */ + uintptr_t ftt_pc; /* address of tracepoint */ + pid_t ftt_pid; /* pid of tracepoint */ + fasttrap_machtp_t ftt_mtp; /* ISA-specific portion */ + fasttrap_id_t *ftt_ids; /* NULL-terminated list */ + fasttrap_id_t *ftt_retids; /* NULL-terminated list */ + fasttrap_tracepoint_t *ftt_next; /* link in global hash */ +}; + +typedef struct fasttrap_bucket { + kmutex_t ftb_mtx; /* bucket lock */ + void *ftb_data; /* data payload */ + + uint8_t ftb_pad[64 - sizeof (kmutex_t) - sizeof (void *)]; +} fasttrap_bucket_t; + +typedef struct fasttrap_hash { + ulong_t fth_nent; /* power-of-2 num. of entries */ + ulong_t fth_mask; /* fth_nent - 1 */ + fasttrap_bucket_t *fth_table; /* array of buckets */ +} fasttrap_hash_t; + +/* + * If at some future point these assembly functions become observable by + * DTrace, then these defines should become separate functions so that the + * fasttrap provider doesn't trigger probes during internal operations. + */ +#define fasttrap_copyout copyout +#define fasttrap_fuword32 fuword32 +#define fasttrap_suword32 suword32 + +#define fasttrap_fulword fulword +#define fasttrap_sulword sulword + +extern void fasttrap_sigtrap(proc_t *, kthread_t *, uintptr_t); + +extern dtrace_id_t fasttrap_probe_id; +extern fasttrap_hash_t fasttrap_tpoints; + +#define FASTTRAP_TPOINTS_INDEX(pid, pc) \ + (((pc) / sizeof (fasttrap_instr_t) + (pid)) & fasttrap_tpoints.fth_mask) + +/* + * Must be implemented by fasttrap_isa.c + */ +extern int fasttrap_tracepoint_init(proc_t *, fasttrap_tracepoint_t *, + uintptr_t, fasttrap_probe_type_t); +extern int fasttrap_tracepoint_install(proc_t *, fasttrap_tracepoint_t *); +extern int fasttrap_tracepoint_remove(proc_t *, fasttrap_tracepoint_t *); + +extern int fasttrap_pid_probe(struct regs *); +extern int fasttrap_return_probe(struct regs *); + +extern uint64_t fasttrap_pid_getarg(void *, dtrace_id_t, void *, int, int); +extern uint64_t fasttrap_usdt_getarg(void *, dtrace_id_t, void *, int, int); + +#ifdef __cplusplus +} +#endif + +#endif /* _FASTTRAP_IMPL_H */ From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 10:45:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECA7C106566C; Tue, 6 Jul 2010 10:45:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC06D8FC19; Tue, 6 Jul 2010 10:45:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66AjcQt044855; Tue, 6 Jul 2010 10:45:38 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66AjcUW044853; Tue, 6 Jul 2010 10:45:38 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201007061045.o66AjcUW044853@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 6 Jul 2010 10:45: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: r209722 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 10:45:39 -0000 Author: glebius Date: Tue Jul 6 10:45:38 2010 New Revision: 209722 URL: http://svn.freebsd.org/changeset/base/209722 Log: Avoid double-free. In error cases ipfw(4) frees the mbuf(4), we don't need to. PR: kern/145462 Modified: head/sys/netgraph/ng_ipfw.c Modified: head/sys/netgraph/ng_ipfw.c ============================================================================== --- head/sys/netgraph/ng_ipfw.c Tue Jul 6 10:28:19 2010 (r209721) +++ head/sys/netgraph/ng_ipfw.c Tue Jul 6 10:45:38 2010 (r209722) @@ -265,11 +265,8 @@ ng_ipfw_input(struct mbuf **m0, int dir, * Node must be loaded and corresponding hook must be present. */ if (fw_node == NULL || - (hook = ng_ipfw_findhook1(fw_node, fwa->rule.info)) == NULL) { - if (tee == 0) - m_freem(*m0); + (hook = ng_ipfw_findhook1(fw_node, fwa->rule.info)) == NULL) return (ESRCH); /* no hook associated with this rule */ - } /* * We have two modes: in normal mode we add a tag to packet, which is From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 12:13:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A33F106566C; Tue, 6 Jul 2010 12:13:15 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 799418FC0A; Tue, 6 Jul 2010 12:13:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66CDFPk066008; Tue, 6 Jul 2010 12:13:15 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66CDFEG066006; Tue, 6 Jul 2010 12:13:15 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <201007061213.o66CDFEG066006@svn.freebsd.org> From: Marko Zec Date: Tue, 6 Jul 2010 12:13: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: r209723 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 12:13:15 -0000 Author: zec Date: Tue Jul 6 12:13:15 2010 New Revision: 209723 URL: http://svn.freebsd.org/changeset/base/209723 Log: Fix a double-free bug which can occur if both bit error rate and packet duplication probability are configured on a ng_pipe node. Submitted by: Jeffrey Ahrenholtz MFC after: 3 days Modified: head/sys/netgraph/ng_pipe.c Modified: head/sys/netgraph/ng_pipe.c ============================================================================== --- head/sys/netgraph/ng_pipe.c Tue Jul 6 10:45:38 2010 (r209722) +++ head/sys/netgraph/ng_pipe.c Tue Jul 6 12:13:15 2010 (r209723) @@ -779,8 +779,9 @@ pipe_dequeue(struct hookinfo *hinfo, str random() % 100 <= hinfo->cfg.duplicate) { ngp_h = uma_zalloc(ngp_zone, M_NOWAIT); KASSERT(ngp_h != NULL, ("ngp_h zalloc failed (3)")); - ngp_h->m = m_dup(m, M_NOWAIT); - KASSERT(ngp_h->m != NULL, ("m_dup failed")); + m = m_dup(m, M_NOWAIT); + KASSERT(m != NULL, ("m_dup failed")); + ngp_h->m = m; } else { TAILQ_REMOVE(&ngp_f->packet_head, ngp_h, ngp_link); hinfo->run.qin_frames--; From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 15:27:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47AD11065670; Tue, 6 Jul 2010 15:27:06 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35A108FC23; Tue, 6 Jul 2010 15:27:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66FR6aM008648; Tue, 6 Jul 2010 15:27:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66FR6Ka008645; Tue, 6 Jul 2010 15:27:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007061527.o66FR6Ka008645@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 6 Jul 2010 15:27: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: r209724 - in head/sys/powerpc: mpc85xx powermac powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 15:27:06 -0000 Author: nwhitehorn Date: Tue Jul 6 15:27:05 2010 New Revision: 209724 URL: http://svn.freebsd.org/changeset/base/209724 Log: Move the EOI logic when starting ithreads into intr_machdep instead of relying on it as a side effect of PIC_MASK() in the PIC drivers, and add an inmplementation of assign_cpu() for the kernel interrupt layer. Modified: head/sys/powerpc/mpc85xx/atpic.c head/sys/powerpc/powermac/hrowpic.c head/sys/powerpc/powerpc/intr_machdep.c head/sys/powerpc/powerpc/openpic.c Modified: head/sys/powerpc/mpc85xx/atpic.c ============================================================================== --- head/sys/powerpc/mpc85xx/atpic.c Tue Jul 6 12:13:15 2010 (r209723) +++ head/sys/powerpc/mpc85xx/atpic.c Tue Jul 6 15:27:05 2010 (r209724) @@ -308,12 +308,10 @@ atpic_mask(device_t dev, u_int irq) if (irq > 7) { sc->sc_mask[ATPIC_SLAVE] |= 1 << (irq - 8); atpic_write(sc, ATPIC_SLAVE, 1, sc->sc_mask[ATPIC_SLAVE]); - atpic_write(sc, ATPIC_SLAVE, 0, OCW2_EOI); } else { sc->sc_mask[ATPIC_MASTER] |= 1 << irq; atpic_write(sc, ATPIC_MASTER, 1, sc->sc_mask[ATPIC_MASTER]); } - atpic_write(sc, ATPIC_MASTER, 0, OCW2_EOI); } static void Modified: head/sys/powerpc/powermac/hrowpic.c ============================================================================== --- head/sys/powerpc/powermac/hrowpic.c Tue Jul 6 12:13:15 2010 (r209723) +++ head/sys/powerpc/powermac/hrowpic.c Tue Jul 6 15:27:05 2010 (r209724) @@ -269,12 +269,9 @@ static void hrowpic_mask(device_t dev, u_int irq) { struct hrowpic_softc *sc; - int bank; sc = device_get_softc(dev); hrowpic_toggle_irq(sc, irq, 0); - bank = (irq >= 32) ? HPIC_SECONDARY : HPIC_PRIMARY ; - hrowpic_write_reg(sc, HPIC_CLEAR, bank, 1U << (irq & 0x1f)); } static void Modified: head/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/intr_machdep.c Tue Jul 6 12:13:15 2010 (r209723) +++ head/sys/powerpc/powerpc/intr_machdep.c Tue Jul 6 15:27:05 2010 (r209724) @@ -239,21 +239,42 @@ powerpc_intr_eoi(void *arg) } static void -powerpc_intr_mask(void *arg) +powerpc_intr_pre_ithread(void *arg) { struct powerpc_intr *i = arg; PIC_MASK(i->pic, i->intline); + PIC_EOI(i->pic, i->intline); } static void -powerpc_intr_unmask(void *arg) +powerpc_intr_post_ithread(void *arg) { struct powerpc_intr *i = arg; PIC_UNMASK(i->pic, i->intline); } +static int +powerpc_assign_intr_cpu(void *arg, u_char cpu) +{ +#ifdef SMP + struct powerpc_intr *i = arg; + + if (cpu == NOCPU) + i->cpu = all_cpus; + else + i->cpu = 1 << cpu; + + if (!cold && i->pic != NULL && i->pic == root_pic) + PIC_BIND(i->pic, i->intline, i->cpu); + + return (0); +#else + return (EOPNOTSUPP); +#endif +} + void powerpc_register_pic(device_t dev, u_int ipi) { @@ -360,8 +381,8 @@ powerpc_setup_intr(const char *name, u_i if (i->event == NULL) { error = intr_event_create(&i->event, (void *)i, 0, irq, - powerpc_intr_mask, powerpc_intr_unmask, powerpc_intr_eoi, - NULL, "irq%u:", irq); + powerpc_intr_pre_ithread, powerpc_intr_post_ithread, + powerpc_intr_eoi, powerpc_assign_intr_cpu, "irq%u:", irq); if (error) return (error); @@ -410,14 +431,6 @@ powerpc_bind_intr(u_int irq, u_char cpu) if (i == NULL) return (ENOMEM); - if (cpu == NOCPU) - i->cpu = all_cpus; - else - i->cpu = 1 << cpu; - - if (!cold && i->pic != NULL && i->pic == root_pic) - PIC_BIND(i->pic, i->intline, i->cpu); - return (intr_event_bind(i->event, cpu)); } #endif Modified: head/sys/powerpc/powerpc/openpic.c ============================================================================== --- head/sys/powerpc/powerpc/openpic.c Tue Jul 6 12:13:15 2010 (r209723) +++ head/sys/powerpc/powerpc/openpic.c Tue Jul 6 15:27:05 2010 (r209724) @@ -351,7 +351,6 @@ openpic_mask(device_t dev, u_int irq) x |= OPENPIC_IMASK; openpic_write(sc, OPENPIC_IPI_VECTOR(0), x); } - openpic_write(sc, OPENPIC_PCPU_EOI(PCPU_GET(cpuid)), 0); } void From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 15:31:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3F36106564A; Tue, 6 Jul 2010 15:31:58 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B906A8FC0A; Tue, 6 Jul 2010 15:31:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66FVwOc009731; Tue, 6 Jul 2010 15:31:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66FVwG9009729; Tue, 6 Jul 2010 15:31:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007061531.o66FVwG9009729@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 6 Jul 2010 15:31: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: r209725 - head/sys/powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 15:31:59 -0000 Author: nwhitehorn Date: Tue Jul 6 15:31:58 2010 New Revision: 209725 URL: http://svn.freebsd.org/changeset/base/209725 Log: Fix interrupt distribution to multiple CPUs on systems with cascaded PICs. Because slave PICs send all interrupts to their CPU 0 output line (which is routed to a pin on the master PIC), changes to per-CPU register banks like EOI on the slave PIC must be accessed for CPU 0, instead of the CPU actually processing the interrupt. Submitted by: Andreas Tobler Modified: head/sys/powerpc/powerpc/openpic.c Modified: head/sys/powerpc/powerpc/openpic.c ============================================================================== --- head/sys/powerpc/powerpc/openpic.c Tue Jul 6 15:27:05 2010 (r209724) +++ head/sys/powerpc/powerpc/openpic.c Tue Jul 6 15:31:58 2010 (r209725) @@ -74,7 +74,7 @@ openpic_set_priority(struct openpic_soft uint32_t x; sched_pin(); - tpr = OPENPIC_PCPU_TPR(PCPU_GET(cpuid)); + tpr = OPENPIC_PCPU_TPR((sc->sc_dev == root_pic) ? PCPU_GET(cpuid) : 0); x = openpic_read(sc, tpr); x &= ~OPENPIC_TPR_MASK; x |= pri; @@ -208,10 +208,10 @@ openpic_attach(device_t dev) for (irq = 0; irq < sc->sc_nirq; irq++) openpic_write(sc, OPENPIC_IDEST(irq), 1 << 0); - /* clear all pending interrupts */ + /* clear all pending interrupts from cpu 0 */ for (irq = 0; irq < sc->sc_nirq; irq++) { - (void)openpic_read(sc, OPENPIC_PCPU_IACK(PCPU_GET(cpuid))); - openpic_write(sc, OPENPIC_PCPU_EOI(PCPU_GET(cpuid)), 0); + (void)openpic_read(sc, OPENPIC_PCPU_IACK(0)); + openpic_write(sc, OPENPIC_PCPU_EOI(0), 0); } for (cpu = 0; cpu < sc->sc_ncpu; cpu++) @@ -282,7 +282,8 @@ openpic_dispatch(device_t dev, struct tr CTR1(KTR_INTR, "%s: got interrupt", __func__); - cpuid = PCPU_GET(cpuid); + cpuid = (dev == root_pic) ? PCPU_GET(cpuid) : 0; + sc = device_get_softc(dev); while (1) { @@ -318,19 +319,25 @@ void openpic_eoi(device_t dev, u_int irq __unused) { struct openpic_softc *sc; + u_int cpuid; + + cpuid = (dev == root_pic) ? PCPU_GET(cpuid) : 0; sc = device_get_softc(dev); - openpic_write(sc, OPENPIC_PCPU_EOI(PCPU_GET(cpuid)), 0); + openpic_write(sc, OPENPIC_PCPU_EOI(cpuid), 0); } void openpic_ipi(device_t dev, u_int cpu) { struct openpic_softc *sc; + u_int cpuid; sc = device_get_softc(dev); sched_pin(); - openpic_write(sc, OPENPIC_PCPU_IPI_DISPATCH(PCPU_GET(cpuid), 0), + cpuid = (dev == root_pic) ? PCPU_GET(cpuid) : 0; + + openpic_write(sc, OPENPIC_PCPU_IPI_DISPATCH(cpuid, 0), 1u << cpu); sched_unpin(); } From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 15:38:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 977861065670; Tue, 6 Jul 2010 15:38:38 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8528E8FC16; Tue, 6 Jul 2010 15:38:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66Fcc7o011239; Tue, 6 Jul 2010 15:38:38 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66Fcc3o011237; Tue, 6 Jul 2010 15:38:38 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007061538.o66Fcc3o011237@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 6 Jul 2010 15:38: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: r209726 - head/sys/powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 15:38:38 -0000 Author: nwhitehorn Date: Tue Jul 6 15:38:38 2010 New Revision: 209726 URL: http://svn.freebsd.org/changeset/base/209726 Log: It does not actually make sense to provide an IPI facility on non-root PICs, so replace cpuid logic with an assert. Modified: head/sys/powerpc/powerpc/openpic.c Modified: head/sys/powerpc/powerpc/openpic.c ============================================================================== --- head/sys/powerpc/powerpc/openpic.c Tue Jul 6 15:31:58 2010 (r209725) +++ head/sys/powerpc/powerpc/openpic.c Tue Jul 6 15:38:38 2010 (r209726) @@ -331,13 +331,12 @@ void openpic_ipi(device_t dev, u_int cpu) { struct openpic_softc *sc; - u_int cpuid; + + KASSERT(dev == root_pic, ("Cannot send IPIs from non-root OpenPIC")); sc = device_get_softc(dev); sched_pin(); - cpuid = (dev == root_pic) ? PCPU_GET(cpuid) : 0; - - openpic_write(sc, OPENPIC_PCPU_IPI_DISPATCH(cpuid, 0), + openpic_write(sc, OPENPIC_PCPU_IPI_DISPATCH(PCPU_GET(cpuid), 0), 1u << cpu); sched_unpin(); } From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 16:42:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7FA01065670; Tue, 6 Jul 2010 16:42:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7D178FC16; Tue, 6 Jul 2010 16:42:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66GgBOj025324; Tue, 6 Jul 2010 16:42:11 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66GgB0k025322; Tue, 6 Jul 2010 16:42:11 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201007061642.o66GgB0k025322@svn.freebsd.org> From: Ed Maste Date: Tue, 6 Jul 2010 16:42: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: r209728 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 16:42:12 -0000 Author: emaste Date: Tue Jul 6 16:42:11 2010 New Revision: 209728 URL: http://svn.freebsd.org/changeset/base/209728 Log: Remove email address that no longer exists. Modified: head/sys/netgraph/ng_source.c Modified: head/sys/netgraph/ng_source.c ============================================================================== --- head/sys/netgraph/ng_source.c Tue Jul 6 15:45:59 2010 (r209727) +++ head/sys/netgraph/ng_source.c Tue Jul 6 16:42:11 2010 (r209728) @@ -35,7 +35,7 @@ * THIS SOFTWARE, EVEN IF SANDVINE IS ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * - * Author: Dave Chapeskie + * Author: Dave Chapeskie */ #include From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 16:55:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A138B1065676; Tue, 6 Jul 2010 16:55:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 912FF8FC13; Tue, 6 Jul 2010 16:55:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66Gtdh2028349; Tue, 6 Jul 2010 16:55:39 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66GtdPT028347; Tue, 6 Jul 2010 16:55:39 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201007061655.o66GtdPT028347@svn.freebsd.org> From: Ed Maste Date: Tue, 6 Jul 2010 16:55: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: r209730 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 16:55:39 -0000 Author: emaste Date: Tue Jul 6 16:55:39 2010 New Revision: 209730 URL: http://svn.freebsd.org/changeset/base/209730 Log: Remove defunct email address from header as well. Modified: head/sys/netgraph/ng_source.h Modified: head/sys/netgraph/ng_source.h ============================================================================== --- head/sys/netgraph/ng_source.h Tue Jul 6 16:48:59 2010 (r209729) +++ head/sys/netgraph/ng_source.h Tue Jul 6 16:55:39 2010 (r209730) @@ -34,7 +34,7 @@ * THIS SOFTWARE, EVEN IF SANDVINE IS ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * - * Author: Dave Chapeskie + * Author: Dave Chapeskie * * $FreeBSD$ */ From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 16:56:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D576106566B; Tue, 6 Jul 2010 16:56:28 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D64A8FC12; Tue, 6 Jul 2010 16:56:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66GuRNx028581; Tue, 6 Jul 2010 16:56:27 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66GuR06028579; Tue, 6 Jul 2010 16:56:27 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201007061656.o66GuR06028579@svn.freebsd.org> From: Rui Paulo Date: Tue, 6 Jul 2010 16:56: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: r209731 - head/sys/amd64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 16:56:28 -0000 Author: rpaulo Date: Tue Jul 6 16:56:27 2010 New Revision: 209731 URL: http://svn.freebsd.org/changeset/base/209731 Log: Introduce USD_{SET,GET}{BASE,LIMIT}. These help setting up the user segment descriptor hi and lo values. Idea from Solaris. Reviewed by: kib Modified: head/sys/amd64/include/segments.h Modified: head/sys/amd64/include/segments.h ============================================================================== --- head/sys/amd64/include/segments.h Tue Jul 6 16:55:39 2010 (r209730) +++ head/sys/amd64/include/segments.h Tue Jul 6 16:56:27 2010 (r209731) @@ -74,6 +74,13 @@ struct user_segment_descriptor { u_int64_t sd_hibase:8; /* segment base address (msb) */ } __packed; +#define USD_GETBASE(_sd) (((_sd)->sd_lobase) | (_sd)->sd_hibase << 24) +#define USD_SETBASE(_sd, _b) (_sd)->sd_lobase = (_b); \ + (_sd)->sd_hibase = ((_b) >> 24); +#define USD_GETLIMIT(_sd) (((_sd)->sd_lolimit) | (_sd)->sd_hilimit << 16) +#define USD_SETLIMIT(_sd, _l) (_sd)->sd_lolimit = (_l); \ + (_sd)->sd_hilimit = ((_l) >> 16); + /* * System segment descriptors (128 bit wide) */ From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 16:58:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54A021065670; Tue, 6 Jul 2010 16:58:25 +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 440728FC12; Tue, 6 Jul 2010 16:58:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66GwPTs029044; Tue, 6 Jul 2010 16:58:25 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66GwPGi029042; Tue, 6 Jul 2010 16:58:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201007061658.o66GwPGi029042@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 6 Jul 2010 16:58:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209732 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 16:58:25 -0000 Author: bz Date: Tue Jul 6 16:58:24 2010 New Revision: 209732 URL: http://svn.freebsd.org/changeset/base/209732 Log: MFC r207303 (originally by kmacy): need to initialize the lock before it is used Reported on: stable@ (MFC missing) Modified: stable/8/sys/net/flowtable.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net/flowtable.c ============================================================================== --- stable/8/sys/net/flowtable.c Tue Jul 6 16:56:27 2010 (r209731) +++ stable/8/sys/net/flowtable.c Tue Jul 6 16:58:24 2010 (r209732) @@ -1626,7 +1626,7 @@ flowtable_init(const void *unused __unus EVENTHANDLER_PRI_ANY); flowclean_freq = 20*hz; } -SYSINIT(flowtable_init, SI_SUB_SMP, SI_ORDER_MIDDLE, +SYSINIT(flowtable_init, SI_SUB_KTHREAD_INIT, SI_ORDER_FIRST, flowtable_init, NULL); From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 17:00:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CC97106564A; Tue, 6 Jul 2010 17:00:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CCB78FC16; Tue, 6 Jul 2010 17:00:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66H0Ljt029502; Tue, 6 Jul 2010 17:00:21 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66H0KNk029500; Tue, 6 Jul 2010 17:00:21 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201007061700.o66H0KNk029500@svn.freebsd.org> From: Ed Maste Date: Tue, 6 Jul 2010 17:00: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: r209733 - head/tools/tools/ncpus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 17:00:21 -0000 Author: emaste Date: Tue Jul 6 17:00:20 2010 New Revision: 209733 URL: http://svn.freebsd.org/changeset/base/209733 Log: Switch to my @freebsd.org email address. Modified: head/tools/tools/ncpus/biosmptable.c Modified: head/tools/tools/ncpus/biosmptable.c ============================================================================== --- head/tools/tools/ncpus/biosmptable.c Tue Jul 6 16:58:24 2010 (r209732) +++ head/tools/tools/ncpus/biosmptable.c Tue Jul 6 17:00:20 2010 (r209733) @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Author: Ed Maste + * Author: Ed Maste */ /* From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 17:18:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37949106566C; Tue, 6 Jul 2010 17:18: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 236488FC17; Tue, 6 Jul 2010 17:18:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66HI69J033448; Tue, 6 Jul 2010 17:18:06 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66HI6GH033440; Tue, 6 Jul 2010 17:18:06 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201007061718.o66HI6GH033440@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 6 Jul 2010 17:18:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209734 - in vendor-sys/acpica/dist: . common compiler debugger dispatcher events executer hardware include namespace os_specific/service_layers tests/templates tools/acpiexec tools/acp... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 17:18:06 -0000 Author: jkim Date: Tue Jul 6 17:18:05 2010 New Revision: 209734 URL: http://svn.freebsd.org/changeset/base/209734 Log: Import ACPICA 20100702. Added: vendor-sys/acpica/dist/compiler/dttemplate.c (contents, props changed) vendor-sys/acpica/dist/compiler/dttemplate.h (contents, props changed) vendor-sys/acpica/dist/tests/templates/ vendor-sys/acpica/dist/tests/templates/Makefile (contents, props changed) vendor-sys/acpica/dist/tests/templates/templates.sh (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/common/adisasm.c vendor-sys/acpica/dist/common/dmtable.c vendor-sys/acpica/dist/common/dmtbdump.c vendor-sys/acpica/dist/common/dmtbinfo.c vendor-sys/acpica/dist/compiler/Makefile vendor-sys/acpica/dist/compiler/aslcompile.c vendor-sys/acpica/dist/compiler/aslcompiler.h vendor-sys/acpica/dist/compiler/asldefine.h vendor-sys/acpica/dist/compiler/aslerror.c vendor-sys/acpica/dist/compiler/aslfiles.c vendor-sys/acpica/dist/compiler/aslglobal.h vendor-sys/acpica/dist/compiler/aslmain.c vendor-sys/acpica/dist/compiler/aslstartup.c vendor-sys/acpica/dist/compiler/aslutils.c vendor-sys/acpica/dist/compiler/dtcompile.c vendor-sys/acpica/dist/compiler/dtcompiler.h vendor-sys/acpica/dist/compiler/dtfield.c vendor-sys/acpica/dist/compiler/dtio.c vendor-sys/acpica/dist/compiler/dttable.c vendor-sys/acpica/dist/compiler/dtutils.c vendor-sys/acpica/dist/debugger/dbdisply.c vendor-sys/acpica/dist/dispatcher/dsobject.c vendor-sys/acpica/dist/events/evgpe.c vendor-sys/acpica/dist/events/evgpeblk.c vendor-sys/acpica/dist/events/evgpeinit.c vendor-sys/acpica/dist/events/evxface.c vendor-sys/acpica/dist/events/evxfevnt.c vendor-sys/acpica/dist/executer/exfldio.c vendor-sys/acpica/dist/executer/exprep.c vendor-sys/acpica/dist/hardware/hwgpe.c vendor-sys/acpica/dist/include/acdisasm.h vendor-sys/acpica/dist/include/acevents.h vendor-sys/acpica/dist/include/achware.h vendor-sys/acpica/dist/include/aclocal.h vendor-sys/acpica/dist/include/acobject.h vendor-sys/acpica/dist/include/acoutput.h vendor-sys/acpica/dist/include/acpixf.h vendor-sys/acpica/dist/include/actbl.h vendor-sys/acpica/dist/include/actbl2.h vendor-sys/acpica/dist/include/actypes.h vendor-sys/acpica/dist/include/acutils.h vendor-sys/acpica/dist/namespace/nsrepair.c vendor-sys/acpica/dist/os_specific/service_layers/osunixxf.c vendor-sys/acpica/dist/osunixxf.c vendor-sys/acpica/dist/tools/acpiexec/Makefile vendor-sys/acpica/dist/tools/acpiexec/aeexec.c vendor-sys/acpica/dist/tools/acpisrc/astable.c vendor-sys/acpica/dist/utilities/utmisc.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Tue Jul 6 17:00:20 2010 (r209733) +++ vendor-sys/acpica/dist/changes.txt Tue Jul 6 17:18:05 2010 (r209734) @@ -1,4 +1,80 @@ ---------------------------------------- +02 July 2010. Summary of changes for version 20100702: + +This release is available at www.acpica.org/downloads + +1) ACPI CA Core Subsystem: + +Implemented several updates to the recently added GPE reference count +support. The model for "wake" GPEs is changing to give the host OS complete +control of these GPEs. Eventually, the ACPICA core will not execute any _PRW +methods, since the host already must execute them. Also, additional changes +were made to help ensure that the reference counts are kept in proper +synchronization with reality. Rafael J. Wysocki. + +1) Ensure that GPEs are not enabled twice during initialization. +2) Ensure that GPE enable masks stay in sync with the reference count. +3) Do not inadvertently enable GPEs when writing GPE registers. +4) Remove the internal wake reference counter and add new AcpiGpeWakeup +interface. This interface will set or clear individual GPEs for wakeup. +5) Remove GpeType argument from AcpiEnable and AcpiDisable. These interfaces +are now used for "runtime" GPEs only. + +Changed the behavior of the GPE install/remove handler interfaces. The GPE is +no longer disabled during this process, as it was found to cause problems on +some machines. Rafael J. Wysocki. + +Reverted a change introduced in version 20100528 to enable Embedded +Controller multi-byte transfers. This change was found to cause problems with +Index Fields and possibly Bank Fields. It will be reintroduced when these +problems have been resolved. + +Fixed a problem with references to Alias objects within Package Objects. A +reference to an Alias within the definition of a Package was not always +resolved properly. Aliases to objects like Processors, Thermal zones, etc. +were resolved to the actual object instead of a reference to the object as it +should be. Package objects are only allowed to contain integer, string, +buffer, package, and reference objects. Redhat bugzilla 608648. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 88.3K Code, 18.8K Data, 107.1K Total + Debug Version: 164.1K Code, 51.5K Data, 215.6K Total + Current Release: + Non-Debug Version: 88.3K Code, 18.8K Data, 107.1K Total + Debug Version: 164.0K Code, 51.5K Data, 215.5K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented a new compiler subsystem to allow definition and +compilation of the non-AML ACPI tables such as FADT, MADT, SRAT, etc. These +are called "ACPI Data Tables", and the new compiler is the "Data Table +Compiler". This compiler is intended to simplify the existing error-prone +process of creating these tables for the BIOS, as well as allowing the +disassembly, modification, recompilation, and override of existing ACPI data +tables. See the iASL User Guide for detailed information. + +iASL: Implemented a new Template Generator option in support of the new Data +Table Compiler. This option will create examples of all known ACPI tables +that can be used as the basis for table development. See the iASL +documentation and the -T option. + +Disassembler and headers: Added support for the WDDT ACPI table (Watchdog +Descriptor Table). + +Updated the Linux makefiles for iASL and AcpiExec to place the generated +object files in the local directory so that there can be no collisions +between the shared files between them that are generated with different +options. + +Added support for Mac OS X in the Unix OSL used for iASL and AcpiExec. Use +the #define __APPLE__ to enable this support. + +---------------------------------------- 28 May 2010. Summary of changes for version 20100528: This release is available at www.acpica.org/downloads Modified: vendor-sys/acpica/dist/common/adisasm.c ============================================================================== --- vendor-sys/acpica/dist/common/adisasm.c Tue Jul 6 17:00:20 2010 (r209733) +++ vendor-sys/acpica/dist/common/adisasm.c Tue Jul 6 17:18:05 2010 (r209734) @@ -153,10 +153,6 @@ AdCreateTableHeader ( char *Filename, ACPI_TABLE_HEADER *Table); -void -AdDisassemblerHeader ( - char *Filename); - ACPI_STATUS AdDeferredParse ( ACPI_PARSE_OBJECT *Op, @@ -644,7 +640,7 @@ AdCreateTableHeader ( */ AdDisassemblerHeader (Filename); - AcpiOsPrintf (" *\n * Original Table Header:\n"); + AcpiOsPrintf (" * Original Table Header:\n"); AcpiOsPrintf (" * Signature \"%4.4s\"\n", Table->Signature); AcpiOsPrintf (" * Length 0x%8.8X (%u)\n", Table->Length, Table->Length); @@ -689,7 +685,7 @@ AdCreateTableHeader ( AcpiOsPrintf (" * OEM Revision 0x%8.8X (%u)\n", Table->OemRevision, Table->OemRevision); AcpiOsPrintf (" * Compiler ID \"%.4s\"\n", Table->AslCompilerId); AcpiOsPrintf (" * Compiler Version 0x%8.8X (%u)\n", Table->AslCompilerRevision, Table->AslCompilerRevision); - AcpiOsPrintf (" */\n"); + AcpiOsPrintf (" */\n\n"); /* Create AML output filename based on input filename */ Modified: vendor-sys/acpica/dist/common/dmtable.c ============================================================================== --- vendor-sys/acpica/dist/common/dmtable.c Tue Jul 6 17:00:20 2010 (r209733) +++ vendor-sys/acpica/dist/common/dmtable.c Tue Jul 6 17:18:05 2010 (r209734) @@ -117,6 +117,7 @@ #include "accommon.h" #include "acdisasm.h" #include "actables.h" +#include "aslcompiler.h" #include "dtcompiler.h" /* This module used for application-level code only */ @@ -132,10 +133,6 @@ AcpiDmCheckAscii ( char *RepairedName, UINT32 Count); -UINT8 -AcpiTbGenerateChecksum ( - ACPI_TABLE_HEADER *Table); - /* These tables map a subtable type to a description string */ @@ -158,6 +155,74 @@ static const char *AcpiDmDmarS "Unknown SubTable Type" /* Reserved */ }; +static const char *AcpiDmEinjActions[] = +{ + "Begin Operation", + "Get Trigger Table", + "Set Error Type", + "Get Error Type", + "End Operation", + "Execute Operation", + "Check Busy Status", + "Get Command Status", + "Unknown Action" +}; + +static const char *AcpiDmEinjInstructions[] = +{ + "Read Register", + "Read Register Value", + "Write Register", + "Write Register Value", + "Noop", + "Unknown Instruction" +}; + +static const char *AcpiDmErstActions[] = +{ + "Begin Write Operation", + "Begin Read Operation", + "Begin Clear Operation", + "End Operation", + "Set Record Offset", + "Execute Operation", + "Check Busy Status", + "Get Command Status", + "Get Record Identifier", + "Set Record Identifier", + "Get Record Count", + "Begin Dummy Write", + "Unused/Unknown Action", + "Get Error Address Range", + "Get Error Address Length", + "Get Error Attributes", + "Unknown Action" +}; + +static const char *AcpiDmErstInstructions[] = +{ + "Read Register", + "Read Register Value", + "Write Register", + "Write Register Value", + "Noop", + "Load Var1", + "Load Var2", + "Store Var1", + "Add", + "Subtract", + "Add Value", + "Subtract Value", + "Stall", + "Stall While True", + "Skip Next If True", + "GoTo", + "Set Source Address", + "Set Destination Address", + "Move Data", + "Unknown Instruction" +}; + static const char *AcpiDmHestSubnames[] = { "IA-32 Machine Check Exception", @@ -234,56 +299,59 @@ static const char *AcpiDmFadtP * * ACPI Table Data, indexed by signature. * - * Each entry contains: Signature, Table Info, Handler, Description + * Each entry contains: Signature, Table Info, Handler, DtHandler, + * Template, Description * - * Simple tables have only a TableInfo structure, complex tables have a handler. - * This table must be NULL terminated. RSDP and FACS are special-cased - * elsewhere. + * Simple tables have only a TableInfo structure, complex tables have a + * handler. This table must be NULL terminated. RSDP and FACS are + * special-cased elsewhere. * ******************************************************************************/ -static ACPI_DMTABLE_DATA AcpiDmTableData[] = +ACPI_DMTABLE_DATA AcpiDmTableData[] = { - {ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, DtCompileAsf, "Alert Standard Format table"}, - {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, "Simple Boot Flag Table"}, - {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, "Boot Error Record Table"}, - {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, "Corrected Platform Error Polling table"}, - {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, "Debug Port table"}, - {ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, "DMA Remapping table"}, - {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, NULL, "Embedded Controller Boot Resources Table"}, - {ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, DtCompileEinj, "Error Injection table"}, - {ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, "Error Record Serialization Table"}, - {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, "Fixed ACPI Description Table"}, - {ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, "Hardware Error Source Table"}, - {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, "High Precision Event Timer table"}, - {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, "I/O Virtualization Reporting Structure"}, - {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, "Multiple APIC Description Table"}, - {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, "Memory Mapped Configuration table"}, - {ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, "Management Controller Host Interface table"}, - {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, "Maximum System Characteristics Table"}, - {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, "Root System Description Table"}, - {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, "Smart Battery Specification Table"}, - {ACPI_SIG_SLIC, AcpiDmTableInfoSlic, NULL, NULL, "Software Licensing Description Table"}, - {ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, "System Locality Information Table"}, - {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, "Serial Port Console Redirection table"}, - {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, NULL, "Server Platform Management Interface table"}, - {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, "System Resource Affinity Table"}, - {ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, NULL, "Trusted Computing Platform Alliance table"}, - {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, NULL, "UEFI Boot Optimization Table"}, - {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, NULL, "Windows ACPI Emulated Devices Table"}, - {ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, DtCompileWdat, "Watchdog Action Table"}, - {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, NULL, "Watchdog Resource Table"}, - {ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, DtCompileXsdt, "Extended System Description Table"}, - {NULL, NULL, NULL, NULL, NULL} + {ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, DtCompileAsf, TemplateAsf, "Alert Standard Format table"}, + {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot, "Simple Boot Flag Table"}, + {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert, "Boot Error Record Table"}, + {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep, "Corrected Platform Error Polling table"}, + {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, TemplateDbgp, "Debug Port table"}, + {ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, TemplateDmar, "DMA Remapping table"}, + {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, NULL, TemplateEcdt, "Embedded Controller Boot Resources Table"}, + {ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, DtCompileEinj, TemplateEinj, "Error Injection table"}, + {ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst, "Error Record Serialization Table"}, + {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt, "Fixed ACPI Description Table"}, + {ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest, "Hardware Error Source Table"}, + {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet, "High Precision Event Timer table"}, + {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs, "I/O Virtualization Reporting Structure"}, + {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt, "Multiple APIC Description Table"}, + {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, TemplateMcfg, "Memory Mapped Configuration table"}, + {ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi, "Management Controller Host Interface table"}, + {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct, "Maximum System Characteristics Table"}, + {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt, "Root System Description Table"}, + {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst, "Smart Battery Specification Table"}, + {ACPI_SIG_SLIC, AcpiDmTableInfoSlic, NULL, NULL, NULL, "Software Licensing Description Table"}, + {ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit, "System Locality Information Table"}, + {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, TemplateSpcr, "Serial Port Console Redirection table"}, + {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, NULL, TemplateSpmi, "Server Platform Management Interface table"}, + {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, TemplateSrat, "System Resource Affinity Table"}, + {ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, NULL, TemplateTcpa, "Trusted Computing Platform Alliance table"}, + {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, NULL, TemplateUefi, "UEFI Boot Optimization Table"}, + {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, NULL, TemplateWaet, "Windows ACPI Emulated Devices Table"}, + {ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, DtCompileWdat, TemplateWdat, "Watchdog Action Table"}, + {ACPI_SIG_WDDT, AcpiDmTableInfoWddt, NULL, NULL, TemplateWddt, "Watchdog Description Table"}, + {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, NULL, TemplateWdrt, "Watchdog Resource Table"}, + {ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, DtCompileXsdt, TemplateXsdt, "Extended System Description Table"}, + {NULL, NULL, NULL, NULL, NULL, NULL} }; /******************************************************************************* * - * FUNCTION: AcpiTbGenerateChecksum + * FUNCTION: AcpiDmGenerateChecksum * - * PARAMETERS: Table - Pointer to a valid ACPI table (with a - * standard ACPI header) + * PARAMETERS: Table - Pointer to table to be checksummed + * Length - Length of the table + * OriginalChecksum - Value of the checksum field * * RETURN: 8 bit checksum of buffer * @@ -292,19 +360,21 @@ static ACPI_DMTABLE_DATA AcpiDmTableD ******************************************************************************/ UINT8 -AcpiTbGenerateChecksum ( - ACPI_TABLE_HEADER *Table) +AcpiDmGenerateChecksum ( + void *Table, + UINT32 Length, + UINT8 OriginalChecksum) { UINT8 Checksum; /* Sum the entire table as-is */ - Checksum = AcpiTbChecksum ((UINT8 *) Table, Table->Length); + Checksum = AcpiTbChecksum ((UINT8 *) Table, Length); /* Subtract off the existing checksum value in the table */ - Checksum = (UINT8) (Checksum - Table->Checksum); + Checksum = (UINT8) (Checksum - OriginalChecksum); /* Compute the final checksum */ @@ -429,10 +499,13 @@ AcpiDmDumpDataTable ( } } - /* Always dump the raw table data */ + if (!Gbl_DoTemplates || Gbl_VerboseTemplates) + { + /* Dump the raw table data */ - AcpiOsPrintf ("\nRaw Table Data\n\n"); - AcpiUtDumpBuffer2 (ACPI_CAST_PTR (UINT8, Table), Length, DB_BYTE_DISPLAY); + AcpiOsPrintf ("\nRaw Table Data\n\n"); + AcpiUtDumpBuffer2 (ACPI_CAST_PTR (UINT8, Table), Length, DB_BYTE_DISPLAY); + } } @@ -460,15 +533,31 @@ AcpiDmLineHeader ( char *Name) { - if (ByteLength) + if (Gbl_DoTemplates && !Gbl_VerboseTemplates) /* Terse template */ { - AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %28s : ", - Offset, Offset, ByteLength, Name); + if (ByteLength) + { + AcpiOsPrintf ("[%.3d] %34s : ", + ByteLength, Name); + } + else + { + AcpiOsPrintf ("%40s : ", + Name); + } } - else + else /* Normal disassembler or verbose template */ { - AcpiOsPrintf ("%43s : ", - Name); + if (ByteLength) + { + AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %28s : ", + Offset, Offset, ByteLength, Name); + } + else + { + AcpiOsPrintf ("%43s : ", + Name); + } } } @@ -480,15 +569,31 @@ AcpiDmLineHeader2 ( UINT32 Value) { - if (ByteLength) + if (Gbl_DoTemplates && !Gbl_VerboseTemplates) /* Terse template */ { - AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %24s % 3d : ", - Offset, Offset, ByteLength, Name, Value); + if (ByteLength) + { + AcpiOsPrintf ("[%.3d] %30s % 3d : ", + ByteLength, Name, Value); + } + else + { + AcpiOsPrintf ("%36s % 3d : ", + Name, Value); + } } - else + else /* Normal disassembler or verbose template */ { - AcpiOsPrintf ("[%3.3Xh %4.4d ] %24s % 3d : ", - Offset, Offset, Name, Value); + if (ByteLength) + { + AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %24s % 3d : ", + Offset, Offset, ByteLength, Name, Value); + } + else + { + AcpiOsPrintf ("[%3.3Xh %4.4d ] %24s % 3d : ", + Offset, Offset, Name, Value); + } } } @@ -508,6 +613,8 @@ AcpiDmLineHeader2 ( * * DESCRIPTION: Display ACPI table contents by walking the Info table. * + * Note: This function must remain in sync with DtGetFieldLength. + * ******************************************************************************/ ACPI_STATUS @@ -568,6 +675,10 @@ AcpiDmDumpTable ( case ACPI_DMT_ASF: case ACPI_DMT_HESTNTYP: case ACPI_DMT_FADTPM: + case ACPI_DMT_EINJACT: + case ACPI_DMT_EINJINST: + case ACPI_DMT_ERSTACT: + case ACPI_DMT_ERSTINST: ByteLength = 1; break; case ACPI_DMT_UINT16: @@ -702,7 +813,11 @@ AcpiDmDumpTable ( for (Temp8 = 0; Temp8 < 16; Temp8++) { - AcpiOsPrintf ("%2.2X,", Target[Temp8]); + AcpiOsPrintf ("%2.2X", Target[Temp8]); + if ((Temp8 + 1) < 16) + { + AcpiOsPrintf (","); + } } AcpiOsPrintf ("\n"); break; @@ -751,7 +866,9 @@ AcpiDmDumpTable ( /* Checksum, display and validate */ AcpiOsPrintf ("%2.2X", *Target); - Temp8 = AcpiTbGenerateChecksum (Table); + Temp8 = AcpiDmGenerateChecksum (Table, + ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length, + ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum); if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum) { AcpiOsPrintf ( @@ -804,6 +921,58 @@ AcpiDmDumpTable ( AcpiOsPrintf ("%4.4X <%s>\n", ACPI_GET16 (Target), AcpiDmDmarSubnames[Temp16]); break; + case ACPI_DMT_EINJACT: + + /* EINJ Action types */ + + Temp8 = *Target; + if (Temp8 > ACPI_EINJ_ACTION_RESERVED) + { + Temp8 = ACPI_EINJ_ACTION_RESERVED; + } + + AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmEinjActions[Temp8]); + break; + + case ACPI_DMT_EINJINST: + + /* EINJ Instruction types */ + + Temp8 = *Target; + if (Temp8 > ACPI_EINJ_INSTRUCTION_RESERVED) + { + Temp8 = ACPI_EINJ_INSTRUCTION_RESERVED; + } + + AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmEinjInstructions[Temp8]); + break; + + case ACPI_DMT_ERSTACT: + + /* ERST Action types */ + + Temp8 = *Target; + if (Temp8 > ACPI_ERST_ACTION_RESERVED) + { + Temp8 = ACPI_ERST_ACTION_RESERVED; + } + + AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmErstActions[Temp8]); + break; + + case ACPI_DMT_ERSTINST: + + /* ERST Instruction types */ + + Temp8 = *Target; + if (Temp8 > ACPI_ERST_INSTRUCTION_RESERVED) + { + Temp8 = ACPI_ERST_INSTRUCTION_RESERVED; + } + + AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmErstInstructions[Temp8]); + break; + case ACPI_DMT_HEST: /* HEST subtable types */ @@ -839,7 +1008,6 @@ AcpiDmDumpTable ( AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmHestNotifySubnames[Temp8]); break; - case ACPI_DMT_MADT: /* MADT subtable types */ Modified: vendor-sys/acpica/dist/common/dmtbdump.c ============================================================================== --- vendor-sys/acpica/dist/common/dmtbdump.c Tue Jul 6 17:00:20 2010 (r209733) +++ vendor-sys/acpica/dist/common/dmtbdump.c Tue Jul 6 17:18:05 2010 (r209734) @@ -130,7 +130,8 @@ * * PARAMETERS: Table - A RSDP * - * RETURN: Length of the table (there is no length field, use revision) + * RETURN: Length of the table (there is not always a length field, + * use revision or length if available (ACPI 2.0+)) * * DESCRIPTION: Format the contents of a RSDP * @@ -140,19 +141,42 @@ UINT32 AcpiDmDumpRsdp ( ACPI_TABLE_HEADER *Table) { - UINT32 Length = ACPI_RSDP_REV0_SIZE; + ACPI_TABLE_RSDP *Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table); + UINT32 Length = sizeof (ACPI_RSDP_COMMON); + UINT8 Checksum; /* Dump the common ACPI 1.0 portion */ AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp1); - /* ACPI 2.0+ contains more data and has a Length field */ + /* Validate the first checksum */ - if (ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table)->Revision > 0) + Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_RSDP_COMMON), + Rsdp->Checksum); + if (Checksum != Rsdp->Checksum) { - Length = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table)->Length; + AcpiOsPrintf ("/* Incorrect Checksum above, should be 0x%2.2X */\n", + Checksum); + } + + /* The RSDP for ACPI 2.0+ contains more data and has a Length field */ + + if (Rsdp->Revision > 0) + { + Length = Rsdp->Length; AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp2); + + /* Validate the extended checksum over entire RSDP */ + + Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_TABLE_RSDP), + Rsdp->ExtendedChecksum); + if (Checksum != Rsdp->ExtendedChecksum) + { + AcpiOsPrintf ( + "/* Incorrect Extended Checksum above, should be 0x%2.2X */\n", + Checksum); + } } return (Length); @@ -595,7 +619,7 @@ AcpiDmDumpDmar ( while (PathOffset < ScopeTable->Length) { AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2, "PCI Path"); - AcpiOsPrintf ("[%2.2X, %2.2X]\n", PciPath[0], PciPath[1]); + AcpiOsPrintf ("%2.2X,%2.2X\n", PciPath[0], PciPath[1]); /* Point to next PCI Path entry */ @@ -709,7 +733,7 @@ AcpiDmDumpErst ( { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, SubTable, - sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0); + sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0); if (ACPI_FAILURE (Status)) { return; @@ -1301,15 +1325,20 @@ AcpiDmDumpSlit ( return; } - AcpiOsPrintf ("%2.2X ", Row[j]); + AcpiOsPrintf ("%2.2X", Row[j]); Offset++; /* Display up to 16 bytes per output row */ - if (j && (((j+1) % 16) == 0) && ((j+1) < Localities)) + if ((j+1) < Localities) { - AcpiOsPrintf ("\n"); - AcpiDmLineHeader (Offset, 0, ""); + AcpiOsPrintf (","); + + if (j && (((j+1) % 16) == 0)) + { + AcpiOsPrintf ("\n"); + AcpiDmLineHeader (Offset, 0, ""); + } } } Modified: vendor-sys/acpica/dist/common/dmtbinfo.c ============================================================================== --- vendor-sys/acpica/dist/common/dmtbinfo.c Tue Jul 6 17:00:20 2010 (r209733) +++ vendor-sys/acpica/dist/common/dmtbinfo.c Tue Jul 6 17:18:05 2010 (r209734) @@ -153,6 +153,7 @@ #define ACPI_UEFI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_UEFI,f) #define ACPI_WAET_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WAET,f) #define ACPI_WDAT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDAT,f) +#define ACPI_WDDT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDDT,f) #define ACPI_WDRT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDRT,f) /* Subtables */ @@ -171,6 +172,7 @@ #define ACPI_DMAR2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_ATSR,f) #define ACPI_DMAR3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_RHSA,f) #define ACPI_EINJ0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WHEA_HEADER,f) +#define ACPI_ERST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WHEA_HEADER,f) #define ACPI_HEST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f) #define ACPI_HEST1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_CORRECTED,f) #define ACPI_HEST2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_NMI,f) @@ -229,6 +231,12 @@ #define ACPI_MADT8_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_INTERRUPT_SOURCE,f,o) #define ACPI_MADT9_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC,f,o) #define ACPI_MADT10_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f,o) +#define ACPI_WDDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_WDDT,f,o) +#define ACPI_EINJ0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o) +#define ACPI_ERST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o) +#define ACPI_HEST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f,o) +#define ACPI_HEST1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_IA_CORRECTED,f,o) +#define ACPI_HEST6_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_AER_ROOT,f,o) /* * Required terminator for all tables below @@ -731,7 +739,7 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[] = { - {ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (HeaderLength), "Injection Header Length", DT_LENGTH}, + {ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (HeaderLength), "Injection Header Length", 0}, {ACPI_DMT_UINT8, ACPI_EINJ_OFFSET (Flags), "Flags", 0}, {ACPI_DMT_UINT24, ACPI_EINJ_OFFSET (Reserved[0]), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_EINJ_OFFSET (Entries), "Injection Entry Count", 0}, @@ -740,9 +748,11 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[] = { - {ACPI_DMT_UINT8, ACPI_EINJ0_OFFSET (Action), "Action", 0}, - {ACPI_DMT_UINT8, ACPI_EINJ0_OFFSET (Instruction), "Instruction", 0}, - {ACPI_DMT_UINT8, ACPI_EINJ0_OFFSET (Flags), "Flags", 0}, + {ACPI_DMT_EINJACT, ACPI_EINJ0_OFFSET (Action), "Action", 0}, + {ACPI_DMT_EINJINST, ACPI_EINJ0_OFFSET (Instruction), "Instruction", 0}, + {ACPI_DMT_UINT8, ACPI_EINJ0_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_EINJ0_FLAG_OFFSET (Flags,0), "Preserve Register Bits", 0}, + {ACPI_DMT_UINT8, ACPI_EINJ0_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_GAS, ACPI_EINJ0_OFFSET (RegisterRegion), "Register Region", 0}, {ACPI_DMT_UINT64, ACPI_EINJ0_OFFSET (Value), "Value", 0}, @@ -759,12 +769,26 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoErst[] = { - {ACPI_DMT_UINT32, ACPI_ERST_OFFSET (HeaderLength), "Serialization Header Length", DT_LENGTH}, + {ACPI_DMT_UINT32, ACPI_ERST_OFFSET (HeaderLength), "Serialization Header Length", 0}, {ACPI_DMT_UINT32, ACPI_ERST_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_ERST_OFFSET (Entries), "Instruction Entry Count", 0}, ACPI_DMT_TERMINATOR }; +ACPI_DMTABLE_INFO AcpiDmTableInfoErst0[] = +{ + {ACPI_DMT_ERSTACT, ACPI_ERST0_OFFSET (Action), "Action", 0}, + {ACPI_DMT_ERSTINST, ACPI_ERST0_OFFSET (Instruction), "Instruction", 0}, + {ACPI_DMT_UINT8, ACPI_ERST0_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_ERST0_FLAG_OFFSET (Flags,0), "Preserve Register Bits", 0}, + + {ACPI_DMT_UINT8, ACPI_ERST0_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_GAS, ACPI_ERST0_OFFSET (RegisterRegion), "Register Region", 0}, + {ACPI_DMT_UINT64, ACPI_ERST0_OFFSET (Value), "Value", 0}, + {ACPI_DMT_UINT64, ACPI_ERST0_OFFSET (Mask), "Mask", 0}, + ACPI_DMT_TERMINATOR +}; + /******************************************************************************* * @@ -786,7 +810,8 @@ ACPI_DMTABLE_INFO AcpiDmTableI #define ACPI_DM_HEST_AER \ {ACPI_DMT_UINT16, ACPI_HEST6_OFFSET (Aer.Reserved1), "Reserved", 0}, \ - {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Flags), "Flags", 0}, \ + {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Flags), "Flags (decoded below)", DT_FLAG}, \ + {ACPI_DMT_FLAG0, ACPI_HEST6_FLAG_OFFSET (Aer.Flags,0), "Firmware First", 0}, \ {ACPI_DMT_UINT8, ACPI_HEST6_OFFSET (Aer.Enabled), "Enabled", 0}, \ {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.RecordsToPreallocate), "Records To Preallocate", 0}, \ {ACPI_DMT_UINT32, ACPI_HEST6_OFFSET (Aer.MaxSectionsPerRecord), "Max Sections Per Record", 0}, \ @@ -808,15 +833,17 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[] = { ACPI_DM_HEST_HEADER, - {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Reserved1), "Reserved", 0}, - {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Flags), "Flags", 0}, + {ACPI_DMT_UINT16, ACPI_HEST0_OFFSET (Reserved1), "Reserved1", 0}, + {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_HEST0_FLAG_OFFSET (Flags,0), "Firmware First", 0}, + {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (Enabled), "Enabled", 0}, {ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0}, {ACPI_DMT_UINT32, ACPI_HEST0_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record", 0}, {ACPI_DMT_UINT64, ACPI_HEST0_OFFSET (GlobalCapabilityData), "Global Capability Data", 0}, {ACPI_DMT_UINT64, ACPI_HEST0_OFFSET (GlobalControlData), "Global Control Data", 0}, {ACPI_DMT_UINT8, ACPI_HEST0_OFFSET (NumHardwareBanks), "Num Hardware Banks", 0}, - {ACPI_DMT_UINT56, ACPI_HEST0_OFFSET (Reserved3[0]), "Reserved", 0}, + {ACPI_DMT_UINT56, ACPI_HEST0_OFFSET (Reserved3[0]), "Reserved2", 0}, ACPI_DMT_TERMINATOR }; @@ -825,14 +852,16 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoHest1[] = { ACPI_DM_HEST_HEADER, - {ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (Reserved1), "Reserved", 0}, - {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Flags), "Flags", 0}, + {ACPI_DMT_UINT16, ACPI_HEST1_OFFSET (Reserved1), "Reserved1", 0}, + {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_HEST1_FLAG_OFFSET (Flags,0), "Firmware First", 0}, + {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (Enabled), "Enabled", 0}, {ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (RecordsToPreallocate), "Records To Preallocate", 0}, {ACPI_DMT_UINT32, ACPI_HEST1_OFFSET (MaxSectionsPerRecord), "Max Sections Per Record", 0}, {ACPI_DMT_HESTNTFY, ACPI_HEST1_OFFSET (Notify), "Notify", 0}, {ACPI_DMT_UINT8, ACPI_HEST1_OFFSET (NumHardwareBanks), "Num Hardware Banks", 0}, - {ACPI_DMT_UINT24, ACPI_HEST1_OFFSET (Reserved2[0]), "Reserved", 0}, + {ACPI_DMT_UINT24, ACPI_HEST1_OFFSET (Reserved2[0]), "Reserved2", 0}, ACPI_DMT_TERMINATOR }; @@ -848,7 +877,6 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMT_TERMINATOR }; - /* 6: PCI Express Root Port AER */ ACPI_DMTABLE_INFO AcpiDmTableInfoHest6[] = @@ -1425,15 +1453,15 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[] = { {ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (ProximityDomain), "Proximity Domain", 0}, - {ACPI_DMT_UINT16, ACPI_SRAT1_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT16, ACPI_SRAT1_OFFSET (Reserved), "Reserved1", 0}, {ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (BaseAddress), "Base Address", 0}, {ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (Length), "Address Length", 0}, - {ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (Reserved1), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (Reserved1), "Reserved2", 0}, {ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Enabled", 0}, {ACPI_DMT_FLAG1, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Hot Pluggable", 0}, {ACPI_DMT_FLAG2, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Non-Volatile", 0}, - {ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (Reserved2), "Reserved", 0}, + {ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (Reserved2), "Reserved3", 0}, ACPI_DMT_TERMINATOR }; @@ -1441,13 +1469,13 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[] = { - {ACPI_DMT_UINT16, ACPI_SRAT2_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT16, ACPI_SRAT2_OFFSET (Reserved), "Reserved1", 0}, {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ProximityDomain), "Proximity Domain", 0}, {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ApicId), "Apic ID", 0}, {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_SRAT2_FLAG_OFFSET (Flags,0), "Enabled", 0}, {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (ClockDomain), "Clock Domain", 0}, - {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (Reserved2), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_SRAT2_OFFSET (Reserved2), "Reserved2", 0}, ACPI_DMT_TERMINATOR }; @@ -1537,6 +1565,46 @@ ACPI_DMTABLE_INFO AcpiDmTableI /******************************************************************************* * + * WDDT - Watchdog Description Table + * + ******************************************************************************/ + +ACPI_DMTABLE_INFO AcpiDmTableInfoWddt[] = +{ + {ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (SpecVersion), "Specification Version", 0}, + {ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (TableVersion), "Table Version", 0}, + {ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (PciVendorId), "PCI Vendor ID", 0}, + {ACPI_DMT_GAS, ACPI_WDDT_OFFSET (Address), "Timer Register", 0}, + {ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (MaxCount), "Max Count", 0}, + {ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (MinCount), "Min Count", 0}, + {ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (Period), "Period", 0}, + {ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (Status), "Status (decoded below)", 0}, + + /* Status Flags byte 0 */ + + {ACPI_DMT_FLAG0, ACPI_WDDT_FLAG_OFFSET (Status,0), "Available", 0}, + {ACPI_DMT_FLAG1, ACPI_WDDT_FLAG_OFFSET (Status,0), "Active", 0}, + {ACPI_DMT_FLAG2, ACPI_WDDT_FLAG_OFFSET (Status,0), "OS Owns", 0}, + + /* Status Flags byte 1 */ + + {ACPI_DMT_FLAG3, ACPI_WDDT_FLAG_OFFSET (Status,1), "User Reset", 0}, + {ACPI_DMT_FLAG4, ACPI_WDDT_FLAG_OFFSET (Status,1), "Timeout Reset", 0}, + {ACPI_DMT_FLAG5, ACPI_WDDT_FLAG_OFFSET (Status,1), "Power Fail Reset", 0}, + {ACPI_DMT_FLAG6, ACPI_WDDT_FLAG_OFFSET (Status,1), "Unknown Reset", 0}, + + {ACPI_DMT_UINT16, ACPI_WDDT_OFFSET (Capability), "Capability (decoded below)", 0}, + + /* Capability Flags byte 0 */ + + {ACPI_DMT_FLAG0, ACPI_WDDT_FLAG_OFFSET (Capability,0), "Auto Reset", 0}, + {ACPI_DMT_FLAG1, ACPI_WDDT_FLAG_OFFSET (Capability,0), "Timeout Alert", 0}, + ACPI_DMT_TERMINATOR +}; + + +/******************************************************************************* + * * WDRT - Watchdog Resource Table * ******************************************************************************/ @@ -1555,4 +1623,3 @@ ACPI_DMTABLE_INFO AcpiDmTableI {ACPI_DMT_UINT8, ACPI_WDRT_OFFSET (Units), "Counter Units", 0}, ACPI_DMT_TERMINATOR }; - Modified: vendor-sys/acpica/dist/compiler/Makefile ============================================================================== --- vendor-sys/acpica/dist/compiler/Makefile Tue Jul 6 17:00:20 2010 (r209733) +++ vendor-sys/acpica/dist/compiler/Makefile Tue Jul 6 17:18:05 2010 (r209734) @@ -1,161 +1,580 @@ - +# +# iASL compiler/disassembler +# + PROG= iasl -SRCS= \ - aslcompilerparse.c \ - aslcompilerlex.c \ - aslanalyze.c \ - aslcodegen.c \ - aslcompile.c \ - aslerror.c \ - aslfiles.c \ - aslfold.c \ - asllength.c \ - asllisting.c \ - aslload.c \ - asllookup.c \ - aslmain.c \ - aslmap.c \ - aslopcodes.c \ - asloperands.c \ - aslopt.c \ - aslpredef.c \ - aslresource.c \ - aslrestype1.c \ - aslrestype1i.c \ - aslrestype2.c \ - aslrestype2d.c \ - aslrestype2e.c \ - aslrestype2q.c \ - aslrestype2w.c \ - aslstartup.c \ - aslstubs.c \ - asltransform.c \ - asltree.c \ - aslutils.c \ - dtcompile.c \ - dtfield.c \ - dtio.c \ - dtsubtable.c \ - dttable.c \ - dtutils.c \ - ../common/getopt.c \ - ../utilities/utalloc.c \ - ../utilities/utcache.c \ - ../utilities/utcopy.c \ - ../utilities/utdebug.c \ - ../utilities/utdelete.c \ - ../utilities/utglobal.c \ - ../utilities/utinit.c \ - ../utilities/utlock.c \ - ../utilities/utobject.c \ - ../utilities/utmisc.c \ - ../utilities/utmath.c \ - ../utilities/utmutex.c \ - ../utilities/utresrc.c \ - ../utilities/utstate.c \ - ../utilities/utxface.c \ - ../namespace/nsaccess.c \ - ../namespace/nsalloc.c \ - ../namespace/nsdump.c \ - ../namespace/nsnames.c \ - ../namespace/nsobject.c \ - ../namespace/nsparse.c \ - ../namespace/nssearch.c \ - ../namespace/nsutils.c \ - ../namespace/nswalk.c \ - ../namespace/nsxfobj.c \ - ../parser/psargs.c \ - ../parser/psloop.c \ - ../parser/psopcode.c \ - ../parser/psparse.c \ - ../parser/psscope.c \ - ../parser/pstree.c \ - ../parser/psutils.c \ - ../parser/pswalk.c \ - ../dispatcher/dswscope.c \ - ../dispatcher/dswstate.c \ - ../dispatcher/dsfield.c \ - ../dispatcher/dsobject.c \ - ../dispatcher/dsopcode.c \ - ../dispatcher/dsutils.c \ - ../dispatcher/dswexec.c \ - ../dispatcher/dswload.c \ - ../executer/exconvrt.c \ - ../executer/excreate.c \ - ../executer/exdump.c \ - ../executer/exmisc.c \ - ../executer/exmutex.c \ - ../executer/exnames.c \ - ../executer/exoparg1.c \ - ../executer/exoparg2.c \ - ../executer/exoparg3.c \ - ../executer/exoparg6.c \ - ../executer/exprep.c \ - ../executer/exregion.c \ - ../executer/exresnte.c \ - ../executer/exresolv.c \ - ../executer/exresop.c \ - ../executer/exstore.c \ - ../executer/exstoren.c \ - ../executer/exstorob.c \ - ../executer/exsystem.c \ - ../executer/exutils.c \ - ../common/adfile.c \ - ../common/adisasm.c \ - ../common/adwalk.c \ - ../common/dmextern.c \ - ../common/dmrestag.c \ - ../common/dmtable.c \ - ../common/dmtbinfo.c \ - ../common/dmtbdump.c \ - ../debugger/dbfileio.c \ - ../disassembler/dmbuffer.c \ - ../disassembler/dmnames.c \ - ../disassembler/dmopcode.c \ - ../disassembler/dmobject.c \ - ../disassembler/dmresrc.c \ - ../disassembler/dmresrcl.c \ - ../disassembler/dmresrcs.c \ - ../disassembler/dmutils.c \ - ../disassembler/dmwalk.c \ - ../tables/tbfadt.c \ - ../tables/tbinstal.c \ - ../tables/tbutils.c \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 17:19:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9ECED1065673; Tue, 6 Jul 2010 17:19:39 +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 75A9F8FC17; Tue, 6 Jul 2010 17:19:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66HJdUd033850; Tue, 6 Jul 2010 17:19:39 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66HJdPZ033849; Tue, 6 Jul 2010 17:19:39 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201007061719.o66HJdPZ033849@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 6 Jul 2010 17:19:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209735 - vendor-sys/acpica/20100702 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 17:19:39 -0000 Author: jkim Date: Tue Jul 6 17:19:39 2010 New Revision: 209735 URL: http://svn.freebsd.org/changeset/base/209735 Log: Tag ACPICA 20100702. Added: vendor-sys/acpica/20100702/ - copied from r209734, vendor-sys/acpica/dist/ From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 17:20:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E980106567A; Tue, 6 Jul 2010 17:20:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EC798FC26; Tue, 6 Jul 2010 17:20:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66HK9bj033996; Tue, 6 Jul 2010 17:20:09 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66HK9QU033992; Tue, 6 Jul 2010 17:20:09 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201007061720.o66HK9QU033992@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 6 Jul 2010 17:20: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: r209736 - head/lib/libc/posix1e X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 17:20:09 -0000 Author: trasz Date: Tue Jul 6 17:20:08 2010 New Revision: 209736 URL: http://svn.freebsd.org/changeset/base/209736 Log: Fix acl_from_text(3) - and, therefore, setfacl(1) - for user and group names names starting with a digit. MFC after: 1 month Modified: head/lib/libc/posix1e/acl_from_text.c head/lib/libc/posix1e/acl_from_text_nfs4.c head/lib/libc/posix1e/acl_support.h Modified: head/lib/libc/posix1e/acl_from_text.c ============================================================================== --- head/lib/libc/posix1e/acl_from_text.c Tue Jul 6 17:19:39 2010 (r209735) +++ head/lib/libc/posix1e/acl_from_text.c Tue Jul 6 17:20:08 2010 (r209736) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include "acl_support.h" -static int _posix1e_acl_name_to_id(acl_tag_t tag, char *name, uid_t *id); static acl_tag_t acl_string_to_tag(char *tag, char *qualifier); int _nfs4_acl_entry_from_text(acl_t aclp, char *entry); @@ -148,8 +147,7 @@ _posix1e_acl_entry_from_text(acl_t aclp, case ACL_USER: case ACL_GROUP: - error = _posix1e_acl_name_to_id(t, qualifier, - &id); + error = _acl_name_to_id(t, qualifier, &id); if (error == -1) return (-1); break; @@ -272,8 +270,8 @@ error_label: * XXX USES *PW* AND *GR* WHICH ARE STATEFUL AND THEREFORE THIS ROUTINE * MAY HAVE SIDE-EFFECTS */ -static int -_posix1e_acl_name_to_id(acl_tag_t tag, char *name, uid_t *id) +int +_acl_name_to_id(acl_tag_t tag, char *name, uid_t *id) { struct group *g; struct passwd *p; Modified: head/lib/libc/posix1e/acl_from_text_nfs4.c ============================================================================== --- head/lib/libc/posix1e/acl_from_text_nfs4.c Tue Jul 6 17:19:39 2010 (r209735) +++ head/lib/libc/posix1e/acl_from_text_nfs4.c Tue Jul 6 17:20:08 2010 (r209736) @@ -79,16 +79,14 @@ parse_tag(const char *str, acl_entry_t e /* * Parse the qualifier field of ACL entry passed as "str". * If user or group name cannot be resolved, then the variable - * referenced by "need_qualifier" is set to 1. + * referenced by "need_qualifier" is set to 1; it will be checked + * later to figure out whether the appended_id is required. */ static int parse_qualifier(char *str, acl_entry_t entry, int *need_qualifier) { int qualifier_length, error; - id_t id; - char *end; - struct passwd *pwd; - struct group *grp; + uid_t id; acl_tag_t tag; assert(need_qualifier != NULL); @@ -101,44 +99,17 @@ parse_qualifier(char *str, acl_entry_t e return (-1); } - /* XXX: Can we assume that valid username never begins with a digit? */ - if (isdigit(str[0])) { - id = strtod(str, &end); - - if (end - str != qualifier_length) { - warnx("malformed ACL: trailing characters " - "after numerical id"); - return (-1); - } - - return (acl_set_qualifier(entry, &id)); - } - error = acl_get_tag_type(entry, &tag); if (error) return (error); - assert(tag == ACL_USER || tag == ACL_GROUP); - - if (tag == ACL_USER) { - /* XXX: Thread-unsafe. */ - pwd = getpwnam(str); - if (pwd == NULL) { - *need_qualifier = 1; - return (0); - } - - return (acl_set_qualifier(entry, &(pwd->pw_uid))); - } - - /* XXX: Thread-unsafe. */ - grp = getgrnam(str); - if (grp == NULL) { + error = _acl_name_to_id(tag, str, &id); + if (error) { *need_qualifier = 1; return (0); } - return (acl_set_qualifier(entry, &(grp->gr_gid))); + return (acl_set_qualifier(entry, &id)); } static int Modified: head/lib/libc/posix1e/acl_support.h ============================================================================== --- head/lib/libc/posix1e/acl_support.h Tue Jul 6 17:19:39 2010 (r209735) +++ head/lib/libc/posix1e/acl_support.h Tue Jul 6 17:20:08 2010 (r209736) @@ -61,5 +61,6 @@ int _posix1e_acl_add_entry(acl_t acl, ac acl_perm_t perm); char *string_skip_whitespace(char *string); void string_trim_trailing_whitespace(char *string); +int _acl_name_to_id(acl_tag_t tag, char *name, uid_t *id); #endif From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 18:05:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17F7F1065675; Tue, 6 Jul 2010 18:05: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 089918FC16; Tue, 6 Jul 2010 18:05:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66I55nM043915; Tue, 6 Jul 2010 18:05:05 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66I55IG043913; Tue, 6 Jul 2010 18:05:05 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201007061805.o66I55IG043913@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 6 Jul 2010 18:05: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: r209737 - head/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 18:05:06 -0000 Author: jkim Date: Tue Jul 6 18:05:05 2010 New Revision: 209737 URL: http://svn.freebsd.org/changeset/base/209737 Log: Fix a possible null pointer dereference. A patch for -STABLE was Submitted by: Yamagi Burmeister (lists at yamagi dot org) Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Tue Jul 6 17:20:08 2010 (r209736) +++ head/sys/dev/fb/vesa.c Tue Jul 6 18:05:05 2010 (r209737) @@ -536,6 +536,8 @@ vesa_bios_save_restore(int code, void *p return (1); buf = x86bios_alloc(&offs, size, M_NOWAIT); + if (buf == NULL) + return (1); x86bios_init_regs(®s); regs.R_AX = 0x4f04; From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 18:06:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1273D1065674; Tue, 6 Jul 2010 18:06:11 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02FA58FC17; Tue, 6 Jul 2010 18:06:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66I6ATX044190; Tue, 6 Jul 2010 18:06:10 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66I6A3s044188; Tue, 6 Jul 2010 18:06:10 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201007061806.o66I6A3s044188@svn.freebsd.org> From: Benedict Reuschling Date: Tue, 6 Jul 2010 18:06: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: r209738 - head/gnu/usr.bin/dialog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 18:06:13 -0000 Author: bcr (doc committer) Date: Tue Jul 6 18:06:10 2010 New Revision: 209738 URL: http://svn.freebsd.org/changeset/base/209738 Log: Mention the radiolist option in the man page. It is being listed when dialog(1) is run without arguments and works as expected. Therefore, it should be part of the manual as well. Note: dialog(1) has not been updated for many years and is not actively maintained at the moment. PR: docs/139682 Submitted by: manolis@ Discussed with: jkim@ MFC after: 2 weeks Modified: head/gnu/usr.bin/dialog/dialog.1 Modified: head/gnu/usr.bin/dialog/dialog.1 ============================================================================== --- head/gnu/usr.bin/dialog/dialog.1 Tue Jul 6 18:05:05 2010 (r209737) +++ head/gnu/usr.bin/dialog/dialog.1 Tue Jul 6 18:06:10 2010 (r209738) @@ -30,6 +30,7 @@ types of dialog objects are currently su .BR yes/no " box," " menu" " box," " input" " box," .BR message " box," " text" " box," " info" " box," .BR checklist " box," " program" " box," +.BR radiolist " box," .BR ftree " and " tree " boxes." .SH OPTIONS .TP @@ -172,6 +173,15 @@ On exit, a list of the .I tag strings of those entries that are turned on will be printed on .IR stderr "." +.IP "\fB\-\-radiolist \fItext height width list-height \fR[ \fItag item status \fR] \fI..." +.RB "A " radiolist " box is similar to a " checklist " but it only allows" +a single entry to be selected. One entry may initially be turned on as +specified by +.IR status "." +On exit, the +.I tag +string of the entry that is turned on will be printed on +.IR stderr "." .IP "\fB\-\-ftree \fIfile FS text height width menu-height" .B ftree box is a dialog box showing the tree described by the data from the file From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 18:07:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C0321065675; Tue, 6 Jul 2010 18:07:56 +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 6CE3E8FC20; Tue, 6 Jul 2010 18:07:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66I7uY9044623; Tue, 6 Jul 2010 18:07:56 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66I7u6u044621; Tue, 6 Jul 2010 18:07:56 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201007061807.o66I7u6u044621@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 6 Jul 2010 18:07: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: r209739 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 18:07:56 -0000 Author: bz Date: Tue Jul 6 18:07:56 2010 New Revision: 209739 URL: http://svn.freebsd.org/changeset/base/209739 Log: Also install the new bsd.arch.inc.mk filed. Missed in r204020. Reviewed by: imp Modified: head/share/mk/Makefile Modified: head/share/mk/Makefile ============================================================================== --- head/share/mk/Makefile Tue Jul 6 18:06:10 2010 (r209738) +++ head/share/mk/Makefile Tue Jul 6 18:07:56 2010 (r209739) @@ -2,6 +2,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/8/93 FILES= bsd.README +FILES+= bsd.arch.inc.mk FILES+= bsd.compat.mk bsd.cpu.mk bsd.dep.mk bsd.doc.mk bsd.endian.mk FILES+= bsd.files.mk bsd.incs.mk bsd.info.mk bsd.init.mk FILES+= bsd.kmod.mk From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 18:08:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14D48106566C; Tue, 6 Jul 2010 18:08:55 +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 7D2A38FC1F; Tue, 6 Jul 2010 18:08:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66I8tX3044855; Tue, 6 Jul 2010 18:08:55 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66I8tsN044853; Tue, 6 Jul 2010 18:08:55 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201007061808.o66I8tsN044853@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 6 Jul 2010 18:08: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: r209740 - head/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 18:08:56 -0000 Author: jkim Date: Tue Jul 6 18:08:55 2010 New Revision: 209740 URL: http://svn.freebsd.org/changeset/base/209740 Log: Plug a possible memory leak. Submitted by: Yamagi Burmeister (lists at yamagi dot org) Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Tue Jul 6 18:07:56 2010 (r209739) +++ head/sys/dev/fb/vesa.c Tue Jul 6 18:08:55 2010 (r209740) @@ -836,7 +836,7 @@ vesa_bios_init(void) "version 1.2 or later is required.\n", ((vers & 0xf000) >> 12) * 10 + ((vers & 0x0f00) >> 8), ((vers & 0x00f0) >> 4) * 10 + (vers & 0x000f)); - return (1); + goto fail; } VESA_STRCPY(vesa_oemstr, buf->v_oemstr); From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 18:17:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F39221065676; Tue, 6 Jul 2010 18:17:31 +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 E46368FC25; Tue, 6 Jul 2010 18:17:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66IHVse046788; Tue, 6 Jul 2010 18:17:31 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66IHVh1046786; Tue, 6 Jul 2010 18:17:31 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201007061817.o66IHVh1046786@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 6 Jul 2010 18:17: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: r209741 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 18:17:32 -0000 Author: yongari Date: Tue Jul 6 18:17:31 2010 New Revision: 209741 URL: http://svn.freebsd.org/changeset/base/209741 Log: Zero entire status block and add missing bus_dmamap_sync(9). Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Tue Jul 6 18:08:55 2010 (r209740) +++ head/sys/dev/bge/if_bge.c Tue Jul 6 18:17:31 2010 (r209741) @@ -1760,15 +1760,19 @@ bge_blockinit(struct bge_softc *sc) BGE_ADDR_HI(sc->bge_ldata.bge_status_block_paddr)); CSR_WRITE_4(sc, BGE_HCC_STATUSBLK_ADDR_LO, BGE_ADDR_LO(sc->bge_ldata.bge_status_block_paddr)); - sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx = 0; - sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx = 0; /* Set up status block size. */ if (sc->bge_asicrev == BGE_ASICREV_BCM5700 && - sc->bge_chipid != BGE_CHIPID_BCM5700_C0) + sc->bge_chipid != BGE_CHIPID_BCM5700_C0) { val = BGE_STATBLKSZ_FULL; - else + bzero(sc->bge_ldata.bge_status_block, BGE_STATUS_BLK_SZ); + } else { val = BGE_STATBLKSZ_32BYTE; + bzero(sc->bge_ldata.bge_status_block, 32); + } + bus_dmamap_sync(sc->bge_cdata.bge_status_tag, + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* Turn on host coalescing state machine */ CSR_WRITE_4(sc, BGE_HCC_MODE, val | BGE_HCCMODE_ENABLE); From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 18:20:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA1DB1065677; Tue, 6 Jul 2010 18:20: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 AACD08FC20; Tue, 6 Jul 2010 18:20:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66IKnOe047542; Tue, 6 Jul 2010 18:20:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66IKnnE047540; Tue, 6 Jul 2010 18:20:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201007061820.o66IKnnE047540@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 6 Jul 2010 18:20: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: r209742 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 18:20:49 -0000 Author: kib Date: Tue Jul 6 18:20:49 2010 New Revision: 209742 URL: http://svn.freebsd.org/changeset/base/209742 Log: In revoke(), verify that VCHR vnode indeed belongs to devfs. Found and tested by: pho MFC after: 1 week Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Tue Jul 6 18:17:31 2010 (r209741) +++ head/sys/kern/vfs_syscalls.c Tue Jul 6 18:20:49 2010 (r209742) @@ -4215,7 +4215,7 @@ revoke(td, uap) vfslocked = NDHASGIANT(&nd); vp = nd.ni_vp; NDFREE(&nd, NDF_ONLY_PNBUF); - if (vp->v_type != VCHR) { + if (vp->v_type != VCHR || vp->v_rdev == NULL) { error = EINVAL; goto out; } From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 18:22:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C9B0106566B; Tue, 6 Jul 2010 18:22:57 +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 8D62F8FC1A; Tue, 6 Jul 2010 18:22:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66IMvoS048049; Tue, 6 Jul 2010 18:22:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66IMv32048047; Tue, 6 Jul 2010 18:22:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201007061822.o66IMv32048047@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 6 Jul 2010 18:22: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: r209743 - head/sys/dev/md X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 18:22:57 -0000 Author: kib Date: Tue Jul 6 18:22:57 2010 New Revision: 209743 URL: http://svn.freebsd.org/changeset/base/209743 Log: Calculate nshift only once. Also noted by: avg MFC after: 1 week Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Tue Jul 6 18:20:49 2010 (r209742) +++ head/sys/dev/md/md.c Tue Jul 6 18:22:57 2010 (r209743) @@ -255,7 +255,7 @@ dimension(off_t size) { off_t rcnt; struct indir *ip; - int i, layer; + int layer; rcnt = size; layer = 0; @@ -263,9 +263,6 @@ dimension(off_t size) rcnt /= NINDIR; layer++; } - /* figure out log2(NINDIR) */ - for (i = NINDIR, nshift = -1; i; nshift++) - i >>= 1; /* * XXX: the top layer is probably not fully populated, so we allocate @@ -1220,6 +1217,11 @@ g_md_init(struct g_class *mp __unused) caddr_t c; u_char *ptr, *name, *type; unsigned len; + int i; + + /* figure out log2(NINDIR) */ + for (i = NINDIR, nshift = -1; i; nshift++) + i >>= 1; mod = NULL; sx_init(&md_sx, "MD config lock"); From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 19:03:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 473D9106566C; Tue, 6 Jul 2010 19:03:05 +0000 (UTC) (envelope-from lists@yamagi.org) Received: from mail.yamagi.org (yamagi.org [88.198.78.242]) by mx1.freebsd.org (Postfix) with ESMTP id 060588FC1A; Tue, 6 Jul 2010 19:03:04 +0000 (UTC) Received: from [192.168.1.150] (f054137213.adsl.alicedsl.de [78.54.137.213]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.yamagi.org (Postfix) with ESMTP id 9BCDC1083AB3; Tue, 6 Jul 2010 20:35:03 +0200 (CEST) Date: Tue, 6 Jul 2010 20:35:02 +0200 (CEST) From: Yamagi Burmeister X-X-Sender: yamagi@maka.home.yamagi.org To: Jung-uk Kim In-Reply-To: <201007061808.o66I8tsN044853@svn.freebsd.org> Message-ID: References: <201007061808.o66I8tsN044853@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209740 - head/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 19:03:05 -0000 On Tue, 6 Jul 2010, Jung-uk Kim wrote: > Log: > Plug a possible memory leak. > > Submitted by: Yamagi Burmeister (lists at yamagi dot org) Thanks :) -- Homepage: www.yamagi.org Jabber: yamagi@yamagi.org GnuPG/GPG: 0xEFBCCBCB From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 19:05:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A2ED1065676; Tue, 6 Jul 2010 19:05:42 +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 E61558FC1D; Tue, 6 Jul 2010 19:05:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66J5fuS057439; Tue, 6 Jul 2010 19:05:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66J5fFt057437; Tue, 6 Jul 2010 19:05:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201007061905.o66J5fFt057437@svn.freebsd.org> From: Alexander Motin Date: Tue, 6 Jul 2010 19:05: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: r209744 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 19:05:42 -0000 Author: mav Date: Tue Jul 6 19:05:41 2010 New Revision: 209744 URL: http://svn.freebsd.org/changeset/base/209744 Log: ATA device reset starts probe sequence from the beginning. If reset caused by timeout/error of one of probe commands, process may continue infinitely. Make CAM ATA more robust to faulty devices and false positive detections, abort probe after two restarts on timeouts or ten on other errors. Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Tue Jul 6 18:22:57 2010 (r209743) +++ head/sys/cam/ata/ata_xpt.c Tue Jul 6 19:05:41 2010 (r209744) @@ -134,6 +134,7 @@ typedef struct { uint32_t pm_prv; int restart; int spinup; + int faults; u_int caps; struct cam_periph *periph; } probe_softc; @@ -738,14 +739,28 @@ probedone(struct cam_periph *periph, uni ident_buf = &path->device->ident_data; if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { -device_fail: if ((!softc->restart) && - cam_periph_error(done_ccb, 0, 0, NULL) == ERESTART) { + if (softc->restart) { + if (bootverbose) { + cam_error_print(done_ccb, + CAM_ESF_ALL, CAM_EPF_ALL); + } + } else if (cam_periph_error(done_ccb, 0, 0, NULL) == ERESTART) return; - } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { /* Don't wedge the queue */ xpt_release_devq(done_ccb->ccb_h.path, /*count*/1, /*run_queue*/TRUE); } + if (softc->restart) { + softc->faults++; + if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) == + CAM_CMD_TIMEOUT) + softc->faults += 4; + if (softc->faults < 10) + goto done; + else + softc->restart = 0; + } else /* Old PIO2 devices may not support mode setting. */ if (softc->action == PROBE_SETMODE && ata_max_pmode(ident_buf) <= ATA_PIO2 && @@ -761,7 +776,7 @@ device_fail: if ((!softc->restart) && * already marked unconfigured, notify the peripheral * drivers that this device is no more. */ - if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0) +device_fail: if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0) xpt_async(AC_LOST_DEVICE, path, NULL); found = 0; goto done; From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 19:43:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4315106566C; Tue, 6 Jul 2010 19:43:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A55148FC1A; Tue, 6 Jul 2010 19:43:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66JhfEL065733; Tue, 6 Jul 2010 19:43:41 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66Jhf6a065732; Tue, 6 Jul 2010 19:43:41 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201007061943.o66Jhf6a065732@svn.freebsd.org> From: Ed Maste Date: Tue, 6 Jul 2010 19:43: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: r209745 - head/tools/tools/ncpus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 19:43:41 -0000 Author: emaste Date: Tue Jul 6 19:43:40 2010 New Revision: 209745 URL: http://svn.freebsd.org/changeset/base/209745 Log: Use canonical spelling of FreeBSD.org Submitted by: Garrett Cooper Modified: head/tools/tools/ncpus/biosmptable.c Modified: head/tools/tools/ncpus/biosmptable.c ============================================================================== --- head/tools/tools/ncpus/biosmptable.c Tue Jul 6 19:05:41 2010 (r209744) +++ head/tools/tools/ncpus/biosmptable.c Tue Jul 6 19:43:40 2010 (r209745) @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Author: Ed Maste + * Author: Ed Maste */ /* From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 20:57:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 237841065674; Tue, 6 Jul 2010 20:57:29 +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 0F9CE8FC1D; Tue, 6 Jul 2010 20:57:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66KvSGK082147; Tue, 6 Jul 2010 20:57:28 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66KvSnr082136; Tue, 6 Jul 2010 20:57:28 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201007062057.o66KvSnr082136@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 6 Jul 2010 20:57:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209746 - in head: sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/debugger sys/contrib/dev/acpica/disassembler sys/contrib/d... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 20:57:29 -0000 Author: jkim Date: Tue Jul 6 20:57:28 2010 New Revision: 209746 URL: http://svn.freebsd.org/changeset/base/209746 Log: Merge ACPICA 20100702. Added: head/sys/contrib/dev/acpica/compiler/dtcompile.c - copied, changed from r209743, vendor-sys/acpica/dist/compiler/dtcompile.c head/sys/contrib/dev/acpica/compiler/dtcompiler.h - copied, changed from r209743, vendor-sys/acpica/dist/compiler/dtcompiler.h head/sys/contrib/dev/acpica/compiler/dtfield.c - copied, changed from r209743, vendor-sys/acpica/dist/compiler/dtfield.c head/sys/contrib/dev/acpica/compiler/dtio.c - copied, changed from r209743, vendor-sys/acpica/dist/compiler/dtio.c head/sys/contrib/dev/acpica/compiler/dtsubtable.c - copied, changed from r209743, vendor-sys/acpica/dist/compiler/dtsubtable.c head/sys/contrib/dev/acpica/compiler/dttable.c - copied, changed from r209743, vendor-sys/acpica/dist/compiler/dttable.c head/sys/contrib/dev/acpica/compiler/dttemplate.c - copied, changed from r209743, vendor-sys/acpica/dist/compiler/dttemplate.c head/sys/contrib/dev/acpica/compiler/dttemplate.h - copied unchanged from r209743, vendor-sys/acpica/dist/compiler/dttemplate.h head/sys/contrib/dev/acpica/compiler/dtutils.c - copied, changed from r209743, vendor-sys/acpica/dist/compiler/dtutils.c Modified: head/sys/contrib/dev/acpica/acpica_prep.sh head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/adwalk.c head/sys/contrib/dev/acpica/common/dmextern.c head/sys/contrib/dev/acpica/common/dmrestag.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtbdump.c head/sys/contrib/dev/acpica/common/dmtbinfo.c head/sys/contrib/dev/acpica/compiler/aslanalyze.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslcompiler.l head/sys/contrib/dev/acpica/compiler/aslcompiler.y head/sys/contrib/dev/acpica/compiler/asldefine.h head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/asllookup.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslopt.c head/sys/contrib/dev/acpica/compiler/aslpredef.c head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/asltransform.c head/sys/contrib/dev/acpica/compiler/asltree.c head/sys/contrib/dev/acpica/compiler/asltypes.h head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/debugger/dbcmds.c head/sys/contrib/dev/acpica/debugger/dbdisply.c head/sys/contrib/dev/acpica/debugger/dbexec.c head/sys/contrib/dev/acpica/debugger/dbfileio.c head/sys/contrib/dev/acpica/debugger/dbhistry.c head/sys/contrib/dev/acpica/debugger/dbinput.c head/sys/contrib/dev/acpica/debugger/dbutils.c head/sys/contrib/dev/acpica/disassembler/dmobject.c head/sys/contrib/dev/acpica/disassembler/dmopcode.c head/sys/contrib/dev/acpica/disassembler/dmresrc.c head/sys/contrib/dev/acpica/dispatcher/dsinit.c head/sys/contrib/dev/acpica/dispatcher/dsmethod.c head/sys/contrib/dev/acpica/dispatcher/dsmthdat.c head/sys/contrib/dev/acpica/dispatcher/dsobject.c head/sys/contrib/dev/acpica/dispatcher/dsopcode.c head/sys/contrib/dev/acpica/dispatcher/dsutils.c head/sys/contrib/dev/acpica/events/evgpe.c head/sys/contrib/dev/acpica/events/evgpeblk.c head/sys/contrib/dev/acpica/events/evgpeinit.c head/sys/contrib/dev/acpica/events/evgpeutil.c head/sys/contrib/dev/acpica/events/evrgnini.c head/sys/contrib/dev/acpica/events/evxface.c head/sys/contrib/dev/acpica/events/evxfevnt.c head/sys/contrib/dev/acpica/executer/exdump.c head/sys/contrib/dev/acpica/executer/exfldio.c head/sys/contrib/dev/acpica/executer/exprep.c head/sys/contrib/dev/acpica/executer/exregion.c head/sys/contrib/dev/acpica/executer/exsystem.c head/sys/contrib/dev/acpica/hardware/hwgpe.c head/sys/contrib/dev/acpica/hardware/hwsleep.c head/sys/contrib/dev/acpica/hardware/hwvalid.c head/sys/contrib/dev/acpica/include/acconfig.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acevents.h head/sys/contrib/dev/acpica/include/acexcep.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/achware.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acnamesp.h head/sys/contrib/dev/acpica/include/acobject.h head/sys/contrib/dev/acpica/include/acoutput.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/acpredef.h head/sys/contrib/dev/acpica/include/acstruct.h head/sys/contrib/dev/acpica/include/actbl.h head/sys/contrib/dev/acpica/include/actbl2.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/contrib/dev/acpica/namespace/nsaccess.c head/sys/contrib/dev/acpica/namespace/nsalloc.c head/sys/contrib/dev/acpica/namespace/nsdump.c head/sys/contrib/dev/acpica/namespace/nsinit.c head/sys/contrib/dev/acpica/namespace/nsnames.c head/sys/contrib/dev/acpica/namespace/nsparse.c head/sys/contrib/dev/acpica/namespace/nsrepair.c head/sys/contrib/dev/acpica/namespace/nsrepair2.c head/sys/contrib/dev/acpica/namespace/nssearch.c head/sys/contrib/dev/acpica/namespace/nsutils.c head/sys/contrib/dev/acpica/namespace/nswalk.c head/sys/contrib/dev/acpica/namespace/nsxfobj.c head/sys/contrib/dev/acpica/osunixxf.c head/sys/contrib/dev/acpica/utilities/utglobal.c head/sys/contrib/dev/acpica/utilities/utmisc.c head/sys/contrib/dev/acpica/utilities/uttrack.c head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_button.c head/sys/dev/acpica/acpi_ec.c head/sys/dev/acpica/acpi_lid.c head/usr.sbin/acpi/acpidump/acpi_user.c head/usr.sbin/acpi/iasl/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/acpica_prep.sh ============================================================================== --- head/sys/contrib/dev/acpica/acpica_prep.sh Tue Jul 6 19:43:40 2010 (r209745) +++ head/sys/contrib/dev/acpica/acpica_prep.sh Tue Jul 6 20:57:28 2010 (r209746) @@ -33,7 +33,8 @@ src_headers="acapps.h accommon.h acconfi acresrc.h acrestyp.h acstruct.h actables.h actbl.h actbl1.h \ actbl2.h actypes.h acutils.h amlcode.h amlresrc.h \ platform/acenv.h platform/acfreebsd.h platform/acgcc.h" -comp_headers="aslcompiler.h asldefine.h aslglobal.h asltypes.h" +comp_headers="aslcompiler.h asldefine.h aslglobal.h asltypes.h \ + dtcompiler.h dttemplate.h" platform_headers="acfreebsd.h acgcc.h" # pre-clean @@ -49,7 +50,7 @@ tar -x -z -f ${src} -C ${wrk} # strip files echo strip for i in ${stripdirs}; do - find ${wrk} -name ${i} -type d | xargs rm -r + find ${wrk} -name ${i} -type d -print | xargs rm -r done for i in ${stripfiles}; do find ${wrk} -name ${i} -type f -delete @@ -58,22 +59,22 @@ done # copy files echo copying full dirs for i in ${fulldirs}; do - find ${wrk} -name ${i} -type d | xargs -J % mv % ${dst} + find ${wrk} -name ${i} -type d -print | xargs -J % mv % ${dst} done echo copying remaining files -find ${wrk} -type f | xargs -J % mv % ${dst} +find ${wrk} -type f -print | xargs -J % mv % ${dst} # canonify include paths for H in ${src_headers}; do - find ${dst} -name "*.[chy]" -type f | \ + find ${dst} -name "*.[chy]" -type f -print | \ xargs sed -i "" -e "s|[\"<]$H[\">]|\|g" done for H in ${comp_headers}; do - find ${dst}/compiler -name "*.[chly]" -type f | \ + find ${dst}/common ${dst}/compiler -name "*.[chly]" -type f | \ xargs sed -i "" -e "s|[\"<]$H[\">]|\|g" done for H in ${platform_headers}; do - find ${dst}/include/platform -name "*.h" -type f | \ + find ${dst}/include/platform -name "*.h" -type f -print | \ xargs sed -i "" -e "s|[\"<]$H[\">]|\|g" done Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Tue Jul 6 19:43:40 2010 (r209745) +++ head/sys/contrib/dev/acpica/changes.txt Tue Jul 6 20:57:28 2010 (r209746) @@ -1,4 +1,167 @@ ---------------------------------------- +02 July 2010. Summary of changes for version 20100702: + +This release is available at www.acpica.org/downloads + +1) ACPI CA Core Subsystem: + +Implemented several updates to the recently added GPE reference count +support. The model for "wake" GPEs is changing to give the host OS complete +control of these GPEs. Eventually, the ACPICA core will not execute any _PRW +methods, since the host already must execute them. Also, additional changes +were made to help ensure that the reference counts are kept in proper +synchronization with reality. Rafael J. Wysocki. + +1) Ensure that GPEs are not enabled twice during initialization. +2) Ensure that GPE enable masks stay in sync with the reference count. +3) Do not inadvertently enable GPEs when writing GPE registers. +4) Remove the internal wake reference counter and add new AcpiGpeWakeup +interface. This interface will set or clear individual GPEs for wakeup. +5) Remove GpeType argument from AcpiEnable and AcpiDisable. These interfaces +are now used for "runtime" GPEs only. + +Changed the behavior of the GPE install/remove handler interfaces. The GPE is +no longer disabled during this process, as it was found to cause problems on +some machines. Rafael J. Wysocki. + +Reverted a change introduced in version 20100528 to enable Embedded +Controller multi-byte transfers. This change was found to cause problems with +Index Fields and possibly Bank Fields. It will be reintroduced when these +problems have been resolved. + +Fixed a problem with references to Alias objects within Package Objects. A +reference to an Alias within the definition of a Package was not always +resolved properly. Aliases to objects like Processors, Thermal zones, etc. +were resolved to the actual object instead of a reference to the object as it +should be. Package objects are only allowed to contain integer, string, +buffer, package, and reference objects. Redhat bugzilla 608648. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 88.3K Code, 18.8K Data, 107.1K Total + Debug Version: 164.1K Code, 51.5K Data, 215.6K Total + Current Release: + Non-Debug Version: 88.3K Code, 18.8K Data, 107.1K Total + Debug Version: 164.0K Code, 51.5K Data, 215.5K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented a new compiler subsystem to allow definition and +compilation of the non-AML ACPI tables such as FADT, MADT, SRAT, etc. These +are called "ACPI Data Tables", and the new compiler is the "Data Table +Compiler". This compiler is intended to simplify the existing error-prone +process of creating these tables for the BIOS, as well as allowing the +disassembly, modification, recompilation, and override of existing ACPI data +tables. See the iASL User Guide for detailed information. + +iASL: Implemented a new Template Generator option in support of the new Data +Table Compiler. This option will create examples of all known ACPI tables +that can be used as the basis for table development. See the iASL +documentation and the -T option. + +Disassembler and headers: Added support for the WDDT ACPI table (Watchdog +Descriptor Table). + +Updated the Linux makefiles for iASL and AcpiExec to place the generated +object files in the local directory so that there can be no collisions +between the shared files between them that are generated with different +options. + +Added support for Mac OS X in the Unix OSL used for iASL and AcpiExec. Use +the #define __APPLE__ to enable this support. + +---------------------------------------- +28 May 2010. Summary of changes for version 20100528: + +This release is available at www.acpica.org/downloads + +Note: The ACPI 4.0a specification was released on April 5, 2010 and is +available at www.acpi.info. This is primarily an errata release. + +1) ACPI CA Core Subsystem: + +Undefined ACPI tables: We are looking for the definitions for the following +ACPI tables that have been seen in the field: ATKG, IEIT, GSCI. + +Implemented support to enable multi-byte transfers for Embedded Controller +(EC) operation regions. Previously, the maximum data size passed to the EC +operation region handler was a single byte. There are often EC Fields larger +than one byte that need to be transferred, and it is useful for the EC driver +to lock these as a single transaction. This change enables single transfers +larger than 8 bits. This effectively changes the access to the EC space from +ByteAcc to AnyAcc, and will probably require changes to the host OS Embedded +Controller driver to enable 16/32/64/256-bit transfers in addition to 8-bit +transfers. Alexey Starikovskiy, Lin Ming + +Implemented a performance enhancement for namespace search and access. This +change enhances the performance of namespace searches and walks by adding a +backpointer to the parent in each namespace node. On large namespaces, this +change can improve overall ACPI performance by up to 9X. Adding a pointer to +each namespace node increases the overall size of the internal namespace by +about 5%, since each namespace entry usually consists of both a namespace +node and an ACPI operand object. However, this is the first growth of the +namespace in ten years. ACPICA bugzilla 817. Alexey Starikovskiy. + +Implemented a performance optimization that reduces the number of namespace +walks. On control method exit, only walk the namespace if the method is known +to have created namespace objects outside of its local scope. Previously, the +entire namespace was traversed on each control method exit. This change can +improve overall ACPI performance by up to 3X. Alexey Starikovskiy, Bob Moore. + +Added support to truncate I/O addresses to 16 bits for Windows compatibility. +Some ASL code has been seen in the field that inadvertently has bits set +above bit 15. This feature is optional and is enabled if the BIOS requests +any Windows OSI strings. It can also be enabled by the host OS. Matthew +Garrett, Bob Moore. + +Added support to limit the maximum time for the ASL Sleep() operator. To +prevent accidental deep sleeps, limit the maximum time that Sleep() will +actually sleep. Configurable, the default maximum is two seconds. ACPICA +bugzilla 854. + +Added run-time validation support for the _WDG and_WED Microsoft predefined +methods. These objects are defined by "Windows Instrumentation", and are not +part of the ACPI spec. ACPICA BZ 860. + +Expanded all statistic counters used during namespace and device +initialization from 16 to 32 bits in order to support very large namespaces. + +Replaced all instances of %d in printf format specifiers with %u since nearly +all integers in ACPICA are unsigned. + +Fixed the exception namestring for AE_WAKE_ONLY_GPE. Was incorrectly returned +as AE_NO_HANDLER. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 88.4K Code, 18.8K Data, 107.2K Total + Debug Version: 164.2K Code, 51.5K Data, 215.7K Total + Current Release: + Non-Debug Version: 88.3K Code, 18.8K Data, 107.1K Total + Debug Version: 164.1K Code, 51.5K Data, 215.6K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Added compiler support for the _WDG and_WED Microsoft predefined +methods. These objects are defined by "Windows Instrumentation", and are not +part of the ACPI spec. ACPICA BZ 860. + +AcpiExec: added option to disable the memory tracking mechanism. The -dt +option will disable the tracking mechanism, which improves performance +considerably. + +AcpiExec: Restructured the command line options into -d (disable) and -e +(enable) options. + +---------------------------------------- 28 April 2010. Summary of changes for version 20100428: 1) ACPI CA Core Subsystem: Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Tue Jul 6 19:43:40 2010 (r209745) +++ head/sys/contrib/dev/acpica/common/adisasm.c Tue Jul 6 20:57:28 2010 (r209746) @@ -153,10 +153,6 @@ AdCreateTableHeader ( char *Filename, ACPI_TABLE_HEADER *Table); -void -AdDisassemblerHeader ( - char *Filename); - ACPI_STATUS AdDeferredParse ( ACPI_PARSE_OBJECT *Op, @@ -502,7 +498,7 @@ AdAmlDisassemble ( if (AcpiDmGetExternalMethodCount ()) { fprintf (stderr, - "\nFound %d external control methods, reparsing with new information\n", + "\nFound %u external control methods, reparsing with new information\n", AcpiDmGetExternalMethodCount ()); /* @@ -515,10 +511,11 @@ AdAmlDisassemble ( AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME; AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED; AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE; + AcpiGbl_RootNodeStruct.Parent = NULL; AcpiGbl_RootNodeStruct.Child = NULL; AcpiGbl_RootNodeStruct.Peer = NULL; AcpiGbl_RootNodeStruct.Object = NULL; - AcpiGbl_RootNodeStruct.Flags = ANOBJ_END_OF_PEER_LIST; + AcpiGbl_RootNodeStruct.Flags = 0; Status = AcpiNsRootInitialize (); AcpiDmAddExternalsToNamespace (); @@ -643,7 +640,7 @@ AdCreateTableHeader ( */ AdDisassemblerHeader (Filename); - AcpiOsPrintf (" *\n * Original Table Header:\n"); + AcpiOsPrintf (" * Original Table Header:\n"); AcpiOsPrintf (" * Signature \"%4.4s\"\n", Table->Signature); AcpiOsPrintf (" * Length 0x%8.8X (%u)\n", Table->Length, Table->Length); @@ -688,7 +685,7 @@ AdCreateTableHeader ( AcpiOsPrintf (" * OEM Revision 0x%8.8X (%u)\n", Table->OemRevision, Table->OemRevision); AcpiOsPrintf (" * Compiler ID \"%.4s\"\n", Table->AslCompilerId); AcpiOsPrintf (" * Compiler Version 0x%8.8X (%u)\n", Table->AslCompilerRevision, Table->AslCompilerRevision); - AcpiOsPrintf (" */\n"); + AcpiOsPrintf (" */\n\n"); /* Create AML output filename based on input filename */ @@ -706,7 +703,7 @@ AdCreateTableHeader ( /* Open the ASL definition block */ AcpiOsPrintf ( - "DefinitionBlock (\"%s\", \"%4.4s\", %hd, \"%.6s\", \"%.8s\", 0x%8.8X)\n", + "DefinitionBlock (\"%s\", \"%4.4s\", %hu, \"%.6s\", \"%.8s\", 0x%8.8X)\n", NewFilename, Table->Signature, Table->Revision, Table->OemId, Table->OemTableId, Table->OemRevision); @@ -1018,7 +1015,7 @@ AdGetLocalTables ( * is architecture-dependent. */ NumTables = (NewTable->Length - sizeof (ACPI_TABLE_HEADER)) / PointerSize; - AcpiOsPrintf ("There are %d tables defined in the %4.4s\n\n", + AcpiOsPrintf ("There are %u tables defined in the %4.4s\n\n", NumTables, NewTable->Signature); /* Get the FADT */ Modified: head/sys/contrib/dev/acpica/common/adwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adwalk.c Tue Jul 6 19:43:40 2010 (r209745) +++ head/sys/contrib/dev/acpica/common/adwalk.c Tue Jul 6 20:57:28 2010 (r209746) @@ -537,7 +537,7 @@ AcpiDmFindOrphanDescending ( } ArgCount = AcpiDmInspectPossibleArgs (3, 1, NextOp); - AcpiOsPrintf ("/* A-CHILDREN: %d Actual %d */\n", ArgCount, AcpiDmCountChildren (Op)); + AcpiOsPrintf ("/* A-CHILDREN: %u Actual %u */\n", ArgCount, AcpiDmCountChildren (Op)); if (ArgCount < 1) { Modified: head/sys/contrib/dev/acpica/common/dmextern.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmextern.c Tue Jul 6 19:43:40 2010 (r209745) +++ head/sys/contrib/dev/acpica/common/dmextern.c Tue Jul 6 20:57:28 2010 (r209746) @@ -252,7 +252,7 @@ AcpiDmNormalizeParentPrefix ( Node = Op->Common.Node; while (Node && (*Path == (UINT8) AML_PARENT_PREFIX)) { - Node = AcpiNsGetParentNode (Node); + Node = Node->Parent; Path++; } @@ -629,7 +629,7 @@ AcpiDmEmitExternals ( if (AcpiGbl_ExternalList->Type == ACPI_TYPE_METHOD) { - AcpiOsPrintf (") // %d Arguments\n", + AcpiOsPrintf (") // %u Arguments\n", AcpiGbl_ExternalList->Value); } else Modified: head/sys/contrib/dev/acpica/common/dmrestag.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmrestag.c Tue Jul 6 19:43:40 2010 (r209745) +++ head/sys/contrib/dev/acpica/common/dmrestag.c Tue Jul 6 20:57:28 2010 (r209746) @@ -549,13 +549,6 @@ AcpiDmGetResourceNode ( return (Node); } - /* List is circular, this flag marks the end */ - - if (Node->Flags & ANOBJ_END_OF_PEER_LIST) - { - return (NULL); - } - Node = Node->Peer; } Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Tue Jul 6 19:43:40 2010 (r209745) +++ head/sys/contrib/dev/acpica/common/dmtable.c Tue Jul 6 20:57:28 2010 (r209746) @@ -117,6 +117,8 @@ #include #include #include +#include +#include /* This module used for application-level code only */ @@ -125,20 +127,12 @@ /* Local Prototypes */ -static ACPI_DMTABLE_DATA * -AcpiDmGetTableData ( - char *Signature); - static void AcpiDmCheckAscii ( UINT8 *Target, char *RepairedName, UINT32 Count); -UINT8 -AcpiTbGenerateChecksum ( - ACPI_TABLE_HEADER *Table); - /* These tables map a subtable type to a description string */ @@ -161,6 +155,74 @@ static const char *AcpiDmDmarS "Unknown SubTable Type" /* Reserved */ }; +static const char *AcpiDmEinjActions[] = +{ + "Begin Operation", + "Get Trigger Table", + "Set Error Type", + "Get Error Type", + "End Operation", + "Execute Operation", + "Check Busy Status", + "Get Command Status", + "Unknown Action" +}; + +static const char *AcpiDmEinjInstructions[] = +{ + "Read Register", + "Read Register Value", + "Write Register", + "Write Register Value", + "Noop", + "Unknown Instruction" +}; + +static const char *AcpiDmErstActions[] = +{ + "Begin Write Operation", + "Begin Read Operation", + "Begin Clear Operation", + "End Operation", + "Set Record Offset", + "Execute Operation", + "Check Busy Status", + "Get Command Status", + "Get Record Identifier", + "Set Record Identifier", + "Get Record Count", + "Begin Dummy Write", + "Unused/Unknown Action", + "Get Error Address Range", + "Get Error Address Length", + "Get Error Attributes", + "Unknown Action" +}; + +static const char *AcpiDmErstInstructions[] = +{ + "Read Register", + "Read Register Value", + "Write Register", + "Write Register Value", + "Noop", + "Load Var1", + "Load Var2", + "Store Var1", + "Add", + "Subtract", + "Add Value", + "Subtract Value", + "Stall", + "Stall While True", + "Skip Next If True", + "GoTo", + "Set Source Address", + "Set Destination Address", + "Move Data", + "Unknown Instruction" +}; + static const char *AcpiDmHestSubnames[] = { "IA-32 Machine Check Exception", @@ -237,56 +299,59 @@ static const char *AcpiDmFadtP * * ACPI Table Data, indexed by signature. * - * Each entry contains: Signature, Table Info, Handler, Description + * Each entry contains: Signature, Table Info, Handler, DtHandler, + * Template, Description * - * Simple tables have only a TableInfo structure, complex tables have a handler. - * This table must be NULL terminated. RSDP and FACS are special-cased - * elsewhere. + * Simple tables have only a TableInfo structure, complex tables have a + * handler. This table must be NULL terminated. RSDP and FACS are + * special-cased elsewhere. * ******************************************************************************/ -static ACPI_DMTABLE_DATA AcpiDmTableData[] = +ACPI_DMTABLE_DATA AcpiDmTableData[] = { - {ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, "Alert Standard Format table"}, - {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, "Simple Boot Flag Table"}, - {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, "Boot Error Record Table"}, - {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, "Corrected Platform Error Polling table"}, - {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, "Debug Port table"}, - {ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, "DMA Remapping table"}, - {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, "Embedded Controller Boot Resources Table"}, - {ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, "Error Injection table"}, - {ACPI_SIG_ERST, NULL, AcpiDmDumpErst, "Error Record Serialization Table"}, - {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, "Fixed ACPI Description Table"}, - {ACPI_SIG_HEST, NULL, AcpiDmDumpHest, "Hardware Error Source Table"}, - {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, "High Precision Event Timer table"}, - {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, "I/O Virtualization Reporting Structure"}, - {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, "Multiple APIC Description Table"}, - {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, "Memory Mapped Configuration table"}, - {ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, "Management Controller Host Interface table"}, - {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, "Maximum System Characteristics Table"}, - {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, "Root System Description Table"}, - {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, "Smart Battery Specification Table"}, - {ACPI_SIG_SLIC, AcpiDmTableInfoSlic, NULL, "Software Licensing Description Table"}, - {ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, "System Locality Information Table"}, - {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, "Serial Port Console Redirection table"}, - {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, "Server Platform Management Interface table"}, - {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, "System Resource Affinity Table"}, - {ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, "Trusted Computing Platform Alliance table"}, - {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, "UEFI Boot Optimization Table"}, - {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, "Windows ACPI Emulated Devices Table"}, - {ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, "Watchdog Action Table"}, - {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, "Watchdog Resource Table"}, - {ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, "Extended System Description Table"}, - {NULL, NULL, NULL, NULL} + {ACPI_SIG_ASF, NULL, AcpiDmDumpAsf, DtCompileAsf, TemplateAsf, "Alert Standard Format table"}, + {ACPI_SIG_BOOT, AcpiDmTableInfoBoot, NULL, NULL, TemplateBoot, "Simple Boot Flag Table"}, + {ACPI_SIG_BERT, AcpiDmTableInfoBert, NULL, NULL, TemplateBert, "Boot Error Record Table"}, + {ACPI_SIG_CPEP, NULL, AcpiDmDumpCpep, DtCompileCpep, TemplateCpep, "Corrected Platform Error Polling table"}, + {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp, NULL, NULL, TemplateDbgp, "Debug Port table"}, + {ACPI_SIG_DMAR, NULL, AcpiDmDumpDmar, DtCompileDmar, TemplateDmar, "DMA Remapping table"}, + {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt, NULL, NULL, TemplateEcdt, "Embedded Controller Boot Resources Table"}, + {ACPI_SIG_EINJ, NULL, AcpiDmDumpEinj, DtCompileEinj, TemplateEinj, "Error Injection table"}, + {ACPI_SIG_ERST, NULL, AcpiDmDumpErst, DtCompileErst, TemplateErst, "Error Record Serialization Table"}, + {ACPI_SIG_FADT, NULL, AcpiDmDumpFadt, DtCompileFadt, TemplateFadt, "Fixed ACPI Description Table"}, + {ACPI_SIG_HEST, NULL, AcpiDmDumpHest, DtCompileHest, TemplateHest, "Hardware Error Source Table"}, + {ACPI_SIG_HPET, AcpiDmTableInfoHpet, NULL, NULL, TemplateHpet, "High Precision Event Timer table"}, + {ACPI_SIG_IVRS, NULL, AcpiDmDumpIvrs, DtCompileIvrs, TemplateIvrs, "I/O Virtualization Reporting Structure"}, + {ACPI_SIG_MADT, NULL, AcpiDmDumpMadt, DtCompileMadt, TemplateMadt, "Multiple APIC Description Table"}, + {ACPI_SIG_MCFG, NULL, AcpiDmDumpMcfg, DtCompileMcfg, TemplateMcfg, "Memory Mapped Configuration table"}, + {ACPI_SIG_MCHI, AcpiDmTableInfoMchi, NULL, NULL, TemplateMchi, "Management Controller Host Interface table"}, + {ACPI_SIG_MSCT, NULL, AcpiDmDumpMsct, DtCompileMsct, TemplateMsct, "Maximum System Characteristics Table"}, + {ACPI_SIG_RSDT, NULL, AcpiDmDumpRsdt, DtCompileRsdt, TemplateRsdt, "Root System Description Table"}, + {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst, "Smart Battery Specification Table"}, + {ACPI_SIG_SLIC, AcpiDmTableInfoSlic, NULL, NULL, NULL, "Software Licensing Description Table"}, + {ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit, "System Locality Information Table"}, + {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, TemplateSpcr, "Serial Port Console Redirection table"}, + {ACPI_SIG_SPMI, AcpiDmTableInfoSpmi, NULL, NULL, TemplateSpmi, "Server Platform Management Interface table"}, + {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, TemplateSrat, "System Resource Affinity Table"}, + {ACPI_SIG_TCPA, AcpiDmTableInfoTcpa, NULL, NULL, TemplateTcpa, "Trusted Computing Platform Alliance table"}, + {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, NULL, TemplateUefi, "UEFI Boot Optimization Table"}, + {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, NULL, TemplateWaet, "Windows ACPI Emulated Devices Table"}, + {ACPI_SIG_WDAT, NULL, AcpiDmDumpWdat, DtCompileWdat, TemplateWdat, "Watchdog Action Table"}, + {ACPI_SIG_WDDT, AcpiDmTableInfoWddt, NULL, NULL, TemplateWddt, "Watchdog Description Table"}, + {ACPI_SIG_WDRT, AcpiDmTableInfoWdrt, NULL, NULL, TemplateWdrt, "Watchdog Resource Table"}, + {ACPI_SIG_XSDT, NULL, AcpiDmDumpXsdt, DtCompileXsdt, TemplateXsdt, "Extended System Description Table"}, + {NULL, NULL, NULL, NULL, NULL, NULL} }; /******************************************************************************* * - * FUNCTION: AcpiTbGenerateChecksum + * FUNCTION: AcpiDmGenerateChecksum * - * PARAMETERS: Table - Pointer to a valid ACPI table (with a - * standard ACPI header) + * PARAMETERS: Table - Pointer to table to be checksummed + * Length - Length of the table + * OriginalChecksum - Value of the checksum field * * RETURN: 8 bit checksum of buffer * @@ -295,19 +360,21 @@ static ACPI_DMTABLE_DATA AcpiDmTableD ******************************************************************************/ UINT8 -AcpiTbGenerateChecksum ( - ACPI_TABLE_HEADER *Table) +AcpiDmGenerateChecksum ( + void *Table, + UINT32 Length, + UINT8 OriginalChecksum) { UINT8 Checksum; /* Sum the entire table as-is */ - Checksum = AcpiTbChecksum ((UINT8 *) Table, Table->Length); + Checksum = AcpiTbChecksum ((UINT8 *) Table, Length); /* Subtract off the existing checksum value in the table */ - Checksum = (UINT8) (Checksum - Table->Checksum); + Checksum = (UINT8) (Checksum - OriginalChecksum); /* Compute the final checksum */ @@ -328,7 +395,7 @@ AcpiTbGenerateChecksum ( * ******************************************************************************/ -static ACPI_DMTABLE_DATA * +ACPI_DMTABLE_DATA * AcpiDmGetTableData ( char *Signature) { @@ -432,10 +499,13 @@ AcpiDmDumpDataTable ( } } - /* Always dump the raw table data */ + if (!Gbl_DoTemplates || Gbl_VerboseTemplates) + { + /* Dump the raw table data */ - AcpiOsPrintf ("\nRaw Table Data\n\n"); - AcpiUtDumpBuffer2 (ACPI_CAST_PTR (UINT8, Table), Length, DB_BYTE_DISPLAY); + AcpiOsPrintf ("\nRaw Table Data\n\n"); + AcpiUtDumpBuffer2 (ACPI_CAST_PTR (UINT8, Table), Length, DB_BYTE_DISPLAY); + } } @@ -463,15 +533,31 @@ AcpiDmLineHeader ( char *Name) { - if (ByteLength) + if (Gbl_DoTemplates && !Gbl_VerboseTemplates) /* Terse template */ { - AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %28s : ", - Offset, Offset, ByteLength, Name); + if (ByteLength) + { + AcpiOsPrintf ("[%.3d] %34s : ", + ByteLength, Name); + } + else + { + AcpiOsPrintf ("%40s : ", + Name); + } } - else + else /* Normal disassembler or verbose template */ { - AcpiOsPrintf ("%43s : ", - Name); + if (ByteLength) + { + AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %28s : ", + Offset, Offset, ByteLength, Name); + } + else + { + AcpiOsPrintf ("%43s : ", + Name); + } } } @@ -483,15 +569,31 @@ AcpiDmLineHeader2 ( UINT32 Value) { - if (ByteLength) + if (Gbl_DoTemplates && !Gbl_VerboseTemplates) /* Terse template */ { - AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %24s % 3d : ", - Offset, Offset, ByteLength, Name, Value); + if (ByteLength) + { + AcpiOsPrintf ("[%.3d] %30s % 3d : ", + ByteLength, Name, Value); + } + else + { + AcpiOsPrintf ("%36s % 3d : ", + Name, Value); + } } - else + else /* Normal disassembler or verbose template */ { - AcpiOsPrintf ("[%3.3Xh %4.4d ] %24s % 3d : ", - Offset, Offset, Name, Value); + if (ByteLength) + { + AcpiOsPrintf ("[%3.3Xh %4.4d% 3d] %24s % 3d : ", + Offset, Offset, ByteLength, Name, Value); + } + else + { + AcpiOsPrintf ("[%3.3Xh %4.4d ] %24s % 3d : ", + Offset, Offset, Name, Value); + } } } @@ -511,6 +613,8 @@ AcpiDmLineHeader2 ( * * DESCRIPTION: Display ACPI table contents by walking the Info table. * + * Note: This function must remain in sync with DtGetFieldLength. + * ******************************************************************************/ ACPI_STATUS @@ -571,6 +675,10 @@ AcpiDmDumpTable ( case ACPI_DMT_ASF: case ACPI_DMT_HESTNTYP: case ACPI_DMT_FADTPM: + case ACPI_DMT_EINJACT: + case ACPI_DMT_EINJINST: + case ACPI_DMT_ERSTACT: + case ACPI_DMT_ERSTINST: ByteLength = 1; break; case ACPI_DMT_UINT16: @@ -705,7 +813,11 @@ AcpiDmDumpTable ( for (Temp8 = 0; Temp8 < 16; Temp8++) { - AcpiOsPrintf ("%2.2X,", Target[Temp8]); + AcpiOsPrintf ("%2.2X", Target[Temp8]); + if ((Temp8 + 1) < 16) + { + AcpiOsPrintf (","); + } } AcpiOsPrintf ("\n"); break; @@ -754,7 +866,9 @@ AcpiDmDumpTable ( /* Checksum, display and validate */ AcpiOsPrintf ("%2.2X", *Target); - Temp8 = AcpiTbGenerateChecksum (Table); + Temp8 = AcpiDmGenerateChecksum (Table, + ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Length, + ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum); if (Temp8 != ACPI_CAST_PTR (ACPI_TABLE_HEADER, Table)->Checksum) { AcpiOsPrintf ( @@ -807,6 +921,58 @@ AcpiDmDumpTable ( AcpiOsPrintf ("%4.4X <%s>\n", ACPI_GET16 (Target), AcpiDmDmarSubnames[Temp16]); break; + case ACPI_DMT_EINJACT: + + /* EINJ Action types */ + + Temp8 = *Target; + if (Temp8 > ACPI_EINJ_ACTION_RESERVED) + { + Temp8 = ACPI_EINJ_ACTION_RESERVED; + } + + AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmEinjActions[Temp8]); + break; + + case ACPI_DMT_EINJINST: + + /* EINJ Instruction types */ + + Temp8 = *Target; + if (Temp8 > ACPI_EINJ_INSTRUCTION_RESERVED) + { + Temp8 = ACPI_EINJ_INSTRUCTION_RESERVED; + } + + AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmEinjInstructions[Temp8]); + break; + + case ACPI_DMT_ERSTACT: + + /* ERST Action types */ + + Temp8 = *Target; + if (Temp8 > ACPI_ERST_ACTION_RESERVED) + { + Temp8 = ACPI_ERST_ACTION_RESERVED; + } + + AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmErstActions[Temp8]); + break; + + case ACPI_DMT_ERSTINST: + + /* ERST Instruction types */ + + Temp8 = *Target; + if (Temp8 > ACPI_ERST_INSTRUCTION_RESERVED) + { + Temp8 = ACPI_ERST_INSTRUCTION_RESERVED; + } + + AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmErstInstructions[Temp8]); + break; + case ACPI_DMT_HEST: /* HEST subtable types */ @@ -842,7 +1008,6 @@ AcpiDmDumpTable ( AcpiOsPrintf ("%2.2X (%s)\n", *Target, AcpiDmHestNotifySubnames[Temp8]); break; - case ACPI_DMT_MADT: /* MADT subtable types */ Modified: head/sys/contrib/dev/acpica/common/dmtbdump.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump.c Tue Jul 6 19:43:40 2010 (r209745) +++ head/sys/contrib/dev/acpica/common/dmtbdump.c Tue Jul 6 20:57:28 2010 (r209746) @@ -130,7 +130,8 @@ * * PARAMETERS: Table - A RSDP * - * RETURN: Length of the table (there is no length field, use revision) + * RETURN: Length of the table (there is not always a length field, + * use revision or length if available (ACPI 2.0+)) * * DESCRIPTION: Format the contents of a RSDP * @@ -140,19 +141,42 @@ UINT32 AcpiDmDumpRsdp ( ACPI_TABLE_HEADER *Table) { - UINT32 Length = ACPI_RSDP_REV0_SIZE; + ACPI_TABLE_RSDP *Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table); + UINT32 Length = sizeof (ACPI_RSDP_COMMON); + UINT8 Checksum; /* Dump the common ACPI 1.0 portion */ AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp1); - /* ACPI 2.0+ contains more data and has a Length field */ + /* Validate the first checksum */ - if (ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table)->Revision > 0) + Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_RSDP_COMMON), + Rsdp->Checksum); + if (Checksum != Rsdp->Checksum) { - Length = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table)->Length; + AcpiOsPrintf ("/* Incorrect Checksum above, should be 0x%2.2X */\n", + Checksum); + } + + /* The RSDP for ACPI 2.0+ contains more data and has a Length field */ + + if (Rsdp->Revision > 0) + { + Length = Rsdp->Length; AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp2); + + /* Validate the extended checksum over entire RSDP */ + + Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_TABLE_RSDP), + Rsdp->ExtendedChecksum); + if (Checksum != Rsdp->ExtendedChecksum) + { + AcpiOsPrintf ( + "/* Incorrect Extended Checksum above, should be 0x%2.2X */\n", + Checksum); + } } return (Length); @@ -595,7 +619,7 @@ AcpiDmDumpDmar ( while (PathOffset < ScopeTable->Length) { AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2, "PCI Path"); - AcpiOsPrintf ("[%2.2X, %2.2X]\n", PciPath[0], PciPath[1]); + AcpiOsPrintf ("%2.2X,%2.2X\n", PciPath[0], PciPath[1]); /* Point to next PCI Path entry */ @@ -709,7 +733,7 @@ AcpiDmDumpErst ( { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset, SubTable, - sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0); + sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0); if (ACPI_FAILURE (Status)) { return; @@ -1174,7 +1198,7 @@ AcpiDmDumpMcfg ( { if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Table->Length) { - AcpiOsPrintf ("Warning: there are %d invalid trailing bytes\n", + AcpiOsPrintf ("Warning: there are %u invalid trailing bytes\n", sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length)); return; } @@ -1301,15 +1325,20 @@ AcpiDmDumpSlit ( return; } - AcpiOsPrintf ("%2.2X ", Row[j]); + AcpiOsPrintf ("%2.2X", Row[j]); Offset++; /* Display up to 16 bytes per output row */ - if (j && (((j+1) % 16) == 0) && ((j+1) < Localities)) + if ((j+1) < Localities) { - AcpiOsPrintf ("\n"); - AcpiDmLineHeader (Offset, 0, ""); + AcpiOsPrintf (","); + + if (j && (((j+1) % 16) == 0)) + { + AcpiOsPrintf ("\n"); + AcpiDmLineHeader (Offset, 0, ""); + } } } Modified: head/sys/contrib/dev/acpica/common/dmtbinfo.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo.c Tue Jul 6 19:43:40 2010 (r209745) +++ head/sys/contrib/dev/acpica/common/dmtbinfo.c Tue Jul 6 20:57:28 2010 (r209746) @@ -153,6 +153,7 @@ #define ACPI_UEFI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_UEFI,f) #define ACPI_WAET_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WAET,f) #define ACPI_WDAT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDAT,f) +#define ACPI_WDDT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDDT,f) #define ACPI_WDRT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDRT,f) /* Subtables */ @@ -171,6 +172,7 @@ #define ACPI_DMAR2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_ATSR,f) #define ACPI_DMAR3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_RHSA,f) #define ACPI_EINJ0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WHEA_HEADER,f) +#define ACPI_ERST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WHEA_HEADER,f) #define ACPI_HEST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f) #define ACPI_HEST1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_CORRECTED,f) #define ACPI_HEST2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_NMI,f) @@ -229,6 +231,17 @@ #define ACPI_MADT8_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_INTERRUPT_SOURCE,f,o) #define ACPI_MADT9_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC,f,o) #define ACPI_MADT10_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f,o) +#define ACPI_WDDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_WDDT,f,o) +#define ACPI_EINJ0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o) +#define ACPI_ERST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o) +#define ACPI_HEST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f,o) +#define ACPI_HEST1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_IA_CORRECTED,f,o) +#define ACPI_HEST6_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_AER_ROOT,f,o) + +/* + * Required terminator for all tables below + */ +#define ACPI_DMT_TERMINATOR {ACPI_DMT_EXIT, 0, NULL, 0} /* @@ -245,16 +258,16 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoHeader[] = { - {ACPI_DMT_SIG, ACPI_HDR_OFFSET (Signature[0]), "Signature"}, - {ACPI_DMT_UINT32, ACPI_HDR_OFFSET (Length), "Table Length"}, - {ACPI_DMT_UINT8, ACPI_HDR_OFFSET (Revision), "Revision"}, - {ACPI_DMT_CHKSUM, ACPI_HDR_OFFSET (Checksum), "Checksum"}, - {ACPI_DMT_NAME6, ACPI_HDR_OFFSET (OemId[0]), "Oem ID"}, - {ACPI_DMT_NAME8, ACPI_HDR_OFFSET (OemTableId[0]), "Oem Table ID"}, - {ACPI_DMT_UINT32, ACPI_HDR_OFFSET (OemRevision), "Oem Revision"}, - {ACPI_DMT_NAME4, ACPI_HDR_OFFSET (AslCompilerId[0]), "Asl Compiler ID"}, - {ACPI_DMT_UINT32, ACPI_HDR_OFFSET (AslCompilerRevision), "Asl Compiler Revision"}, - {ACPI_DMT_EXIT, 0, NULL} + {ACPI_DMT_SIG, ACPI_HDR_OFFSET (Signature[0]), "Signature", 0}, + {ACPI_DMT_UINT32, ACPI_HDR_OFFSET (Length), "Table Length", DT_LENGTH}, + {ACPI_DMT_UINT8, ACPI_HDR_OFFSET (Revision), "Revision", 0}, + {ACPI_DMT_CHKSUM, ACPI_HDR_OFFSET (Checksum), "Checksum", 0}, + {ACPI_DMT_NAME6, ACPI_HDR_OFFSET (OemId[0]), "Oem ID", 0}, + {ACPI_DMT_NAME8, ACPI_HDR_OFFSET (OemTableId[0]), "Oem Table ID", 0}, + {ACPI_DMT_UINT32, ACPI_HDR_OFFSET (OemRevision), "Oem Revision", 0}, + {ACPI_DMT_NAME4, ACPI_HDR_OFFSET (AslCompilerId[0]), "Asl Compiler ID", 0}, + {ACPI_DMT_UINT32, ACPI_HDR_OFFSET (AslCompilerRevision), "Asl Compiler Revision", 0}, + ACPI_DMT_TERMINATOR }; @@ -266,12 +279,12 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoGas[] = { - {ACPI_DMT_SPACEID, ACPI_GAS_OFFSET (SpaceId), "Space ID"}, - {ACPI_DMT_UINT8, ACPI_GAS_OFFSET (BitWidth), "Bit Width"}, - {ACPI_DMT_UINT8, ACPI_GAS_OFFSET (BitOffset), "Bit Offset"}, - {ACPI_DMT_UINT8, ACPI_GAS_OFFSET (AccessWidth), "Access Width"}, - {ACPI_DMT_UINT64, ACPI_GAS_OFFSET (Address), "Address"}, - {ACPI_DMT_EXIT, 0, NULL} + {ACPI_DMT_SPACEID, ACPI_GAS_OFFSET (SpaceId), "Space ID", 0}, + {ACPI_DMT_UINT8, ACPI_GAS_OFFSET (BitWidth), "Bit Width", 0}, + {ACPI_DMT_UINT8, ACPI_GAS_OFFSET (BitOffset), "Bit Offset", 0}, + {ACPI_DMT_UINT8, ACPI_GAS_OFFSET (AccessWidth), "Access Width", 0}, + {ACPI_DMT_UINT64, ACPI_GAS_OFFSET (Address), "Address", 0}, + ACPI_DMT_TERMINATOR }; @@ -283,23 +296,23 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[] = { - {ACPI_DMT_NAME8, ACPI_RSDP_OFFSET (Signature[0]), "Signature"}, - {ACPI_DMT_UINT8, ACPI_RSDP_OFFSET (Checksum), "Checksum"}, - {ACPI_DMT_NAME6, ACPI_RSDP_OFFSET (OemId[0]), "Oem ID"}, - {ACPI_DMT_UINT8, ACPI_RSDP_OFFSET (Revision), "Revision"}, - {ACPI_DMT_UINT32, ACPI_RSDP_OFFSET (RsdtPhysicalAddress), "RSDT Address"}, - {ACPI_DMT_EXIT, 0, NULL} + {ACPI_DMT_NAME8, ACPI_RSDP_OFFSET (Signature[0]), "Signature", 0}, + {ACPI_DMT_UINT8, ACPI_RSDP_OFFSET (Checksum), "Checksum", 0}, + {ACPI_DMT_NAME6, ACPI_RSDP_OFFSET (OemId[0]), "Oem ID", 0}, + {ACPI_DMT_UINT8, ACPI_RSDP_OFFSET (Revision), "Revision", 0}, + {ACPI_DMT_UINT32, ACPI_RSDP_OFFSET (RsdtPhysicalAddress), "RSDT Address", 0}, + ACPI_DMT_TERMINATOR }; /* ACPI 2.0+ Extensions */ ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[] = { - {ACPI_DMT_UINT32, ACPI_RSDP_OFFSET (Length), "Length"}, - {ACPI_DMT_UINT64, ACPI_RSDP_OFFSET (XsdtPhysicalAddress), "XSDT Address"}, - {ACPI_DMT_UINT8, ACPI_RSDP_OFFSET (ExtendedChecksum), "Extended Checksum"}, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 21:41:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE25E1065670; Tue, 6 Jul 2010 21:41: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 AEF518FC12; Tue, 6 Jul 2010 21:41:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66Lf8dS091732; Tue, 6 Jul 2010 21:41:08 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66Lf8wD091730; Tue, 6 Jul 2010 21:41:08 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201007062141.o66Lf8wD091730@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 6 Jul 2010 21:41: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: r209747 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 21:41:08 -0000 Author: jkim Date: Tue Jul 6 21:41:08 2010 New Revision: 209747 URL: http://svn.freebsd.org/changeset/base/209747 Log: Fix mis-merges in the previous commit. Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Tue Jul 6 20:57:28 2010 (r209746) +++ head/sys/dev/acpica/acpi.c Tue Jul 6 21:41:08 2010 (r209747) @@ -2690,7 +2690,7 @@ acpi_wake_sleep_prep(ACPI_HANDLE handle, * and set _PSW. */ if (sstate > prw.lowest_wake) { - AcpiDisableGpe(prw.gpe_handle, prw.gpe_bit); + AcpiGpeWakeup(prw.gpe_handle, prw.gpe_bit, ACPI_GPE_DISABLE); if (bootverbose) device_printf(dev, "wake_prep disabled wake for %s (S%d)\n", acpi_name(handle), sstate); @@ -2727,7 +2727,7 @@ acpi_wake_run_prep(ACPI_HANDLE handle, i * clear _PSW and turn off any power resources it used. */ if (sstate > prw.lowest_wake) { - AcpiEnableGpe(prw.gpe_handle, prw.gpe_bit); + AcpiGpeWakeup(prw.gpe_handle, prw.gpe_bit, ACPI_GPE_ENABLE); if (bootverbose) device_printf(dev, "run_prep re-enabled %s\n", acpi_name(handle)); } else { From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 22:33:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A27A11065670; Tue, 6 Jul 2010 22:33:22 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78FD28FC08; Tue, 6 Jul 2010 22:33:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66MXMlh003513; Tue, 6 Jul 2010 22:33:22 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66MXMUl003511; Tue, 6 Jul 2010 22:33:22 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201007062233.o66MXMUl003511@svn.freebsd.org> From: Bruce Cran Date: Tue, 6 Jul 2010 22:33: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: r209748 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 22:33:22 -0000 Author: brucec Date: Tue Jul 6 22:33:22 2010 New Revision: 209748 URL: http://svn.freebsd.org/changeset/base/209748 Log: Simplify the wording of the console configuration dialogs since we now only have a single video console driver. Approved by: rrs (mentor) MFC after: 1 month Modified: head/usr.sbin/sysinstall/menus.c Modified: head/usr.sbin/sysinstall/menus.c ============================================================================== --- head/usr.sbin/sysinstall/menus.c Tue Jul 6 21:41:08 2010 (r209747) +++ head/usr.sbin/sysinstall/menus.c Tue Jul 6 22:33:22 2010 (r209748) @@ -1836,9 +1836,8 @@ DMenu MenuNTP = { DMenu MenuSyscons = { DMENU_NORMAL_TYPE, "System Console Configuration", - "The default system console driver for FreeBSD (syscons) has a\n" - "number of configuration options which may be set according to\n" - "your preference.\n\n" + "The system console driver for FreeBSD has a number of configuration\n" + "options which may be set according to your preference.\n\n" "When you are done setting configuration options, select Cancel.", "Configure your system console settings", NULL, @@ -1862,9 +1861,9 @@ DMenu MenuSyscons = { DMenu MenuSysconsKeymap = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Keymap", - "The default system console driver for FreeBSD (syscons) defaults\n" - "to a standard \"PC-98x1\" keyboard map. Users may wish to choose\n" - "one of the other keymaps below.\n" + "The system console driver for FreeBSD defaults to a standard\n" + "\"PC-98x1\" keyboard map. Users may wish to choose one of the\n" + "other keymaps below.\n" "Note that sysinstall itself only uses the part of the keyboard map\n" "which is required to generate the ANSI character subset, but your\n" "choice of keymap will also be saved for later (fuller) use.", @@ -1878,10 +1877,10 @@ DMenu MenuSysconsKeymap = { DMenu MenuSysconsKeymap = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Keymap", - "The default system console driver for FreeBSD (syscons) defaults\n" - "to a standard \"American\" keyboard map. Users in other countries\n" - "(or with different keyboard preferences) may wish to choose one of\n" - "the other keymaps below.\n" + "The system console driver for FreeBSD defaults to a standard\n" + "\"American\" keyboard map. Users in other countries (or with\n" + "different keyboard preferences) may wish to choose one of the\n" + "other keymaps below.\n" "Note that sysinstall itself only uses the part of the keyboard map\n" "which is required to generate the ANSI character subset, but your\n" "choice of keymap will also be saved for later (fuller) use.", From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 23:13:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE797106566C; Tue, 6 Jul 2010 23:13:21 +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 ADDAC8FC13; Tue, 6 Jul 2010 23:13:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66NDLfc012283; Tue, 6 Jul 2010 23:13:21 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66NDLO5012281; Tue, 6 Jul 2010 23:13:21 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201007062313.o66NDLO5012281@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 6 Jul 2010 23:13: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: r209749 - head/sys/ia64/ia64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 23:13:21 -0000 Author: marcel Date: Tue Jul 6 23:13:21 2010 New Revision: 209749 URL: http://svn.freebsd.org/changeset/base/209749 Log: Provide more examples for error injection. Modified: head/sys/ia64/ia64/mca.c Modified: head/sys/ia64/ia64/mca.c ============================================================================== --- head/sys/ia64/ia64/mca.c Tue Jul 6 22:33:22 2010 (r209748) +++ head/sys/ia64/ia64/mca.c Tue Jul 6 23:13:21 2010 (r209749) @@ -91,7 +91,12 @@ mca_sysctl_inject(SYSCTL_HANDLER_ARGS) if (error != 0 || req->newptr == NULL) return (error); - /* For example: val=137 causes a fatal CPU error. */ + /* + * Example values for injecting PAL determined machine checks: + * corrected 9 + * recoverable 73 + * fatal 137 + */ res = ia64_call_pal_stacked(PAL_MC_ERROR_INJECT, val, 0, 0); printf("%s: %#lx, %#lx, %#lx, %#lx\n", __func__, res.pal_status, res.pal_result[0], res.pal_result[1], res.pal_result[2]); From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 23:29:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BADE106564A; Tue, 6 Jul 2010 23:29:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 399DE8FC14; Tue, 6 Jul 2010 23:29:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66NTt3N015992; Tue, 6 Jul 2010 23:29:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66NTt2o015985; Tue, 6 Jul 2010 23:29:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201007062329.o66NTt2o015985@svn.freebsd.org> From: Warner Losh Date: Tue, 6 Jul 2010 23:29: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: r209751 - in head/usr.sbin/pc-sysinstall: backend-query doc pc-sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 23:29:56 -0000 Author: imp Date: Tue Jul 6 23:29:55 2010 New Revision: 209751 URL: http://svn.freebsd.org/changeset/base/209751 Log: A few patches from Ed Maste by way of Kris Moore 1. Change detect-vmware to detect-emulation 2. improve laptop detection 3. better, network descriptions Modified: head/usr.sbin/pc-sysinstall/backend-query/Makefile head/usr.sbin/pc-sysinstall/backend-query/detect-laptop.sh head/usr.sbin/pc-sysinstall/backend-query/detect-nics.sh head/usr.sbin/pc-sysinstall/doc/help-index head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh Modified: head/usr.sbin/pc-sysinstall/backend-query/Makefile ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/Makefile Tue Jul 6 23:20:43 2010 (r209750) +++ head/usr.sbin/pc-sysinstall/backend-query/Makefile Tue Jul 6 23:29:55 2010 (r209751) @@ -1,6 +1,6 @@ # $FreeBSD$ -FILES= detect-laptop.sh detect-nics.sh detect-vmware.sh disk-info.sh \ +FILES= detect-laptop.sh detect-nics.sh detect-emulation.sh disk-info.sh \ disk-list.sh disk-part.sh enable-net.sh list-config.sh list-components.sh \ list-mirrors.sh list-rsync-backups.sh list-tzones.sh query-langs.sh \ send-logs.sh setup-ssh-keys.sh sys-mem.sh test-live.sh test-netup.sh \ Modified: head/usr.sbin/pc-sysinstall/backend-query/detect-laptop.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/detect-laptop.sh Tue Jul 6 23:20:43 2010 (r209750) +++ head/usr.sbin/pc-sysinstall/backend-query/detect-laptop.sh Tue Jul 6 23:29:55 2010 (r209751) @@ -25,9 +25,8 @@ # # $FreeBSD$ -dmesgLine=`dmesg | grep "acpi_acad0"` -if test "${dmesgLine}" = ""; then - echo "laptop: NO" -else +if devinfo | grep 'acpi_acad0' >/dev/null 2>/dev/null; then echo "laptop: YES" -fi +else + echo "laptop: NO" +fi Modified: head/usr.sbin/pc-sysinstall/backend-query/detect-nics.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/detect-nics.sh Tue Jul 6 23:20:43 2010 (r209750) +++ head/usr.sbin/pc-sysinstall/backend-query/detect-nics.sh Tue Jul 6 23:29:55 2010 (r209751) @@ -25,17 +25,12 @@ # # $FreeBSD$ -rm /tmp/netCards 2>/dev/null -touch /tmp/netCards - -config="`ifconfig -l`" - -for i in $config -do - echo "${i}" | grep -e "lo0" -e "^fwe" -e "^fwip" -e "lo1" -e "^plip" -e "^pfsync" -e "^pflog" -e "^tun" >/dev/null 2>/dev/null - if [ "$?" != "0" ] - then - IDENT="<`dmesg | grep ^${i} | grep -v "miibus" | grep '<' | cut -d '<' -f 2 | cut -d '>' -f 1 | head -1`>" - echo "${i}: $IDENT" - fi +for i in $(ifconfig -l); do + case "${i%%[0-9]*}" in + lo|fwe|fwip|plip|pfsync|pflog|tun) + continue + ;; + esac + IDENT=$(dmesg | sed -n "s/^$i: <\(.*\)>.*$/\1/p" | head -1) + echo "${i}: <$IDENT>" done Modified: head/usr.sbin/pc-sysinstall/doc/help-index ============================================================================== --- head/usr.sbin/pc-sysinstall/doc/help-index Tue Jul 6 23:20:43 2010 (r209750) +++ head/usr.sbin/pc-sysinstall/doc/help-index Tue Jul 6 23:29:55 2010 (r209751) @@ -22,8 +22,8 @@ System Query Commands detect-laptop Tests to see if this system is a laptop or desktop - detect-vmware - Tests to see if this system is actually a vmware session + detect-emulation + Tests to see if this system is actually running in an emulator such as VirtualBox detect-nics Returns a listing of the detected network cards on this system Modified: head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 ============================================================================== --- head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 Tue Jul 6 23:20:43 2010 (r209750) +++ head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 Tue Jul 6 23:29:55 2010 (r209751) @@ -69,8 +69,8 @@ Returns information about a storage devi sectors. .It detect-laptop Tests to see if this system is a laptop or desktop. -.It detect-vmware -Tests to see if this system is a vmware session. +.It detect-emulation +Tests to see if this system is running in an emulator .It detect-nics Returns a listing of the detected network cards on this system. .It list-components Modified: head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh Tue Jul 6 23:20:43 2010 (r209750) +++ head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh Tue Jul 6 23:29:55 2010 (r209751) @@ -124,8 +124,8 @@ case $1 in detect-nics) ${QUERYDIR}/detect-nics.sh ;; - # The user is wanting to check if we are in vmware - detect-vmware) ${QUERYDIR}/detect-vmware.sh + # The user is wanting to check if we are in emulation + detect-emulation) ${QUERYDIR}/detect-emulation.sh ;; # The user is wanting to query a disk's information From owner-svn-src-all@FreeBSD.ORG Tue Jul 6 23:31:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E054106566B; Tue, 6 Jul 2010 23:31:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43AD68FC08; Tue, 6 Jul 2010 23:31:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o66NVrsP016462; Tue, 6 Jul 2010 23:31:53 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o66NVrcb016460; Tue, 6 Jul 2010 23:31:53 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201007062331.o66NVrcb016460@svn.freebsd.org> From: Warner Losh Date: Tue, 6 Jul 2010 23:31: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: r209752 - head/usr.sbin/pc-sysinstall/backend-query X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 23:31:53 -0000 Author: imp Date: Tue Jul 6 23:31:52 2010 New Revision: 209752 URL: http://svn.freebsd.org/changeset/base/209752 Log: These files should have been added/deleted in r209751 Added: head/usr.sbin/pc-sysinstall/backend-query/detect-emulation.sh (contents, props changed) Deleted: head/usr.sbin/pc-sysinstall/backend-query/detect-vmware.sh Added: head/usr.sbin/pc-sysinstall/backend-query/detect-emulation.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/detect-emulation.sh Tue Jul 6 23:31:52 2010 (r209752) @@ -0,0 +1,41 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iXsystems, 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 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$ + +case "$(kenv smbios.system.product)" in +VirtualBox) + echo "emulation: VIRTUALBOX" + exit 0 + ;; +VMware*) + echo "emulation: VMWARE" + exit 0 + ;; +*) + echo "emulation: NO" + exit 1 + ;; +esac From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 00:03:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C78EC106566C; Wed, 7 Jul 2010 00:03:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B68438FC16; Wed, 7 Jul 2010 00:03:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6703624023404; Wed, 7 Jul 2010 00:03:06 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67036PN023402; Wed, 7 Jul 2010 00:03:06 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201007070003.o67036PN023402@svn.freebsd.org> From: Warner Losh Date: Wed, 7 Jul 2010 00: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: r209753 - head/usr.sbin/pc-sysinstall/backend-query X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 00:03:06 -0000 Author: imp Date: Wed Jul 7 00:03:06 2010 New Revision: 209753 URL: http://svn.freebsd.org/changeset/base/209753 Log: Further simplification. Modified: head/usr.sbin/pc-sysinstall/backend-query/detect-laptop.sh Modified: head/usr.sbin/pc-sysinstall/backend-query/detect-laptop.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/detect-laptop.sh Tue Jul 6 23:31:52 2010 (r209752) +++ head/usr.sbin/pc-sysinstall/backend-query/detect-laptop.sh Wed Jul 7 00:03:06 2010 (r209753) @@ -25,7 +25,7 @@ # # $FreeBSD$ -if devinfo | grep 'acpi_acad0' >/dev/null 2>/dev/null; then +if devinfo | grep -q acpi_acad0; then echo "laptop: YES" else echo "laptop: NO" From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 06:06:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAA57106566B; Wed, 7 Jul 2010 06:06:54 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA0EE8FC14; Wed, 7 Jul 2010 06:06:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6766sMt003022; Wed, 7 Jul 2010 06:06:54 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6766s1F003020; Wed, 7 Jul 2010 06:06:54 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201007070606.o6766s1F003020@svn.freebsd.org> From: Brian Somers Date: Wed, 7 Jul 2010 06:06: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: r209756 - head/sbin/dhclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 06:06:55 -0000 Author: brian Date: Wed Jul 7 06:06:54 2010 New Revision: 209756 URL: http://svn.freebsd.org/changeset/base/209756 Log: When dhclient obtains a lease, it runs dhclient-script and expects it to configure the interface. When the script is complete, dhclient monitors the routing socket and will terminate if its address is deleted or if its interface is removed or brought down. Because the routing socket is already open when dhclient-script is run, dhclient ignores address deletions for 10 seconds after the script was run. If the address that will be obtained is already configured on the interface before dhclient starts, and if dhclient-script takes more than 10 seconds (perhaps due to dhclient-*-hooks latencies), on script completion, dhclient will immediately and silently exit when it sees the RTM_DELADDR routing message resulting from the script reassigning the address to the interface. This change logs dhclient's reason for exiting and also changes the 10 second timeout to be effective from completion of dhclient-script rather than from when it was started. We now ignore RTM_DELADDR and RTM_NEWADDR messages when the message contains no interface address (which should not happen) rather than exiting. Not reviewed by: brooks (timeout) MFC after: 3 weeks Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Wed Jul 7 04:06:38 2010 (r209755) +++ head/sbin/dhclient/dhclient.c Wed Jul 7 06:06:54 2010 (r209756) @@ -126,7 +126,7 @@ int fork_privchld(int, int); ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) #define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len)) -time_t scripttime; +static time_t scripttime; int findproto(char *cp, int n) @@ -204,7 +204,7 @@ disassoc(void *arg) void routehandler(struct protocol *p) { - char msg[2048]; + char msg[2048], *addr; struct rt_msghdr *rtm; struct if_msghdr *ifm; struct ifa_msghdr *ifam; @@ -224,13 +224,6 @@ routehandler(struct protocol *p) switch (rtm->rtm_type) { case RTM_NEWADDR: - /* - * XXX: If someone other than us adds our address, - * we should assume they are taking over from us, - * delete the lease record, and exit without modifying - * the interface. - */ - break; case RTM_DELADDR: ifam = (struct ifa_msghdr *)rtm; @@ -243,7 +236,7 @@ routehandler(struct protocol *p) sa = get_ifa((char *)(ifam + 1), ifam->ifam_addrs); if (sa == NULL) - goto die; + break; if ((a.len = sizeof(struct in_addr)) > sizeof(a.iabuf)) error("king bula sez: len mismatch"); @@ -255,21 +248,42 @@ routehandler(struct protocol *p) if (addr_eq(a, l->address)) break; - if (l == NULL) /* deleted addr is not the one we set */ + if (l == NULL) /* added/deleted addr is not the one we set */ break; - goto die; + + addr = inet_ntoa(((struct sockaddr_in *)sa)->sin_addr); + if (rtm->rtm_type == RTM_NEWADDR) { + /* + * XXX: If someone other than us adds our address, + * should we assume they are taking over from us, + * delete the lease record, and exit without modifying + * the interface? + */ + warning("My address (%s) was re-added", addr); + } else { + warning("My address (%s) was deleted, dhclient exiting", + addr); + goto die; + } + break; case RTM_IFINFO: ifm = (struct if_msghdr *)rtm; if (ifm->ifm_index != ifi->index) break; - if ((rtm->rtm_flags & RTF_UP) == 0) + if ((rtm->rtm_flags & RTF_UP) == 0) { + warning("Interface %s is down, dhclient exiting", + ifi->name); goto die; + } break; case RTM_IFANNOUNCE: ifan = (struct if_announcemsghdr *)rtm; if (ifan->ifan_what == IFAN_DEPARTURE && - ifan->ifan_index == ifi->index) + ifan->ifan_index == ifi->index) { + warning("Interface %s is gone, dhclient exiting", + ifi->name); goto die; + } break; case RTM_IEEE80211: ifan = (struct if_announcemsghdr *)rtm; @@ -2110,8 +2124,6 @@ script_go(void) struct buf *buf; int ret; - scripttime = time(NULL); - hdr.code = IMSG_SCRIPT_GO; hdr.len = sizeof(struct imsg_hdr); @@ -2132,6 +2144,8 @@ script_go(void) error("received corrupted message"); buf_read(privfd, &ret, sizeof(ret)); + scripttime = time(NULL); + return (ret); } From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 07:09:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAF40106567B; Wed, 7 Jul 2010 07:09:33 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA76F8FC0A; Wed, 7 Jul 2010 07:09:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6779XbJ017986; Wed, 7 Jul 2010 07:09:33 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6779XnG017985; Wed, 7 Jul 2010 07:09:33 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201007070709.o6779XnG017985@svn.freebsd.org> From: Martin Matuska Date: Wed, 7 Jul 2010 07:09: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: r209757 - head/cddl/compat/opensolaris/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 07:09:33 -0000 Author: mm Date: Wed Jul 7 07:09:33 2010 New Revision: 209757 URL: http://svn.freebsd.org/changeset/base/209757 Log: - Add support for the "sec" option to "zfs set sharenfs" Submitted by: Dmitry Morozovsky Approved by: delphij (mentor) MFC after: 3 days Modified: head/cddl/compat/opensolaris/misc/fsshare.c Modified: head/cddl/compat/opensolaris/misc/fsshare.c ============================================================================== --- head/cddl/compat/opensolaris/misc/fsshare.c Wed Jul 7 06:06:54 2010 (r209756) +++ head/cddl/compat/opensolaris/misc/fsshare.c Wed Jul 7 07:09:33 2010 (r209757) @@ -110,11 +110,11 @@ getline(FILE *fd, const char *skip) * * Recognized keywords: * - * ro, maproot, mapall, mask, network, alldirs, public, webnfs, index, quiet + * ro, maproot, mapall, mask, network, sec, alldirs, public, webnfs, index, quiet * */ static const char *known_opts[] = { "ro", "maproot", "mapall", "mask", - "network", "alldirs", "public", "webnfs", "index", "quiet", NULL }; + "network", "sec", "alldirs", "public", "webnfs", "index", "quiet", NULL }; static char * translate_opts(const char *shareopts) { From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 09:23:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 779A2106566C; Wed, 7 Jul 2010 09:23:47 +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 674D08FC18; Wed, 7 Jul 2010 09:23:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o679NlEl047563; Wed, 7 Jul 2010 09:23:47 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o679NlXY047561; Wed, 7 Jul 2010 09:23:47 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201007070923.o679NlXY047561@svn.freebsd.org> From: Kevin Lo Date: Wed, 7 Jul 2010 09:23: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: r209758 - head/sys/amd64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 09:23:47 -0000 Author: kevlo Date: Wed Jul 7 09:23:46 2010 New Revision: 209758 URL: http://svn.freebsd.org/changeset/base/209758 Log: Add the u3g(4) driver. I can't find any reason why it's not here. Modified: head/sys/amd64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Wed Jul 7 07:09:33 2010 (r209757) +++ head/sys/amd64/conf/GENERIC Wed Jul 7 09:23:46 2010 (r209758) @@ -294,6 +294,7 @@ device umass # Disks/Mass storage - Re device ums # Mouse device urio # Diamond Rio 500 MP3 player # USB Serial devices +device u3g # USB-based 3G modems (Option, Huawei, Sierra) device uark # Technologies ARK3116 based serial adapters device ubsa # Belkin F5U103 and compatible serial adapters device uftdi # For FTDI usb serial adapters From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 11:19:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E87051065687; Wed, 7 Jul 2010 11:19:06 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7FE38FC20; Wed, 7 Jul 2010 11:19:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67BJ6UX073969; Wed, 7 Jul 2010 11:19:06 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67BJ6Db073967; Wed, 7 Jul 2010 11:19:06 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201007071119.o67BJ6Db073967@svn.freebsd.org> From: Randall Stewart Date: Wed, 7 Jul 2010 11:19: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: r209760 - head/lib/libc/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 11:19:07 -0000 Author: rrs Date: Wed Jul 7 11:19:06 2010 New Revision: 209760 URL: http://svn.freebsd.org/changeset/base/209760 Log: If a user calls sctp_sendx() with a NULL sinfo we will crash. Instead we should provide our own temp structure to use internally. MFC after: 1 month Modified: head/lib/libc/net/sctp_sys_calls.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Wed Jul 7 10:55:13 2010 (r209759) +++ head/lib/libc/net/sctp_sys_calls.c Wed Jul 7 11:19:06 2010 (r209760) @@ -724,6 +724,7 @@ sctp_sendx(int sd, const void *msg, size struct sctp_sndrcvinfo *sinfo, int flags) { + struct sctp_sndrcvinfo __sinfo; ssize_t ret; int i, cnt, *aa, saved_errno; char *buf; @@ -790,6 +791,10 @@ sctp_sendx(int sd, const void *msg, size return (ret); } continue_send: + if (sinfo == NULL) { + sinfo = &__sinfo; + memset(&__sinfo, 0, sizeof(__sinfo)); + } sinfo->sinfo_assoc_id = sctp_getassocid(sd, addrs); if (sinfo->sinfo_assoc_id == 0) { printf("Huh, can't get associd? TSNH!\n"); From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 12:00:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53FD7106568E; Wed, 7 Jul 2010 12:00:13 +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 30AC18FC15; Wed, 7 Jul 2010 12:00:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67C0Bpr083031; Wed, 7 Jul 2010 12:00:11 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67C0BCH083030; Wed, 7 Jul 2010 12:00:11 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201007071200.o67C0BCH083030@svn.freebsd.org> From: Attilio Rao Date: Wed, 7 Jul 2010 12: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: r209761 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 12:00:13 -0000 Author: attilio Date: Wed Jul 7 12:00:11 2010 New Revision: 209761 URL: http://svn.freebsd.org/changeset/base/209761 Log: - Simplify logic in handling ticks wrap-up - Fix a bug where thread may be in sleeping state but the wchan won't be set, leading to an empty container for sleepq_type(). [0] Sponsored by: Sandvine Incorporated [0] Submitted by: Bryan Venteicher MFC after: 3 days X-MFC: 209577 Modified: head/sys/kern/kern_clock.c Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Wed Jul 7 11:19:06 2010 (r209760) +++ head/sys/kern/kern_clock.c Wed Jul 7 12:00:11 2010 (r209761) @@ -202,8 +202,14 @@ deadlkres(void) FOREACH_PROC_IN_SYSTEM(p) { PROC_LOCK(p); FOREACH_THREAD_IN_PROC(p, td) { + + /* + * Once a thread is found in "interesting" + * state a possible ticks wrap-up needs to be + * checked. + */ thread_lock(td); - if (TD_ON_LOCK(td)) { + if (TD_ON_LOCK(td) && ticks < td->td_blktick) { /* * The thread should be blocked on a @@ -212,11 +218,6 @@ deadlkres(void) */ MPASS(td->td_blocked != NULL); - /* Handle ticks wrap-up. */ - if (ticks < td->td_blktick) { - thread_unlock(td); - continue; - } tticks = ticks - td->td_blktick; thread_unlock(td); if (tticks > blkticks) { @@ -232,13 +233,9 @@ deadlkres(void) panic("%s: possible deadlock detected for %p, blocked for %d ticks\n", __func__, td, tticks); } - } else if (TD_IS_SLEEPING(td)) { - - /* Handle ticks wrap-up. */ - if (ticks < td->td_blktick) { - thread_unlock(td); - continue; - } + } else if (TD_IS_SLEEPING(td) && + TD_ON_SLEEPQ(td) && + ticks < td->td_blktick) { /* * Check if the thread is sleeping on a From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 12:09:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B2361065670; Wed, 7 Jul 2010 12:09:00 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AD6C8FC19; Wed, 7 Jul 2010 12:09:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67C8wl4085044; Wed, 7 Jul 2010 12:08:58 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67C8wRC085042; Wed, 7 Jul 2010 12:08:58 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201007071208.o67C8wRC085042@svn.freebsd.org> From: Rui Paulo Date: Wed, 7 Jul 2010 12:08: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: r209763 - head/sys/amd64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 12:09:00 -0000 Author: rpaulo Date: Wed Jul 7 12:08:58 2010 New Revision: 209763 URL: http://svn.freebsd.org/changeset/base/209763 Log: Fix style issues with the previous commit, namely use-tab-instead-of-space and don't use underscores in macro variables. Pointed out by: bde Modified: head/sys/amd64/include/segments.h Modified: head/sys/amd64/include/segments.h ============================================================================== --- head/sys/amd64/include/segments.h Wed Jul 7 12:04:56 2010 (r209762) +++ head/sys/amd64/include/segments.h Wed Jul 7 12:08:58 2010 (r209763) @@ -74,12 +74,12 @@ struct user_segment_descriptor { u_int64_t sd_hibase:8; /* segment base address (msb) */ } __packed; -#define USD_GETBASE(_sd) (((_sd)->sd_lobase) | (_sd)->sd_hibase << 24) -#define USD_SETBASE(_sd, _b) (_sd)->sd_lobase = (_b); \ - (_sd)->sd_hibase = ((_b) >> 24); -#define USD_GETLIMIT(_sd) (((_sd)->sd_lolimit) | (_sd)->sd_hilimit << 16) -#define USD_SETLIMIT(_sd, _l) (_sd)->sd_lolimit = (_l); \ - (_sd)->sd_hilimit = ((_l) >> 16); +#define USD_GETBASE(sd) (((sd)->sd_lobase) | (sd)->sd_hibase << 24) +#define USD_SETBASE(sd, b) (sd)->sd_lobase = (b); \ + (sd)->sd_hibase = ((b) >> 24); +#define USD_GETLIMIT(sd) (((sd)->sd_lolimit) | (sd)->sd_hilimit << 16) +#define USD_SETLIMIT(sd, l) (sd)->sd_lolimit = (l); \ + (sd)->sd_hilimit = ((l) >> 16); /* * System segment descriptors (128 bit wide) From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 12:44:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8119D1065670; Wed, 7 Jul 2010 12:44:19 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57B008FC0C; Wed, 7 Jul 2010 12:44:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67CiJTc092888; Wed, 7 Jul 2010 12:44:19 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67CiJ2G092886; Wed, 7 Jul 2010 12:44:19 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201007071244.o67CiJ2G092886@svn.freebsd.org> From: Bruce Cran Date: Wed, 7 Jul 2010 12:44: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: r209764 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 12:44:19 -0000 Author: brucec Date: Wed Jul 7 12:44:19 2010 New Revision: 209764 URL: http://svn.freebsd.org/changeset/base/209764 Log: Increase the default and minimum partition sizes. Bump / to 1GB, /var to 4GB and /tmp to 1GB. A 512MB root partition is now too small to hold two kernels, so to prevent installkernel failing 1GB is a better default. Likewise, applications are storing more data in /var so 4GB is more reasonable on a modern machine. The previous minimum partition sizes were too small to hold a minimal installation, and have been adjusted accordingly. Discussed with: rwatson, simon Approved by: rrs (mentor) MFC after: 1 week Modified: head/usr.sbin/sysinstall/label.c Modified: head/usr.sbin/sysinstall/label.c ============================================================================== --- head/usr.sbin/sysinstall/label.c Wed Jul 7 12:08:58 2010 (r209763) +++ head/usr.sbin/sysinstall/label.c Wed Jul 7 12:44:19 2010 (r209764) @@ -62,9 +62,9 @@ * Minimum partition sizes */ #if defined(__ia64__) || defined(__sparc64__) || defined(__amd64__) -#define ROOT_MIN_SIZE 128 +#define ROOT_MIN_SIZE 280 #else -#define ROOT_MIN_SIZE 118 +#define ROOT_MIN_SIZE 180 #endif #define SWAP_MIN_SIZE 32 #define USR_MIN_SIZE 160 @@ -82,10 +82,10 @@ * for this configuration we scale things relative to the NOM vs DEFAULT * sizes. If the disk is larger then /home will get any remaining space. */ -#define ROOT_DEFAULT_SIZE 512 +#define ROOT_DEFAULT_SIZE 1024 #define USR_DEFAULT_SIZE 8192 -#define VAR_DEFAULT_SIZE 1024 -#define TMP_DEFAULT_SIZE 512 +#define VAR_DEFAULT_SIZE 4096 +#define TMP_DEFAULT_SIZE 1024 #define HOME_DEFAULT_SIZE USR_DEFAULT_SIZE /* @@ -93,9 +93,9 @@ * when we have insufficient disk space. If this isn't sufficient we scale * down using the MIN sizes instead. */ -#define ROOT_NOMINAL_SIZE 256 +#define ROOT_NOMINAL_SIZE 512 #define USR_NOMINAL_SIZE 1536 -#define VAR_NOMINAL_SIZE 128 +#define VAR_NOMINAL_SIZE 512 #define TMP_NOMINAL_SIZE 128 #define HOME_NOMINAL_SIZE USR_NOMINAL_SIZE From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 14:15:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D54C106564A; Wed, 7 Jul 2010 14:15:51 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CBEA8FC08; Wed, 7 Jul 2010 14:15:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67EFpjp013308; Wed, 7 Jul 2010 14:15:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67EFpdX013306; Wed, 7 Jul 2010 14:15:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007071415.o67EFpdX013306@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 7 Jul 2010 14:15:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209765 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 14:15:51 -0000 Author: nwhitehorn Date: Wed Jul 7 14:15:51 2010 New Revision: 209765 URL: http://svn.freebsd.org/changeset/base/209765 Log: MFC r209490,209492: Move default HZ from 100 to 1000 on powerpc, and rearrange the logic slightly, so that it is set to 100 on ARM and MIPS and defaults to 1000, instead of defaulting to 100, and setting it to 1000 on everything but ARM and MIPS. Reviewed by: marcel Modified: stable/8/sys/kern/subr_param.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/subr_param.c ============================================================================== --- stable/8/sys/kern/subr_param.c Wed Jul 7 12:44:19 2010 (r209764) +++ stable/8/sys/kern/subr_param.c Wed Jul 7 14:15:51 2010 (r209765) @@ -53,10 +53,10 @@ __FBSDID("$FreeBSD$"); */ #ifndef HZ -# if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || defined(__sparc64__) -# define HZ 1000 -# else +# if defined(__mips__) || defined(__arm__) # define HZ 100 +# else +# define HZ 1000 # endif # ifndef HZ_VM # define HZ_VM 100 From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 14:19:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE274106566B; Wed, 7 Jul 2010 14:19:58 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3FD48FC1E; Wed, 7 Jul 2010 14:19:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67EJw2U014256; Wed, 7 Jul 2010 14:19:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67EJwjs014254; Wed, 7 Jul 2010 14:19:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007071419.o67EJwjs014254@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 7 Jul 2010 14:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209766 - stable/8/sys/powerpc/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 14:19:59 -0000 Author: nwhitehorn Date: Wed Jul 7 14:19:58 2010 New Revision: 209766 URL: http://svn.freebsd.org/changeset/base/209766 Log: MFC r209222: Modify the console mouse pointer drawing routine to use single-byte writes instead of 4-byte ones. Because the mouse pointer can start part way through a character cell, 4-byte memory operations are not necessarily aligned, triggering a fatal alignment exception when the console pointer was moved on PowerPC G5 systems. Modified: stable/8/sys/powerpc/ofw/ofw_syscons.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/powerpc/ofw/ofw_syscons.c ============================================================================== --- stable/8/sys/powerpc/ofw/ofw_syscons.c Wed Jul 7 14:15:51 2010 (r209765) +++ stable/8/sys/powerpc/ofw/ofw_syscons.c Wed Jul 7 14:19:58 2010 (r209766) @@ -856,16 +856,11 @@ ofwfb_putm8(video_adapter_t *adp, int x, { struct ofwfb_softc *sc; int i, j, k; - uint32_t *addr; + uint8_t *addr; u_char fg, bg; - union { - uint32_t l[2]; - uint8_t c[8]; - } ch; - sc = (struct ofwfb_softc *)adp; - addr = (u_int32_t *)((int)sc->sc_addr + addr = (u_int8_t *)((int)sc->sc_addr + (y + sc->sc_ymargin)*sc->sc_stride + x + sc->sc_xmargin); @@ -874,12 +869,6 @@ ofwfb_putm8(video_adapter_t *adp, int x, for (i = 0; i < size && i+y < sc->sc_height - 2*sc->sc_ymargin; i++) { /* - * Use the current values for the line - */ - ch.l[0] = addr[0]; - ch.l[1] = addr[1]; - - /* * Calculate 2 x 4-chars at a time, and then * write these out. */ @@ -888,12 +877,10 @@ ofwfb_putm8(video_adapter_t *adp, int x, continue; if (pixel_image[i] & (1 << k)) - ch.c[j] = (ch.c[j] == fg) ? bg : fg; + addr[j] = (addr[j] == fg) ? bg : fg; } - addr[0] = ch.l[0]; - addr[1] = ch.l[1]; - addr += (sc->sc_stride / sizeof(u_int32_t)); + addr += (sc->sc_stride / sizeof(u_int8_t)); } return (0); From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 14:21:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D0C1106564A; Wed, 7 Jul 2010 14:21:41 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C3A08FC1E; Wed, 7 Jul 2010 14:21:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67ELf3m014703; Wed, 7 Jul 2010 14:21:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67ELepC014700; Wed, 7 Jul 2010 14:21:40 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007071421.o67ELepC014700@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 7 Jul 2010 14:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209767 - stable/8/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 14:21:41 -0000 Author: nwhitehorn Date: Wed Jul 7 14:21:40 2010 New Revision: 209767 URL: http://svn.freebsd.org/changeset/base/209767 Log: MFC r209114: Make SMP work on MPC7400-based Apple desktops like the PowerMac3,3. Modified: stable/8/sys/powerpc/aim/mp_cpudep.c stable/8/sys/powerpc/aim/platform_chrp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- stable/8/sys/powerpc/aim/mp_cpudep.c Wed Jul 7 14:19:58 2010 (r209766) +++ stable/8/sys/powerpc/aim/mp_cpudep.c Wed Jul 7 14:21:40 2010 (r209767) @@ -75,9 +75,21 @@ cpudep_ap_bootstrap(void) } static register_t -mpc745x_l2_enable(register_t l2cr_config) +mpc74xx_l2_enable(register_t l2cr_config) { - register_t ccr; + register_t ccr, bit; + uint16_t vers; + + vers = mfpvr() >> 16; + switch (vers) { + case MPC7400: + case MPC7410: + bit = L2CR_L2IP; + break; + default: + bit = L2CR_L2I; + break; + } ccr = mfspr(SPR_L2CR); if (ccr & L2CR_L2E) @@ -88,7 +100,7 @@ mpc745x_l2_enable(register_t l2cr_config mtspr(SPR_L2CR, ccr | L2CR_L2I); do { ccr = mfspr(SPR_L2CR); - } while (ccr & L2CR_L2I); + } while (ccr & bit); powerpc_sync(); mtspr(SPR_L2CR, l2cr_config); powerpc_sync(); @@ -129,7 +141,7 @@ mpc745x_l3_enable(register_t l3cr_config } static register_t -mpc745x_l1d_enable(void) +mpc74xx_l1d_enable(void) { register_t hid; @@ -147,7 +159,7 @@ mpc745x_l1d_enable(void) } static register_t -mpc745x_l1i_enable(void) +mpc74xx_l1i_enable(void) { register_t hid; @@ -267,9 +279,9 @@ cpudep_ap_setup() mtspr(SPR_HID0, bsp_state[0]); isync(); mtspr(SPR_HID1, bsp_state[1]); isync(); - reg = mpc745x_l2_enable(bsp_state[2]); - reg = mpc745x_l1d_enable(); - reg = mpc745x_l1i_enable(); + reg = mpc74xx_l2_enable(bsp_state[2]); + reg = mpc74xx_l1d_enable(); + reg = mpc74xx_l1i_enable(); break; default: Modified: stable/8/sys/powerpc/aim/platform_chrp.c ============================================================================== --- stable/8/sys/powerpc/aim/platform_chrp.c Wed Jul 7 14:19:58 2010 (r209766) +++ stable/8/sys/powerpc/aim/platform_chrp.c Wed Jul 7 14:21:40 2010 (r209767) @@ -228,8 +228,26 @@ chrp_smp_start_cpu(platform_t plat, stru cpu = pc->pc_hwref; res = OF_getprop(cpu, "soft-reset", &reset, sizeof(reset)); - if (res < 0) - return (ENXIO); + if (res < 0) { + reset = 0x58; + + switch (pc->pc_cpuid) { + case 0: + reset += 0x03; + break; + case 1: + reset += 0x04; + break; + case 2: + reset += 0x0f; + break; + case 4: + reset += 0x10; + break; + default: + return (ENXIO); + } + } ap_pcpu = pc; @@ -239,10 +257,12 @@ chrp_smp_start_cpu(platform_t plat, stru rstvec = rstvec_virtbase + reset; *rstvec = 4; + powerpc_sync(); (void)(*rstvec); powerpc_sync(); DELAY(1); *rstvec = 0; + powerpc_sync(); (void)(*rstvec); powerpc_sync(); From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 14:24:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17AFD1065670; Wed, 7 Jul 2010 14:24:49 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E27BC8FC1C; Wed, 7 Jul 2010 14:24:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67EOm4k015420; Wed, 7 Jul 2010 14:24:48 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67EOmo3015419; Wed, 7 Jul 2010 14:24:48 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201007071424.o67EOmo3015419@svn.freebsd.org> From: Rui Paulo Date: Wed, 7 Jul 2010 14:24:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-cddl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209768 - vendor-cddl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 14:24:49 -0000 Author: rpaulo Date: Wed Jul 7 14:24:48 2010 New Revision: 209768 URL: http://svn.freebsd.org/changeset/base/209768 Log: As per discussion in freebsd-arch, remove the vendor-cddl tree. Deleted: vendor-cddl/ From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 15:05:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92F4C1065670; Wed, 7 Jul 2010 15:05:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B1498FC0A; Wed, 7 Jul 2010 15:05:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67F5ivA024422; Wed, 7 Jul 2010 15:05:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67F5iMV024420; Wed, 7 Jul 2010 15:05:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201007071505.o67F5iMV024420@svn.freebsd.org> From: Adrian Chadd Date: Wed, 7 Jul 2010 15:05: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: r209769 - head/sys/mips/atheros X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 15:05:44 -0000 Author: adrian Date: Wed Jul 7 15:05:44 2010 New Revision: 209769 URL: http://svn.freebsd.org/changeset/base/209769 Log: Fix the CS line definitions. These bits are for the CS2/CS1 lines rather than CS1/CS0. This has been tested on the Ubiqiti Routerstation Pro board. Modified: head/sys/mips/atheros/ar71xxreg.h Modified: head/sys/mips/atheros/ar71xxreg.h ============================================================================== --- head/sys/mips/atheros/ar71xxreg.h Wed Jul 7 14:24:48 2010 (r209768) +++ head/sys/mips/atheros/ar71xxreg.h Wed Jul 7 15:05:44 2010 (r209769) @@ -151,10 +151,10 @@ #define AR71XX_GPIO_FUNCTION 0x28 #define GPIO_FUNC_STEREO_EN (1 << 17) #define GPIO_FUNC_SLIC_EN (1 << 16) -#define GPIO_FUNC_SPI_CS1_EN (1 << 15) - /* CS1 is shared with GPIO_1 */ -#define GPIO_FUNC_SPI_CS0_EN (1 << 14) - /* CS0 is shared with GPIO_0 */ +#define GPIO_FUNC_SPI_CS2_EN (1 << 15) + /* CS2 is shared with GPIO_1 */ +#define GPIO_FUNC_SPI_CS1_EN (1 << 14) + /* CS1 is shared with GPIO_0 */ #define GPIO_FUNC_SPI_EN (1 << 13) #define GPIO_FUNC_UART_EN (1 << 8) #define GPIO_FUNC_USB_OC_EN (1 << 4) From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 17:05:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C3601065673; Wed, 7 Jul 2010 17:05:32 +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 4A3338FC14; Wed, 7 Jul 2010 17:05:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67H5WEK050774; Wed, 7 Jul 2010 17:05:32 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67H5WHv050772; Wed, 7 Jul 2010 17:05:32 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201007071705.o67H5WHv050772@svn.freebsd.org> From: Ken Smith Date: Wed, 7 Jul 2010 17:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209770 - stable/8/release/scripts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 17:05:32 -0000 Author: kensmith Date: Wed Jul 7 17:05:32 2010 New Revision: 209770 URL: http://svn.freebsd.org/changeset/base/209770 Log: Package set for 8.1-RELEASE. We still have a 2Gb maximum file size limit caused by cvsup still being used for some of our mirror system. That is being worked on. Reviewed by: re@, portmgr@ Modified: stable/8/release/scripts/package-split.py Modified: stable/8/release/scripts/package-split.py ============================================================================== --- stable/8/release/scripts/package-split.py Wed Jul 7 15:05:44 2010 (r209769) +++ stable/8/release/scripts/package-split.py Wed Jul 7 17:05:32 2010 (r209770) @@ -52,52 +52,21 @@ def disc1_packages(): if doing_dvd: pkgs.extend(['archivers/unzip', - 'astro/xearth', - 'devel/gmake', - 'devel/imake', - 'editors/emacs', - 'editors/vim-lite', 'emulators/linux_base-f10', - 'emulators/mtools', - 'graphics/png', - 'graphics/xv', - 'irc/xchat', - 'lang/perl5.8', - 'mail/alpine', - 'mail/exim', - 'mail/fetchmail', - 'mail/mutt', - 'mail/popd', - 'mail/postfix', - 'mail/xfmail', - 'net/cvsup-without-gui', + 'lang/perl5.10', + 'net/mpd5', 'net/rsync', - 'net/samba3', - 'news/slrn', - 'news/tin', 'ports-mgmt/p5-FreeBSD-Portindex', 'ports-mgmt/portaudit', 'ports-mgmt/portmaster', 'ports-mgmt/portupgrade', - 'print/a2ps-letter', - 'print/apsfilter', - 'print/ghostscript7-nox11', - 'print/psutils-letter', - 'print/gv', 'shells/bash', - 'shells/pdksh', 'shells/zsh', 'security/sudo', 'sysutils/screen', - 'www/links', - 'www/lynx', 'x11/gnome2', 'x11/kde4', - 'x11/rxvt', - 'x11/xorg', - 'x11-wm/afterstep', - 'x11-wm/fvwm2', - 'x11-wm/windowmaker']) + 'x11/xorg']) return pkgs # The list of desired packages From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 17:20:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3BE31065672; Wed, 7 Jul 2010 17:20:16 +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 E18E58FC1A; Wed, 7 Jul 2010 17:20:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67HKGtE054087; Wed, 7 Jul 2010 17:20:16 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67HKGfT054085; Wed, 7 Jul 2010 17:20:16 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201007071720.o67HKGfT054085@svn.freebsd.org> From: Ken Smith Date: Wed, 7 Jul 2010 17:20:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209771 - in releng/8.1/release: picobsd/floppy.tree/sbin scripts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 17:20:17 -0000 Author: kensmith Date: Wed Jul 7 17:20:16 2010 New Revision: 209771 URL: http://svn.freebsd.org/changeset/base/209771 Log: Merge r209770 from stable/8: > Package set for 8.1-RELEASE. We still have a 2Gb maximum file size > limit caused by cvsup still being used for some of our mirror system. > That is being worked on. Reviewed by: re@, portmgr@ Approved by: re (implicit) Modified: releng/8.1/release/scripts/package-split.py Directory Properties: releng/8.1/release/ (props changed) releng/8.1/release/doc/en_US.ISO8859-1/hardware/ (props changed) releng/8.1/release/picobsd/ (props changed) releng/8.1/release/picobsd/floppy.tree/sbin/ (props changed) releng/8.1/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) releng/8.1/release/picobsd/qemu/ (props changed) Modified: releng/8.1/release/scripts/package-split.py ============================================================================== --- releng/8.1/release/scripts/package-split.py Wed Jul 7 17:05:32 2010 (r209770) +++ releng/8.1/release/scripts/package-split.py Wed Jul 7 17:20:16 2010 (r209771) @@ -52,52 +52,21 @@ def disc1_packages(): if doing_dvd: pkgs.extend(['archivers/unzip', - 'astro/xearth', - 'devel/gmake', - 'devel/imake', - 'editors/emacs', - 'editors/vim-lite', 'emulators/linux_base-f10', - 'emulators/mtools', - 'graphics/png', - 'graphics/xv', - 'irc/xchat', - 'lang/perl5.8', - 'mail/alpine', - 'mail/exim', - 'mail/fetchmail', - 'mail/mutt', - 'mail/popd', - 'mail/postfix', - 'mail/xfmail', - 'net/cvsup-without-gui', + 'lang/perl5.10', + 'net/mpd5', 'net/rsync', - 'net/samba3', - 'news/slrn', - 'news/tin', 'ports-mgmt/p5-FreeBSD-Portindex', 'ports-mgmt/portaudit', 'ports-mgmt/portmaster', 'ports-mgmt/portupgrade', - 'print/a2ps-letter', - 'print/apsfilter', - 'print/ghostscript7-nox11', - 'print/psutils-letter', - 'print/gv', 'shells/bash', - 'shells/pdksh', 'shells/zsh', 'security/sudo', 'sysutils/screen', - 'www/links', - 'www/lynx', 'x11/gnome2', 'x11/kde4', - 'x11/rxvt', - 'x11/xorg', - 'x11-wm/afterstep', - 'x11-wm/fvwm2', - 'x11-wm/windowmaker']) + 'x11/xorg']) return pkgs # The list of desired packages From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 17:44:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 428EB106566B; Wed, 7 Jul 2010 17:44:10 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3115E8FC0A; Wed, 7 Jul 2010 17:44:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67Hi9rc059464; Wed, 7 Jul 2010 17:44:09 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67Hi9IU059462; Wed, 7 Jul 2010 17:44:09 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201007071744.o67Hi9IU059462@svn.freebsd.org> From: Benedict Reuschling Date: Wed, 7 Jul 2010 17:44: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: r209772 - head/usr.bin/getopt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 17:44:10 -0000 Author: bcr (doc committer) Date: Wed Jul 7 17:44:09 2010 New Revision: 209772 URL: http://svn.freebsd.org/changeset/base/209772 Log: Fix an error in the EXAMPLES section of getopt(1), which is based on the same fix present in NetBSD. Note: the getopt man page contains more antique information like this. An overhaul of the man page and/or sync with NetBSD would be the right thing to do. But since this is out of the scope of the PR, I'll leave it as it is for now. PR: docs/133118 Submitted by: Oleg A. Mamontov (oleg at mamontov dot net) Discussed with: jilles@ MFC after: 2 weeks Modified: head/usr.bin/getopt/getopt.1 Modified: head/usr.bin/getopt/getopt.1 ============================================================================== --- head/usr.bin/getopt/getopt.1 Wed Jul 7 17:20:16 2010 (r209771) +++ head/usr.bin/getopt/getopt.1 Wed Jul 7 17:44:09 2010 (r209772) @@ -1,6 +1,6 @@ .\" $FreeBSD$ .\" -.Dd April 3, 1999 +.Dd July 7, 2010 .Dt GETOPT 1 .Os .Sh NAME @@ -64,9 +64,9 @@ set \-\- $args # You cannot use the set command with a backquoted getopt directly, # since the exit code from getopt would be shadowed by those of set, # which is zero by definition. -for i +while true; do - case "$i" + case "$1" in \-a|\-b) echo flag $i set; sflags="${i#-}$sflags"; From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 17:48:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDF4010656CC for ; Wed, 7 Jul 2010 17:48:41 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 850A08FC1D for ; Wed, 7 Jul 2010 17:48:41 +0000 (UTC) Received: (qmail 27502 invoked by uid 399); 7 Jul 2010 17:48:40 -0000 Received: from localhost (HELO ?192.168.0.142?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 7 Jul 2010 17:48:40 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C34BDF7.1020201@FreeBSD.org> Date: Wed, 07 Jul 2010 10:48:39 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: Benedict Reuschling References: <201007071744.o67Hi9IU059462@svn.freebsd.org> In-Reply-To: <201007071744.o67Hi9IU059462@svn.freebsd.org> X-Enigmail-Version: 1.1 OpenPGP: id=1A1ABC84 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: r209772 - head/usr.bin/getopt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 17:48:42 -0000 On 7/7/2010 10:44 AM, Benedict Reuschling wrote: > Author: bcr (doc committer) > -for i > +while true; > do If this is intended to be an sh scripting example a better way to write that is: while : ; You can't guarantee that "true" will always be available and do what you expect, whereas the ':' operator is a shell builtin. hth, Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 17:52:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94C16106566B; Wed, 7 Jul 2010 17:52:13 +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 835278FC16; Wed, 7 Jul 2010 17:52:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67HqDSg061334; Wed, 7 Jul 2010 17:52:13 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67HqDlp061332; Wed, 7 Jul 2010 17:52:13 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201007071752.o67HqDlp061332@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 7 Jul 2010 17:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209773 - releng/8.1/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 17:52:13 -0000 Author: bz Date: Wed Jul 7 17:52:13 2010 New Revision: 209773 URL: http://svn.freebsd.org/changeset/base/209773 Log: MFC r207303 (originally by kmacy): need to initialize the lock before it is used Reported on: stable@ (MFC missing) Approved by: re (kensmith) Modified: releng/8.1/sys/net/flowtable.c Directory Properties: releng/8.1/sys/ (props changed) releng/8.1/sys/amd64/include/xen/ (props changed) releng/8.1/sys/cddl/contrib/opensolaris/ (props changed) releng/8.1/sys/contrib/dev/acpica/ (props changed) releng/8.1/sys/contrib/pf/ (props changed) releng/8.1/sys/dev/ixgbe/ (props changed) releng/8.1/sys/dev/xen/xenpci/ (props changed) releng/8.1/sys/geom/sched/ (props changed) Modified: releng/8.1/sys/net/flowtable.c ============================================================================== --- releng/8.1/sys/net/flowtable.c Wed Jul 7 17:44:09 2010 (r209772) +++ releng/8.1/sys/net/flowtable.c Wed Jul 7 17:52:13 2010 (r209773) @@ -1626,7 +1626,7 @@ flowtable_init(const void *unused __unus EVENTHANDLER_PRI_ANY); flowclean_freq = 20*hz; } -SYSINIT(flowtable_init, SI_SUB_SMP, SI_ORDER_MIDDLE, +SYSINIT(flowtable_init, SI_SUB_KTHREAD_INIT, SI_ORDER_FIRST, flowtable_init, NULL); From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 17:59:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02C9F106566B; Wed, 7 Jul 2010 17:59:07 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id CFA6C8FC1F; Wed, 7 Jul 2010 17:59:05 +0000 (UTC) Received: by ewy26 with SMTP id 26so2387380ewy.13 for ; Wed, 07 Jul 2010 10:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=z0Hg9ac6VkV8eitIx4jhkMftcF19bkFh0qvNkKkgkZw=; b=qvBZAO9DecBHQrm/4Lwcq8jRSqLErkX5AgzEMePBx15KpmOFGPRQjZa24d3TeQVhVG ntEbQZroOzJzwm7JvGl7/1dOd6/bP7y29g1Hn53E6Y8a1BaYnlA/3+I0TZu9uZu8EEmo xubTSxA4hA5VLFVJ481/pZD7KXOFMNjuqUzyY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=D/lCiZu26A8psUUCOK9FDyvA+cBkOj6UuW1uJi37hrwSNJkO1ZeG0IO4XyQDkQmSAf u7yhXR17off00EW+lmkwxPh1G+BycI1C8cP2bqRfeRMAtGjqOiv6W7OPLLLM3K5c1SdM XQVJJkXeMp/7HLGdHNU+M/Q1L0GStmqdxxgNU= Received: by 10.213.2.132 with SMTP id 4mr5941280ebj.94.1278525542340; Wed, 07 Jul 2010 10:59:02 -0700 (PDT) Received: from localhost ([80.90.43.159]) by mx.google.com with ESMTPS id v59sm63213268eeh.4.2010.07.07.10.58.56 (version=SSLv3 cipher=RC4-MD5); Wed, 07 Jul 2010 10:59:00 -0700 (PDT) From: Anonymous To: Doug Barton References: <201007071744.o67Hi9IU059462@svn.freebsd.org> <4C34BDF7.1020201__3943.14767695523$1278525000$gmane$org@FreeBSD.org> Date: Wed, 07 Jul 2010 21:58:53 +0400 In-Reply-To: <4C34BDF7.1020201__3943.14767695523$1278525000$gmane$org@FreeBSD.org> (Doug Barton's message of "Wed, 07 Jul 2010 10:48:39 -0700") Message-ID: <86zky3897m.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Benedict Reuschling , src-committers@freebsd.org Subject: Re: svn commit: r209772 - head/usr.bin/getopt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 17:59:07 -0000 Doug Barton writes: > On 7/7/2010 10:44 AM, Benedict Reuschling wrote: >> Author: bcr (doc committer) > >> -for i >> +while true; >> do > > If this is intended to be an sh scripting example a better way to write > that is: > > while : ; > > You can't guarantee that "true" will always be available and do what you > expect, whereas the ':' operator is a shell builtin. Isn't `true' shell builtin as well? $ type true true is a shell builtin From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 18:44:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6D841065675; Wed, 7 Jul 2010 18:44:55 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 011D88FC1A; Wed, 7 Jul 2010 18:44:54 +0000 (UTC) Received: by wwi18 with SMTP id 18so1439164wwi.31 for ; Wed, 07 Jul 2010 11:44:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Y9gdj2oa82PJu9ENXk3wGfnKMbfgvszx3kS72GnyJZ0=; b=Bx8IlbvVqgvfSKa5NgZoVeolmszXX3+XziUsyKFm0g9eLCOIxJ/NIs0sukUBs2qN6r Xo9uYZcF5TCyWtQ2VPAqfKySWCprTJW9xFtSQeLRmAmJj7FAbFmJTm7K5cD6m0/mJ9lZ ZKlgnHjwRtJ0HXpnDfH4h+OfSwgW7SS5BA/DY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=CxZ6+ZcQ+HoGPUxuX5uQOXvMwyN7WcsEfjJdgkLIFLkTWvOzEbY2DMgdcIUIbyvjpv DYOZ/3yE9mHW65xKgvGK2t+mcFAYXRXBIYaNohuMGCS7GKbIA7Wq3lV4pVS6i3blgBMw jaZ4qFmRLAhvvd5s7tCbUqOEwgz4cLeckxoYE= MIME-Version: 1.0 Received: by 10.227.158.16 with SMTP id d16mr5483719wbx.3.1278528289619; Wed, 07 Jul 2010 11:44:49 -0700 (PDT) Received: by 10.216.37.68 with HTTP; Wed, 7 Jul 2010 11:44:49 -0700 (PDT) In-Reply-To: <201007071752.o67HqDlp061332@svn.freebsd.org> References: <201007071752.o67HqDlp061332@svn.freebsd.org> Date: Wed, 7 Jul 2010 22:44:49 +0400 Message-ID: From: pluknet To: "Bjoern A. Zeeb" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-releng@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209773 - releng/8.1/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 18:44:56 -0000 On 7 July 2010 21:52, Bjoern A. Zeeb wrote: > Author: bz > Date: Wed Jul =A07 17:52:13 2010 > New Revision: 209773 > URL: http://svn.freebsd.org/changeset/base/209773 > > Log: > =A0MFC r207303 (originally by kmacy): > > =A0 =A0need to initialize the lock before it is used > > =A0 =A0Reported on: =A0stable@ (MFC missing) > > =A0Approved by: =A0re (kensmith) > > Modified: > =A0releng/8.1/sys/net/flowtable.c > Directory Properties: > =A0releng/8.1/sys/ =A0 (props changed) > =A0releng/8.1/sys/amd64/include/xen/ =A0 (props changed) > =A0releng/8.1/sys/cddl/contrib/opensolaris/ =A0 (props changed) > =A0releng/8.1/sys/contrib/dev/acpica/ =A0 (props changed) > =A0releng/8.1/sys/contrib/pf/ =A0 (props changed) > =A0releng/8.1/sys/dev/ixgbe/ =A0 (props changed) > =A0releng/8.1/sys/dev/xen/xenpci/ =A0 (props changed) > =A0releng/8.1/sys/geom/sched/ =A0 (props changed) > > Modified: releng/8.1/sys/net/flowtable.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 > --- releng/8.1/sys/net/flowtable.c =A0 =A0 =A0Wed Jul =A07 17:44:09 2010 = =A0 =A0 =A0 =A0(r209772) > +++ releng/8.1/sys/net/flowtable.c =A0 =A0 =A0Wed Jul =A07 17:52:13 2010 = =A0 =A0 =A0 =A0(r209773) > @@ -1626,7 +1626,7 @@ flowtable_init(const void *unused __unus > =A0 =A0 =A0 =A0 =A0 =A0EVENTHANDLER_PRI_ANY); > =A0 =A0 =A0 =A0flowclean_freq =3D 20*hz; > =A0} > -SYSINIT(flowtable_init, SI_SUB_SMP, SI_ORDER_MIDDLE, > +SYSINIT(flowtable_init, SI_SUB_KTHREAD_INIT, SI_ORDER_FIRST, > =A0 =A0 flowtable_init, NULL); > > Thanks! --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 19:06:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C246106566C; Wed, 7 Jul 2010 19:06: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 01DAE8FC1B; Wed, 7 Jul 2010 19:06:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67J6rvQ077943; Wed, 7 Jul 2010 19:06:53 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67J6rSL077940; Wed, 7 Jul 2010 19:06:53 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201007071906.o67J6rSL077940@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 7 Jul 2010 19:06: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: r209774 - in head/sys/boot/ia64: common efi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 19:06:54 -0000 Author: marcel Date: Wed Jul 7 19:06:53 2010 New Revision: 209774 URL: http://svn.freebsd.org/changeset/base/209774 Log: Use the kernel's start address to determine what to map. This allows us to link the kernel at different addresses without needing to build a corresponding loader. Modified: head/sys/boot/ia64/common/exec.c head/sys/boot/ia64/efi/version Modified: head/sys/boot/ia64/common/exec.c ============================================================================== --- head/sys/boot/ia64/common/exec.c Wed Jul 7 17:52:13 2010 (r209773) +++ head/sys/boot/ia64/common/exec.c Wed Jul 7 19:06:53 2010 (r209774) @@ -106,11 +106,12 @@ elf64_exec(struct preloaded_file *fp) pte = PTE_PRESENT | PTE_MA_WB | PTE_ACCESSED | PTE_DIRTY | PTE_PL_KERN | PTE_AR_RWX | PTE_ED; + pte |= IA64_RR_MASK(hdr->e_entry) & PTE_PPN_MASK; - __asm __volatile("mov cr.ifa=%0" :: "r"(IA64_RR_BASE(7))); + __asm __volatile("mov cr.ifa=%0" :: "r"(hdr->e_entry)); __asm __volatile("mov cr.itir=%0" :: "r"(28 << 2)); - __asm __volatile("ptr.i %0,%1" :: "r"(IA64_RR_BASE(7)), "r"(28<<2)); - __asm __volatile("ptr.d %0,%1" :: "r"(IA64_RR_BASE(7)), "r"(28<<2)); + __asm __volatile("ptr.i %0,%1" :: "r"(hdr->e_entry), "r"(28<<2)); + __asm __volatile("ptr.d %0,%1" :: "r"(hdr->e_entry), "r"(28<<2)); __asm __volatile("srlz.i;;"); __asm __volatile("itr.i itr[%0]=%1;;" :: "r"(0), "r"(pte)); __asm __volatile("srlz.i;;"); Modified: head/sys/boot/ia64/efi/version ============================================================================== --- head/sys/boot/ia64/efi/version Wed Jul 7 17:52:13 2010 (r209773) +++ head/sys/boot/ia64/efi/version Wed Jul 7 19:06:53 2010 (r209774) @@ -3,6 +3,8 @@ $FreeBSD$ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this file is important. Make sure the current version number is on line 6. +2.2: Create direct mapping based on start address instead of mapping + first 256M. 2.1: Add support for "-dev " argument parsing. 2.0: Provide devices based on the block I/O protocol, rather than the simple file services protocol. Use the FreeBSD file system code From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 19:34:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C91310656C3; Wed, 7 Jul 2010 19:34: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 8BA018FC23; Wed, 7 Jul 2010 19:34:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67JYmIx084115; Wed, 7 Jul 2010 19:34:48 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67JYmGK084113; Wed, 7 Jul 2010 19:34:48 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201007071934.o67JYmGK084113@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 7 Jul 2010 19:34: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: r209775 - head/sys/ia64/ia64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 19:34:48 -0000 Author: marcel Date: Wed Jul 7 19:34:48 2010 New Revision: 209775 URL: http://svn.freebsd.org/changeset/base/209775 Log: Remove pointless BOOTP conditional. Modified: head/sys/ia64/ia64/autoconf.c Modified: head/sys/ia64/ia64/autoconf.c ============================================================================== --- head/sys/ia64/ia64/autoconf.c Wed Jul 7 19:06:53 2010 (r209774) +++ head/sys/ia64/ia64/autoconf.c Wed Jul 7 19:34:48 2010 (r209775) @@ -26,7 +26,6 @@ * $FreeBSD$ */ -#include "opt_bootp.h" #include "opt_isa.h" #include @@ -53,10 +52,6 @@ SYSINIT(configure2, SI_SUB_CONFIGURE, SI /* SI_ORDER_MIDDLE is hookable */ SYSINIT(configure3, SI_SUB_CONFIGURE, SI_ORDER_ANY, configure_final, NULL); -#ifdef BOOTP -void bootpc_init(void); -#endif - #ifdef DEV_ISA #include device_t isa_bus_device = 0; From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 19:52:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB26E1065675; Wed, 7 Jul 2010 19:52:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D964D8FC1D; Wed, 7 Jul 2010 19:52:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67JqoGP088157; Wed, 7 Jul 2010 19:52:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67JqomM088155; Wed, 7 Jul 2010 19:52:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201007071952.o67JqomM088155@svn.freebsd.org> From: Marius Strobl Date: Wed, 7 Jul 2010 19:52:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209776 - stable/8/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 19:52:51 -0000 Author: marius Date: Wed Jul 7 19:52:50 2010 New Revision: 209776 URL: http://svn.freebsd.org/changeset/base/209776 Log: MFC: r209695 - Pin the IPI cache and TLB demap functions in order to prevent migration between determining the other CPUs and calling cpu_ipi_selected(), which apart from generally doing the wrong thing can lead to a panic when a CPU is told to IPI itself (which sun4u doesn't support). Reported and tested by: Nathaniel W Filardo - Add __unused where appropriate. Modified: stable/8/sys/sparc64/include/smp.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/include/smp.h ============================================================================== --- stable/8/sys/sparc64/include/smp.h Wed Jul 7 19:34:48 2010 (r209775) +++ stable/8/sys/sparc64/include/smp.h Wed Jul 7 19:52:50 2010 (r209776) @@ -38,6 +38,9 @@ #ifndef LOCORE +#include +#include + #include #include #include @@ -139,6 +142,7 @@ ipi_dcache_page_inval(void *func, vm_pad if (smp_cpus == 1) return (NULL); + sched_pin(); ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); ica->ica_mask = all_cpus; @@ -154,6 +158,7 @@ ipi_icache_page_inval(void *func, vm_pad if (smp_cpus == 1) return (NULL); + sched_pin(); ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); ica->ica_mask = all_cpus; @@ -170,8 +175,11 @@ ipi_tlb_context_demap(struct pmap *pm) if (smp_cpus == 1) return (NULL); - if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) + sched_pin(); + if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) { + sched_unpin(); return (NULL); + } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus | PCPU_GET(cpumask); @@ -189,8 +197,11 @@ ipi_tlb_page_demap(struct pmap *pm, vm_o if (smp_cpus == 1) return (NULL); - if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) + sched_pin(); + if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) { + sched_unpin(); return (NULL); + } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus | PCPU_GET(cpumask); @@ -208,8 +219,11 @@ ipi_tlb_range_demap(struct pmap *pm, vm_ if (smp_cpus == 1) return (NULL); - if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) + sched_pin(); + if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) { + sched_unpin(); return (NULL); + } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus | PCPU_GET(cpumask); @@ -230,6 +244,7 @@ ipi_wait(void *cookie) while (*mask != 0) ; mtx_unlock_spin(&ipi_mtx); + sched_unpin(); } } @@ -242,35 +257,36 @@ ipi_wait(void *cookie) #ifndef LOCORE static __inline void * -ipi_dcache_page_inval(void *func, vm_paddr_t pa) +ipi_dcache_page_inval(void *func __unused, vm_paddr_t pa __unused) { return (NULL); } static __inline void * -ipi_icache_page_inval(void *func, vm_paddr_t pa) +ipi_icache_page_inval(void *func __unused, vm_paddr_t pa __unused) { return (NULL); } static __inline void * -ipi_tlb_context_demap(struct pmap *pm) +ipi_tlb_context_demap(struct pmap *pm __unused) { return (NULL); } static __inline void * -ipi_tlb_page_demap(struct pmap *pm, vm_offset_t va) +ipi_tlb_page_demap(struct pmap *pm __unused, vm_offset_t va __unused) { return (NULL); } static __inline void * -ipi_tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end) +ipi_tlb_range_demap(struct pmap *pm __unused, vm_offset_t start __unused, + __unused vm_offset_t end) { return (NULL); From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 19:52:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 520C710656E8; Wed, 7 Jul 2010 19:52:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 112668FC15; Wed, 7 Jul 2010 19:52:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67JqvOu088227; Wed, 7 Jul 2010 19:52:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67JqvbH088225; Wed, 7 Jul 2010 19:52:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201007071952.o67JqvbH088225@svn.freebsd.org> From: Marius Strobl Date: Wed, 7 Jul 2010 19:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209777 - stable/7/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 19:52:59 -0000 Author: marius Date: Wed Jul 7 19:52:57 2010 New Revision: 209777 URL: http://svn.freebsd.org/changeset/base/209777 Log: MFC: r209695 - Pin the IPI cache and TLB demap functions in order to prevent migration between determining the other CPUs and calling cpu_ipi_selected(), which apart from generally doing the wrong thing can lead to a panic when a CPU is told to IPI itself (which sun4u doesn't support). Reported and tested by: Nathaniel W Filardo - Add __unused where appropriate. Modified: stable/7/sys/sparc64/include/smp.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/smp.h ============================================================================== --- stable/7/sys/sparc64/include/smp.h Wed Jul 7 19:52:50 2010 (r209776) +++ stable/7/sys/sparc64/include/smp.h Wed Jul 7 19:52:57 2010 (r209777) @@ -38,6 +38,9 @@ #ifndef LOCORE +#include +#include + #include #include #include @@ -138,6 +141,7 @@ ipi_dcache_page_inval(void *func, vm_pad if (smp_cpus == 1) return (NULL); + sched_pin(); ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); ica->ica_mask = all_cpus; @@ -153,6 +157,7 @@ ipi_icache_page_inval(void *func, vm_pad if (smp_cpus == 1) return (NULL); + sched_pin(); ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); ica->ica_mask = all_cpus; @@ -169,8 +174,11 @@ ipi_tlb_context_demap(struct pmap *pm) if (smp_cpus == 1) return (NULL); - if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) + sched_pin(); + if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) { + sched_unpin(); return (NULL); + } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus | PCPU_GET(cpumask); @@ -188,8 +196,11 @@ ipi_tlb_page_demap(struct pmap *pm, vm_o if (smp_cpus == 1) return (NULL); - if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) + sched_pin(); + if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) { + sched_unpin(); return (NULL); + } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus | PCPU_GET(cpumask); @@ -207,8 +218,11 @@ ipi_tlb_range_demap(struct pmap *pm, vm_ if (smp_cpus == 1) return (NULL); - if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) + sched_pin(); + if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) { + sched_unpin(); return (NULL); + } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus | PCPU_GET(cpumask); @@ -229,6 +243,7 @@ ipi_wait(void *cookie) while (*mask != 0) ; mtx_unlock_spin(&ipi_mtx); + sched_unpin(); } } @@ -241,35 +256,36 @@ ipi_wait(void *cookie) #ifndef LOCORE static __inline void * -ipi_dcache_page_inval(void *func, vm_paddr_t pa) +ipi_dcache_page_inval(void *func __unused, vm_paddr_t pa __unused) { return (NULL); } static __inline void * -ipi_icache_page_inval(void *func, vm_paddr_t pa) +ipi_icache_page_inval(void *func __unused, vm_paddr_t pa __unused) { return (NULL); } static __inline void * -ipi_tlb_context_demap(struct pmap *pm) +ipi_tlb_context_demap(struct pmap *pm __unused) { return (NULL); } static __inline void * -ipi_tlb_page_demap(struct pmap *pm, vm_offset_t va) +ipi_tlb_page_demap(struct pmap *pm __unused, vm_offset_t va __unused) { return (NULL); } static __inline void * -ipi_tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end) +ipi_tlb_range_demap(struct pmap *pm __unused, vm_offset_t start __unused, + __unused vm_offset_t end) { return (NULL); From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 20:06:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28DCF1065670; Wed, 7 Jul 2010 20:06:49 +0000 (UTC) (envelope-from randi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1866C8FC15; Wed, 7 Jul 2010 20:06:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67K6mwn091336; Wed, 7 Jul 2010 20:06:48 GMT (envelope-from randi@svn.freebsd.org) Received: (from randi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67K6mps091334; Wed, 7 Jul 2010 20:06:48 GMT (envelope-from randi@svn.freebsd.org) Message-Id: <201007072006.o67K6mps091334@svn.freebsd.org> From: Randi Harper Date: Wed, 7 Jul 2010 20:06: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: r209778 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 20:06:49 -0000 Author: randi Date: Wed Jul 7 20:06:48 2010 New Revision: 209778 URL: http://svn.freebsd.org/changeset/base/209778 Log: Add further documentation for netDev in install.cfg to reflect the new usage. Approved by: cperciva (mentor) MFC after: 3 days Modified: head/usr.sbin/sysinstall/install.cfg Modified: head/usr.sbin/sysinstall/install.cfg ============================================================================== --- head/usr.sbin/sysinstall/install.cfg Wed Jul 7 19:52:57 2010 (r209777) +++ head/usr.sbin/sysinstall/install.cfg Wed Jul 7 20:06:48 2010 (r209778) @@ -20,6 +20,7 @@ netmask=255.255.255.240 ################################ # Which installation device to use - ftp is pointed directly at my local # machine and the installation device is my WD8013 ethernet interface. +# netDev can be set to ANY or a comma-delimited list of interfaces. _ftpPath=ftp://time.cdrom.com/pub netDev=ed0 mediaSetFTP From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 20:07:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C87A81065675; Wed, 7 Jul 2010 20:07:33 +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 9E3168FC0C; Wed, 7 Jul 2010 20:07:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67K7X5e091538; Wed, 7 Jul 2010 20:07:33 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67K7Xj2091535; Wed, 7 Jul 2010 20:07:33 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201007072007.o67K7Xj2091535@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 7 Jul 2010 20:07: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: r209779 - in head/sys/ia64: acpica include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 20:07:33 -0000 Author: marcel Date: Wed Jul 7 20:07:33 2010 New Revision: 209779 URL: http://svn.freebsd.org/changeset/base/209779 Log: Add acpi_find_table() -- a convenience function for looking up an ACPI table given the signature. Modified: head/sys/ia64/acpica/acpi_machdep.c head/sys/ia64/include/md_var.h Modified: head/sys/ia64/acpica/acpi_machdep.c ============================================================================== --- head/sys/ia64/acpica/acpi_machdep.c Wed Jul 7 20:06:48 2010 (r209778) +++ head/sys/ia64/acpica/acpi_machdep.c Wed Jul 7 20:07:33 2010 (r209779) @@ -28,11 +28,12 @@ #include #include +#include +#include #include - +#include #include -#include int acpi_machdep_init(device_t dev) @@ -57,3 +58,37 @@ acpi_cpu_c1() { ia64_call_pal_static(PAL_HALT_LIGHT, 0, 0, 0); } + +void * +acpi_find_table(const char *sig) +{ + ACPI_PHYSICAL_ADDRESS rsdp_ptr; + ACPI_TABLE_RSDP *rsdp; + ACPI_TABLE_XSDT *xsdt; + ACPI_TABLE_HEADER *table; + UINT64 addr; + u_int i, count; + + if ((rsdp_ptr = AcpiOsGetRootPointer()) == 0) + return (NULL); + + rsdp = (ACPI_TABLE_RSDP *)IA64_PHYS_TO_RR7(rsdp_ptr); + xsdt = (ACPI_TABLE_XSDT *)IA64_PHYS_TO_RR7(rsdp->XsdtPhysicalAddress); + + count = (UINT64 *)((char *)xsdt + xsdt->Header.Length) - + xsdt->TableOffsetEntry; + + for (i = 0; i < count; i++) { + addr = xsdt->TableOffsetEntry[i]; + table = (ACPI_TABLE_HEADER *)IA64_PHYS_TO_RR7(addr); + + if (strncmp(table->Signature, sig, ACPI_NAME_SIZE) != 0) + continue; + if (ACPI_FAILURE(AcpiTbChecksum((void *)table, table->Length))) + continue; + + return (table); + } + + return (NULL); +} Modified: head/sys/ia64/include/md_var.h ============================================================================== --- head/sys/ia64/include/md_var.h Wed Jul 7 20:06:48 2010 (r209778) +++ head/sys/ia64/include/md_var.h Wed Jul 7 20:07:33 2010 (r209779) @@ -77,6 +77,7 @@ extern uint64_t ia64_lapic_addr; extern long Maxmem; extern u_int busdma_swi_pending; +void *acpi_find_table(const char *sig); void busdma_swi(void); int copyout_regstack(struct thread *, uint64_t *, uint64_t *); void cpu_mp_add(u_int, u_int, u_int); From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 21:00:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FCB11065678; Wed, 7 Jul 2010 21:00:18 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F4C18FC16; Wed, 7 Jul 2010 21:00:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67L0I0r003398; Wed, 7 Jul 2010 21:00:18 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67L0IVh003396; Wed, 7 Jul 2010 21:00:18 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201007072100.o67L0IVh003396@svn.freebsd.org> From: Marius Strobl Date: Wed, 7 Jul 2010 21:00:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209781 - releng/8.1/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 21:00:18 -0000 Author: marius Date: Wed Jul 7 21:00:17 2010 New Revision: 209781 URL: http://svn.freebsd.org/changeset/base/209781 Log: MFC: r209695 - Pin the IPI cache and TLB demap functions in order to prevent migration between determining the other CPUs and calling cpu_ipi_selected(), which apart from generally doing the wrong thing can lead to a panic when a CPU is told to IPI itself (which sun4u doesn't support). Reported and tested by: Nathaniel W Filardo - Add __unused where appropriate. Approved by: re (kib) Modified: releng/8.1/sys/sparc64/include/smp.h Directory Properties: releng/8.1/sys/ (props changed) releng/8.1/sys/amd64/include/xen/ (props changed) releng/8.1/sys/cddl/contrib/opensolaris/ (props changed) releng/8.1/sys/contrib/dev/acpica/ (props changed) releng/8.1/sys/contrib/pf/ (props changed) releng/8.1/sys/dev/ixgbe/ (props changed) releng/8.1/sys/dev/xen/xenpci/ (props changed) releng/8.1/sys/geom/sched/ (props changed) Modified: releng/8.1/sys/sparc64/include/smp.h ============================================================================== --- releng/8.1/sys/sparc64/include/smp.h Wed Jul 7 20:21:24 2010 (r209780) +++ releng/8.1/sys/sparc64/include/smp.h Wed Jul 7 21:00:17 2010 (r209781) @@ -38,6 +38,9 @@ #ifndef LOCORE +#include +#include + #include #include #include @@ -139,6 +142,7 @@ ipi_dcache_page_inval(void *func, vm_pad if (smp_cpus == 1) return (NULL); + sched_pin(); ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); ica->ica_mask = all_cpus; @@ -154,6 +158,7 @@ ipi_icache_page_inval(void *func, vm_pad if (smp_cpus == 1) return (NULL); + sched_pin(); ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); ica->ica_mask = all_cpus; @@ -170,8 +175,11 @@ ipi_tlb_context_demap(struct pmap *pm) if (smp_cpus == 1) return (NULL); - if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) + sched_pin(); + if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) { + sched_unpin(); return (NULL); + } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus | PCPU_GET(cpumask); @@ -189,8 +197,11 @@ ipi_tlb_page_demap(struct pmap *pm, vm_o if (smp_cpus == 1) return (NULL); - if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) + sched_pin(); + if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) { + sched_unpin(); return (NULL); + } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus | PCPU_GET(cpumask); @@ -208,8 +219,11 @@ ipi_tlb_range_demap(struct pmap *pm, vm_ if (smp_cpus == 1) return (NULL); - if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) + sched_pin(); + if ((cpus = (pm->pm_active & PCPU_GET(other_cpus))) == 0) { + sched_unpin(); return (NULL); + } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); ita->ita_mask = cpus | PCPU_GET(cpumask); @@ -230,6 +244,7 @@ ipi_wait(void *cookie) while (*mask != 0) ; mtx_unlock_spin(&ipi_mtx); + sched_unpin(); } } @@ -242,35 +257,36 @@ ipi_wait(void *cookie) #ifndef LOCORE static __inline void * -ipi_dcache_page_inval(void *func, vm_paddr_t pa) +ipi_dcache_page_inval(void *func __unused, vm_paddr_t pa __unused) { return (NULL); } static __inline void * -ipi_icache_page_inval(void *func, vm_paddr_t pa) +ipi_icache_page_inval(void *func __unused, vm_paddr_t pa __unused) { return (NULL); } static __inline void * -ipi_tlb_context_demap(struct pmap *pm) +ipi_tlb_context_demap(struct pmap *pm __unused) { return (NULL); } static __inline void * -ipi_tlb_page_demap(struct pmap *pm, vm_offset_t va) +ipi_tlb_page_demap(struct pmap *pm __unused, vm_offset_t va __unused) { return (NULL); } static __inline void * -ipi_tlb_range_demap(struct pmap *pm, vm_offset_t start, vm_offset_t end) +ipi_tlb_range_demap(struct pmap *pm __unused, vm_offset_t start __unused, + __unused vm_offset_t end) { return (NULL); From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 21:49:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99398106566B; Wed, 7 Jul 2010 21:49:13 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id 168298FC13; Wed, 7 Jul 2010 21:49:12 +0000 (UTC) Received: by qyk30 with SMTP id 30so3258001qyk.13 for ; Wed, 07 Jul 2010 14:49:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=VgXAjkRDhuzVUu9VvdDJaSJYy02GiX0CuxHT00deHQY=; b=diSpm+g77tvsK0F7IlT1+4J4qV8E5lN9U7JgZBpBTnxgDLHYilZZxpGHwK6h8be/rn C0Z+w5cpX6QAOtwTEQyWPHuWz7Fm3IIqZus+nhcKWzI3pyRKQRXm6/9G4tD2GraLQnRt kqtFm3khUHgNLXBVkWEbsKHt20cVTl9e43RNo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=F2vsNyDAzin/49q63Y5gcRaFQwezCJ9RV0mx49Yu0IKlaTD/ARIgr+YWiWXvp65Dn8 mLi41AtuUYbGsRs40FnU1ZWt/pkDUlImLOTMuNcvkko5fU+O7/bt8YtKXqqW6XtGznE0 BkVMPfBozwZmSEg6pHawaChRzKlWQWnV9Ix4A= MIME-Version: 1.0 Received: by 10.224.60.205 with SMTP id q13mr2839729qah.336.1278539349619; Wed, 07 Jul 2010 14:49:09 -0700 (PDT) Received: by 10.229.192.201 with HTTP; Wed, 7 Jul 2010 14:49:09 -0700 (PDT) In-Reply-To: <86zky3897m.fsf@gmail.com> References: <201007071744.o67Hi9IU059462@svn.freebsd.org> <4C34BDF7.1020201__3943.14767695523$1278525000$gmane$org@FreeBSD.org> <86zky3897m.fsf@gmail.com> Date: Wed, 7 Jul 2010 14:49:09 -0700 Message-ID: From: Garrett Cooper To: Anonymous Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org, Benedict Reuschling Subject: Re: svn commit: r209772 - head/usr.bin/getopt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 21:49:13 -0000 On Wed, Jul 7, 2010 at 10:58 AM, Anonymous wrote: > Doug Barton writes: > >> On 7/7/2010 10:44 AM, Benedict Reuschling wrote: >>> Author: bcr (doc committer) >> >>> -for i >>> +while true; >>> =A0do >> >> If this is intended to be an sh scripting example a better way to write >> that is: >> >> while : ; >> >> You can't guarantee that "true" will always be available and do what you >> expect, whereas the ':' operator is a shell builtin. > > Isn't `true' shell builtin as well? > > =A0$ type true > =A0true is a shell builtin `true' is the new way. `:' is the old Bourne way as I've been told (but you're right, it is a built-in now as of at least 7.1 -- not sure about 6.x though)... -Garrett From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 22:53:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 451CE106566B; Wed, 7 Jul 2010 22:53:59 +0000 (UTC) (envelope-from randi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 353518FC0A; Wed, 7 Jul 2010 22:53:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o67Mrx6X028451; Wed, 7 Jul 2010 22:53:59 GMT (envelope-from randi@svn.freebsd.org) Received: (from randi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o67MrxkL028447; Wed, 7 Jul 2010 22:53:59 GMT (envelope-from randi@svn.freebsd.org) Message-Id: <201007072253.o67MrxkL028447@svn.freebsd.org> From: Randi Harper Date: Wed, 7 Jul 2010 22:53: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: r209782 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 22:53:59 -0000 Author: randi Date: Wed Jul 7 22:53:58 2010 New Revision: 209782 URL: http://svn.freebsd.org/changeset/base/209782 Log: Add support for remote logging to syslogd via an install.cfg variable. Approved by: cperciva (mentor) MFC after: 3 weeks Modified: head/usr.sbin/sysinstall/install.cfg head/usr.sbin/sysinstall/msg.c head/usr.sbin/sysinstall/sysinstall.h Modified: head/usr.sbin/sysinstall/install.cfg ============================================================================== --- head/usr.sbin/sysinstall/install.cfg Wed Jul 7 21:00:17 2010 (r209781) +++ head/usr.sbin/sysinstall/install.cfg Wed Jul 7 22:53:58 2010 (r209782) @@ -17,6 +17,9 @@ ipaddr=204.216.27.230 netmask=255.255.255.240 ################################ +# Log to a remote syslogd server +syslogdServer=10.0.1.1 + ################################ # Which installation device to use - ftp is pointed directly at my local # machine and the installation device is my WD8013 ethernet interface. Modified: head/usr.sbin/sysinstall/msg.c ============================================================================== --- head/usr.sbin/sysinstall/msg.c Wed Jul 7 21:00:17 2010 (r209781) +++ head/usr.sbin/sysinstall/msg.c Wed Jul 7 22:53:58 2010 (r209782) @@ -34,10 +34,18 @@ * */ -#include "sysinstall.h" -#include #include #include +#include +#include + +#include +#include + +#include +#include + +#include "sysinstall.h" Boolean isDebug(void) @@ -47,6 +55,50 @@ isDebug(void) return (cp = variable_get(VAR_DEBUG)) && strcmp(cp, "no"); } +static Boolean +isNetworkUp(void) +{ + if (!(RunningAsInit) || + (variable_check("NETWORK_CONFIGURED=NO")) != TRUE) { + return TRUE; + } + + return FALSE; +} + +void +msgSyslog(const char *errstr) +{ + struct sockaddr_in server; + struct hostent *hp; + char *host, *line; + int sock; + + if (!isNetworkUp()) + return; + + if (!(host = variable_get(VAR_SYSLOG_SERVER))) + return; + + if (!(hp = gethostbyname2(host, AF_INET))) + return; + + if (!(sock = socket(AF_INET, SOCK_DGRAM, 0))) + return; + + bzero(&server, sizeof(struct sockaddr_in)); + server.sin_family = AF_INET; + server.sin_port = htons(514); + bcopy((char *)hp->h_addr, (char *)&server.sin_addr, hp->h_length); + + asprintf(&line, "<%d>%s", LOG_NOTICE, errstr); + sendto(sock, line, strlen(line), 0, (struct sockaddr *)&server, + sizeof(struct sockaddr_in)); + + close(sock); + free(line); +} + /* Whack up an informational message on the status line, in stand-out */ void msgYap(char *fmt, ...) @@ -99,6 +151,8 @@ msgInfo(char *fmt, ...) attrset(attrs); move(StatusLine, 79); refresh(); + + msgSyslog(errstr); } /* Whack up a warning on the status line */ @@ -120,8 +174,15 @@ msgWarn(char *fmt, ...) mvaddstr(StatusLine, 0, errstr); attrset(attrs); refresh(); - if (OnVTY && isDebug()) - msgDebug("Warning message `%s'\n", errstr); + + /* we don't want this hitting syslog twice */ + if (isDebug()) { + if (OnVTY) + msgDebug("Warning message `%s'\n", errstr); + else + msgSyslog(errstr); + } + } /* Whack up an error on the status line */ @@ -143,8 +204,14 @@ msgError(char *fmt, ...) mvaddstr(StatusLine, 0, errstr); attrset(attrs); refresh(); - if (OnVTY && isDebug()) - msgDebug("Error message `%s'\n", errstr); + + /* we don't want this hitting syslog twice */ + if (isDebug()) { + if (OnVTY) + msgDebug("Error message `%s'\n", errstr); + else + msgSyslog(errstr); + } } /* Whack up a fatal error on the status line */ @@ -174,6 +241,8 @@ msgFatal(char *fmt, ...) refresh(); if (OnVTY) msgDebug("Fatal error `%s'!\n", errstr); + else + msgSyslog(errstr); getch(); systemShutdown(1); } @@ -316,6 +385,9 @@ msgDebug(char *fmt, ...) va_start(args, fmt); vsnprintf((char *)(dbg + strlen(dbg)), FILENAME_MAX, fmt, args); va_end(args); + + msgSyslog(dbg); + write(DebugFD, dbg, strlen(dbg)); } Modified: head/usr.sbin/sysinstall/sysinstall.h ============================================================================== --- head/usr.sbin/sysinstall/sysinstall.h Wed Jul 7 21:00:17 2010 (r209781) +++ head/usr.sbin/sysinstall/sysinstall.h Wed Jul 7 22:53:58 2010 (r209782) @@ -183,6 +183,7 @@ #define VAR_SERIAL_SPEED "serialSpeed" #define VAR_SLOW_ETHER "slowEthernetCard" #define VAR_SWAP_SIZE "swapSize" +#define VAR_SYSLOG_SERVER "syslogdServer" #define VAR_TRY_DHCP "tryDHCP" #define VAR_TRY_RTSOL "tryRTSOL" #define VAR_UFS_PATH "ufs" From owner-svn-src-all@FreeBSD.ORG Wed Jul 7 23:01:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2F2F106566C; Wed, 7 Jul 2010 23:01:57 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id AFDEB8FC14; Wed, 7 Jul 2010 23:01:56 +0000 (UTC) Received: by bwz12 with SMTP id 12so149369bwz.13 for ; Wed, 07 Jul 2010 16:01:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type :content-transfer-encoding; bh=GvbhTwdx2u7YYyD51Dog5CDIyDfpvPH5It7No3WaVvM=; b=MGZjysMLkPb7Ht25rmhxwB4rWiSXM4EpKOOroHVnfxQ0BipmwTfHAVtaV4R6cOEpZW HEkD8I8oq1mMsqfgV1gB87WfzRae3cE+mB4XOJzhMqnIbrvRa0OIjKCKHncumexOe6Sf O35fRS5nSyOs+v3QGBJ++8caq+sChMeukrZlo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; b=p6FiMeuXdMMQbeRtWTFmNwhKUNd0Fr3EAwv+HJpE9GAWG2G0vIZ9ScALaLgC2BDDZV H7L4cMR0Cn4rtU7GUBRFU78QvTixyDEEeEM83wGGcArtzbMC8I9uR4XLj2tdOZ5VEho7 wuiY4TgdNo5iQRmAZuLmC9n2prf+STp6GmJWo= Received: by 10.204.81.203 with SMTP id y11mr1151425bkk.152.1278543711058; Wed, 07 Jul 2010 16:01:51 -0700 (PDT) Received: from localhost (hd5b906df.selukra.dyn.perspektivbredband.net [213.185.6.223]) by mx.google.com with ESMTPS id x19sm30065542bkv.9.2010.07.07.16.01.48 (version=SSLv3 cipher=RC4-MD5); Wed, 07 Jul 2010 16:01:50 -0700 (PDT) From: Anonymous To: Garrett Cooper References: <201007071744.o67Hi9IU059462@svn.freebsd.org> <4C34BDF7.1020201__3943.14767695523$1278525000$gmane$org@FreeBSD.org> <86zky3897m.fsf@gmail.com> Date: Thu, 08 Jul 2010 03:01:39 +0400 In-Reply-To: (Garrett Cooper's message of "Wed, 7 Jul 2010 14:49:09 -0700") Message-ID: <861vbe28x8.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (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, Doug Barton , src-committers@freebsd.org, Benedict Reuschling Subject: Re: svn commit: r209772 - head/usr.bin/getopt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 23:01:58 -0000 Garrett Cooper writes: > On Wed, Jul 7, 2010 at 10:58 AM, Anonymous wrote: >> Doug Barton writes: >> >>> On 7/7/2010 10:44 AM, Benedict Reuschling wrote: >>>> Author: bcr (doc committer) >>> >>>> -for i >>>> +while true; >>>> =C2=A0do >>> >>> If this is intended to be an sh scripting example a better way to write >>> that is: >>> >>> while : ; >>> >>> You can't guarantee that "true" will always be available and do what you >>> expect, whereas the ':' operator is a shell builtin. >> >> Isn't `true' shell builtin as well? >> >> =C2=A0$ type true >> =C2=A0true is a shell builtin > > `true' is the new way. `:' is the old Bourne way as I've been told > (but you're right, it is a built-in now as of at least 7.1 -- not sure > about 6.x though)... I see `true' uncommented in builtins.def going all the way back to Ash as it was posted on Usenet in 1989. From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 02:35:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C46E106564A; Thu, 8 Jul 2010 02:35:38 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38C9A8FC0C; Thu, 8 Jul 2010 02:35:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o682Zca1077385; Thu, 8 Jul 2010 02:35:38 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o682ZcKf077382; Thu, 8 Jul 2010 02:35:38 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201007080235.o682ZcKf077382@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 8 Jul 2010 02:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209783 - in stable/8/sys: kern modules modules/alq X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 02:35:38 -0000 Author: lstewart Date: Thu Jul 8 02:35:37 2010 New Revision: 209783 URL: http://svn.freebsd.org/changeset/base/209783 Log: MFC r205959: Add support for ALQ(9) to be compiled and loaded as a kernel module. Sponsored by: FreeBSD Foundation Reviewed by: dwmalone, jeff, rpaulo, rwatson Added: stable/8/sys/modules/alq/ - copied from r205959, head/sys/modules/alq/ Modified: stable/8/sys/kern/kern_alq.c stable/8/sys/modules/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_alq.c ============================================================================== --- stable/8/sys/kern/kern_alq.c Wed Jul 7 22:53:58 2010 (r209782) +++ stable/8/sys/kern/kern_alq.c Thu Jul 8 02:35:37 2010 (r209783) @@ -1,7 +1,13 @@ /*- * Copyright (c) 2002, Jeffrey Roberson + * Copyright (c) 2008-2009, Lawrence Stewart + * Copyright (c) 2009-2010, The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed at the Centre for Advanced + * Internet Architectures, Swinburne University of Technology, Melbourne, + * Australia by Lawrence Stewart under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -27,6 +33,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_mac.h" + #include #include #include @@ -180,9 +188,16 @@ ald_daemon(void) ALD_LOCK(); for (;;) { - while ((alq = LIST_FIRST(&ald_active)) == NULL) + while ((alq = LIST_FIRST(&ald_active)) == NULL && + !ald_shutingdown) msleep(&ald_active, &ald_mtx, PWAIT, "aldslp", 0); + /* Don't shutdown until all active ALQs are flushed. */ + if (ald_shutingdown && alq == NULL) { + ALD_UNLOCK(); + break; + } + ALQ_LOCK(alq); ald_deactivate(alq); ALD_UNLOCK(); @@ -192,6 +207,8 @@ ald_daemon(void) wakeup(alq); ALD_LOCK(); } + + kproc_exit(0); } static void @@ -200,14 +217,29 @@ ald_shutdown(void *arg, int howto) struct alq *alq; ALD_LOCK(); + + /* Ensure no new queues can be created. */ ald_shutingdown = 1; + /* Shutdown all ALQs prior to terminating the ald_daemon. */ while ((alq = LIST_FIRST(&ald_queues)) != NULL) { LIST_REMOVE(alq, aq_link); ALD_UNLOCK(); alq_shutdown(alq); ALD_LOCK(); } + + /* At this point, all ALQs are flushed and shutdown. */ + + /* + * Wake ald_daemon so that it exits. It won't be able to do + * anything until we msleep because we hold the ald_mtx. + */ + wakeup(&ald_active); + + /* Wait for ald_daemon to exit. */ + msleep(ald_proc, &ald_mtx, PWAIT, "aldslp", 0); + ALD_UNLOCK(); } @@ -510,3 +542,53 @@ alq_close(struct alq *alq) free(alq->aq_entbuf, M_ALD); free(alq, M_ALD); } + +static int +alq_load_handler(module_t mod, int what, void *arg) +{ + int ret; + + ret = 0; + + switch (what) { + case MOD_LOAD: + case MOD_SHUTDOWN: + break; + + case MOD_QUIESCE: + ALD_LOCK(); + /* Only allow unload if there are no open queues. */ + if (LIST_FIRST(&ald_queues) == NULL) { + ald_shutingdown = 1; + ALD_UNLOCK(); + ald_shutdown(NULL, 0); + mtx_destroy(&ald_mtx); + } else { + ALD_UNLOCK(); + ret = EBUSY; + } + break; + + case MOD_UNLOAD: + /* If MOD_QUIESCE failed we must fail here too. */ + if (ald_shutingdown == 0) + ret = EBUSY; + break; + + default: + ret = EINVAL; + break; + } + + return (ret); +} + +static moduledata_t alq_mod = +{ + "alq", + alq_load_handler, + NULL +}; + +DECLARE_MODULE(alq, alq_mod, SI_SUB_SMP, SI_ORDER_ANY); +MODULE_VERSION(alq, 1); Modified: stable/8/sys/modules/Makefile ============================================================================== --- stable/8/sys/modules/Makefile Wed Jul 7 22:53:58 2010 (r209782) +++ stable/8/sys/modules/Makefile Thu Jul 8 02:35:37 2010 (r209783) @@ -20,6 +20,7 @@ SUBDIR= ${_3dfx} \ aio \ alc \ ale \ + alq \ ${_amd} \ ${_amdsbwd} \ ${_amdtemp} \ From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 02:41:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B23FB106566C; Thu, 8 Jul 2010 02:41:55 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 860EB8FC16; Thu, 8 Jul 2010 02:41:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o682ftDR078775; Thu, 8 Jul 2010 02:41:55 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o682ftZ6078773; Thu, 8 Jul 2010 02:41:55 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201007080241.o682ftZ6078773@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 8 Jul 2010 02:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209784 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 02:41:55 -0000 Author: lstewart Date: Thu Jul 8 02:41:55 2010 New Revision: 209784 URL: http://svn.freebsd.org/changeset/base/209784 Log: MFC r206026: - Factor code to destroy an ALQ out of alq_close() into a private alq_destroy(). - Use the new alq_destroy() to properly handle a failure case in alq_open(). Sponsored by: FreeBSD Foundation Reviewed by: dwmalone, jeff, rpaulo, rwatson (as part of a larger patch) Modified: stable/8/sys/kern/kern_alq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_alq.c ============================================================================== --- stable/8/sys/kern/kern_alq.c Thu Jul 8 02:35:37 2010 (r209783) +++ stable/8/sys/kern/kern_alq.c Thu Jul 8 02:41:55 2010 (r209784) @@ -103,6 +103,7 @@ static void ald_deactivate(struct alq *) /* Internal queue functions */ static void alq_shutdown(struct alq *); +static void alq_destroy(struct alq *); static int alq_doio(struct alq *); @@ -263,6 +264,18 @@ alq_shutdown(struct alq *alq) crfree(alq->aq_cred); } +void +alq_destroy(struct alq *alq) +{ + /* Drain all pending IO. */ + alq_shutdown(alq); + + mtx_destroy(&alq->aq_mtx); + free(alq->aq_first, M_ALD); + free(alq->aq_entbuf, M_ALD); + free(alq, M_ALD); +} + /* * Flush all pending data to disk. This operation will block. */ @@ -420,8 +433,11 @@ alq_open(struct alq **alqp, const char * alp->ae_next = alq->aq_first; - if ((error = ald_add(alq)) != 0) + if ((error = ald_add(alq)) != 0) { + alq_destroy(alq); return (error); + } + *alqp = alq; return (0); @@ -525,22 +541,9 @@ alq_flush(struct alq *alq) void alq_close(struct alq *alq) { - /* - * If we're already shuting down someone else will flush and close - * the vnode. - */ - if (ald_rem(alq) != 0) - return; - - /* - * Drain all pending IO. - */ - alq_shutdown(alq); - - mtx_destroy(&alq->aq_mtx); - free(alq->aq_first, M_ALD); - free(alq->aq_entbuf, M_ALD); - free(alq, M_ALD); + /* Only flush and destroy alq if not already shutting down. */ + if (ald_rem(alq) == 0) + alq_destroy(alq); } static int From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 02:43:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EE32106566B; Thu, 8 Jul 2010 02:43:53 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AF088FC13; Thu, 8 Jul 2010 02:43:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o682hqFH079252; Thu, 8 Jul 2010 02:43:52 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o682hqFO079250; Thu, 8 Jul 2010 02:43:52 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201007080243.o682hqFO079250@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 8 Jul 2010 02:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209785 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 02:43:53 -0000 Author: lstewart Date: Thu Jul 8 02:43:52 2010 New Revision: 209785 URL: http://svn.freebsd.org/changeset/base/209785 Log: MFC r206027: According to SLEEP(9), msleep() is deprecated in favour of mtx_sleep(). Sponsored by: FreeBSD Foundation Reviewed by: dwmalone, jeff, rpaulo, rwatson (as part of a larger patch) Modified: stable/8/sys/kern/kern_alq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_alq.c ============================================================================== --- stable/8/sys/kern/kern_alq.c Thu Jul 8 02:41:55 2010 (r209784) +++ stable/8/sys/kern/kern_alq.c Thu Jul 8 02:43:52 2010 (r209785) @@ -191,7 +191,7 @@ ald_daemon(void) for (;;) { while ((alq = LIST_FIRST(&ald_active)) == NULL && !ald_shutingdown) - msleep(&ald_active, &ald_mtx, PWAIT, "aldslp", 0); + mtx_sleep(&ald_active, &ald_mtx, PWAIT, "aldslp", 0); /* Don't shutdown until all active ALQs are flushed. */ if (ald_shutingdown && alq == NULL) { @@ -234,12 +234,12 @@ ald_shutdown(void *arg, int howto) /* * Wake ald_daemon so that it exits. It won't be able to do - * anything until we msleep because we hold the ald_mtx. + * anything until we mtx_sleep because we hold the ald_mtx. */ wakeup(&ald_active); /* Wait for ald_daemon to exit. */ - msleep(ald_proc, &ald_mtx, PWAIT, "aldslp", 0); + mtx_sleep(ald_proc, &ald_mtx, PWAIT, "aldslp", 0); ALD_UNLOCK(); } From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 02:46:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F1EE106566B; Thu, 8 Jul 2010 02:46:43 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA5288FC08; Thu, 8 Jul 2010 02:46:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o682kgwu079950; Thu, 8 Jul 2010 02:46:42 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o682kgad079948; Thu, 8 Jul 2010 02:46:42 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201007080246.o682kgad079948@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 8 Jul 2010 02:46:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209786 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 02:46:43 -0000 Author: lstewart Date: Thu Jul 8 02:46:42 2010 New Revision: 209786 URL: http://svn.freebsd.org/changeset/base/209786 Log: MFC r206028: The ALQ should not be considered drained until it has been made inactive. Sponsored by: FreeBSD Foundation Reviewed by: dwmalone, jeff, rpaulo, rwatson (as part of a larger patch) Modified: stable/8/sys/kern/kern_alq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_alq.c ============================================================================== --- stable/8/sys/kern/kern_alq.c Thu Jul 8 02:43:52 2010 (r209785) +++ stable/8/sys/kern/kern_alq.c Thu Jul 8 02:46:42 2010 (r209786) @@ -253,7 +253,7 @@ alq_shutdown(struct alq *alq) alq->aq_flags |= AQ_SHUTDOWN; /* Drain IO */ - while (alq->aq_flags & (AQ_FLUSHING|AQ_ACTIVE)) { + while (alq->aq_flags & AQ_ACTIVE) { alq->aq_flags |= AQ_WANTED; msleep_spin(alq, &alq->aq_mtx, "aldclose", 0); } From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 03:28:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8C48106566C; Thu, 8 Jul 2010 03:28:25 +0000 (UTC) (envelope-from randi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5C928FC16; Thu, 8 Jul 2010 03:28:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o683SP4s089420; Thu, 8 Jul 2010 03:28:25 GMT (envelope-from randi@svn.freebsd.org) Received: (from randi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o683SP5k089410; Thu, 8 Jul 2010 03:28:25 GMT (envelope-from randi@svn.freebsd.org) Message-Id: <201007080328.o683SP5k089410@svn.freebsd.org> From: Randi Harper Date: Thu, 8 Jul 2010 03:28: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: r209787 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 03:28:25 -0000 Author: randi Date: Thu Jul 8 03:28:25 2010 New Revision: 209787 URL: http://svn.freebsd.org/changeset/base/209787 Log: Remove the ability to upgrade via sysinstall. This feature has been flaky and broken for a number of years. freebsd-update now provides a reasonable way to handle upgrades, so keeping this functionality in sysinstall only serves to mislead users. Approved by: cperciva (mentor) Deleted: head/usr.sbin/sysinstall/installUpgrade.c Modified: head/usr.sbin/sysinstall/Makefile head/usr.sbin/sysinstall/dispatch.c head/usr.sbin/sysinstall/install.c head/usr.sbin/sysinstall/menus.c head/usr.sbin/sysinstall/sysinstall.8 head/usr.sbin/sysinstall/sysinstall.h Modified: head/usr.sbin/sysinstall/Makefile ============================================================================== --- head/usr.sbin/sysinstall/Makefile Thu Jul 8 02:46:42 2010 (r209786) +++ head/usr.sbin/sysinstall/Makefile Thu Jul 8 03:28:25 2010 (r209787) @@ -8,7 +8,7 @@ PROG= sysinstall MAN= sysinstall.8 SRCS= anonFTP.c cdrom.c command.c config.c devices.c dhcp.c \ disks.c dispatch.c dist.c dmenu.c doc.c dos.c floppy.c \ - ftp.c globals.c http.c index.c install.c installUpgrade.c keymap.c \ + ftp.c globals.c http.c index.c install.c keymap.c \ label.c main.c makedevs.c media.c menus.c misc.c modules.c \ mouse.c msg.c network.c nfs.c options.c package.c \ system.c tcpip.c termcap.c ttys.c ufs.c usb.c user.c \ Modified: head/usr.sbin/sysinstall/dispatch.c ============================================================================== --- head/usr.sbin/sysinstall/dispatch.c Thu Jul 8 02:46:42 2010 (r209786) +++ head/usr.sbin/sysinstall/dispatch.c Thu Jul 8 03:28:25 2010 (r209787) @@ -82,7 +82,6 @@ static struct _word { { "installCommit", installCommit }, { "installExpress", installExpress }, { "installStandard", installStandard }, - { "installUpgrade", installUpgrade }, { "installFixupBase", installFixupBase }, { "installFixitHoloShell", installFixitHoloShell }, { "installFixitCDROM", installFixitCDROM }, Modified: head/usr.sbin/sysinstall/install.c ============================================================================== --- head/usr.sbin/sysinstall/install.c Thu Jul 8 02:46:42 2010 (r209786) +++ head/usr.sbin/sysinstall/install.c Thu Jul 8 03:28:25 2010 (r209787) @@ -1032,13 +1032,11 @@ installFilesystems(dialogMenuItem *self) Device **devs; PartInfo *root; char dname[80]; - Boolean upgrade = FALSE; /* If we've already done this, bail out */ if (!variable_cmp(DISK_LABELLED, "written")) return DITEM_SUCCESS; - upgrade = !variable_cmp(SYSTEM_STATE, "upgrade"); if (!checkLabels(TRUE)) return DITEM_FAILURE; @@ -1078,9 +1076,7 @@ installFilesystems(dialogMenuItem *self) if (strcmp(root->mountpoint, "/")) msgConfirm("Warning: %s is marked as a root partition but is mounted on %s", RootChunk->name, root->mountpoint); - if (root->do_newfs && (!upgrade || - !msgNoYes("You are upgrading - are you SURE you want to newfs " - "the root partition?"))) { + if (root->do_newfs) { int i; dialog_clear_norefresh(); @@ -1093,9 +1089,7 @@ installFilesystems(dialogMenuItem *self) } } else { - if (!upgrade) { - msgConfirm("Warning: Using existing root partition."); - } + msgConfirm("Warning: Using existing root partition."); dialog_clear_norefresh(); msgNotify("Checking integrity of existing %s filesystem.", dname); i = vsystem("fsck_ffs -y %s", dname); @@ -1179,9 +1173,7 @@ installFilesystems(dialogMenuItem *self) sprintf(dname, "%s/dev/%s", RunningAsInit ? "/mnt" : "", c2->name); - if (tmp->do_newfs && (!upgrade || - !msgNoYes("You are upgrading - are you SURE you" - " want to newfs /dev/%s?", c2->name))) + if (tmp->do_newfs) performNewfs(tmp, dname, QUEUE_YES); else command_shell_add(tmp->mountpoint, @@ -1214,7 +1206,7 @@ installFilesystems(dialogMenuItem *self) } } else if (c1->type == fat && c1->private_data && - (root->do_newfs || upgrade)) { + (root->do_newfs)) { char name[FILENAME_MAX]; sprintf(name, "%s/%s", RunningAsInit ? "/mnt" : "", ((PartInfo *)c1->private_data)->mountpoint); @@ -1227,9 +1219,7 @@ installFilesystems(dialogMenuItem *self) sprintf(dname, "%s/dev/%s", RunningAsInit ? "/mnt" : "", c1->name); - if (pi->do_newfs && (!upgrade || - !msgNoYes("You are upgrading - are you SURE you want to " - "newfs /dev/%s?", c1->name))) + if (pi->do_newfs) performNewfs(pi, dname, QUEUE_YES); command_func_add(pi->mountpoint, Mount_msdosfs, c1->name); Modified: head/usr.sbin/sysinstall/menus.c ============================================================================== --- head/usr.sbin/sysinstall/menus.c Thu Jul 8 02:46:42 2010 (r209786) +++ head/usr.sbin/sysinstall/menus.c Thu Jul 8 03:28:25 2010 (r209787) @@ -243,7 +243,6 @@ DMenu MenuIndex = { #endif /* WITH_SYSCONS */ { " Time Zone", "Set the system's time zone.", NULL, dmenuSystemCommand, NULL, "tzsetup" }, { " TTYs", "Configure system ttys.", NULL, configEtcTtys, NULL, "ttys" }, - { " Upgrade", "Upgrade an existing system.", NULL, installUpgrade }, { " Usage", "Quick start - How to use this menu system.", NULL, dmenuDisplayFile, NULL, "usage" }, { " User Management", "Add user and group information.", NULL, dmenuSubmenu, NULL, &MenuUsermgmt }, { NULL } }, @@ -275,7 +274,6 @@ DMenu MenuInitial = { #endif { "Options", "View/Set various installation options", NULL, optionsEditor }, { "Fixit", "Repair mode with CDROM/DVD/floppy or start shell", NULL, dmenuSubmenu, NULL, &MenuFixit }, - { "Upgrade", "Upgrade an existing system", NULL, installUpgrade }, { "Load Config..","Load default install configuration", NULL, dispatch_load_menu }, { "Index", "Glossary of functions", NULL, dmenuSubmenu, NULL, &MenuIndex }, { NULL } }, Modified: head/usr.sbin/sysinstall/sysinstall.8 ============================================================================== --- head/usr.sbin/sysinstall/sysinstall.8 Thu Jul 8 02:46:42 2010 (r209786) +++ head/usr.sbin/sysinstall/sysinstall.8 Thu Jul 8 03:28:25 2010 (r209787) @@ -553,11 +553,6 @@ installation type available. .Pp .Sy Variables : None -.It installUpgrade -Start an upgrade installation. -.Pp -.Sy Variables : -None .It installFixitHoloShell Start up the "emergency holographic shell" over on VTY4 if running as init. Modified: head/usr.sbin/sysinstall/sysinstall.h ============================================================================== --- head/usr.sbin/sysinstall/sysinstall.h Thu Jul 8 02:46:42 2010 (r209786) +++ head/usr.sbin/sysinstall/sysinstall.h Thu Jul 8 03:28:25 2010 (r209787) @@ -679,7 +679,6 @@ extern int installFixitUSB(dialogMenuIte extern int installFixitFloppy(dialogMenuItem *self); extern int installFixupBase(dialogMenuItem *self); extern int installFixupKernel(dialogMenuItem *self, int dists); -extern int installUpgrade(dialogMenuItem *self); extern int installFilesystems(dialogMenuItem *self); extern int installVarDefaults(dialogMenuItem *self); extern void installEnvironment(void); From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 03:28:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC4491065670; Thu, 8 Jul 2010 03:28:25 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B737E8FC17; Thu, 8 Jul 2010 03:28:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o683SPbv089423; Thu, 8 Jul 2010 03:28:25 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o683SPZA089416; Thu, 8 Jul 2010 03:28:25 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201007080328.o683SPZA089416@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 8 Jul 2010 03:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209788 - in stable/8: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 03:28:25 -0000 Author: lstewart Date: Thu Jul 8 03:28:25 2010 New Revision: 209788 URL: http://svn.freebsd.org/changeset/base/209788 Log: MFC r207223: - Rework the underlying ALQ storage to be a circular buffer, which amongst other things allows variable length messages to be easily supported. - Extend KPI with alq_writen() and alq_getn() to support variable length messages, which is enabled at ALQ creation time depending on the arguments passed to alq_open(). Also add variants of alq_open() and alq_post() that accept a flags argument. The KPI is still fully backwards compatible and shouldn't require any change in ALQ consumers unless they wish to utilise the new features. - Introduce the ALQ_NOACTIVATE and ALQ_ORDERED flags to allow ALQ consumers to have more control over IO scheduling and resource acquisition respectively. - Strengthen invariants checking. - Document ALQ changes in ALQ(9) man page. Sponsored by: FreeBSD Foundation Reviewed by: gnn, jeff, rpaulo, rwatson Modified: stable/8/share/man/man9/alq.9 stable/8/sys/kern/kern_alq.c stable/8/sys/sys/alq.h Directory Properties: stable/8/share/man/ (props changed) stable/8/share/man/man1/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/share/man/man9/alq.9 ============================================================================== --- stable/8/share/man/man9/alq.9 Thu Jul 8 03:28:25 2010 (r209787) +++ stable/8/share/man/man9/alq.9 Thu Jul 8 03:28:25 2010 (r209788) @@ -1,7 +1,13 @@ .\" .\" Copyright (c) 2003 Hiten Pandya +.\" Copyright (c) 2009-2010 The FreeBSD Foundation .\" All rights reserved. .\" +.\" Portions of this software were developed at the Centre for Advanced +.\" Internet Architectures, Swinburne University of Technology, Melbourne, +.\" Australia by Lawrence Stewart under sponsorship from the FreeBSD +.\" Foundation. +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -25,21 +31,34 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2003 +.Dd April 26, 2010 .Dt ALQ 9 .Os .Sh NAME .Nm alq , +.Nm alq_open_flags , .Nm alq_open , +.Nm alq_writen , .Nm alq_write , .Nm alq_flush , .Nm alq_close , +.Nm alq_getn , .Nm alq_get , +.Nm alq_post_flags , .Nm alq_post .Nd Asynchronous Logging Queues .Sh SYNOPSIS .In sys/alq.h .Ft int +.Fo alq_open_flags +.Fa "struct alq **app" +.Fa "const char *file" +.Fa "struct ucred *cred" +.Fa "int cmode" +.Fa "int size" +.Fa "int flags" +.Fc +.Ft int .Fo alq_open .Fa "struct alq **app" .Fa "const char *file" @@ -49,19 +68,25 @@ .Fa "int count" .Fc .Ft int -.Fn alq_write "struct alq *alq" "void *data" "int waitok" +.Fn alq_writen "struct alq *alq" "void *data" "int len" "int flags" +.Ft int +.Fn alq_write "struct alq *alq" "void *data" "int flags" .Ft void .Fn alq_flush "struct alq *alq" .Ft void .Fn alq_close "struct alq *alq" .Ft struct ale * -.Fn alq_get "struct alq *alq" "int waitok" +.Fn alq_getn "struct alq *alq" "int len" "int flags" +.Ft struct ale * +.Fn alq_get "struct alq *alq" "int flags" +.Ft void +.Fn alq_post_flags "struct alq *alq" "struct ale *ale" "int flags" .Ft void .Fn alq_post "struct alq *alq" "struct ale *ale" .Sh DESCRIPTION The .Nm -facility provides an asynchronous fixed length recording +facility provides an asynchronous fixed or variable length recording mechanism, known as Asynchronous Logging Queues. It can record to any .Xr vnode 9 , @@ -81,26 +106,37 @@ is defined as which has the following members: .Bd -literal -offset indent struct ale { - struct ale *ae_next; /* Next Entry */ - char *ae_data; /* Entry buffer */ - int ae_flags; /* Entry flags */ + intptr_t ae_bytesused; /* # bytes written to ALE. */ + char *ae_data; /* Write ptr. */ + int ae_pad; /* Unused, compat. */ }; .Ed .Pp -The -.Va ae_flags -field is for internal use, clients of the +An .Nm -interface should not modify this field. -Behaviour is undefined if this field is modified. +can be created in either fixed or variable length mode. +A variable length +.Nm +accommodates writes of varying length using +.Fn alq_writen +and +.Fn alq_getn . +A fixed length +.Nm +accommodates a fixed number of writes using +.Fn alq_write +and +.Fn alq_get , +each of fixed size (set at queue creation time). +Fixed length mode is deprecated in favour of variable length mode. .Sh FUNCTIONS The -.Fn alq_open -function creates a new logging queue. +.Fn alq_open_flags +function creates a new variable length asynchronous logging queue. The .Fa file -argument is the name of the file to open for logging; if the file does not -yet exist, +argument is the name of the file to open for logging. +If the file does not yet exist, .Fn alq_open will attempt to create it. The @@ -112,33 +148,99 @@ as the requested creation mode, to be us Consumers of this API may wish to pass .Dv ALQ_DEFAULT_CMODE , a default creation mode suitable for most applications. -The argument +The .Fa cred -specifies the credentials to use when opening and performing I/O on the file. -The size of each entry in the queue is determined by -.Fa size . +argument specifies the credentials to use when opening and performing I/O on the file. The +.Fa size +argument sets the size (in bytes) of the underlying queue. +The ALQ_ORDERED flag may be passed in via +.Fa flags +to indicate that the ordering of writer threads waiting for a busy +.Nm +to free up resources should be preserved. +.Pp +The deprecated +.Fn alq_open +function is implemented as a wrapper around +.Fn alq_open_flags +to provide backwards compatibility to consumers that have not been updated to +utilise the newer +.Fn alq_open_flags +function. +It passes all arguments through to +.Fn alq_open_flags +untouched except for +.Fa size +and +.Fa count , +and sets +.Fa flags +to 0. +To create a variable length mode +.Nm , +the +.Fa size +argument should be set to the size (in bytes) of the underlying queue and the +.Fa count +argument should be set to 0. +To create a fixed length mode +.Nm , +the +.Fa size +argument should be set to the size (in bytes) of each write and the .Fa count -argument determines the number of items to be stored in the -asynchronous queue over an approximate period of a disk -write operation. +argument should be set to the number of +.Fa size +byte chunks to reserve capacity for. .Pp The -.Fn alq_write +.Fn alq_writen function writes +.Fa len +bytes from .Fa data -to the designated queue, +to the designated variable length mode queue .Fa alq . -In the event that -.Fn alq_write -could not write the entry immediately, and +If +.Fn alq_writen +could not write the entry immediately and .Dv ALQ_WAITOK -is passed to -.Fa waitok , -then +is set in +.Fa flags , +the function will be allowed to +.Xr msleep_spin 9 +with the +.Dq Li alqwnord +or +.Dq Li alqwnres +wait message. +A write will automatically schedule the queue +.Fa alq +to be flushed to disk. +This behaviour can be controlled by passing ALQ_NOACTIVATE via +.Fa flags +to indicate that the write should not schedule +.Fa alq +to be flushed to disk. +.Pp +The deprecated +.Fn alq_write +function is implemented as a wrapper around +.Fn alq_writen +to provide backwards compatibility to consumers that have not been updated to +utilise variable length mode queues. +The function will write +.Fa size +bytes of data (where +.Fa size +was specified at queue creation time) from the +.Fa data +buffer to the +.Fa alq . +Note that it is an error to call .Fn alq_write -will be allowed to -.Xr tsleep 9 . +on a variable length mode queue. .Pp The .Fn alq_flush @@ -146,61 +248,136 @@ function is used for flushing .Fa alq to the log medium that was passed to .Fn alq_open . +If +.Fa alq +has data to flush and is not already in the process of being flushed, the +function will block doing IO. +Otherwise, the function will return immediately. .Pp The .Fn alq_close -function will close the asynchronous logging queue, -.Fa alq , +function will close the asynchronous logging queue +.Fa alq and flush all pending write requests to the log medium. It will free all resources that were previously allocated. .Pp The -.Fn alq_get -function returns the next available asynchronous logging entry -from the queue, -.Fa alq . -This function leaves the queue in a locked state, until a subsequent +.Fn alq_getn +function returns an asynchronous log entry from +.Fa alq , +initialised to point at a buffer capable of receiving +.Fa len +bytes of data. +This function leaves +.Fa alq +in a locked state, until a subsequent .Fn alq_post +or +.Fn alq_post_flags call is made. -In the event that -.Fn alq_get -could not retrieve an entry immediately, it will -.Xr tsleep 9 +If +.Fn alq_getn +could not obtain +.Fa len +bytes of buffer immediately and +.Dv ALQ_WAITOK +is set in +.Fa flags , +the function will be allowed to +.Xr msleep_spin 9 with the -.Dq Li alqget +.Dq Li alqgnord +or +.Dq Li alqgnres wait message. +The caller can choose to write less than +.Fa len +bytes of data to the returned asynchronous log entry by setting the entry's +ae_bytesused field to the number of bytes actually written. +This must be done prior to calling +.Fn alq_post . .Pp -The -.Fn alq_post -function schedules the asynchronous logging entry, -.Fa ale , -which is retrieved using the +The deprecated .Fn alq_get -function, -for writing to the asynchronous logging queue, +function is implemented as a wrapper around +.Fn alq_getn +to provide backwards compatibility to consumers that have not been updated to +utilise variable length mode queues. +The asynchronous log entry returned will be initialised to point at a buffer +capable of receiving +.Fa size +bytes of data (where +.Fa size +was specified at queue creation time). +Note that it is an error to call +.Fn alq_get +on a variable length mode queue. +.Pp +The +.Fn alq_post_flags +function schedules the asynchronous log entry +.Fa ale +(obtained from +.Fn alq_getn +or +.Fn alq_get ) +for writing to .Fa alq . -This function leaves the queue, -.Fa alq , +The ALQ_NOACTIVATE flag may be passed in via +.Fa flags +to indicate that the queue should not be immediately scheduled to be flushed to +disk. +This function leaves +.Fa alq in an unlocked state. +.Pp +The +.Fn alq_post +function is implemented as a wrapper around +.Fn alq_post_flags +to provide backwards compatibility to consumers that have not been updated to +utilise the newer +.Fn alq_post_flags +function. +It simply passes all arguments through to +.Fn alq_post_flags +untouched, and sets +.Fa flags +to 0. .Sh IMPLEMENTATION NOTES The +.Fn alq_writen +and .Fn alq_write -function is a wrapper around the +functions both perform a +.Xr bcopy 3 +from the supplied +.Fa data +buffer into the underlying +.Nm +buffer. +Performance critical code paths may wish to consider using +.Fn alq_getn +(variable length queues) or +.Fn alq_get +(fixed length queues) to avoid the extra memory copy. Note that a queue +remains locked between calls to +.Fn alq_getn +or .Fn alq_get and .Fn alq_post -functions; by using these functions separately, a call -to -.Fn bcopy -can be avoided for performance critical code paths. +or +.Fn alq_post_flags , +so this method of writing to a queue is unsuitable for situations where the +time between calls may be substantial. .Sh LOCKING -Each asynchronous queue is protected by a spin mutex. +Each asynchronous logging queue is protected by a spin mutex. .Pp Functions -.Fn alq_flush , -.Fn alq_open +.Fn alq_flush and -.Fn alq_post +.Fn alq_open may attempt to acquire an internal sleep mutex, and should consequently not be used in contexts where sleeping is not allowed. @@ -214,32 +391,36 @@ if it fails to open or else it returns 0. .Pp The +.Fn alq_writen +and .Fn alq_write -function returns +functions return .Er EWOULDBLOCK if .Dv ALQ_NOWAIT -was provided as a value to -.Fa waitok -and either the queue is full, or when the system is shutting down. +was set in +.Fa flags +and either the queue is full or the system is shutting down. .Pp The +.Fn alq_getn +and .Fn alq_get -function returns -.Dv NULL , +functions return +.Dv NULL if .Dv ALQ_NOWAIT -was provided as a value to -.Fa waitok -and either the queue is full, or when the system is shutting down. +was set in +.Fa flags +and either the queue is full or the system is shutting down. .Pp NOTE: invalid arguments to non-void functions will result in undefined behaviour. .Sh SEE ALSO -.Xr syslog 3 , -.Xr kthread 9 , +.Xr kproc 9 , .Xr ktr 9 , -.Xr tsleep 9 , +.Xr msleep_spin 9 , +.Xr syslog 3 , .Xr vnode 9 .Sh HISTORY The @@ -250,7 +431,11 @@ Asynchronous Logging Queues (ALQ) facili The .Nm facility was written by -.An Jeffrey Roberson Aq jeff@FreeBSD.org . +.An Jeffrey Roberson Aq jeff@FreeBSD.org +and extended by +.An Lawrence Stewart Aq lstewart@freebsd.org . .Pp This manual page was written by -.An Hiten Pandya Aq hmp@FreeBSD.org . +.An Hiten Pandya Aq hmp@FreeBSD.org +and revised by +.An Lawrence Stewart Aq lstewart@freebsd.org . Modified: stable/8/sys/kern/kern_alq.c ============================================================================== --- stable/8/sys/kern/kern_alq.c Thu Jul 8 03:28:25 2010 (r209787) +++ stable/8/sys/kern/kern_alq.c Thu Jul 8 03:28:25 2010 (r209788) @@ -55,16 +55,23 @@ __FBSDID("$FreeBSD$"); /* Async. Logging Queue */ struct alq { + char *aq_entbuf; /* Buffer for stored entries */ int aq_entmax; /* Max entries */ int aq_entlen; /* Entry length */ - char *aq_entbuf; /* Buffer for stored entries */ + int aq_freebytes; /* Bytes available in buffer */ + int aq_buflen; /* Total length of our buffer */ + int aq_writehead; /* Location for next write */ + int aq_writetail; /* Flush starts at this location */ + int aq_wrapearly; /* # bytes left blank at end of buf */ int aq_flags; /* Queue flags */ + int aq_waiters; /* Num threads waiting for resources + * NB: Used as a wait channel so must + * not be first field in the alq struct + */ + struct ale aq_getpost; /* ALE for use by get/post */ struct mtx aq_mtx; /* Queue lock */ struct vnode *aq_vp; /* Open vnode handle */ struct ucred *aq_cred; /* Credentials of the opening thread */ - struct ale *aq_first; /* First ent */ - struct ale *aq_entfree; /* First free ent */ - struct ale *aq_entvalid; /* First ent valid for writing */ LIST_ENTRY(alq) aq_act; /* List of active queues */ LIST_ENTRY(alq) aq_link; /* List of all queues */ }; @@ -73,10 +80,14 @@ struct alq { #define AQ_ACTIVE 0x0002 /* on the active list */ #define AQ_FLUSHING 0x0004 /* doing IO */ #define AQ_SHUTDOWN 0x0008 /* Queue no longer valid */ +#define AQ_ORDERED 0x0010 /* Queue enforces ordered writes */ +#define AQ_LEGACY 0x0020 /* Legacy queue (fixed length writes) */ #define ALQ_LOCK(alq) mtx_lock_spin(&(alq)->aq_mtx) #define ALQ_UNLOCK(alq) mtx_unlock_spin(&(alq)->aq_mtx) +#define HAS_PENDING_DATA(alq) ((alq)->aq_freebytes != (alq)->aq_buflen) + static MALLOC_DEFINE(M_ALD, "ALD", "ALD"); /* @@ -205,7 +216,7 @@ ald_daemon(void) needwakeup = alq_doio(alq); ALQ_UNLOCK(alq); if (needwakeup) - wakeup(alq); + wakeup_one(alq); ALD_LOCK(); } @@ -252,6 +263,20 @@ alq_shutdown(struct alq *alq) /* Stop any new writers. */ alq->aq_flags |= AQ_SHUTDOWN; + /* + * If the ALQ isn't active but has unwritten data (possible if + * the ALQ_NOACTIVATE flag has been used), explicitly activate the + * ALQ here so that the pending data gets flushed by the ald_daemon. + */ + if (!(alq->aq_flags & AQ_ACTIVE) && HAS_PENDING_DATA(alq)) { + alq->aq_flags |= AQ_ACTIVE; + ALQ_UNLOCK(alq); + ALD_LOCK(); + ald_activate(alq); + ALD_UNLOCK(); + ALQ_LOCK(alq); + } + /* Drain IO */ while (alq->aq_flags & AQ_ACTIVE) { alq->aq_flags |= AQ_WANTED; @@ -271,7 +296,6 @@ alq_destroy(struct alq *alq) alq_shutdown(alq); mtx_destroy(&alq->aq_mtx); - free(alq->aq_first, M_ALD); free(alq->aq_entbuf, M_ALD); free(alq, M_ALD); } @@ -287,46 +311,54 @@ alq_doio(struct alq *alq) struct vnode *vp; struct uio auio; struct iovec aiov[2]; - struct ale *ale; - struct ale *alstart; int totlen; int iov; int vfslocked; + int wrapearly; + + KASSERT((HAS_PENDING_DATA(alq)), ("%s: queue empty!", __func__)); vp = alq->aq_vp; td = curthread; totlen = 0; - iov = 0; - - alstart = ale = alq->aq_entvalid; - alq->aq_entvalid = NULL; + iov = 1; + wrapearly = alq->aq_wrapearly; bzero(&aiov, sizeof(aiov)); bzero(&auio, sizeof(auio)); - do { - if (aiov[iov].iov_base == NULL) - aiov[iov].iov_base = ale->ae_data; - aiov[iov].iov_len += alq->aq_entlen; - totlen += alq->aq_entlen; - /* Check to see if we're wrapping the buffer */ - if (ale->ae_data + alq->aq_entlen != ale->ae_next->ae_data) - iov++; - ale->ae_flags &= ~AE_VALID; - ale = ale->ae_next; - } while (ale->ae_flags & AE_VALID); + /* Start the write from the location of our buffer tail pointer. */ + aiov[0].iov_base = alq->aq_entbuf + alq->aq_writetail; + + if (alq->aq_writetail < alq->aq_writehead) { + /* Buffer not wrapped. */ + totlen = aiov[0].iov_len = alq->aq_writehead - alq->aq_writetail; + } else if (alq->aq_writehead == 0) { + /* Buffer not wrapped (special case to avoid an empty iov). */ + totlen = aiov[0].iov_len = alq->aq_buflen - alq->aq_writetail - + wrapearly; + } else { + /* + * Buffer wrapped, requires 2 aiov entries: + * - first is from writetail to end of buffer + * - second is from start of buffer to writehead + */ + aiov[0].iov_len = alq->aq_buflen - alq->aq_writetail - + wrapearly; + iov++; + aiov[1].iov_base = alq->aq_entbuf; + aiov[1].iov_len = alq->aq_writehead; + totlen = aiov[0].iov_len + aiov[1].iov_len; + } alq->aq_flags |= AQ_FLUSHING; ALQ_UNLOCK(alq); - if (iov == 2 || aiov[iov].iov_base == NULL) - iov--; - auio.uio_iov = &aiov[0]; auio.uio_offset = 0; auio.uio_segflg = UIO_SYSSPACE; auio.uio_rw = UIO_WRITE; - auio.uio_iovcnt = iov + 1; + auio.uio_iovcnt = iov; auio.uio_resid = totlen; auio.uio_td = td; @@ -350,8 +382,28 @@ alq_doio(struct alq *alq) ALQ_LOCK(alq); alq->aq_flags &= ~AQ_FLUSHING; - if (alq->aq_entfree == NULL) - alq->aq_entfree = alstart; + /* Adjust writetail as required, taking into account wrapping. */ + alq->aq_writetail = (alq->aq_writetail + totlen + wrapearly) % + alq->aq_buflen; + alq->aq_freebytes += totlen + wrapearly; + + /* + * If we just flushed part of the buffer which wrapped, reset the + * wrapearly indicator. + */ + if (wrapearly) + alq->aq_wrapearly = 0; + + /* + * If we just flushed the buffer completely, reset indexes to 0 to + * minimise buffer wraps. + * This is also required to ensure alq_getn() can't wedge itself. + */ + if (!HAS_PENDING_DATA(alq)) + alq->aq_writehead = alq->aq_writetail = 0; + + KASSERT((alq->aq_writetail >= 0 && alq->aq_writetail < alq->aq_buflen), + ("%s: aq_writetail < 0 || aq_writetail >= aq_buflen", __func__)); if (alq->aq_flags & AQ_WANTED) { alq->aq_flags &= ~AQ_WANTED; @@ -376,27 +428,27 @@ SYSINIT(ald, SI_SUB_LOCK, SI_ORDER_ANY, /* * Create the queue data structure, allocate the buffer, and open the file. */ + int -alq_open(struct alq **alqp, const char *file, struct ucred *cred, int cmode, - int size, int count) +alq_open_flags(struct alq **alqp, const char *file, struct ucred *cred, int cmode, + int size, int flags) { struct thread *td; struct nameidata nd; - struct ale *ale; - struct ale *alp; struct alq *alq; - char *bufp; - int flags; + int oflags; int error; - int i, vfslocked; + int vfslocked; + + KASSERT((size > 0), ("%s: size <= 0", __func__)); *alqp = NULL; td = curthread; NDINIT(&nd, LOOKUP, NOFOLLOW | MPSAFE, UIO_SYSSPACE, file, td); - flags = FWRITE | O_NOFOLLOW | O_CREAT; + oflags = FWRITE | O_NOFOLLOW | O_CREAT; - error = vn_open_cred(&nd, &flags, cmode, 0, cred, NULL); + error = vn_open_cred(&nd, &oflags, cmode, 0, cred, NULL); if (error) return (error); @@ -407,31 +459,20 @@ alq_open(struct alq **alqp, const char * VFS_UNLOCK_GIANT(vfslocked); alq = malloc(sizeof(*alq), M_ALD, M_WAITOK|M_ZERO); - alq->aq_entbuf = malloc(count * size, M_ALD, M_WAITOK|M_ZERO); - alq->aq_first = malloc(sizeof(*ale) * count, M_ALD, M_WAITOK|M_ZERO); alq->aq_vp = nd.ni_vp; alq->aq_cred = crhold(cred); - alq->aq_entmax = count; - alq->aq_entlen = size; - alq->aq_entfree = alq->aq_first; mtx_init(&alq->aq_mtx, "ALD Queue", NULL, MTX_SPIN|MTX_QUIET); - bufp = alq->aq_entbuf; - ale = alq->aq_first; - alp = NULL; - - /* Match up entries with buffers */ - for (i = 0; i < count; i++) { - if (alp) - alp->ae_next = ale; - ale->ae_data = bufp; - alp = ale; - ale++; - bufp += size; - } - - alp->ae_next = alq->aq_first; + alq->aq_buflen = size; + alq->aq_entmax = 0; + alq->aq_entlen = 0; + + alq->aq_freebytes = alq->aq_buflen; + alq->aq_entbuf = malloc(alq->aq_buflen, M_ALD, M_WAITOK|M_ZERO); + alq->aq_writehead = alq->aq_writetail = 0; + if (flags & ALQ_ORDERED) + alq->aq_flags |= AQ_ORDERED; if ((error = ald_add(alq)) != 0) { alq_destroy(alq); @@ -443,77 +484,405 @@ alq_open(struct alq **alqp, const char * return (0); } +int +alq_open(struct alq **alqp, const char *file, struct ucred *cred, int cmode, + int size, int count) +{ + int ret; + + KASSERT((count >= 0), ("%s: count < 0", __func__)); + + if (count > 0) { + ret = alq_open_flags(alqp, file, cred, cmode, size*count, 0); + (*alqp)->aq_flags |= AQ_LEGACY; + (*alqp)->aq_entmax = count; + (*alqp)->aq_entlen = size; + } else + ret = alq_open_flags(alqp, file, cred, cmode, size, 0); + + return (ret); +} + + /* * Copy a new entry into the queue. If the operation would block either * wait or return an error depending on the value of waitok. */ int -alq_write(struct alq *alq, void *data, int waitok) +alq_writen(struct alq *alq, void *data, int len, int flags) { - struct ale *ale; + int activate, copy, ret; + void *waitchan; + + KASSERT((len > 0 && len <= alq->aq_buflen), + ("%s: len <= 0 || len > aq_buflen", __func__)); - if ((ale = alq_get(alq, waitok)) == NULL) + activate = ret = 0; + copy = len; + waitchan = NULL; + + ALQ_LOCK(alq); + + /* + * Fail to perform the write and return EWOULDBLOCK if: + * - The message is larger than our underlying buffer. + * - The ALQ is being shutdown. + * - There is insufficient free space in our underlying buffer + * to accept the message and the user can't wait for space. + * - There is insufficient free space in our underlying buffer + * to accept the message and the alq is inactive due to prior + * use of the ALQ_NOACTIVATE flag (which would lead to deadlock). + */ + if (len > alq->aq_buflen || + alq->aq_flags & AQ_SHUTDOWN || + (((flags & ALQ_NOWAIT) || (!(alq->aq_flags & AQ_ACTIVE) && + HAS_PENDING_DATA(alq))) && alq->aq_freebytes < len)) { + ALQ_UNLOCK(alq); return (EWOULDBLOCK); + } - bcopy(data, ale->ae_data, alq->aq_entlen); - alq_post(alq, ale); + /* + * If we want ordered writes and there is already at least one thread + * waiting for resources to become available, sleep until we're woken. + */ + if (alq->aq_flags & AQ_ORDERED && alq->aq_waiters > 0) { + KASSERT(!(flags & ALQ_NOWAIT), + ("%s: ALQ_NOWAIT set but incorrectly ignored!", __func__)); + alq->aq_waiters++; + msleep_spin(&alq->aq_waiters, &alq->aq_mtx, "alqwnord", 0); + alq->aq_waiters--; + } - return (0); + /* + * (ALQ_WAITOK && aq_freebytes < len) or aq_freebytes >= len, either + * enter while loop and sleep until we have enough free bytes (former) + * or skip (latter). If AQ_ORDERED is set, only 1 thread at a time will + * be in this loop. Otherwise, multiple threads may be sleeping here + * competing for ALQ resources. + */ + while (alq->aq_freebytes < len && !(alq->aq_flags & AQ_SHUTDOWN)) { + KASSERT(!(flags & ALQ_NOWAIT), + ("%s: ALQ_NOWAIT set but incorrectly ignored!", __func__)); + alq->aq_flags |= AQ_WANTED; + alq->aq_waiters++; + if (waitchan) + wakeup(waitchan); + msleep_spin(alq, &alq->aq_mtx, "alqwnres", 0); + alq->aq_waiters--; + + /* + * If we're the first thread to wake after an AQ_WANTED wakeup + * but there isn't enough free space for us, we're going to loop + * and sleep again. If there are other threads waiting in this + * loop, schedule a wakeup so that they can see if the space + * they require is available. + */ + if (alq->aq_waiters > 0 && !(alq->aq_flags & AQ_ORDERED) && + alq->aq_freebytes < len && !(alq->aq_flags & AQ_WANTED)) + waitchan = alq; + else + waitchan = NULL; + } + + /* + * If there are waiters, we need to signal the waiting threads after we + * complete our work. The alq ptr is used as a wait channel for threads + * requiring resources to be freed up. In the AQ_ORDERED case, threads + * are not allowed to concurrently compete for resources in the above + * while loop, so we use a different wait channel in this case. + */ + if (alq->aq_waiters > 0) { + if (alq->aq_flags & AQ_ORDERED) + waitchan = &alq->aq_waiters; + else + waitchan = alq; + } else + waitchan = NULL; + + /* Bail if we're shutting down. */ + if (alq->aq_flags & AQ_SHUTDOWN) { + ret = EWOULDBLOCK; + goto unlock; + } + + /* + * If we need to wrap the buffer to accommodate the write, + * we'll need 2 calls to bcopy. + */ + if ((alq->aq_buflen - alq->aq_writehead) < len) + copy = alq->aq_buflen - alq->aq_writehead; + + /* Copy message (or part thereof if wrap required) to the buffer. */ + bcopy(data, alq->aq_entbuf + alq->aq_writehead, copy); + alq->aq_writehead += copy; + + if (alq->aq_writehead >= alq->aq_buflen) { + KASSERT((alq->aq_writehead == alq->aq_buflen), + ("%s: alq->aq_writehead (%d) > alq->aq_buflen (%d)", + __func__, + alq->aq_writehead, + alq->aq_buflen)); + alq->aq_writehead = 0; + } + + if (copy != len) { + /* + * Wrap the buffer by copying the remainder of our message + * to the start of the buffer and resetting aq_writehead. + */ + bcopy(((uint8_t *)data)+copy, alq->aq_entbuf, len - copy); + alq->aq_writehead = len - copy; + } + + KASSERT((alq->aq_writehead >= 0 && alq->aq_writehead < alq->aq_buflen), + ("%s: aq_writehead < 0 || aq_writehead >= aq_buflen", __func__)); + + alq->aq_freebytes -= len; + + if (!(alq->aq_flags & AQ_ACTIVE) && !(flags & ALQ_NOACTIVATE)) { + alq->aq_flags |= AQ_ACTIVE; + activate = 1; + } + + KASSERT((HAS_PENDING_DATA(alq)), ("%s: queue empty!", __func__)); + +unlock: + ALQ_UNLOCK(alq); + + if (activate) { + ALD_LOCK(); + ald_activate(alq); + ALD_UNLOCK(); + } + + /* NB: We rely on wakeup_one waking threads in a FIFO manner. */ + if (waitchan != NULL) + wakeup_one(waitchan); + + return (ret); +} + +int +alq_write(struct alq *alq, void *data, int flags) +{ + /* Should only be called in fixed length message (legacy) mode. */ + KASSERT((alq->aq_flags & AQ_LEGACY), + ("%s: fixed length write on variable length queue", __func__)); + return (alq_writen(alq, data, alq->aq_entlen, flags)); } +/* + * Retrieve a pointer for the ALQ to write directly into, avoiding bcopy. + */ struct ale * -alq_get(struct alq *alq, int waitok) +alq_getn(struct alq *alq, int len, int flags) { - struct ale *ale; - struct ale *aln; + int contigbytes; + void *waitchan; + + KASSERT((len > 0 && len <= alq->aq_buflen), + ("%s: len <= 0 || len > alq->aq_buflen", __func__)); - ale = NULL; + waitchan = NULL; ALQ_LOCK(alq); - /* Loop until we get an entry or we're shutting down */ - while ((alq->aq_flags & AQ_SHUTDOWN) == 0 && - (ale = alq->aq_entfree) == NULL && - (waitok & ALQ_WAITOK)) { + /* + * Determine the number of free contiguous bytes. + * We ensure elsewhere that if aq_writehead == aq_writetail because + * the buffer is empty, they will both be set to 0 and therefore + * aq_freebytes == aq_buflen and is fully contiguous. + * If they are equal and the buffer is not empty, aq_freebytes will + * be 0 indicating the buffer is full. + */ + if (alq->aq_writehead <= alq->aq_writetail) + contigbytes = alq->aq_freebytes; + else { + contigbytes = alq->aq_buflen - alq->aq_writehead; + + if (contigbytes < len) { + /* + * Insufficient space at end of buffer to handle a + * contiguous write. Wrap early if there's space at + * the beginning. This will leave a hole at the end + * of the buffer which we will have to skip over when + * flushing the buffer to disk. + */ + if (alq->aq_writetail >= len || flags & ALQ_WAITOK) { + /* Keep track of # bytes left blank. */ + alq->aq_wrapearly = contigbytes; + /* Do the wrap and adjust counters. */ + contigbytes = alq->aq_freebytes = + alq->aq_writetail; + alq->aq_writehead = 0; + } + } + } + + /* *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 03:35:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6202106564A; Thu, 8 Jul 2010 03:35:00 +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 871D18FC19; Thu, 8 Jul 2010 03:35:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o683Z0kU090937; Thu, 8 Jul 2010 03:35:00 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o683Z0wx090934; Thu, 8 Jul 2010 03:35:00 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201007080335.o683Z0wx090934@svn.freebsd.org> From: Alan Cox Date: Thu, 8 Jul 2010 03:35: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: r209789 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 03:35:00 -0000 Author: alc Date: Thu Jul 8 03:35:00 2010 New Revision: 209789 URL: http://svn.freebsd.org/changeset/base/209789 Log: Correctly maintain the per-cpu field "curpmap" on amd64 just like we do on i386. The consequences of not doing so on amd64 became apparent with the introduction of the COUNT_IPIS and COUNT_XINVLTLB_HITS options. Specifically, single-threaded applications were generating unnecessary IPIs to shoot-down the TLB on other processors. However, this is clearly nonsensical because a single-threaded application is only running on the current processor. The reason that this happens is that pmap_activate() is unable to properly update the old pmap's field "pm_active" without the correct "curpmap". So, in effect, stale bits in "pm_active" were leading pmap_protect(), pmap_remove(), pmap_remove_pages(), etc. to flush the TLB contents on some arbitrary processor that wasn't even running the same application. Reviewed by: kib MFC after: 3 weeks Modified: head/sys/amd64/amd64/cpu_switch.S head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Thu Jul 8 03:28:25 2010 (r209788) +++ head/sys/amd64/amd64/cpu_switch.S Thu Jul 8 03:35:00 2010 (r209789) @@ -69,16 +69,13 @@ * %rsi = newtd */ ENTRY(cpu_throw) + movl PCPU(CPUID),%eax testq %rdi,%rdi - jnz 1f - movq PCPU(IDLETHREAD),%rdi -1: - movq TD_PCB(%rdi),%r8 /* Old pcb */ - movl PCPU(CPUID), %eax + jz 1f /* release bit from old pm_active */ - movq TD_PROC(%rdi), %rdx /* oldtd->td_proc */ - movq P_VMSPACE(%rdx), %rdx /* proc->p_vmspace */ - LK btrl %eax, VM_PMAP+PM_ACTIVE(%rdx) /* clear old */ + movq PCPU(CURPMAP),%rdx + LK btrl %eax,PM_ACTIVE(%rdx) /* clear old */ +1: movq TD_PCB(%rsi),%r8 /* newtd->td_proc */ movq PCB_CR3(%r8),%rdx movq %rdx,%cr3 /* new address space */ @@ -140,15 +137,16 @@ swinact: movq %rcx,%cr3 /* new address space */ movl PCPU(CPUID), %eax /* Release bit from old pmap->pm_active */ - movq TD_PROC(%rdi), %rcx /* oldproc */ - movq P_VMSPACE(%rcx), %rcx - LK btrl %eax, VM_PMAP+PM_ACTIVE(%rcx) /* clear old */ + movq PCPU(CURPMAP),%rcx + LK btrl %eax,PM_ACTIVE(%rcx) /* clear old */ SETLK %rdx, TD_LOCK(%rdi) /* Release the old thread */ swact: /* Set bit in new pmap->pm_active */ movq TD_PROC(%rsi),%rdx /* newproc */ movq P_VMSPACE(%rdx), %rdx - LK btsl %eax, VM_PMAP+PM_ACTIVE(%rdx) /* set new */ + addq $VM_PMAP,%rdx + LK btsl %eax,PM_ACTIVE(%rdx) /* set new */ + movq %rdx,PCPU(CURPMAP) sw1: #if defined(SCHED_ULE) && defined(SMP) Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Jul 8 03:28:25 2010 (r209788) +++ head/sys/amd64/amd64/pmap.c Thu Jul 8 03:35:00 2010 (r209789) @@ -1574,6 +1574,7 @@ pmap_pinit0(pmap_t pmap) pmap->pm_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(KPML4phys); pmap->pm_root = NULL; pmap->pm_active = 0; + PCPU_SET(curpmap, pmap); TAILQ_INIT(&pmap->pm_pvchunk); bzero(&pmap->pm_stats, sizeof pmap->pm_stats); } @@ -5008,6 +5009,7 @@ if (oldpmap) /* XXX FIXME */ cr3 = DMAP_TO_PHYS((vm_offset_t)pmap->pm_pml4); td->td_pcb->pcb_cr3 = cr3; load_cr3(cr3); + PCPU_SET(curpmap, pmap); critical_exit(); } From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 03:41:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDF0F1065672; Thu, 8 Jul 2010 03:41:57 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1E988FC17; Thu, 8 Jul 2010 03:41:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o683fvgd092592; Thu, 8 Jul 2010 03:41:57 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o683fvAH092590; Thu, 8 Jul 2010 03:41:57 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201007080341.o683fvAH092590@svn.freebsd.org> From: Lawrence Stewart Date: Thu, 8 Jul 2010 03:41:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209790 - stable/8/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 03:41:58 -0000 Author: lstewart Date: Thu Jul 8 03:41:57 2010 New Revision: 209790 URL: http://svn.freebsd.org/changeset/base/209790 Log: MFC r209119,209325: - Add a utility macro to simplify calculating an aggregate sum from a DPCPU counter variable. - Rename the internal for loop iterator to "_i" to avoid potential shadowing of external variables named "i". The "_" prefix is reserved for infrastructure type code and is therefore not expected to be used by normal code likely to call DPCPU_SUM(). [1] - Change DPCPU_SUM to return the sum rather than calculate and assign it internally. Usage is now: "sum = DPCPU_SUM(dpcpu_var, member_to_sum);" [2] - Fix some style nits. [3] Sponsored by: FreeBSD Foundation Suggested by: bde [3], mdf [1], kib [1,2], pjd [1,3] Reviewed by: jhb, rpaulo, rwatson (old version of r209119), kib (r209325) Modified: stable/8/sys/sys/pcpu.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sys/pcpu.h ============================================================================== --- stable/8/sys/sys/pcpu.h Thu Jul 8 03:35:00 2010 (r209789) +++ stable/8/sys/sys/pcpu.h Thu Jul 8 03:41:57 2010 (r209790) @@ -109,6 +109,21 @@ extern uintptr_t dpcpu_off[]; #define DPCPU_ID_GET(i, n) (*DPCPU_ID_PTR(i, n)) #define DPCPU_ID_SET(i, n, v) (*DPCPU_ID_PTR(i, n) = v) +/* + * Utility macros. + */ +#define DPCPU_SUM(n, var) __extension__ \ +({ \ + u_int _i; \ + __typeof((DPCPU_PTR(n))->var) sum; \ + \ + sum = 0; \ + CPU_FOREACH(_i) { \ + sum += (DPCPU_ID_PTR(_i, n))->var; \ + } \ + sum; \ +}) + /* * XXXUPS remove as soon as we have per cpu variable * linker sets and can define rm_queue in _rm_lock.h From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 08:13:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 106F7106564A; Thu, 8 Jul 2010 08:13:22 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id B8E9D8FC21; Thu, 8 Jul 2010 08:13:21 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id AFFD014DBFAD; Thu, 8 Jul 2010 10:13:19 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id LVsKjrDr2Yuu; Thu, 8 Jul 2010 10:13:16 +0200 (CEST) Received: from [192.168.1.105] (catv-80-99-92-167.catv.broadband.hu [80.99.92.167]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id A9ECD14DBFA6; Thu, 8 Jul 2010 10:13:16 +0200 (CEST) Message-ID: <4C358891.5010502@FreeBSD.org> Date: Thu, 08 Jul 2010 10:13:05 +0200 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-PT; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: Randi Harper References: <201007080328.o683SP5k089410@svn.freebsd.org> In-Reply-To: <201007080328.o683SP5k089410@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; 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: r209787 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 08:13:22 -0000 Em 2010.07.08. 5:28, Randi Harper escreveu: > Author: randi > Date: Thu Jul 8 03:28:25 2010 > New Revision: 209787 > URL: http://svn.freebsd.org/changeset/base/209787 > > Log: > Remove the ability to upgrade via sysinstall. This feature has been flaky > and broken for a number of years. freebsd-update now provides a reasonable > way to handle upgrades, so keeping this functionality in sysinstall only > serves to mislead users. > > Approved by: cperciva (mentor) > Please revert. It has never been discussed in FreeBSD mailing lists, while it is mandatory before such important changes. I just used this feature yesterday to repair my -CURRENT installation on a netbook with an USB snapshot image. First I tried freebsd-update but it just failed to fetch the keys from the servers and was unable to produce any sensual error message so I had to fall back to this "flaky" and "broken" feature, which in contrast perfectly worked. I'm sure there are others who have used it recently. Gabor From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 08:31:46 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64EE0106564A; Thu, 8 Jul 2010 08:31:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id D67E08FC17; Thu, 8 Jul 2010 08:31:45 +0000 (UTC) Received: from c122-106-145-25.carlnfd1.nsw.optusnet.com.au (c122-106-145-25.carlnfd1.nsw.optusnet.com.au [122.106.145.25]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o688VfZp027608 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 8 Jul 2010 18:31:43 +1000 Date: Thu, 8 Jul 2010 18:31:41 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Rui Paulo In-Reply-To: <201007071208.o67C8wRC085042@svn.freebsd.org> Message-ID: <20100708183126.L58215@delplex.bde.org> References: <201007071208.o67C8wRC085042@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r209763 - head/sys/amd64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 08:31:46 -0000 On Wed, 7 Jul 2010, Rui Paulo wrote: > Log: > Fix style issues with the previous commit, namely > use-tab-instead-of-space and don't use underscores in macro variables. > > Pointed out by: bde Thanks. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 08:37:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F5E9106564A; Thu, 8 Jul 2010 08:37:51 +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 579158FC1C; Thu, 8 Jul 2010 08:37:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o688bpXY057889; Thu, 8 Jul 2010 08:37:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o688bpAw057886; Thu, 8 Jul 2010 08:37:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201007080837.o688bpAw057886@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 8 Jul 2010 08:37:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209792 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 08:37:51 -0000 Author: kib Date: Thu Jul 8 08:37:51 2010 New Revision: 209792 URL: http://svn.freebsd.org/changeset/base/209792 Log: Make VM_ALLOC_RETRY flag mandatory for vm_page_grab(). Assert that the flag is always provided, and unconditionally retry after sleep for the busy page or failed allocation. The intent is to remove VM_ALLOC_RETRY eventually. Proposed and reviewed by: alc Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Jul 8 04:04:27 2010 (r209791) +++ head/sys/vm/vm_page.c Thu Jul 8 08:37:51 2010 (r209792) @@ -2032,6 +2032,9 @@ vm_page_dontneed(vm_page_t m) * to be in the object. If the page doesn't exist, first allocate it * and then conditionally zero it. * + * The caller must always specify the VM_ALLOC_RETRY flag. This is intended + * to facilitate its eventual removal. + * * This routine may block. */ vm_page_t @@ -2041,22 +2044,20 @@ vm_page_grab(vm_object_t object, vm_pind u_int count; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + KASSERT((allocflags & VM_ALLOC_RETRY) != 0, + ("vm_page_grab: VM_ALLOC_RETRY is required")); retrylookup: if ((m = vm_page_lookup(object, pindex)) != NULL) { if ((m->oflags & VPO_BUSY) != 0 || ((allocflags & VM_ALLOC_IGN_SBUSY) == 0 && m->busy != 0)) { - if ((allocflags & VM_ALLOC_RETRY) != 0) { - /* - * Reference the page before unlocking and - * sleeping so that the page daemon is less - * likely to reclaim it. - */ - vm_page_lock_queues(); - vm_page_flag_set(m, PG_REFERENCED); - } + /* + * Reference the page before unlocking and + * sleeping so that the page daemon is less + * likely to reclaim it. + */ + vm_page_lock_queues(); + vm_page_flag_set(m, PG_REFERENCED); vm_page_sleep(m, "pgrbwt"); - if ((allocflags & VM_ALLOC_RETRY) == 0) - return (NULL); goto retrylookup; } else { if ((allocflags & VM_ALLOC_WIRED) != 0) { @@ -2078,8 +2079,6 @@ retrylookup: atomic_add_int(&vm_pageout_deficit, count); VM_WAIT; VM_OBJECT_LOCK(object); - if ((allocflags & VM_ALLOC_RETRY) == 0) - return (NULL); goto retrylookup; } else if (m->valid != 0) return (m); Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Thu Jul 8 04:04:27 2010 (r209791) +++ head/sys/vm/vm_page.h Thu Jul 8 08:37:51 2010 (r209792) @@ -312,7 +312,7 @@ extern struct vpglocks vm_page_queue_loc /* page allocation flags: */ #define VM_ALLOC_WIRED 0x0020 /* non pageable */ #define VM_ALLOC_ZERO 0x0040 /* Try to obtain a zeroed page */ -#define VM_ALLOC_RETRY 0x0080 /* vm_page_grab() only */ +#define VM_ALLOC_RETRY 0x0080 /* Mandatory with vm_page_grab() */ #define VM_ALLOC_NOOBJ 0x0100 /* No associated object */ #define VM_ALLOC_NOBUSY 0x0200 /* Do not busy the page */ #define VM_ALLOC_IFCACHED 0x0400 /* Fail if the page is not cached */ From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 08:39:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D577F106564A; Thu, 8 Jul 2010 08:39:02 +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 C75BD8FC13; Thu, 8 Jul 2010 08:39:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o688d2wA058191; Thu, 8 Jul 2010 08:39:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o688d2PM058189; Thu, 8 Jul 2010 08:39:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201007080839.o688d2PM058189@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 8 Jul 2010 08:39: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: r209793 - head/sys/dev/agp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 08:39:02 -0000 Author: kib Date: Thu Jul 8 08:39:02 2010 New Revision: 209793 URL: http://svn.freebsd.org/changeset/base/209793 Log: Do not mention VM_ALLOC_RETRY in comment, and normalize the terminology (blocking -> sleeping). Reviewed by: alc MFC after: 3 days Modified: head/sys/dev/agp/agp.c Modified: head/sys/dev/agp/agp.c ============================================================================== --- head/sys/dev/agp/agp.c Thu Jul 8 08:37:51 2010 (r209792) +++ head/sys/dev/agp/agp.c Thu Jul 8 08:39:02 2010 (r209793) @@ -537,8 +537,8 @@ agp_generic_bind_memory(device_t dev, st /* * Allocate the pages early, before acquiring the lock, - * because vm_page_grab() used with VM_ALLOC_RETRY may - * block and we can't hold a mutex while blocking. + * because vm_page_grab() may sleep and we can't hold a mutex + * while sleeping. */ VM_OBJECT_LOCK(mem->am_obj); for (i = 0; i < mem->am_size; i += PAGE_SIZE) { From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 08:53:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 8008C106567F for ; Thu, 8 Jul 2010 08:53:11 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from xps.daemonology.net (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx2.freebsd.org (Postfix) with SMTP id 2989215008D for ; Thu, 8 Jul 2010 08:53:10 +0000 (UTC) Received: (qmail 23232 invoked from network); 8 Jul 2010 08:53:09 -0000 Received: from unknown (HELO xps.daemonology.net) (127.0.0.1) by localhost with SMTP; 8 Jul 2010 08:53:09 -0000 Message-ID: <4C3591F5.2040401@freebsd.org> Date: Thu, 08 Jul 2010 01:53:09 -0700 From: Colin Percival User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.10) Gecko/20100627 Thunderbird/3.0.5 MIME-Version: 1.0 To: Gabor Kovesdan References: <201007080328.o683SP5k089410@svn.freebsd.org> <4C358891.5010502@FreeBSD.org> In-Reply-To: <4C358891.5010502@FreeBSD.org> X-Enigmail-Version: 1.0.1 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, Randi Harper Subject: Re: svn commit: r209787 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 08:53:11 -0000 On 07/08/10 01:13, Gabor Kovesdan wrote: > Em 2010.07.08. 5:28, Randi Harper escreveu: >> Remove the ability to upgrade via sysinstall. [...] >> >> Approved by: cperciva (mentor) >> > Please revert. It has never been discussed in FreeBSD mailing lists, > while it is mandatory before such important changes. This was discussed on the freebsd-sysinstall list last month: http://lists.freebsd.org/pipermail/freebsd-sysinstall/2010-June/000012.html My personal feeling was that since the level of interest in sysinstall from FreeBSD developers was generally low, this would be sufficient, so I told randi to go ahead and commit without also adding noise to -arch; but if you think the freebsd-sysinstall list is insufficient I'll get her to back this out pending discussion on -arch. > I just used this > feature yesterday to repair my -CURRENT installation on a netbook with > an USB snapshot image. First I tried freebsd-update but it just failed > to fetch the keys from the servers and was unable to produce any sensual > error message Yes, freebsd-update should print a more useful error message when it is asked to upgrade to a release it doesn't support (freebsd-update only does RELEASEs, BETAs, and RCs). But a more *sensual* message is probably not necessary. :-) -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 09:15:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 63FA01065672; Thu, 8 Jul 2010 09:15:32 +0000 (UTC) Date: Thu, 8 Jul 2010 09:15:32 +0000 From: Alexey Dokuchaev To: Colin Percival Message-ID: <20100708091532.GA5707@FreeBSD.org> References: <201007080328.o683SP5k089410@svn.freebsd.org> <4C358891.5010502@FreeBSD.org> <4C3591F5.2040401@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <4C3591F5.2040401@freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Gabor Kovesdan , Randi Harper Subject: Re: svn commit: r209787 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 09:15:32 -0000 On Thu, Jul 08, 2010 at 01:53:09AM -0700, Colin Percival wrote: > On 07/08/10 01:13, Gabor Kovesdan wrote: > > Em 2010.07.08. 5:28, Randi Harper escreveu: > >> Remove the ability to upgrade via sysinstall. [...] > >> > >> Approved by: cperciva (mentor) > >> > > I just used this feature yesterday to repair my -CURRENT installation > > on a netbook with an USB snapshot image. First I tried freebsd-update > > but it just failed to fetch the keys from the servers and was unable > > to produce any sensual error message [...] > > Yes, freebsd-update should print a more useful error message when it is asked > to upgrade to a release it doesn't support (freebsd-update only does RELEASEs, > BETAs, and RCs). But a more *sensual* message is probably not necessary. :-) He'd probably meant sensitive. Still, if freebsd-update(8) cannot be used as drop-in replacement of sysinstall(8) for functionality in question (and not supporting -CURRENT snapshots that many of us are running proves it cannot), this change should be reverted until universally accepted solution is proposed, tested, and committed. ./danfe From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 09:35:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18F951065670; Thu, 8 Jul 2010 09:35:07 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id 9090F8FC15; Thu, 8 Jul 2010 09:35:06 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id 235FC14DBFAE; Thu, 8 Jul 2010 11:35:05 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id V04cDQ3WiWN5; Thu, 8 Jul 2010 11:35:02 +0200 (CEST) Received: from [192.168.1.105] (catv-80-99-92-167.catv.broadband.hu [80.99.92.167]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id D1AF214DBED6; Thu, 8 Jul 2010 11:35:02 +0200 (CEST) Message-ID: <4C359BC0.9000605@FreeBSD.org> Date: Thu, 08 Jul 2010 11:34:56 +0200 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-PT; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: Colin Percival References: <201007080328.o683SP5k089410@svn.freebsd.org> <4C358891.5010502@FreeBSD.org> <4C3591F5.2040401@freebsd.org> In-Reply-To: <4C3591F5.2040401@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Randi Harper Subject: Re: svn commit: r209787 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 09:35:07 -0000 Em 2010.07.08. 10:53, Colin Percival escreveu: > My personal feeling was that since the level of interest in sysinstall from > FreeBSD developers was generally low, this would be sufficient, so I told > randi to go ahead and commit without also adding noise to -arch; but if you > think the freebsd-sysinstall list is insufficient I'll get her to back this > out pending discussion on -arch. > Imo, it should go to current@. It's the only officially supported installer, which also implies that it's a default piece of software that you just cannot avoid while installing. > >> I just used this >> feature yesterday to repair my -CURRENT installation on a netbook with >> an USB snapshot image. First I tried freebsd-update but it just failed >> to fetch the keys from the servers and was unable to produce any sensual >> error message >> > Yes, freebsd-update should print a more useful error message when it is asked > to upgrade to a release it doesn't support (freebsd-update only does RELEASEs, > BETAs, and RCs). Another reason to keep this feature then. And what if your installation is broken in such a way that you cannot run freebsd-update? Yeah, there is the fixit console and the live system but what if I just want to overwrite my system with the binaries of the installation media without mocking with manual repair? There's no other way to do so, so this feature is still useful. If you want to make it clear that it's not recommended for updates, let's move it to the repair section as "Quick repair from installation media" or something like that. > But a more *sensual* message is probably not necessary. :-) > Sorry, bad English. :) Gabor From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 09:43:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34B9E1065675; Thu, 8 Jul 2010 09:43:17 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id A757E8FC18; Thu, 8 Jul 2010 09:43:16 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id 0B4C714DBFAE; Thu, 8 Jul 2010 11:43:16 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id TPmLe2de4kps; Thu, 8 Jul 2010 11:43:13 +0200 (CEST) Received: from [192.168.1.105] (catv-80-99-92-167.catv.broadband.hu [80.99.92.167]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id D2D0314DBED6; Thu, 8 Jul 2010 11:43:13 +0200 (CEST) Message-ID: <4C359DAC.1060307@FreeBSD.org> Date: Thu, 08 Jul 2010 11:43:08 +0200 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-PT; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: Colin Percival References: <201007080328.o683SP5k089410@svn.freebsd.org> <4C358891.5010502@FreeBSD.org> <4C3591F5.2040401@freebsd.org> In-Reply-To: <4C3591F5.2040401@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Randi Harper Subject: Re: svn commit: r209787 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 09:43:17 -0000 Em 2010.07.08. 10:53, Colin Percival escreveu: >> I just used this >> feature yesterday to repair my -CURRENT installation on a netbook with >> an USB snapshot image. First I tried freebsd-update but it just failed >> to fetch the keys from the servers and was unable to produce any sensual >> error message >> > Yes, freebsd-update should print a more useful error message when it is asked > to upgrade to a release it doesn't support (freebsd-update only does RELEASEs, > BETAs, and RCs). But a more *sensual* message is probably not necessary. :-) > Btw, I'm not the only one who experienced this problem: http://forums.freebsd.org/showthread.php?t=1280 In my case, the system uses Wifi but everything just works with it, except freebsd-update. I don't know how it fetches the keys but that process should not be that difficult to require extra configuration, it should just work out of the box when network is up. Gabor From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 11:21:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60D30106564A; Thu, 8 Jul 2010 11:21:12 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 510568FC1A; Thu, 8 Jul 2010 11:21:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68BLCa4095311; Thu, 8 Jul 2010 11:21:12 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68BLCdV095309; Thu, 8 Jul 2010 11:21:12 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201007081121.o68BLCdV095309@svn.freebsd.org> From: Randall Stewart Date: Thu, 8 Jul 2010 11:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209794 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 11:21:12 -0000 Author: rrs Date: Thu Jul 8 11:21:11 2010 New Revision: 209794 URL: http://svn.freebsd.org/changeset/base/209794 Log: This releases JC from mentorship. He has shown an outstanding ability to work in the community and I think he is Ready ;-) Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Thu Jul 8 08:39:02 2010 (r209793) +++ svnadmin/conf/mentors Thu Jul 8 11:21:11 2010 (r209794) @@ -17,7 +17,6 @@ cbzimmer sam dchagin kib eri mlaier Co-mentor: thompsa gabor delphij -jchandra rrs jinmei gnn mdf zml mm delphij From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 12:20:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3F5B106566B; Thu, 8 Jul 2010 12:20:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2CD68FC1A; Thu, 8 Jul 2010 12:20:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68CKF1w008461; Thu, 8 Jul 2010 12:20:15 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68CKF03008459; Thu, 8 Jul 2010 12:20:15 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201007081220.o68CKF03008459@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 8 Jul 2010 12:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209795 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 12:20:15 -0000 Author: glebius Date: Thu Jul 8 12:20:15 2010 New Revision: 209795 URL: http://svn.freebsd.org/changeset/base/209795 Log: Merge 209589 from head: After processing the O_SKIPTO opcode our cmd points to the next rule, and "match" processing at the end of inner loop would look ahead into the next rule, which is incorrect. Particularly, in the case when the next rule started with F_NOT opcode it was skipped blindly. To fix this, exit the inner loop with the continue operator forcibly and explicitly. PR: kern/147798 Modified: stable/8/sys/netinet/ipfw/ip_fw2.c Modified: stable/8/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw2.c Thu Jul 8 11:21:11 2010 (r209794) +++ stable/8/sys/netinet/ipfw/ip_fw2.c Thu Jul 8 12:20:15 2010 (r209795) @@ -2012,14 +2012,15 @@ do { \ (1 << chain->map[f_pos]->set)); f_pos++) ; - /* prepare to enter the inner loop */ + /* Re-enter the inner loop at the skipto rule. */ f = chain->map[f_pos]; l = f->cmd_len; cmd = f->cmd; match = 1; cmdlen = 0; skip_or = 0; - break; + continue; + break; /* not reached */ case O_REJECT: /* From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 12:21:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08F38106566B; Thu, 8 Jul 2010 12:21:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC44A8FC23; Thu, 8 Jul 2010 12:21:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68CLPun008818; Thu, 8 Jul 2010 12:21:25 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68CLPOc008816; Thu, 8 Jul 2010 12:21:25 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201007081221.o68CLPOc008816@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 8 Jul 2010 12:21:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209796 - stable/8/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 12:21:26 -0000 Author: glebius Date: Thu Jul 8 12:21:25 2010 New Revision: 209796 URL: http://svn.freebsd.org/changeset/base/209796 Log: Merge 209633, 209722 from head: The struct ipfw_rule_ref follows the struct m_tag. Deal with this correctly. This fixes breakage of ng_ipfw(4) in r201527. Submitted by: Alexander Zagrebin Avoid double-free. In error cases ipfw(4) frees the mbuf(4), we don't need to. PR: kern/145462 Modified: stable/8/sys/netgraph/ng_ipfw.c Modified: stable/8/sys/netgraph/ng_ipfw.c ============================================================================== --- stable/8/sys/netgraph/ng_ipfw.c Thu Jul 8 12:20:15 2010 (r209795) +++ stable/8/sys/netgraph/ng_ipfw.c Thu Jul 8 12:21:25 2010 (r209796) @@ -221,20 +221,21 @@ ng_ipfw_findhook1(node_p node, u_int16_t static int ng_ipfw_rcvdata(hook_p hook, item_p item) { - struct ipfw_rule_ref *tag; + struct m_tag *tag; + struct ipfw_rule_ref *r; struct mbuf *m; NGI_GET_M(item, m); NG_FREE_ITEM(item); - tag = (struct ipfw_rule_ref *) - m_tag_locate(m, MTAG_IPFW_RULE, 0, NULL); + tag = m_tag_locate(m, MTAG_IPFW_RULE, 0, NULL); if (tag == NULL) { NG_FREE_M(m); return (EINVAL); /* XXX: find smth better */ }; - if (tag->info & IPFW_INFO_IN) { + r = (struct ipfw_rule_ref *)(tag + 1); + if (r->info & IPFW_INFO_IN) { ip_input(m); return (0); } else { @@ -264,11 +265,8 @@ ng_ipfw_input(struct mbuf **m0, int dir, * Node must be loaded and corresponding hook must be present. */ if (fw_node == NULL || - (hook = ng_ipfw_findhook1(fw_node, fwa->rule.info)) == NULL) { - if (tee == 0) - m_freem(*m0); + (hook = ng_ipfw_findhook1(fw_node, fwa->rule.info)) == NULL) return (ESRCH); /* no hook associated with this rule */ - } /* * We have two modes: in normal mode we add a tag to packet, which is From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 13:07:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE238106564A; Thu, 8 Jul 2010 13:07:40 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADF8B8FC0A; Thu, 8 Jul 2010 13:07:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68D7eXF019002; Thu, 8 Jul 2010 13:07:40 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68D7e0G019001; Thu, 8 Jul 2010 13:07:40 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201007081307.o68D7e0G019001@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 8 Jul 2010 13:07: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: r209797 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 13:07:40 -0000 Author: glebius Date: Thu Jul 8 13:07:40 2010 New Revision: 209797 URL: http://svn.freebsd.org/changeset/base/209797 Log: Since r209216 bpf(4) searches for mbuf_tags(9) and thus will not work with a stub m_hdr instead of a full mbuf. PR: kern/148050 Modified: head/sys/netinet/ipfw/ip_fw_log.c Modified: head/sys/netinet/ipfw/ip_fw_log.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_log.c Thu Jul 8 12:21:25 2010 (r209796) +++ head/sys/netinet/ipfw/ip_fw_log.c Thu Jul 8 13:07:40 2010 (r209797) @@ -152,22 +152,24 @@ ipfw_log(struct ip_fw *f, u_int hlen, st if (V_fw_verbose == 0) { #ifndef WITHOUT_BPF - struct m_hdr mh; + struct mbuf m0; if (log_if == NULL || log_if->if_bpf == NULL) return; + /* BPF treats the "mbuf" as read-only */ - mh.mh_next = m; - mh.mh_len = ETHER_HDR_LEN; + bzero(&m0, sizeof(struct mbuf)); + m0.m_hdr.mh_next = m; + m0.m_hdr.mh_len = ETHER_HDR_LEN; if (args->eh) { /* layer2, use orig hdr */ - mh.mh_data = (char *)args->eh; + m0.m_hdr.mh_data = (char *)args->eh; } else { /* add fake header. Later we will store * more info in the header */ - mh.mh_data = "DDDDDDSSSSSS\x08\x00"; + m0.m_hdr.mh_data = "DDDDDDSSSSSS\x08\x00"; } - BPF_MTAP(log_if, (struct mbuf *)&mh); + BPF_MTAP(log_if, &m0); #endif /* !WITHOUT_BPF */ return; } From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 13:34:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD3A81065673; Thu, 8 Jul 2010 13:34:01 +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 AC3DE8FC19; Thu, 8 Jul 2010 13:34:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68DY1GI024845; Thu, 8 Jul 2010 13:34:01 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68DY1OC024841; Thu, 8 Jul 2010 13:34:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201007081334.o68DY1OC024841@svn.freebsd.org> From: John Baldwin Date: Thu, 8 Jul 2010 13:34:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209798 - in stable/7/etc: . rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 13:34:01 -0000 Author: jhb Date: Thu Jul 8 13:34:01 2010 New Revision: 209798 URL: http://svn.freebsd.org/changeset/base/209798 Log: MFC 175676: Implement a quiet prefix, which will disable some diagnostics. The fast prefix also implies quiet. During boot we use either fast or quiet. For shutdown we already use 'faststop'. So, this informational message should only appear during interactive use. Reviewed by: silence on freebsd-rc@ Modified: stable/7/etc/rc stable/7/etc/rc.d/netif stable/7/etc/rc.subr Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/rc ============================================================================== --- stable/7/etc/rc Thu Jul 8 13:07:40 2010 (r209797) +++ stable/7/etc/rc Thu Jul 8 13:34:01 2010 (r209798) @@ -56,7 +56,7 @@ if [ "$1" = autoboot ]; then rc_fast=yes # run_rc_command(): do fast booting else autoboot=no - _boot="start" + _boot="quietstart" fi dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null` Modified: stable/7/etc/rc.d/netif ============================================================================== --- stable/7/etc/rc.d/netif Thu Jul 8 13:07:40 2010 (r209797) +++ stable/7/etc/rc.d/netif Thu Jul 8 13:34:01 2010 (r209798) @@ -72,7 +72,7 @@ network_start() if [ -f /etc/rc.d/ipfilter ] ; then # Resync ipfilter - /etc/rc.d/ipfilter fastresync + /etc/rc.d/ipfilter quietresync fi if [ -f /etc/rc.d/bridge -a -n "$cmdifn" ] ; then /etc/rc.d/bridge start $cmdifn Modified: stable/7/etc/rc.subr ============================================================================== --- stable/7/etc/rc.subr Thu Jul 8 13:07:40 2010 (r209797) +++ stable/7/etc/rc.subr Thu Jul 8 13:34:01 2010 (r209798) @@ -381,9 +381,10 @@ wait_for_pids() # If argument has a given prefix, then change the operation as follows: # Prefix Operation # ------ --------- -# fast Skip the pid check, and set rc_fast=yes +# fast Skip the pid check, and set rc_fast=yes, rc_quiet=yes # force Set ${rcvar} to YES, and set rc_force=yes # one Set ${rcvar} to YES +# quiet Don't output some diagnostics, and set rc_quiet=yes # # The following globals are used: # @@ -526,6 +527,8 @@ wait_for_pids() # # rc_force Not empty if "force" was provided (q.v.) # +# rc_quiet Not empty if "quiet" was provided +# # run_rc_command() { @@ -546,6 +549,7 @@ run_rc_command() fast*) # "fast" prefix; don't check pid rc_arg=${rc_arg#fast} rc_fast=yes + rc_quiet=yes ;; force*) # "force prefix; always run rc_force=yes @@ -562,6 +566,11 @@ run_rc_command() eval ${rcvar}=YES fi ;; + quiet*) # "quiet" prefix; omit some messages + _rc_prefix=quiet + rc_arg=${rc_arg#${_rc_prefix}} + rc_quiet=yes + ;; esac eval _override_command=\$${name}_program @@ -616,7 +625,7 @@ run_rc_command() # if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" -a -z "${rc_pid}" ]; then if ! checkyesno ${rcvar}; then - if [ -n "$rc_fast" ]; then + if [ -n "${rc_quiet}" ]; then return 0 fi echo -n "Cannot '${rc_arg}' $name. Set ${rcvar} to " From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 14:08:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8A57106566B; Thu, 8 Jul 2010 14:08:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 984EF8FC1A; Thu, 8 Jul 2010 14:08:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68E83bt032351; Thu, 8 Jul 2010 14:08:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68E83Kh032349; Thu, 8 Jul 2010 14:08:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201007081408.o68E83Kh032349@svn.freebsd.org> From: Adrian Chadd Date: Thu, 8 Jul 2010 14:08: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: r209799 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 14:08:03 -0000 Author: adrian Date: Thu Jul 8 14:08:03 2010 New Revision: 209799 URL: http://svn.freebsd.org/changeset/base/209799 Log: Extend the ath debugging a little to log the interface name. Some devices have >1 atheros card and the current debug prints make it impossible to tell which interface is being unhappy. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Jul 8 13:34:01 2010 (r209798) +++ head/sys/dev/ath/if_ath.c Thu Jul 8 14:08:03 2010 (r209799) @@ -324,7 +324,7 @@ TUNABLE_INT("hw.ath.debug", &ath_debug); (sc->sc_ifp->if_flags & (IFF_DEBUG|IFF_LINK2)) == (IFF_DEBUG|IFF_LINK2)) #define DPRINTF(sc, m, fmt, ...) do { \ if (sc->sc_debug & (m)) \ - printf(fmt, __VA_ARGS__); \ + device_printf(sc->sc_dev, fmt, __VA_ARGS__); \ } while (0) #define KEYPRINTF(sc, ix, hk, mac) do { \ if (sc->sc_debug & ATH_DEBUG_KEYCACHE) \ From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 14:19:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F261D106567E; Thu, 8 Jul 2010 14:19:52 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1D778FC18; Thu, 8 Jul 2010 14:19:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68EJqCj035010; Thu, 8 Jul 2010 14:19:52 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68EJqtO035008; Thu, 8 Jul 2010 14:19:52 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007081419.o68EJqtO035008@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 8 Jul 2010 14:19: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: r209800 - head/sys/dev/iicbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 14:19:53 -0000 Author: nwhitehorn Date: Thu Jul 8 14:19:52 2010 New Revision: 209800 URL: http://svn.freebsd.org/changeset/base/209800 Log: Fix iicbus_get_addr() on 64-bit big-endian systems. The bus accessor passes a uintptr_t, not a uint32_t. Modified: head/sys/dev/iicbus/iicbus.c Modified: head/sys/dev/iicbus/iicbus.c ============================================================================== --- head/sys/dev/iicbus/iicbus.c Thu Jul 8 14:08:03 2010 (r209799) +++ head/sys/dev/iicbus/iicbus.c Thu Jul 8 14:19:52 2010 (r209800) @@ -181,7 +181,7 @@ iicbus_read_ivar(device_t bus, device_t default: return (EINVAL); case IICBUS_IVAR_ADDR: - *(uint32_t *)result = devi->addr; + *result = devi->addr; break; } return (0); From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 14:29:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE86D106566C; Thu, 8 Jul 2010 14:29:23 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD1DB8FC0A; Thu, 8 Jul 2010 14:29:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68ETNUq037115; Thu, 8 Jul 2010 14:29:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68ETNxh037110; Thu, 8 Jul 2010 14:29:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007081429.o68ETNxh037110@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 8 Jul 2010 14:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209801 - in head/sys: dev/ofw powerpc/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 14:29:24 -0000 Author: nwhitehorn Date: Thu Jul 8 14:29:23 2010 New Revision: 209801 URL: http://svn.freebsd.org/changeset/base/209801 Log: Change the argument type to OF_call_method to take an array of cell_t instead of unsigned longs to prepare for platforms where they are not the same. Modified: head/sys/dev/ofw/ofw_if.m head/sys/dev/ofw/ofw_standard.c head/sys/dev/ofw/openfirm.c head/sys/powerpc/ofw/ofw_real.c Modified: head/sys/dev/ofw/ofw_if.m ============================================================================== --- head/sys/dev/ofw/ofw_if.m Thu Jul 8 14:19:52 2010 (r209800) +++ head/sys/dev/ofw/ofw_if.m Thu Jul 8 14:29:23 2010 (r209801) @@ -229,7 +229,7 @@ METHOD int call_method { int _nargs; int _nreturns; - unsigned long *_args_and_returns; + cell_t *_args_and_returns; }; /** Modified: head/sys/dev/ofw/ofw_standard.c ============================================================================== --- head/sys/dev/ofw/ofw_standard.c Thu Jul 8 14:19:52 2010 (r209800) +++ head/sys/dev/ofw/ofw_standard.c Thu Jul 8 14:29:23 2010 (r209801) @@ -95,7 +95,7 @@ static ssize_t ofw_std_package_to_path(o size_t len); static int ofw_std_call_method(ofw_t ofw, ihandle_t instance, const char *method, int nargs, int nreturns, - unsigned long *args_and_returns); + cell_t *args_and_returns); static ihandle_t ofw_std_open(ofw_t ofw, const char *device); static void ofw_std_close(ofw_t ofw, ihandle_t instance); static ssize_t ofw_std_read(ofw_t ofw, ihandle_t instance, void *addr, @@ -515,7 +515,7 @@ ofw_std_package_to_path(ofw_t ofw, phand /* Call the method in the scope of a given instance. */ static int ofw_std_call_method(ofw_t ofw, ihandle_t instance, const char *method, - int nargs, int nreturns, unsigned long *args_and_returns) + int nargs, int nreturns, cell_t *args_and_returns) { struct { cell_t name; @@ -529,8 +529,7 @@ ofw_std_call_method(ofw_t ofw, ihandle_t 2, 1, }; - cell_t *cp; - unsigned long *ap; + cell_t *cp, *ap; int n; if (nargs > 6) Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Thu Jul 8 14:19:52 2010 (r209800) +++ head/sys/dev/ofw/openfirm.c Thu Jul 8 14:29:23 2010 (r209801) @@ -328,14 +328,14 @@ OF_call_method(const char *method, ihand ...) { va_list ap; - unsigned long args_n_results[12]; + cell_t args_n_results[12]; int n, status; if (nargs > 6) return (-1); va_start(ap, nreturns); for (n = 0; n < nargs; n++) - args_n_results[n] = va_arg(ap, unsigned long); + args_n_results[n] = va_arg(ap, cell_t); status = OFW_CALL_METHOD(ofw_obj, instance, method, nargs, nreturns, args_n_results); @@ -343,7 +343,7 @@ OF_call_method(const char *method, ihand return (status); for (; n < nargs + nreturns; n++) - *va_arg(ap, unsigned long *) = args_n_results[n]; + *va_arg(ap, cell_t *) = args_n_results[n]; va_end(ap); return (0); } Modified: head/sys/powerpc/ofw/ofw_real.c ============================================================================== --- head/sys/powerpc/ofw/ofw_real.c Thu Jul 8 14:19:52 2010 (r209800) +++ head/sys/powerpc/ofw/ofw_real.c Thu Jul 8 14:29:23 2010 (r209801) @@ -97,7 +97,7 @@ static ssize_t ofw_real_instance_to_path static ssize_t ofw_real_package_to_path(ofw_t, phandle_t package, char *buf, size_t len); static int ofw_real_call_method(ofw_t, ihandle_t instance, const char *method, - int nargs, int nreturns, unsigned long *args_and_returns); + int nargs, int nreturns, cell_t *args_and_returns); static ihandle_t ofw_real_open(ofw_t, const char *device); static void ofw_real_close(ofw_t, ihandle_t instance); static ssize_t ofw_real_read(ofw_t, ihandle_t instance, void *addr, size_t len); @@ -652,7 +652,7 @@ ofw_real_package_to_path(ofw_t ofw, phan /* Call the method in the scope of a given instance. */ static int ofw_real_call_method(ofw_t ofw, ihandle_t instance, const char *method, - int nargs, int nreturns, unsigned long *args_and_returns) + int nargs, int nreturns, cell_t *args_and_returns) { struct { cell_t name; @@ -666,8 +666,7 @@ ofw_real_call_method(ofw_t ofw, ihandle_ 2, 1, }; - cell_t *cp; - unsigned long *ap; + cell_t *cp, *ap; int n; if (nargs > 6) From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 14:34:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF4B41065691; Thu, 8 Jul 2010 14:34:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF08A8FC1D; Thu, 8 Jul 2010 14:34:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68EYFZM038270; Thu, 8 Jul 2010 14:34:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68EYF9X038267; Thu, 8 Jul 2010 14:34:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201007081434.o68EYF9X038267@svn.freebsd.org> From: Adrian Chadd Date: Thu, 8 Jul 2010 14:34: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: r209802 - head/sys/mips/atheros X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 14:34:16 -0000 Author: adrian Date: Thu Jul 8 14:34:15 2010 New Revision: 209802 URL: http://svn.freebsd.org/changeset/base/209802 Log: Introduce a sysctl block for if_arge and, for now, a blank debug sysctl placeholder for later. Add in a missing FreeBSD ID string. Modified: head/sys/mips/atheros/if_arge.c head/sys/mips/atheros/if_argevar.h Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Thu Jul 8 14:29:23 2010 (r209801) +++ head/sys/mips/atheros/if_arge.c Thu Jul 8 14:34:15 2010 (r209802) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -198,6 +199,18 @@ arge_probe(device_t dev) return (0); } +static void +arge_attach_sysctl(device_t dev) +{ + struct arge_softc *sc = device_get_softc(dev); + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(dev); + struct sysctl_oid *tree = device_get_sysctl_tree(dev); + + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "debug", CTLFLAG_RW, &sc->arge_debug, 0, + "arge interface debugging flags"); +} + static int arge_attach(device_t dev) { @@ -457,6 +470,9 @@ arge_attach(device_t dev) goto fail; } + /* setup sysctl variables */ + arge_attach_sysctl(dev); + fail: if (error) arge_detach(dev); Modified: head/sys/mips/atheros/if_argevar.h ============================================================================== --- head/sys/mips/atheros/if_argevar.h Thu Jul 8 14:29:23 2010 (r209801) +++ head/sys/mips/atheros/if_argevar.h Thu Jul 8 14:34:15 2010 (r209802) @@ -23,6 +23,8 @@ * 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 __IF_ARGEVAR_H__ @@ -152,6 +154,7 @@ struct arge_softc { uint32_t arge_pll_reg; uint32_t arge_pll_reg_shift; int arge_if_flags; + uint32_t arge_debug; }; #endif /* __IF_ARGEVAR_H__ */ From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 14:35:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AABF4106566C; Thu, 8 Jul 2010 14:35:35 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98DC28FC12; Thu, 8 Jul 2010 14:35:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68EZZVi038602; Thu, 8 Jul 2010 14:35:35 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68EZZOY038600; Thu, 8 Jul 2010 14:35:35 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007081435.o68EZZOY038600@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 8 Jul 2010 14:35: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: r209803 - head/sys/powerpc/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 14:35:35 -0000 Author: nwhitehorn Date: Thu Jul 8 14:35:35 2010 New Revision: 209803 URL: http://svn.freebsd.org/changeset/base/209803 Log: Fix several bugs in the real-mode Open Firmware implementation and provide a virtual-mode version for use on 64-bit systems, which have 32-bit firmware implementations and require similar constraints on addressing to the real-mode implementation. Modified: head/sys/powerpc/ofw/ofw_real.c Modified: head/sys/powerpc/ofw/ofw_real.c ============================================================================== --- head/sys/powerpc/ofw/ofw_real.c Thu Jul 8 14:34:15 2010 (r209802) +++ head/sys/powerpc/ofw/ofw_real.c Thu Jul 8 14:35:35 2010 (r209803) @@ -65,12 +65,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include -#include #include -#include +#include #include +#include +#include #include #include @@ -98,6 +100,8 @@ static ssize_t ofw_real_package_to_path( size_t len); static int ofw_real_call_method(ofw_t, ihandle_t instance, const char *method, int nargs, int nreturns, cell_t *args_and_returns); +static int ofw_real_interpret(ofw_t ofw, const char *cmd, int nreturns, + unsigned long *returns); static ihandle_t ofw_real_open(ofw_t, const char *device); static void ofw_real_close(ofw_t, ihandle_t instance); static ssize_t ofw_real_read(ofw_t, ihandle_t instance, void *addr, size_t len); @@ -126,6 +130,7 @@ static ofw_method_t ofw_real_methods[] = OFWMETHOD(ofw_test, ofw_real_test), OFWMETHOD(ofw_call_method, ofw_real_call_method), + OFWMETHOD(ofw_interpret, ofw_real_interpret), OFWMETHOD(ofw_open, ofw_real_open), OFWMETHOD(ofw_close, ofw_real_close), OFWMETHOD(ofw_read, ofw_real_read), @@ -146,6 +151,13 @@ static ofw_def_t ofw_real = { }; OFW_DEF(ofw_real); +static ofw_def_t ofw_32bit = { + OFW_STD_32BIT, + ofw_real_methods, + 0 +}; +OFW_DEF(ofw_32bit); + MALLOC_DEFINE(M_OFWREAL, "ofwreal", "Open Firmware Real Mode Bounce Page"); static int (*openfirmware)(void *); @@ -156,13 +168,16 @@ static off_t of_bounce_offset; static size_t of_bounce_size; static struct mtx of_bounce_mtx; +extern int ofw_real_mode; +extern struct pmap ofw_pmap; + /* * After the VM is up, allocate a wired, low memory bounce page. */ static void ofw_real_bounce_alloc(void *); -SYSINIT(ofw_real_bounce_alloc, SI_SUB_VM, SI_ORDER_ANY, +SYSINIT(ofw_real_bounce_alloc, SI_SUB_KMEM, SI_ORDER_ANY, ofw_real_bounce_alloc, NULL); static void @@ -197,38 +212,54 @@ ofw_real_bounce_alloc(void *junk) of_bounce_virt = contigmalloc(PAGE_SIZE, M_OFWREAL, 0, 0, BUS_SPACE_MAXADDR_32BIT, PAGE_SIZE, PAGE_SIZE); + of_bounce_phys = vtophys(of_bounce_virt); of_bounce_size = PAGE_SIZE; + /* + * For virtual-mode OF, direct map this physical address so that + * we have a 32-bit virtual address to give OF. + */ + + if (!ofw_real_mode && !hw_direct_map) + pmap_kenter(of_bounce_phys, of_bounce_phys); + mtx_unlock(&of_bounce_mtx); } static cell_t ofw_real_map(const void *buf, size_t len) { + static char emergency_buffer[255]; cell_t phys; mtx_assert(&of_bounce_mtx, MA_OWNED); if (of_bounce_virt == NULL) { + /* + * If we haven't set up the MMU, then buf is guaranteed + * to be accessible to OF, because the only memory we + * can use right now is memory mapped by firmware. + */ if (!pmap_bootstrapped) - return (cell_t)buf; + return (cell_t)(uintptr_t)buf; /* * XXX: It is possible for us to get called before the VM has * come online, but after the MMU is up. We don't have the * bounce buffer yet, but can no longer presume a 1:1 mapping. - * Grab the physical address of the buffer, and hope it is - * in range if this happens. + * Copy into the emergency buffer, and reset at the end. */ - return (cell_t)vtophys(buf); + of_bounce_virt = emergency_buffer; + of_bounce_phys = (vm_offset_t)of_bounce_virt; + of_bounce_size = sizeof(emergency_buffer); } /* * Make sure the bounce page offset satisfies any reasonable * alignment constraint. */ - of_bounce_offset += of_bounce_offset % sizeof(register_t); + of_bounce_offset += sizeof(register_t) - (of_bounce_offset % sizeof(register_t)); if (of_bounce_offset + len > of_bounce_size) { panic("Oversize Open Firmware call!"); @@ -240,7 +271,7 @@ ofw_real_map(const void *buf, size_t len of_bounce_offset += len; - return phys; + return (phys); } static void @@ -274,25 +305,28 @@ ofw_real_init(ofw_t ofw, void *openfirm) static int ofw_real_test(ofw_t ofw, const char *name) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; cell_t nreturns; cell_t service; cell_t missing; - } args = { - (cell_t)"test", - 1, - 1, - }; + } args; + + args.name = (cell_t)(uintptr_t)"test"; + args.nargs = 1; + args.nreturns = 1; ofw_real_start(); args.service = ofw_real_map(name, strlen(name) + 1); - if (args.service == 0 || openfirmware(&args) == -1) { + argsptr = ofw_real_map(&args, sizeof(args)); + if (args.service == 0 || openfirmware((void *)argsptr) == -1) { ofw_real_stop(); return (-1); } + ofw_real_unmap(argsptr, &args, sizeof(args)); ofw_real_stop(); return (args.missing); } @@ -305,21 +339,28 @@ ofw_real_test(ofw_t ofw, const char *nam static phandle_t ofw_real_peer(ofw_t ofw, phandle_t node) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; cell_t nreturns; cell_t node; cell_t next; - } args = { - (cell_t)"peer", - 1, - 1, - }; + } args; + + args.name = (cell_t)(uintptr_t)"peer"; + args.nargs = 1; + args.nreturns = 1; args.node = node; - if (openfirmware(&args) == -1) + ofw_real_start(); + argsptr = ofw_real_map(&args, sizeof(args)); + if (openfirmware((void *)argsptr) == -1) { + ofw_real_stop(); return (-1); + } + ofw_real_unmap(argsptr, &args, sizeof(args)); + ofw_real_stop(); return (args.next); } @@ -327,21 +368,28 @@ ofw_real_peer(ofw_t ofw, phandle_t node) static phandle_t ofw_real_child(ofw_t ofw, phandle_t node) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; cell_t nreturns; cell_t node; cell_t child; - } args = { - (cell_t)"child", - 1, - 1, - }; + } args; + + args.name = (cell_t)(uintptr_t)"child"; + args.nargs = 1; + args.nreturns = 1; args.node = node; - if (openfirmware(&args) == -1) + ofw_real_start(); + argsptr = ofw_real_map(&args, sizeof(args)); + if (openfirmware((void *)argsptr) == -1) { + ofw_real_stop(); return (-1); + } + ofw_real_unmap(argsptr, &args, sizeof(args)); + ofw_real_stop(); return (args.child); } @@ -349,21 +397,28 @@ ofw_real_child(ofw_t ofw, phandle_t node static phandle_t ofw_real_parent(ofw_t ofw, phandle_t node) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; cell_t nreturns; cell_t node; cell_t parent; - } args = { - (cell_t)"parent", - 1, - 1, - }; + } args; + + args.name = (cell_t)(uintptr_t)"parent"; + args.nargs = 1; + args.nreturns = 1; args.node = node; - if (openfirmware(&args) == -1) + ofw_real_start(); + argsptr = ofw_real_map(&args, sizeof(args)); + if (openfirmware((void *)argsptr) == -1) { + ofw_real_stop(); return (-1); + } + ofw_real_unmap(argsptr, &args, sizeof(args)); + ofw_real_stop(); return (args.parent); } @@ -371,21 +426,28 @@ ofw_real_parent(ofw_t ofw, phandle_t nod static phandle_t ofw_real_instance_to_package(ofw_t ofw, ihandle_t instance) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; cell_t nreturns; cell_t instance; cell_t package; - } args = { - (cell_t)"instance-to-package", - 1, - 1, - }; + } args; + + args.name = (cell_t)(uintptr_t)"instance-to-package"; + args.nargs = 1; + args.nreturns = 1; args.instance = instance; - if (openfirmware(&args) == -1) + ofw_real_start(); + argsptr = ofw_real_map(&args, sizeof(args)); + if (openfirmware((void *)argsptr) == -1) { + ofw_real_stop(); return (-1); + } + ofw_real_unmap(argsptr, &args, sizeof(args)); + ofw_real_stop(); return (args.package); } @@ -393,27 +455,30 @@ ofw_real_instance_to_package(ofw_t ofw, static ssize_t ofw_real_getproplen(ofw_t ofw, phandle_t package, const char *propname) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; cell_t nreturns; cell_t package; cell_t propname; - cell_t proplen; - } args = { - (cell_t)"getproplen", - 2, - 1, - }; + int32_t proplen; + } args; + + args.name = (cell_t)(uintptr_t)"getproplen"; + args.nargs = 2; + args.nreturns = 1; ofw_real_start(); args.package = package; args.propname = ofw_real_map(propname, strlen(propname) + 1); - if (args.propname == 0 || openfirmware(&args) == -1) { + argsptr = ofw_real_map(&args, sizeof(args)); + if (args.propname == 0 || openfirmware((void *)argsptr) == -1) { ofw_real_stop(); return (-1); } + ofw_real_unmap(argsptr, &args, sizeof(args)); ofw_real_stop(); return (args.proplen); } @@ -423,6 +488,7 @@ static ssize_t ofw_real_getprop(ofw_t ofw, phandle_t package, const char *propname, void *buf, size_t buflen) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; @@ -431,12 +497,12 @@ ofw_real_getprop(ofw_t ofw, phandle_t pa cell_t propname; cell_t buf; cell_t buflen; - cell_t size; - } args = { - (cell_t)"getprop", - 4, - 1, - }; + int32_t size; + } args; + + args.name = (cell_t)(uintptr_t)"getprop"; + args.nargs = 4; + args.nreturns = 1; ofw_real_start(); @@ -444,10 +510,13 @@ ofw_real_getprop(ofw_t ofw, phandle_t pa args.propname = ofw_real_map(propname, strlen(propname) + 1); args.buf = ofw_real_map(buf, buflen); args.buflen = buflen; - if (args.propname == 0 || args.buf == 0 || openfirmware(&args) == -1) { + argsptr = ofw_real_map(&args, sizeof(args)); + if (args.propname == 0 || args.buf == 0 || + openfirmware((void *)argsptr) == -1) { ofw_real_stop(); return (-1); } + ofw_real_unmap(argsptr, &args, sizeof(args)); ofw_real_unmap(args.buf, buf, buflen); ofw_real_stop(); @@ -459,6 +528,7 @@ static int ofw_real_nextprop(ofw_t ofw, phandle_t package, const char *previous, char *buf, size_t size) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; @@ -467,21 +537,24 @@ ofw_real_nextprop(ofw_t ofw, phandle_t p cell_t previous; cell_t buf; cell_t flag; - } args = { - (cell_t)"nextprop", - 3, - 1, - }; + } args; + + args.name = (cell_t)(uintptr_t)"nextprop"; + args.nargs = 3; + args.nreturns = 1; ofw_real_start(); args.package = package; args.previous = ofw_real_map(previous, strlen(previous) + 1); args.buf = ofw_real_map(buf, size); - if (args.previous == 0 || args.buf == 0 || openfirmware(&args) == -1) { + argsptr = ofw_real_map(&args, sizeof(args)); + if (args.previous == 0 || args.buf == 0 || + openfirmware((void *)argsptr) == -1) { ofw_real_stop(); return (-1); } + ofw_real_unmap(argsptr, &args, sizeof(args)); ofw_real_unmap(args.buf, buf, size); ofw_real_stop(); @@ -494,6 +567,7 @@ static int ofw_real_setprop(ofw_t ofw, phandle_t package, const char *propname, const void *buf, size_t len) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; @@ -503,11 +577,11 @@ ofw_real_setprop(ofw_t ofw, phandle_t pa cell_t buf; cell_t len; cell_t size; - } args = { - (cell_t)"setprop", - 4, - 1, - }; + } args; + + args.name = (cell_t)(uintptr_t)"setprop"; + args.nargs = 4; + args.nreturns = 1; ofw_real_start(); @@ -515,10 +589,13 @@ ofw_real_setprop(ofw_t ofw, phandle_t pa args.propname = ofw_real_map(propname, strlen(propname) + 1); args.buf = ofw_real_map(buf, len); args.len = len; - if (args.propname == 0 || args.buf == 0 || openfirmware(&args) == -1) { + argsptr = ofw_real_map(&args, sizeof(args)); + if (args.propname == 0 || args.buf == 0 || + openfirmware((void *)argsptr) == -1) { ofw_real_stop(); return (-1); } + ofw_real_unmap(argsptr, &args, sizeof(args)); ofw_real_stop(); return (args.size); } @@ -527,6 +604,7 @@ ofw_real_setprop(ofw_t ofw, phandle_t pa static ssize_t ofw_real_canon(ofw_t ofw, const char *device, char *buf, size_t len) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; @@ -534,22 +612,25 @@ ofw_real_canon(ofw_t ofw, const char *de cell_t device; cell_t buf; cell_t len; - cell_t size; - } args = { - (cell_t)"canon", - 3, - 1, - }; + int32_t size; + } args; + + args.name = (cell_t)(uintptr_t)"canon"; + args.nargs = 3; + args.nreturns = 1; ofw_real_start(); args.device = ofw_real_map(device, strlen(device) + 1); args.buf = ofw_real_map(buf, len); args.len = len; - if (args.device == 0 || args.buf == 0 || openfirmware(&args) == -1) { + argsptr = ofw_real_map(&args, sizeof(args)); + if (args.device == 0 || args.buf == 0 || + openfirmware((void *)argsptr) == -1) { ofw_real_stop(); return (-1); } + ofw_real_unmap(argsptr, &args, sizeof(args)); ofw_real_unmap(args.buf, buf, len); ofw_real_stop(); @@ -560,25 +641,29 @@ ofw_real_canon(ofw_t ofw, const char *de static phandle_t ofw_real_finddevice(ofw_t ofw, const char *device) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; cell_t nreturns; cell_t device; cell_t package; - } args = { - (cell_t)"finddevice", - 1, - 1, - }; + } args; + + args.name = (cell_t)(uintptr_t)"finddevice"; + args.nargs = 1; + args.nreturns = 1; ofw_real_start(); args.device = ofw_real_map(device, strlen(device) + 1); - if (args.device == 0 || openfirmware(&args) == -1) { + argsptr = ofw_real_map(&args, sizeof(args)); + if (args.device == 0 || + openfirmware((void *)argsptr) == -1) { ofw_real_stop(); return (-1); } + ofw_real_unmap(argsptr, &args, sizeof(args)); ofw_real_stop(); return (args.package); } @@ -587,6 +672,7 @@ ofw_real_finddevice(ofw_t ofw, const cha static ssize_t ofw_real_instance_to_path(ofw_t ofw, ihandle_t instance, char *buf, size_t len) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; @@ -594,22 +680,25 @@ ofw_real_instance_to_path(ofw_t ofw, iha cell_t instance; cell_t buf; cell_t len; - cell_t size; - } args = { - (cell_t)"instance-to-path", - 3, - 1, - }; + int32_t size; + } args; + + args.name = (cell_t)(uintptr_t)"instance-to-path"; + args.nargs = 3; + args.nreturns = 1; ofw_real_start(); args.instance = instance; args.buf = ofw_real_map(buf, len); args.len = len; - if (args.buf == 0 || openfirmware(&args) == -1) { + argsptr = ofw_real_map(&args, sizeof(args)); + if (args.buf == 0 || + openfirmware((void *)argsptr) == -1) { ofw_real_stop(); return (-1); } + ofw_real_unmap(argsptr, &args, sizeof(args)); ofw_real_unmap(args.buf, buf, len); ofw_real_stop(); @@ -620,6 +709,7 @@ ofw_real_instance_to_path(ofw_t ofw, iha static ssize_t ofw_real_package_to_path(ofw_t ofw, phandle_t package, char *buf, size_t len) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; @@ -627,22 +717,25 @@ ofw_real_package_to_path(ofw_t ofw, phan cell_t package; cell_t buf; cell_t len; - cell_t size; - } args = { - (cell_t)"package-to-path", - 3, - 1, - }; + int32_t size; + } args; + + args.name = (cell_t)(uintptr_t)"package-to-path"; + args.nargs = 3; + args.nreturns = 1; ofw_real_start(); args.package = package; args.buf = ofw_real_map(buf, len); args.len = len; - if (args.buf == 0 || openfirmware(&args) == -1) { + argsptr = ofw_real_map(&args, sizeof(args)); + if (args.buf == 0 || + openfirmware((void *)argsptr) == -1) { ofw_real_stop(); return (-1); } + ofw_real_unmap(argsptr, &args, sizeof(args)); ofw_real_unmap(args.buf, buf, len); ofw_real_stop(); @@ -654,6 +747,7 @@ static int ofw_real_call_method(ofw_t ofw, ihandle_t instance, const char *method, int nargs, int nreturns, cell_t *args_and_returns) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; @@ -661,14 +755,14 @@ ofw_real_call_method(ofw_t ofw, ihandle_ cell_t method; cell_t instance; cell_t args_n_results[12]; - } args = { - (cell_t)"call-method", - 2, - 1, - }; + } args; cell_t *cp, *ap; int n; + args.name = (cell_t)(uintptr_t)"call-method"; + args.nargs = 2; + args.nreturns = 1; + if (nargs > 6) return (-1); @@ -681,10 +775,13 @@ ofw_real_call_method(ofw_t ofw, ihandle_ ap = args_and_returns; for (cp = args.args_n_results + (n = nargs); --n >= 0;) *--cp = *(ap++); - if (args.method == 0 || openfirmware(&args) == -1) { + argsptr = ofw_real_map(&args, sizeof(args)); + if (args.method == 0 || + openfirmware((void *)argsptr) == -1) { ofw_real_stop(); return (-1); } + ofw_real_unmap(argsptr, &args, sizeof(args)); ofw_real_stop(); if (args.args_n_results[nargs]) return (args.args_n_results[nargs]); @@ -693,6 +790,39 @@ ofw_real_call_method(ofw_t ofw, ihandle_ return (0); } +static int +ofw_real_interpret(ofw_t ofw, const char *cmd, int nreturns, + unsigned long *returns) +{ + vm_offset_t argsptr; + struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t slot[16]; + } args; + cell_t status; + int i = 0, j = 0; + + args.name = (cell_t)(uintptr_t)"interpret"; + args.nargs = 1; + + ofw_real_start(); + args.nreturns = ++nreturns; + args.slot[i++] = ofw_real_map(cmd, strlen(cmd) + 1); + argsptr = ofw_real_map(&args, sizeof(args)); + if (openfirmware((void *)argsptr) == -1) { + ofw_real_stop(); + return (-1); + } + ofw_real_unmap(argsptr, &args, sizeof(args)); + ofw_real_stop(); + status = args.slot[i++]; + while (i < 1 + nreturns) + returns[j++] = args.slot[i++]; + return (status); +} + /* * Device I/O functions */ @@ -701,26 +831,29 @@ ofw_real_call_method(ofw_t ofw, ihandle_ static ihandle_t ofw_real_open(ofw_t ofw, const char *device) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; cell_t nreturns; cell_t device; cell_t instance; - } args = { - (cell_t)"open", - 1, - 1, - }; + } args; + + args.name = (cell_t)(uintptr_t)"open"; + args.nargs = 1; + args.nreturns = 1; ofw_real_start(); args.device = ofw_real_map(device, strlen(device) + 1); - if (args.device == 0 || openfirmware(&args) == -1 + argsptr = ofw_real_map(&args, sizeof(args)); + if (args.device == 0 || openfirmware((void *)argsptr) == -1 || args.instance == 0) { ofw_real_stop(); return (-1); } + ofw_real_unmap(argsptr, &args, sizeof(args)); ofw_real_stop(); return (args.instance); } @@ -729,25 +862,29 @@ ofw_real_open(ofw_t ofw, const char *dev static void ofw_real_close(ofw_t ofw, ihandle_t instance) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; cell_t nreturns; cell_t instance; - } args = { - (cell_t)"close", - 1, - 0, - }; + } args; + args.name = (cell_t)(uintptr_t)"close"; + args.nargs = 1; + args.nreturns = 0; args.instance = instance; - openfirmware(&args); + ofw_real_start(); + argsptr = ofw_real_map(&args, sizeof(args)); + openfirmware((void *)argsptr); + ofw_real_stop(); } /* Read from an instance. */ static ssize_t ofw_real_read(ofw_t ofw, ihandle_t instance, void *addr, size_t len) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; @@ -755,22 +892,24 @@ ofw_real_read(ofw_t ofw, ihandle_t insta cell_t instance; cell_t addr; cell_t len; - cell_t actual; - } args = { - (cell_t)"read", - 3, - 1, - }; + int32_t actual; + } args; + + args.name = (cell_t)(uintptr_t)"read"; + args.nargs = 3; + args.nreturns = 1; ofw_real_start(); args.instance = instance; args.addr = ofw_real_map(addr, len); args.len = len; - if (args.addr == 0 || openfirmware(&args) == -1) { + argsptr = ofw_real_map(&args, sizeof(args)); + if (args.addr == 0 || openfirmware((void *)argsptr) == -1) { ofw_real_stop(); return (-1); } + ofw_real_unmap(argsptr, &args, sizeof(args)); ofw_real_unmap(args.addr, addr, len); ofw_real_stop(); @@ -781,6 +920,7 @@ ofw_real_read(ofw_t ofw, ihandle_t insta static ssize_t ofw_real_write(ofw_t ofw, ihandle_t instance, const void *addr, size_t len) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; @@ -788,22 +928,24 @@ ofw_real_write(ofw_t ofw, ihandle_t inst cell_t instance; cell_t addr; cell_t len; - cell_t actual; - } args = { - (cell_t)"write", - 3, - 1, - }; + int32_t actual; + } args; + + args.name = (cell_t)(uintptr_t)"write"; + args.nargs = 3; + args.nreturns = 1; ofw_real_start(); args.instance = instance; args.addr = ofw_real_map(addr, len); args.len = len; - if (args.addr == 0 || openfirmware(&args) == -1) { + argsptr = ofw_real_map(&args, sizeof(args)); + if (args.addr == 0 || openfirmware((void *)argsptr) == -1) { ofw_real_stop(); return (-1); } + ofw_real_unmap(argsptr, &args, sizeof(args)); ofw_real_stop(); return (args.actual); } @@ -812,6 +954,7 @@ ofw_real_write(ofw_t ofw, ihandle_t inst static int ofw_real_seek(ofw_t ofw, ihandle_t instance, u_int64_t pos) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; @@ -820,17 +963,23 @@ ofw_real_seek(ofw_t ofw, ihandle_t insta cell_t poshi; cell_t poslo; cell_t status; - } args = { - (cell_t)"seek", - 3, - 1, - }; + } args; + + args.name = (cell_t)(uintptr_t)"seek"; + args.nargs = 3; + args.nreturns = 1; args.instance = instance; args.poshi = pos >> 32; args.poslo = pos; - if (openfirmware(&args) == -1) + ofw_real_start(); + argsptr = ofw_real_map(&args, sizeof(args)); + if (openfirmware((void *)argsptr) == -1) { + ofw_real_stop(); return (-1); + } + ofw_real_unmap(argsptr, &args, sizeof(args)); + ofw_real_stop(); return (args.status); } @@ -842,6 +991,7 @@ ofw_real_seek(ofw_t ofw, ihandle_t insta static caddr_t ofw_real_claim(ofw_t ofw, void *virt, size_t size, u_int align) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; @@ -850,39 +1000,49 @@ ofw_real_claim(ofw_t ofw, void *virt, si cell_t size; cell_t align; cell_t baseaddr; - } args = { - (cell_t)"claim", - 3, - 1, - }; + } args; + + args.name = (cell_t)(uintptr_t)"claim"; + args.nargs = 3; + args.nreturns = 1; - args.virt = (cell_t)virt; + args.virt = (cell_t)(uintptr_t)virt; args.size = size; args.align = align; - if (openfirmware(&args) == -1) + ofw_real_start(); + argsptr = ofw_real_map(&args, sizeof(args)); + if (openfirmware((void *)argsptr) == -1) { + ofw_real_stop(); return ((void *)-1); - return ((void *)args.baseaddr); + } + ofw_real_unmap(argsptr, &args, sizeof(args)); + ofw_real_stop(); + return ((void *)(uintptr_t)args.baseaddr); } /* Release an area of memory. */ static void ofw_real_release(ofw_t ofw, void *virt, size_t size) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; cell_t nreturns; cell_t virt; cell_t size; - } args = { - (cell_t)"release", - 2, - 0, - }; + } args; + + args.name = (cell_t)(uintptr_t)"release"; + args.nargs = 2; + args.nreturns = 0; - args.virt = (cell_t)virt; + args.virt = (cell_t)(uintptr_t)virt; args.size = size; - openfirmware(&args); + ofw_real_start(); + argsptr = ofw_real_map(&args, sizeof(args)); + openfirmware((void *)argsptr); + ofw_real_stop(); } /* @@ -893,36 +1053,44 @@ ofw_real_release(ofw_t ofw, void *virt, static void ofw_real_enter(ofw_t ofw) { + vm_offset_t argsptr; struct { cell_t name; cell_t nargs; cell_t nreturns; - } args = { - (cell_t)"enter", - 0, - 0, - }; + } args; + + args.name = (cell_t)(uintptr_t)"enter"; + args.nargs = 0; + args.nreturns = 0; - openfirmware(&args); + ofw_real_start(); + argsptr = ofw_real_map(&args, sizeof(args)); + openfirmware((void *)argsptr); /* We may come back. */ + ofw_real_stop(); } /* Shut down and drop back to the Open Firmware interface. */ static void ofw_real_exit(ofw_t ofw) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 14:40:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81207106564A; Thu, 8 Jul 2010 14:40:46 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 705AE8FC13; Thu, 8 Jul 2010 14:40:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68EekX9039776; Thu, 8 Jul 2010 14:40:46 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68EekBp039774; Thu, 8 Jul 2010 14:40:46 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007081440.o68EekBp039774@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 8 Jul 2010 14:40: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: r209804 - head/sys/powerpc/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 14:40:46 -0000 Author: nwhitehorn Date: Thu Jul 8 14:40:46 2010 New Revision: 209804 URL: http://svn.freebsd.org/changeset/base/209804 Log: Make ofw_syscons work on 64-bit systems. Modified: head/sys/powerpc/ofw/ofw_syscons.c Modified: head/sys/powerpc/ofw/ofw_syscons.c ============================================================================== --- head/sys/powerpc/ofw/ofw_syscons.c Thu Jul 8 14:35:35 2010 (r209803) +++ head/sys/powerpc/ofw/ofw_syscons.c Thu Jul 8 14:40:46 2010 (r209804) @@ -216,7 +216,7 @@ ofwfb_configure(int flags) phandle_t chosen; ihandle_t stdout; phandle_t node; - bus_addr_t fb_phys; + uint32_t fb_phys; int depth; int disable; int len; @@ -748,7 +748,7 @@ ofwfb_putc8(video_adapter_t *adp, vm_off row = (off / adp->va_info.vi_width) * adp->va_info.vi_cheight; col = (off % adp->va_info.vi_width) * adp->va_info.vi_cwidth; p = sc->sc_font + c*sc->sc_font_height; - addr = (u_int32_t *)((int)sc->sc_addr + addr = (u_int32_t *)((uintptr_t)sc->sc_addr + (row + sc->sc_ymargin)*sc->sc_stride + col + sc->sc_xmargin); @@ -860,7 +860,7 @@ ofwfb_putm8(video_adapter_t *adp, int x, u_char fg, bg; sc = (struct ofwfb_softc *)adp; - addr = (u_int8_t *)((int)sc->sc_addr + addr = (u_int8_t *)((uintptr_t)sc->sc_addr + (y + sc->sc_ymargin)*sc->sc_stride + x + sc->sc_xmargin); From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 14:49:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32D161065675; Thu, 8 Jul 2010 14:49:56 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2153F8FC14; Thu, 8 Jul 2010 14:49:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68Enu0I041826; Thu, 8 Jul 2010 14:49:56 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68EntU9041822; Thu, 8 Jul 2010 14:49:55 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201007081449.o68EntU9041822@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 8 Jul 2010 14:49: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: r209805 - in head/sys/mips: include mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 14:49:56 -0000 Author: jchandra Date: Thu Jul 8 14:49:55 2010 New Revision: 209805 URL: http://svn.freebsd.org/changeset/base/209805 Log: Merge jmallett@'s n64 work into HEAD - changeset 8 Updated PTE/PDE macros from http://svn.freebsd.org/base/user/jmallett/octeon Introduce pmap_segshift() macro, use pmap_segmap() in place of pmap_pde, and remove pmap_pde(). Approved by: rrs (mentor) Obtained from: jmallett@ Modified: head/sys/mips/include/pmap.h head/sys/mips/include/pte.h head/sys/mips/mips/pmap.c Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Thu Jul 8 14:40:46 2010 (r209804) +++ head/sys/mips/include/pmap.h Thu Jul 8 14:49:55 2010 (r209805) @@ -50,7 +50,6 @@ #include #define NKPT 120 /* actual number of kernel page tables */ -#define NUSERPGTBLS (VM_MAXUSER_ADDRESS >> SEGSHIFT) #ifndef LOCORE @@ -97,7 +96,6 @@ typedef struct pmap *pmap_t; #ifdef _KERNEL pt_entry_t *pmap_pte(pmap_t, vm_offset_t); -pd_entry_t pmap_segmap(pmap_t pmap, vm_offset_t va); vm_offset_t pmap_kextract(vm_offset_t va); #define vtophys(va) pmap_kextract(((vm_offset_t) (va))) Modified: head/sys/mips/include/pte.h ============================================================================== --- head/sys/mips/include/pte.h Thu Jul 8 14:40:46 2010 (r209804) +++ head/sys/mips/include/pte.h Thu Jul 8 14:49:55 2010 (r209805) @@ -29,6 +29,12 @@ #ifndef _MACHINE_PTE_H_ #define _MACHINE_PTE_H_ +#ifndef _LOCORE +/* pt_entry_t is 32 bit for now, has to be made 64 bit for n64 */ +typedef uint32_t pt_entry_t; +typedef pt_entry_t *pd_entry_t; +#endif + /* * TLB and PTE management. Most things operate within the context of * EntryLo0,1, and begin with TLBLO_. Things which work with EntryHi @@ -65,25 +71,20 @@ #define TLBLO_PTE_TO_PA(pte) (TLBLO_PFN_TO_PA(TLBLO_PTE_TO_PFN((pte)))) /* + * XXX This comment is not correct for anything more modern than R4K. + * * VPN for EntryHi register. Upper two bits select user, supervisor, * or kernel. Bits 61 to 40 copy bit 63. VPN2 is bits 39 and down to * as low as 13, down to PAGE_SHIFT, to index 2 TLB pages*. From bit 12 * to bit 8 there is a 5-bit 0 field. Low byte is ASID. * + * XXX This comment is not correct for FreeBSD. * Note that in FreeBSD, we map 2 TLB pages is equal to 1 VM page. */ #define TLBHI_ASID_MASK (0xff) #define TLBHI_PAGE_MASK (2 * PAGE_SIZE - 1) #define TLBHI_ENTRY(va, asid) (((va) & ~TLBHI_PAGE_MASK) | ((asid) & TLBHI_ASID_MASK)) -#ifndef _LOCORE -typedef uint32_t pt_entry_t; -typedef pt_entry_t *pd_entry_t; -#endif - -#define PDESIZE sizeof(pd_entry_t) /* for assembly files */ -#define PTESIZE sizeof(pt_entry_t) /* for assembly files */ - /* * TLB flags managed in hardware: * C: Cache attribute. Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Thu Jul 8 14:40:46 2010 (r209804) +++ head/sys/mips/mips/pmap.c Thu Jul 8 14:49:55 2010 (r209805) @@ -118,14 +118,25 @@ __FBSDID("$FreeBSD$"); /* * Get PDEs and PTEs for user/kernel address space + * + * XXX The & for pmap_segshift() is wrong, as is the fact that it doesn't + * trim off gratuitous bits of the address space. By having the & + * there, we break defining NUSERPGTBLS below because the address space + * is defined such that it ends immediately after NPDEPG*NPTEPG*PAGE_SIZE, + * so we end up getting NUSERPGTBLS of 0. */ -#define pmap_pde(m, v) (&((m)->pm_segtab[(vm_offset_t)(v) >> SEGSHIFT])) -#define segtab_pde(m, v) (m[(vm_offset_t)(v) >> SEGSHIFT]) +#define pmap_segshift(v) (((v) >> SEGSHIFT) & (NPDEPG - 1)) +#define segtab_pde(m, v) ((m)[pmap_segshift((v))]) -#define MIPS_SEGSIZE (1L << SEGSHIFT) -#define mips_segtrunc(va) ((va) & ~(MIPS_SEGSIZE-1)) +#define NUSERPGTBLS (pmap_segshift(VM_MAXUSER_ADDRESS)) +#define mips_segtrunc(va) ((va) & ~SEGOFSET) #define is_kernel_pmap(x) ((x) == kernel_pmap) -#define vad_to_pte_offset(adr) (((adr) >> PAGE_SHIFT) & (NPTEPG -1)) + +/* + * Given a virtual address, get the offset of its PTE within its page + * directory page. + */ +#define PDE_OFFSET(va) (((vm_offset_t)(va) >> PAGE_SHIFT) & (NPTEPG - 1)) struct pmap kernel_pmap_store; pd_entry_t *kernel_segmap; @@ -246,13 +257,13 @@ static struct local_sysmaps sysmap_lmem[ sysm->valid2 = 0; \ intr_restore(intr) -pd_entry_t +static inline pt_entry_t * pmap_segmap(pmap_t pmap, vm_offset_t va) { - if (pmap->pm_segtab) - return (pmap->pm_segtab[((vm_offset_t)(va) >> SEGSHIFT)]); + if (pmap->pm_segtab != NULL) + return (segtab_pde(pmap->pm_segtab, va)); else - return ((pd_entry_t)0); + return (NULL); } /* @@ -267,9 +278,9 @@ pmap_pte(pmap_t pmap, vm_offset_t va) pt_entry_t *pdeaddr; if (pmap) { - pdeaddr = (pt_entry_t *)pmap_segmap(pmap, va); + pdeaddr = pmap_segmap(pmap, va); if (pdeaddr) { - return pdeaddr + vad_to_pte_offset(va); + return pdeaddr + PDE_OFFSET(va); } } return ((pt_entry_t *)0); @@ -878,12 +889,12 @@ pmap_unuse_pt(pmap_t pmap, vm_offset_t v return (0); if (mpte == NULL) { - ptepindex = (va >> SEGSHIFT); + ptepindex = pmap_segshift(va); if (pmap->pm_ptphint && (pmap->pm_ptphint->pindex == ptepindex)) { mpte = pmap->pm_ptphint; } else { - pteva = *pmap_pde(pmap, va); + pteva = pmap_segmap(pmap, va); mpte = PHYS_TO_VM_PAGE(MIPS_KSEG0_TO_PHYS(pteva)); pmap->pm_ptphint = mpte; } @@ -1082,7 +1093,7 @@ pmap_allocpte(pmap_t pmap, vm_offset_t v /* * Calculate pagetable page index */ - ptepindex = va >> SEGSHIFT; + ptepindex = pmap_segshift(va); retry: /* * Get the page directory entry @@ -1205,7 +1216,7 @@ pmap_growkernel(vm_offset_t addr) nkpt++; pte = (pt_entry_t *)pageva; - segtab_pde(kernel_segmap, kernel_vm_end) = (pd_entry_t)pte; + segtab_pde(kernel_segmap, kernel_vm_end) = pte; /* * The R[4-7]?00 stores only one copy of the Global bit in @@ -1529,8 +1540,8 @@ pmap_remove(struct pmap *pmap, vm_offset goto out; } for (va = sva; va < eva; va = nva) { - if (!*pmap_pde(pmap, va)) { - nva = mips_segtrunc(va + MIPS_SEGSIZE); + if (pmap_segmap(pmap, va) == NULL) { + nva = mips_segtrunc(va + NBSEG); continue; } pmap_remove_page(pmap, va); @@ -1646,8 +1657,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sv /* * If segment table entry is empty, skip this segment. */ - if (!*pmap_pde(pmap, sva)) { - sva = mips_segtrunc(sva + MIPS_SEGSIZE); + if (pmap_segmap(pmap, sva) == NULL) { + sva = mips_segtrunc(sva + NBSEG); continue; } /* @@ -1934,7 +1945,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ /* * Calculate pagetable page index */ - ptepindex = va >> SEGSHIFT; + ptepindex = pmap_segshift(va); if (mpte && (mpte->pindex == ptepindex)) { mpte->wire_count++; } else { @@ -2619,7 +2630,7 @@ pmap_is_prefaultable(pmap_t pmap, vm_off rv = FALSE; PMAP_LOCK(pmap); - if (*pmap_pde(pmap, addr)) { + if (pmap_segmap(pmap, addr) != NULL) { pte = pmap_pte(pmap, addr); rv = (*pte == 0); } From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 14:56:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B6BD106566B; Thu, 8 Jul 2010 14:56:42 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B33F8FC08; Thu, 8 Jul 2010 14:56:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68EugUY043355; Thu, 8 Jul 2010 14:56:42 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68EugUB043353; Thu, 8 Jul 2010 14:56:42 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201007081456.o68EugUB043353@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 8 Jul 2010 14:56: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: r209806 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 14:56:42 -0000 Author: jchandra Date: Thu Jul 8 14:56:42 2010 New Revision: 209806 URL: http://svn.freebsd.org/changeset/base/209806 Log: Fix minor issue in sys/mips/mips/cache_mipsNN.c, using int type for virtual addr will break on 64 bit, change to vm_offset_t. Reviewed by: imp@ Approved by: rrs (mentor) Modified: head/sys/mips/mips/cache_mipsNN.c Modified: head/sys/mips/mips/cache_mipsNN.c ============================================================================== --- head/sys/mips/mips/cache_mipsNN.c Thu Jul 8 14:49:55 2010 (r209805) +++ head/sys/mips/mips/cache_mipsNN.c Thu Jul 8 14:56:42 2010 (r209806) @@ -404,7 +404,7 @@ mipsNN_pdcache_wbinv_range_32(vm_offset_ void mipsNN_pdcache_wbinv_range_index_16(vm_offset_t va, vm_size_t size) { - unsigned int eva, tmpva; + vm_offset_t eva, tmpva; int i, stride, loopcount; /* @@ -445,7 +445,7 @@ mipsNN_pdcache_wbinv_range_index_16(vm_o void mipsNN_pdcache_wbinv_range_index_32(vm_offset_t va, vm_size_t size) { - unsigned int eva, tmpva; + vm_offset_t eva, tmpva; int i, stride, loopcount; /* From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 14:59:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02F4B106566B; Thu, 8 Jul 2010 14:59:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E6FE68FC1D; Thu, 8 Jul 2010 14:59:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68ExWcn044027; Thu, 8 Jul 2010 14:59:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68ExWgO044025; Thu, 8 Jul 2010 14:59:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201007081459.o68ExWgO044025@svn.freebsd.org> From: Adrian Chadd Date: Thu, 8 Jul 2010 14:59:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209807 - head/sys/mips/atheros X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 14:59:33 -0000 Author: adrian Date: Thu Jul 8 14:59:32 2010 New Revision: 209807 URL: http://svn.freebsd.org/changeset/base/209807 Log: Address PR kern/148307 - fix if_ath TX mbuf alignment/size constraint checks The existing code only checked the alignment of the first mbuf and didn't enforce the size constraints. This commit introduces a simple function to check the alignment and size of all mbufs in the list. This fixes the initial issue in the PR. PR: kern/148307 Reviewed by: gonzo@ Modified: head/sys/mips/atheros/if_arge.c Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Thu Jul 8 14:56:42 2010 (r209806) +++ head/sys/mips/atheros/if_arge.c Thu Jul 8 14:59:32 2010 (r209807) @@ -834,6 +834,28 @@ arge_init_locked(struct arge_softc *sc) } /* + * Return whether the mbuf chain is correctly aligned + * for the arge TX engine. + * + * The TX engine requires each fragment to be aligned to a + * 4 byte boundary and the size of each fragment except + * the last to be a multiple of 4 bytes. + */ +static int +arge_mbuf_chain_is_tx_aligned(struct mbuf *m0) +{ + struct mbuf *m; + + for (m = m0; m != NULL; m = m->m_next) { + if((mtod(m, intptr_t) & 3) != 0) + return 0; + if ((m->m_next != NULL) && ((m->m_len & 0x03) != 0)) + return 0; + } + return 1; +} + +/* * Encapsulate an mbuf chain in a descriptor by coupling the mbuf data * pointers to the fragment pointers. */ @@ -853,7 +875,7 @@ arge_encap(struct arge_softc *sc, struct * even 4 bytes */ m = *m_head; - if((mtod(m, intptr_t) & 3) != 0) { + if (! arge_mbuf_chain_is_tx_aligned(m)) { m = m_defrag(*m_head, M_DONTWAIT); if (m == NULL) { *m_head = NULL; From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 15:05:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2424C106566C; Thu, 8 Jul 2010 15:05:24 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1220D8FC14; Thu, 8 Jul 2010 15:05:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68F5N5W045372; Thu, 8 Jul 2010 15:05:23 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68F5NmO045365; Thu, 8 Jul 2010 15:05:23 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201007081505.o68F5NmO045365@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 8 Jul 2010 15:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209808 - in head/sys/mips/rmi: . dev/xlr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 15:05:24 -0000 Author: jchandra Date: Thu Jul 8 15:05:23 2010 New Revision: 209808 URL: http://svn.freebsd.org/changeset/base/209808 Log: 64 bit compilation support XLR platform code. Mostly changes to make casting between int and pointer and printing 64bit values safe for 32 and 64 bit compile. Approved by: rrs Modified: head/sys/mips/rmi/dev/xlr/rge.c head/sys/mips/rmi/iodi.c head/sys/mips/rmi/on_chip.c head/sys/mips/rmi/xlr_machdep.c head/sys/mips/rmi/xlr_pci.c Modified: head/sys/mips/rmi/dev/xlr/rge.c ============================================================================== --- head/sys/mips/rmi/dev/xlr/rge.c Thu Jul 8 14:59:32 2010 (r209807) +++ head/sys/mips/rmi/dev/xlr/rge.c Thu Jul 8 15:05:23 2010 (r209808) @@ -583,14 +583,14 @@ release_tx_desc(struct msgrng_msg *msg, struct mbuf *m; tx_desc = (struct p2d_tx_desc *)MIPS_PHYS_TO_KSEG0(msg->msg0); - chk_addr = (struct p2d_tx_desc *)(uint32_t) (tx_desc->frag[XLR_MAX_TX_FRAGS] & 0x00000000ffffffff); + chk_addr = (struct p2d_tx_desc *)(intptr_t)tx_desc->frag[XLR_MAX_TX_FRAGS]; if (tx_desc != chk_addr) { printf("Address %p does not match with stored addr %p - we leaked a descriptor\n", tx_desc, chk_addr); return; } if (rel_buf) { - m = (struct mbuf *)(uint32_t) (tx_desc->frag[XLR_MAX_TX_FRAGS + 1] & 0x00000000ffffffff); + m = (struct mbuf *)(intptr_t)tx_desc->frag[XLR_MAX_TX_FRAGS + 1]; m_freem(m); } free_p2d_desc(tx_desc); @@ -626,7 +626,7 @@ free_buf(vm_paddr_t paddr) (u_long)paddr, mag); return; } - m = (struct mbuf *)um; + m = (struct mbuf *)(intptr_t)um; if (m != NULL) m_freem(m); } @@ -644,9 +644,9 @@ get_buf(void) if (m_new == NULL) return NULL; - m_adj(m_new, XLR_CACHELINE_SIZE - ((unsigned int)m_new->m_data & 0x1f)); + m_adj(m_new, XLR_CACHELINE_SIZE - ((uintptr_t)m_new->m_data & 0x1f)); md = (unsigned int *)m_new->m_data; - md[0] = (unsigned int)m_new; /* Back Ptr */ + md[0] = (uintptr_t)m_new; /* Back Ptr */ md[1] = 0xf00bad; m_adj(m_new, XLR_CACHELINE_SIZE); @@ -996,7 +996,7 @@ rmi_xlr_config_pde(struct driver_data *p bucket_map |= (1ULL << bucket); } } - printf("rmi_xlr_config_pde: bucket_map=%llx\n", bucket_map); + printf("rmi_xlr_config_pde: bucket_map=%jx\n", (uintmax_t)bucket_map); /* bucket_map = 0x1; */ xlr_write_reg(priv->mmio, R_PDE_CLASS_0, (bucket_map & 0xffffffff)); @@ -1480,8 +1480,8 @@ mac_xmit(struct mbuf *m, struct rge_soft msgrng_access_disable(mflags); release_tx_desc(&msg, 0); xlr_rge_msg_snd_failed[vcpu]++; - dbg_msg("Failed packet to cpu %d, rv = %d, stid %d, msg0=%llx\n", - vcpu, rv, stid, msg.msg0); + dbg_msg("Failed packet to cpu %d, rv = %d, stid %d, msg0=%jx\n", + vcpu, rv, stid, (uintmax_t)msg.msg0); return MAC_TX_FAIL; } msgrng_access_disable(mflags); @@ -1489,7 +1489,8 @@ mac_xmit(struct mbuf *m, struct rge_soft } /* Send the packet to MAC */ - dbg_msg("Sent tx packet to stid %d, msg0=%llx, msg1=%llx \n", stid, msg.msg0, msg.msg1); + dbg_msg("Sent tx packet to stid %d, msg0=%jx, msg1=%jx \n", stid, + (uintmax_t)msg.msg0, (uintmax_t)msg.msg1); #ifdef DUMP_PACKETS { int i = 0; @@ -1638,8 +1639,8 @@ rmi_xlr_mac_msgring_handler(int bucket, int vcpu = xlr_cpu_id(); int cpu = xlr_core_id(); - dbg_msg("mac: bucket=%d, size=%d, code=%d, stid=%d, msg0=%llx msg1=%llx\n", - bucket, size, code, stid, msg->msg0, msg->msg1); + dbg_msg("mac: bucket=%d, size=%d, code=%d, stid=%d, msg0=%jx msg1=%jx\n", + bucket, size, code, stid, (uintmax_t)msg->msg0, (uintmax_t)msg->msg1); phys_addr = (uint64_t) (msg->msg0 & 0xffffffffe0ULL); length = (msg->msg0 >> 40) & 0x3fff; @@ -1670,8 +1671,8 @@ rmi_xlr_mac_msgring_handler(int bucket, return; priv = &(sc->priv); - dbg_msg("msg0 = %llx, stid = %d, port = %d, addr=%lx, length=%d, ctrl=%d\n", - msg->msg0, stid, port, addr, length, ctrl); + dbg_msg("msg0 = %jx, stid = %d, port = %d, addr=%lx, length=%d, ctrl=%d\n", + (uintmax_t)msg->msg0, stid, port, addr, length, ctrl); if (ctrl == CTRL_REG_FREE || ctrl == CTRL_JUMBO_FREE) { xlr_rge_tx_ok_done[vcpu]++; @@ -1698,8 +1699,8 @@ rmi_xlr_mac_msgring_handler(int bucket, if ((priv->frin_to_be_sent[cpu]) > MAC_FRIN_TO_BE_SENT_THRESHOLD) { mac_frin_replenish(NULL); } - dbg_msg("gmac_%d: rx packet: phys_addr = %llx, length = %x\n", - priv->instance, phys_addr, length); + dbg_msg("gmac_%d: rx packet: phys_addr = %jx, length = %x\n", + priv->instance, (uintmax_t)phys_addr, length); mac_stats_add(priv->stats.rx_packets, 1); mac_stats_add(priv->stats.rx_bytes, length); xlr_inc_counter(NETIF_RX); @@ -1887,7 +1888,7 @@ rge_attach(device_t dev) * note this is a hack to pass the irq to the iodi interrupt setup * routines */ - sc->rge_irq.__r_i = (struct resource_i *)sc->irq; + sc->rge_irq.__r_i = (struct resource_i *)(intptr_t)sc->irq; ret = bus_setup_intr(dev, &sc->rge_irq, INTR_FAST | INTR_TYPE_NET | INTR_MPSAFE, NULL, rge_intr, sc, &sc->rge_intrhand); @@ -2040,7 +2041,7 @@ rge_rx(struct rge_softc *sc, vm_paddr_t mag = xlr_paddr_lw(paddr - XLR_CACHELINE_SIZE + sizeof(uint32_t)); mips_wr_status(sr); - m = (struct mbuf *)tm; + m = (struct mbuf *)(intptr_t)tm; if (mag != 0xf00bad) { /* somebody else packet Error - FIXME in intialization */ printf("cpu %d: *ERROR* Not my packet paddr %p\n", xlr_cpu_id(), (void *)paddr); @@ -2453,7 +2454,7 @@ rmi_xlr_config_spill(xlr_reg_t * mmio, panic("Unable to allocate memory for spill area!\n"); } phys_addr = vtophys(spill); - dbg_msg("Allocate spill %d bytes at %llx\n", size, phys_addr); + dbg_msg("Allocate spill %d bytes at %jx\n", size, (uintmax_t)phys_addr); xlr_write_reg(mmio, reg_start_0, (phys_addr >> 5) & 0xffffffff); xlr_write_reg(mmio, reg_start_1, (phys_addr >> 37) & 0x07); xlr_write_reg(mmio, reg_size, spill_size); Modified: head/sys/mips/rmi/iodi.c ============================================================================== --- head/sys/mips/rmi/iodi.c Thu Jul 8 14:59:32 2010 (r209807) +++ head/sys/mips/rmi/iodi.c Thu Jul 8 15:05:23 2010 (r209808) @@ -115,7 +115,7 @@ iodi_setup_intr(device_t dev, device_t c int irq; /* This is a hack to pass in the irq */ - irq = (int)ires->__r_i; + irq = (intptr_t)ires->__r_i; if (rmi_spin_mutex_safe) mtx_lock_spin(&xlr_pic_lock); reg = xlr_read_reg(mmio, PIC_IRT_1_BASE + irq - PIC_IRQ_BASE); @@ -178,10 +178,10 @@ iodi_alloc_resource(device_t bus, device res->r_bustag = uart_bus_space_mem; } else if (strcmp(device_get_name(child), "ehci") == 0) { - res->r_bushandle = 0xbef24000; + res->r_bushandle = MIPS_PHYS_TO_KSEG1(0x1ef24000); res->r_bustag = rmi_pci_bus_space; } else if (strcmp(device_get_name(child), "cfi") == 0) { - res->r_bushandle = 0xbc000000; + res->r_bushandle = MIPS_PHYS_TO_KSEG1(0x1c000000); res->r_bustag = 0; } /* res->r_start = *rid; */ Modified: head/sys/mips/rmi/on_chip.c ============================================================================== --- head/sys/mips/rmi/on_chip.c Thu Jul 8 14:59:32 2010 (r209807) +++ head/sys/mips/rmi/on_chip.c Thu Jul 8 15:05:23 2010 (r209808) @@ -210,8 +210,8 @@ xlr_msgring_handler(struct trapframe *tf if (!tx_stn_handlers[tx_stid].action) { printf("[%s]: No Handler for message from stn_id=%d, bucket=%d, " - "size=%d, msg0=%llx, dropping message\n", - __FUNCTION__, tx_stid, bucket, size, msg.msg0); + "size=%d, msg0=%jx, dropping message\n", + __FUNCTION__, tx_stid, bucket, size, (uintmax_t)msg.msg0); } else { //printf("[%s]: rx_stid = %d\n", __FUNCTION__, rx_stid); msgrng_flags_restore(mflags); Modified: head/sys/mips/rmi/xlr_machdep.c ============================================================================== --- head/sys/mips/rmi/xlr_machdep.c Thu Jul 8 14:59:32 2010 (r209807) +++ head/sys/mips/rmi/xlr_machdep.c Thu Jul 8 15:05:23 2010 (r209808) @@ -265,7 +265,6 @@ mips_init(void) init_param2(physmem); /* XXX: Catch 22. Something touches the tlb. */ - mips_cpu_init(); pmap_bootstrap(); #ifdef DDB @@ -294,13 +293,13 @@ platform_start(__register_t a0 __unused, #endif /* XXX FIXME the code below is not 64 bit clean */ /* Save boot loader and other stuff from scratch regs */ - xlr_boot1_info = *(struct boot1_info *)read_c0_register32(MIPS_COP_0_OSSCRATCH, 0); + xlr_boot1_info = *(struct boot1_info *)(intptr_t)(int)read_c0_register32(MIPS_COP_0_OSSCRATCH, 0); cpu_mask_info = read_c0_register64(MIPS_COP_0_OSSCRATCH, 1); xlr_online_cpumask = read_c0_register32(MIPS_COP_0_OSSCRATCH, 2); xlr_run_mode = read_c0_register32(MIPS_COP_0_OSSCRATCH, 3); xlr_argc = read_c0_register32(MIPS_COP_0_OSSCRATCH, 4); - xlr_argv = (char **)read_c0_register32(MIPS_COP_0_OSSCRATCH, 5); - xlr_envp = (char **)read_c0_register32(MIPS_COP_0_OSSCRATCH, 6); + xlr_argv = (char **)(intptr_t)(int)read_c0_register32(MIPS_COP_0_OSSCRATCH, 5); + xlr_envp = (char **)(intptr_t)(int)read_c0_register32(MIPS_COP_0_OSSCRATCH, 6); /* TODO: Verify the magic number here */ /* FIXMELATER: xlr_boot1_info.magic_number */ @@ -387,9 +386,9 @@ platform_start(__register_t a0 __unused, * 64 bit > 4Gig and we are in 32 bit mode. */ phys_avail[j + 1] = 0xfffff000; - printf("boot map size was %llx\n", boot_map->physmem_map[i].size); + printf("boot map size was %jx\n", (intmax_t)boot_map->physmem_map[i].size); boot_map->physmem_map[i].size = phys_avail[j + 1] - phys_avail[j]; - printf("reduced to %llx\n", boot_map->physmem_map[i].size); + printf("reduced to %jx\n", (intmax_t)boot_map->physmem_map[i].size); } printf("Next segment : addr:%p -> %p \n", (void *)phys_avail[j], Modified: head/sys/mips/rmi/xlr_pci.c ============================================================================== --- head/sys/mips/rmi/xlr_pci.c Thu Jul 8 14:59:32 2010 (r209807) +++ head/sys/mips/rmi/xlr_pci.c Thu Jul 8 15:05:23 2010 (r209808) @@ -223,7 +223,7 @@ static uint32_t pci_cfg_read_32bit(uint32_t addr) { uint32_t temp = 0; - uint32_t *p = (uint32_t *) ((uint32_t) xlr_pci_config_base + (addr & ~3)); + uint32_t *p = (uint32_t *)xlr_pci_config_base + addr / sizeof(uint32_t); uint64_t cerr_cpu_log = 0; disable_and_clear_cache_error(); @@ -285,7 +285,7 @@ xlr_pcib_write_config(device_t dev, u_in data = val; } - p = (uint32_t *)((uint32_t) xlr_pci_config_base + (cfgaddr & ~3)); + p = (uint32_t *)xlr_pci_config_base + cfgaddr / sizeof(uint32_t); *p = bswap32(data); return; @@ -410,7 +410,7 @@ bridge_pcix_mask_ack(void *arg) static void bridge_pcie_ack(void *arg) { - int irq = (int)arg; + int irq = (intptr_t)arg; uint32_t reg; xlr_reg_t *pcie_mmio_le = xlr_io_mmio(XLR_IO_PCIE_1_OFFSET); From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 15:20:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDE26106564A; Thu, 8 Jul 2010 15:20:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD8268FC1C; Thu, 8 Jul 2010 15:20:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68FKvHJ048821; Thu, 8 Jul 2010 15:20:57 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68FKvO9048818; Thu, 8 Jul 2010 15:20:57 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201007081520.o68FKvO9048818@svn.freebsd.org> From: Adrian Chadd Date: Thu, 8 Jul 2010 15:20: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: r209809 - head/sys/mips/atheros X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 15:20:58 -0000 Author: adrian Date: Thu Jul 8 15:20:57 2010 New Revision: 209809 URL: http://svn.freebsd.org/changeset/base/209809 Log: Add TX-path aligned/unaligned stats for if_arge. Modified: head/sys/mips/atheros/if_arge.c head/sys/mips/atheros/if_argevar.h Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Thu Jul 8 15:05:23 2010 (r209808) +++ head/sys/mips/atheros/if_arge.c Thu Jul 8 15:20:57 2010 (r209809) @@ -209,6 +209,14 @@ arge_attach_sysctl(device_t dev) SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "debug", CTLFLAG_RW, &sc->arge_debug, 0, "arge interface debugging flags"); + + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "tx_pkts_aligned", CTLFLAG_RW, &sc->stats.tx_pkts_aligned, 0, + "number of TX aligned packets"); + + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "tx_pkts_unaligned", CTLFLAG_RW, &sc->stats.tx_pkts_unaligned, 0, + "number of TX unaligned packets"); } static int @@ -876,13 +884,15 @@ arge_encap(struct arge_softc *sc, struct */ m = *m_head; if (! arge_mbuf_chain_is_tx_aligned(m)) { + sc->stats.tx_pkts_unaligned++; m = m_defrag(*m_head, M_DONTWAIT); if (m == NULL) { *m_head = NULL; return (ENOBUFS); } *m_head = m; - } + } else + sc->stats.tx_pkts_aligned++; prod = sc->arge_cdata.arge_tx_prod; txd = &sc->arge_cdata.arge_txdesc[prod]; Modified: head/sys/mips/atheros/if_argevar.h ============================================================================== --- head/sys/mips/atheros/if_argevar.h Thu Jul 8 15:05:23 2010 (r209808) +++ head/sys/mips/atheros/if_argevar.h Thu Jul 8 15:20:57 2010 (r209809) @@ -155,6 +155,10 @@ struct arge_softc { uint32_t arge_pll_reg_shift; int arge_if_flags; uint32_t arge_debug; + struct { + uint32_t tx_pkts_unaligned; + uint32_t tx_pkts_aligned; + } stats; }; #endif /* __IF_ARGEVAR_H__ */ From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 15:22:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56136106564A; Thu, 8 Jul 2010 15:22:47 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 454298FC0A; Thu, 8 Jul 2010 15:22:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68FMljN049262; Thu, 8 Jul 2010 15:22:47 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68FMlxm049258; Thu, 8 Jul 2010 15:22:47 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201007081522.o68FMlxm049258@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 8 Jul 2010 15:22: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: r209810 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 15:22:47 -0000 Author: jchandra Date: Thu Jul 8 15:22:46 2010 New Revision: 209810 URL: http://svn.freebsd.org/changeset/base/209810 Log: Enable KX bit, which is needed for 64 bit access, in status register for XLR. Update exception handlers and other functions which set/change status registers to preserve this. Approved by: rrs Modified: head/sys/mips/mips/exception.S head/sys/mips/mips/locore.S head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/mips/exception.S ============================================================================== --- head/sys/mips/mips/exception.S Thu Jul 8 15:20:57 2010 (r209809) +++ head/sys/mips/mips/exception.S Thu Jul 8 15:22:46 2010 (r209810) @@ -235,7 +235,7 @@ SlowFault: #define SAVE_REG(reg, offs, base) \ REG_S reg, CALLFRAME_SIZ + (SZREG * offs) (base) -#ifdef TARGET_OCTEON +#if defined(TARGET_OCTEON) #define CLEAR_STATUS \ mfc0 a0, COP_0_STATUS_REG ;\ li a2, (MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX) ; \ @@ -244,6 +244,15 @@ SlowFault: and a0, a0, a2 ; \ mtc0 a0, COP_0_STATUS_REG ; \ ITLBNOPFIX +#elif defined(TARGET_XLR_XLS) +#define CLEAR_STATUS \ + mfc0 a0, COP_0_STATUS_REG ;\ + li a2, (MIPS_SR_KX | MIPS_SR_COP_2_BIT) ; \ + or a0, a0, a2 ; \ + li a2, ~(MIPS_SR_INT_IE | MIPS_SR_EXL | SR_KSU_USER) ; \ + and a0, a0, a2 ; \ + mtc0 a0, COP_0_STATUS_REG ; \ + ITLBNOPFIX #else #define CLEAR_STATUS \ mfc0 a0, COP_0_STATUS_REG ;\ @@ -475,8 +484,10 @@ NNON_LEAF(MipsUserGenException, CALLFRAM PTR_LA gp, _C_LABEL(_gp) # switch to kernel GP # Turn off fpu and enter kernel mode and t0, a0, ~(SR_COP_1_BIT | SR_EXL | SR_KSU_MASK | SR_INT_ENAB) -#ifdef TARGET_OCTEON +#if defined(TARGET_OCTEON) or t0, t0, (MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX | MIPS32_SR_PX) +#elif defined(TARGET_XLR_XLS) + or t0, t0, (MIPS_SR_KX | MIPS_SR_COP_2_BIT) #endif mtc0 t0, COP_0_STATUS_REG PTR_ADDU a0, k1, U_PCB_REGS @@ -693,6 +704,8 @@ NNON_LEAF(MipsUserIntr, CALLFRAME_SIZ, r and t0, a0, ~(SR_COP_1_BIT | SR_EXL | SR_INT_ENAB | SR_KSU_MASK) #ifdef TARGET_OCTEON or t0, t0, (MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX | MIPS32_SR_PX) +#elif defined(TARGET_XLR_XLS) + or t0, t0, (MIPS_SR_KX | MIPS_SR_COP_2_BIT) #endif mtc0 t0, COP_0_STATUS_REG ITLBNOPFIX Modified: head/sys/mips/mips/locore.S ============================================================================== --- head/sys/mips/mips/locore.S Thu Jul 8 15:20:57 2010 (r209809) +++ head/sys/mips/mips/locore.S Thu Jul 8 15:22:46 2010 (r209810) @@ -99,7 +99,7 @@ VECTOR(_locore, unknown) /* Reset these bits */ li t0, ~(MIPS_SR_DE | MIPS_SR_SOFT_RESET | MIPS_SR_ERL | MIPS_SR_EXL | MIPS_SR_INT_IE) -#elif defined (CPU_XLR) +#elif defined (TARGET_XLR_XLS) /* Set these bits */ li t1, (MIPS_SR_COP_2_BIT | MIPS_SR_COP_0_BIT | MIPS_SR_KX) Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Thu Jul 8 15:20:57 2010 (r209809) +++ head/sys/mips/mips/vm_machdep.c Thu Jul 8 15:22:46 2010 (r209810) @@ -148,7 +148,7 @@ cpu_fork(register struct thread *td1,reg pcb2->pcb_context[PCB_REG_S0] = (register_t)(intptr_t)fork_return; pcb2->pcb_context[PCB_REG_S1] = (register_t)(intptr_t)td2; pcb2->pcb_context[PCB_REG_S2] = (register_t)(intptr_t)td2->td_frame; - pcb2->pcb_context[PCB_REG_SR] = SR_INT_MASK & mips_rd_status(); + pcb2->pcb_context[PCB_REG_SR] = (MIPS_SR_KX | SR_INT_MASK) & mips_rd_status(); /* * FREEBSD_DEVELOPERS_FIXME: * Setup any other CPU-Specific registers (Not MIPS Standard) @@ -162,7 +162,6 @@ cpu_fork(register struct thread *td1,reg #ifdef TARGET_OCTEON pcb2->pcb_context[PCB_REG_SR] |= MIPS_SR_COP_2_BIT | MIPS32_SR_PX | MIPS_SR_UX | MIPS_SR_KX | MIPS_SR_SX; #endif - } /* @@ -351,7 +350,7 @@ cpu_set_upcall(struct thread *td, struct pcb2->pcb_context[PCB_REG_S1] = (register_t)(intptr_t)td; pcb2->pcb_context[PCB_REG_S2] = (register_t)(intptr_t)td->td_frame; /* Dont set IE bit in SR. sched lock release will take care of it */ - pcb2->pcb_context[PCB_REG_SR] = SR_INT_MASK & mips_rd_status(); + pcb2->pcb_context[PCB_REG_SR] = (MIPS_SR_KX | SR_INT_MASK) & mips_rd_status(); #ifdef TARGET_OCTEON pcb2->pcb_context[PCB_REG_SR] |= MIPS_SR_COP_2_BIT | MIPS_SR_COP_0_BIT | From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 15:37:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEFC510656C2; Thu, 8 Jul 2010 15:37:16 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEA838FC0C; Thu, 8 Jul 2010 15:37:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68FbGRP052502; Thu, 8 Jul 2010 15:37:16 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68FbGSs052500; Thu, 8 Jul 2010 15:37:16 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201007081537.o68FbGSs052500@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 8 Jul 2010 15:37: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: r209811 - head/sys/mips/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 15:37:16 -0000 Author: jchandra Date: Thu Jul 8 15:37:16 2010 New Revision: 209811 URL: http://svn.freebsd.org/changeset/base/209811 Log: Use 64 bit type for rqb_word_t in n64 kernel. Reviewed by: imp Approved by: rrs Modified: head/sys/mips/include/runq.h Modified: head/sys/mips/include/runq.h ============================================================================== --- head/sys/mips/include/runq.h Thu Jul 8 15:22:46 2010 (r209810) +++ head/sys/mips/include/runq.h Thu Jul 8 15:37:16 2010 (r209811) @@ -30,11 +30,16 @@ #ifndef _MACHINE_RUNQ_H_ #define _MACHINE_RUNQ_H_ +#if defined(__mips_n64) +#define RQB_LEN (1) /* Number of priority status words. */ +#define RQB_L2BPW (6) /* Log2(sizeof(rqb_word_t) * NBBY)). */ +#else #define RQB_LEN (2) /* Number of priority status words. */ #define RQB_L2BPW (5) /* Log2(sizeof(rqb_word_t) * NBBY)). */ +#endif #define RQB_BPW (1<> RQB_L2BPW) #define RQB_FFS(word) (ffs(word) - 1) @@ -42,6 +47,10 @@ /* * Type of run queue status word. */ -typedef u_int32_t rqb_word_t; +#if defined(__mips_n64) +typedef u_int64_t rqb_word_t; +#else +typedef u_int32_t rqb_word_t; +#endif #endif From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 15:38:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF9FA106564A; Thu, 8 Jul 2010 15:38:55 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDDF88FC0A; Thu, 8 Jul 2010 15:38:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68FctGd052898; Thu, 8 Jul 2010 15:38:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68Fctuf052894; Thu, 8 Jul 2010 15:38:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007081538.o68Fctuf052894@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 8 Jul 2010 15:38: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: r209812 - in head/sys/powerpc: aim booke powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 15:38:56 -0000 Author: nwhitehorn Date: Thu Jul 8 15:38:55 2010 New Revision: 209812 URL: http://svn.freebsd.org/changeset/base/209812 Log: Replace the existing PowerPC busdma implementation with the one from amd64 (with slight modifications). This provides support for bounce buffers, which are required on systems with RAM above 4 GB. Modified: head/sys/powerpc/aim/vm_machdep.c head/sys/powerpc/booke/vm_machdep.c head/sys/powerpc/powerpc/busdma_machdep.c Modified: head/sys/powerpc/aim/vm_machdep.c ============================================================================== --- head/sys/powerpc/aim/vm_machdep.c Thu Jul 8 15:37:16 2010 (r209811) +++ head/sys/powerpc/aim/vm_machdep.c Thu Jul 8 15:38:55 2010 (r209812) @@ -358,10 +358,8 @@ sf_buf_free(struct sf_buf *sf) void swi_vm(void *dummy) { -#if 0 /* XXX: Don't have busdma stuff yet */ if (busdma_swi_pending != 0) busdma_swi(); -#endif } /* Modified: head/sys/powerpc/booke/vm_machdep.c ============================================================================== --- head/sys/powerpc/booke/vm_machdep.c Thu Jul 8 15:37:16 2010 (r209811) +++ head/sys/powerpc/booke/vm_machdep.c Thu Jul 8 15:38:55 2010 (r209812) @@ -357,10 +357,8 @@ sf_buf_free(struct sf_buf *sf) void swi_vm(void *dummy) { -#if 0 /* XXX: Don't have busdma stuff yet */ if (busdma_swi_pending != 0) busdma_swi(); -#endif } /* Modified: head/sys/powerpc/powerpc/busdma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/busdma_machdep.c Thu Jul 8 15:37:16 2010 (r209811) +++ head/sys/powerpc/powerpc/busdma_machdep.c Thu Jul 8 15:38:55 2010 (r209812) @@ -1,5 +1,4 @@ /*- - * Copyright (c) 2002 Peter Grehan * Copyright (c) 1997, 1998 Justin T. Gibbs. * All rights reserved. * @@ -23,27 +22,28 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * From i386/busdma_machdep.c,v 1.26 2002/04/19 22:58:09 alfred */ -#include -__FBSDID("$FreeBSD$"); - /* - * Bus dma support routines + * From amd64/busdma_machdep.c, r204214 */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include #include #include +#include +#include #include #include #include #include #include +#include #include #include @@ -51,34 +51,122 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include + +#define MAX_BPAGES 8192 + +struct bounce_zone; struct bus_dma_tag { - bus_dma_tag_t parent; - bus_size_t alignment; - bus_size_t boundary; - bus_addr_t lowaddr; - bus_addr_t highaddr; + bus_dma_tag_t parent; + bus_size_t alignment; + bus_size_t boundary; + bus_addr_t lowaddr; + bus_addr_t highaddr; bus_dma_filter_t *filter; - void *filterarg; - bus_size_t maxsize; - u_int nsegments; - bus_size_t maxsegsz; - int flags; - int ref_count; - int map_count; + void *filterarg; + bus_size_t maxsize; + u_int nsegments; + bus_size_t maxsegsz; + int flags; + int ref_count; + int map_count; bus_dma_lock_t *lockfunc; void *lockfuncarg; + bus_dma_segment_t *segments; + struct bounce_zone *bounce_zone; +}; + +struct bounce_page { + vm_offset_t vaddr; /* kva of bounce buffer */ + bus_addr_t busaddr; /* Physical address */ + vm_offset_t datavaddr; /* kva of client data */ + bus_size_t datacount; /* client data count */ + STAILQ_ENTRY(bounce_page) links; +}; + +int busdma_swi_pending; + +struct bounce_zone { + STAILQ_ENTRY(bounce_zone) links; + STAILQ_HEAD(bp_list, bounce_page) bounce_page_list; + int total_bpages; + int free_bpages; + int reserved_bpages; + int active_bpages; + int total_bounced; + int total_deferred; + int map_count; + bus_size_t alignment; + bus_addr_t lowaddr; + char zoneid[8]; + char lowaddrid[20]; + struct sysctl_ctx_list sysctl_tree; + struct sysctl_oid *sysctl_tree_top; }; +static struct mtx bounce_lock; +static int total_bpages; +static int busdma_zonecount; +static STAILQ_HEAD(, bounce_zone) bounce_zone_list; + +SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); +SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, + "Total bounce pages"); + struct bus_dmamap { - bus_dma_tag_t dmat; - void *buf; /* unmapped buffer pointer */ - bus_size_t buflen; /* unmapped buffer length */ - bus_dmamap_callback_t *callback; - void *callback_arg; + struct bp_list bpages; + int pagesneeded; + int pagesreserved; + bus_dma_tag_t dmat; + void *buf; /* unmapped buffer pointer */ + bus_size_t buflen; /* unmapped buffer length */ + bus_dmamap_callback_t *callback; + void *callback_arg; + STAILQ_ENTRY(bus_dmamap) links; }; +static STAILQ_HEAD(, bus_dmamap) bounce_map_waitinglist; +static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist; +static struct bus_dmamap nobounce_dmamap; + +static void init_bounce_pages(void *dummy); +static int alloc_bounce_zone(bus_dma_tag_t dmat); +static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages); +static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map, + int commit); +static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_offset_t vaddr, bus_size_t size); +static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); +static __inline int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); + +/* + * Return true if a match is made. + * + * To find a match walk the chain of bus_dma_tag_t's looking for 'paddr'. + * + * If paddr is within the bounds of the dma tag then call the filter callback + * to check for a match, if there is no filter callback then assume a match. + */ +static __inline int +run_filter(bus_dma_tag_t dmat, bus_addr_t paddr) +{ + int retval; + + retval = 0; + + do { + if (((paddr > dmat->lowaddr && paddr <= dmat->highaddr) + || ((paddr & (dmat->alignment - 1)) != 0)) + && (dmat->filter == NULL + || (*dmat->filter)(dmat->filterarg, paddr) != 0)) + retval = 1; + + dmat = dmat->parent; + } while (retval == 0 && dmat != NULL); + return (retval); +} + /* * Convenience function for manipulating driver locks from busdma (during * busdma_swi, for example). Drivers that don't provide their own locks @@ -112,42 +200,53 @@ busdma_lock_mutex(void *arg, bus_dma_loc static void dflt_lock(void *arg, bus_dma_lock_op_t op) { -#ifdef INVARIANTS panic("driver error: busdma dflt_lock called"); -#else - printf("DRIVER_ERROR: busdma dflt_lock called\n"); -#endif } +#define BUS_DMA_COULD_BOUNCE BUS_DMA_BUS3 +#define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4 /* * Allocate a device specific dma_tag. */ int bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, - bus_size_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr, - bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize, - int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, - void *lockfuncarg, bus_dma_tag_t *dmat) + bus_size_t boundary, bus_addr_t lowaddr, + bus_addr_t highaddr, bus_dma_filter_t *filter, + void *filterarg, bus_size_t maxsize, int nsegments, + bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, + void *lockfuncarg, bus_dma_tag_t *dmat) { bus_dma_tag_t newtag; int error = 0; + /* Basic sanity checking */ + if (boundary != 0 && boundary < maxsegsz) + maxsegsz = boundary; + + if (maxsegsz == 0) { + return (EINVAL); + } + /* Return a NULL tag on failure */ *dmat = NULL; - newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_DEVBUF, M_NOWAIT); - if (newtag == NULL) + newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_DEVBUF, + M_ZERO | M_NOWAIT); + if (newtag == NULL) { + CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", + __func__, newtag, 0, error); return (ENOMEM); + } newtag->parent = parent; newtag->alignment = alignment; newtag->boundary = boundary; - newtag->lowaddr = trunc_page((vm_offset_t)lowaddr) + (PAGE_SIZE - 1); - newtag->highaddr = trunc_page((vm_offset_t)highaddr) + (PAGE_SIZE - 1); + newtag->lowaddr = trunc_page((vm_paddr_t)lowaddr) + (PAGE_SIZE - 1); + newtag->highaddr = trunc_page((vm_paddr_t)highaddr) + (PAGE_SIZE - 1); newtag->filter = filter; newtag->filterarg = filterarg; - newtag->maxsize = maxsize; - newtag->nsegments = nsegments; + newtag->maxsize = maxsize; + newtag->nsegments = nsegments; newtag->maxsegsz = maxsegsz; newtag->flags = flags; newtag->ref_count = 1; /* Count ourself */ @@ -159,61 +258,107 @@ bus_dma_tag_create(bus_dma_tag_t parent, newtag->lockfunc = dflt_lock; newtag->lockfuncarg = NULL; } + newtag->segments = NULL; - /* - * Take into account any restrictions imposed by our parent tag - */ - if (parent != NULL) { - newtag->lowaddr = min(parent->lowaddr, newtag->lowaddr); - newtag->highaddr = max(parent->highaddr, newtag->highaddr); + /* Take into account any restrictions imposed by our parent tag */ + if (parent != NULL) { + newtag->lowaddr = MIN(parent->lowaddr, newtag->lowaddr); + newtag->highaddr = MAX(parent->highaddr, newtag->highaddr); if (newtag->boundary == 0) newtag->boundary = parent->boundary; else if (parent->boundary != 0) - newtag->boundary = MIN(parent->boundary, + newtag->boundary = MIN(parent->boundary, newtag->boundary); - if (newtag->filter == NULL) { - /* - * Short circuit looking at our parent directly - * since we have encapsulated all of its information - */ - newtag->filter = parent->filter; - newtag->filterarg = parent->filterarg; - newtag->parent = parent->parent; + if (newtag->filter == NULL) { + /* + * Short circuit looking at our parent directly + * since we have encapsulated all of its information + */ + newtag->filter = parent->filter; + newtag->filterarg = parent->filterarg; + newtag->parent = parent->parent; } if (newtag->parent != NULL) atomic_add_int(&parent->ref_count, 1); } - *dmat = newtag; + if (newtag->lowaddr < ptoa((vm_paddr_t)Maxmem) + || newtag->alignment > 1) + newtag->flags |= BUS_DMA_COULD_BOUNCE; + + if (((newtag->flags & BUS_DMA_COULD_BOUNCE) != 0) && + (flags & BUS_DMA_ALLOCNOW) != 0) { + struct bounce_zone *bz; + + /* Must bounce */ + + if ((error = alloc_bounce_zone(newtag)) != 0) { + free(newtag, M_DEVBUF); + return (error); + } + bz = newtag->bounce_zone; + + if (ptoa(bz->total_bpages) < maxsize) { + int pages; + + pages = atop(maxsize) - bz->total_bpages; + + /* Add pages to our bounce pool */ + if (alloc_bounce_pages(newtag, pages) < pages) + error = ENOMEM; + } + /* Performed initial allocation */ + newtag->flags |= BUS_DMA_MIN_ALLOC_COMP; + } + + if (error != 0) { + free(newtag, M_DEVBUF); + } else { + *dmat = newtag; + } + CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d", + __func__, newtag, (newtag != NULL ? newtag->flags : 0), error); return (error); } int bus_dma_tag_destroy(bus_dma_tag_t dmat) { + bus_dma_tag_t dmat_copy; + int error; + + error = 0; + dmat_copy = dmat; + if (dmat != NULL) { - - if (dmat->map_count != 0) - return (EBUSY); - - while (dmat != NULL) { - bus_dma_tag_t parent; - - parent = dmat->parent; - atomic_subtract_int(&dmat->ref_count, 1); - if (dmat->ref_count == 0) { - free(dmat, M_DEVBUF); - /* - * Last reference count, so - * release our reference - * count on our parent. - */ - dmat = parent; - } else - dmat = NULL; - } - } - return (0); + + if (dmat->map_count != 0) { + error = EBUSY; + goto out; + } + + while (dmat != NULL) { + bus_dma_tag_t parent; + + parent = dmat->parent; + atomic_subtract_int(&dmat->ref_count, 1); + if (dmat->ref_count == 0) { + if (dmat->segments != NULL) + free(dmat->segments, M_DEVBUF); + free(dmat, M_DEVBUF); + /* + * Last reference count, so + * release our reference + * count on our parent. + */ + dmat = parent; + } else + dmat = NULL; + } + } +out: + CTR3(KTR_BUSDMA, "%s tag %p error %d", __func__, dmat_copy, error); + return (error); } /* @@ -223,10 +368,83 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) int bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) { - *mapp = NULL; - dmat->map_count++; + int error; - return (0); + error = 0; + + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, + M_NOWAIT); + if (dmat->segments == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, ENOMEM); + return (ENOMEM); + } + } + + /* + * Bouncing might be required if the driver asks for an active + * exclusion region, a data alignment that is stricter than 1, and/or + * an active address boundary. + */ + if (dmat->flags & BUS_DMA_COULD_BOUNCE) { + + /* Must bounce */ + struct bounce_zone *bz; + int maxpages; + + if (dmat->bounce_zone == NULL) { + if ((error = alloc_bounce_zone(dmat)) != 0) + return (error); + } + bz = dmat->bounce_zone; + + *mapp = (bus_dmamap_t)malloc(sizeof(**mapp), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (*mapp == NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, ENOMEM); + return (ENOMEM); + } + + /* Initialize the new map */ + STAILQ_INIT(&((*mapp)->bpages)); + + /* + * Attempt to add pages to our pool on a per-instance + * basis up to a sane limit. + */ + if (dmat->alignment > 1) + maxpages = MAX_BPAGES; + else + maxpages = MIN(MAX_BPAGES, Maxmem -atop(dmat->lowaddr)); + if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 + || (bz->map_count > 0 && bz->total_bpages < maxpages)) { + int pages; + + pages = MAX(atop(dmat->maxsize), 1); + pages = MIN(maxpages - bz->total_bpages, pages); + pages = MAX(pages, 1); + if (alloc_bounce_pages(dmat, pages) < pages) + error = ENOMEM; + + if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0) { + if (error == 0) + dmat->flags |= BUS_DMA_MIN_ALLOC_COMP; + } else { + error = 0; + } + } + bz->map_count++; + } else { + *mapp = NULL; + } + if (error == 0) + dmat->map_count++; + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->flags, error); + return (error); } /* @@ -236,13 +454,22 @@ bus_dmamap_create(bus_dma_tag_t dmat, in int bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) { - if (map != NULL) { - panic("dmamap_destroy: NULL?\n"); - } - dmat->map_count--; - return (0); + if (map != NULL && map != &nobounce_dmamap) { + if (STAILQ_FIRST(&map->bpages) != NULL) { + CTR3(KTR_BUSDMA, "%s: tag %p error %d", + __func__, dmat, EBUSY); + return (EBUSY); + } + if (dmat->bounce_zone) + dmat->bounce_zone->map_count--; + free(map, M_DEVBUF); + } + dmat->map_count--; + CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); + return (0); } + /* * Allocate a piece of memory that can be efficiently mapped into * bus device space based on the constraints lited in the dma tag. @@ -250,7 +477,7 @@ bus_dmamap_destroy(bus_dma_tag_t dmat, b */ int bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, - bus_dmamap_t *mapp) + bus_dmamap_t *mapp) { int mflags; @@ -258,56 +485,87 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi mflags = M_NOWAIT; else mflags = M_WAITOK; + + /* If we succeed, no mapping/bouncing will be required */ + *mapp = NULL; + + if (dmat->segments == NULL) { + dmat->segments = (bus_dma_segment_t *)malloc( + sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, + mflags); + if (dmat->segments == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->flags, ENOMEM); + return (ENOMEM); + } + } if (flags & BUS_DMA_ZERO) mflags |= M_ZERO; - *mapp = NULL; - /* * XXX: * (dmat->alignment < dmat->maxsize) is just a quick hack; the exact * alignment guarantees of malloc need to be nailed down, and the * code below should be rewritten to take that into account. * - * In the meantime, we'll return an error if malloc gets it wrong. + * In the meantime, we'll warn the user if malloc gets it wrong. */ - if (dmat->maxsize <= PAGE_SIZE && - dmat->alignment < dmat->maxsize) { + if ((dmat->maxsize <= PAGE_SIZE) && + (dmat->alignment < dmat->maxsize) && + dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem)) { *vaddr = malloc(dmat->maxsize, M_DEVBUF, mflags); - } else { - /* - * XXX Use Contigmalloc until it is merged into this facility - * and handles multi-seg allocations. Nobody is doing - * multi-seg allocations yet though. - */ - *vaddr = contigmalloc(dmat->maxsize, M_DEVBUF, mflags, - 0ul, dmat->lowaddr, dmat->alignment? dmat->alignment : 1ul, - dmat->boundary); - } - - if (*vaddr == NULL) - return (ENOMEM); - - if ((uintptr_t)*vaddr % dmat->alignment) - printf("XXX: %s: alignment not respected!\n", __func__); - - return (0); + } else { + /* + * XXX Use Contigmalloc until it is merged into this facility + * and handles multi-seg allocations. Nobody is doing + * multi-seg allocations yet though. + * XXX Certain AGP hardware does. + */ + *vaddr = contigmalloc(dmat->maxsize, M_DEVBUF, mflags, + 0ul, dmat->lowaddr, dmat->alignment? dmat->alignment : 1ul, + dmat->boundary); + } + if (*vaddr == NULL) { + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->flags, ENOMEM); + return (ENOMEM); + } else if ((uintptr_t)*vaddr & (dmat->alignment - 1)) { + printf("bus_dmamem_alloc failed to align memory properly.\n"); + } +#ifdef NOTYET + if (flags & BUS_DMA_NOCACHE) + pmap_change_attr((vm_offset_t)*vaddr, dmat->maxsize, + PAT_UNCACHEABLE); +#endif + CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", + __func__, dmat, dmat->flags, 0); + return (0); } /* - * Free a piece of memory and it's allocated dmamap, that was allocated + * Free a piece of memory and it's allociated dmamap, that was allocated * via bus_dmamem_alloc. Make the same choice for free/contigfree. */ void bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map) { - if (map != NULL) - panic("bus_dmamem_free: Invalid map freed\n"); - if (dmat->maxsize <= PAGE_SIZE && - dmat->alignment < dmat->maxsize) + /* + * dmamem does not need to be bounced, so the map should be + * NULL + */ + if (map != NULL) + panic("bus_dmamem_free: Invalid map freed\n"); +#ifdef NOTYET + pmap_change_attr((vm_offset_t)vaddr, dmat->maxsize, PAT_WRITE_BACK); +#endif + if ((dmat->maxsize <= PAGE_SIZE) && + (dmat->alignment < dmat->maxsize) && + dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem)) free(vaddr, M_DEVBUF); - else + else { contigfree(vaddr, dmat->maxsize, M_DEVBUF); + } + CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, dmat->flags); } /* @@ -316,26 +574,89 @@ bus_dmamem_free(bus_dma_tag_t dmat, void * the starting segment on entrance, and the ending segment on exit. * first indicates if this is the first invocation of this function. */ -static int -bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dma_segment_t segs[], - void *buf, bus_size_t buflen, struct thread *td, int flags, - vm_offset_t *lastaddrp, int *segp, int first) +static __inline int +_bus_dmamap_load_buffer(bus_dma_tag_t dmat, + bus_dmamap_t map, + void *buf, bus_size_t buflen, + pmap_t pmap, + int flags, + bus_addr_t *lastaddrp, + bus_dma_segment_t *segs, + int *segp, + int first) { bus_size_t sgsize; bus_addr_t curaddr, lastaddr, baddr, bmask; - vm_offset_t vaddr = (vm_offset_t)buf; + vm_offset_t vaddr; + bus_addr_t paddr; int seg; - pmap_t pmap; - if (td != NULL) - pmap = vmspace_pmap(td->td_proc->p_vmspace); - else - pmap = NULL; + if (map == NULL) + map = &nobounce_dmamap; + + if ((map != &nobounce_dmamap && map->pagesneeded == 0) + && ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0)) { + vm_offset_t vendaddr; + + CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, " + "alignment= %d", dmat->lowaddr, ptoa((vm_paddr_t)Maxmem), + dmat->boundary, dmat->alignment); + CTR3(KTR_BUSDMA, "map= %p, nobouncemap= %p, pagesneeded= %d", + map, &nobounce_dmamap, map->pagesneeded); + /* + * Count the number of bounce pages + * needed in order to complete this transfer + */ + vaddr = (vm_offset_t)buf; + vendaddr = (vm_offset_t)buf + buflen; + + while (vaddr < vendaddr) { + bus_size_t sg_len; + sg_len = PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK); + if (pmap) + paddr = pmap_extract(pmap, vaddr); + else + paddr = pmap_kextract(vaddr); + if (run_filter(dmat, paddr) != 0) { + sg_len = roundup2(sg_len, dmat->alignment); + map->pagesneeded++; + } + vaddr += sg_len; + } + CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); + } + + /* Reserve Necessary Bounce Pages */ + if (map->pagesneeded != 0) { + mtx_lock(&bounce_lock); + if (flags & BUS_DMA_NOWAIT) { + if (reserve_bounce_pages(dmat, map, 0) != 0) { + mtx_unlock(&bounce_lock); + return (ENOMEM); + } + } else { + if (reserve_bounce_pages(dmat, map, 1) != 0) { + /* Queue us for resources */ + map->dmat = dmat; + map->buf = buf; + map->buflen = buflen; + STAILQ_INSERT_TAIL(&bounce_map_waitinglist, + map, links); + mtx_unlock(&bounce_lock); + return (EINPROGRESS); + } + } + mtx_unlock(&bounce_lock); + } + + vaddr = (vm_offset_t)buf; lastaddr = *lastaddrp; bmask = ~(dmat->boundary - 1); for (seg = *segp; buflen > 0 ; ) { + bus_size_t max_sgsize; + /* * Get the physical address for this segment. */ @@ -347,11 +668,15 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma /* * Compute the segment size, and adjust counts. */ - sgsize = PAGE_SIZE - ((u_long)curaddr & PAGE_MASK); - if (sgsize > dmat->maxsegsz) - sgsize = dmat->maxsegsz; - if (buflen < sgsize) - sgsize = buflen; + max_sgsize = MIN(buflen, dmat->maxsegsz); + sgsize = PAGE_SIZE - ((vm_offset_t)curaddr & PAGE_MASK); + if (map->pagesneeded != 0 && run_filter(dmat, curaddr)) { + sgsize = roundup2(sgsize, dmat->alignment); + sgsize = MIN(sgsize, max_sgsize); + curaddr = add_bounce_page(dmat, map, vaddr, sgsize); + } else { + sgsize = MIN(sgsize, max_sgsize); + } /* * Make sure we don't cross any boundaries. @@ -364,7 +689,7 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma /* * Insert chunk into a segment, coalescing with - * the previous segment if possible. + * previous segment if possible. */ if (first) { segs[seg].ds_addr = curaddr; @@ -403,59 +728,71 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma */ int bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, - bus_size_t buflen, bus_dmamap_callback_t *callback, - void *callback_arg, int flags) + bus_size_t buflen, bus_dmamap_callback_t *callback, + void *callback_arg, int flags) { -#ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT - bus_dma_segment_t dm_segments[dmat->nsegments]; -#else - bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS]; -#endif - vm_offset_t lastaddr; - int error, nsegs; + bus_addr_t lastaddr = 0; + int error, nsegs = 0; - if (map != NULL) - panic("bus_dmamap_load: Invalid map\n"); + if (map != NULL) { + flags |= BUS_DMA_WAITOK; + map->callback = callback; + map->callback_arg = callback_arg; + } - lastaddr = (vm_offset_t)0; - nsegs = 0; - error = bus_dmamap_load_buffer(dmat, dm_segments, buf, buflen, - NULL, flags, &lastaddr, &nsegs, 1); + error = _bus_dmamap_load_buffer(dmat, map, buf, buflen, NULL, flags, + &lastaddr, dmat->segments, &nsegs, 1); - if (error == 0) - (*callback)(callback_arg, dm_segments, nsegs + 1, 0); + CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", + __func__, dmat, dmat->flags, error, nsegs + 1); + + if (error == EINPROGRESS) { + return (error); + } + + if (error) + (*callback)(callback_arg, dmat->segments, 0, error); else - (*callback)(callback_arg, NULL, 0, error); + (*callback)(callback_arg, dmat->segments, nsegs + 1, 0); + + /* + * Return ENOMEM to the caller so that it can pass it up the stack. + * This error only happens when NOWAIT is set, so deferal is disabled. + */ + if (error == ENOMEM) + return (error); return (0); } + /* - * Like bus_dmamap_load(), but for mbufs. + * Like _bus_dmamap_load(), but for mbufs. */ int -bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map, struct mbuf *m0, - bus_dmamap_callback2_t *callback, void *callback_arg, int flags) +bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map, + struct mbuf *m0, + bus_dmamap_callback2_t *callback, void *callback_arg, + int flags) { -#ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT - bus_dma_segment_t dm_segments[dmat->nsegments]; -#else - bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS]; -#endif - int nsegs = 0, error = 0; + int nsegs, error; M_ASSERTPKTHDR(m0); + flags |= BUS_DMA_NOWAIT; + nsegs = 0; + error = 0; if (m0->m_pkthdr.len <= dmat->maxsize) { int first = 1; - vm_offset_t lastaddr = 0; + bus_addr_t lastaddr = 0; struct mbuf *m; for (m = m0; m != NULL && error == 0; m = m->m_next) { if (m->m_len > 0) { - error = bus_dmamap_load_buffer(dmat, - dm_segments, m->m_data, m->m_len, NULL, - flags, &lastaddr, &nsegs, first); + error = _bus_dmamap_load_buffer(dmat, map, + m->m_data, m->m_len, + NULL, flags, &lastaddr, + dmat->segments, &nsegs, first); first = 0; } } @@ -464,90 +801,96 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, } if (error) { - /* - * force "no valid mappings" on error in callback. - */ - (*callback)(callback_arg, dm_segments, 0, 0, error); + /* force "no valid mappings" in callback */ + (*callback)(callback_arg, dmat->segments, 0, 0, error); } else { - (*callback)(callback_arg, dm_segments, nsegs+1, - m0->m_pkthdr.len, error); + (*callback)(callback_arg, dmat->segments, + nsegs+1, m0->m_pkthdr.len, error); } + CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", + __func__, dmat, dmat->flags, error, nsegs + 1); return (error); } int -bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map, struct mbuf *m0, - bus_dma_segment_t *segs, int *nsegs, int flags) +bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map, + struct mbuf *m0, bus_dma_segment_t *segs, int *nsegs, + int flags) { - int error = 0; + int error; M_ASSERTPKTHDR(m0); + flags |= BUS_DMA_NOWAIT; *nsegs = 0; - + error = 0; if (m0->m_pkthdr.len <= dmat->maxsize) { int first = 1; - vm_offset_t lastaddr = 0; + bus_addr_t lastaddr = 0; struct mbuf *m; for (m = m0; m != NULL && error == 0; m = m->m_next) { if (m->m_len > 0) { - error = bus_dmamap_load_buffer(dmat, - segs, m->m_data, m->m_len, NULL, - flags, &lastaddr, nsegs, first); + error = _bus_dmamap_load_buffer(dmat, map, + m->m_data, m->m_len, + NULL, flags, &lastaddr, + segs, nsegs, first); first = 0; } } - ++*nsegs; } else { error = EINVAL; } + /* XXX FIXME: Having to increment nsegs is really annoying */ + ++*nsegs; + CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d", + __func__, dmat, dmat->flags, error, *nsegs); return (error); } /* - * Like bus_dmamap_load(), but for uios. + * Like _bus_dmamap_load(), but for uios. */ int -bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t map, struct uio *uio, - bus_dmamap_callback2_t *callback, void *callback_arg, int flags) +bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t map, + struct uio *uio, + bus_dmamap_callback2_t *callback, void *callback_arg, + int flags) { - vm_offset_t lastaddr; -#ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT - bus_dma_segment_t dm_segments[dmat->nsegments]; -#else - bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS]; -#endif - int nsegs, i, error, first; + bus_addr_t lastaddr = 0; + int nsegs, error, first, i; bus_size_t resid; struct iovec *iov; - struct thread *td = NULL; + pmap_t pmap; + flags |= BUS_DMA_NOWAIT; resid = uio->uio_resid; iov = uio->uio_iov; if (uio->uio_segflg == UIO_USERSPACE) { - td = uio->uio_td; - KASSERT(td != NULL, - ("bus_dmamap_load_uio: USERSPACE but no proc")); - } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 16:06:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC1BB106566B; Thu, 8 Jul 2010 16:06:58 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9CD98FC14; Thu, 8 Jul 2010 16:06:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68G6wQL059205; Thu, 8 Jul 2010 16:06:58 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68G6wSs059203; Thu, 8 Jul 2010 16:06:58 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201007081606.o68G6wSs059203@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 8 Jul 2010 16:06: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: r209814 - in head/sys: conf mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 16:06:58 -0000 Author: jchandra Date: Thu Jul 8 16:06:58 2010 New Revision: 209814 URL: http://svn.freebsd.org/changeset/base/209814 Log: 64 bit ld script for mips, and configuration file for 64 bit compilation on XLR Approved by: rrs Added: head/sys/conf/ldscript.mips.64 (contents, props changed) head/sys/mips/conf/XLR64 (contents, props changed) Added: head/sys/conf/ldscript.mips.64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/conf/ldscript.mips.64 Thu Jul 8 16:06:58 2010 (r209814) @@ -0,0 +1,301 @@ +/*- + * Copyright (c) 2001, 2004, 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. Neither the name of the Juniper Networks, Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JUNIPER NETWORKS 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 JUNIPER NETWORKS 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. + * + * JNPR: ldscript.mips,v 1.3 2006/10/11 06:12:04 + * $FreeBSD$ + */ + +OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips", "elf64-tradlittlemips") +OUTPUT_ARCH(mips) +ENTRY(_start) +SEARCH_DIR(/usr/lib); +/* Do we need any of these for elf? + __DYNAMIC = 0; +PROVIDE (_DYNAMIC = 0); +*/ +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + . = KERNLOADADDR + SIZEOF_HEADERS; + .text : + { + *(.trap) + *(.text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t.*) + } =0x1000000 + .fini : + { + KEEP (*(.fini)) + } =0x1000000 + PROVIDE (__etext = .); + PROVIDE (_etext = .); + PROVIDE (etext = .); + .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } + .rodata1 : { *(.rodata1) } + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.text : + { + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t.*) + } + .rela.text : + { + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t.*) + } + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.rodata : + { + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r.*) + } + .rela.rodata : + { + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r.*) + } + .rel.data : + { + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d.*) + } + .rela.data : + { + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d.*) + } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.sdata : + { + *(.rel.sdata) + *(.rel.sdata.*) + *(.rel.gnu.linkonce.s.*) + } + .rela.sdata : + { + *(.rela.sdata) + *(.rela.sdata.*) + *(.rela.gnu.linkonce.s.*) + } + .rel.sbss : + { + *(.rel.sbss) + *(.rel.sbss.*) + *(.rel.gnu.linkonce.sb.*) + } + .rela.sbss : + { + *(.rela.sbss) + *(.rela.sbss.*) + *(.rel.gnu.linkonce.sb.*) + } + .rel.sdata2 : + { + *(.rel.sdata2) + *(.rel.sdata2.*) + *(.rel.gnu.linkonce.s2.*) + } + .rela.sdata2 : + { + *(.rela.sdata2) + *(.rela.sdata2.*) + *(.rela.gnu.linkonce.s2.*) + } + .rel.sbss2 : + { + *(.rel.sbss2) + *(.rel.sbss2.*) + *(.rel.gnu.linkonce.sb2.*) + } + .rela.sbss2 : + { + *(.rela.sbss2) + *(.rela.sbss2.*) + *(.rela.gnu.linkonce.sb2.*) + } + .rel.bss : + { + *(.rel.bss) + *(.rel.bss.*) + *(.rel.gnu.linkonce.b.*) + } + .rela.bss : + { + *(.rela.bss) + *(.rela.bss.*) + *(.rela.gnu.linkonce.b.*) + } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + .init : + { + KEEP (*(.init)) + } =0x1000000 + .reginfo : { *(.reginfo) } + .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) } + .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) } + . = ALIGN(0x2000) + (. & (0x2000 - 1)); + .data : + { + *(.data) + *(.data.*) + *(.gnu.linkonce.d.*) + SORT(CONSTRUCTORS) + } + .data1 : { *(.data1) } + .eh_frame : { KEEP (*(.eh_frame)) } + .gcc_except_table : { *(.gcc_except_table) } + .ctors : + { + /* gcc uses crtbegin.o to find the start of + the constructors, so we make sure it is + first. Because this is a wildcard, it + doesn't matter if the user does not + actually link against crtbegin.o; the + linker won't look for a file to match a + wildcard. The wildcard also means that it + doesn't matter which directory crtbegin.o + is in. */ + KEEP (*crtbegin.o(.ctors)) + /* We don't want to include the .ctor section from + from the crtend.o file until after the sorted ctors. + The .ctor section from the crtend file contains the + end of ctors marker and it must be last */ + KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + } + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + } + .plt : { *(.plt) } + _gp = ALIGN(16) + 0x7ff0; + .got : { *(.got.plt) *(.got) } + .dynamic : { *(.dynamic) } + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + .sdata : + { + *(.sdata) + *(.sdata.*) + *(.gnu.linkonce.s.*) + } + _edata = .; + PROVIDE (edata = .); + __bss_start = .; + .sbss : + { + PROVIDE (__sbss_start = .); + PROVIDE (___sbss_start = .); + *(.dynsbss) + *(.sbss) + *(.sbss.*) + *(.gnu.linkonce.sb.*) + *(.scommon) + PROVIDE (__sbss_end = .); + PROVIDE (___sbss_end = .); + } + .bss : + { + *(.dynbss) + *(.bss) + *(.bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + /* Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections. */ + . = ALIGN(64 / 8); + } + . = ALIGN(64 / 8); + _end = .; + PROVIDE (end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + /* These must appear regardless of . */ +} Added: head/sys/mips/conf/XLR64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/XLR64 Thu Jul 8 16:06:58 2010 (r209814) @@ -0,0 +1,266 @@ +# XLR64 -- Kernel configuration file for N64 kernel on XLR/XLS +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +machine mips +cpu CPU_MIPS4KC +ident XLR + +makeoptions MODULES_OVERRIDE="" +makeoptions TARGET_BIG_ENDIAN + +include "../rmi/std.xlr" + +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions ARCH_FLAGS="-march=mips64 -mabi=64" +makeoptions LDSCRIPT_NAME=ldscript.mips.64 + +#profile 2 + +options SCHED_ULE # ULE scheduler +#options VERBOSE_SYSINIT +#options SCHED_4BSD # 4BSD scheduler +#options SMP +#options PREEMPTION # Enable kernel thread preemption +#options FULL_PREEMPTION # Enable kernel thread preemption +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +#options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options NFSCLIENT +options NFS_ROOT +# +options BOOTP +options BOOTP_NFSROOT +options BOOTP_NFSV3 +options BOOTP_WIRED_TO=rge0 +options BOOTP_COMPAT +options ROOTDEVNAME=\"nfs:10.1.1.8:/usr/extra/nfsroot\" +# +#options MD_ROOT # MD is a potential root device +#options MD_ROOT_SIZE=27000 +#options MD_ROOT_SIZE=5120 +#options ROOTDEVNAME=\"ufs:md0\" +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options HZ=1000 +options NO_SWAPPING + +#Debugging options +options KTRACE # ktrace(1) support +options DDB +options KDB +options GDB +options ALT_BREAK_TO_DEBUGGER +#options DEADLKRES #Enable the deadlock resolver +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +#options KTR # ktr(4) and ktrdump(8) support +#options KTR_COMPILE=(KTR_LOCK|KTR_PROC|KTR_INTR|KTR_CALLOUT|KTR_UMA|KTR_SYSC|KTR_CRITICAL) +#options KTR_ENTRIES=131072 +#options MUTEX_DEBUG +#options MUTEX_PROFILING + +device pci +#device ata +#device atadisk +#options XLR_PERFMON # Enable XLR processor activity monitoring +options BREAK_TO_DEBUGGER +#device genclock +device uart +# Pseudo +device loop +device random +device md +device mem +device pty +device bpf + +# Network +device miibus +device rge +device ether +device re +device msk + +device da +device scbus +#device ohci # OHCI PCI->USB interface +device ehci # EHCI PCI->USB interface (USB 2.0) +device usb # USB Bus (required) +options USB_DEBUG # enable debug msgs +#device udbp # USB Double Bulk Pipe devices +#device ugen # Generic +#device uhid # "Human Interface Devices" +device umass # Disks/Mass storage - Requires scbus and da + +#device cfi + +#i2c +# Not yet +#device ic +#device iic +#device iicbb +#device iicbus +#device xlr_rtc +#device xlr_temperature +#device xlr_eeprom + +#crypto +# Not yet +#device cryptodev +#device crypto +#device rmisec +options ISA_MIPS64 +makeoptions KERNLOADADDR=0xffffffff80100000 +# XLR64 -- Kernel configuration file for N64 kernel on XLR/XLS +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +machine mips +cpu CPU_MIPS4KC +ident XLR + +makeoptions MODULES_OVERRIDE="" +makeoptions TARGET_BIG_ENDIAN + +include "../rmi/std.xlr" + +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions ARCH_FLAGS="-march=mips64 -mabi=64" +makeoptions LDSCRIPT_NAME=ldscript.mips.64 + +#profile 2 + +options SCHED_ULE # ULE scheduler +#options VERBOSE_SYSINIT +#options SCHED_4BSD # 4BSD scheduler +#options SMP +#options PREEMPTION # Enable kernel thread preemption +#options FULL_PREEMPTION # Enable kernel thread preemption +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +#options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options NFSCLIENT +options NFS_ROOT +# +options BOOTP +options BOOTP_NFSROOT +options BOOTP_NFSV3 +options BOOTP_WIRED_TO=rge0 +options BOOTP_COMPAT +options ROOTDEVNAME=\"nfs:10.1.1.8:/usr/extra/nfsroot\" +# +#options MD_ROOT # MD is a potential root device +#options MD_ROOT_SIZE=27000 +#options MD_ROOT_SIZE=5120 +#options ROOTDEVNAME=\"ufs:md0\" +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options HZ=1000 +options NO_SWAPPING + +#Debugging options +options KTRACE # ktrace(1) support +options DDB +options KDB +options GDB +options ALT_BREAK_TO_DEBUGGER +#options DEADLKRES #Enable the deadlock resolver +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +#options KTR # ktr(4) and ktrdump(8) support +#options KTR_COMPILE=(KTR_LOCK|KTR_PROC|KTR_INTR|KTR_CALLOUT|KTR_UMA|KTR_SYSC|KTR_CRITICAL) +#options KTR_ENTRIES=131072 +#options MUTEX_DEBUG +#options MUTEX_PROFILING + +device pci +#device ata +#device atadisk +#options XLR_PERFMON # Enable XLR processor activity monitoring +options BREAK_TO_DEBUGGER +#device genclock +device uart +# Pseudo +device loop +device random +device md +device mem +device pty +device bpf + +# Network +device miibus +device rge +device ether +device re +device msk + +device da +device scbus +#device ohci # OHCI PCI->USB interface +device ehci # EHCI PCI->USB interface (USB 2.0) +device usb # USB Bus (required) +options USB_DEBUG # enable debug msgs +#device udbp # USB Double Bulk Pipe devices +#device ugen # Generic +#device uhid # "Human Interface Devices" +device umass # Disks/Mass storage - Requires scbus and da + +#device cfi + +#i2c +# Not yet +#device ic +#device iic +#device iicbb +#device iicbus +#device xlr_rtc +#device xlr_temperature +#device xlr_eeprom + +#crypto +# Not yet +#device cryptodev +#device crypto +#device rmisec +options ISA_MIPS64 +makeoptions KERNLOADADDR=0xffffffff80100000 From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 16:11:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 656711065672; Thu, 8 Jul 2010 16:11:06 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 550038FC19; Thu, 8 Jul 2010 16:11:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68GB6rI060145; Thu, 8 Jul 2010 16:11:06 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68GB6Sx060143; Thu, 8 Jul 2010 16:11:06 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201007081611.o68GB6Sx060143@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 8 Jul 2010 16:11: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: r209815 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 16:11:06 -0000 Author: jchandra Date: Thu Jul 8 16:11:06 2010 New Revision: 209815 URL: http://svn.freebsd.org/changeset/base/209815 Log: Fix XLR64, the previous version had the contents of file duplicated. Modified: head/sys/mips/conf/XLR64 Modified: head/sys/mips/conf/XLR64 ============================================================================== --- head/sys/mips/conf/XLR64 Thu Jul 8 16:06:58 2010 (r209814) +++ head/sys/mips/conf/XLR64 Thu Jul 8 16:11:06 2010 (r209815) @@ -131,136 +131,3 @@ device umass # Disks/ #device rmisec options ISA_MIPS64 makeoptions KERNLOADADDR=0xffffffff80100000 -# XLR64 -- Kernel configuration file for N64 kernel on XLR/XLS -# -# For more information on this file, please read the handbook section on -# Kernel Configuration Files: -# -# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -machine mips -cpu CPU_MIPS4KC -ident XLR - -makeoptions MODULES_OVERRIDE="" -makeoptions TARGET_BIG_ENDIAN - -include "../rmi/std.xlr" - -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -makeoptions ARCH_FLAGS="-march=mips64 -mabi=64" -makeoptions LDSCRIPT_NAME=ldscript.mips.64 - -#profile 2 - -options SCHED_ULE # ULE scheduler -#options VERBOSE_SYSINIT -#options SCHED_4BSD # 4BSD scheduler -#options SMP -#options PREEMPTION # Enable kernel thread preemption -#options FULL_PREEMPTION # Enable kernel thread preemption -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options FFS # Berkeley Fast Filesystem -#options SOFTUPDATES # Enable FFS soft updates support -options UFS_ACL # Support for access control lists -options UFS_DIRHASH # Improve performance on big directories -options NFSCLIENT -options NFS_ROOT -# -options BOOTP -options BOOTP_NFSROOT -options BOOTP_NFSV3 -options BOOTP_WIRED_TO=rge0 -options BOOTP_COMPAT -options ROOTDEVNAME=\"nfs:10.1.1.8:/usr/extra/nfsroot\" -# -#options MD_ROOT # MD is a potential root device -#options MD_ROOT_SIZE=27000 -#options MD_ROOT_SIZE=5120 -#options ROOTDEVNAME=\"ufs:md0\" -options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -options HZ=1000 -options NO_SWAPPING - -#Debugging options -options KTRACE # ktrace(1) support -options DDB -options KDB -options GDB -options ALT_BREAK_TO_DEBUGGER -#options DEADLKRES #Enable the deadlock resolver -options INVARIANTS #Enable calls of extra sanity checking -options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS #Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed -#options KTR # ktr(4) and ktrdump(8) support -#options KTR_COMPILE=(KTR_LOCK|KTR_PROC|KTR_INTR|KTR_CALLOUT|KTR_UMA|KTR_SYSC|KTR_CRITICAL) -#options KTR_ENTRIES=131072 -#options MUTEX_DEBUG -#options MUTEX_PROFILING - -device pci -#device ata -#device atadisk -#options XLR_PERFMON # Enable XLR processor activity monitoring -options BREAK_TO_DEBUGGER -#device genclock -device uart -# Pseudo -device loop -device random -device md -device mem -device pty -device bpf - -# Network -device miibus -device rge -device ether -device re -device msk - -device da -device scbus -#device ohci # OHCI PCI->USB interface -device ehci # EHCI PCI->USB interface (USB 2.0) -device usb # USB Bus (required) -options USB_DEBUG # enable debug msgs -#device udbp # USB Double Bulk Pipe devices -#device ugen # Generic -#device uhid # "Human Interface Devices" -device umass # Disks/Mass storage - Requires scbus and da - -#device cfi - -#i2c -# Not yet -#device ic -#device iic -#device iicbb -#device iicbus -#device xlr_rtc -#device xlr_temperature -#device xlr_eeprom - -#crypto -# Not yet -#device cryptodev -#device crypto -#device rmisec -options ISA_MIPS64 -makeoptions KERNLOADADDR=0xffffffff80100000 From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 16:39:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69416106566B; Thu, 8 Jul 2010 16:39:03 +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 25A948FC12; Thu, 8 Jul 2010 16:39:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o68GZSOs066436; Thu, 8 Jul 2010 10:35:28 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 08 Jul 2010 10:35:45 -0600 (MDT) Message-Id: <20100708.103545.87210464882418374.imp@bsdimp.com> To: cperciva@freebsd.org From: "M. Warner Losh" In-Reply-To: <4C3591F5.2040401@freebsd.org> References: <201007080328.o683SP5k089410@svn.freebsd.org> <4C358891.5010502@FreeBSD.org> <4C3591F5.2040401@freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.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, gabor@freebsd.org, randi@freebsd.org Subject: Re: svn commit: r209787 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 16:39:03 -0000 In message: <4C3591F5.2040401@freebsd.org> Colin Percival writes: : On 07/08/10 01:13, Gabor Kovesdan wrote: : > Em 2010.07.08. 5:28, Randi Harper escreveu: : >> Remove the ability to upgrade via sysinstall. [...] : >> : >> Approved by: cperciva (mentor) : >> : > Please revert. It has never been discussed in FreeBSD mailing lists, : > while it is mandatory before such important changes. : : This was discussed on the freebsd-sysinstall list last month: : http://lists.freebsd.org/pipermail/freebsd-sysinstall/2010-June/000012.html : : My personal feeling was that since the level of interest in sysinstall from : FreeBSD developers was generally low, this would be sufficient, so I told : randi to go ahead and commit without also adding noise to -arch; but if you : think the freebsd-sysinstall list is insufficient I'll get her to back this : out pending discussion on -arch. freebsd-sysinstall is unlikely to represent more than a tiny sliver of the freebsd community. Talking about ripping out major functionality likely won't get a good sampling of the community there and will tend to produce skewed results. Warner From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 16:53:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 857D81065674; Thu, 8 Jul 2010 16:53:19 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75D148FC1B; Thu, 8 Jul 2010 16:53:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68GrJ2T069444; Thu, 8 Jul 2010 16:53:19 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68GrJ73069442; Thu, 8 Jul 2010 16:53:19 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201007081653.o68GrJ73069442@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 8 Jul 2010 16:53: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: r209816 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 16:53:19 -0000 Author: jh Date: Thu Jul 8 16:53:19 2010 New Revision: 209816 URL: http://svn.freebsd.org/changeset/base/209816 Log: Assert that low and high are >= 0. The allocator doesn't support the negative range. Modified: head/sys/kern/subr_unit.c Modified: head/sys/kern/subr_unit.c ============================================================================== --- head/sys/kern/subr_unit.c Thu Jul 8 16:11:06 2010 (r209815) +++ head/sys/kern/subr_unit.c Thu Jul 8 16:53:19 2010 (r209816) @@ -326,8 +326,8 @@ new_unrhdr(int low, int high, struct mtx { struct unrhdr *uh; - KASSERT(low <= high, - ("UNR: use error: new_unrhdr(%u, %u)", low, high)); + KASSERT(low >= 0 && high >= 0 && low <= high, + ("UNR: use error: new_unrhdr(%d, %d)", low, high)); uh = Malloc(sizeof *uh); if (mutex != NULL) uh->mtx = mutex; From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 18:15:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A312C106566B; Thu, 8 Jul 2010 18:15:06 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 929FE8FC12; Thu, 8 Jul 2010 18:15:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68IF6H8087665; Thu, 8 Jul 2010 18:15:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68IF6Sx087663; Thu, 8 Jul 2010 18:15:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007081815.o68IF6Sx087663@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 8 Jul 2010 18:15: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: r209817 - head/sys/dev/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 18:15:06 -0000 Author: nwhitehorn Date: Thu Jul 8 18:15:06 2010 New Revision: 209817 URL: http://svn.freebsd.org/changeset/base/209817 Log: Missed a file in r209803: this header contains a definition of OFW_STD_32BIT. Pointy hat to: me Modified: head/sys/dev/ofw/openfirm.h Modified: head/sys/dev/ofw/openfirm.h ============================================================================== --- head/sys/dev/ofw/openfirm.h Thu Jul 8 16:53:19 2010 (r209816) +++ head/sys/dev/ofw/openfirm.h Thu Jul 8 18:15:06 2010 (r209817) @@ -91,6 +91,7 @@ int OF_init(void *cookie); #define OFW_STD_DIRECT "ofw_std" /* Standard OF interface */ #define OFW_STD_REAL "ofw_real" /* Real-mode OF interface */ +#define OFW_STD_32BIT "ofw_32bit" /* 32-bit OF interface */ #define OFW_FDT "ofw_fdt" /* Flattened Device Tree */ /* Generic functions */ From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 18:22:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20909106564A; Thu, 8 Jul 2010 18:22:51 +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 EA8C48FC18; Thu, 8 Jul 2010 18:22:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68IMnH7089399; Thu, 8 Jul 2010 18:22:49 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68IMnnH089396; Thu, 8 Jul 2010 18:22:49 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201007081822.o68IMnnH089396@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 8 Jul 2010 18:22: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: r209818 - head/sys/dev/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 18:22:51 -0000 Author: yongari Date: Thu Jul 8 18:22:49 2010 New Revision: 209818 URL: http://svn.freebsd.org/changeset/base/209818 Log: Remove enabling RX checksum offloading in RX filter setup. RX checksum is enabled in sge_init_locked(). While I'm here do not set RX checksum bits in RX descriptor initialization. It is controller's job to set these bits. Tested by: xclin cs dot nctu dot edu dot tw > Modified: head/sys/dev/sge/if_sge.c head/sys/dev/sge/if_sgereg.h Modified: head/sys/dev/sge/if_sge.c ============================================================================== --- head/sys/dev/sge/if_sge.c Thu Jul 8 18:15:06 2010 (r209817) +++ head/sys/dev/sge/if_sge.c Thu Jul 8 18:22:49 2010 (r209818) @@ -480,7 +480,7 @@ sge_rxfilter(struct sge_softc *sc) } if_maddr_runlock(ifp); } - CSR_WRITE_2(sc, RxMacControl, rxfilt | 0x02); + CSR_WRITE_2(sc, RxMacControl, rxfilt); CSR_WRITE_4(sc, RxHashTable, hashes[0]); CSR_WRITE_4(sc, RxHashTable2, hashes[1]); } @@ -1118,8 +1118,7 @@ sge_newbuf(struct sge_softc *sc, int pro desc->sge_flags = htole32(segs[0].ds_len); if (prod == SGE_RX_RING_CNT - 1) desc->sge_flags |= htole32(RING_END); - desc->sge_cmdsts = htole32(RDC_OWN | RDC_INTR | RDC_IP_CSUM | - RDC_TCP_CSUM | RDC_UDP_CSUM); + desc->sge_cmdsts = htole32(RDC_OWN | RDC_INTR); return (0); } @@ -1133,8 +1132,7 @@ sge_discard_rxbuf(struct sge_softc *sc, desc->sge_flags = htole32(MCLBYTES - SGE_RX_BUF_ALIGN); if (index == SGE_RX_RING_CNT - 1) desc->sge_flags |= htole32(RING_END); - desc->sge_cmdsts = htole32(RDC_OWN | RDC_INTR | RDC_IP_CSUM | - RDC_TCP_CSUM | RDC_UDP_CSUM); + desc->sge_cmdsts = htole32(RDC_OWN | RDC_INTR); } /* @@ -1665,7 +1663,7 @@ sge_init_locked(struct sge_softc *sc) for (i = 0; i < ETHER_ADDR_LEN; i++) CSR_WRITE_1(sc, RxMacAddr + i, IF_LLADDR(ifp)[i]); /* Configure RX MAC. */ - rxfilt = RXMAC_STRIP_FCS | RXMAC_PAD_ENB; + rxfilt = RXMAC_STRIP_FCS | RXMAC_PAD_ENB | RXMAC_CSUM_ENB; CSR_WRITE_2(sc, RxMacControl, rxfilt); sge_rxfilter(sc); sge_setvlan(sc); Modified: head/sys/dev/sge/if_sgereg.h ============================================================================== --- head/sys/dev/sge/if_sgereg.h Thu Jul 8 18:15:06 2010 (r209817) +++ head/sys/dev/sge/if_sgereg.h Thu Jul 8 18:22:49 2010 (r209818) @@ -140,6 +140,7 @@ #define RXMAC_STRIP_VLAN 0x0020 #define RXMAC_STRIP_FCS 0x0010 #define RXMAC_PAD_ENB 0x0004 +#define RXMAC_CSUM_ENB 0x0002 #define SGE_RX_PAD_BYTES 10 From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 19:15:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11164106564A; Thu, 8 Jul 2010 19:15:27 +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 F351E8FC0A; Thu, 8 Jul 2010 19:15:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68JFQmx001236; Thu, 8 Jul 2010 19:15:26 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68JFQ8w001233; Thu, 8 Jul 2010 19:15:26 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201007081915.o68JFQ8w001233@svn.freebsd.org> From: John Baldwin Date: Thu, 8 Jul 2010 19:15: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: r209819 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 19:15:27 -0000 Author: jhb Date: Thu Jul 8 19:15:26 2010 New Revision: 209819 URL: http://svn.freebsd.org/changeset/base/209819 Log: - Various style and whitespace fixes. - Make sugid_coredump and kern_logsigexit private to kern_sig.c. Submitted by: bde (partially) MFC after: 1 month Modified: head/sys/kern/kern_sig.c head/sys/sys/signalvar.h Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Thu Jul 8 18:22:49 2010 (r209818) +++ head/sys/kern/kern_sig.c Thu Jul 8 19:15:26 2010 (r209819) @@ -125,7 +125,7 @@ struct filterops sig_filtops = { .f_event = filt_signal, }; -int kern_logsigexit = 1; +static int kern_logsigexit = 1; SYSCTL_INT(_kern, KERN_LOGSIGEXIT, logsigexit, CTLFLAG_RW, &kern_logsigexit, 0, "Log processes quitting on abnormal signals to syslog(3)"); @@ -167,7 +167,7 @@ SYSINIT(signal, SI_SUB_P1003_1B, SI_ORDE (cr1)->cr_ruid == (cr2)->cr_uid || \ (cr1)->cr_uid == (cr2)->cr_uid) -int sugid_coredump; +static int sugid_coredump; SYSCTL_INT(_kern, OID_AUTO, sugid_coredump, CTLFLAG_RW, &sugid_coredump, 0, "Allow setuid and setgid processes to dump core"); Modified: head/sys/sys/signalvar.h ============================================================================== --- head/sys/sys/signalvar.h Thu Jul 8 18:22:49 2010 (r209818) +++ head/sys/sys/signalvar.h Thu Jul 8 19:15:26 2010 (r209819) @@ -39,8 +39,7 @@ #include /* - * Kernel signal definitions and data structures, - * not exported to user programs. + * Kernel signal definitions and data structures. */ /* @@ -60,7 +59,7 @@ struct sigacts { sigset_t ps_siginfo; /* Signals that want SA_SIGINFO args. */ sigset_t ps_sigignore; /* Signals being ignored. */ sigset_t ps_sigcatch; /* Signals being caught by user. */ - sigset_t ps_freebsd4; /* signals using freebsd4 ucontext. */ + sigset_t ps_freebsd4; /* Signals using freebsd4 ucontext. */ sigset_t ps_osigset; /* Signals using <= 3.x osigset_t. */ sigset_t ps_usertramp; /* SunOS compat; libc sigtramp. XXX */ int ps_flag; @@ -72,10 +71,9 @@ struct sigacts { #define PS_NOCLDSTOP 0x0002 /* No SIGCHLD when children stop. */ #define PS_CLDSIGIGN 0x0004 /* The SIGCHLD handler is SIG_IGN. */ -#if defined(_KERNEL) && defined(COMPAT_43) -/* - * Compatibility. - */ +#ifdef _KERNEL + +#ifdef COMPAT_43 typedef struct { struct osigcontext si_sc; int si_signo; @@ -93,7 +91,7 @@ struct osigaction { }; typedef void __osiginfohandler_t(int, osiginfo_t *, void *); -#endif /* _KERNEL && COMPAT_43 */ +#endif /* COMPAT_43 */ /* additional signal action values, used only temporarily/internally */ #define SIG_CATCH ((__sighandler_t *)2) @@ -102,78 +100,80 @@ typedef void __osiginfohandler_t(int, os /* * get signal action for process and signal; currently only for current process */ -#define SIGACTION(p, sig) (p->p_sigacts->ps_sigact[_SIG_IDX(sig)]) +#define SIGACTION(p, sig) (p->p_sigacts->ps_sigact[_SIG_IDX(sig)]) + +#endif /* _KERNEL */ /* - * sigset_t manipulation macros + * sigset_t manipulation macros. */ -#define SIGADDSET(set, signo) \ +#define SIGADDSET(set, signo) \ ((set).__bits[_SIG_WORD(signo)] |= _SIG_BIT(signo)) -#define SIGDELSET(set, signo) \ +#define SIGDELSET(set, signo) \ ((set).__bits[_SIG_WORD(signo)] &= ~_SIG_BIT(signo)) -#define SIGEMPTYSET(set) \ +#define SIGEMPTYSET(set) \ do { \ int __i; \ for (__i = 0; __i < _SIG_WORDS; __i++) \ (set).__bits[__i] = 0; \ } while (0) -#define SIGFILLSET(set) \ +#define SIGFILLSET(set) \ do { \ int __i; \ for (__i = 0; __i < _SIG_WORDS; __i++) \ (set).__bits[__i] = ~0U; \ } while (0) -#define SIGISMEMBER(set, signo) \ +#define SIGISMEMBER(set, signo) \ ((set).__bits[_SIG_WORD(signo)] & _SIG_BIT(signo)) -#define SIGISEMPTY(set) (__sigisempty(&(set))) -#define SIGNOTEMPTY(set) (!__sigisempty(&(set))) +#define SIGISEMPTY(set) (__sigisempty(&(set))) +#define SIGNOTEMPTY(set) (!__sigisempty(&(set))) -#define SIGSETEQ(set1, set2) (__sigseteq(&(set1), &(set2))) -#define SIGSETNEQ(set1, set2) (!__sigseteq(&(set1), &(set2))) +#define SIGSETEQ(set1, set2) (__sigseteq(&(set1), &(set2))) +#define SIGSETNEQ(set1, set2) (!__sigseteq(&(set1), &(set2))) -#define SIGSETOR(set1, set2) \ +#define SIGSETOR(set1, set2) \ do { \ int __i; \ for (__i = 0; __i < _SIG_WORDS; __i++) \ (set1).__bits[__i] |= (set2).__bits[__i]; \ } while (0) -#define SIGSETAND(set1, set2) \ +#define SIGSETAND(set1, set2) \ do { \ int __i; \ for (__i = 0; __i < _SIG_WORDS; __i++) \ (set1).__bits[__i] &= (set2).__bits[__i]; \ } while (0) -#define SIGSETNAND(set1, set2) \ +#define SIGSETNAND(set1, set2) \ do { \ int __i; \ for (__i = 0; __i < _SIG_WORDS; __i++) \ (set1).__bits[__i] &= ~(set2).__bits[__i]; \ } while (0) -#define SIGSETLO(set1, set2) ((set1).__bits[0] = (set2).__bits[0]) -#define SIGSETOLD(set, oset) ((set).__bits[0] = (oset)) +#define SIGSETLO(set1, set2) ((set1).__bits[0] = (set2).__bits[0]) +#define SIGSETOLD(set, oset) ((set).__bits[0] = (oset)) -#define SIG_CANTMASK(set) \ +#define SIG_CANTMASK(set) \ SIGDELSET(set, SIGKILL), SIGDELSET(set, SIGSTOP) -#define SIG_STOPSIGMASK(set) \ +#define SIG_STOPSIGMASK(set) \ SIGDELSET(set, SIGSTOP), SIGDELSET(set, SIGTSTP), \ SIGDELSET(set, SIGTTIN), SIGDELSET(set, SIGTTOU) -#define SIG_CONTSIGMASK(set) \ +#define SIG_CONTSIGMASK(set) \ SIGDELSET(set, SIGCONT) -#define sigcantmask (sigmask(SIGKILL) | sigmask(SIGSTOP)) +#define sigcantmask (sigmask(SIGKILL) | sigmask(SIGSTOP)) -#define SIG2OSIG(sig, osig) (osig = (sig).__bits[0]) -#define OSIG2SIG(osig, sig) SIGEMPTYSET(sig); (sig).__bits[0] = osig +#define SIG2OSIG(sig, osig) (osig = (sig).__bits[0]) +#define OSIG2SIG(osig, sig) SIGEMPTYSET(sig); (sig).__bits[0] = osig static __inline int __sigisempty(sigset_t *set) @@ -215,24 +215,24 @@ typedef struct ksiginfo { struct sigqueue *ksi_sigq; } ksiginfo_t; -#define ksi_signo ksi_info.si_signo -#define ksi_errno ksi_info.si_errno -#define ksi_code ksi_info.si_code -#define ksi_pid ksi_info.si_pid -#define ksi_uid ksi_info.si_uid -#define ksi_status ksi_info.si_status -#define ksi_addr ksi_info.si_addr -#define ksi_value ksi_info.si_value -#define ksi_band ksi_info.si_band -#define ksi_trapno ksi_info.si_trapno -#define ksi_overrun ksi_info.si_overrun -#define ksi_timerid ksi_info.si_timerid -#define ksi_mqd ksi_info.si_mqd +#define ksi_signo ksi_info.si_signo +#define ksi_errno ksi_info.si_errno +#define ksi_code ksi_info.si_code +#define ksi_pid ksi_info.si_pid +#define ksi_uid ksi_info.si_uid +#define ksi_status ksi_info.si_status +#define ksi_addr ksi_info.si_addr +#define ksi_value ksi_info.si_value +#define ksi_band ksi_info.si_band +#define ksi_trapno ksi_info.si_trapno +#define ksi_overrun ksi_info.si_overrun +#define ksi_timerid ksi_info.si_timerid +#define ksi_mqd ksi_info.si_mqd /* bits for ksi_flags */ -#define KSI_TRAP 0x01 /* Generated by trap. */ +#define KSI_TRAP 0x01 /* Generated by trap. */ #define KSI_EXT 0x02 /* Externally managed ksi. */ -#define KSI_INS 0x04 /* Directly insert ksi, not the copy */ +#define KSI_INS 0x04 /* Directly insert ksi, not the copy */ #define KSI_SIGQ 0x08 /* Generated by sigqueue, might ret EGAIN. */ #define KSI_HEAD 0x10 /* Insert into head, not tail. */ #define KSI_COPYMASK (KSI_TRAP|KSI_SIGQ) @@ -275,12 +275,12 @@ sigsetmasked(sigset_t *set, sigset_t *ma return (1); } -#define ksiginfo_init(ksi) \ +#define ksiginfo_init(ksi) \ do { \ bzero(ksi, sizeof(ksiginfo_t)); \ } while(0) -#define ksiginfo_init_trap(ksi) \ +#define ksiginfo_init_trap(ksi) \ do { \ ksiginfo_t *kp = ksi; \ bzero(kp, sizeof(ksiginfo_t)); \ @@ -295,56 +295,51 @@ ksiginfo_copy(ksiginfo_t *src, ksiginfo_ } struct pgrp; -struct thread; struct proc; struct sigio; -struct mtx; - -extern int sugid_coredump; /* Sysctl variable kern.sugid_coredump */ -extern struct mtx sigio_lock; -extern int kern_logsigexit; /* Sysctl variable kern.logsigexit */ +struct thread; /* * Lock the pointers for a sigio object in the underlying objects of * a file descriptor. */ -#define SIGIO_LOCK() mtx_lock(&sigio_lock) -#define SIGIO_TRYLOCK() mtx_trylock(&sigio_lock) -#define SIGIO_UNLOCK() mtx_unlock(&sigio_lock) -#define SIGIO_LOCKED() mtx_owned(&sigio_lock) -#define SIGIO_ASSERT(type) mtx_assert(&sigio_lock, type) +#define SIGIO_LOCK() mtx_lock(&sigio_lock) +#define SIGIO_TRYLOCK() mtx_trylock(&sigio_lock) +#define SIGIO_UNLOCK() mtx_unlock(&sigio_lock) +#define SIGIO_LOCKED() mtx_owned(&sigio_lock) +#define SIGIO_ASSERT(type) mtx_assert(&sigio_lock, type) + +extern struct mtx sigio_lock; -/* stop_allowed parameter for cursig */ +/* Values for stop_allowed parameter for cursig(). */ #define SIG_STOP_ALLOWED 100 #define SIG_STOP_NOT_ALLOWED 101 -/* flags for kern_sigprocmask */ +/* Flags for kern_sigprocmask(). */ #define SIGPROCMASK_OLD 0x0001 #define SIGPROCMASK_PROC_LOCKED 0x0002 #define SIGPROCMASK_PS_LOCKED 0x0004 -/* - * Machine-independent functions: - */ int cursig(struct thread *td, int stop_allowed); void execsigs(struct proc *p); void gsignal(int pgid, int sig, ksiginfo_t *ksi); void killproc(struct proc *p, char *why); -ksiginfo_t * ksiginfo_alloc(int); -void ksiginfo_free(ksiginfo_t *); +ksiginfo_t * ksiginfo_alloc(int wait); +void ksiginfo_free(ksiginfo_t *ksi); int pksignal(struct proc *p, int sig, ksiginfo_t *ksi); -void pgsigio(struct sigio **, int signum, int checkctty); +void pgsigio(struct sigio **sigiop, int sig, int checkctty); void pgsignal(struct pgrp *pgrp, int sig, int checkctty, ksiginfo_t *ksi); int postsig(int sig); void psignal(struct proc *p, int sig); -int psignal_event(struct proc *p, struct sigevent *, ksiginfo_t *); +int psignal_event(struct proc *p, struct sigevent *sigev, ksiginfo_t *ksi); int ptracestop(struct thread *td, int sig); +void sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *retmask); struct sigacts *sigacts_alloc(void); void sigacts_copy(struct sigacts *dest, struct sigacts *src); void sigacts_free(struct sigacts *ps); struct sigacts *sigacts_hold(struct sigacts *ps); int sigacts_shared(struct sigacts *ps); -void sigexit(struct thread *td, int signum) __dead2; +void sigexit(struct thread *td, int sig) __dead2; int sig_ffs(sigset_t *set); void siginit(struct proc *p); void signotify(struct thread *td); @@ -356,12 +351,7 @@ void sigqueue_take(ksiginfo_t *ksi); void tdksignal(struct thread *td, int sig, ksiginfo_t *ksi); void tdsigcleanup(struct thread *td); void tdsignal(struct thread *td, int sig); -void trapsignal(struct thread *td, ksiginfo_t *); - -/* - * Machine-dependent functions: - */ -void sendsig(sig_t, ksiginfo_t *, sigset_t *retmask); +void trapsignal(struct thread *td, ksiginfo_t *ksi); #endif /* _KERNEL */ From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 19:22:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66FD3106564A; Thu, 8 Jul 2010 19:22:52 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 569CC8FC14; Thu, 8 Jul 2010 19:22:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68JMqjd002963; Thu, 8 Jul 2010 19:22:52 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68JMquj002961; Thu, 8 Jul 2010 19:22:52 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201007081922.o68JMquj002961@svn.freebsd.org> From: Jamie Gritton Date: Thu, 8 Jul 2010 19:22: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: r209820 - head/usr.sbin/jls X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 19:22:52 -0000 Author: jamie Date: Thu Jul 8 19:22:52 2010 New Revision: 209820 URL: http://svn.freebsd.org/changeset/base/209820 Log: Properly recognize a number followed by non-digits as a jail name. Call "0" a name because zero is used to indicate no specified jid. MFC after: 3 days Modified: head/usr.sbin/jls/jls.c Modified: head/usr.sbin/jls/jls.c ============================================================================== --- head/usr.sbin/jls/jls.c Thu Jul 8 19:15:26 2010 (r209819) +++ head/usr.sbin/jls/jls.c Thu Jul 8 19:22:52 2010 (r209820) @@ -84,8 +84,10 @@ main(int argc, char **argv) break; case 'j': jid = strtoul(optarg, &ep, 10); - if (!*optarg || *ep) + if (!jid || *ep) { + jid = 0; jname = optarg; + } break; case 'h': pflags = (pflags & ~(PRINT_SKIP | PRINT_VERBOSE)) | From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 19:36:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 233561065670; Thu, 8 Jul 2010 19:36:39 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 119D18FC0C; Thu, 8 Jul 2010 19:36:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68JacpY006021; Thu, 8 Jul 2010 19:36:38 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68JacsF006019; Thu, 8 Jul 2010 19:36:38 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201007081936.o68JacsF006019@svn.freebsd.org> From: Weongyo Jeong Date: Thu, 8 Jul 2010 19:36:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209821 - stable/8/sys/dev/bwi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 19:36:39 -0000 Author: weongyo Date: Thu Jul 8 19:36:38 2010 New Revision: 209821 URL: http://svn.freebsd.org/changeset/base/209821 Log: MFC r209597: Fixes NULL pointer reference that it's occurred when the state is changed to RUN because ic->ic_newassoc isn't set anywhere now. In the previous bwi_newassoc() is used to initialize AMRR rate routines. Tested by: Warren Block Modified: stable/8/sys/dev/bwi/if_bwi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bwi/if_bwi.c ============================================================================== --- stable/8/sys/dev/bwi/if_bwi.c Thu Jul 8 19:22:52 2010 (r209820) +++ stable/8/sys/dev/bwi/if_bwi.c Thu Jul 8 19:36:38 2010 (r209821) @@ -1769,7 +1769,6 @@ bwi_newstate(struct ieee80211vap *vap, e enum ieee80211_state ostate = vap->iv_state; struct bwi_softc *sc = ifp->if_softc; struct bwi_mac *mac; - struct ieee80211_node *ni = vap->iv_bss; int error; BWI_LOCK(sc); @@ -1817,10 +1816,6 @@ bwi_newstate(struct ieee80211vap *vap, e #else sc->sc_txpwrcb_type = BWI_TXPWR_CALIB; #endif - if (vap->iv_opmode == IEEE80211_M_STA) { - /* fake a join to init the tx rate */ - ic->ic_newassoc(ni, 1); - } callout_reset(&sc->sc_calib_ch, hz, bwi_calibrate, sc); } From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 19:40:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51FFB106566C; Thu, 8 Jul 2010 19:40:10 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 404E98FC0A; Thu, 8 Jul 2010 19:40:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68JeA8P006859; Thu, 8 Jul 2010 19:40:10 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68JeAGQ006857; Thu, 8 Jul 2010 19:40:10 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201007081940.o68JeAGQ006857@svn.freebsd.org> From: Weongyo Jeong Date: Thu, 8 Jul 2010 19:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209822 - stable/8/sys/dev/bwi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 19:40:10 -0000 Author: weongyo Date: Thu Jul 8 19:40:09 2010 New Revision: 209822 URL: http://svn.freebsd.org/changeset/base/209822 Log: MFC r209598: Initializes the ratectl for a node when the state is changed to RUN. This prevents a kernel fault by dividing with zero because the initial rate was 0 and didn't be initialized. Tested by: Warren Block Modified: stable/8/sys/dev/bwi/if_bwi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bwi/if_bwi.c ============================================================================== --- stable/8/sys/dev/bwi/if_bwi.c Thu Jul 8 19:36:38 2010 (r209821) +++ stable/8/sys/dev/bwi/if_bwi.c Thu Jul 8 19:40:09 2010 (r209822) @@ -1764,6 +1764,7 @@ static int bwi_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct bwi_vap *bvp = BWI_VAP(vap); + const struct ieee80211_txparam *tp; struct ieee80211com *ic= vap->iv_ic; struct ifnet *ifp = ic->ic_ifp; enum ieee80211_state ostate = vap->iv_state; @@ -1817,6 +1818,11 @@ bwi_newstate(struct ieee80211vap *vap, e sc->sc_txpwrcb_type = BWI_TXPWR_CALIB; #endif + /* Initializes ratectl for a node. */ + tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)]; + if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE) + ieee80211_ratectl_node_init(vap->iv_bss); + callout_reset(&sc->sc_calib_ch, hz, bwi_calibrate, sc); } back: From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 20:17:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C289106564A; Thu, 8 Jul 2010 20:17:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A9EB8FC1E; Thu, 8 Jul 2010 20:17:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68KHuhn015199; Thu, 8 Jul 2010 20:17:56 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68KHuLa015197; Thu, 8 Jul 2010 20:17:56 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201007082017.o68KHuLa015197@svn.freebsd.org> From: Andriy Gapon Date: Thu, 8 Jul 2010 20:17:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209823 - stable/8/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 20:17:56 -0000 Author: avg Date: Thu Jul 8 20:17:56 2010 New Revision: 209823 URL: http://svn.freebsd.org/changeset/base/209823 Log: MFC r209056: vnode.h: expand debug macros to non-empty void statements when DEBUG_VFS_LOCKS is disabled Modified: stable/8/sys/sys/vnode.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sys/vnode.h ============================================================================== --- stable/8/sys/sys/vnode.h Thu Jul 8 19:40:09 2010 (r209822) +++ stable/8/sys/sys/vnode.h Thu Jul 8 20:17:56 2010 (r209823) @@ -524,17 +524,17 @@ void assert_vop_unlocked(struct vnode *v #else /* !DEBUG_VFS_LOCKS */ -#define ASSERT_VI_LOCKED(vp, str) -#define ASSERT_VI_UNLOCKED(vp, str) -#define ASSERT_VOP_ELOCKED(vp, str) +#define ASSERT_VI_LOCKED(vp, str) ((void)0) +#define ASSERT_VI_UNLOCKED(vp, str) ((void)0) +#define ASSERT_VOP_ELOCKED(vp, str) ((void)0) #if 0 #define ASSERT_VOP_ELOCKED_OTHER(vp, str) #endif -#define ASSERT_VOP_LOCKED(vp, str) +#define ASSERT_VOP_LOCKED(vp, str) ((void)0) #if 0 #define ASSERT_VOP_SLOCKED(vp, str) #endif -#define ASSERT_VOP_UNLOCKED(vp, str) +#define ASSERT_VOP_UNLOCKED(vp, str) ((void)0) #endif /* DEBUG_VFS_LOCKS */ From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 20:18:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B48D91065670; Thu, 8 Jul 2010 20:18:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A30E78FC1B; Thu, 8 Jul 2010 20:18:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68KIqhb015431; Thu, 8 Jul 2010 20:18:52 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68KIqBM015429; Thu, 8 Jul 2010 20:18:52 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201007082018.o68KIqBM015429@svn.freebsd.org> From: Andriy Gapon Date: Thu, 8 Jul 2010 20:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209824 - stable/7/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 20:18:52 -0000 Author: avg Date: Thu Jul 8 20:18:52 2010 New Revision: 209824 URL: http://svn.freebsd.org/changeset/base/209824 Log: MFC r209056: vnode.h: expand debug macros to non-empty void statements when DEBUG_VFS_LOCKS is disabled Modified: stable/7/sys/sys/vnode.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sys/vnode.h ============================================================================== --- stable/7/sys/sys/vnode.h Thu Jul 8 20:17:56 2010 (r209823) +++ stable/7/sys/sys/vnode.h Thu Jul 8 20:18:52 2010 (r209824) @@ -502,17 +502,17 @@ void assert_vop_unlocked(struct vnode *v #else /* !DEBUG_VFS_LOCKS */ -#define ASSERT_VI_LOCKED(vp, str) -#define ASSERT_VI_UNLOCKED(vp, str) -#define ASSERT_VOP_ELOCKED(vp, str) +#define ASSERT_VI_LOCKED(vp, str) ((void)0) +#define ASSERT_VI_UNLOCKED(vp, str) ((void)0) +#define ASSERT_VOP_ELOCKED(vp, str) ((void)0) #if 0 #define ASSERT_VOP_ELOCKED_OTHER(vp, str) #endif -#define ASSERT_VOP_LOCKED(vp, str) +#define ASSERT_VOP_LOCKED(vp, str) ((void)0) #if 0 #define ASSERT_VOP_SLOCKED(vp, str) #endif -#define ASSERT_VOP_UNLOCKED(vp, str) +#define ASSERT_VOP_UNLOCKED(vp, str) ((void)0) #endif /* DEBUG_VFS_LOCKS */ From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 20:38:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 309C2106566B; Thu, 8 Jul 2010 20:38:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DB8C8FC08; Thu, 8 Jul 2010 20:38:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68KcniU019943; Thu, 8 Jul 2010 20:38:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68Kcmui019934; Thu, 8 Jul 2010 20:38:48 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201007082038.o68Kcmui019934@svn.freebsd.org> From: Andriy Gapon Date: Thu, 8 Jul 2010 20:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209825 - in stable/8/sys: dev/acpica dev/usb fs/procfs geom kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 20:38:49 -0000 Author: avg Date: Thu Jul 8 20:38:48 2010 New Revision: 209825 URL: http://svn.freebsd.org/changeset/base/209825 Log: MFC r209062: fix a few cases where a string is passed via format argument instead of via %s Note: no MFC to stable/7 Modified: stable/8/sys/dev/acpica/acpi_thermal.c stable/8/sys/dev/usb/usb_dev.c stable/8/sys/dev/usb/usb_device.c stable/8/sys/dev/usb/usb_process.c stable/8/sys/fs/procfs/procfs_type.c stable/8/sys/geom/geom_dev.c stable/8/sys/kern/subr_kdb.c stable/8/sys/kern/subr_taskqueue.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_thermal.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_thermal.c Thu Jul 8 20:18:52 2010 (r209824) +++ stable/8/sys/dev/acpica/acpi_thermal.c Thu Jul 8 20:38:48 2010 (r209825) @@ -1171,7 +1171,6 @@ static int acpi_tz_cooling_thread_start(struct acpi_tz_softc *sc) { int error; - char name[16]; ACPI_LOCK(thermal); if (sc->tz_cooling_proc_running) { @@ -1182,10 +1181,9 @@ acpi_tz_cooling_thread_start(struct acpi ACPI_UNLOCK(thermal); error = 0; if (sc->tz_cooling_proc == NULL) { - snprintf(name, sizeof(name), "acpi_cooling%d", - device_get_unit(sc->tz_dev)); error = kproc_create(acpi_tz_cooling_thread, sc, - &sc->tz_cooling_proc, RFHIGHPID, 0, name); + &sc->tz_cooling_proc, RFHIGHPID, 0, "acpi_cooling%d", + device_get_unit(sc->tz_dev)); if (error != 0) { device_printf(sc->tz_dev, "could not create thread - %d", error); ACPI_LOCK(thermal); Modified: stable/8/sys/dev/usb/usb_dev.c ============================================================================== --- stable/8/sys/dev/usb/usb_dev.c Thu Jul 8 20:18:52 2010 (r209824) +++ stable/8/sys/dev/usb/usb_dev.c Thu Jul 8 20:38:48 2010 (r209825) @@ -1733,7 +1733,7 @@ usb_fifo_attach(struct usb_device *udev, /* Now, create the device itself */ f_sc->dev = make_dev(&usb_devsw, 0, uid, gid, mode, - devname); + "%s", devname); /* XXX setting si_drv1 and creating the device is not atomic! */ f_sc->dev->si_drv1 = pd; } Modified: stable/8/sys/dev/usb/usb_device.c ============================================================================== --- stable/8/sys/dev/usb/usb_device.c Thu Jul 8 20:18:52 2010 (r209824) +++ stable/8/sys/dev/usb/usb_device.c Thu Jul 8 20:38:48 2010 (r209825) @@ -1577,7 +1577,7 @@ usb_alloc_device(device_t parent_dev, st udev->ctrl_dev = usb_make_dev(udev, 0, FREAD|FWRITE); /* Create a link from /dev/ugenX.X to the default endpoint */ - make_dev_alias(udev->ctrl_dev, udev->ugen_name); + make_dev_alias(udev->ctrl_dev, "%s", udev->ugen_name); #endif if (udev->flags.usb_mode == USB_MODE_HOST) { Modified: stable/8/sys/dev/usb/usb_process.c ============================================================================== --- stable/8/sys/dev/usb/usb_process.c Thu Jul 8 20:18:52 2010 (r209824) +++ stable/8/sys/dev/usb/usb_process.c Thu Jul 8 20:38:48 2010 (r209825) @@ -221,7 +221,7 @@ usb_proc_create(struct usb_process *up, cv_init(&up->up_drain, "usbdrain"); if (USB_THREAD_CREATE(&usb_process, up, - &up->up_ptr, pmesg)) { + &up->up_ptr, "%s", pmesg)) { DPRINTFN(0, "Unable to create USB process."); up->up_ptr = NULL; goto error; Modified: stable/8/sys/fs/procfs/procfs_type.c ============================================================================== --- stable/8/sys/fs/procfs/procfs_type.c Thu Jul 8 20:18:52 2010 (r209824) +++ stable/8/sys/fs/procfs/procfs_type.c Thu Jul 8 20:38:48 2010 (r209825) @@ -48,9 +48,9 @@ procfs_doproctype(PFS_FILL_ARGS) static const char *none = "Not Available"; if (p != NULL && p->p_sysent && p->p_sysent->sv_name) - sbuf_printf(sb, p->p_sysent->sv_name); + sbuf_printf(sb, "%s", p->p_sysent->sv_name); else - sbuf_printf(sb, none); + sbuf_printf(sb, "%s", none); sbuf_putc(sb, '\n'); return (0); } Modified: stable/8/sys/geom/geom_dev.c ============================================================================== --- stable/8/sys/geom/geom_dev.c Thu Jul 8 20:18:52 2010 (r209824) +++ stable/8/sys/geom/geom_dev.c Thu Jul 8 20:38:48 2010 (r209825) @@ -127,7 +127,7 @@ g_dev_taste(struct g_class *mp, struct g KASSERT(error == 0, ("g_dev_taste(%s) failed to g_attach, err=%d", pp->name, error)); dev = make_dev(&g_dev_cdevsw, 0, - UID_ROOT, GID_OPERATOR, 0640, gp->name); + UID_ROOT, GID_OPERATOR, 0640, "%s", gp->name); if (pp->flags & G_PF_CANDELETE) dev->si_flags |= SI_CANDELETE; dev->si_iosize_max = MAXPHYS; Modified: stable/8/sys/kern/subr_kdb.c ============================================================================== --- stable/8/sys/kern/subr_kdb.c Thu Jul 8 20:18:52 2010 (r209824) +++ stable/8/sys/kern/subr_kdb.c Thu Jul 8 20:38:48 2010 (r209825) @@ -230,7 +230,7 @@ kdb_panic(const char *msg) stop_cpus_hard(PCPU_GET(other_cpus)); #endif printf("KDB: panic\n"); - panic(msg); + panic("%s", msg); } void Modified: stable/8/sys/kern/subr_taskqueue.c ============================================================================== --- stable/8/sys/kern/subr_taskqueue.c Thu Jul 8 20:18:52 2010 (r209824) +++ stable/8/sys/kern/subr_taskqueue.c Thu Jul 8 20:38:48 2010 (r209825) @@ -322,7 +322,7 @@ taskqueue_start_threads(struct taskqueue for (i = 0; i < count; i++) { if (count == 1) error = kthread_add(taskqueue_thread_loop, tqp, NULL, - &tq->tq_threads[i], RFSTOPPED, 0, ktname); + &tq->tq_threads[i], RFSTOPPED, 0, "%s", ktname); else error = kthread_add(taskqueue_thread_loop, tqp, NULL, &tq->tq_threads[i], RFSTOPPED, 0, From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 20:40:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE1D1106564A; Thu, 8 Jul 2010 20:40:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCCA98FC14; Thu, 8 Jul 2010 20:40:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68KevVd020511; Thu, 8 Jul 2010 20:40:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68Kevp7020509; Thu, 8 Jul 2010 20:40:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201007082040.o68Kevp7020509@svn.freebsd.org> From: Andriy Gapon Date: Thu, 8 Jul 2010 20:40:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209826 - stable/8/sys/fs/udf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 20:40:57 -0000 Author: avg Date: Thu Jul 8 20:40:57 2010 New Revision: 209826 URL: http://svn.freebsd.org/changeset/base/209826 Log: MFC r209425: udf_vnops: cosmetic followup to r208671 Modified: stable/8/sys/fs/udf/udf_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/8/sys/fs/udf/udf_vnops.c Thu Jul 8 20:38:48 2010 (r209825) +++ stable/8/sys/fs/udf/udf_vnops.c Thu Jul 8 20:40:57 2010 (r209826) @@ -904,8 +904,8 @@ udf_readlink(struct vop_readlink_args *a vp = ap->a_vp; node = VTON(vp); len = le64toh(node->fentry->inf_len); + buf = malloc(len, M_DEVBUF, M_WAITOK); iov[0].iov_len = len; - buf = malloc(iov[0].iov_len, M_DEVBUF, M_WAITOK); iov[0].iov_base = buf; uio.uio_iov = iov; uio.uio_iovcnt = 1; From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 20:43:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CA95106566C; Thu, 8 Jul 2010 20:43:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B3D08FC22; Thu, 8 Jul 2010 20:43:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68KhLeQ021042; Thu, 8 Jul 2010 20:43:21 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68KhLeF021040; Thu, 8 Jul 2010 20:43:21 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201007082043.o68KhLeF021040@svn.freebsd.org> From: Andriy Gapon Date: Thu, 8 Jul 2010 20:43:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209827 - stable/7/sys/fs/udf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 20:43:21 -0000 Author: avg Date: Thu Jul 8 20:43:20 2010 New Revision: 209827 URL: http://svn.freebsd.org/changeset/base/209827 Log: MFC r209425: udf_vnops: cosmetic followup to r208671 Modified: stable/7/sys/fs/udf/udf_vnops.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/7/sys/fs/udf/udf_vnops.c Thu Jul 8 20:40:57 2010 (r209826) +++ stable/7/sys/fs/udf/udf_vnops.c Thu Jul 8 20:43:20 2010 (r209827) @@ -903,8 +903,8 @@ udf_readlink(struct vop_readlink_args *a vp = ap->a_vp; node = VTON(vp); len = le64toh(node->fentry->inf_len); + buf = malloc(len, M_DEVBUF, M_WAITOK); iov[0].iov_len = len; - buf = malloc(iov[0].iov_len, M_DEVBUF, M_WAITOK); iov[0].iov_base = buf; uio.uio_iov = iov; uio.uio_iovcnt = 1; From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 20:46:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1DC4106566B; Thu, 8 Jul 2010 20:46:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B69E48FC08; Thu, 8 Jul 2010 20:46:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68Kkt3b021911; Thu, 8 Jul 2010 20:46:55 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68KktMu021907; Thu, 8 Jul 2010 20:46:55 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201007082046.o68KktMu021907@svn.freebsd.org> From: Andriy Gapon Date: Thu, 8 Jul 2010 20:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209828 - stable/8/sys/dev/sound/pcm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 20:46:56 -0000 Author: avg Date: Thu Jul 8 20:46:55 2010 New Revision: 209828 URL: http://svn.freebsd.org/changeset/base/209828 Log: MFC r209193: sound/pcm: use non-const string with SYSCTL_STRING Modified: stable/8/sys/dev/sound/pcm/feeder_eq.c stable/8/sys/dev/sound/pcm/feeder_rate.c stable/8/sys/dev/sound/pcm/sound.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sound/pcm/feeder_eq.c ============================================================================== --- stable/8/sys/dev/sound/pcm/feeder_eq.c Thu Jul 8 20:43:20 2010 (r209827) +++ stable/8/sys/dev/sound/pcm/feeder_eq.c Thu Jul 8 20:46:55 2010 (r209828) @@ -93,7 +93,7 @@ SND_DECLARE_FILE("$FreeBSD$"); static int feeder_eq_exact_rate = 0; #ifdef _KERNEL -static const char feeder_eq_presets[] = FEEDER_EQ_PRESETS; +static char feeder_eq_presets[] = FEEDER_EQ_PRESETS; SYSCTL_STRING(_hw_snd, OID_AUTO, feeder_eq_presets, CTLFLAG_RD, &feeder_eq_presets, 0, "compile-time eq presets"); Modified: stable/8/sys/dev/sound/pcm/feeder_rate.c ============================================================================== --- stable/8/sys/dev/sound/pcm/feeder_rate.c Thu Jul 8 20:43:20 2010 (r209827) +++ stable/8/sys/dev/sound/pcm/feeder_rate.c Thu Jul 8 20:46:55 2010 (r209828) @@ -159,7 +159,7 @@ int feeder_rate_quality = Z_QUALITY_DEFA static int feeder_rate_polyphase_max = Z_POLYPHASE_MAX; #ifdef _KERNEL -static const char feeder_rate_presets[] = FEEDER_RATE_PRESETS; +static char feeder_rate_presets[] = FEEDER_RATE_PRESETS; SYSCTL_STRING(_hw_snd, OID_AUTO, feeder_rate_presets, CTLFLAG_RD, &feeder_rate_presets, 0, "compile-time rate presets"); Modified: stable/8/sys/dev/sound/pcm/sound.c ============================================================================== --- stable/8/sys/dev/sound/pcm/sound.c Thu Jul 8 20:43:20 2010 (r209827) +++ stable/8/sys/dev/sound/pcm/sound.c Thu Jul 8 20:46:55 2010 (r209828) @@ -68,7 +68,7 @@ SYSCTL_NODE(_hw, OID_AUTO, snd, CTLFLAG_ * XXX I've had enough with people not telling proper version/arch * while reporting problems, not after 387397913213th questions/requests. */ -static const char snd_driver_version[] = +static char snd_driver_version[] = __XSTRING(SND_DRV_VERSION)"/"MACHINE_ARCH; SYSCTL_STRING(_hw_snd, OID_AUTO, version, CTLFLAG_RD, &snd_driver_version, 0, "driver version/arch"); From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 20:57:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CDC1106564A; Thu, 8 Jul 2010 20:57:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B6A58FC16; Thu, 8 Jul 2010 20:57:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68Kv7Xo024880; Thu, 8 Jul 2010 20:57:07 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68Kv763024878; Thu, 8 Jul 2010 20:57:07 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201007082057.o68Kv763024878@svn.freebsd.org> From: Andriy Gapon Date: Thu, 8 Jul 2010 20:57:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209829 - stable/8/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 20:57:08 -0000 Author: avg Date: Thu Jul 8 20:57:07 2010 New Revision: 209829 URL: http://svn.freebsd.org/changeset/base/209829 Log: MFC r209228: device.hints: do install when WITHOUT_BOOT is set Modified: stable/8/etc/Makefile Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/Makefile ============================================================================== --- stable/8/etc/Makefile Thu Jul 8 20:46:55 2010 (r209828) +++ stable/8/etc/Makefile Thu Jul 8 20:57:07 2010 (r209829) @@ -245,11 +245,13 @@ distribution: ${DESTDIR}/var/crash cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ ${FREEBSD} ${DESTDIR}/ +.if ${MK_BOOT} != "no" .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints) ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \ ${DESTDIR}/boot/device.hints .endif +.endif distrib-dirs: mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 20:57:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 573BF106566C; Thu, 8 Jul 2010 20:57:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 45C2F8FC0A; Thu, 8 Jul 2010 20:57:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68KvbIL025044; Thu, 8 Jul 2010 20:57:37 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68Kvb4w025042; Thu, 8 Jul 2010 20:57:37 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201007082057.o68Kvb4w025042@svn.freebsd.org> From: Andriy Gapon Date: Thu, 8 Jul 2010 20:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209830 - stable/7/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 20:57:37 -0000 Author: avg Date: Thu Jul 8 20:57:37 2010 New Revision: 209830 URL: http://svn.freebsd.org/changeset/base/209830 Log: MFC r209228: device.hints: do install when WITHOUT_BOOT is set Modified: stable/7/etc/Makefile Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/Makefile ============================================================================== --- stable/7/etc/Makefile Thu Jul 8 20:57:07 2010 (r209829) +++ stable/7/etc/Makefile Thu Jul 8 20:57:37 2010 (r209830) @@ -236,11 +236,13 @@ distribution: ${DESTDIR}/var/crash cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ ${FREEBSD} ${DESTDIR}/ +.if ${MK_BOOT} != "no" .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints) ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \ ${DESTDIR}/boot/device.hints .endif +.endif distrib-dirs: mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 21:02:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 880F0106564A; Thu, 8 Jul 2010 21:02:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 762638FC12; Thu, 8 Jul 2010 21:02:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68L2WGM026588; Thu, 8 Jul 2010 21:02:32 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68L2WSR026586; Thu, 8 Jul 2010 21:02:32 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201007082102.o68L2WSR026586@svn.freebsd.org> From: Andriy Gapon Date: Thu, 8 Jul 2010 21:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209831 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 21:02:32 -0000 Author: avg Date: Thu Jul 8 21:02:31 2010 New Revision: 209831 URL: http://svn.freebsd.org/changeset/base/209831 Log: MFC r209247: lock_profile_release_lock: do not compare unsigned with zero Note: no MFC to stable/7 Modified: stable/8/sys/kern/subr_lock.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/subr_lock.c ============================================================================== --- stable/8/sys/kern/subr_lock.c Thu Jul 8 20:57:37 2010 (r209830) +++ stable/8/sys/kern/subr_lock.c Thu Jul 8 21:02:31 2010 (r209831) @@ -600,7 +600,7 @@ lock_profile_release_lock(struct lock_ob struct lock_profile_object *l; struct lock_prof_type *type; struct lock_prof *lp; - u_int64_t holdtime; + u_int64_t curtime, holdtime; struct lpohead *head; int spin; @@ -628,9 +628,11 @@ lock_profile_release_lock(struct lock_ob lp = lock_profile_lookup(lo, spin, l->lpo_file, l->lpo_line); if (lp == NULL) goto release; - holdtime = nanoseconds() - l->lpo_acqtime; - if (holdtime < 0) + curtime = nanoseconds(); + if (curtime < l->lpo_acqtime) goto release; + holdtime = curtime - l->lpo_acqtime; + /* * Record if the lock has been held longer now than ever * before. From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 21:24:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAFE5106566C; Thu, 8 Jul 2010 21:24:28 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1C9578FC13; Thu, 8 Jul 2010 21:24:26 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA04678; Fri, 09 Jul 2010 00:24:25 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1OWya1-000489-1y; Fri, 09 Jul 2010 00:24:25 +0300 Message-ID: <4C364206.4070500@freebsd.org> Date: Fri, 09 Jul 2010 00:24:22 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100603) MIME-Version: 1.0 To: Andriy Gapon References: <201007082057.o68Kv763024878@svn.freebsd.org> In-Reply-To: <201007082057.o68Kv763024878@svn.freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r209829 - stable/8/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 21:24:28 -0000 on 08/07/2010 23:57 Andriy Gapon said the following: > Author: avg > Date: Thu Jul 8 20:57:07 2010 > New Revision: 209829 > URL: http://svn.freebsd.org/changeset/base/209829 > > Log: > MFC r209228: device.hints: do install when WITHOUT_BOOT is set "do NOT install" - stupid mistake in the original commit message got replicated. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 21:26:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20B8D1065679; Thu, 8 Jul 2010 21:26:27 +0000 (UTC) (envelope-from randi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D3C58FC1A; Thu, 8 Jul 2010 21:26:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68LQR4g032110; Thu, 8 Jul 2010 21:26:27 GMT (envelope-from randi@svn.freebsd.org) Received: (from randi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68LQQx1032102; Thu, 8 Jul 2010 21:26:26 GMT (envelope-from randi@svn.freebsd.org) Message-Id: <201007082126.o68LQQx1032102@svn.freebsd.org> From: Randi Harper Date: Thu, 8 Jul 2010 21:26: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: r209832 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 21:26:27 -0000 Author: randi Date: Thu Jul 8 21:26:26 2010 New Revision: 209832 URL: http://svn.freebsd.org/changeset/base/209832 Log: Revert r209787 pending further discussion. Approved by: cperciva (mentor) Added: head/usr.sbin/sysinstall/installUpgrade.c - copied unchanged from r209786, head/usr.sbin/sysinstall/installUpgrade.c Modified: head/usr.sbin/sysinstall/Makefile head/usr.sbin/sysinstall/dispatch.c head/usr.sbin/sysinstall/install.c head/usr.sbin/sysinstall/menus.c head/usr.sbin/sysinstall/sysinstall.8 head/usr.sbin/sysinstall/sysinstall.h Modified: head/usr.sbin/sysinstall/Makefile ============================================================================== --- head/usr.sbin/sysinstall/Makefile Thu Jul 8 21:02:31 2010 (r209831) +++ head/usr.sbin/sysinstall/Makefile Thu Jul 8 21:26:26 2010 (r209832) @@ -8,7 +8,7 @@ PROG= sysinstall MAN= sysinstall.8 SRCS= anonFTP.c cdrom.c command.c config.c devices.c dhcp.c \ disks.c dispatch.c dist.c dmenu.c doc.c dos.c floppy.c \ - ftp.c globals.c http.c index.c install.c keymap.c \ + ftp.c globals.c http.c index.c install.c installUpgrade.c keymap.c \ label.c main.c makedevs.c media.c menus.c misc.c modules.c \ mouse.c msg.c network.c nfs.c options.c package.c \ system.c tcpip.c termcap.c ttys.c ufs.c usb.c user.c \ Modified: head/usr.sbin/sysinstall/dispatch.c ============================================================================== --- head/usr.sbin/sysinstall/dispatch.c Thu Jul 8 21:02:31 2010 (r209831) +++ head/usr.sbin/sysinstall/dispatch.c Thu Jul 8 21:26:26 2010 (r209832) @@ -82,6 +82,7 @@ static struct _word { { "installCommit", installCommit }, { "installExpress", installExpress }, { "installStandard", installStandard }, + { "installUpgrade", installUpgrade }, { "installFixupBase", installFixupBase }, { "installFixitHoloShell", installFixitHoloShell }, { "installFixitCDROM", installFixitCDROM }, Modified: head/usr.sbin/sysinstall/install.c ============================================================================== --- head/usr.sbin/sysinstall/install.c Thu Jul 8 21:02:31 2010 (r209831) +++ head/usr.sbin/sysinstall/install.c Thu Jul 8 21:26:26 2010 (r209832) @@ -1032,11 +1032,13 @@ installFilesystems(dialogMenuItem *self) Device **devs; PartInfo *root; char dname[80]; + Boolean upgrade = FALSE; /* If we've already done this, bail out */ if (!variable_cmp(DISK_LABELLED, "written")) return DITEM_SUCCESS; + upgrade = !variable_cmp(SYSTEM_STATE, "upgrade"); if (!checkLabels(TRUE)) return DITEM_FAILURE; @@ -1076,7 +1078,9 @@ installFilesystems(dialogMenuItem *self) if (strcmp(root->mountpoint, "/")) msgConfirm("Warning: %s is marked as a root partition but is mounted on %s", RootChunk->name, root->mountpoint); - if (root->do_newfs) { + if (root->do_newfs && (!upgrade || + !msgNoYes("You are upgrading - are you SURE you want to newfs " + "the root partition?"))) { int i; dialog_clear_norefresh(); @@ -1089,7 +1093,9 @@ installFilesystems(dialogMenuItem *self) } } else { - msgConfirm("Warning: Using existing root partition."); + if (!upgrade) { + msgConfirm("Warning: Using existing root partition."); + } dialog_clear_norefresh(); msgNotify("Checking integrity of existing %s filesystem.", dname); i = vsystem("fsck_ffs -y %s", dname); @@ -1173,7 +1179,9 @@ installFilesystems(dialogMenuItem *self) sprintf(dname, "%s/dev/%s", RunningAsInit ? "/mnt" : "", c2->name); - if (tmp->do_newfs) + if (tmp->do_newfs && (!upgrade || + !msgNoYes("You are upgrading - are you SURE you" + " want to newfs /dev/%s?", c2->name))) performNewfs(tmp, dname, QUEUE_YES); else command_shell_add(tmp->mountpoint, @@ -1206,7 +1214,7 @@ installFilesystems(dialogMenuItem *self) } } else if (c1->type == fat && c1->private_data && - (root->do_newfs)) { + (root->do_newfs || upgrade)) { char name[FILENAME_MAX]; sprintf(name, "%s/%s", RunningAsInit ? "/mnt" : "", ((PartInfo *)c1->private_data)->mountpoint); @@ -1219,7 +1227,9 @@ installFilesystems(dialogMenuItem *self) sprintf(dname, "%s/dev/%s", RunningAsInit ? "/mnt" : "", c1->name); - if (pi->do_newfs) + if (pi->do_newfs && (!upgrade || + !msgNoYes("You are upgrading - are you SURE you want to " + "newfs /dev/%s?", c1->name))) performNewfs(pi, dname, QUEUE_YES); command_func_add(pi->mountpoint, Mount_msdosfs, c1->name); Copied: head/usr.sbin/sysinstall/installUpgrade.c (from r209786, head/usr.sbin/sysinstall/installUpgrade.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/sysinstall/installUpgrade.c Thu Jul 8 21:26:26 2010 (r209832, copy of r209786, head/usr.sbin/sysinstall/installUpgrade.c) @@ -0,0 +1,526 @@ +/* + * The new sysinstall program. + * + * This is probably the last program in the `sysinstall' line - the next + * generation being essentially a complete rewrite. + * + * $FreeBSD$ + * + * Copyright (c) 1995 + * Jordan Hubbard. 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, + * verbatim and that no modifications are made prior to this + * point in the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``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 JORDAN HUBBARD OR HIS PETS 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, LIFE 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 "sysinstall.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int installUpgradeNonInteractive(dialogMenuItem *self); + +typedef struct _hitList { + enum { JUST_COPY, CALL_HANDLER } action ; + char *name; + Boolean optional; + void (*handler)(struct _hitList *self); +} HitList; + +/* These are the only meaningful files I know about */ +static HitList etc_files [] = { + { JUST_COPY, "Xaccel.ini", TRUE, NULL }, + { JUST_COPY, "X11", TRUE, NULL }, + { JUST_COPY, "adduser.conf", TRUE, NULL }, + { JUST_COPY, "aliases", TRUE, NULL }, + { JUST_COPY, "aliases.db", TRUE, NULL }, + { JUST_COPY, "amd.map", TRUE, NULL }, + { JUST_COPY, "auth.conf", TRUE, NULL }, + { JUST_COPY, "crontab", TRUE, NULL }, + { JUST_COPY, "csh.cshrc", TRUE, NULL }, + { JUST_COPY, "csh.login", TRUE, NULL }, + { JUST_COPY, "csh.logout", TRUE, NULL }, + { JUST_COPY, "cvsupfile", TRUE, NULL }, + { JUST_COPY, "devfs.conf", TRUE, NULL }, + { JUST_COPY, "dhclient.conf", TRUE, NULL }, + { JUST_COPY, "disktab", TRUE, NULL }, + { JUST_COPY, "dumpdates", TRUE, NULL }, + { JUST_COPY, "exports", TRUE, NULL }, + { JUST_COPY, "fbtab", TRUE, NULL }, + { JUST_COPY, "fstab", FALSE, NULL }, + { JUST_COPY, "ftpusers", TRUE, NULL }, + { JUST_COPY, "gettytab", TRUE, NULL }, + { JUST_COPY, "gnats", TRUE, NULL }, + { JUST_COPY, "group", FALSE, NULL }, + { JUST_COPY, "hosts", TRUE, NULL }, + { JUST_COPY, "hosts.allow", TRUE, NULL }, + { JUST_COPY, "hosts.equiv", TRUE, NULL }, + { JUST_COPY, "hosts.lpd", TRUE, NULL }, + { JUST_COPY, "inetd.conf", TRUE, NULL }, + { JUST_COPY, "localtime", TRUE, NULL }, + { JUST_COPY, "login.access", TRUE, NULL }, + { JUST_COPY, "login.conf", TRUE, NULL }, + { JUST_COPY, "mail", TRUE, NULL }, + { JUST_COPY, "mail.rc", TRUE, NULL }, + { JUST_COPY, "mac.conf", TRUE, NULL }, + { JUST_COPY, "make.conf", TRUE, NULL }, + { JUST_COPY, "manpath.config", TRUE, NULL }, + { JUST_COPY, "master.passwd", FALSE, NULL }, + { JUST_COPY, "mergemaster.rc", TRUE, NULL }, + { JUST_COPY, "motd", TRUE, NULL }, + { JUST_COPY, "namedb", TRUE, NULL }, + { JUST_COPY, "networks", TRUE, NULL }, + { JUST_COPY, "newsyslog.conf", TRUE, NULL }, + { JUST_COPY, "nsmb.conf", TRUE, NULL }, + { JUST_COPY, "nsswitch.conf", TRUE, NULL }, + { JUST_COPY, "ntp.conf", TRUE, NULL }, + { JUST_COPY, "pam.conf", TRUE, NULL }, + { JUST_COPY, "passwd", TRUE, NULL }, + { JUST_COPY, "periodic", TRUE, NULL }, + { JUST_COPY, "pf.conf", TRUE, NULL }, + { JUST_COPY, "portsnap.conf", TRUE, NULL }, + { JUST_COPY, "ppp", TRUE, NULL }, + { JUST_COPY, "printcap", TRUE, NULL }, + { JUST_COPY, "profile", TRUE, NULL }, + { JUST_COPY, "protocols", TRUE, NULL }, + { JUST_COPY, "pwd.db", TRUE, NULL }, + { JUST_COPY, "rc.local", TRUE, NULL }, + { JUST_COPY, "rc.firewall", TRUE, NULL }, + { JUST_COPY, "rc.conf.local", TRUE, NULL }, + { JUST_COPY, "remote", TRUE, NULL }, + { JUST_COPY, "resolv.conf", TRUE, NULL }, + { JUST_COPY, "rmt", TRUE, NULL }, + { JUST_COPY, "sendmail.cf", TRUE, NULL }, + { JUST_COPY, "sendmail.cw", TRUE, NULL }, + { JUST_COPY, "services", TRUE, NULL }, + { JUST_COPY, "shells", TRUE, NULL }, + { JUST_COPY, "skeykeys", TRUE, NULL }, + { JUST_COPY, "snmpd.config", TRUE, NULL }, + { JUST_COPY, "spwd.db", TRUE, NULL }, + { JUST_COPY, "src.conf", TRUE, NULL }, + { JUST_COPY, "ssh", TRUE, NULL }, + { JUST_COPY, "sysctl.conf", TRUE, NULL }, + { JUST_COPY, "syslog.conf", TRUE, NULL }, + { JUST_COPY, "ttys", TRUE, NULL }, + { 0, NULL, FALSE, NULL }, +}; + +static void +traverseHitlist(HitList *h) +{ + system("rm -rf /etc/upgrade"); + Mkdir("/etc/upgrade"); + while (h->name) { + if (!file_readable(h->name)) { + if (!h->optional) + msgConfirm("Unable to find an old /etc/%s file! That is decidedly non-standard and\n" + "your upgraded system may function a little strangely as a result.", h->name); + } + else { + if (h->action == JUST_COPY) { + /* Move the just-loaded copy aside */ + vsystem("mv /etc/%s /etc/upgrade/%s", h->name, h->name); + + /* Copy the old one into its place */ + msgNotify("Resurrecting %s..", h->name); + /* Do this with tar so that symlinks and such are preserved */ + if (vsystem("tar cf - %s | tar xpf - -C /etc", h->name)) + msgConfirm("Unable to resurrect your old /etc/%s! Hmmmm.", h->name); + } + else /* call handler */ + h->handler(h); + } + ++h; + } +} + +int +installUpgrade(dialogMenuItem *self) +{ + char saved_etc[FILENAME_MAX]; + Boolean extractingBin = TRUE; + + if (variable_get(VAR_NONINTERACTIVE)) + return installUpgradeNonInteractive(self); + + variable_set2(SYSTEM_STATE, "upgrade", 0); + dialog_clear(); + + if (msgYesNo("Before beginning a binary upgrade, please review the upgrade instructions,\n" + "which are located in the \"Install\" document under the main documentation\n" + "menu. Given that you have read these instructions and understand the risks\n" + "and precautions involved, are you sure that you want to proceed with\n" + "this upgrade?") != 0) + return DITEM_FAILURE; + + if (!Dists) { + msgConfirm("First, you must select some distribution components. The upgrade procedure\n" + "will only upgrade the distributions you select in the next set of menus."); + if (!dmenuOpenSimple(&MenuDistributions, FALSE) || !Dists) + return DITEM_FAILURE; + } + else if (!(Dists & DIST_BASE)) { /* No base selected? Not much of an upgrade.. */ + if (msgYesNo("You didn't select the base distribution as one of the distributons to load.\n" + "This one is pretty vital to a successful upgrade. Are you SURE you don't\n" + "want to select the base distribution? Chose No to bring up the Distributions\n" + "menu again.") != 0) { + if (!dmenuOpenSimple(&MenuDistributions, FALSE)) + return DITEM_FAILURE; + } + } + + /* Still?! OK! They must know what they're doing.. */ + if (!(Dists & DIST_BASE)) + extractingBin = FALSE; + + if (RunningAsInit) { + Device **devs; + int i, cnt; + char *cp; + + cp = variable_get(VAR_DISK); + devs = deviceFind(cp, DEVICE_TYPE_DISK); + cnt = deviceCount(devs); + if (!cnt) { + msgConfirm("No disks found! Please verify that your disk controller is being\n" + "properly probed at boot time. See the Hardware Guide on the\n" + "Documentation menu for clues on diagnosing this type of problem."); + return DITEM_FAILURE | DITEM_RESTORE; + } + else { + /* Enable all the drives before we start */ + for (i = 0; i < cnt; i++) + devs[i]->enabled = TRUE; + } + + msgConfirm("OK. First, we're going to go to the disk label editor. In this editor\n" + "you will be expected to Mount any partitions you're interested in\n" + "upgrading. DO NOT set the Newfs flag to Y on anything in the label editor\n" + "unless you're absolutely sure you know what you're doing! In this\n" + "instance, you'll be using the label editor as little more than a fancy\n" + "screen-oriented partition mounting tool.\n\n" + "Once you're done in the label editor, press Q to return here for the next\n" + "step."); + + if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE) { + msgConfirm("The disk label editor returned an error status. Upgrade operation\n" + "aborted."); + return DITEM_FAILURE | DITEM_RESTORE; + } + + /* Don't write out MBR info */ + variable_set2(DISK_PARTITIONED, "written", 0); + if (DITEM_STATUS(diskLabelCommit(self)) == DITEM_FAILURE) { + msgConfirm("Not all file systems were properly mounted. Upgrade operation\n" + "aborted."); + variable_unset(DISK_PARTITIONED); + return DITEM_FAILURE | DITEM_RESTORE; + } + + msgNotify("Updating /stand on root filesystem"); + (void)vsystem("find -x /stand | cpio %s -pdum /mnt", cpioVerbosity()); + + if (DITEM_STATUS(chroot("/mnt")) == DITEM_FAILURE) { + msgConfirm("Unable to chroot to /mnt - something is wrong with the\n" + "root partition or the way it's mounted if this doesn't work."); + variable_unset(DISK_PARTITIONED); + return DITEM_FAILURE | DITEM_RESTORE; + } + chdir("/"); + installEnvironment(); + systemCreateHoloshell(); + } + + saved_etc[0] = '\0'; + + /* Don't allow sources to be upgraded if we have src already */ + if (directory_exists("/usr/src/") && (Dists & DIST_SRC)) { + Dists &= ~DIST_SRC; + SrcDists = 0; + msgConfirm("Warning: /usr/src exists and sources were selected as upgrade\n" + "targets. Unfortunately, this is not the way to upgrade your\n" + "sources - please use CTM or CVSup or some other method which\n" + "handles ``deletion events'', unlike this particular feature.\n\n" + "Your existing /usr/src will not be affected by this upgrade.\n"); + } + + if (extractingBin) { + while (!*saved_etc) { + char *cp = msgGetInput("/var/tmp/etc", "Under which directory do you wish to save your current /etc?"); + + if (!cp || !*cp || Mkdir(cp)) { + if (msgYesNo("Directory was not specified, was invalid or user selected Cancel.\n\n" + "Doing an upgrade without first backing up your /etc directory is a very\n" + "bad idea! Do you want to go back and specify the save directory again?") != 0) + break; + } + else { + SAFE_STRCPY(saved_etc, cp); + } + } + + if (saved_etc[0]) { + msgNotify("Preserving /etc directory.."); + if (vsystem("tar -cBpf - -C /etc . | tar --unlink -xBpf - -C %s", saved_etc)) + if (msgYesNo("Unable to backup your /etc into %s.\n" + "Do you want to continue anyway?", saved_etc) != 0) + return DITEM_FAILURE; + msgNotify("Preserving /root directory.."); + vsystem("tar -cBpf - -C / root | tar --unlink -xBpf - -C %s", saved_etc); + } + + msgNotify("chflags'ing old binaries - please wait."); + (void)vsystem("chflags -R noschg /bin /sbin /lib /libexec /usr/bin /usr/sbin /usr/lib /usr/libexec /var/empty /boot/kernel*"); + + if (directory_exists("/boot/kernel")) { + if (directory_exists("/boot/kernel.prev")) { + msgNotify("Removing /boot/kernel.prev"); + if (system("rm -fr /boot/kernel.prev")) { + msgConfirm("NOTICE: I'm trying to back up /boot/kernel to\n" + "/boot/kernel.prev, but /boot/kernel.prev exists and I\n" + "can't remove it. This means that the backup will, in\n" + "all probability, fail."); + } + } + msgNotify("Moving old kernel to /boot/kernel.prev"); + if (system("mv /boot/kernel /boot/kernel.prev")) { + if (!msgYesNo("Hmmm! I couldn't move the old kernel over! Do you want to\n" + "treat this as a big problem and abort the upgrade? Due to the\n" + "way that this upgrade process works, you will have to reboot\n" + "and start over from the beginning. Select Yes to reboot now")) + systemShutdown(1); + } + else + msgConfirm("NOTICE: Your old kernel is in /boot/kernel.prev should this\n" + "upgrade fail for any reason and you need to boot your old\n" + "kernel."); + } + } + +media: + /* We do this very late, but we unfortunately need to back up /etc first */ + if (!mediaVerify()) + return DITEM_FAILURE; + + if (!DEVICE_INIT(mediaDevice)) { + if (!msgYesNo("Couldn't initialize the media. Would you like\n" + "to adjust your media selection and try again?")) { + mediaDevice = NULL; + goto media; + } + else + return DITEM_FAILURE | DITEM_REDRAW | DITEM_RESTORE; + } + + msgNotify("Beginning extraction of distributions."); + if (DITEM_STATUS(distExtractAll(self)) == DITEM_FAILURE) { + msgConfirm("Hmmmm. We couldn't even extract the base distribution. This upgrade\n" + "should be considered a failure and started from the beginning, sorry!\n" + "The system will reboot now."); + dialog_clear(); + systemShutdown(1); + } + else if (Dists) { + if (!extractingBin || !(Dists & DIST_BASE)) { + msgNotify("The extraction process seems to have had some problems, but we got most\n" + "of the essentials. We'll treat this as a warning since it may have been\n" + "only non-essential distributions which failed to load."); + } + else { + msgConfirm("Hmmmm. We couldn't even extract the base distribution. This upgrade\n" + "should be considered a failure and started from the beginning, sorry!\n" + "The system will reboot now."); + dialog_clear(); + systemShutdown(1); + } + } + + if (extractingBin) + vsystem("disklabel -B `awk '$2~/\\/$/ {print substr($1, 6, 5)}' /etc/fstab`"); + msgNotify("First stage of upgrade completed successfully!\n\n" + "Next comes stage 2, where we attempt to resurrect your /etc\n" + "directory!"); + + if (chdir(saved_etc)) { + msgConfirm("Unable to go to your saved /etc directory in %s?! Argh!\n" + "Something went seriously wrong! It's quite possible that\n" + "your former /etc is toast. I hope you didn't have any\n" + "important customizations you wanted to keep in there.. :(", saved_etc); + } + else { + /* Now try to resurrect the /etc files */ + traverseHitlist(etc_files); + /* Resurrect the root dotfiles */ + vsystem("tar -cBpf - root | tar -xBpf - -C / && rm -rf root"); + } + + msgConfirm("Upgrade completed! All of your old /etc files have been restored.\n" + "For your reference, the new /etc files are in /etc/upgrade/ in case\n" + "you wish to upgrade these files by hand (though that should not be\n" + "strictly necessary). If your root partition is specified in /etc/fstab\n" + "using the old \"compatibility\" slice, you may also wish to update it to\n" + "use a fully qualified slice name in order to avoid warnings on startup.\n\n" + "When you're ready to reboot into the new system, simply exit the installation."); + return DITEM_SUCCESS | DITEM_REDRAW | DITEM_RESTORE; +} + +static int +installUpgradeNonInteractive(dialogMenuItem *self) +{ + char *saved_etc; + Boolean extractingBin = TRUE; + + variable_set2(SYSTEM_STATE, "upgrade", 0); + + /* Make sure at least BIN is selected */ + Dists |= DIST_BASE; + + if (RunningAsInit) { + Device **devs; + int i, cnt; + char *cp; + + cp = variable_get(VAR_DISK); + devs = deviceFind(cp, DEVICE_TYPE_DISK); + cnt = deviceCount(devs); + if (!cnt) { + msgConfirm("No disks found! Please verify that your disk controller is being\n" + "properly probed at boot time. See the Hardware Guide on the\n" + "Documentation menu for clues on diagnosing this type of problem."); + return DITEM_FAILURE; + } + else { + /* Enable all the drives before we start */ + for (i = 0; i < cnt; i++) + devs[i]->enabled = TRUE; + } + + msgConfirm("OK. First, we're going to go to the disk label editor. In this editor\n" + "you will be expected to Mount any partitions you're interested in\n" + "upgrading. DO NOT set the Newfs flag to Y on anything in the label editor\n" + "unless you're absolutely sure you know what you're doing! In this\n" + "instance, you'll be using the label editor as little more than a fancy\n" + "screen-oriented partition mounting tool.\n\n" + "Once you're done in the label editor, press Q to return here for the next\n" + "step."); + + if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE) { + msgConfirm("The disk label editor returned an error status. Upgrade operation\n" + "aborted."); + return DITEM_FAILURE; + } + + /* Don't write out MBR info */ + variable_set2(DISK_PARTITIONED, "written", 0); + if (DITEM_STATUS(diskLabelCommit(self)) == DITEM_FAILURE) { + msgConfirm("Not all file systems were properly mounted. Upgrade operation\n" + "aborted."); + variable_unset(DISK_PARTITIONED); + return DITEM_FAILURE; + } + + if (extractingBin) { + msgNotify("chflags'ing old binaries - please wait."); + (void)vsystem("chflags -R noschg /mnt/"); + } + msgNotify("Updating /stand on root filesystem"); + (void)vsystem("find -x /stand | cpio %s -pdum /mnt", cpioVerbosity()); + + if (DITEM_STATUS(chroot("/mnt")) == DITEM_FAILURE) { + msgConfirm("Unable to chroot to /mnt - something is wrong with the\n" + "root partition or the way it's mounted if this doesn't work."); + variable_unset(DISK_PARTITIONED); + return DITEM_FAILURE; + } + chdir("/"); + systemCreateHoloshell(); + } + + if (!mediaVerify() || !DEVICE_INIT(mediaDevice)) { + msgNotify("Upgrade: Couldn't initialize media."); + return DITEM_FAILURE; + } + + saved_etc = "/var/tmp/etc"; + Mkdir(saved_etc); + msgNotify("Preserving /etc directory.."); + if (vsystem("tar -cpBf - -C /etc . | tar -xpBf - -C %s", saved_etc)) { + msgNotify("Unable to backup your /etc into %s.", saved_etc); + return DITEM_FAILURE; + } + + /* + * Back up the old kernel, leaving it in place in case we + * crash and reboot. + */ + if (directory_exists("/boot/kernel")) { + if (directory_exists("/boot/kernel.prev")) { + msgNotify("Removing /boot/kernel.prev"); + if (system("rm -fr /boot/kernel.prev")) { + msgConfirm("NOTICE: I'm trying to back up /boot/kernel to\n" + "/boot/kernel.prev, but /boot/kernel.prev exists and I\n" + "can't remove it. This means that the backup will, in\n" + "all probability, fail."); + } + } + msgNotify("Copying old kernel to /boot/kernel.prev"); + vsystem("cp -Rp /boot/kernel /boot/kernel.prev"); + } + + msgNotify("Beginning extraction of distributions."); + if (DITEM_STATUS(distExtractAll(self)) == DITEM_FAILURE) { + msgConfirm("Hmmmm. We couldn't even extract the base distribution. This upgrade\n" + "should be considered a failure and started from the beginning, sorry!\n" + "The system will reboot now."); + dialog_clear(); + systemShutdown(1); + } + else if (Dists) { + if (!(Dists & DIST_BASE)) { + msgNotify("The extraction process seems to have had some problems, but we got most\n" + "of the essentials. We'll treat this as a warning since it may have been\n" + "only non-essential distributions which failed to upgrade."); + } + else { + msgConfirm("Hmmmm. We couldn't even extract the base distribution. This upgrade\n" + "should be considered a failure and started from the beginning, sorry!\n" + "The system will reboot now."); + dialog_clear(); + systemShutdown(1); + } + } + + msgNotify("First stage of upgrade completed successfully."); + if (vsystem("tar -cpBf - -C %s . | tar --unlink -xpBf - -C /etc", saved_etc)) { + msgNotify("Unable to resurrect your old /etc!"); + return DITEM_FAILURE; + } + return DITEM_SUCCESS | DITEM_REDRAW; +} Modified: head/usr.sbin/sysinstall/menus.c ============================================================================== --- head/usr.sbin/sysinstall/menus.c Thu Jul 8 21:02:31 2010 (r209831) +++ head/usr.sbin/sysinstall/menus.c Thu Jul 8 21:26:26 2010 (r209832) @@ -243,6 +243,7 @@ DMenu MenuIndex = { #endif /* WITH_SYSCONS */ { " Time Zone", "Set the system's time zone.", NULL, dmenuSystemCommand, NULL, "tzsetup" }, { " TTYs", "Configure system ttys.", NULL, configEtcTtys, NULL, "ttys" }, + { " Upgrade", "Upgrade an existing system.", NULL, installUpgrade }, { " Usage", "Quick start - How to use this menu system.", NULL, dmenuDisplayFile, NULL, "usage" }, { " User Management", "Add user and group information.", NULL, dmenuSubmenu, NULL, &MenuUsermgmt }, { NULL } }, @@ -274,6 +275,7 @@ DMenu MenuInitial = { #endif { "Options", "View/Set various installation options", NULL, optionsEditor }, { "Fixit", "Repair mode with CDROM/DVD/floppy or start shell", NULL, dmenuSubmenu, NULL, &MenuFixit }, + { "Upgrade", "Upgrade an existing system", NULL, installUpgrade }, { "Load Config..","Load default install configuration", NULL, dispatch_load_menu }, { "Index", "Glossary of functions", NULL, dmenuSubmenu, NULL, &MenuIndex }, { NULL } }, Modified: head/usr.sbin/sysinstall/sysinstall.8 ============================================================================== --- head/usr.sbin/sysinstall/sysinstall.8 Thu Jul 8 21:02:31 2010 (r209831) +++ head/usr.sbin/sysinstall/sysinstall.8 Thu Jul 8 21:26:26 2010 (r209832) @@ -553,6 +553,11 @@ installation type available. .Pp .Sy Variables : None +.It installUpgrade +Start an upgrade installation. +.Pp +.Sy Variables : +None .It installFixitHoloShell Start up the "emergency holographic shell" over on VTY4 if running as init. Modified: head/usr.sbin/sysinstall/sysinstall.h ============================================================================== --- head/usr.sbin/sysinstall/sysinstall.h Thu Jul 8 21:02:31 2010 (r209831) +++ head/usr.sbin/sysinstall/sysinstall.h Thu Jul 8 21:26:26 2010 (r209832) @@ -679,6 +679,7 @@ extern int installFixitUSB(dialogMenuIte extern int installFixitFloppy(dialogMenuItem *self); extern int installFixupBase(dialogMenuItem *self); extern int installFixupKernel(dialogMenuItem *self, int dists); +extern int installUpgrade(dialogMenuItem *self); extern int installFilesystems(dialogMenuItem *self); extern int installVarDefaults(dialogMenuItem *self); extern void installEnvironment(void); From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 21:28:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B7EA106566B; Thu, 8 Jul 2010 21:28:58 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id 30BAB8FC18; Thu, 8 Jul 2010 21:28:57 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id 9632A14DBFC0; Thu, 8 Jul 2010 23:28:55 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 6w5v7wKnK2kN; Thu, 8 Jul 2010 23:28:53 +0200 (CEST) Received: from [192.168.1.105] (catv-80-99-92-167.catv.broadband.hu [80.99.92.167]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id 4C99014DBED6; Thu, 8 Jul 2010 23:28:53 +0200 (CEST) Message-ID: <4C36430E.4030504@FreeBSD.org> Date: Thu, 08 Jul 2010 23:28:46 +0200 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-PT; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: Randi Harper References: <201007082126.o68LQQx1032102@svn.freebsd.org> In-Reply-To: <201007082126.o68LQQx1032102@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; 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: r209832 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 21:28:58 -0000 Em 2010.07.08. 23:26, Randi Harper escreveu: > Author: randi > Date: Thu Jul 8 21:26:26 2010 > New Revision: 209832 > URL: http://svn.freebsd.org/changeset/base/209832 > > Log: > Revert r209787 pending further discussion. > > Approved by: cperciva (mentor) > Thanks! As I mentioned on IRC, I'll also try to improve this feature, I'm just very busy with other projects at the moment. Gabor From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 21:34:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95E201065670; Thu, 8 Jul 2010 21:34:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 837068FC1D; Thu, 8 Jul 2010 21:34:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68LYIdZ033874; Thu, 8 Jul 2010 21:34:18 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68LYIZd033872; Thu, 8 Jul 2010 21:34:18 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201007082134.o68LYIZd033872@svn.freebsd.org> From: Andriy Gapon Date: Thu, 8 Jul 2010 21:34:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209833 - stable/8/contrib/binutils/binutils/doc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 21:34:18 -0000 Author: avg Date: Thu Jul 8 21:34:18 2010 New Revision: 209833 URL: http://svn.freebsd.org/changeset/base/209833 Log: MFC r209413: readelf.1: remove duplicate -u/--unwind option description Modified: stable/8/contrib/binutils/binutils/doc/readelf.1 Directory Properties: stable/8/contrib/binutils/ (props changed) Modified: stable/8/contrib/binutils/binutils/doc/readelf.1 ============================================================================== --- stable/8/contrib/binutils/binutils/doc/readelf.1 Thu Jul 8 21:26:26 2010 (r209832) +++ stable/8/contrib/binutils/binutils/doc/readelf.1 Thu Jul 8 21:34:18 2010 (r209833) @@ -247,14 +247,6 @@ Displays the contents of the file's relo .PD Displays the contents of the file's unwind section, if it has one. Only the unwind sections for \s-1IA64\s0 \s-1ELF\s0 files are currently supported. -.IP "\fB\-u\fR" 4 -.IX Item "-u" -.PD 0 -.IP "\fB\-\-unwind\fR" 4 -.IX Item "--unwind" -.PD -Displays the contents of the file's unwind section, if it has one. Only -the unwind sections for \s-1IA64\s0 \s-1ELF\s0 files are currently supported. .IP "\fB\-d\fR" 4 .IX Item "-d" .PD 0 From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 21:35:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C6D8106564A; Thu, 8 Jul 2010 21:35:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79DAB8FC17; Thu, 8 Jul 2010 21:35:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68LZvm7034274; Thu, 8 Jul 2010 21:35:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68LZvg4034272; Thu, 8 Jul 2010 21:35:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201007082135.o68LZvg4034272@svn.freebsd.org> From: Andriy Gapon Date: Thu, 8 Jul 2010 21:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209834 - stable/7/contrib/binutils/binutils/doc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 21:35:57 -0000 Author: avg Date: Thu Jul 8 21:35:57 2010 New Revision: 209834 URL: http://svn.freebsd.org/changeset/base/209834 Log: MFC r209413: readelf.1: remove duplicate -u/--unwind option description Modified: stable/7/contrib/binutils/binutils/doc/readelf.1 Directory Properties: stable/7/contrib/binutils/ (props changed) Modified: stable/7/contrib/binutils/binutils/doc/readelf.1 ============================================================================== --- stable/7/contrib/binutils/binutils/doc/readelf.1 Thu Jul 8 21:34:18 2010 (r209833) +++ stable/7/contrib/binutils/binutils/doc/readelf.1 Thu Jul 8 21:35:57 2010 (r209834) @@ -247,14 +247,6 @@ Displays the contents of the file's relo .PD Displays the contents of the file's unwind section, if it has one. Only the unwind sections for \s-1IA64\s0 \s-1ELF\s0 files are currently supported. -.IP "\fB\-u\fR" 4 -.IX Item "-u" -.PD 0 -.IP "\fB\-\-unwind\fR" 4 -.IX Item "--unwind" -.PD -Displays the contents of the file's unwind section, if it has one. Only -the unwind sections for \s-1IA64\s0 \s-1ELF\s0 files are currently supported. .IP "\fB\-d\fR" 4 .IX Item "-d" .PD 0 From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 21:36:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 602B3106566B; Thu, 8 Jul 2010 21:36:24 +0000 (UTC) (envelope-from sektie@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id B11A58FC1B; Thu, 8 Jul 2010 21:36:23 +0000 (UTC) Received: by vws6 with SMTP id 6so1990225vws.13 for ; Thu, 08 Jul 2010 14:36:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=Kav/DVsMw7aCSpTFgrLRwK/s06/oRvkd17KtFgxm+gw=; b=MBa51fCLs/lSrldFCgJLoJTOlC2wPvZTgylXWcsUzU/r25TUkSkqB+YLnVL7uHqnbm 0eVKQNhuNw8lQ9afCRGGFzEJCZFn+P1yhU+7lvnupalJ768ytoHz3KU/jimfb6wGo6KK HYUySDTtJ6qAddNqxKO3xm5P46F0VlznVYkwQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=Klnrr89hoNZ4+v1pzZTrKuDjTe96xFTfk0D8mkgNExZCmXp/fvB0U+mHCItYqZIvEf A8wE3mp8xb7qdqS6QHSZYaSK8GwdCrMey9q/JmU0Aw+3CWCIkUXA3VPfzDOGMEchcHI4 F2BxBv0i0WN6bM0N8i/5G1mnTNqG3IJsEtpL0= MIME-Version: 1.0 Received: by 10.220.62.5 with SMTP id v5mr4642021vch.244.1278624978619; Thu, 08 Jul 2010 14:36:18 -0700 (PDT) Sender: sektie@gmail.com Received: by 10.220.174.42 with HTTP; Thu, 8 Jul 2010 14:36:18 -0700 (PDT) In-Reply-To: <4C36430E.4030504@FreeBSD.org> References: <201007082126.o68LQQx1032102@svn.freebsd.org> <4C36430E.4030504@FreeBSD.org> Date: Thu, 8 Jul 2010 14:36:18 -0700 X-Google-Sender-Auth: Nkqf3iWTMfcFBDK8vS6FoCLQXdY Message-ID: From: Randi Harper To: Gabor Kovesdan Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209832 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 21:36:24 -0000 On Thu, Jul 8, 2010 at 2:28 PM, Gabor Kovesdan wrote: > Em 2010.07.08. 23:26, Randi Harper escreveu: >> >> Author: randi >> Date: Thu Jul =A08 21:26:26 2010 >> New Revision: 209832 >> URL: http://svn.freebsd.org/changeset/base/209832 >> >> Log: >> =A0 Revert r209787 pending further discussion. >> >> =A0 Approved by: cperciva (mentor) >> > > Thanks! As I mentioned on IRC, I'll also try to improve this feature, I'm > just very busy with other projects at the moment. > > Gabor > > As was mentioned on IRC, I think a good stopgap would be to at least remove the upgrade option from the main menu. It's not really an acceptable form of upgrade, it doesn't do an intelligent merging of config files. It would be better placed in the Fixit submenu if we're going to be leaving it around for a while and renaming it to something like "Mangle My Filesystem". :P -- randi From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 21:56:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71E0A1065672; Thu, 8 Jul 2010 21:56:05 +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 4683A8FC13; Thu, 8 Jul 2010 21:56:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68Lu5bq038683; Thu, 8 Jul 2010 21:56:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68Lu5l4038681; Thu, 8 Jul 2010 21:56:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201007082156.o68Lu5l4038681@svn.freebsd.org> From: John Baldwin Date: Thu, 8 Jul 2010 21:56:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209835 - stable/8/sys/i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 21:56:05 -0000 Author: jhb Date: Thu Jul 8 21:56:05 2010 New Revision: 209835 URL: http://svn.freebsd.org/changeset/base/209835 Log: MFC 208742: MFamd64: Add a new macro PCPU_XEN_FIELDS to hold XEN-specific per-CPU fields that is always included in PCPU_MD_FIELDS. The macro is empty for non-XEN kernels. This avoids duplicating non-XEN per-CPU fields in two places. While here, remove several unused fields from the XEN-specific structure. Modified: stable/8/sys/i386/include/pcpu.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/i386/include/pcpu.h ============================================================================== --- stable/8/sys/i386/include/pcpu.h Thu Jul 8 21:35:57 2010 (r209834) +++ stable/8/sys/i386/include/pcpu.h Thu Jul 8 21:56:05 2010 (r209835) @@ -62,35 +62,20 @@ struct shadow_time_info { uint32_t version; }; - -#define PCPU_MD_FIELDS \ - char pc_monitorbuf[128] __aligned(128); /* cache line */ \ - struct pcpu *pc_prvspace; /* Self-reference */ \ - struct pmap *pc_curpmap; \ - struct i386tss pc_common_tss; \ - struct segment_descriptor pc_common_tssd; \ - struct segment_descriptor *pc_tss_gdt; \ - struct segment_descriptor *pc_fsgs_gdt; \ - vm_paddr_t *pc_pdir_shadow; \ - int pc_currentldt; \ - u_int pc_acpi_id; /* ACPI CPU id */ \ - u_int pc_apic_id; \ - int pc_private_tss; /* Flag indicating private tss*/\ - u_int pc_cr3; /* track cr3 for R1/R3*/ \ - u_int pc_pdir; \ - u_int pc_lazypmap; \ - u_int pc_rendezvous; \ - u_int pc_cpuast; \ - uint64_t pc_processed_system_time; \ +#define PCPU_XEN_FIELDS \ + ; \ + u_int pc_cr3; /* track cr3 for R1/R3*/ \ + vm_paddr_t *pc_pdir_shadow; \ + 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] - - - + int pc_virq_to_irq[NR_VIRQS]; \ + int pc_ipi_to_irq[NR_IPIS] #else +#define PCPU_XEN_FIELDS +#endif + #define PCPU_MD_FIELDS \ char pc_monitorbuf[128] __aligned(128); /* cache line */ \ struct pcpu *pc_prvspace; /* Self-reference */ \ @@ -102,9 +87,8 @@ struct shadow_time_info { int pc_currentldt; \ u_int pc_acpi_id; /* ACPI CPU id */ \ u_int pc_apic_id; \ - int pc_private_tss /* Flag indicating private tss */ - -#endif + int pc_private_tss /* Flag indicating private tss */\ + PCPU_XEN_FIELDS #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 22:13:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D2AA106564A; Thu, 8 Jul 2010 22:13:24 +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 1BE2D8FC21; Thu, 8 Jul 2010 22:13:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68MDNPk042565; Thu, 8 Jul 2010 22:13:23 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68MDNFM042563; Thu, 8 Jul 2010 22:13:23 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201007082213.o68MDNFM042563@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 8 Jul 2010 22:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209836 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 22:13:24 -0000 Author: jkim Date: Thu Jul 8 22:13:23 2010 New Revision: 209836 URL: http://svn.freebsd.org/changeset/base/209836 Log: Implement optional 'precision' for numbers. Previously, it was parsed but ignored. Some third-party modules (e.g., APCICA) prefer this format over zero padding flag '0'. Modified: head/sys/kern/subr_prf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Thu Jul 8 21:56:05 2010 (r209835) +++ head/sys/kern/subr_prf.c Thu Jul 8 22:13:23 2010 (r209836) @@ -800,7 +800,8 @@ number: neg = 1; num = -(intmax_t)num; } - p = ksprintn(nbuf, num, base, &tmp, upper); + p = ksprintn(nbuf, num, base, &n, upper); + tmp = 0; if (sharpflag && num != 0) { if (base == 8) tmp++; @@ -810,10 +811,13 @@ number: if (neg) tmp++; - if (!ladjust && padc != '0' && width - && (width -= tmp) > 0) - while (width--) - PCHAR(padc); + if (!ladjust && padc == '0') + dwidth = width - tmp; + width -= tmp + MAX(dwidth, n); + dwidth -= n; + if (!ladjust) + while (width-- > 0) + PCHAR(' '); if (neg) PCHAR('-'); if (sharpflag && num != 0) { @@ -824,16 +828,15 @@ number: PCHAR('x'); } } - if (!ladjust && width && (width -= tmp) > 0) - while (width--) - PCHAR(padc); + while (dwidth-- > 0) + PCHAR('0'); while (*p) PCHAR(*p--); - if (ladjust && width && (width -= tmp) > 0) - while (width--) - PCHAR(padc); + if (ladjust) + while (width-- > 0) + PCHAR(' '); break; default: From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 22:21:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45792106566B; Thu, 8 Jul 2010 22:21:19 +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 335CC8FC13; Thu, 8 Jul 2010 22:21:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68MLJ4X044292; Thu, 8 Jul 2010 22:21:19 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68MLJPX044290; Thu, 8 Jul 2010 22:21:19 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201007082221.o68MLJPX044290@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 8 Jul 2010 22:21: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: r209837 - head/lib/libstand X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 22:21:20 -0000 Author: jkim Date: Thu Jul 8 22:21:18 2010 New Revision: 209837 URL: http://svn.freebsd.org/changeset/base/209837 Log: Sync. printf() of libstand(3) with sys/kern/subr_prf.c. CVS r1.94 jhb: Cast the integer read as the first argument for %b to an unsigned integer so it's value is not sign extended when assigned to the uintmax_t variable used internally by printf. For example, if bit 31 is set in the cpuid feature word, then %b would print out the initial value as a 16 character hexadecimal value. Now it only prints out an 8 character value. CVS r1.109 njl: Add support for 'h' and 'hh' modifiers for printf(9). CVS r1.117 phk: If we ignore an unknown % sequence, we must stop interpreting the remaining % arguments because the varargs are now out of sync and there is a risk that we might for instance dereference an integer in a %s argument. SVN r209836 jkim: Implement optional 'precision' for numbers. Previously, it was parsed but ignored. Some third-party modules (e.g., APCICA) prefer this format over zero padding flag '0'. Modified: head/lib/libstand/printf.c Modified: head/lib/libstand/printf.c ============================================================================== --- head/lib/libstand/printf.c Thu Jul 8 22:13:23 2010 (r209836) +++ head/lib/libstand/printf.c Thu Jul 8 22:21:18 2010 (r209837) @@ -159,10 +159,10 @@ kvprintf(char const *fmt, void (*func)(i int ch, n; uintmax_t num; int base, lflag, qflag, tmp, width, ladjust, sharpflag, neg, sign, dot; - int jflag, tflag, zflag; + int cflag, hflag, jflag, tflag, zflag; int dwidth, upper; char padc; - int retval = 0; + int stop = 0, retval = 0; num = 0; if (!func) @@ -179,7 +179,7 @@ kvprintf(char const *fmt, void (*func)(i for (;;) { padc = ' '; width = 0; - while ((ch = (u_char)*fmt++) != '%') { + while ((ch = (u_char)*fmt++) != '%' || stop) { if (ch == '\0') return (retval); PCHAR(ch); @@ -187,7 +187,7 @@ kvprintf(char const *fmt, void (*func)(i percent = fmt - 1; qflag = 0; lflag = 0; ladjust = 0; sharpflag = 0; neg = 0; sign = 0; dot = 0; dwidth = 0; upper = 0; - jflag = 0; tflag = 0; zflag = 0; + cflag = 0; hflag = 0; jflag = 0; tflag = 0; zflag = 0; reswitch: switch (ch = (u_char)*fmt++) { case '.': dot = 1; @@ -234,7 +234,7 @@ reswitch: switch (ch = (u_char)*fmt++) { width = n; goto reswitch; case 'b': - num = va_arg(ap, int); + num = (u_int)va_arg(ap, int); p = va_arg(ap, char *); for (q = ksprintn(nbuf, num, *p++, NULL, 0); *q;) PCHAR(*q--); @@ -278,6 +278,13 @@ reswitch: switch (ch = (u_char)*fmt++) { base = 10; sign = 1; goto handle_sign; + case 'h': + if (hflag) { + hflag = 0; + cflag = 1; + } else + hflag = 1; + goto reswitch; case 'j': jflag = 1; goto reswitch; @@ -297,6 +304,10 @@ reswitch: switch (ch = (u_char)*fmt++) { *(va_arg(ap, long *)) = retval; else if (zflag) *(va_arg(ap, size_t *)) = retval; + else if (hflag) + *(va_arg(ap, short *)) = retval; + else if (cflag) + *(va_arg(ap, char *)) = retval; else *(va_arg(ap, int *)) = retval; break; @@ -368,6 +379,10 @@ handle_nosign: num = va_arg(ap, u_long); else if (zflag) num = va_arg(ap, size_t); + else if (hflag) + num = (u_short)va_arg(ap, int); + else if (cflag) + num = (u_char)va_arg(ap, int); else num = va_arg(ap, u_int); goto number; @@ -382,6 +397,10 @@ handle_sign: num = va_arg(ap, long); else if (zflag) num = va_arg(ap, ssize_t); + else if (hflag) + num = (short)va_arg(ap, int); + else if (cflag) + num = (char)va_arg(ap, int); else num = va_arg(ap, int); number: @@ -389,7 +408,8 @@ number: neg = 1; num = -(intmax_t)num; } - p = ksprintn(nbuf, num, base, &tmp, upper); + p = ksprintn(nbuf, num, base, &n, upper); + tmp = 0; if (sharpflag && num != 0) { if (base == 8) tmp++; @@ -399,9 +419,13 @@ number: if (neg) tmp++; - if (!ladjust && width && (width -= tmp) > 0) - while (width--) - PCHAR(padc); + if (!ladjust && padc == '0') + dwidth = width - tmp; + width -= tmp + MAX(dwidth, n); + dwidth -= n; + if (!ladjust) + while (width-- > 0) + PCHAR(' '); if (neg) PCHAR('-'); if (sharpflag && num != 0) { @@ -412,18 +436,27 @@ number: PCHAR('x'); } } + while (dwidth-- > 0) + PCHAR('0'); while (*p) PCHAR(*p--); - if (ladjust && width && (width -= tmp) > 0) - while (width--) - PCHAR(padc); + if (ladjust) + while (width-- > 0) + PCHAR(' '); break; default: while (percent < fmt) PCHAR(*percent++); + /* + * Since we ignore an formatting argument it is no + * longer safe to obey the remaining formatting + * arguments as the arguments will no longer match + * the format specs. + */ + stop = 1; break; } } From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 23:25:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1AF91065670; Thu, 8 Jul 2010 23:25:33 +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 961098FC0A; Thu, 8 Jul 2010 23:25:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68NPX2X058626; Thu, 8 Jul 2010 23:25:33 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68NPXvi058623; Thu, 8 Jul 2010 23:25:33 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201007082325.o68NPXvi058623@svn.freebsd.org> From: Attilio Rao Date: Thu, 8 Jul 2010 23:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209838 - in stable/8/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 23:25:33 -0000 Author: attilio Date: Thu Jul 8 23:25:33 2010 New Revision: 209838 URL: http://svn.freebsd.org/changeset/base/209838 Log: MFC r208587: Add the support for reporting the NOCOREDUMP flag from sysctl_kern_proc_vmmap(). Sponsored by: Sandvine Incorporated Modified: stable/8/sys/kern/kern_proc.c stable/8/sys/sys/user.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_proc.c ============================================================================== --- stable/8/sys/kern/kern_proc.c Thu Jul 8 22:21:18 2010 (r209837) +++ stable/8/sys/kern/kern_proc.c Thu Jul 8 23:25:33 2010 (r209838) @@ -1576,6 +1576,8 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A kve->kve_flags |= KVME_FLAG_COW; if (entry->eflags & MAP_ENTRY_NEEDS_COPY) kve->kve_flags |= KVME_FLAG_NEEDS_COPY; + if (entry->eflags & MAP_ENTRY_NOCOREDUMP) + kve->kve_flags |= KVME_FLAG_NOCOREDUMP; last_timestamp = map->timestamp; vm_map_unlock_read(map); @@ -1751,6 +1753,8 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR kve->kve_flags |= KVME_FLAG_COW; if (entry->eflags & MAP_ENTRY_NEEDS_COPY) kve->kve_flags |= KVME_FLAG_NEEDS_COPY; + if (entry->eflags & MAP_ENTRY_NOCOREDUMP) + kve->kve_flags |= KVME_FLAG_NOCOREDUMP; last_timestamp = map->timestamp; vm_map_unlock_read(map); Modified: stable/8/sys/sys/user.h ============================================================================== --- stable/8/sys/sys/user.h Thu Jul 8 22:21:18 2010 (r209837) +++ stable/8/sys/sys/user.h Thu Jul 8 23:25:33 2010 (r209838) @@ -336,6 +336,7 @@ struct kinfo_file { #define KVME_FLAG_COW 0x00000001 #define KVME_FLAG_NEEDS_COPY 0x00000002 +#define KVME_FLAG_NOCOREDUMP 0x00000004 #if defined(__amd64__) #define KINFO_OVMENTRY_SIZE 1168 From owner-svn-src-all@FreeBSD.ORG Thu Jul 8 23:26:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 193071065676 for ; Thu, 8 Jul 2010 23:26:37 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 786938FC26 for ; Thu, 8 Jul 2010 23:26:36 +0000 (UTC) Received: (qmail 29829 invoked by uid 399); 8 Jul 2010 23:26:35 -0000 Received: from localhost (HELO ?192.168.0.142?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 8 Jul 2010 23:26:35 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Date: Thu, 8 Jul 2010 16:26:33 -0700 (PDT) From: Doug Barton To: Randi Harper In-Reply-To: Message-ID: References: <201007082126.o68LQQx1032102@svn.freebsd.org> <4C36430E.4030504@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-message-flag: Outlook -- Not just for spreading viruses anymore! OpenPGP: id=1A1ABC84 Organization: http://SupersetSolutions.com/ MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1344817088-1278631595=:17178" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Gabor Kovesdan Subject: Re: svn commit: r209832 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 23:26:37 -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-1344817088-1278631595=:17178 Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8BIT On Thu, 8 Jul 2010, Randi Harper wrote: > On Thu, Jul 8, 2010 at 2:28 PM, Gabor Kovesdan wrote: >> Em 2010.07.08. 23:26, Randi Harper escreveu: >>> >>> Author: randi >>> Date: Thu Jul  8 21:26:26 2010 >>> New Revision: 209832 >>> URL: http://svn.freebsd.org/changeset/base/209832 >>> >>> Log: >>>   Revert r209787 pending further discussion. >>> >>>   Approved by: cperciva (mentor) >>> >> >> Thanks! As I mentioned on IRC, I'll also try to improve this feature, I'm >> just very busy with other projects at the moment. Unfortunately the road to the current sysinstall hell was paved with just such good intentions. My suggestion is that we all get out of the way of the people who are, actually, DOING the work. :) > As was mentioned on IRC, I think a good stopgap would be to at least > remove the upgrade option from the main menu. It's not really an > acceptable form of upgrade, it doesn't do an intelligent merging of > config files. It would be better placed in the Fixit submenu if we're > going to be leaving it around for a while and renaming it to something > like "Mangle My Filesystem". :P Sounds like a better option would be to just remove it from the menu altogether and ifdef 0 the code. That way if $SOMEONE wants to step in and fix the existing code within a reasonable period of time (6 months or less?) then they will still have that option, but users won't suffer in the meantime. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso --0-1344817088-1278631595=:17178-- From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 00:35:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3DA7106564A; Fri, 9 Jul 2010 00:35:09 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2F538FC0C; Fri, 9 Jul 2010 00:35:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o690Z9VI074002; Fri, 9 Jul 2010 00:35:09 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o690Z9cH074000; Fri, 9 Jul 2010 00:35:09 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201007090035.o690Z9cH074000@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 9 Jul 2010 00:35: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: r209839 - head/sys/dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 00:35:09 -0000 Author: np Date: Fri Jul 9 00:35:09 2010 New Revision: 209839 URL: http://svn.freebsd.org/changeset/base/209839 Log: Fix bufsize calculation so that cxgbtool can display information for the last I/O queue too. MFC after: 3 days Modified: head/sys/dev/cxgb/cxgb_main.c Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Thu Jul 8 23:25:33 2010 (r209838) +++ head/sys/dev/cxgb/cxgb_main.c Fri Jul 9 00:35:09 2010 (r209839) @@ -3086,7 +3086,6 @@ cxgb_extension_ioctl(struct cdev *dev, u if (!error) { v = (uint32_t *)buf; - ioqs->bufsize -= 4 * sizeof(uint32_t); ioqs->ioq_rx_enable = *v++; ioqs->ioq_tx_enable = *v++; ioqs->ioq_rx_status = *v++; From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 00:36:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEF46106564A; Fri, 9 Jul 2010 00:36:35 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD3478FC08; Fri, 9 Jul 2010 00:36:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o690aZ7i074334; Fri, 9 Jul 2010 00:36:35 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o690aZaK074328; Fri, 9 Jul 2010 00:36:35 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201007090036.o690aZaK074328@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 9 Jul 2010 00:36: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: r209840 - in head/sys/dev/cxgb: . common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 00:36:36 -0000 Author: np Date: Fri Jul 9 00:36:35 2010 New Revision: 209840 URL: http://svn.freebsd.org/changeset/base/209840 Log: Eliminate ext_intr_task. The "slow" interrupt handler is already running on the adapter's task queue. Just do what the task does instead of enqueueing it. MFC after: 3 days Modified: head/sys/dev/cxgb/common/cxgb_common.h head/sys/dev/cxgb/common/cxgb_t3_hw.c head/sys/dev/cxgb/cxgb_adapter.h head/sys/dev/cxgb/cxgb_main.c head/sys/dev/cxgb/cxgb_sge.c Modified: head/sys/dev/cxgb/common/cxgb_common.h ============================================================================== --- head/sys/dev/cxgb/common/cxgb_common.h Fri Jul 9 00:35:09 2010 (r209839) +++ head/sys/dev/cxgb/common/cxgb_common.h Fri Jul 9 00:36:35 2010 (r209840) @@ -701,7 +701,6 @@ void t3_port_intr_enable(adapter_t *adap void t3_port_intr_disable(adapter_t *adapter, int idx); void t3_port_intr_clear(adapter_t *adapter, int idx); int t3_slow_intr_handler(adapter_t *adapter); -int t3_phy_intr_handler(adapter_t *adapter); void t3_link_changed(adapter_t *adapter, int port_id); int t3_link_start(struct cphy *phy, struct cmac *mac, struct link_config *lc); Modified: head/sys/dev/cxgb/common/cxgb_t3_hw.c ============================================================================== --- head/sys/dev/cxgb/common/cxgb_t3_hw.c Fri Jul 9 00:35:09 2010 (r209839) +++ head/sys/dev/cxgb/common/cxgb_t3_hw.c Fri Jul 9 00:36:35 2010 (r209840) @@ -2180,7 +2180,7 @@ static int mac_intr_handler(adapter_t *a /* * Interrupt handler for PHY events. */ -int t3_phy_intr_handler(adapter_t *adapter) +static int phy_intr_handler(adapter_t *adapter) { u32 i, cause = t3_read_reg(adapter, A_T3DBG_INT_CAUSE); @@ -2262,7 +2262,7 @@ int t3_slow_intr_handler(adapter_t *adap if (cause & F_XGMAC0_1) mac_intr_handler(adapter, 1); if (cause & F_T3DBG) - t3_os_ext_intr_handler(adapter); + phy_intr_handler(adapter); /* Clear the interrupts just processed. */ t3_write_reg(adapter, A_PL_INT_CAUSE0, cause); Modified: head/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- head/sys/dev/cxgb/cxgb_adapter.h Fri Jul 9 00:35:09 2010 (r209839) +++ head/sys/dev/cxgb/cxgb_adapter.h Fri Jul 9 00:36:35 2010 (r209840) @@ -350,7 +350,6 @@ struct adapter { struct filter_info *filters; /* Tasks */ - struct task ext_intr_task; struct task slow_intr_task; struct task tick_task; struct taskqueue *tq; @@ -500,7 +499,6 @@ void t3_os_link_changed(adapter_t *adapt void t3_os_phymod_changed(struct adapter *adap, int port_id); void t3_sge_err_intr_handler(adapter_t *adapter); int t3_offload_tx(struct t3cdev *, struct mbuf *); -void t3_os_ext_intr_handler(adapter_t *adapter); void t3_os_set_hw_addr(adapter_t *adapter, int port_idx, u8 hw_addr[]); int t3_mgmt_tx(adapter_t *adap, struct mbuf *m); Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Fri Jul 9 00:35:09 2010 (r209839) +++ head/sys/dev/cxgb/cxgb_main.c Fri Jul 9 00:36:35 2010 (r209840) @@ -95,7 +95,6 @@ static void cxgb_build_medialist(struct static void cxgb_media_status(struct ifnet *, struct ifmediareq *); static int setup_sge_qsets(adapter_t *); static void cxgb_async_intr(void *); -static void cxgb_ext_intr_handler(void *, int); static void cxgb_tick_handler(void *, int); static void cxgb_tick(void *); static void setup_rss(adapter_t *sc); @@ -588,7 +587,6 @@ cxgb_controller_attach(device_t dev) taskqueue_start_threads(&sc->tq, 1, PI_NET, "%s taskq", device_get_nameunit(dev)); - TASK_INIT(&sc->ext_intr_task, 0, cxgb_ext_intr_handler, sc); TASK_INIT(&sc->tick_task, 0, cxgb_tick_handler, sc); @@ -1265,29 +1263,6 @@ void t3_os_phymod_changed(struct adapter } } -/* - * Interrupt-context handler for external (PHY) interrupts. - */ -void -t3_os_ext_intr_handler(adapter_t *sc) -{ - if (cxgb_debug) - printf("t3_os_ext_intr_handler\n"); - /* - * Schedule a task to handle external interrupts as they may be slow - * and we use a mutex to protect MDIO registers. We disable PHY - * interrupts in the meantime and let the task reenable them when - * it's done. - */ - if (sc->slow_intr_mask) { - ADAPTER_LOCK(sc); - sc->slow_intr_mask &= ~F_T3DBG; - t3_write_reg(sc, A_PL_INT_ENABLE0, sc->slow_intr_mask); - taskqueue_enqueue(sc->tq, &sc->ext_intr_task); - ADAPTER_UNLOCK(sc); - } -} - void t3_os_set_hw_addr(adapter_t *adapter, int port_idx, u8 hw_addr[]) { @@ -1937,7 +1912,6 @@ cxgb_uninit_synchronized(struct port_inf clrbit(&sc->open_device_map, pi->port_id); t3_port_intr_disable(sc, pi->port_id); taskqueue_drain(sc->tq, &sc->slow_intr_task); - taskqueue_drain(sc->tq, &sc->ext_intr_task); taskqueue_drain(sc->tq, &sc->tick_task); PORT_LOCK(pi); @@ -2295,34 +2269,11 @@ cxgb_async_intr(void *data) { adapter_t *sc = data; - if (cxgb_debug) - device_printf(sc->dev, "cxgb_async_intr\n"); - /* - * May need to sleep - defer to taskqueue - */ + t3_write_reg(sc, A_PL_INT_ENABLE0, 0); + (void) t3_read_reg(sc, A_PL_INT_ENABLE0); taskqueue_enqueue(sc->tq, &sc->slow_intr_task); } -static void -cxgb_ext_intr_handler(void *arg, int count) -{ - adapter_t *sc = (adapter_t *)arg; - - if (cxgb_debug) - printf("cxgb_ext_intr_handler\n"); - - t3_phy_intr_handler(sc); - - /* Now reenable external interrupts */ - ADAPTER_LOCK(sc); - if (sc->slow_intr_mask) { - sc->slow_intr_mask |= F_T3DBG; - t3_write_reg(sc, A_PL_INT_CAUSE0, F_T3DBG); - t3_write_reg(sc, A_PL_INT_ENABLE0, sc->slow_intr_mask); - } - ADAPTER_UNLOCK(sc); -} - static inline int link_poll_needed(struct port_info *p) { Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Fri Jul 9 00:35:09 2010 (r209839) +++ head/sys/dev/cxgb/cxgb_sge.c Fri Jul 9 00:36:35 2010 (r209840) @@ -910,6 +910,8 @@ sge_slow_intr_handler(void *arg, int nco adapter_t *sc = arg; t3_slow_intr_handler(sc); + t3_write_reg(sc, A_PL_INT_ENABLE0, sc->slow_intr_mask); + (void) t3_read_reg(sc, A_PL_INT_ENABLE0); } /** @@ -3168,8 +3170,11 @@ t3b_intr(void *data) if (!map) return; - if (__predict_false(map & F_ERRINTR)) + if (__predict_false(map & F_ERRINTR)) { + t3_write_reg(adap, A_PL_INT_ENABLE0, 0); + (void) t3_read_reg(adap, A_PL_INT_ENABLE0); taskqueue_enqueue(adap->tq, &adap->slow_intr_task); + } mtx_lock(&q0->lock); for_each_port(adap, i) @@ -3197,8 +3202,11 @@ t3_intr_msi(void *data) if (process_responses_gts(adap, &adap->sge.qs[i].rspq)) new_packets = 1; mtx_unlock(&q0->lock); - if (new_packets == 0) + if (new_packets == 0) { + t3_write_reg(adap, A_PL_INT_ENABLE0, 0); + (void) t3_read_reg(adap, A_PL_INT_ENABLE0); taskqueue_enqueue(adap->tq, &adap->slow_intr_task); + } } void From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 00:38:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E2B3106566B; Fri, 9 Jul 2010 00:38:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BEF68FC0C; Fri, 9 Jul 2010 00:38:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o690c0lu074697; Fri, 9 Jul 2010 00:38:00 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o690c0mI074691; Fri, 9 Jul 2010 00:38:00 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201007090038.o690c0mI074691@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 9 Jul 2010 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: r209841 - in head/sys/dev/cxgb: . common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 00:38:00 -0000 Author: np Date: Fri Jul 9 00:38:00 2010 New Revision: 209841 URL: http://svn.freebsd.org/changeset/base/209841 Log: Improve cxgb(4)'s behaviour when faced with temporarily "bouncy" links: - Run the adapter's tick at 1Hz and remove link state checks from it. Instead, have each port check its link state. Delay the check so that it takes place slightly after the driver is notified of a change in link state. This is a cheap way to debounce these notifications if many are received in rapid succession. POLL_LINK_1ST_TIME flag can also be eliminated as a side effect of these changes. - Do not reset the PHY when link goes down. - Clear port's link_fault flag if the PHY indicates link is down. - get_link_status_r should leave speed and duplex alone when link is down. MFC after: 1 month Modified: head/sys/dev/cxgb/common/cxgb_ael1002.c head/sys/dev/cxgb/common/cxgb_common.h head/sys/dev/cxgb/common/cxgb_t3_hw.c head/sys/dev/cxgb/cxgb_adapter.h head/sys/dev/cxgb/cxgb_main.c Modified: head/sys/dev/cxgb/common/cxgb_ael1002.c ============================================================================== --- head/sys/dev/cxgb/common/cxgb_ael1002.c Fri Jul 9 00:36:35 2010 (r209840) +++ head/sys/dev/cxgb/common/cxgb_ael1002.c Fri Jul 9 00:38:00 2010 (r209841) @@ -297,6 +297,9 @@ static int get_link_status_r(struct cphy if (err) return err; *link_ok = (stat0 & stat1 & (stat2 >> 12)) & 1; + + if (*link_ok == 0) + return (0); } if (speed) *speed = SPEED_10000; @@ -1947,8 +1950,6 @@ static int ael2020_intr_enable(struct cp if (err) return err; - phy->caps |= POLL_LINK_1ST_TIME; - /* enable standard Link Alarm Status Interrupts */ err = t3_phy_lasi_intr_enable(phy); if (err) Modified: head/sys/dev/cxgb/common/cxgb_common.h ============================================================================== --- head/sys/dev/cxgb/common/cxgb_common.h Fri Jul 9 00:36:35 2010 (r209840) +++ head/sys/dev/cxgb/common/cxgb_common.h Fri Jul 9 00:38:00 2010 (r209841) @@ -60,7 +60,6 @@ enum { /* skip 25 */ SUPPORTED_MISC_IRQ = 1 << 26, SUPPORTED_IRQ = (SUPPORTED_LINK_IRQ | SUPPORTED_MISC_IRQ), - POLL_LINK_1ST_TIME = 1 << 27 }; enum { /* adapter interrupt-maintained statistics */ Modified: head/sys/dev/cxgb/common/cxgb_t3_hw.c ============================================================================== --- head/sys/dev/cxgb/common/cxgb_t3_hw.c Fri Jul 9 00:36:35 2010 (r209840) +++ head/sys/dev/cxgb/common/cxgb_t3_hw.c Fri Jul 9 00:38:00 2010 (r209841) @@ -1530,6 +1530,9 @@ void t3_link_changed(adapter_t *adapter, phy->ops->get_link_status(phy, &link_ok, &speed, &duplex, &fc); + if (link_ok == 0) + pi->link_fault = LF_NO; + if (lc->requested_fc & PAUSE_AUTONEG) fc &= lc->requested_fc; else @@ -1608,12 +1611,8 @@ void t3_link_changed(adapter_t *adapter, F_XGM_INT, 0); } - if (!link_fault) { - if (is_10G(adapter)) - pi->phy.ops->power_down(&pi->phy, 1); + if (!link_fault) t3_mac_disable(mac, MAC_DIRECTION_RX); - t3_link_start(phy, mac, lc); - } /* * Make sure Tx FIFO continues to drain, even as rxen is left @@ -2160,13 +2159,14 @@ static int mac_intr_handler(adapter_t *a mac->stats.xaui_pcs_ctc_err++; if (cause & F_XAUIPCSALIGNCHANGE) mac->stats.xaui_pcs_align_change++; - if (cause & F_XGM_INT) { - t3_set_reg_field(adap, - A_XGM_INT_ENABLE + mac->offset, - F_XGM_INT, 0); + if (cause & F_XGM_INT & + t3_read_reg(adap, A_XGM_INT_ENABLE + mac->offset)) { + t3_set_reg_field(adap, A_XGM_INT_ENABLE + mac->offset, + F_XGM_INT, 0); /* link fault suspected */ pi->link_fault = LF_MAYBE; + t3_os_link_intr(pi); } t3_write_reg(adap, A_XGM_INT_CAUSE + mac->offset, cause); @@ -2194,7 +2194,7 @@ static int phy_intr_handler(adapter_t *a int phy_cause = p->phy.ops->intr_handler(&p->phy); if (phy_cause & cphy_cause_link_change) - t3_link_changed(adapter, i); + t3_os_link_intr(p); if (phy_cause & cphy_cause_fifo_error) p->phy.fifo_errors++; if (phy_cause & cphy_cause_module_change) Modified: head/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- head/sys/dev/cxgb/cxgb_adapter.h Fri Jul 9 00:36:35 2010 (r209840) +++ head/sys/dev/cxgb/cxgb_adapter.h Fri Jul 9 00:38:00 2010 (r209841) @@ -106,6 +106,8 @@ struct port_info { int link_fault; uint8_t hw_addr[ETHER_ADDR_LEN]; + struct callout link_check_ch; + struct task link_check_task; struct task timer_reclaim_task; struct cdev *port_cdev; @@ -494,6 +496,7 @@ adap2pinfo(struct adapter *adap, int idx int t3_os_find_pci_capability(adapter_t *adapter, int cap); int t3_os_pci_save_state(struct adapter *adapter); int t3_os_pci_restore_state(struct adapter *adapter); +void t3_os_link_intr(struct port_info *); void t3_os_link_changed(adapter_t *adapter, int port_id, int link_status, int speed, int duplex, int fc, int mac_was_reset); void t3_os_phymod_changed(struct adapter *adap, int port_id); @@ -527,10 +530,6 @@ int t3_get_desc(const struct sge_qset *q unsigned char *data); void t3_update_qset_coalesce(struct sge_qset *qs, const struct qset_params *p); -#define CXGB_TICKS(a) ((a)->params.linkpoll_period ? \ - (hz * (a)->params.linkpoll_period) / 10 : \ - (a)->params.stats_update_period * hz) - /* * XXX figure out how we can return this to being private to sge */ Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Fri Jul 9 00:36:35 2010 (r209840) +++ head/sys/dev/cxgb/cxgb_main.c Fri Jul 9 00:38:00 2010 (r209841) @@ -97,6 +97,8 @@ static int setup_sge_qsets(adapter_t *); static void cxgb_async_intr(void *); static void cxgb_tick_handler(void *, int); static void cxgb_tick(void *); +static void link_check_callout(void *); +static void check_link_status(void *, int); static void setup_rss(adapter_t *sc); static int alloc_filters(struct adapter *); static int setup_hw_filters(struct adapter *); @@ -670,7 +672,7 @@ cxgb_controller_attach(device_t dev) sc->params.vpd.port_type[2], sc->params.vpd.port_type[3]); device_printf(sc->dev, "Firmware Version %s\n", &sc->fw_version[0]); - callout_reset(&sc->cxgb_tick_ch, CXGB_TICKS(sc), cxgb_tick, sc); + callout_reset(&sc->cxgb_tick_ch, hz, cxgb_tick, sc); t3_add_attach_sysctls(sc); out: if (error) @@ -1007,6 +1009,9 @@ cxgb_port_attach(device_t dev) device_get_unit(device_get_parent(dev)), p->port_id); PORT_LOCK_INIT(p, p->lockbuf); + callout_init(&p->link_check_ch, CALLOUT_MPSAFE); + TASK_INIT(&p->link_check_task, 0, check_link_status, p); + /* Allocate an ifnet object and set it up */ ifp = p->ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { @@ -1827,8 +1832,6 @@ cxgb_init_locked(struct port_info *p) ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; PORT_UNLOCK(p); - t3_link_changed(sc, p->port_id); - for (i = p->first_qset; i < p->first_qset + p->nqsets; i++) { struct sge_qset *qs = &sc->sge.qs[i]; struct sge_txq *txq = &qs->txq[TXQ_ETH]; @@ -1839,6 +1842,9 @@ cxgb_init_locked(struct port_info *p) /* all ok */ setbit(&sc->open_device_map, p->port_id); + callout_reset(&p->link_check_ch, + p->phy.caps & SUPPORTED_LINK_IRQ ? hz * 3 : hz / 4, + link_check_callout, p); done: if (may_sleep) { @@ -1914,6 +1920,9 @@ cxgb_uninit_synchronized(struct port_inf taskqueue_drain(sc->tq, &sc->slow_intr_task); taskqueue_drain(sc->tq, &sc->tick_task); + callout_drain(&pi->link_check_ch); + taskqueue_drain(sc->tq, &pi->link_check_task); + PORT_LOCK(pi); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); @@ -2274,33 +2283,42 @@ cxgb_async_intr(void *data) taskqueue_enqueue(sc->tq, &sc->slow_intr_task); } -static inline int -link_poll_needed(struct port_info *p) +static void +link_check_callout(void *arg) { - struct cphy *phy = &p->phy; + struct port_info *pi = arg; + struct adapter *sc = pi->adapter; - if (phy->caps & POLL_LINK_1ST_TIME) { - p->phy.caps &= ~POLL_LINK_1ST_TIME; - return (1); - } + if (!isset(&sc->open_device_map, pi->port_id)) + return; - return (p->link_fault || !(phy->caps & SUPPORTED_LINK_IRQ)); + taskqueue_enqueue(sc->tq, &pi->link_check_task); } static void -check_link_status(adapter_t *sc) +check_link_status(void *arg, int pending) { - int i; + struct port_info *pi = arg; + struct adapter *sc = pi->adapter; - for (i = 0; i < (sc)->params.nports; ++i) { - struct port_info *p = &sc->port[i]; + if (!isset(&sc->open_device_map, pi->port_id)) + return; - if (!isset(&sc->open_device_map, p->port_id)) - continue; + t3_link_changed(sc, pi->port_id); - if (link_poll_needed(p)) - t3_link_changed(sc, i); - } + if (pi->link_fault || !(pi->phy.caps & SUPPORTED_LINK_IRQ)) + callout_reset(&pi->link_check_ch, hz, link_check_callout, pi); +} + +void +t3_os_link_intr(struct port_info *pi) +{ + /* + * Schedule a link check in the near future. If the link is flapping + * rapidly we'll keep resetting the callout and delaying the check until + * things stabilize a bit. + */ + callout_reset(&pi->link_check_ch, hz / 4, link_check_callout, pi); } static void @@ -2352,7 +2370,7 @@ cxgb_tick(void *arg) return; taskqueue_enqueue(sc->tq, &sc->tick_task); - callout_reset(&sc->cxgb_tick_ch, CXGB_TICKS(sc), cxgb_tick, sc); + callout_reset(&sc->cxgb_tick_ch, hz, cxgb_tick, sc); } static void @@ -2366,8 +2384,6 @@ cxgb_tick_handler(void *arg, int count) if (sc->flags & CXGB_SHUTDOWN || !(sc->flags & FULL_INIT_DONE)) return; - check_link_status(sc); - if (p->rev == T3_REV_B2 && p->nports < 4 && sc->open_device_map) check_t3b2_mac(sc); From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 03:03:16 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72AAC106566B; Fri, 9 Jul 2010 03:03:16 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 288C58FC13; Fri, 9 Jul 2010 03:03:15 +0000 (UTC) Received: from lawrence1.loshell.room52.net (ppp59-167-184-191.static.internode.on.net [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 7F6B97E853; Fri, 9 Jul 2010 13:03:14 +1000 (EST) Message-ID: <4C369172.4020700@freebsd.org> Date: Fri, 09 Jul 2010 13:03:14 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.10) Gecko/20100704 Thunderbird/3.0.5 MIME-Version: 1.0 To: Kostik Belousov References: <201006130239.o5D2du3m086332@svn.freebsd.org> <20100613101025.GD1320@garage.freebsd.pl> <4C158B71.205@freebsd.org> <20100614085205.GD13238@deviant.kiev.zoral.com.ua> <4C1605A7.2000202@freebsd.org> <20100614104349.GF13238@deviant.kiev.zoral.com.ua> <4C198A90.3060905@freebsd.org> <20100617071300.GX13238@deviant.kiev.zoral.com.ua> <4C1AD292.5070508@freebsd.org> In-Reply-To: <4C1AD292.5070508@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Matthew Fleming , src-committers@FreeBSD.org, Pawel Jakub Dawidek , John Baldwin , svn-src-all@FreeBSD.org, brde@optusnet.com.au, svn-src-head@FreeBSD.org Subject: Re: svn commit: r209119 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 03:03:16 -0000 On 06/18/10 11:57, Lawrence Stewart wrote: > On 06/17/10 17:13, Kostik Belousov wrote: >> On Thu, Jun 17, 2010 at 12:38:08PM +1000, Lawrence Stewart wrote: >>> On 06/14/10 20:43, Kostik Belousov wrote: > [snip] >>>> Or, you could ditch the sum at all, indeed using ({}) and returning the >>>> result. __typeof is your friend to select proper type of accumulator. >>> >>> So, something like this? >>> >>> #define DPCPU_SUM(n, var) __extension__ \ >>> ({ \ >>> u_int >>> _i; \ >>> __typeof((DPCPU_PTR(n))->var) >>> sum; \ >>> >>> \ >>> sum = >>> 0; \ >>> CPU_FOREACH(_i) >>> { \ >>> sum += (DPCPU_ID_PTR(_i, >>> n))->var; \ >>> >>> } \ >>> >>> sum; \ >>> }) >>> >>> Which can be used like this: >>> >>> totalss.n_in = DPCPU_SUM(ss, n_in); [snip] > I'll commit the above version of the macro this evening (GMT+10) unless > I hear any objections. Thanks to all of you for your input. Any objections to the following patch going in as a follow up to the above discussion? http://people.freebsd.org/~lstewart/patches/tcp_ffcaia2008/dpcpu_zeromember_9.x.r209745.patch Turns out I need DPCPU_ZERO to fix a bug in SIFTR and it occurred to me that providing variants of the macros which work on the DPCPU variable itself or a member of a DPCPU struct makes good sense. The new patch therefore renames my original DPCPU_SUM to DPCPU_MEMBERSUM and includes DPCPU_MEMBERZERO(). Also open to suggestions on a sensible shortening of MEMBER or other appropriate and descriptive indicator to reduce the macro name lengths. MBR implies some sort of memory barrier... any other ideas? Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 05:25:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AC9E106564A; Fri, 9 Jul 2010 05:25:14 +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 7A06E8FC0C; Fri, 9 Jul 2010 05:25:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o695PEYT038279; Fri, 9 Jul 2010 05:25:14 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o695PEmj038278; Fri, 9 Jul 2010 05:25:14 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201007090525.o695PEmj038278@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 9 Jul 2010 05:25: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: r209842 - head/lib/libstand X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 05:25:14 -0000 Author: jkim Date: Fri Jul 9 05:25:14 2010 New Revision: 209842 URL: http://svn.freebsd.org/changeset/base/209842 Log: Fix build by defining MAX() macro here. Modified: head/lib/libstand/printf.c Modified: head/lib/libstand/printf.c ============================================================================== --- head/lib/libstand/printf.c Fri Jul 9 00:38:00 2010 (r209841) +++ head/lib/libstand/printf.c Fri Jul 9 05:25:14 2010 (r209842) @@ -151,6 +151,7 @@ ksprintn(char *nbuf, uintmax_t num, int static int kvprintf(char const *fmt, void (*func)(int), void *arg, int radix, va_list ap) { +#define MAX(a, b) (((a) > (b)) ? (a) : (b)) #define PCHAR(c) {int cc=(c); if (func) (*func)(cc); else *d++ = cc; retval++; } char nbuf[MAXNBUF]; char *d; From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 08:48:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9D561065674; Fri, 9 Jul 2010 08:48:51 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5EAB8FC1D; Fri, 9 Jul 2010 08:48:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o698mpaw083013; Fri, 9 Jul 2010 08:48:51 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o698mpda083004; Fri, 9 Jul 2010 08:48:51 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201007090848.o698mpda083004@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 9 Jul 2010 08:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209843 - in stable/8: share/man/man4 sys/conf sys/modules/netgraph sys/modules/netgraph/patch sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 08:48:51 -0000 Author: ae Date: Fri Jul 9 08:48:51 2010 New Revision: 209843 URL: http://svn.freebsd.org/changeset/base/209843 Log: MFC r208946: New netgraph node ng_patch(4). It performs data modification of packets passing through. Modifications are restricted to a subset of C language operations on unsigned integers of 8, 16, 32 or 64 bit size. These are: set to new value (=), addition (+=), subtraction (-=), multiplication (*=), division (/=), negation (= -), bitwise AND (&=), bitwise OR (|=), bitwise eXclusive OR (^=), shift left (<<=), shift right (>>=). Several operations are all applied to a packet sequentially in order they were specified by user. Submitted by: Maxim Ignatenko Vadim Goncharov Discussed with: net@ MFC r208947: Fix typo. MFC r208989: Style(9) fixes: * Sort includes * Replace #define to #define * Split declarations and initializations * Split long lines Requested by: kib MFC r209194: * Include sys/systm.h for KASSERT() * Remove unneeded includes and comment * Replace home made OFFSETOF() macro with standard offsetof() Pointed out by: bde Approved by: kib (mentor) Added: stable/8/share/man/man4/ng_patch.4 - copied unchanged from r208946, head/share/man/man4/ng_patch.4 stable/8/sys/modules/netgraph/patch/ - copied from r208946, head/sys/modules/netgraph/patch/ stable/8/sys/netgraph/ng_patch.c - copied, changed from r208946, head/sys/netgraph/ng_patch.c stable/8/sys/netgraph/ng_patch.h - copied, changed from r208946, head/sys/netgraph/ng_patch.h Modified: stable/8/share/man/man4/Makefile stable/8/sys/conf/NOTES stable/8/sys/conf/files stable/8/sys/conf/options stable/8/sys/modules/netgraph/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Fri Jul 9 05:25:14 2010 (r209842) +++ stable/8/share/man/man4/Makefile Fri Jul 9 08:48:51 2010 (r209843) @@ -272,6 +272,7 @@ MAN= aac.4 \ ng_nat.4 \ ng_netflow.4 \ ng_one2many.4 \ + ng_patch.4 \ ng_ppp.4 \ ng_pppoe.4 \ ng_pptpgre.4 \ Copied: stable/8/share/man/man4/ng_patch.4 (from r208946, head/share/man/man4/ng_patch.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/ng_patch.4 Fri Jul 9 08:48:51 2010 (r209843, copy of r208946, head/share/man/man4/ng_patch.4) @@ -0,0 +1,235 @@ +.\" Copyright (c) 2010 Maxim Ignatenko +.\" Copyright (c) 2010 Vadim Goncharov +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 9, 2010 +.Dt NG_PATCH 4 +.Os +.Sh NAME +.Nm ng_patch +.Nd "trivial mbuf data modifying netgraph node type" +.Sh SYNOPSIS +.In netgraph/ng_patch.h +.Sh DESCRIPTION +The +.Nm patch +node performs data modification of packets passing through it. +Modifications are restricted to a subset of C language operations +on unsigned integers of 8, 16, 32 or 64 bit size. +These are: set to new value (=), addition (+=), subtraction (-=), +multiplication (*=), division (/=), negation (= -), +bitwise AND (&=), bitwise OR (|=), bitwise eXclusive OR (^=), +shift left (<<=), shift right (>>=). +A negation operation is the one exception: integer is treated as signed +and second operand (the +.Va value ) +is not used. +There may be several modification operations, they are all applied +to a packet sequentially in order they were specified by user. +Data payload of packet is viewed as array of bytes, with zero offset +corresponding to the very first byte of packet headers, and +.Va length +bytes beginning from +.Va offset +are taken as a single integer in network byte order. +.Sh HOOKS +This node type has two hooks: +.Bl -tag -width indent +.It Va in +Packets received on this hook are modified according to rules specified +in config and then forwarded to +.Ar out +hook, if it exists and connected. +Otherwise they are reflected back to the +.Ar in +hook. +.It Va out +Packets received on this hook are forwarded to +.Ar in +hook without any changes. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width indent +.It Dv NGM_PATCH_SETCONFIG Pq Li setconfig +This command sets the sequence of modify operations +that will be applied to incoming data on a hook. +The following +.Vt "struct ng_patch_config" +must be supplied as an argument: +.Bd -literal -offset 4n +struct ng_patch_op { + uint64_t value; + uint32_t offset; + uint16_t length; /* 1,2,4 or 8 bytes */ + uint16_t mode; +}; +/* Patching modes */ +#define NG_PATCH_MODE_SET 1 +#define NG_PATCH_MODE_ADD 2 +#define NG_PATCH_MODE_SUB 3 +#define NG_PATCH_MODE_MUL 4 +#define NG_PATCH_MODE_DIV 5 +#define NG_PATCH_MODE_NEG 6 +#define NG_PATCH_MODE_AND 7 +#define NG_PATCH_MODE_OR 8 +#define NG_PATCH_MODE_XOR 9 +#define NG_PATCH_MODE_SHL 10 +#define NG_PATCH_MODE_SHR 11 + +struct ng_patch_config { + uint32_t count; + uint32_t csum_flags; + struct ng_patch_op ops[]; +}; +.Ed +.Pp +The +.Va csum_flags +can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_SCTP and CSUM_UDP +(other values are ignored) for instructing the IP stack to recalculate the +corresponding checksum before transmitting packet on output interface. +The +.Nm +node does not do any checksum correction by itself. +.It Dv NGM_PATCH_GETCONFIG Pq Li getconfig +This control message obtains current set of modify operations, +returned as +.Vt "struct ng_patch_config" . +.It Dv NGM_PATCH_GET_STATS Pq Li getstats +Returns node statistics as a +.Vt "struct ng_patch_stats" . +.It Dv NGM_PATCH_CLR_STATS Pq Li clrstats +Clear node statistics. +.It Dv NGM_PATCH_GETCLR_STATS Pq Li getclrstats +This command is identical to +.Dv NGM_PATCH_GET_STATS , +except that the statistics are also atomically cleared. +.El +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh EXAMPLES +The +.Nm +node allows to modify TTL and TOS/DSCP fields in IP packets. +Suppose you have two adjacent simplex links to remote network +(e.g.\& satellite), so that the packets expiring in between +will generate unwanted ICMP-replies which have to go forth, not back. +Thus you need to raise TTL of every packet entering link link by 2 +to ensure the TTL will not reach zero there. +So you setup +.Xr ipfw 8 +rule with +.Cm netgraph +action to inject packets going to other end of simplex link by the +following +.Xr ngctl 8 +script: +.Bd -literal -offset 4n +/usr/sbin/ngctl -f- <<-SEQ + mkpeer ipfw: patch 200 in + name ipfw:200 ttl_add + msg ttl_add: setconfig { count=1 csum_flags=1 ops=[ \e + { mode=2 value=3 length=1 offset=8 } ] } +SEQ +/sbin/ipfw add 150 netgraph 200 ip from any to simplex.remote.net +.Ed +.Pp +Here +.Dq Li ttl_add +node of type +.Nm +configured to add (mode +.Dv NG_PATCH_MODE_ADD ) +a +.Va value +of 3 to a one-byte TTL field, which is 9th byte of IP packet header. +.Pp +Another example would be two consecutive modifications of packet TOS +field: say, you need to clear the +.Dv IPTOS_THROUGHPUT +bit and set the +.Dv IPTOS_MINCOST +bit. +So you do: +.Bd -literal -offset 4n +/usr/sbin/ngctl -f- <<-SEQ + mkpeer ipfw: patch 300 in + name ipfw:300 tos_chg + msg tos_chg: setconfig { count=2 csum_flags=1 ops=[ \e + { mode=7 value=0xf7 length=1 offset=1 } \e + { mode=8 value=0x02 length=1 offset=1 } ] } +SEQ +/sbin/ipfw add 160 netgraph 600 ip from any to any not dst-port 80 +.Ed +.Pp +This first does +.Dv NG_PATCH_MODE_AND +clearing the fourth bit and then +.Dv NG_PATCH_MODE_OR +setting the third bit. +.Pp +In both examples the +.Va csum_flags +field indicates that IP checksum (but not TCP or UDP checksum) should be +recalculated before transmit. +.Pp +Note: one should ensure that packets are returned to ipfw after processing +inside +.Xr netgraph 4 , +by setting appropriate +.Xr sysctl 8 +variable: +.Bd -literal -offset 4n +sysctl net.inet.ip.fw.one_pass=0 +.Ed +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_ipfw 4 , +.Xr ngctl 8 +.Sh HISTORY +The +.Nm +node type was implemented in +.Fx 8.1 . +.Sh AUTHORS +.An "Maxim Ignatenko" Aq gelraen.ua@gmail.com . +This manual page was written by +.An "Vadim Goncharov" Aq vadimnuclight@tpu.ru . +.Sh BUGS +Node blindly tries to apply every patching operation to each packet +(except those which offset if greater than length of the packet), +so be sure that you supply only the right packets to it (e.g. changing +bytes in the ARP packets meant to be in IP header could corrupt +them and make your machine unreachable from the network). +.Pp +.Em !!! WARNING !!! +.Pp +Output path of the IP stack assumes correct fields and lengths in the +packets - changing them by mistake to incorrect values can cause +unpredictable results including kernel panics. Modified: stable/8/sys/conf/NOTES ============================================================================== --- stable/8/sys/conf/NOTES Fri Jul 9 05:25:14 2010 (r209842) +++ stable/8/sys/conf/NOTES Fri Jul 9 08:48:51 2010 (r209843) @@ -698,6 +698,7 @@ options NETGRAPH_MPPC_ENCRYPTION options NETGRAPH_NETFLOW options NETGRAPH_NAT options NETGRAPH_ONE2MANY +options NETGRAPH_PATCH options NETGRAPH_PIPE options NETGRAPH_PPP options NETGRAPH_PPPOE Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Fri Jul 9 05:25:14 2010 (r209842) +++ stable/8/sys/conf/files Fri Jul 9 08:48:51 2010 (r209843) @@ -2457,6 +2457,7 @@ netgraph/ng_mppc.c optional netgraph_mp netgraph/ng_nat.c optional netgraph_nat inet libalias netgraph/ng_one2many.c optional netgraph_one2many netgraph/ng_parse.c optional netgraph +netgraph/ng_patch.c optional netgraph_patch netgraph/ng_pipe.c optional netgraph_pipe netgraph/ng_ppp.c optional netgraph_ppp netgraph/ng_pppoe.c optional netgraph_pppoe Modified: stable/8/sys/conf/options ============================================================================== --- stable/8/sys/conf/options Fri Jul 9 05:25:14 2010 (r209842) +++ stable/8/sys/conf/options Fri Jul 9 08:48:51 2010 (r209843) @@ -484,6 +484,7 @@ NETGRAPH_MPPC_ENCRYPTION opt_netgraph.h NETGRAPH_NAT opt_netgraph.h NETGRAPH_NETFLOW opt_netgraph.h NETGRAPH_ONE2MANY opt_netgraph.h +NETGRAPH_PATCH opt_netgraph.h NETGRAPH_PIPE opt_netgraph.h NETGRAPH_PPP opt_netgraph.h NETGRAPH_PPPOE opt_netgraph.h Modified: stable/8/sys/modules/netgraph/Makefile ============================================================================== --- stable/8/sys/modules/netgraph/Makefile Fri Jul 9 05:25:14 2010 (r209842) +++ stable/8/sys/modules/netgraph/Makefile Fri Jul 9 08:48:51 2010 (r209843) @@ -35,6 +35,7 @@ SUBDIR= async \ netflow \ netgraph \ one2many \ + patch \ pipe \ ppp \ pppoe \ Copied and modified: stable/8/sys/netgraph/ng_patch.c (from r208946, head/sys/netgraph/ng_patch.c) ============================================================================== --- head/sys/netgraph/ng_patch.c Wed Jun 9 12:25:57 2010 (r208946, copy source) +++ stable/8/sys/netgraph/ng_patch.c Fri Jul 9 08:48:51 2010 (r209843) @@ -29,12 +29,11 @@ __FBSDID("$FreeBSD$"); #include +#include #include -#include +#include #include -#include -#include -#include /* be64toh(), htobe64() */ +#include #include #include #include @@ -47,16 +46,14 @@ static ng_newhook_t ng_patch_newhook; static ng_rcvdata_t ng_patch_rcvdata; static ng_disconnect_t ng_patch_disconnect; -#define OFFSETOF(s, e) ((char *)&((s *)0)->e - (char *)((s *)0)) - static int -ng_patch_config_getlen(const struct ng_parse_type *type, const u_char *start, - const u_char *buf) +ng_patch_config_getlen(const struct ng_parse_type *type, + const u_char *start, const u_char *buf) { const struct ng_patch_config *p; p = (const struct ng_patch_config *)(buf - - OFFSETOF(struct ng_patch_config, ops)); + offsetof(struct ng_patch_config, ops)); return (p->count); } @@ -158,7 +155,7 @@ struct ng_patch_priv { }; typedef struct ng_patch_priv *priv_p; -#define NG_PATCH_CONF_SIZE(count) (sizeof(struct ng_patch_config) + \ +#define NG_PATCH_CONF_SIZE(count) (sizeof(struct ng_patch_config) + \ (count) * sizeof(struct ng_patch_op)) static void do_patch(priv_p conf, struct mbuf *m); @@ -195,12 +192,14 @@ static int ng_patch_rcvmsg(node_p node, item_p item, hook_p lasthook) { const priv_p privp = NG_NODE_PRIVATE(node); - struct ng_patch_config *conf; + struct ng_patch_config *conf, *newconf; + union patch_val *newval; struct ng_mesg *msg; - struct ng_mesg *resp = NULL; - int i, clear = 0; - int error = 0; + struct ng_mesg *resp; + int i, clear, error; + clear = error = 0; + resp = NULL; NGI_GET_MSG(item, msg); switch (msg->header.typecookie) { case NGM_PATCH_COOKIE: @@ -215,16 +214,15 @@ ng_patch_rcvmsg(node_p node, item_p item break; case NGM_PATCH_SETCONFIG: { - struct ng_patch_config *newconf; - union patch_val *newval; - - if (msg->header.arglen < sizeof(struct ng_patch_config)) { + if (msg->header.arglen < + sizeof(struct ng_patch_config)) { error = EINVAL; break; } conf = (struct ng_patch_config *)msg->data; - if (msg->header.arglen < NG_PATCH_CONF_SIZE(conf->count)) { + if (msg->header.arglen < + NG_PATCH_CONF_SIZE(conf->count)) { error = EINVAL; break; } @@ -248,27 +246,34 @@ ng_patch_rcvmsg(node_p node, item_p item CSUM_SCTP; if (error == 0) { - newconf = malloc(NG_PATCH_CONF_SIZE(conf->count), - M_NETGRAPH, M_WAIT); - newval = malloc(conf->count * sizeof(union patch_val), + newconf = malloc( + NG_PATCH_CONF_SIZE(conf->count), M_NETGRAPH, M_WAIT); + newval = malloc(conf->count * + sizeof(union patch_val), M_NETGRAPH, + M_WAIT); for(i = 0; i < conf->count; i++) { switch (conf->ops[i].length) { case 1: - newval[i].v1 = conf->ops[i].value; + newval[i].v1 = + conf->ops[i].value; break; case 2: - newval[i].v2 = conf->ops[i].value; + newval[i].v2 = + conf->ops[i].value; break; case 4: - newval[i].v4 = conf->ops[i].value; + newval[i].v4 = + conf->ops[i].value; break; case 8: - newval[i].v8 = conf->ops[i].value; + newval[i].v8 = + conf->ops[i].value; break; } } - bcopy(conf, newconf, NG_PATCH_CONF_SIZE(conf->count)); + bcopy(conf, newconf, + NG_PATCH_CONF_SIZE(conf->count)); if (privp->val != NULL) free(privp->val, M_NETGRAPH); privp->val = newval; @@ -310,12 +315,15 @@ ng_patch_rcvmsg(node_p node, item_p item static void do_patch(priv_p privp, struct mbuf *m) { - struct ng_patch_config *conf = privp->config; + struct ng_patch_config *conf; uint64_t buf; - int i, patched = 0; + int i, patched; + conf = privp->config; + patched = 0; for(i = 0; i < conf->count; i++) { - if (conf->ops[i].offset + conf->ops[i].length > m->m_pkthdr.len) + if (conf->ops[i].offset + conf->ops[i].length > + m->m_pkthdr.len) continue; /* for "=" operation we don't need to copy data from mbuf */ @@ -323,7 +331,7 @@ do_patch(priv_p privp, struct mbuf *m) m_copydata(m, conf->ops[i].offset, conf->ops[i].length, (caddr_t)&buf); } - + switch (conf->ops[i].length) { case 1: switch (conf->ops[i].mode) { @@ -550,16 +558,17 @@ ng_patch_shutdown(node_p node) static int ng_patch_disconnect(hook_p hook) { - priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + priv_p priv; + priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); if (hook == priv->in) { priv->in = NULL; } if (hook == priv->out) { priv->out = NULL; } - if ((NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0) - && (NG_NODE_IS_VALID(NG_HOOK_NODE(hook)))) /* already shutting down? */ + if (NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0 && + NG_NODE_IS_VALID(NG_HOOK_NODE(hook))) /* already shutting down? */ ng_rmnode_self(NG_HOOK_NODE(hook)); return (0); } Copied and modified: stable/8/sys/netgraph/ng_patch.h (from r208946, head/sys/netgraph/ng_patch.h) ============================================================================== --- head/sys/netgraph/ng_patch.h Wed Jun 9 12:25:57 2010 (r208946, copy source) +++ stable/8/sys/netgraph/ng_patch.h Fri Jul 9 08:48:51 2010 (r209843) @@ -30,14 +30,14 @@ #define _NETGRAPH_NG_PATCH_H_ /* Node type name. */ -#define NG_PATCH_NODE_TYPE "patch" +#define NG_PATCH_NODE_TYPE "patch" /* Node type cookie. */ -#define NGM_PATCH_COOKIE 1262445509 +#define NGM_PATCH_COOKIE 1262445509 /* Hook names */ -#define NG_PATCH_HOOK_IN "in" -#define NG_PATCH_HOOK_OUT "out" +#define NG_PATCH_HOOK_IN "in" +#define NG_PATCH_HOOK_OUT "out" /* Netgraph commands understood by this node type */ enum { @@ -70,7 +70,7 @@ struct ng_patch_op { uint16_t mode; }; -#define NG_PATCH_OP_TYPE_INFO { \ +#define NG_PATCH_OP_TYPE_INFO { \ { "value", &ng_parse_uint64_type }, \ { "offset", &ng_parse_uint32_type }, \ { "length", &ng_parse_uint16_type }, \ @@ -84,7 +84,7 @@ struct ng_patch_config { struct ng_patch_op ops[]; }; -#define NG_PATCH_CONFIG_TYPE_INFO { \ +#define NG_PATCH_CONFIG_TYPE_INFO { \ { "count", &ng_parse_uint32_type }, \ { "csum_flags", &ng_parse_uint32_type }, \ { "ops", &ng_patch_confarr_type }, \ @@ -97,7 +97,7 @@ struct ng_patch_stats { uint64_t dropped; }; -#define NG_PATCH_STATS_TYPE_INFO { \ +#define NG_PATCH_STATS_TYPE_INFO { \ { "received", &ng_parse_uint64_type }, \ { "patched", &ng_parse_uint64_type }, \ { "dropped", &ng_parse_uint64_type }, \ From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 10:57:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 148B31065672; Fri, 9 Jul 2010 10:57:57 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05B4B8FC1D; Fri, 9 Jul 2010 10:57:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o69AvtKf013420; Fri, 9 Jul 2010 10:57:55 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o69AvtK5013419; Fri, 9 Jul 2010 10:57:55 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201007091057.o69AvtK5013419@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 9 Jul 2010 10:57: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: r209844 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 10:57:57 -0000 Author: jh Date: Fri Jul 9 10:57:55 2010 New Revision: 209844 URL: http://svn.freebsd.org/changeset/base/209844 Log: Remove redundant high >= 0. Reported by: rstone Modified: head/sys/kern/subr_unit.c Modified: head/sys/kern/subr_unit.c ============================================================================== --- head/sys/kern/subr_unit.c Fri Jul 9 08:48:51 2010 (r209843) +++ head/sys/kern/subr_unit.c Fri Jul 9 10:57:55 2010 (r209844) @@ -326,7 +326,7 @@ new_unrhdr(int low, int high, struct mtx { struct unrhdr *uh; - KASSERT(low >= 0 && high >= 0 && low <= high, + KASSERT(low >= 0 && low <= high, ("UNR: use error: new_unrhdr(%d, %d)", low, high)); uh = Malloc(sizeof *uh); if (mutex != NULL) From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 11:27:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5DAE106566C; Fri, 9 Jul 2010 11:27:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6B2F8FC08; Fri, 9 Jul 2010 11:27:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o69BRXBn019930; Fri, 9 Jul 2010 11:27:33 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o69BRXL7019928; Fri, 9 Jul 2010 11:27:33 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201007091127.o69BRXL7019928@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 9 Jul 2010 11:27: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: r209845 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 11:27:33 -0000 Author: glebius Date: Fri Jul 9 11:27:33 2010 New Revision: 209845 URL: http://svn.freebsd.org/changeset/base/209845 Log: Improve last commit: use bpf_mtap2() to avoiding stack usage. Prodded by: julian Modified: head/sys/netinet/ipfw/ip_fw_log.c Modified: head/sys/netinet/ipfw/ip_fw_log.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_log.c Fri Jul 9 10:57:55 2010 (r209844) +++ head/sys/netinet/ipfw/ip_fw_log.c Fri Jul 9 11:27:33 2010 (r209845) @@ -152,24 +152,17 @@ ipfw_log(struct ip_fw *f, u_int hlen, st if (V_fw_verbose == 0) { #ifndef WITHOUT_BPF - struct mbuf m0; if (log_if == NULL || log_if->if_bpf == NULL) return; - /* BPF treats the "mbuf" as read-only */ - bzero(&m0, sizeof(struct mbuf)); - m0.m_hdr.mh_next = m; - m0.m_hdr.mh_len = ETHER_HDR_LEN; - if (args->eh) { /* layer2, use orig hdr */ - m0.m_hdr.mh_data = (char *)args->eh; - } else { - /* add fake header. Later we will store - * more info in the header + if (args->eh) /* layer2, use orig hdr */ + BPF_MTAP2(log_if, args->eh, ETHER_HDR_LEN, m); + else + /* Add fake header. Later we will store + * more info in the header. */ - m0.m_hdr.mh_data = "DDDDDDSSSSSS\x08\x00"; - } - BPF_MTAP(log_if, &m0); + BPF_MTAP2(log_if, "DDDDDDSSSSSS\x08\x00", ETHER_HDR_LEN, m); #endif /* !WITHOUT_BPF */ return; } From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 13:46:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3C71106566B; Fri, 9 Jul 2010 13:46:00 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C22FB8FC17; Fri, 9 Jul 2010 13:46:00 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 4B8AA46B53; Fri, 9 Jul 2010 09:46:00 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 453108A04E; Fri, 9 Jul 2010 09:45:50 -0400 (EDT) From: John Baldwin To: Doug Barton Date: Fri, 9 Jul 2010 08:11:24 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100217; KDE/4.4.5; amd64; ; ) References: <201007082126.o68LQQx1032102@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201007090811.25079.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 09 Jul 2010 09:45:50 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Gabor Kovesdan , Randi Harper Subject: Re: svn commit: r209832 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 13:46:01 -0000 On Thursday, July 08, 2010 7:26:33 pm Doug Barton wrote: > On Thu, 8 Jul 2010, Randi Harper wrote: > > > On Thu, Jul 8, 2010 at 2:28 PM, Gabor Kovesdan wrote: > >> Em 2010.07.08. 23:26, Randi Harper escreveu: > >>> > >>> Author: randi > >>> Date: Thu Jul 8 21:26:26 2010 > >>> New Revision: 209832 > >>> URL: http://svn.freebsd.org/changeset/base/209832 > >>> > >>> Log: > >>> Revert r209787 pending further discussion. > >>> > >>> Approved by: cperciva (mentor) > >>> > >> > >> Thanks! As I mentioned on IRC, I'll also try to improve this feature, I'm > >> just very busy with other projects at the moment. > > Unfortunately the road to the current sysinstall hell was paved with > just such good intentions. My suggestion is that we all get out of the > way of the people who are, actually, DOING the work. :) > > > As was mentioned on IRC, I think a good stopgap would be to at least > > remove the upgrade option from the main menu. It's not really an > > acceptable form of upgrade, it doesn't do an intelligent merging of > > config files. It would be better placed in the Fixit submenu if we're > > going to be leaving it around for a while and renaming it to something > > like "Mangle My Filesystem". :P > > Sounds like a better option would be to just remove it from the menu > altogether and ifdef 0 the code. That way if $SOMEONE wants to step in > and fix the existing code within a reasonable period of time (6 months > or less?) then they will still have that option, but users won't suffer > in the meantime. Well, this assumes that the existing code is completely broken, but that isn't true. Some people find the existing functionality useful. I'm sure it could be improved, but if the existing functionality is useful I don't see why it has to be disabled. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 13:53:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FF66106566B; Fri, 9 Jul 2010 13:53:26 +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 206E48FC17; Fri, 9 Jul 2010 13:53:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o69DrPw7052007; Fri, 9 Jul 2010 13:53:26 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o69DrP8t052005; Fri, 9 Jul 2010 13:53:25 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201007091353.o69DrP8t052005@svn.freebsd.org> From: John Baldwin Date: Fri, 9 Jul 2010 13:53: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: r209847 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 13:53:26 -0000 Author: jhb Date: Fri Jul 9 13:53:25 2010 New Revision: 209847 URL: http://svn.freebsd.org/changeset/base/209847 Log: Refine a comment. Reviewed by: bde Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Fri Jul 9 13:49:20 2010 (r209846) +++ head/sys/kern/kern_exec.c Fri Jul 9 13:53:25 2010 (r209847) @@ -754,11 +754,10 @@ interpret: /* * If tracing the process, trap to debugger so breakpoints - * can be set before the program executes. - * Use tdsignal to deliver signal to current thread, using - * psignal may cause the signal to be delivered to wrong thread - * because that thread will exit, remember we are going to enter - * single thread mode. + * can be set before the program executes. We have to use + * tdsignal() to deliver the signal to the current thread + * since any other threads in this process will exit if + * execve() succeeds. */ if (p->p_flag & P_TRACED) tdsignal(td, SIGTRAP); From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 13:59:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0771C106566C; Fri, 9 Jul 2010 13:59:54 +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 EC0E38FC23; Fri, 9 Jul 2010 13:59:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o69DxrKE053468; Fri, 9 Jul 2010 13:59:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o69DxrRp053466; Fri, 9 Jul 2010 13:59:53 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201007091359.o69DxrRp053466@svn.freebsd.org> From: John Baldwin Date: Fri, 9 Jul 2010 13:59: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: r209848 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 13:59:54 -0000 Author: jhb Date: Fri Jul 9 13:59:53 2010 New Revision: 209848 URL: http://svn.freebsd.org/changeset/base/209848 Log: Accidentally committed an older version of this comment rather than the final one. Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Fri Jul 9 13:53:25 2010 (r209847) +++ head/sys/kern/kern_exec.c Fri Jul 9 13:59:53 2010 (r209848) @@ -753,10 +753,10 @@ interpret: p->p_flag &= ~P_INEXEC; /* - * If tracing the process, trap to debugger so breakpoints - * can be set before the program executes. We have to use - * tdsignal() to deliver the signal to the current thread - * since any other threads in this process will exit if + * If tracing the process, trap to the debugger so that + * breakpoints can be set before the program executes. We + * have to use tdsignal() to deliver the signal to the current + * thread since any other threads in this process will exit if * execve() succeeds. */ if (p->p_flag & P_TRACED) From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 14:00:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2161C1065673; Fri, 9 Jul 2010 14:00:23 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 116838FC14; Fri, 9 Jul 2010 14:00:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o69E0MvX053633; Fri, 9 Jul 2010 14:00:22 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o69E0M1j053631; Fri, 9 Jul 2010 14:00:22 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007091400.o69E0M1j053631@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 9 Jul 2010 14: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: r209849 - head/sys/powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 14:00:23 -0000 Author: nwhitehorn Date: Fri Jul 9 14:00:22 2010 New Revision: 209849 URL: http://svn.freebsd.org/changeset/base/209849 Log: MFppc64: Check if devices are direct-mapped individually instead of just checking the value of hw_direct_map. Modified: head/sys/powerpc/powerpc/bus_machdep.c Modified: head/sys/powerpc/powerpc/bus_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/bus_machdep.c Fri Jul 9 13:59:53 2010 (r209848) +++ head/sys/powerpc/powerpc/bus_machdep.c Fri Jul 9 14:00:22 2010 (r209849) @@ -99,11 +99,11 @@ bs_remap_earlyboot(void) int i; vm_offset_t pa, spa; - if (hw_direct_map) - return; - for (i = 0; i < earlyboot_map_idx; i++) { spa = earlyboot_mappings[i].addr; + if (pmap_dev_direct_mapped(spa, earlyboot_mappings[i].size) + == 0) + continue; pa = trunc_page(spa); while (pa < spa + earlyboot_mappings[i].size) { From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 14:01:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E64F51065670; Fri, 9 Jul 2010 14:01:18 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D63018FC08; Fri, 9 Jul 2010 14:01:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o69E1Ifi053900; Fri, 9 Jul 2010 14:01:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o69E1Ira053898; Fri, 9 Jul 2010 14:01:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007091401.o69E1Ira053898@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 9 Jul 2010 14:01: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: r209850 - head/sys/powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 14:01:19 -0000 Author: nwhitehorn Date: Fri Jul 9 14:01:18 2010 New Revision: 209850 URL: http://svn.freebsd.org/changeset/base/209850 Log: MFppc64: Use longs instead of ints as the native word type in bcopy(). This will expand nicely on 64-bit systems. Modified: head/sys/powerpc/powerpc/bcopy.c Modified: head/sys/powerpc/powerpc/bcopy.c ============================================================================== --- head/sys/powerpc/powerpc/bcopy.c Fri Jul 9 14:00:22 2010 (r209849) +++ head/sys/powerpc/powerpc/bcopy.c Fri Jul 9 14:01:18 2010 (r209850) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); * sizeof(word) MUST BE A POWER OF TWO * SO THAT wmask BELOW IS ALL ONES */ -typedef int word; /* "word" used for optimal copy speed */ +typedef long word; /* "word" used for optimal copy speed */ #define wsize sizeof(word) #define wmask (wsize - 1) @@ -86,14 +86,14 @@ memcpy(void *dst0, const void *src0, siz /* * Copy forward. */ - t = (int)src; /* only need low bits */ + t = (size_t)src; /* only need low bits */ - if ((t | (int)dst) & wmask) { + if ((t | (uintptr_t)dst) & wmask) { /* * Try to align operands. This cannot be done * unless the low bits match. */ - if ((t ^ (int)dst) & wmask || length < wsize) { + if ((t ^ (uintptr_t)dst) & wmask || length < wsize) { t = length; } else { t = wsize - (t & wmask); @@ -118,10 +118,10 @@ memcpy(void *dst0, const void *src0, siz */ src += length; dst += length; - t = (int)src; + t = (uintptr_t)src; - if ((t | (int)dst) & wmask) { - if ((t ^ (int)dst) & wmask || length <= wsize) { + if ((t | (uintptr_t)dst) & wmask) { + if ((t ^ (uintptr_t)dst) & wmask || length <= wsize) { t = length; } else { t &= wmask; From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 14:02:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 733E2106566C; Fri, 9 Jul 2010 14:02:24 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 635678FC1C; Fri, 9 Jul 2010 14:02:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o69E2O4i054171; Fri, 9 Jul 2010 14:02:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o69E2Oh7054169; Fri, 9 Jul 2010 14:02:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007091402.o69E2Oh7054169@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 9 Jul 2010 14:02: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: r209851 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 14:02:24 -0000 Author: nwhitehorn Date: Fri Jul 9 14:02:24 2010 New Revision: 209851 URL: http://svn.freebsd.org/changeset/base/209851 Log: MFppc64: Minor 64-bit-cleanliness upgrades and support for platform detection on subtly-broken OF implementations like in the Mambo simulator. Modified: head/sys/powerpc/aim/platform_chrp.c Modified: head/sys/powerpc/aim/platform_chrp.c ============================================================================== --- head/sys/powerpc/aim/platform_chrp.c Fri Jul 9 14:01:18 2010 (r209850) +++ head/sys/powerpc/aim/platform_chrp.c Fri Jul 9 14:02:24 2010 (r209851) @@ -88,7 +88,7 @@ PLATFORM_DEF(chrp_platform); static int chrp_probe(platform_t plat) { - if (OF_finddevice("/memory") != -1) + if (OF_finddevice("/memory") != -1 || OF_finddevice("/memory@0") != -1) return (BUS_PROBE_GENERIC); return (ENXIO); @@ -105,7 +105,7 @@ static u_long chrp_timebase_freq(platform_t plat, struct cpuref *cpuref) { phandle_t phandle; - long ticks = -1; + int32_t ticks = -1; phandle = cpuref->cr_hwref; @@ -121,7 +121,7 @@ chrp_timebase_freq(platform_t plat, stru static int chrp_smp_fill_cpuref(struct cpuref *cpuref, phandle_t cpu) { - int cpuid, res; + cell_t cpuid, res; cpuref->cr_hwref = cpu; res = OF_getprop(cpu, "reg", &cpuid, sizeof(cpuid)); From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 14:02:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67BB71065687; Fri, 9 Jul 2010 14:02:57 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57FB78FC2A; Fri, 9 Jul 2010 14:02:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o69E2vTD054308; Fri, 9 Jul 2010 14:02:57 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o69E2vTF054306; Fri, 9 Jul 2010 14:02:57 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007091402.o69E2vTF054306@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 9 Jul 2010 14:02: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: r209852 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 14:02:57 -0000 Author: nwhitehorn Date: Fri Jul 9 14:02:57 2010 New Revision: 209852 URL: http://svn.freebsd.org/changeset/base/209852 Log: Remove an unnecessary include of opt_psim.h, which is not present on powerpc64. Modified: head/sys/powerpc/aim/nexus.c Modified: head/sys/powerpc/aim/nexus.c ============================================================================== --- head/sys/powerpc/aim/nexus.c Fri Jul 9 14:02:24 2010 (r209851) +++ head/sys/powerpc/aim/nexus.c Fri Jul 9 14:02:57 2010 (r209852) @@ -54,7 +54,6 @@ * * $FreeBSD$ */ -#include "opt_psim.h" #include #include From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 14:04:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47AB41065673; Fri, 9 Jul 2010 14:04:17 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37BC18FC08; Fri, 9 Jul 2010 14:04:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o69E4H82054639; Fri, 9 Jul 2010 14:04:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o69E4H2d054637; Fri, 9 Jul 2010 14:04:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007091404.o69E4H2d054637@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 9 Jul 2010 14:04: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: r209853 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 14:04:17 -0000 Author: nwhitehorn Date: Fri Jul 9 14:04:16 2010 New Revision: 209853 URL: http://svn.freebsd.org/changeset/base/209853 Log: The number after 2 is 3, not 4. MFC after: 3 days Modified: head/sys/powerpc/aim/platform_chrp.c Modified: head/sys/powerpc/aim/platform_chrp.c ============================================================================== --- head/sys/powerpc/aim/platform_chrp.c Fri Jul 9 14:02:57 2010 (r209852) +++ head/sys/powerpc/aim/platform_chrp.c Fri Jul 9 14:04:16 2010 (r209853) @@ -241,7 +241,7 @@ chrp_smp_start_cpu(platform_t plat, stru case 2: reset += 0x0f; break; - case 4: + case 3: reset += 0x10; break; default: From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 15:04:17 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C249B1065680; Fri, 9 Jul 2010 15:04:17 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from mail-gw2.york.ac.uk (mail-gw2.york.ac.uk [144.32.128.247]) by mx1.freebsd.org (Postfix) with ESMTP id 532F68FC12; Fri, 9 Jul 2010 15:04:16 +0000 (UTC) Received: from mail-gw7.york.ac.uk (mail-gw7.york.ac.uk [144.32.129.30]) by mail-gw2.york.ac.uk (8.13.6/8.13.6) with ESMTP id o69F4Dai009808; Fri, 9 Jul 2010 16:04:13 +0100 (BST) Received: from buffy-128.york.ac.uk ([144.32.128.160] helo=buffy.york.ac.uk) by mail-gw7.york.ac.uk with esmtps (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1OXF7d-0005V1-Fa; Fri, 09 Jul 2010 16:04:13 +0100 Received: from buffy.york.ac.uk (localhost [127.0.0.1]) by buffy.york.ac.uk (8.14.4/8.14.4) with ESMTP id o69F4D5r026140; Fri, 9 Jul 2010 16:04:13 +0100 (BST) (envelope-from gavin@FreeBSD.org) Received: (from ga9@localhost) by buffy.york.ac.uk (8.14.4/8.14.4/Submit) id o69F4Dt3026139; Fri, 9 Jul 2010 16:04:13 +0100 (BST) (envelope-from gavin@FreeBSD.org) X-Authentication-Warning: buffy.york.ac.uk: ga9 set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson To: Randi Harper In-Reply-To: <201007082126.o68LQQx1032102@svn.freebsd.org> References: <201007082126.o68LQQx1032102@svn.freebsd.org> Content-Type: text/plain; charset="ASCII" Content-Transfer-Encoding: quoted-printable Date: Fri, 09 Jul 2010 16:04:12 +0100 Message-ID: <1278687852.109.4.camel@buffy.york.ac.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 FreeBSD GNOME Team Port X-York-MailScanner: Found to be clean X-York-MailScanner-From: gavin@freebsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r209832 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 15:04:17 -0000 On Thu, 2010-07-08 at 21:26 +0000, Randi Harper wrote: > Author: randi > Date: Thu Jul 8 21:26:26 2010 > New Revision: 209832 > URL: http://svn.freebsd.org/changeset/base/209832 >=20 > Log: > Revert r209787 pending further discussion. > =20 > Approved by: cperciva (mentor) Thank you. Gaivn From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 17:11:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CD1A106564A; Fri, 9 Jul 2010 17:11:30 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CA258FC14; Fri, 9 Jul 2010 17:11:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o69HBUpp096888; Fri, 9 Jul 2010 17:11:30 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o69HBUDP096886; Fri, 9 Jul 2010 17:11:30 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201007091711.o69HBUDP096886@svn.freebsd.org> From: Jack F Vogel Date: Fri, 9 Jul 2010 17: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: r209859 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 17:11:30 -0000 Author: jfv Date: Fri Jul 9 17:11:29 2010 New Revision: 209859 URL: http://svn.freebsd.org/changeset/base/209859 Log: Fix of a VLAN problem by jhb, the checksum capability got lost along the way. MFC: asap Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri Jul 9 16:19:51 2010 (r209858) +++ head/sys/dev/e1000/if_igb.c Fri Jul 9 17:11:29 2010 (r209859) @@ -2679,7 +2679,7 @@ igb_setup_interface(device_t dev, struct ifp->if_capabilities = ifp->if_capenable = 0; - ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_MTU; + ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM; ifp->if_capabilities |= IFCAP_TSO4; ifp->if_capabilities |= IFCAP_JUMBO_MTU; if (igb_header_split) From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 17:38:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 100B71065672; Fri, 9 Jul 2010 17:38:16 +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 F3BCF8FC24; Fri, 9 Jul 2010 17:38:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o69HcFiZ002939; Fri, 9 Jul 2010 17:38:15 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o69HcFDA002936; Fri, 9 Jul 2010 17:38:15 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201007091738.o69HcFDA002936@svn.freebsd.org> From: Xin LI Date: Fri, 9 Jul 2010 17:38: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: r209860 - head/sys/dev/twa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 17:38:16 -0000 Author: delphij Date: Fri Jul 9 17:38:15 2010 New Revision: 209860 URL: http://svn.freebsd.org/changeset/base/209860 Log: Don't use pack() for structures that is used purely for software state. Otherwise the resulting, unaligned mutex structure would trigger panic. Submitted by: Tom Cough Reported/Tested by: jhb MFC after: 3 days Modified: head/sys/dev/twa/tw_cl.h head/sys/dev/twa/tw_cl_share.h Modified: head/sys/dev/twa/tw_cl.h ============================================================================== --- head/sys/dev/twa/tw_cl.h Fri Jul 9 17:11:29 2010 (r209859) +++ head/sys/dev/twa/tw_cl.h Fri Jul 9 17:38:15 2010 (r209860) @@ -74,7 +74,6 @@ #define TW_CLI_PCI_CONFIG_STATUS_OFFSET 0x6 /* status register offset */ #endif /* TW_OSL_PCI_CONFIG_ACCESSIBLE */ -#pragma pack(1) #ifdef TW_OSL_DEBUG struct tw_cli_q_stats { @@ -206,7 +205,6 @@ struct tw_cli_ctlr_context { #endif /* TW_OSL_DEBUG */ }; -#pragma pack() /* Modified: head/sys/dev/twa/tw_cl_share.h ============================================================================== --- head/sys/dev/twa/tw_cl_share.h Fri Jul 9 17:11:29 2010 (r209859) +++ head/sys/dev/twa/tw_cl_share.h Fri Jul 9 17:38:15 2010 (r209860) @@ -125,7 +125,6 @@ #define TW_CL_SEVERITY_DEBUG_STRING "DEBUG" -#pragma pack(1) /* * Structure, a pointer to which is used as the controller handle in @@ -190,6 +189,7 @@ struct tw_cl_req_packet { }; +#pragma pack(1) /* * Packet that describes an AEN/error generated by the controller, * Common Layer, or even the OS Layer. @@ -206,6 +206,7 @@ struct tw_cl_event_packet { TW_UINT32 event_src; TW_UINT8 severity_str[20]; }; +#pragma pack() /* Structure to link 2 adjacent elements in a list. */ @@ -215,6 +216,7 @@ struct tw_cl_link { }; +#pragma pack(1) /* Scatter/Gather list entry with 32 bit addresses. */ struct tw_cl_sg_desc32 { TW_UINT32 address; From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 19:38:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BADC9106564A; Fri, 9 Jul 2010 19:38:30 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F3818FC16; Fri, 9 Jul 2010 19:38:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o69JcUVT029194; Fri, 9 Jul 2010 19:38:30 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o69JcUII029190; Fri, 9 Jul 2010 19:38:30 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201007091938.o69JcUII029190@svn.freebsd.org> From: Alan Cox Date: Fri, 9 Jul 2010 19:38: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: r209861 - in head/sys: kern vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 19:38:30 -0000 Author: alc Date: Fri Jul 9 19:38:30 2010 New Revision: 209861 URL: http://svn.freebsd.org/changeset/base/209861 Log: Add support for the VM_ALLOC_COUNT() hint to vm_page_alloc(). Consequently, the maintenance of vm_pageout_deficit can be localized to just two places: vm_page_alloc() and vm_pageout_scan(). This change also corrects an off-by-one error in the maintenance of vm_pageout_deficit. Historically, the buffer cache functions, allocbuf() and vm_hold_load_pages(), have not taken into account that vm_page_alloc() already increments vm_pageout_deficit by one. Reviewed by: kib Modified: head/sys/kern/vfs_bio.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Jul 9 17:38:15 2010 (r209860) +++ head/sys/kern/vfs_bio.c Fri Jul 9 19:38:30 2010 (r209861) @@ -3752,10 +3752,9 @@ tryagain: * process we are. */ p = vm_page_alloc(NULL, pg >> PAGE_SHIFT, VM_ALLOC_NOOBJ | - VM_ALLOC_SYSTEM | VM_ALLOC_WIRED); + VM_ALLOC_SYSTEM | VM_ALLOC_WIRED | + VM_ALLOC_COUNT((to - pg) >> PAGE_SHIFT)); if (!p) { - atomic_add_int(&vm_pageout_deficit, - (to - pg) >> PAGE_SHIFT); VM_WAIT; goto tryagain; } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Jul 9 17:38:15 2010 (r209860) +++ head/sys/vm/vm_page.c Fri Jul 9 19:38:30 2010 (r209861) @@ -1264,7 +1264,8 @@ vm_page_alloc(vm_object_t object, vm_pin * Not allocatable, give up. */ mtx_unlock(&vm_page_queue_free_mtx); - atomic_add_int(&vm_pageout_deficit, 1); + atomic_add_int(&vm_pageout_deficit, + MAX((u_int)req >> VM_ALLOC_COUNT_SHIFT, 1)); pagedaemon_wakeup(); return (NULL); } @@ -2041,7 +2042,6 @@ vm_page_t vm_page_grab(vm_object_t object, vm_pindex_t pindex, int allocflags) { vm_page_t m; - u_int count; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); KASSERT((allocflags & VM_ALLOC_RETRY) != 0, @@ -2071,12 +2071,9 @@ retrylookup: } } m = vm_page_alloc(object, pindex, allocflags & ~(VM_ALLOC_RETRY | - VM_ALLOC_IGN_SBUSY | VM_ALLOC_COUNT_MASK)); + VM_ALLOC_IGN_SBUSY)); if (m == NULL) { VM_OBJECT_UNLOCK(object); - count = (u_int)allocflags >> VM_ALLOC_COUNT_SHIFT; - if (count > 0) - atomic_add_int(&vm_pageout_deficit, count); VM_WAIT; VM_OBJECT_LOCK(object); goto retrylookup; Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Fri Jul 9 17:38:15 2010 (r209860) +++ head/sys/vm/vm_page.h Fri Jul 9 19:38:30 2010 (r209861) @@ -321,7 +321,6 @@ extern struct vpglocks vm_page_queue_loc #define VM_ALLOC_COUNT_SHIFT 16 #define VM_ALLOC_COUNT(count) ((count) << VM_ALLOC_COUNT_SHIFT) -#define VM_ALLOC_COUNT_MASK VM_ALLOC_COUNT(0xffff) void vm_page_flag_set(vm_page_t m, unsigned short bits); void vm_page_flag_clear(vm_page_t m, unsigned short bits); From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 20:05:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4B41106578B; Fri, 9 Jul 2010 20:05:56 +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 D30D58FC0A; Fri, 9 Jul 2010 20:05:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o69K5uHb035242; Fri, 9 Jul 2010 20:05:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o69K5uQ5035237; Fri, 9 Jul 2010 20:05:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201007092005.o69K5uQ5035237@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 9 Jul 2010 20:05: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: r209862 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 20:05:57 -0000 Author: kib Date: Fri Jul 9 20:05:56 2010 New Revision: 209862 URL: http://svn.freebsd.org/changeset/base/209862 Log: For both i386 and amd64 pmap, - change the type of pm_active to cpumask_t, which it is; - in pmap_remove_pages(), compare with PCPU(curpmap), instead of dereferencing the long chain of pointers [1]. For amd64 pmap, remove the unneeded checks for validity of curpmap in pmap_activate(), since curpmap should be always valid after r209789. Submitted by: alc [1] Reviewed by: alc MFC after: 3 weeks Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/include/pmap.h head/sys/i386/i386/pmap.c head/sys/i386/include/pmap.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Jul 9 19:38:30 2010 (r209861) +++ head/sys/amd64/amd64/pmap.c Fri Jul 9 20:05:56 2010 (r209862) @@ -4018,7 +4018,7 @@ pmap_remove_pages(pmap_t pmap) uint64_t inuse, bitmask; int allfree; - if (pmap != vmspace_pmap(curthread->td_proc->p_vmspace)) { + if (pmap != PCPU_GET(curpmap)) { printf("warning: pmap_remove_pages called with non-current pmap\n"); return; } @@ -4998,11 +4998,9 @@ pmap_activate(struct thread *td) pmap = vmspace_pmap(td->td_proc->p_vmspace); oldpmap = PCPU_GET(curpmap); #ifdef SMP -if (oldpmap) /* XXX FIXME */ atomic_clear_int(&oldpmap->pm_active, PCPU_GET(cpumask)); atomic_set_int(&pmap->pm_active, PCPU_GET(cpumask)); #else -if (oldpmap) /* XXX FIXME */ oldpmap->pm_active &= ~PCPU_GET(cpumask); pmap->pm_active |= PCPU_GET(cpumask); #endif Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Fri Jul 9 19:38:30 2010 (r209861) +++ head/sys/amd64/include/pmap.h Fri Jul 9 20:05:56 2010 (r209862) @@ -244,7 +244,7 @@ struct pmap { struct mtx pm_mtx; pml4_entry_t *pm_pml4; /* KVA of level 4 page table */ TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */ - u_int pm_active; /* active on cpus */ + cpumask_t pm_active; /* active on cpus */ uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ u_int pm_retries; /* spare u_int here due to padding */ Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Fri Jul 9 19:38:30 2010 (r209861) +++ head/sys/i386/i386/pmap.c Fri Jul 9 20:05:56 2010 (r209862) @@ -4180,7 +4180,7 @@ pmap_remove_pages(pmap_t pmap) uint32_t inuse, bitmask; int allfree; - if (pmap != vmspace_pmap(curthread->td_proc->p_vmspace)) { + if (pmap != PCPU_GET(curpmap)) { printf("warning: pmap_remove_pages called with non-current pmap\n"); return; } Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Fri Jul 9 19:38:30 2010 (r209861) +++ head/sys/i386/include/pmap.h Fri Jul 9 20:05:56 2010 (r209862) @@ -417,7 +417,7 @@ struct pmap { struct mtx pm_mtx; pd_entry_t *pm_pdir; /* KVA of page directory */ TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */ - u_int pm_active; /* active on cpus */ + cpumask_t pm_active; /* active on cpus */ struct pmap_statistics pm_stats; /* pmap statistics */ LIST_ENTRY(pmap) pm_list; /* List of all pmaps */ uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 20:43:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F136106566C; Fri, 9 Jul 2010 20:43:59 +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 1D5758FC0A; Fri, 9 Jul 2010 20:43:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o69KhvZ0043623; Fri, 9 Jul 2010 20:43:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o69Khvbc043622; Fri, 9 Jul 2010 20:43:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201007092043.o69Khvbc043622@svn.freebsd.org> From: Xin LI Date: Fri, 9 Jul 2010 20:43:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209863 - stable/7/sys/dev/twa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 20:43:59 -0000 Author: delphij Date: Fri Jul 9 20:43:57 2010 New Revision: 209863 URL: http://svn.freebsd.org/changeset/base/209863 Log: MFC r209860: Don't use pack() for structures that is used purely for software state. Otherwise the resulting, unaligned mutex structure would trigger panic. Submitted by: Tom Cough Reported/Tested by: jhb PR: kern/148464 Modified: stable/7/sys/dev/twa/tw_cl.h stable/7/sys/dev/twa/tw_cl_share.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/twa/tw_cl.h ============================================================================== --- stable/7/sys/dev/twa/tw_cl.h Fri Jul 9 20:05:56 2010 (r209862) +++ stable/7/sys/dev/twa/tw_cl.h Fri Jul 9 20:43:57 2010 (r209863) @@ -74,7 +74,6 @@ #define TW_CLI_PCI_CONFIG_STATUS_OFFSET 0x6 /* status register offset */ #endif /* TW_OSL_PCI_CONFIG_ACCESSIBLE */ -#pragma pack(1) #ifdef TW_OSL_DEBUG struct tw_cli_q_stats { @@ -206,7 +205,6 @@ struct tw_cli_ctlr_context { #endif /* TW_OSL_DEBUG */ }; -#pragma pack() /* Modified: stable/7/sys/dev/twa/tw_cl_share.h ============================================================================== --- stable/7/sys/dev/twa/tw_cl_share.h Fri Jul 9 20:05:56 2010 (r209862) +++ stable/7/sys/dev/twa/tw_cl_share.h Fri Jul 9 20:43:57 2010 (r209863) @@ -125,7 +125,6 @@ #define TW_CL_SEVERITY_DEBUG_STRING "DEBUG" -#pragma pack(1) /* * Structure, a pointer to which is used as the controller handle in @@ -190,6 +189,7 @@ struct tw_cl_req_packet { }; +#pragma pack(1) /* * Packet that describes an AEN/error generated by the controller, * Common Layer, or even the OS Layer. @@ -206,6 +206,7 @@ struct tw_cl_event_packet { TW_UINT32 event_src; TW_UINT8 severity_str[20]; }; +#pragma pack() /* Structure to link 2 adjacent elements in a list. */ @@ -215,6 +216,7 @@ struct tw_cl_link { }; +#pragma pack(1) /* Scatter/Gather list entry with 32 bit addresses. */ struct tw_cl_sg_desc32 { TW_UINT32 address; From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 20:44:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9452110656C7; Fri, 9 Jul 2010 20:44:14 +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 6983F8FC1C; Fri, 9 Jul 2010 20:44:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o69KiEY3043740; Fri, 9 Jul 2010 20:44:14 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o69KiEbU043737; Fri, 9 Jul 2010 20:44:14 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201007092044.o69KiEbU043737@svn.freebsd.org> From: Xin LI Date: Fri, 9 Jul 2010 20:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209864 - stable/8/sys/dev/twa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 20:44:14 -0000 Author: delphij Date: Fri Jul 9 20:44:14 2010 New Revision: 209864 URL: http://svn.freebsd.org/changeset/base/209864 Log: MFC r209860: Don't use pack() for structures that is used purely for software state. Otherwise the resulting, unaligned mutex structure would trigger panic. Submitted by: Tom Cough Reported/Tested by: jhb Modified: stable/8/sys/dev/twa/tw_cl.h stable/8/sys/dev/twa/tw_cl_share.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/twa/tw_cl.h ============================================================================== --- stable/8/sys/dev/twa/tw_cl.h Fri Jul 9 20:43:57 2010 (r209863) +++ stable/8/sys/dev/twa/tw_cl.h Fri Jul 9 20:44:14 2010 (r209864) @@ -74,7 +74,6 @@ #define TW_CLI_PCI_CONFIG_STATUS_OFFSET 0x6 /* status register offset */ #endif /* TW_OSL_PCI_CONFIG_ACCESSIBLE */ -#pragma pack(1) #ifdef TW_OSL_DEBUG struct tw_cli_q_stats { @@ -206,7 +205,6 @@ struct tw_cli_ctlr_context { #endif /* TW_OSL_DEBUG */ }; -#pragma pack() /* Modified: stable/8/sys/dev/twa/tw_cl_share.h ============================================================================== --- stable/8/sys/dev/twa/tw_cl_share.h Fri Jul 9 20:43:57 2010 (r209863) +++ stable/8/sys/dev/twa/tw_cl_share.h Fri Jul 9 20:44:14 2010 (r209864) @@ -125,7 +125,6 @@ #define TW_CL_SEVERITY_DEBUG_STRING "DEBUG" -#pragma pack(1) /* * Structure, a pointer to which is used as the controller handle in @@ -190,6 +189,7 @@ struct tw_cl_req_packet { }; +#pragma pack(1) /* * Packet that describes an AEN/error generated by the controller, * Common Layer, or even the OS Layer. @@ -206,6 +206,7 @@ struct tw_cl_event_packet { TW_UINT32 event_src; TW_UINT8 severity_str[20]; }; +#pragma pack() /* Structure to link 2 adjacent elements in a list. */ @@ -215,6 +216,7 @@ struct tw_cl_link { }; +#pragma pack(1) /* Scatter/Gather list entry with 32 bit addresses. */ struct tw_cl_sg_desc32 { TW_UINT32 address; From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 20:48:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7DED1065673; Fri, 9 Jul 2010 20:48:48 +0000 (UTC) (envelope-from pgollucci@p6m7g8.com) Received: from cell.p6m7g8.net (static-71-178-236-107.washdc.fios.verizon.net [71.178.236.107]) by mx1.freebsd.org (Postfix) with ESMTP id 2EB298FC1A; Fri, 9 Jul 2010 20:48:47 +0000 (UTC) Received: from philip.hq.rws (wsip-174-79-184-239.dc.dc.cox.net [174.79.184.239]) (authenticated bits=0) by cell.p6m7g8.net (8.14.4/8.14.3) with ESMTP id o69KQO28047698 (version=TLSv1/SSLv3 cipher=DHE-DSS-CAMELLIA256-SHA bits=256 verify=NO); Fri, 9 Jul 2010 20:26:24 GMT (envelope-from pgollucci@p6m7g8.com) Message-ID: <4C3785E5.6040109@p6m7g8.com> Date: Fri, 09 Jul 2010 20:26:13 +0000 From: "Philip M. Gollucci" Organization: P6M7G8 Inc. User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100607 Thunderbird/3.0.4 MIME-Version: 1.0 To: Konstantin Belousov References: <201007092005.o69K5uQ5035237@svn.freebsd.org> In-Reply-To: <201007092005.o69K5uQ5035237@svn.freebsd.org> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,RDNS_DYNAMIC autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on cell.p6m7g8.net Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209862 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 20:48:48 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > - u_int pm_active; /* active on cpus */ > + cpumask_t pm_active; /* active on cpus */ minor whitespace glitch. - -- - ------------------------------------------------------------------------ 1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70 3F8C 75B8 8FFB DB9B 8C1C Philip M. Gollucci (pgollucci@p6m7g8.com) c: 703.336.9354 VP Apache Infrastructure; Member, Apache Software Foundation Committer, FreeBSD Foundation Consultant, P6M7G8 Inc. Sr. System Admin, Ridecharge Inc. Work like you don't need the money, love like you'll never get hurt, and dance like nobody's watching. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iD8DBQFMN4XkdbiP+9ubjBwRAivXAJ9EcezmHAi3DvXGLXaC5Y71ff6M/gCgi3xV 8miwwuL166tq7UG3u790iUU= =xmPw -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 21:06:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7731106567A; Fri, 9 Jul 2010 21:06:58 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 92B6D8FC26; Fri, 9 Jul 2010 21:06:58 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 97F0F1FFC34; Fri, 9 Jul 2010 21:06:57 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 02D9B84531; Fri, 9 Jul 2010 23:04:44 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Gabor Kovesdan References: <201007080328.o683SP5k089410@svn.freebsd.org> <4C358891.5010502@FreeBSD.org> Date: Fri, 09 Jul 2010 23:04:44 +0200 In-Reply-To: <4C358891.5010502@FreeBSD.org> (Gabor Kovesdan's message of "Thu, 08 Jul 2010 10:13:05 +0200") Message-ID: <86lj9kicyb.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (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, Randi Harper Subject: Re: svn commit: r209787 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 21:06:58 -0000 Gabor Kovesdan writes: > First I tried freebsd-update but it [...] was unable to produce any > sensual error message=20 Frankly, I'd be more worried if it had *succeeded* to produce sensual error messages. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 21:21:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD3AF106566C; Fri, 9 Jul 2010 21:21:08 +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 A32438FC1A; Fri, 9 Jul 2010 21:21:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o69LL8mt051797; Fri, 9 Jul 2010 21:21:08 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o69LL86I051795; Fri, 9 Jul 2010 21:21:08 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201007092121.o69LL86I051795@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 9 Jul 2010 21:21: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: r209865 - head/sys/dev/sk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 21:21:08 -0000 Author: yongari Date: Fri Jul 9 21:21:08 2010 New Revision: 209865 URL: http://svn.freebsd.org/changeset/base/209865 Log: Some revision of Yukon controller generates corrupted frame when TX checksum offloading is enabled. The frame has a valid checksum value so payload might be modified during TX checksum calculation. Disable TX checksum offloading but give users chance to enable it when they know their controller works without problems with TX checksum offloading. Reported by: Andrzej Tobola iem dot pw dot edu dot pl> Modified: head/sys/dev/sk/if_sk.c Modified: head/sys/dev/sk/if_sk.c ============================================================================== --- head/sys/dev/sk/if_sk.c Fri Jul 9 20:44:14 2010 (r209864) +++ head/sys/dev/sk/if_sk.c Fri Jul 9 21:21:08 2010 (r209865) @@ -1169,14 +1169,17 @@ sk_ioctl(ifp, command, data) break; } mask = ifr->ifr_reqcap ^ ifp->if_capenable; - if (mask & IFCAP_HWCSUM) { - ifp->if_capenable ^= IFCAP_HWCSUM; - if (IFCAP_HWCSUM & ifp->if_capenable && - IFCAP_HWCSUM & ifp->if_capabilities) - ifp->if_hwassist = SK_CSUM_FEATURES; + if ((mask & IFCAP_TXCSUM) != 0 && + (IFCAP_TXCSUM & ifp->if_capabilities) != 0) { + ifp->if_capenable ^= IFCAP_TXCSUM; + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) + ifp->if_hwassist |= SK_CSUM_FEATURES; else - ifp->if_hwassist = 0; + ifp->if_hwassist &= ~SK_CSUM_FEATURES; } + if ((mask & IFCAP_RXCSUM) != 0 && + (IFCAP_RXCSUM & ifp->if_capabilities) != 0) + ifp->if_capenable ^= IFCAP_RXCSUM; SK_IF_UNLOCK(sc_if); break; default: @@ -1363,13 +1366,23 @@ sk_attach(dev) * SK_GENESIS has a bug in checksum offload - From linux. */ if (sc_if->sk_softc->sk_type != SK_GENESIS) { - ifp->if_capabilities = IFCAP_HWCSUM; - ifp->if_hwassist = SK_CSUM_FEATURES; + ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_RXCSUM; + ifp->if_hwassist = 0; } else { ifp->if_capabilities = 0; ifp->if_hwassist = 0; } ifp->if_capenable = ifp->if_capabilities; + /* + * Some revision of Yukon controller generates corrupted + * frame when TX checksum offloading is enabled. The + * frame has a valid checksum value so payload might be + * modified during TX checksum calculation. Disable TX + * checksum offloading but give users chance to enable it + * when they know their controller works without problems + * with TX checksum offloading. + */ + ifp->if_capenable &= ~IFCAP_TXCSUM; ifp->if_ioctl = sk_ioctl; ifp->if_start = sk_start; ifp->if_init = sk_init; From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 21:25:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5159F106566B; Fri, 9 Jul 2010 21:25:00 +0000 (UTC) (envelope-from sektie@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id ABEAC8FC1A; Fri, 9 Jul 2010 21:24:59 +0000 (UTC) Received: by qwg5 with SMTP id 5so731628qwg.13 for ; Fri, 09 Jul 2010 14:24:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=dZ4kWaqRrr5jk/Fe9vhlDJm3f2i0fxawwgE32z4sAfw=; b=DK/3SrQRRKoMShxDxDeB9H+SEEJit3zY7NBn/Q8WzVFlXb0h15uJ05cN+tot7WW6VZ QQ6QqA2LDeR0ivNYLy5ThpjfOMoaK95d8i+HQYK/5XotN4hQaclgVmtklvcy4uds5b+V 1MjefzKIkCgkNeFhDS0g5kgxmmBXy8xOjAtXg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=ZceNut0dOiDT4etRj8l7R1wq8kBBb8oICIowYb0EDZRpihtmlCgxTqYVH9VXPbkG2N K6RNGQfn/WMqdycJdkrBTuL9631AFGT7pU0kUmbl3RhHvmfUme73JoKmpo/QnGjrNLo6 4rviulv4vPTHgP/cIE2VPt1Coif++Q87ldo+4= MIME-Version: 1.0 Received: by 10.224.96.71 with SMTP id g7mr5888295qan.307.1278710686792; Fri, 09 Jul 2010 14:24:46 -0700 (PDT) Sender: sektie@gmail.com Received: by 10.220.174.42 with HTTP; Fri, 9 Jul 2010 14:24:46 -0700 (PDT) In-Reply-To: <86lj9kicyb.fsf@ds4.des.no> References: <201007080328.o683SP5k089410@svn.freebsd.org> <4C358891.5010502@FreeBSD.org> <86lj9kicyb.fsf@ds4.des.no> Date: Fri, 9 Jul 2010 14:24:46 -0700 X-Google-Sender-Auth: RUgyyu2oqi0bSLSSkvFE4nkVgQk Message-ID: From: Randi Harper To: =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Gabor Kovesdan Subject: Re: svn commit: r209787 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 21:25:00 -0000 2010/7/9 Dag-Erling Sm=F8rgrav : > Gabor Kovesdan writes: >> First I tried freebsd-update but it [...] was unable to produce any >> sensual error message > > Frankly, I'd be more worried if it had *succeeded* to produce sensual > error messages. > Someone should file a PR. I demand sensual error messages from freebsd-update. :( -- randi From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 21:27:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1040106566B; Fri, 9 Jul 2010 21:27:42 +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 D066F8FC1A; Fri, 9 Jul 2010 21:27:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o69LRggi053520; Fri, 9 Jul 2010 21:27:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o69LRg6W053518; Fri, 9 Jul 2010 21:27:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201007092127.o69LRg6W053518@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 9 Jul 2010 21:27: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: r209866 - head/sys/i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 21:27:43 -0000 Author: kib Date: Fri Jul 9 21:27:42 2010 New Revision: 209866 URL: http://svn.freebsd.org/changeset/base/209866 Log: Fix spacing. Noted by: pgollucci MFC after: 3 weeks Modified: head/sys/i386/include/pmap.h Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Fri Jul 9 21:21:08 2010 (r209865) +++ head/sys/i386/include/pmap.h Fri Jul 9 21:27:42 2010 (r209866) @@ -417,7 +417,7 @@ struct pmap { struct mtx pm_mtx; pd_entry_t *pm_pdir; /* KVA of page directory */ TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */ - cpumask_t pm_active; /* active on cpus */ + cpumask_t pm_active; /* active on cpus */ struct pmap_statistics pm_stats; /* pmap statistics */ LIST_ENTRY(pmap) pm_list; /* List of all pmaps */ uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 21:28:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4FB9106564A; Fri, 9 Jul 2010 21:28:35 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id 967578FC15; Fri, 9 Jul 2010 21:28:35 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id 9845B14DC00F; Fri, 9 Jul 2010 23:28:33 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id CxHh7K+Nb-BH; Fri, 9 Jul 2010 23:28:31 +0200 (CEST) Received: from [192.168.1.105] (catv-80-99-92-167.catv.broadband.hu [80.99.92.167]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id 0327814DBF62; Fri, 9 Jul 2010 23:28:30 +0200 (CEST) Message-ID: <4C379479.2030601@FreeBSD.org> Date: Fri, 09 Jul 2010 23:28:25 +0200 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-PT; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: Randi Harper References: <201007080328.o683SP5k089410@svn.freebsd.org> <4C358891.5010502@FreeBSD.org> <86lj9kicyb.fsf@ds4.des.no> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209787 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 21:28:36 -0000 Em 2010.07.09. 23:24, Randi Harper escreveu: > 2010/7/9 Dag-Erling Smørgrav: > >> Gabor Kovesdan writes: >> >>> First I tried freebsd-update but it [...] was unable to produce any >>> sensual error message >>> >> Frankly, I'd be more worried if it had *succeeded* to produce sensual >> error messages. >> >> > Someone should file a PR. I demand sensual error messages from > freebsd-update. :( > Ok, I now, bad English. :) You can add it to fortunes if you like it so much. :) Gabor From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 21:33:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0846D106566C; Fri, 9 Jul 2010 21:33:52 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 7AA2A8FC12; Fri, 9 Jul 2010 21:33:51 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id D759A1FFC33; Fri, 9 Jul 2010 21:33:49 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 39BE6846C2; Fri, 9 Jul 2010 23:31:37 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Alexey Dokuchaev References: <201007080328.o683SP5k089410@svn.freebsd.org> <4C358891.5010502@FreeBSD.org> <4C3591F5.2040401@freebsd.org> <20100708091532.GA5707@FreeBSD.org> Date: Fri, 09 Jul 2010 23:31:36 +0200 In-Reply-To: <20100708091532.GA5707@FreeBSD.org> (Alexey Dokuchaev's message of "Thu, 8 Jul 2010 09:15:32 +0000") Message-ID: <8639vse407.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Randi Harper , Gabor Kovesdan , Colin Percival , svn-src-head@freebsd.org Subject: Re: svn commit: r209787 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 21:33:52 -0000 Alexey Dokuchaev writes: > Colin Percival writes: > > But a more *sensual* message is probably not necessary. :-) > He'd probably meant sensitive. This is getting better and better... DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 21:36:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48660106564A; Fri, 9 Jul 2010 21:36:43 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id B76748FC18; Fri, 9 Jul 2010 21:36:42 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id 34D8814DC010; Fri, 9 Jul 2010 23:36:42 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 6IvKBdySDXJW; Fri, 9 Jul 2010 23:36:39 +0200 (CEST) Received: from [192.168.1.105] (catv-80-99-92-167.catv.broadband.hu [80.99.92.167]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id 8E0E914DBF62; Fri, 9 Jul 2010 23:36:39 +0200 (CEST) Message-ID: <4C379666.6010007@FreeBSD.org> Date: Fri, 09 Jul 2010 23:36:38 +0200 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-PT; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <201007080328.o683SP5k089410@svn.freebsd.org> <4C358891.5010502@FreeBSD.org> <4C3591F5.2040401@freebsd.org> <20100708091532.GA5707@FreeBSD.org> <8639vse407.fsf@ds4.des.no> In-Reply-To: <8639vse407.fsf@ds4.des.no> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, Randi Harper , Colin Percival , svn-src-head@freebsd.org Subject: Re: svn commit: r209787 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 21:36:43 -0000 Em 2010.07.09. 23:31, Dag-Erling Smørgrav escreveu: > Alexey Dokuchaev writes: > >> Colin Percival writes: >> >>> But a more *sensual* message is probably not necessary. :-) >>> >> He'd probably meant sensitive. >> > This is getting better and better... > Actually, I was trying to guess the English equivalent of Spanish word "sensato", which means something like "of common sense". According to wordreference, it should have been sensible, so both of us were wrong. :) Gabor From owner-svn-src-all@FreeBSD.ORG Fri Jul 9 23:22:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B34AE1065673; Fri, 9 Jul 2010 23:22:49 +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 577958FC21; Fri, 9 Jul 2010 23:22:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o69NH3T6097248; Fri, 9 Jul 2010 17:17:03 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 09 Jul 2010 17:17:22 -0600 (MDT) Message-Id: <20100709.171722.575506241400307165.imp@bsdimp.com> To: dougb@freebsd.org From: "M. Warner Losh" In-Reply-To: References: <4C36430E.4030504@FreeBSD.org> X-Mailer: Mew version 6.3 on Emacs 22.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, src-committers@freebsd.org, gabor@freebsd.org, randi@freebsd.org Subject: Re: svn commit: r209832 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 23:22:49 -0000 In message: Doug Barton writes: : On Thu, 8 Jul 2010, Randi Harper wrote: : = : > On Thu, Jul 8, 2010 at 2:28 PM, Gabor Kovesdan : > wrote: : >> Em 2010.07.08. 23:26, Randi Harper escreveu: : >>> : >>> Author: randi : >>> Date: Thu Jul =A08 21:26:26 2010 : >>> New Revision: 209832 : >>> URL: http://svn.freebsd.org/changeset/base/209832 : >>> : >>> Log: : >>> =A0 Revert r209787 pending further discussion. : >>> : >>> =A0 Approved by: cperciva (mentor) : >>> : >> : >> Thanks! As I mentioned on IRC, I'll also try to improve this featu= re, : >> I'm : >> just very busy with other projects at the moment. : = : Unfortunately the road to the current sysinstall hell was paved with : just such good intentions. My suggestion is that we all get out of th= e : way of the people who are, actually, DOING the work. :) For this specific option, however, what harm would there be in leaving well enough alone? Or, failing that, adding "(experts only)" to it? : > As was mentioned on IRC, I think a good stopgap would be to at leas= t : > remove the upgrade option from the main menu. It's not really an : > acceptable form of upgrade, it doesn't do an intelligent merging of= : > config files. It would be better placed in the Fixit submenu if we'= re : > going to be leaving it around for a while and renaming it to someth= ing : > like "Mangle My Filesystem". :P : = : Sounds like a better option would be to just remove it from the menu : altogether and ifdef 0 the code. That way if $SOMEONE wants to step i= n : and fix the existing code within a reasonable period of time (6 month= s : or less?) then they will still have that option, but users won't : suffer in the meantime. In 6 months, I suspect there will be a very different field of play in the installer space. Warner From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 02:29:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 410011065670; Sat, 10 Jul 2010 02:29:23 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D8468FC1E; Sat, 10 Jul 2010 02:29:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6A2TN7p020868; Sat, 10 Jul 2010 02:29:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6A2TMkM020848; Sat, 10 Jul 2010 02:29:22 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007100229.o6A2TMkM020848@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 10 Jul 2010 02:29: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: r209867 - in head: contrib/binutils/bfd contrib/binutils/ld contrib/gcc/config/rs6000 contrib/gdb/gdb gnu/lib/csu gnu/lib/libgcc gnu/usr.bin/binutils/as gnu/usr.bin/binutils/as/powerpc6... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 02:29:23 -0000 Author: nwhitehorn Date: Sat Jul 10 02:29:22 2010 New Revision: 209867 URL: http://svn.freebsd.org/changeset/base/209867 Log: Teach our toolchain how to generate 64-bit PowerPC binaries. This fixes a variety of bugs in binutils related to handling of 64-bit PPC ELF, provides a GCC configuration for 64-bit PowerPC on FreeBSD, and associated build systems tweaks. Obtained from: projects/ppc64 Added: head/gnu/usr.bin/binutils/as/powerpc64-freebsd/ - copied from r209845, head/gnu/usr.bin/binutils/as/powerpc-freebsd/ head/gnu/usr.bin/binutils/gdb/Makefile.powerpc64 (contents, props changed) head/gnu/usr.bin/binutils/ld/Makefile.powerpc64 (contents, props changed) head/gnu/usr.bin/binutils/libbfd/Makefile.powerpc64 (contents, props changed) head/gnu/usr.bin/binutils/libopcodes/Makefile.powerpc64 - copied unchanged from r209845, head/gnu/usr.bin/binutils/libopcodes/Makefile.powerpc head/gnu/usr.bin/gdb/arch/powerpc64/ - copied from r209845, head/gnu/usr.bin/gdb/arch/powerpc/ head/gnu/usr.bin/gdb/kgdb/trgt_powerpc64.c - copied, changed from r209845, head/gnu/usr.bin/gdb/kgdb/trgt_powerpc.c Modified: head/contrib/binutils/bfd/elf64-ppc.c head/contrib/binutils/ld/lexsup.c head/contrib/gcc/config/rs6000/freebsd.h head/contrib/gdb/gdb/ppcfbsd-tdep.c head/contrib/gdb/gdb/solib-svr4.c head/gnu/lib/csu/Makefile head/gnu/lib/libgcc/Makefile head/gnu/usr.bin/binutils/as/Makefile head/gnu/usr.bin/binutils/gdb/Makefile head/gnu/usr.bin/binutils/libbfd/Makefile head/gnu/usr.bin/cc/Makefile.tgt head/gnu/usr.bin/cc/cc_tools/Makefile head/gnu/usr.bin/cc/include/Makefile head/gnu/usr.bin/gdb/arch/powerpc64/config.h Modified: head/contrib/binutils/bfd/elf64-ppc.c ============================================================================== --- head/contrib/binutils/bfd/elf64-ppc.c Fri Jul 9 21:27:42 2010 (r209866) +++ head/contrib/binutils/bfd/elf64-ppc.c Sat Jul 10 02:29:22 2010 (r209867) @@ -3268,13 +3268,13 @@ create_got_section (bfd *abfd, struct bf flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); - got = bfd_make_section (abfd, ".got"); + got = bfd_make_section_anyway (abfd, ".got"); if (!got || !bfd_set_section_flags (abfd, got, flags) || !bfd_set_section_alignment (abfd, got, 3)) return FALSE; - relgot = bfd_make_section (abfd, ".rela.got"); + relgot = bfd_make_section_anyway (abfd, ".rela.got"); if (!relgot || ! bfd_set_section_flags (abfd, relgot, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, relgot, 3)) @@ -6033,6 +6033,10 @@ ppc64_elf_size_dynamic_sections (bfd *ou for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) { + /* Skip this BFD if it is not ELF */ + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour) + continue; + s = ppc64_elf_tdata (ibfd)->got; if (s != NULL && s != htab->got) { @@ -7206,7 +7210,7 @@ ppc64_elf_build_stubs (bfd_boolean emit_ stub_sec->_cooked_size = 0; } - if (htab->plt != NULL) + if (htab->glink != NULL && htab->glink->contents != NULL) { unsigned int indx; bfd_vma plt0; @@ -9000,6 +9004,10 @@ ppc64_elf_finish_dynamic_sections (bfd * while ((dynobj = dynobj->link_next) != NULL) { asection *s; + + if (bfd_get_flavour (dynobj) != bfd_target_elf_flavour) + continue; + s = ppc64_elf_tdata (dynobj)->got; if (s != NULL && s->_raw_size != 0 Modified: head/contrib/binutils/ld/lexsup.c ============================================================================== --- head/contrib/binutils/ld/lexsup.c Fri Jul 9 21:27:42 2010 (r209866) +++ head/contrib/binutils/ld/lexsup.c Sat Jul 10 02:29:22 2010 (r209867) @@ -1145,8 +1145,11 @@ parse_args (unsigned argc, char **argv) whole_archive = TRUE; break; case OPTION_AS_NEEDED: +/* XXX: --as-needed is broken on powerpc64 */ +#ifndef __powerpc64__ as_needed = TRUE; break; +#endif case OPTION_NO_AS_NEEDED: as_needed = FALSE; break; Modified: head/contrib/gcc/config/rs6000/freebsd.h ============================================================================== --- head/contrib/gcc/config/rs6000/freebsd.h Fri Jul 9 21:27:42 2010 (r209866) +++ head/contrib/gcc/config/rs6000/freebsd.h Sat Jul 10 02:29:22 2010 (r209867) @@ -21,13 +21,86 @@ /* Override the defaults, which exist to force the proper definition. */ -#undef CPP_OS_DEFAULT_SPEC -#define CPP_OS_DEFAULT_SPEC "%(cpp_os_freebsd)" +#ifdef IN_LIBGCC2 +#undef TARGET_64BIT +#ifdef __powerpc64__ +#define TARGET_64BIT 1 +#else +#define TARGET_64BIT 0 +#endif +#endif + +/* On 64-bit systems, use the AIX ABI like Linux and NetBSD */ + +#undef DEFAULT_ABI +#define DEFAULT_ABI (TARGET_64BIT ? ABI_AIX : ABI_V4) +#undef TARGET_AIX +#define TARGET_AIX TARGET_64BIT + +#undef FBSD_TARGET_CPU_CPP_BUILTINS +#define FBSD_TARGET_CPU_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("__PPC__"); \ + builtin_define ("__ppc__"); \ + builtin_define ("__PowerPC__"); \ + builtin_define ("__powerpc__"); \ + if (TARGET_64BIT) \ + { \ + builtin_define ("__LP64__"); \ + builtin_define ("__ppc64__"); \ + builtin_define ("__powerpc64__"); \ + builtin_define ("__arch64__"); \ + builtin_assert ("cpu=powerpc64"); \ + builtin_assert ("machine=powerpc64"); \ + } else { \ + builtin_assert ("cpu=powerpc"); \ + builtin_assert ("machine=powerpc"); \ + } \ + } \ + while (0) + +#define INVALID_64BIT "-m%s not supported in this configuration" +#define INVALID_32BIT INVALID_64BIT + +#undef SUBSUBTARGET_OVERRIDE_OPTIONS +#define SUBSUBTARGET_OVERRIDE_OPTIONS \ + do \ + { \ + if (!rs6000_explicit_options.alignment) \ + rs6000_alignment_flags = MASK_ALIGN_NATURAL; \ + if (TARGET_64BIT) \ + { \ + if (DEFAULT_ABI != ABI_AIX) \ + { \ + rs6000_current_abi = ABI_AIX; \ + error (INVALID_64BIT, "call"); \ + } \ + dot_symbols = !strcmp (rs6000_abi_name, "aixdesc"); \ + if (target_flags & MASK_RELOCATABLE) \ + { \ + target_flags &= ~MASK_RELOCATABLE; \ + error (INVALID_64BIT, "relocatable"); \ + } \ + if (target_flags & MASK_EABI) \ + { \ + target_flags &= ~MASK_EABI; \ + error (INVALID_64BIT, "eabi"); \ + } \ + if (target_flags & MASK_PROTOTYPE) \ + { \ + target_flags &= ~MASK_PROTOTYPE; \ + error (INVALID_64BIT, "prototype"); \ + } \ + if ((target_flags & MASK_POWERPC64) == 0) \ + { \ + target_flags |= MASK_POWERPC64; \ + error ("64 bit CPU required"); \ + } \ + } \ + } \ + while (0) -#undef CPP_OS_FREEBSD_SPEC -#define CPP_OS_FREEBSD_SPEC "\ - -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ \ - -Acpu=powerpc -Amachine=powerpc " #undef STARTFILE_DEFAULT_SPEC #define STARTFILE_DEFAULT_SPEC "%(startfile_freebsd)" @@ -57,7 +130,10 @@ c-common.c, and config//.h. */ #undef SIZE_TYPE -#define SIZE_TYPE "unsigned int" +#define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "unsigned int") + +#undef PTRDIFF_TYPE +#define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int") /* rs6000.h gets this wrong for FreeBSD. We use the GCC defaults instead. */ #undef WCHAR_TYPE @@ -75,3 +151,95 @@ /* Override rs6000.h definition. */ #undef ASM_APP_OFF #define ASM_APP_OFF "#NO_APP\n" + +/* Tell the assembler we want 32/64-bit binaries if -m32 or -m64 is passed */ +#if (TARGET_DEFAULT & MASK_64BIT) +#define SVR4_ASM_SPEC "%(asm_cpu) \ +%{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \ +%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \ +%{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC} \ +%{memb|msdata|msdata=eabi: -memb} \ +%{mlittle|mlittle-endian:-mlittle; \ + mbig|mbig-endian :-mbig; \ + mcall-aixdesc | \ + mcall-freebsd | \ + mcall-netbsd | \ + mcall-openbsd | \ + mcall-linux | \ + mcall-gnu :-mbig; \ + mcall-i960-old :-mlittle}" +#define LINK_OS_FREEBSD_SPEC_DEF "\ + %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \ + %{v:-V} \ + %{assert*} %{R*} %{rpath*} %{defsym*} \ + %{shared:-Bshareable %{h*} %{soname*}} \ + %{!shared: \ + %{!static: \ + %{rdynamic: -export-dynamic} \ + %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} \ + %{static:-Bstatic}} \ + %{symbolic:-Bsymbolic}" + + +#undef ASM_DEFAULT_SPEC +#undef ASM_SPEC +#undef LINK_OS_FREEBSD_SPEC +#define ASM_DEFAULT_SPEC "-mppc%{!m32:64}" +#define ASM_SPEC "%{m32:-a32}%{!m32:-a64} " SVR4_ASM_SPEC +#define LINK_OS_FREEBSD_SPEC "%{m32:-melf32ppc}%{!m32:-melf64ppc} " LINK_OS_FREEBSD_SPEC_DEF +#endif + +/* _init and _fini functions are built from bits spread across many + object files, each potentially with a different TOC pointer. For + that reason, place a nop after the call so that the linker can + restore the TOC pointer if a TOC adjusting call stub is needed. */ +#ifdef __powerpc64__ +#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ + asm (SECTION_OP "\n" \ +" bl ." #FUNC "\n" \ +" nop\n" \ +" .previous"); +#endif + +/* __throw will restore its own return address to be the same as the + return address of the function that the throw is being made to. + This is unfortunate, because we want to check the original + return address to see if we need to restore the TOC. + So we have to squirrel it away with this. */ +#define SETUP_FRAME_ADDRESSES() \ + do { if (TARGET_64BIT) rs6000_aix_emit_builtin_unwind_init (); } while (0) + +/* Select a format to encode pointers in exception handling data. CODE + is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is + true if the symbol may be affected by dynamic relocations. */ +#undef ASM_PREFERRED_EH_DATA_FORMAT +#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \ + ((TARGET_64BIT || flag_pic || TARGET_RELOCATABLE) \ + ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel \ + | (TARGET_64BIT ? DW_EH_PE_udata8 : DW_EH_PE_sdata4)) \ + : DW_EH_PE_absptr) + +#define MD_FROB_UPDATE_CONTEXT(CTX, FS) \ + if (TARGET_64BIT) { \ + if ((FS)->regs.reg[2].how == REG_UNSAVED) \ + { \ + unsigned int *insn \ + = (unsigned int *) \ + _Unwind_GetGR ((CTX), LINK_REGISTER_REGNUM); \ + if (*insn == 0xE8410028) \ + _Unwind_SetGRPtr ((CTX), 2, (CTX)->cfa + 40); \ + } \ + } + +/* FreeBSD doesn't support saving and restoring 64-bit regs with a 32-bit + kernel. This is supported when running on a 64-bit kernel with + COMPAT_FREEBSD32, but tell GCC it isn't so that our 32-bit binaries + are compatible. */ +#define OS_MISSING_POWERPC64 !TARGET_64BIT + +/* Function profiling bits */ +#undef RS6000_MCOUNT +#define RS6000_MCOUNT ((TARGET_64BIT) ? "._mcount" : "_mcount") +#define PROFILE_HOOK(LABEL) \ + do { if (TARGET_64BIT) output_profile_hook (LABEL); } while (0) + Modified: head/contrib/gdb/gdb/ppcfbsd-tdep.c ============================================================================== --- head/contrib/gdb/gdb/ppcfbsd-tdep.c Fri Jul 9 21:27:42 2010 (r209866) +++ head/contrib/gdb/gdb/ppcfbsd-tdep.c Sat Jul 10 02:29:22 2010 (r209867) @@ -35,13 +35,13 @@ #include "gdb_assert.h" #include "solib-svr4.h" -#define REG_FIXREG_OFFSET(x) ((x) * 4) -#define REG_LR_OFFSET (32 * 4) -#define REG_CR_OFFSET (33 * 4) -#define REG_XER_OFFSET (34 * 4) -#define REG_CTR_OFFSET (35 * 4) -#define REG_PC_OFFSET (36 * 4) -#define SIZEOF_STRUCT_REG (37 * 4) +#define REG_FIXREG_OFFSET(x) ((x) * sizeof(register_t)) +#define REG_LR_OFFSET (32 * sizeof(register_t)) +#define REG_CR_OFFSET (33 * sizeof(register_t)) +#define REG_XER_OFFSET (34 * sizeof(register_t)) +#define REG_CTR_OFFSET (35 * sizeof(register_t)) +#define REG_PC_OFFSET (36 * sizeof(register_t)) +#define SIZEOF_STRUCT_REG (37 * sizeof(register_t)) #define FPREG_FPR_OFFSET(x) ((x) * 8) #define FPREG_FPSCR_OFFSET (32 * 8) @@ -274,8 +274,13 @@ ppcfbsd_init_abi (struct gdbarch_info in /* For NetBSD, this is an on again, off again thing. Some systems do use the broken struct convention, and some don't. */ set_gdbarch_return_value (gdbarch, ppcfbsd_return_value); +#ifdef __powerpc64__ + set_solib_svr4_fetch_link_map_offsets (gdbarch, + svr4_lp64_fetch_link_map_offsets); +#else set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets); +#endif } void Modified: head/contrib/gdb/gdb/solib-svr4.c ============================================================================== --- head/contrib/gdb/gdb/solib-svr4.c Fri Jul 9 21:27:42 2010 (r209866) +++ head/contrib/gdb/gdb/solib-svr4.c Sat Jul 10 02:29:22 2010 (r209867) @@ -94,6 +94,7 @@ static char *solib_break_names[] = into the data section (thus skipping the descriptor's symbol), and eventually try this one, giving us the real entry point address. */ + ".r_debug_state", "._dl_debug_state", NULL Modified: head/gnu/lib/csu/Makefile ============================================================================== --- head/gnu/lib/csu/Makefile Fri Jul 9 21:27:42 2010 (r209866) +++ head/gnu/lib/csu/Makefile Sat Jul 10 02:29:22 2010 (r209867) @@ -31,7 +31,7 @@ CFLAGS+= -x assembler-with-cpp # Ugly ha CFLAGS+= -include osreldate.h .undef SRCS # hack for 'make depend' .endif -.if ${MACHINE_ARCH} == "powerpc" +.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" TGTOBJS= crtsavres.o SRCS+= crtsavres.asm .endif Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Fri Jul 9 21:27:42 2010 (r209866) +++ head/gnu/lib/libgcc/Makefile Sat Jul 10 02:29:22 2010 (r209867) @@ -143,6 +143,11 @@ LIB2FUNCS_EXTRA = tramp.asm LIB2FUNCS_STATIC_EXTRA = eabi.asm .endif +.if ${TARGET_ARCH} == "powerpc64" +# from config/rs6000/t-ppccomm +LIB2FUNCS_EXTRA = tramp.asm +.endif + .if ${TARGET_ARCH} == "sparc64" # from config/sparc/t-elf LIB1ASMSRC = lb1spc.asm Modified: head/gnu/usr.bin/binutils/as/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/as/Makefile Fri Jul 9 21:27:42 2010 (r209866) +++ head/gnu/usr.bin/binutils/as/Makefile Sat Jul 10 02:29:22 2010 (r209867) @@ -26,7 +26,7 @@ SRCS+= itbl-ops.c itbl-parse.y itbl-lex. .if ${TARGET_ARCH} == "amd64" SRCS+= tc-i386.c -.elif ${TARGET_ARCH} == "powerpc" +.elif ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpc64" SRCS+= tc-ppc.c .elif ${TARGET_ARCH} == "sparc64" # change back to tc-sparc.c when new binutils is imported Modified: head/gnu/usr.bin/binutils/gdb/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/gdb/Makefile Fri Jul 9 21:27:42 2010 (r209866) +++ head/gnu/usr.bin/binutils/gdb/Makefile Sat Jul 10 02:29:22 2010 (r209867) @@ -12,6 +12,8 @@ GDBDIR= ${.CURDIR}/../../../../contrib/g GDB_CPU= sparc .elif ${TARGET_ARCH} == "amd64" GDB_CPU= i386 +.elif ${TARGET_ARCH} == "powerpc64" +GDB_CPU= powerpc .else GDB_CPU= ${TARGET_ARCH} .endif Added: head/gnu/usr.bin/binutils/gdb/Makefile.powerpc64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/binutils/gdb/Makefile.powerpc64 Sat Jul 10 02:29:22 2010 (r209867) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +XSRCS+= ppcnbsd-nat.c ppc-tdep.c \ + core-regset.c +CFLAGS+= -DDEFAULT_BFD_VEC=bfd_elf64_powerpc_vec Added: head/gnu/usr.bin/binutils/ld/Makefile.powerpc64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/binutils/ld/Makefile.powerpc64 Sat Jul 10 02:29:22 2010 (r209867) @@ -0,0 +1,29 @@ +# $FreeBSD$ + +NATIVE_EMULATION= elf64ppc + +SRCS+= e${NATIVE_EMULATION}.c +CLEANFILES+= e${NATIVE_EMULATION}.c +e${NATIVE_EMULATION}.c: emulparams/${NATIVE_EMULATION}.sh emultempl/elf32.em \ + scripttempl/elf.sc genscripts.sh stringify.sed + sh ${.CURDIR}/genscripts.sh ${SRCDIR}/ld ${LIBSERACHPATH} \ + ${TOOLS_PREFIX}/usr \ + ${HOST} ${TARGET_TUPLE} ${TARGET_TUPLE} \ + ${NATIVE_EMULATION} "" no ${NATIVE_EMULATION} ${TARGET_TUPLE} + +PPC32_EMULATION= elf32ppc +_ppc32_path= \"${TOOLS_PREFIX}/usr/lib32\" +EMS+= ${PPC32_EMULATION} +.for ext in ${ELF_SCR_EXT} +LDSCRIPTS+= ${PPC32_EMULATION}.${ext} +.endfor + +SRCS+= e${PPC32_EMULATION}.c +CLEANFILES+= e${PPC32_EMULATION}.c +e${PPC32_EMULATION}.c: emulparams/${PPC32_EMULATION}.sh emultempl/elf32.em \ + scripttempl/elf.sc genscripts.sh stringify.sed + sh ${.CURDIR}/genscripts.sh ${SRCDIR}/ld ${_ppc32_path} \ + ${TOOLS_PREFIX}/usr \ + ${HOST} ${TARGET_TUPLE} ${TARGET_TUPLE} \ + ${PPC32_EMULATION} "" no ${PPC32_EMULATION} ${TARGET_TUPLE} + Modified: head/gnu/usr.bin/binutils/libbfd/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/libbfd/Makefile Fri Jul 9 21:27:42 2010 (r209866) +++ head/gnu/usr.bin/binutils/libbfd/Makefile Sat Jul 10 02:29:22 2010 (r209867) @@ -24,6 +24,8 @@ SELARCH= SELARCH= &bfd_i386_arch .elif ${TARGET_ARCH} == "sparc64" SELARCH= &bfd_sparc_arch +.elif ${TARGET_ARCH} == "powerpc64" +SELARCH= &bfd_powerpc_arch,&bfd_rs6000_arch .else .for _a in ${ARCHS} .if ${SELARCH} == "" Added: head/gnu/usr.bin/binutils/libbfd/Makefile.powerpc64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/binutils/libbfd/Makefile.powerpc64 Sat Jul 10 02:29:22 2010 (r209867) @@ -0,0 +1,27 @@ +# $FreeBSD$ + +ARCHS+= rs6000 + +DEFAULT_VECTOR= bfd_elf64_powerpc_vec + +SRCS+= cpu-powerpc.c \ + cpu-rs6000.c \ + elf32.c \ + elf32-gen.c \ + elf32-ppc.c \ + elf32-target.h \ + elflink.c \ + elf64.c \ + elf64-gen.c \ + elf64-ppc.c \ + elf64-target.h \ + elflink.c \ + ppcboot.c \ + xcofflink.c + +VECS+= ${DEFAULT_VECTOR} \ + bfd_elf64_powerpcle_vec \ + bfd_elf32_powerpc_vec \ + bfd_elf32_powerpcle_vec \ + ppcboot_vec + Copied: head/gnu/usr.bin/binutils/libopcodes/Makefile.powerpc64 (from r209845, head/gnu/usr.bin/binutils/libopcodes/Makefile.powerpc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/gnu/usr.bin/binutils/libopcodes/Makefile.powerpc64 Sat Jul 10 02:29:22 2010 (r209867, copy of r209845, head/gnu/usr.bin/binutils/libopcodes/Makefile.powerpc) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +SRCS+= ppc-dis.c ppc-opc.c +CFLAGS+= -DARCH_powerpc -DARCH_rs6000 Modified: head/gnu/usr.bin/cc/Makefile.tgt ============================================================================== --- head/gnu/usr.bin/cc/Makefile.tgt Fri Jul 9 21:27:42 2010 (r209866) +++ head/gnu/usr.bin/cc/Makefile.tgt Sat Jul 10 02:29:22 2010 (r209867) @@ -4,7 +4,7 @@ TARGET_ARCH?= ${MACHINE_ARCH} .if ${TARGET_ARCH} == "amd64" GCC_CPU= i386 -.elif ${TARGET_ARCH} == "powerpc" +.elif ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpc64" GCC_CPU= rs6000 .elif ${TARGET_ARCH} == "sparc64" GCC_CPU= sparc @@ -18,3 +18,7 @@ TARGET_CPU_DEFAULT= MASK_GNU_AS|MASK_GNU .if ${TARGET_ARCH} == "sparc64" TARGET_CPU_DEFAULT= TARGET_CPU_ultrasparc .endif +.if ${TARGET_ARCH} == "powerpc64" +TARGET_CPU_DEFAULT= \"powerpc64\" +.endif + Modified: head/gnu/usr.bin/cc/cc_tools/Makefile ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/Makefile Fri Jul 9 21:27:42 2010 (r209866) +++ head/gnu/usr.bin/cc/cc_tools/Makefile Sat Jul 10 02:29:22 2010 (r209867) @@ -52,6 +52,10 @@ TARGET_INC+= ${GCC_CPU}/elf.h .if ${TARGET_ARCH} == "arm" TARGET_INC+= ${GCC_CPU}/aout.h .endif +.if ${TARGET_ARCH} == "powerpc64" +TARGET_INC+= ${GCC_CPU}/biarch64.h +TARGET_INC+= ${GCC_CPU}/default64.h +.endif TARGET_INC+= ${GCC_CPU}/freebsd.h .if ${TARGET_ARCH} == "amd64" TARGET_INC+= ${GCC_CPU}/freebsd64.h @@ -171,7 +175,7 @@ OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/ OPT_FILES+= ${.CURDIR}/${GCC_CPU}-freebsd.opt .endif -.if ${TARGET_ARCH} == "powerpc" +.if ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpc64" OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/sysv4.opt .endif @@ -303,12 +307,22 @@ GENSRCS+= gcov-iov.h # Multilib config file multilib.h: +.if ${TARGET_ARCH} == "powerpc64" + echo 'static const char *const multilib_raw[] = { \ + ". !m64 !m32;", \ + "64:../lib m64 !m32;", \ + "32:../lib32 !m64 m32;", NULL };' > ${.TARGET} + echo 'static const char *multilib_options = "m64/m32";' >> ${.TARGET} + echo 'static const char *const multilib_matches_raw[] = { \ + "m64 m64;", "m32 m32;", NULL };' >> ${.TARGET} +.else echo 'static const char *const multilib_raw[] = { \ ". ;", NULL };' > ${.TARGET} + echo 'static const char *multilib_options = "";' >> ${.TARGET} echo 'static const char *const multilib_matches_raw[] = { \ NULL };' >> ${.TARGET} +.endif echo 'static const char *multilib_extra = "";' >> ${.TARGET} - echo 'static const char *multilib_options = "";' >> ${.TARGET} echo 'static const char *const multilib_exclusions_raw[] = { \ NULL };' >> ${.TARGET} Modified: head/gnu/usr.bin/cc/include/Makefile ============================================================================== --- head/gnu/usr.bin/cc/include/Makefile Fri Jul 9 21:27:42 2010 (r209866) +++ head/gnu/usr.bin/cc/include/Makefile Sat Jul 10 02:29:22 2010 (r209867) @@ -12,7 +12,7 @@ INCS= emmintrin.h mmintrin.h pmmintrin.h INCS= ia64intrin.h .elif ${TARGET_ARCH} == "arm" INCS= mmintrin.h -.elif ${TARGET_ARCH} == "powerpc" +.elif ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpc64" INCS= ppc-asm.h altivec.h spe.h .endif Modified: head/gnu/usr.bin/gdb/arch/powerpc64/config.h ============================================================================== --- head/gnu/usr.bin/gdb/arch/powerpc/config.h Fri Jul 9 11:27:33 2010 (r209845) +++ head/gnu/usr.bin/gdb/arch/powerpc64/config.h Sat Jul 10 02:29:22 2010 (r209867) @@ -446,7 +446,7 @@ #define DEFAULT_BFD_ARCH bfd_rs6000_arch /* Define to BFD's default target vector. */ -#define DEFAULT_BFD_VEC bfd_elf32_powerpc_vec +#define DEFAULT_BFD_VEC bfd_elf64_powerpc_vec /* Define to 1 if your system has the _etext variable. */ #define HAVE__ETEXT 1 Copied and modified: head/gnu/usr.bin/gdb/kgdb/trgt_powerpc64.c (from r209845, head/gnu/usr.bin/gdb/kgdb/trgt_powerpc.c) ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_powerpc.c Fri Jul 9 11:27:33 2010 (r209845, copy source) +++ head/gnu/usr.bin/gdb/kgdb/trgt_powerpc64.c Sat Jul 10 02:29:22 2010 (r209867) @@ -72,6 +72,8 @@ kgdb_trgt_fetch_registers(int regno __un /* r1 is saved in the sp field */ supply_register(tdep->ppc_gp0_regnum + 1, (char *)&pcb.pcb_sp); + /* r2 is saved in the toc field */ + supply_register(tdep->ppc_gp0_regnum + 2, (char *)&pcb.pcb_toc); supply_register(tdep->ppc_lr_regnum, (char *)&pcb.pcb_lr); supply_register(tdep->ppc_cr_regnum, (char *)&pcb.pcb_cr); @@ -160,7 +162,7 @@ kgdb_trgt_trapframe_prev_register(struct return; cache = kgdb_trgt_frame_cache(next_frame, this_cache); - *addrp = cache->sp + 8 + ofs; + *addrp = cache->sp + 48 + ofs; *lvalp = lval_memory; target_read_memory(*addrp, valuep, regsz); } From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 02:32:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59F701065674; Sat, 10 Jul 2010 02:32:51 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30C9B8FC18; Sat, 10 Jul 2010 02:32:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6A2WpXU021648; Sat, 10 Jul 2010 02:32:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6A2WpXc021644; Sat, 10 Jul 2010 02:32:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007100232.o6A2WpXc021644@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 10 Jul 2010 02:32:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209868 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 02:32:51 -0000 Author: nwhitehorn Date: Sat Jul 10 02:32:50 2010 New Revision: 209868 URL: http://svn.freebsd.org/changeset/base/209868 Log: Minor modifications to know what to do with powerpc64. Modified: head/share/mk/bsd.cpu.mk head/share/mk/bsd.endian.mk head/share/mk/sys.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Sat Jul 10 02:29:22 2010 (r209867) +++ head/share/mk/bsd.cpu.mk Sat Jul 10 02:32:50 2010 (r209868) @@ -12,7 +12,7 @@ MACHINE_CPU = i486 MACHINE_CPU = amd64 sse2 sse mmx . elif ${MACHINE_ARCH} == "ia64" MACHINE_CPU = itanium -. elif ${MACHINE_ARCH} == "powerpc" +. elif ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" MACHINE_CPU = aim . elif ${MACHINE_ARCH} == "sparc64" . elif ${MACHINE_ARCH} == "arm" @@ -121,6 +121,8 @@ _CPUCFLAGS = -Wa,-me500 -msoft-float . else _CPUCFLAGS = -mcpu=${CPUTYPE} -mno-powerpc64 . endif +. elif ${MACHINE_ARCH} == "powerpc64" +_CPUCFLAGS = -mcpu=${CPUTYPE} . elif ${MACHINE_ARCH} == "mips" . if ${CPUTYPE} == "mips32" _CPUCFLAGS = -march=mips32 Modified: head/share/mk/bsd.endian.mk ============================================================================== --- head/share/mk/bsd.endian.mk Sat Jul 10 02:29:22 2010 (r209867) +++ head/share/mk/bsd.endian.mk Sat Jul 10 02:32:50 2010 (r209868) @@ -7,6 +7,7 @@ (${MACHINE_ARCH} == "mips" && !defined(TARGET_BIG_ENDIAN)) TARGET_ENDIANNESS= 1234 .elif ${MACHINE_ARCH} == "powerpc" || \ + ${MACHINE_ARCH} == "powerpc64" || \ ${MACHINE_ARCH} == "sparc64" || \ ${MACHINE_ARCH} == "arm" || \ ${MACHINE_ARCH} == "mips" Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Sat Jul 10 02:29:22 2010 (r209867) +++ head/share/mk/sys.mk Sat Jul 10 02:32:50 2010 (r209868) @@ -13,7 +13,7 @@ unix ?= We run FreeBSD, not UNIX. # of size and/or endian. This is called MACHINE_CPU in NetBSD, but # that's used for something different in FreeBSD. # -MACHINE_CPUARCH=${MACHINE_ARCH:C/mipse[lb]/mips/:C/armeb/arm/} +MACHINE_CPUARCH=${MACHINE_ARCH:C/mipse[lb]/mips/:C/armeb/arm/:C/powerpc64/powerpc/} .endif # If the special target .POSIX appears (without prerequisites or From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 03:45:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8C3F1065674; Sat, 10 Jul 2010 03:45:55 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7A048FC0C; Sat, 10 Jul 2010 03:45:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6A3jtiR037857; Sat, 10 Jul 2010 03:45:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6A3jtwZ037852; Sat, 10 Jul 2010 03:45:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007100345.o6A3jtwZ037852@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 10 Jul 2010 03:45: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: r209869 - head/lib/csu/powerpc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 03:45:55 -0000 Author: nwhitehorn Date: Sat Jul 10 03:45:55 2010 New Revision: 209869 URL: http://svn.freebsd.org/changeset/base/209869 Log: C startup support for 64-bit PowerPC. Obtained from: projects/ppc64 Added: head/lib/csu/powerpc64/ - copied from r209845, head/lib/csu/powerpc/ Modified: head/lib/csu/powerpc64/Makefile head/lib/csu/powerpc64/crt1.c head/lib/csu/powerpc64/crti.S head/lib/csu/powerpc64/crtn.S Modified: head/lib/csu/powerpc64/Makefile ============================================================================== --- head/lib/csu/powerpc/Makefile Fri Jul 9 11:27:33 2010 (r209845) +++ head/lib/csu/powerpc64/Makefile Sat Jul 10 03:45:55 2010 (r209869) @@ -4,8 +4,9 @@ SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= Scrt1.o gcrt1.o -CFLAGS+= -I${.CURDIR}/../common \ +OBJS+= gcrt1.o +CFLAGS+= -Wall -Wno-unused \ + -I${.CURDIR}/../common \ -I${.CURDIR}/../../libc/include all: ${OBJS} @@ -15,9 +16,6 @@ CLEANFILES= ${OBJS} gcrt1.o: crt1.c ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.ALLSRC} -Scrt1.o: crt1.c - ${CC} ${CFLAGS} -fPIC -DPIC -c -o Scrt1.o ${.ALLSRC} - realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${OBJS} ${DESTDIR}${LIBDIR} Modified: head/lib/csu/powerpc64/crt1.c ============================================================================== --- head/lib/csu/powerpc/crt1.c Fri Jul 9 11:27:33 2010 (r209845) +++ head/lib/csu/powerpc64/crt1.c Sat Jul 10 03:45:55 2010 (r209869) @@ -59,6 +59,8 @@ extern int _DYNAMIC; extern void _fini(void); extern void _init(void); extern int main(int, char **, char **); +extern void _start(int, char **, char **, const struct Struct_Obj_Entry *, + void (*)(void), struct ps_strings *); #ifdef GCRT extern void _mcleanup(void); @@ -71,9 +73,6 @@ char **environ; const char *__progname = ""; struct ps_strings *__ps_strings; -void _start(int, char **, char **, const struct Struct_Obj_Entry *, - void (*)(void), struct ps_strings *); - /* The entry function. */ /* * First 5 arguments are specified by the PowerPC SVR4 ABI. Modified: head/lib/csu/powerpc64/crti.S ============================================================================== --- head/lib/csu/powerpc/crti.S Fri Jul 9 11:27:33 2010 (r209845) +++ head/lib/csu/powerpc64/crti.S Sat Jul 10 03:45:55 2010 (r209869) @@ -26,25 +26,36 @@ .section .init,"ax",@progbits .align 2 .globl _init - .type _init,@function + .section ".opd","aw" + .align 3 _init: - stwu 1,-16(1) - mflr 0 - stw 31,12(1) - stw 0,20(1) - mr 31,1 + .quad ._init,.TOC.@tocbase,0 + .previous + .align 4 + .global ._init + .type ._init,@function +._init: + stdu 1,-48(1) + mflr 0 + std 0,64(1) .section .fini,"ax",@progbits .align 2 .globl _fini + .section ".opd","aw" + .align 3 _fini: - stwu 1,-16(1) - mflr 0 - stw 31,12(1) - stw 0,20(1) - mr 31,1 + .quad ._fini,.TOC.@tocbase,0 + .previous + .align 4 + .global ._fini + .type ._fini,@function +._fini: + stdu 1,-48(1) + mflr 0 + std 0,64(1) .section .rodata .ascii "$FreeBSD$\0" Modified: head/lib/csu/powerpc64/crtn.S ============================================================================== --- head/lib/csu/powerpc/crtn.S Fri Jul 9 11:27:33 2010 (r209845) +++ head/lib/csu/powerpc64/crtn.S Sat Jul 10 03:45:55 2010 (r209869) @@ -24,20 +24,16 @@ */ .section .init,"ax",@progbits - lwz 11,0(1) - lwz 0,4(11) + ld %r1,0(%r1) + ld 0,16(%r1) mtlr 0 - lwz 31,-4(11) - mr 1,11 blr .section .fini,"ax",@progbits - lwz 11,0(1) - lwz 0,4(11) + ld %r1,0(%r1) + ld 0,16(%r1) mtlr 0 - lwz 31,-4(11) - mr 1,11 blr From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 09:29:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 532F7106566C; Sat, 10 Jul 2010 09:29:49 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 419F08FC08; Sat, 10 Jul 2010 09:29:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6A9Tnp2013070; Sat, 10 Jul 2010 09:29:49 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6A9Tnhn013069; Sat, 10 Jul 2010 09:29:49 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201007100929.o6A9Tnhn013069@svn.freebsd.org> From: Martin Matuska Date: Sat, 10 Jul 2010 09:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209870 - stable/8/cddl/compat/opensolaris/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 09:29:49 -0000 Author: mm Date: Sat Jul 10 09:29:48 2010 New Revision: 209870 URL: http://svn.freebsd.org/changeset/base/209870 Log: MFC r209757: - Add support for the "sec" option to "zfs set sharenfs" Submitted by: Dmitry Morozovsky Approved by: delphij (mentor) Modified: stable/8/cddl/compat/opensolaris/misc/fsshare.c Directory Properties: stable/8/cddl/compat/opensolaris/ (props changed) Modified: stable/8/cddl/compat/opensolaris/misc/fsshare.c ============================================================================== --- stable/8/cddl/compat/opensolaris/misc/fsshare.c Sat Jul 10 03:45:55 2010 (r209869) +++ stable/8/cddl/compat/opensolaris/misc/fsshare.c Sat Jul 10 09:29:48 2010 (r209870) @@ -110,11 +110,11 @@ getline(FILE *fd, const char *skip) * * Recognized keywords: * - * ro, maproot, mapall, mask, network, alldirs, public, webnfs, index, quiet + * ro, maproot, mapall, mask, network, sec, alldirs, public, webnfs, index, quiet * */ static const char *known_opts[] = { "ro", "maproot", "mapall", "mask", - "network", "alldirs", "public", "webnfs", "index", "quiet", NULL }; + "network", "sec", "alldirs", "public", "webnfs", "index", "quiet", NULL }; static char * translate_opts(const char *shareopts) { From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 11:40:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19881106564A; Sat, 10 Jul 2010 11:40:32 +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 08DB68FC18; Sat, 10 Jul 2010 11:40:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6ABeV36043266; Sat, 10 Jul 2010 11:40:31 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6ABeVFY043264; Sat, 10 Jul 2010 11:40:31 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201007101140.o6ABeVFY043264@svn.freebsd.org> From: Giorgos Keramidas Date: Sat, 10 Jul 2010 11:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209871 - head/usr.sbin/fifolog/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 11:40:32 -0000 Author: keramida (doc committer) Date: Sat Jul 10 11:40:31 2010 New Revision: 209871 URL: http://svn.freebsd.org/changeset/base/209871 Log: Fix reading of empty fifolog files. When we don't have anything to inflate, skip the rest of the fifolog reader code to avoid hitting the assert about Z_OK a bit further down. Approved by: phk MFC after: 1 week Modified: head/usr.sbin/fifolog/lib/fifolog_reader.c Modified: head/usr.sbin/fifolog/lib/fifolog_reader.c ============================================================================== --- head/usr.sbin/fifolog/lib/fifolog_reader.c Sat Jul 10 09:29:48 2010 (r209870) +++ head/usr.sbin/fifolog/lib/fifolog_reader.c Sat Jul 10 11:40:31 2010 (r209871) @@ -304,8 +304,10 @@ fifolog_reader_process(struct fifolog_re if (i == Z_STREAM_END) { i = inflateReset(zs); } - if (i != Z_OK) + if (i != Z_OK) { fprintf(stderr, "inflate = %d\n", i); + exit (250); + } assert(i == Z_OK); if (zs->avail_out != fr->olen) { q = fr->obuf + (fr->olen - zs->avail_out); From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 13:32:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE88C106564A; Sat, 10 Jul 2010 13:32:45 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 6115F8FC12; Sat, 10 Jul 2010 13:32:44 +0000 (UTC) Received: from c122-106-145-25.carlnfd1.nsw.optusnet.com.au (c122-106-145-25.carlnfd1.nsw.optusnet.com.au [122.106.145.25]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o6ADWeaI027070 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 10 Jul 2010 23:32:42 +1000 Date: Sat, 10 Jul 2010 23:32:40 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Jung-uk Kim In-Reply-To: <201007090525.o695PEmj038278@svn.freebsd.org> Message-ID: <20100710230758.S60090@delplex.bde.org> References: <201007090525.o695PEmj038278@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209842 - head/lib/libstand X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 13:32:45 -0000 On Fri, 9 Jul 2010, Jung-uk Kim wrote: > Log: > Fix build by defining MAX() macro here. > > Modified: > head/lib/libstand/printf.c Arrgh. The unsafe macros MAX() and MIN() were deprecated in the kernel, but this has been broken (in 2001 for NetBSD and 2003 for FreeBSD). Use of MAX() in kern/subr_prf.c was a style bug. Older code in subr_prf.c still uses the min()/max() family of inline functions (just 1 instance). > Modified: head/lib/libstand/printf.c > ============================================================================== > --- head/lib/libstand/printf.c Fri Jul 9 00:38:00 2010 (r209841) > +++ head/lib/libstand/printf.c Fri Jul 9 05:25:14 2010 (r209842) Use of MAX() here was more than a style bug, since MAX() didn't exist. libstand seems to have a full min()/max() family, modulo the usual bugs and some bitrot (libkern never had uqmax()/min(), ...; libstand is missing the addition of omax()/min(), which is unimportant since it doesn't use them, but OTOH it doesn't use most of the ones that it has). > @@ -151,6 +151,7 @@ ksprintn(char *nbuf, uintmax_t num, int > static int > kvprintf(char const *fmt, void (*func)(int), void *arg, int radix, va_list ap) > { > +#define MAX(a, b) (((a) > (b)) ? (a) : (b)) One reason FreeBSD brought back the MAX() and MIN() mistakes was that definitions like the above were duplicated in many places in code not following normal kernel APIs. > #define PCHAR(c) {int cc=(c); if (func) (*func)(cc); else *d++ = cc; retval++; } > char nbuf[MAXNBUF]; > char *d; > The max() and min() families are hard to use because using them requires knowing the types of the arg. It is possible to write safe type-generic macros for max() and min() using gcc features (mainly __typeof()). gcc info gives examples of these. I didn't want to unportabilize the kernel by committing my versions of these, but once used them to find some type mismatches in the misuse of the max()/min() family. The type-generic versions should be safe macros named max() and min(), but unfortunately these good names are taken for the old API. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 13:46:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3ECC1065670; Sat, 10 Jul 2010 13:46:14 +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 B22E08FC12; Sat, 10 Jul 2010 13:46:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6ADkE2p070810; Sat, 10 Jul 2010 13:46:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6ADkEOx070799; Sat, 10 Jul 2010 13:46:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201007101346.o6ADkEOx070799@svn.freebsd.org> From: Alexander Motin Date: Sat, 10 Jul 2010 13:46: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: r209872 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 13:46:14 -0000 Author: mav Date: Sat Jul 10 13:46:14 2010 New Revision: 209872 URL: http://svn.freebsd.org/changeset/base/209872 Log: Make hw.ata.ata_dma_check_80pin tunable affect not only device side, but also controller side cable checks. Make respective sysctl writable. PR: kern/143462 Modified: head/sys/dev/ata/ata-all.c head/sys/dev/ata/chipsets/ata-acerlabs.c head/sys/dev/ata/chipsets/ata-amd.c head/sys/dev/ata/chipsets/ata-highpoint.c head/sys/dev/ata/chipsets/ata-intel.c head/sys/dev/ata/chipsets/ata-ite.c head/sys/dev/ata/chipsets/ata-jmicron.c head/sys/dev/ata/chipsets/ata-marvell.c head/sys/dev/ata/chipsets/ata-promise.c head/sys/dev/ata/chipsets/ata-siliconimage.c head/sys/dev/ata/chipsets/ata-sis.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Sat Jul 10 11:40:31 2010 (r209871) +++ head/sys/dev/ata/ata-all.c Sat Jul 10 13:46:14 2010 (r209872) @@ -105,7 +105,7 @@ SYSCTL_INT(_hw_ata, OID_AUTO, ata_dma, C "ATA disk DMA mode control"); TUNABLE_INT("hw.ata.ata_dma_check_80pin", &ata_dma_check_80pin); SYSCTL_INT(_hw_ata, OID_AUTO, ata_dma_check_80pin, - CTLFLAG_RDTUN, &ata_dma_check_80pin, 1, + CTLFLAG_RW, &ata_dma_check_80pin, 1, "Check for 80pin cable before setting ATA DMA mode"); TUNABLE_INT("hw.ata.atapi_dma", &atapi_dma); SYSCTL_INT(_hw_ata, OID_AUTO, atapi_dma, CTLFLAG_RDTUN, &atapi_dma, 0, Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acerlabs.c Sat Jul 10 11:40:31 2010 (r209871) +++ head/sys/dev/ata/chipsets/ata-acerlabs.c Sat Jul 10 13:46:14 2010 (r209872) @@ -286,7 +286,7 @@ ata_ali_setmode(device_t dev, int target mode = min(mode, ctlr->chip->max_dma); if (ctlr->chip->cfg2 & ALI_NEW && ctlr->chip->chiprev < 0xc7) { - if (mode > ATA_UDMA2 && + if (ata_dma_check_80pin && mode > ATA_UDMA2 && pci_read_config(parent, 0x4a, 1) & (1 << ch->unit)) { ata_print_cable(dev, "controller"); mode = ATA_UDMA2; Modified: head/sys/dev/ata/chipsets/ata-amd.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-amd.c Sat Jul 10 11:40:31 2010 (r209871) +++ head/sys/dev/ata/chipsets/ata-amd.c Sat Jul 10 13:46:14 2010 (r209872) @@ -119,7 +119,7 @@ ata_amd_setmode(device_t dev, int target mode = min(mode, ctlr->chip->max_dma); if (ctlr->chip->cfg1 & AMD_CABLE) { - if (mode > ATA_UDMA2 && + if (ata_dma_check_80pin && mode > ATA_UDMA2 && !(pci_read_config(parent, 0x42, 1) & (1 << devno))) { ata_print_cable(dev, "controller"); mode = ATA_UDMA2; Modified: head/sys/dev/ata/chipsets/ata-highpoint.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-highpoint.c Sat Jul 10 11:40:31 2010 (r209871) +++ head/sys/dev/ata/chipsets/ata-highpoint.c Sat Jul 10 13:46:14 2010 (r209872) @@ -216,7 +216,7 @@ ata_highpoint_check_80pin(device_t dev, res = pci_read_config(parent, 0x5a, 1) & (ch->unit ? 0x1:0x2); pci_write_config(parent, reg, val, 1); - if (mode > ATA_UDMA2 && res) { + if (ata_dma_check_80pin && mode > ATA_UDMA2 && res) { ata_print_cable(dev, "controller"); mode = ATA_UDMA2; } Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Sat Jul 10 11:40:31 2010 (r209871) +++ head/sys/dev/ata/chipsets/ata-intel.c Sat Jul 10 13:46:14 2010 (r209872) @@ -336,7 +336,8 @@ ata_intel_new_setmode(device_t dev, int u_int8_t utimings[] = { 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02 }; mode = min(mode, ctlr->chip->max_dma); - if (mode > ATA_UDMA2 && !(reg54 & (0x10 << devno))) { + if (ata_dma_check_80pin && mode > ATA_UDMA2 && + !(reg54 & (0x10 << devno))) { ata_print_cable(dev, "controller"); mode = ATA_UDMA2; } Modified: head/sys/dev/ata/chipsets/ata-ite.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ite.c Sat Jul 10 11:40:31 2010 (r209871) +++ head/sys/dev/ata/chipsets/ata-ite.c Sat Jul 10 13:46:14 2010 (r209872) @@ -139,7 +139,8 @@ ata_ite_821x_setmode(device_t dev, int t mode = min(mode, ctlr->chip->max_dma); /* check the CBLID bits for 80 conductor cable detection */ - if (mode > ATA_UDMA2 && (pci_read_config(parent, 0x40, 2) & + if (ata_dma_check_80pin && mode > ATA_UDMA2 && + (pci_read_config(parent, 0x40, 2) & (ch->unit ? (1<<3) : (1<<2)))) { ata_print_cable(dev, "controller"); mode = ATA_UDMA2; @@ -186,7 +187,8 @@ ata_ite_8213_setmode(device_t dev, int t mode = min(mode, ctlr->chip->max_dma); - if (mode > ATA_UDMA2 && !(reg54 & (0x10 << target))) { + if (ata_dma_check_80pin && mode > ATA_UDMA2 && + !(reg54 & (0x10 << target))) { ata_print_cable(dev, "controller"); mode = ATA_UDMA2; } Modified: head/sys/dev/ata/chipsets/ata-jmicron.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-jmicron.c Sat Jul 10 11:40:31 2010 (r209871) +++ head/sys/dev/ata/chipsets/ata-jmicron.c Sat Jul 10 13:46:14 2010 (r209872) @@ -149,7 +149,8 @@ ata_jmicron_setmode(device_t dev, int ta mode = min(mode, ctlr->chip->max_dma); /* check for 80pin cable present */ - if (mode > ATA_UDMA2 && pci_read_config(dev, 0x40, 1) & 0x08) { + if (ata_dma_check_80pin && mode > ATA_UDMA2 && + pci_read_config(dev, 0x40, 1) & 0x08) { ata_print_cable(dev, "controller"); mode = ATA_UDMA2; } Modified: head/sys/dev/ata/chipsets/ata-marvell.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-marvell.c Sat Jul 10 11:40:31 2010 (r209871) +++ head/sys/dev/ata/chipsets/ata-marvell.c Sat Jul 10 13:46:14 2010 (r209872) @@ -188,7 +188,8 @@ ata_marvell_setmode(device_t dev, int ta mode = min(mode, ctlr->chip->max_dma); /* Check for 80pin cable present. */ - if (mode > ATA_UDMA2 && ATA_IDX_INB(ch, ATA_BMDEVSPEC_0) & 0x01) { + if (ata_dma_check_80pin && mode > ATA_UDMA2 && + ATA_IDX_INB(ch, ATA_BMDEVSPEC_0) & 0x01) { ata_print_cable(dev, "controller"); mode = ATA_UDMA2; } Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Sat Jul 10 11:40:31 2010 (r209871) +++ head/sys/dev/ata/chipsets/ata-promise.c Sat Jul 10 13:46:14 2010 (r209872) @@ -470,7 +470,8 @@ ata_promise_setmode(device_t dev, int ta switch (ctlr->chip->cfg1) { case PR_OLD: case PR_NEW: - if (mode > ATA_UDMA2 && (pci_read_config(parent, 0x50, 2) & + if (ata_dma_check_80pin && mode > ATA_UDMA2 && + (pci_read_config(parent, 0x50, 2) & (ch->unit ? 1 << 11 : 1 << 10))) { ata_print_cable(dev, "controller"); mode = ATA_UDMA2; @@ -479,7 +480,7 @@ ata_promise_setmode(device_t dev, int ta case PR_TX: ATA_IDX_OUTB(ch, ATA_BMDEVSPEC_0, 0x0b); - if (mode > ATA_UDMA2 && + if (ata_dma_check_80pin && mode > ATA_UDMA2 && ATA_IDX_INB(ch, ATA_BMDEVSPEC_1) & 0x04) { ata_print_cable(dev, "controller"); mode = ATA_UDMA2; @@ -487,7 +488,7 @@ ata_promise_setmode(device_t dev, int ta break; case PR_MIO: - if (mode > ATA_UDMA2 && + if (ata_dma_check_80pin && mode > ATA_UDMA2 && (ATA_INL(ctlr->r_res2, (ctlr->chip->cfg2 & PR_SX4X ? 0x000c0260 : 0x0260) + (ch->unit << 7)) & 0x01000000)) { Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-siliconimage.c Sat Jul 10 11:40:31 2010 (r209871) +++ head/sys/dev/ata/chipsets/ata-siliconimage.c Sat Jul 10 13:46:14 2010 (r209872) @@ -389,7 +389,8 @@ ata_sii_setmode(device_t dev, int target mode = min(mode, ctlr->chip->max_dma); if (ctlr->chip->cfg2 & SII_SETCLK) { - if (mode > ATA_UDMA2 && (pci_read_config(parent, 0x79, 1) & + if (ata_dma_check_80pin && mode > ATA_UDMA2 && + (pci_read_config(parent, 0x79, 1) & (ch->unit ? 0x02 : 0x01))) { ata_print_cable(dev, "controller"); mode = ATA_UDMA2; Modified: head/sys/dev/ata/chipsets/ata-sis.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-sis.c Sat Jul 10 11:40:31 2010 (r209871) +++ head/sys/dev/ata/chipsets/ata-sis.c Sat Jul 10 13:46:14 2010 (r209872) @@ -243,13 +243,13 @@ ata_sis_setmode(device_t dev, int target mode = min(mode, ctlr->chip->max_dma); if (ctlr->chip->cfg1 == SIS_133NEW) { - if (mode > ATA_UDMA2 && + if (ata_dma_check_80pin && mode > ATA_UDMA2 && pci_read_config(parent, ch->unit ? 0x52 : 0x50,2) & 0x8000) { ata_print_cable(dev, "controller"); mode = ATA_UDMA2; } } else { - if (mode > ATA_UDMA2 && + if (ata_dma_check_80pin && mode > ATA_UDMA2 && pci_read_config(parent, 0x48, 1)&(ch->unit ? 0x20 : 0x10)) { ata_print_cable(dev, "controller"); mode = ATA_UDMA2; From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 14:31:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2D87106564A; Sat, 10 Jul 2010 14:31:44 +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 C2B1C8FC1D; Sat, 10 Jul 2010 14:31:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6AEViC7080786; Sat, 10 Jul 2010 14:31:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6AEVidf080784; Sat, 10 Jul 2010 14:31:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201007101431.o6AEVidf080784@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 10 Jul 2010 14:31: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: r209873 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 14:31:44 -0000 Author: kib Date: Sat Jul 10 14:31:44 2010 New Revision: 209873 URL: http://svn.freebsd.org/changeset/base/209873 Log: Document pl_siginfo and PT_FLAG_SI for PT_LWPINFO. MFC after: 1 month Modified: head/lib/libc/sys/ptrace.2 Modified: head/lib/libc/sys/ptrace.2 ============================================================================== --- head/lib/libc/sys/ptrace.2 Sat Jul 10 13:46:14 2010 (r209872) +++ head/lib/libc/sys/ptrace.2 Sat Jul 10 14:31:44 2010 (r209873) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd May 24, 2010 +.Dd July 10, 2010 .Dt PTRACE 2 .Os .Sh NAME @@ -294,6 +294,7 @@ struct ptrace_lwpinfo { int pl_flags; sigset_t pl_sigmask; sigset_t pl_siglist; + siginfo_t pl_siginfo; }; .Ed .Pp @@ -338,13 +339,28 @@ program being executed by debuggee proce execution of a system call from the .Fn execve 2 family. +.It PL_FLAG_SI +Indicates that +.Va pl_siginfo +member of +.Vt "struct ptrace_lwpinfo" +contains valid information. .El .It pl_sigmask The current signal mask of the LWP .It pl_siglist -The current pending set of signals for the LWP. Note that signals that -are delivered to the process would not appear on an LWP siglist until -the thread is selected for delivery. +The current pending set of signals for the LWP. +Note that signals that are delivered to the process would not appear +on an LWP siglist until the thread is selected for delivery. +.It pl_siginfo +The siginfo that accompanies the signal pending. +Only valid for +.Dv PL_EVENT_SIGNAL +kind of stop, when +.Va pl_flags +has +.Dv PL_FLAG_SI +set. .El .It PT_GETNUMLWPS This request returns the number of kernel threads associated with the From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 14:33:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF256106564A; Sat, 10 Jul 2010 14:33:57 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EBAE8FC1A; Sat, 10 Jul 2010 14:33:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6AEXv1E081291; Sat, 10 Jul 2010 14:33:57 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6AEXvD7081289; Sat, 10 Jul 2010 14:33:57 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007101433.o6AEXvD7081289@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 10 Jul 2010 14:33: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: r209874 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 14:33:57 -0000 Author: nwhitehorn Date: Sat Jul 10 14:33:57 2010 New Revision: 209874 URL: http://svn.freebsd.org/changeset/base/209874 Log: Add definitions for powerpc64 ELF relocation types. Some 64-bit relocations are identical to 32-bit relocations in meaning, name, and number, and I have chosen not to duplicate those here. Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Sat Jul 10 14:31:44 2010 (r209873) +++ head/sys/sys/elf_common.h Sat Jul 10 14:33:57 2010 (r209874) @@ -781,6 +781,27 @@ typedef struct { #define R_PPC_SECTOFF_HA 36 /* + * 64-bit relocations + */ +#define R_PPC64_ADDR64 38 +#define R_PPC64_ADDR16_HIGHER 39 +#define R_PPC64_ADDR16_HIGHERA 40 +#define R_PPC64_ADDR16_HIGHEST 41 +#define R_PPC64_ADDR16_HIGHESTA 42 +#define R_PPC64_UADDR64 43 +#define R_PPC64_REL64 44 +#define R_PPC64_PLT64 45 +#define R_PPC64_PLTREL64 46 +#define R_PPC64_TOC16 47 +#define R_PPC64_TOC16_LO 48 +#define R_PPC64_TOC16_HI 49 +#define R_PPC64_TOC16_HA 50 +#define R_PPC64_TOC 51 +#define R_PPC64_DTPMOD64 68 +#define R_PPC64_TPREL64 73 +#define R_PPC64_DTPREL64 78 + +/* * TLS relocations */ #define R_PPC_TLS 67 From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 14:34:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B19A6106564A; Sat, 10 Jul 2010 14:34:37 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A15DE8FC08; Sat, 10 Jul 2010 14:34:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6AEYbN6081489; Sat, 10 Jul 2010 14:34:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6AEYbel081487; Sat, 10 Jul 2010 14:34:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007101434.o6AEYbel081487@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 10 Jul 2010 14:34:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209875 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 14:34:37 -0000 Author: nwhitehorn Date: Sat Jul 10 14:34:37 2010 New Revision: 209875 URL: http://svn.freebsd.org/changeset/base/209875 Log: 32-bit sysctl emulation is also interesting on powerpc64. Modified: head/sys/sys/sysctl.h Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Sat Jul 10 14:33:57 2010 (r209874) +++ head/sys/sys/sysctl.h Sat Jul 10 14:34:37 2010 (r209875) @@ -123,7 +123,7 @@ struct ctlname { #define REQ_WIRED 2 /* locked and wired */ /* definitions for sysctl_req 'flags' member */ -#if defined(__amd64__) || defined(__ia64__) +#if defined(__amd64__) || defined(__ia64__) || defined(__powerpc64__) #define SCTL_MASK32 1 /* 32 bit emulation */ #endif From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 14:39:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A404E106566C; Sat, 10 Jul 2010 14:39:09 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79D1D8FC16; Sat, 10 Jul 2010 14:39:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6AEd9tX082508; Sat, 10 Jul 2010 14:39:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6AEd9Qg082505; Sat, 10 Jul 2010 14:39:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007101439.o6AEd9Qg082505@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 10 Jul 2010 14:39: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: r209876 - in head: lib/libc/gen sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 14:39:09 -0000 Author: nwhitehorn Date: Sat Jul 10 14:39:08 2010 New Revision: 209876 URL: http://svn.freebsd.org/changeset/base/209876 Log: The 64-bit PowerPC ABI implemented in binutils 2.15 requires some special quirks for weak-symbol handling. Text symbols require also marking weak the special dot-symbol associated with the function, and data symbols require that you not do that. To fix this, provide a hacked __weak_reference for powerpc64, and define a new __weak_reference_data for the single weak data symbol in base. Revert after: binutils 2.17 import Obtained from: projects/ppc64 Modified: head/lib/libc/gen/_thread_init.c head/sys/sys/cdefs.h Modified: head/lib/libc/gen/_thread_init.c ============================================================================== --- head/lib/libc/gen/_thread_init.c Sat Jul 10 14:34:37 2010 (r209875) +++ head/lib/libc/gen/_thread_init.c Sat Jul 10 14:39:08 2010 (r209876) @@ -32,7 +32,8 @@ __FBSDID("$FreeBSD$"); void _thread_init_stub(void); __weak_reference(_thread_init_stub, _thread_init); -__weak_reference(_thread_autoinit_dummy_decl_stub, _thread_autoinit_dummy_decl); +__weak_reference_data(_thread_autoinit_dummy_decl_stub, + _thread_autoinit_dummy_decl); int _thread_autoinit_dummy_decl_stub = 0; Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sat Jul 10 14:34:37 2010 (r209875) +++ head/sys/sys/cdefs.h Sat Jul 10 14:39:08 2010 (r209876) @@ -356,8 +356,19 @@ extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))) #endif #ifdef __STDC__ +#ifdef __powerpc64__ #define __weak_reference(sym,alias) \ __asm__(".weak " #alias); \ + __asm__(".equ " #alias ", " #sym); \ + __asm__(".weak ." #alias); \ + __asm__(".equ ." #alias ", ." #sym) +#else +#define __weak_reference(sym,alias) \ + __asm__(".weak " #alias); \ + __asm__(".equ " #alias ", " #sym) +#endif +#define __weak_reference_data(sym,alias)\ + __asm__(".weak " #alias); \ __asm__(".equ " #alias ", " #sym) #define __warn_references(sym,msg) \ __asm__(".section .gnu.warning." #sym); \ From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 14:40:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 420B4106564A; Sat, 10 Jul 2010 14:40:58 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 320AB8FC13; Sat, 10 Jul 2010 14:40:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6AEewSo082947; Sat, 10 Jul 2010 14:40:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6AEewKc082944; Sat, 10 Jul 2010 14:40:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007101440.o6AEewKc082944@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 10 Jul 2010 14:40: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: r209877 - head/lib/msun X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 14:40:58 -0000 Author: nwhitehorn Date: Sat Jul 10 14:40:57 2010 New Revision: 209877 URL: http://svn.freebsd.org/changeset/base/209877 Log: powerpc64 floating-point is identical to powerpc, so use the same code on both architectures. Modified: head/lib/msun/Makefile Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Sat Jul 10 14:39:08 2010 (r209876) +++ head/lib/msun/Makefile Sat Jul 10 14:40:57 2010 (r209877) @@ -14,6 +14,8 @@ .if ${MACHINE_ARCH} == "i386" ARCH_SUBDIR= i387 +.elif ${MACHINE_ARCH} == "powerpc64" +ARCH_SUBDIR= powerpc .else ARCH_SUBDIR= ${MACHINE_ARCH} .endif From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 14:45:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC7E91065676; Sat, 10 Jul 2010 14:45:03 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4CE98FC17; Sat, 10 Jul 2010 14:45:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6AEj3Dg083941; Sat, 10 Jul 2010 14:45:03 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6AEj3KK083918; Sat, 10 Jul 2010 14:45:03 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007101445.o6AEj3KK083918@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 10 Jul 2010 14:45: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: r209878 - in head/lib/libc: . gmon powerpc64 powerpc64/gen powerpc64/softfloat powerpc64/sys stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 14:45:04 -0000 Author: nwhitehorn Date: Sat Jul 10 14:45:03 2010 New Revision: 209878 URL: http://svn.freebsd.org/changeset/base/209878 Log: Provide 64-bit PowerPC support in libc. Obtained from: projects/ppc64 Added: head/lib/libc/powerpc64/ head/lib/libc/powerpc64/Makefile.inc (contents, props changed) head/lib/libc/powerpc64/SYS.h (contents, props changed) head/lib/libc/powerpc64/Symbol.map (contents, props changed) head/lib/libc/powerpc64/_fpmath.h (contents, props changed) head/lib/libc/powerpc64/arith.h (contents, props changed) head/lib/libc/powerpc64/gd_qnan.h (contents, props changed) head/lib/libc/powerpc64/gen/ head/lib/libc/powerpc64/gen/Makefile.inc (contents, props changed) head/lib/libc/powerpc64/gen/_ctx_start.S (contents, props changed) head/lib/libc/powerpc64/gen/_set_tp.c (contents, props changed) head/lib/libc/powerpc64/gen/_setjmp.S (contents, props changed) head/lib/libc/powerpc64/gen/fabs.S (contents, props changed) head/lib/libc/powerpc64/gen/flt_rounds.c (contents, props changed) head/lib/libc/powerpc64/gen/fpgetmask.c (contents, props changed) head/lib/libc/powerpc64/gen/fpgetround.c (contents, props changed) head/lib/libc/powerpc64/gen/fpgetsticky.c (contents, props changed) head/lib/libc/powerpc64/gen/fpsetmask.c (contents, props changed) head/lib/libc/powerpc64/gen/fpsetround.c (contents, props changed) head/lib/libc/powerpc64/gen/infinity.c (contents, props changed) head/lib/libc/powerpc64/gen/makecontext.c (contents, props changed) head/lib/libc/powerpc64/gen/modf.c (contents, props changed) head/lib/libc/powerpc64/gen/setjmp.S (contents, props changed) head/lib/libc/powerpc64/gen/signalcontext.c (contents, props changed) head/lib/libc/powerpc64/gen/sigsetjmp.S (contents, props changed) head/lib/libc/powerpc64/gen/syncicache.c (contents, props changed) head/lib/libc/powerpc64/softfloat/ head/lib/libc/powerpc64/softfloat/milieu.h (contents, props changed) head/lib/libc/powerpc64/softfloat/powerpc-gcc.h (contents, props changed) head/lib/libc/powerpc64/softfloat/softfloat.h (contents, props changed) head/lib/libc/powerpc64/sys/ head/lib/libc/powerpc64/sys/Makefile.inc (contents, props changed) head/lib/libc/powerpc64/sys/brk.S (contents, props changed) head/lib/libc/powerpc64/sys/cerror.S (contents, props changed) head/lib/libc/powerpc64/sys/exect.S (contents, props changed) head/lib/libc/powerpc64/sys/pipe.S (contents, props changed) head/lib/libc/powerpc64/sys/ptrace.S (contents, props changed) head/lib/libc/powerpc64/sys/sbrk.S (contents, props changed) head/lib/libc/powerpc64/sys/setlogin.S (contents, props changed) Modified: head/lib/libc/Makefile head/lib/libc/gmon/gmon.c head/lib/libc/stdlib/malloc.c Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Sat Jul 10 14:40:57 2010 (r209877) +++ head/lib/libc/Makefile Sat Jul 10 14:45:03 2010 (r209878) @@ -51,6 +51,7 @@ NOASM= .include "${.CURDIR}/posix1e/Makefile.inc" .if ${MACHINE_ARCH} != "amd64" && \ ${MACHINE_ARCH} != "ia64" && \ + ${MACHINE_ARCH} != "powerpc64" && \ ${MACHINE_ARCH} != "sparc64" && \ ${MACHINE_ARCH} != "mips" .include "${.CURDIR}/quad/Makefile.inc" Modified: head/lib/libc/gmon/gmon.c ============================================================================== --- head/lib/libc/gmon/gmon.c Sat Jul 10 14:40:57 2010 (r209877) +++ head/lib/libc/gmon/gmon.c Sat Jul 10 14:45:03 2010 (r209878) @@ -50,8 +50,10 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" -#if defined(__i386__) || defined(__sparc64__) || defined(__amd64__) || defined(__powerpc__) +#if defined(__i386__) || defined(__sparc64__) || defined(__amd64__) || (defined(__powerpc__) && !defined(__powerpc64__)) extern char *minbrk __asm (".minbrk"); +#elif defined(__powerpc64__) +extern char *minbrk __asm ("_minbrk"); #else extern char *minbrk __asm ("minbrk"); #endif Added: head/lib/libc/powerpc64/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/Makefile.inc Sat Jul 10 14:45:03 2010 (r209878) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +# Long double is 64-bits +MDSRCS+=machdep_ldisd.c +SYM_MAPS+=${.CURDIR}/powerpc64/Symbol.map Added: head/lib/libc/powerpc64/SYS.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/SYS.h Sat Jul 10 14:45:03 2010 (r209878) @@ -0,0 +1,109 @@ +/*- + * Copyright (c) 2002 Benno Rice. All rights reserved. + * Copyright (c) 2002 David E. O'Brien. 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 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 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 REGENTS 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. + * + * $NetBSD: SYS.h,v 1.8 2002/01/14 00:55:56 thorpej Exp $ + * $FreeBSD$ + */ + +#include +#include + +#define _SYSCALL(x) \ + .text; \ + .align 2; \ + li 0,(__CONCAT(SYS_,x)); \ + sc + +#define SYSCALL(x) \ + .text; \ + .align 2; \ +2: mflr %r0; \ + std %r0,16(%r1); \ + stdu %r1,-48(%r1); \ + bl PIC_PLT(CNAME(HIDENAME(cerror))); \ + nop; \ + addi %r1,%r1,48; \ + ld %r0,16(%r1); \ + mtlr %r0; \ + blr; \ +ENTRY(__CONCAT(__sys_,x)); \ + .weak CNAME(x); \ + .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \ + .weak CNAME(__CONCAT(_,x)); \ + .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ + .weak CNAME(__CONCAT(.,x)); \ + .set CNAME(__CONCAT(.,x)),CNAME(__CONCAT(.__sys_,x));\ + .weak CNAME(__CONCAT(._,x)); \ + .set CNAME(__CONCAT(._,x)),CNAME(__CONCAT(.__sys_,x));\ + _SYSCALL(x); \ + bso 2b + +#define PSEUDO(x) \ + .text; \ + .align 2; \ +ENTRY(__CONCAT(__sys_,x)); \ + .weak CNAME(__CONCAT(_,x)); \ + .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ + .weak CNAME(__CONCAT(._,x)); \ + .set CNAME(__CONCAT(._,x)),CNAME(__CONCAT(.__sys_,x));\ + _SYSCALL(x); \ + bnslr; \ + mflr %r0; \ + std %r0,16(%r1); \ + stdu %r1,-48(%r1); \ + bl PIC_PLT(CNAME(HIDENAME(cerror))); \ + nop; \ + addi %r1,%r1,48; \ + ld %r0,16(%r1); \ + mtlr %r0; \ + blr; + +#define RSYSCALL(x) \ + .text; \ + .align 2; \ +ENTRY(__CONCAT(__sys_,x)); \ + .weak CNAME(x); \ + .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \ + .weak CNAME(__CONCAT(_,x)); \ + .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ + .weak CNAME(__CONCAT(.,x)); \ + .set CNAME(__CONCAT(.,x)),CNAME(__CONCAT(.__sys_,x));\ + .weak CNAME(__CONCAT(._,x)); \ + .set CNAME(__CONCAT(._,x)),CNAME(__CONCAT(.__sys_,x));\ + _SYSCALL(x); \ + bnslr; \ + \ + mflr %r0; \ + std %r0,16(%r1); \ + stdu %r1,-48(%r1); \ + bl PIC_PLT(CNAME(HIDENAME(cerror))); \ + nop; \ + addi %r1,%r1,48; \ + ld %r0,16(%r1); \ + mtlr %r0; \ + blr; Added: head/lib/libc/powerpc64/Symbol.map ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/Symbol.map Sat Jul 10 14:45:03 2010 (r209878) @@ -0,0 +1,59 @@ +/* + * $FreeBSD$ + */ + +/* + * This only needs to contain symbols that are not listed in + * symbol maps from other parts of libc (i.e., not found in + * stdlib/Symbol.map, string/Symbol.map, sys/Symbol.map, ...). + */ +FBSD_1.0 { + /* PSEUDO syscalls */ + _exit; + + _mcount; + _setjmp; + _longjmp; + fabs; + __flt_rounds; + fpgetmask; + fpgetround; + fpgetsticky; + fpsetmask; + fpsetround; + __infinity; + __nan; + makecontext; + modf; + setjmp; + longjmp; + sigsetjmp; + siglongjmp; + htonl; + htons; + ntohl; + ntohs; + brk; + exect; + sbrk; + vfork; +}; + +FBSDprivate_1.0 { + /* PSEUDO syscalls */ + __sys_getlogin; + _getlogin; + __sys_exit; + + _set_tp; + _fpgetsticky; + __makecontext; + __longjmp; + signalcontext; + __signalcontext; + __syncicache; + _end; + _curbrk; + _minbrk; + _cerror; +}; Added: head/lib/libc/powerpc64/_fpmath.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/_fpmath.h Sat Jul 10 14:45:03 2010 (r209878) @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2003 David Schultz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +union IEEEl2bits { + long double e; + struct { + unsigned int sign :1; + unsigned int exp :11; + unsigned int manh :20; + unsigned int manl :32; + } bits; +}; + +#define mask_nbit_l(u) ((void)0) +#define LDBL_IMPLICIT_NBIT +#define LDBL_NBIT 0 + +#define LDBL_MANH_SIZE 20 +#define LDBL_MANL_SIZE 32 + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)(u).bits.manh; \ +} while(0) Added: head/lib/libc/powerpc64/arith.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/arith.h Sat Jul 10 14:45:03 2010 (r209878) @@ -0,0 +1,16 @@ +/* + * MD header for contrib/gdtoa + * + * $FreeBSD$ + */ + +/* + * NOTE: The definitions in this file must be correct or strtod(3) and + * floating point formats in printf(3) will break! The file can be + * generated by running contrib/gdtoa/arithchk.c on the target + * architecture. See contrib/gdtoa/gdtoaimp.h for details. + */ + +#define IEEE_MC68k +#define Arith_Kind_ASL 2 +#define Double_Align Added: head/lib/libc/powerpc64/gd_qnan.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/gd_qnan.h Sat Jul 10 14:45:03 2010 (r209878) @@ -0,0 +1,21 @@ +/* + * MD header for contrib/gdtoa + * + * This file can be generated by compiling and running contrib/gdtoa/qnan.c + * on the target architecture after arith.h has been generated. + * + * $FreeBSD$ + */ + +#define f_QNAN 0x7fc00000 +#define d_QNAN0 0x7ff80000 +#define d_QNAN1 0x0 +#define ld_QNAN0 0x7ff80000 +#define ld_QNAN1 0x0 +#define ld_QNAN2 0x0 +#define ld_QNAN3 0x0 +#define ldus_QNAN0 0x7ff8 +#define ldus_QNAN1 0x0 +#define ldus_QNAN2 0x0 +#define ldus_QNAN3 0x0 +#define ldus_QNAN4 0x0 Added: head/lib/libc/powerpc64/gen/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/gen/Makefile.inc Sat Jul 10 14:45:03 2010 (r209878) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +SRCS += _ctx_start.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \ + fpgetsticky.c fpsetmask.c fpsetround.c \ + infinity.c ldexp.c makecontext.c modf.c _setjmp.S \ + setjmp.S sigsetjmp.S signalcontext.c syncicache.c \ + _set_tp.c + + Added: head/lib/libc/powerpc64/gen/_ctx_start.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/gen/_ctx_start.S Sat Jul 10 14:45:03 2010 (r209878) @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2004 Suleiman Souhlal + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + #include + + __FBSDID("$FreeBSD$"); + + .globl CNAME(_ctx_done) + .globl CNAME(abort) + + ENTRY(_ctx_start) + ld %r2,8(%r14) + ld %r14,0(%r14) + mtlr %r14 + blrl /* branch to start function */ + mr %r3,%r15 /* pass pointer to ucontext as argument */ + nop + bl PIC_PLT(CNAME(_ctx_done)) /* branch to ctxt completion func */ + /* + * we should never return from the + * above branch. + */ + nop + bl PIC_PLT(CNAME(abort)) /* abort */ Added: head/lib/libc/powerpc64/gen/_set_tp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/gen/_set_tp.c Sat Jul 10 14:45:03 2010 (r209878) @@ -0,0 +1,35 @@ +/*- + * Copyright (c) 2004 Doug Rabson + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +void +_set_tp(void *tpval) +{ + register void *tp __asm__("r13"); + + __asm __volatile("mr %0,%1" : "=r"(tp) : "r"((char*)tpval + 0x7010)); +} Added: head/lib/libc/powerpc64/gen/_setjmp.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/gen/_setjmp.S Sat Jul 10 14:45:03 2010 (r209878) @@ -0,0 +1,116 @@ +/*- + * Copyright (c) 2002 Peter Grehan. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* $NetBSD: _setjmp.S,v 1.1 1997/03/29 20:55:53 thorpej Exp $ */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * C library -- _setjmp, _longjmp + * + * _longjmp(a,v) + * will generate a "return(v?v:1)" from the last call to + * _setjmp(a) + * by restoring registers from the stack. + * The previous signal state is NOT restored. + * + * jmpbuf layout: + * +------------+ + * | unused | + * +------------+ + * | unused | + * | | + * | (4 words) | + * | | + * +------------+ + * | saved regs | + * | ... | + */ + +ENTRY(_setjmp) + mflr %r11 + mfcr %r12 + mr %r10,%r1 + mr %r9,%r2 + std %r9,40 + 0*8(%r3) + std %r10,40 + 1*8(%r3) + std %r11,40 + 2*8(%r3) + std %r12,40 + 3*8(%r3) + std %r13,40 + 4*8(%r3) + std %r14,40 + 5*8(%r3) + std %r15,40 + 6*8(%r3) + std %r16,40 + 7*8(%r3) + std %r17,40 + 8*8(%r3) + std %r18,40 + 9*8(%r3) + std %r19,40 + 10*8(%r3) + std %r20,40 + 11*8(%r3) + std %r21,40 + 12*8(%r3) + std %r22,40 + 13*8(%r3) + std %r23,40 + 14*8(%r3) + std %r24,40 + 15*8(%r3) + std %r25,40 + 16*8(%r3) + std %r26,40 + 17*8(%r3) + std %r27,40 + 18*8(%r3) + std %r28,40 + 19*8(%r3) + std %r29,40 + 20*8(%r3) + std %r30,40 + 21*8(%r3) + std %r31,40 + 22*8(%r3) + li %r3,0 + blr + +ENTRY(_longjmp) + ld %r9,40 + 0*8(%r3) + ld %r10,40 + 1*8(%r3) + ld %r11,40 + 2*8(%r3) + ld %r12,40 + 3*8(%r3) + ld %r13,40 + 4*8(%r3) + ld %r14,40 + 5*8(%r3) + ld %r15,40 + 6*8(%r3) + ld %r16,40 + 7*8(%r3) + ld %r17,40 + 8*8(%r3) + ld %r18,40 + 9*8(%r3) + ld %r19,40 + 10*8(%r3) + ld %r20,40 + 11*8(%r3) + ld %r21,40 + 12*8(%r3) + ld %r22,40 + 13*8(%r3) + ld %r23,40 + 14*8(%r3) + ld %r24,40 + 15*8(%r3) + ld %r25,40 + 16*8(%r3) + ld %r26,40 + 17*8(%r3) + ld %r27,40 + 18*8(%r3) + ld %r28,40 + 19*8(%r3) + ld %r29,40 + 20*8(%r3) + ld %r30,40 + 21*8(%r3) + ld %r31,40 + 22*8(%r3) + + mtlr %r11 + mtcr %r12 + mr %r2,%r9 + mr %r1,%r10 + or. %r3,%r4,%r4 + bnelr + li %r3,1 + blr Added: head/lib/libc/powerpc64/gen/fabs.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/gen/fabs.S Sat Jul 10 14:45:03 2010 (r209878) @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2004 Peter Grehan. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * double fabs(double) + */ +ENTRY(fabs) + fabs %f1,%f1 + blr Added: head/lib/libc/powerpc64/gen/flt_rounds.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/gen/flt_rounds.c Sat Jul 10 14:45:03 2010 (r209878) @@ -0,0 +1,56 @@ +/* $NetBSD: flt_rounds.c,v 1.4.10.3 2002/03/22 20:41:53 nathanw Exp $ */ + +/* + * Copyright (c) 1996 Mark Brinicombe + * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Mark Brinicombe + * for the NetBSD Project. + * 4. 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 + +#ifndef _SOFT_FLOAT +static const int map[] = { + 1, /* round to nearest */ + 0, /* round to zero */ + 2, /* round to positive infinity */ + 3 /* round to negative infinity */ +}; + +int +__flt_rounds() +{ + uint64_t fpscr; + + __asm__ __volatile("mffs %0" : "=f"(fpscr)); + return map[(fpscr & 0x03)]; +} +#endif Added: head/lib/libc/powerpc64/gen/fpgetmask.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/gen/fpgetmask.c Sat Jul 10 14:45:03 2010 (r209878) @@ -0,0 +1,55 @@ +/* $NetBSD: fpgetmask.c,v 1.3 2002/01/13 21:45:47 thorpej Exp $ */ + +/* + * Copyright (c) 1999 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Dan Winship. + * + * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifndef _SOFT_FLOAT +fp_except_t +fpgetmask() +{ + u_int64_t fpscr; + + __asm__("mffs %0" : "=f"(fpscr)); + return ((fp_except_t)((fpscr >> 3) & 0x1f)); +} +#endif Added: head/lib/libc/powerpc64/gen/fpgetround.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/gen/fpgetround.c Sat Jul 10 14:45:03 2010 (r209878) @@ -0,0 +1,55 @@ +/* $NetBSD: fpgetround.c,v 1.3 2002/01/13 21:45:47 thorpej Exp $ */ + +/* + * Copyright (c) 1999 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Dan Winship. + * + * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifndef _SOFT_FLOAT +fp_rnd_t +fpgetround() +{ + u_int64_t fpscr; + + __asm__("mffs %0" : "=f"(fpscr)); + return ((fp_rnd_t)(fpscr & 0x3)); +} +#endif Added: head/lib/libc/powerpc64/gen/fpgetsticky.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/gen/fpgetsticky.c Sat Jul 10 14:45:03 2010 (r209878) @@ -0,0 +1,61 @@ +/* $NetBSD: fpgetsticky.c,v 1.3 2002/01/13 21:45:48 thorpej Exp $ */ + +/* + * Copyright (c) 1999 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Dan Winship. + * + * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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$ + */ + +#include + +#include "namespace.h" + +#include +#include + +#ifndef _SOFT_FLOAT +#ifdef __weak_alias +__weak_alias(fpgetsticky,_fpgetsticky) +#endif + +fp_except_t +fpgetsticky() +{ + u_int64_t fpscr; + + __asm__ __volatile("mffs %0" : "=f"(fpscr)); + return ((fp_except_t)((fpscr >> 25) & 0x1f)); +} +#endif Added: head/lib/libc/powerpc64/gen/fpsetmask.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/gen/fpsetmask.c Sat Jul 10 14:45:03 2010 (r209878) @@ -0,0 +1,59 @@ +/* $NetBSD: fpsetmask.c,v 1.3 2002/01/13 21:45:48 thorpej Exp $ */ + +/* + * Copyright (c) 1999 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Dan Winship. + * + * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifndef _SOFT_FLOAT +fp_except_t +fpsetmask(fp_except_t mask) +{ + u_int64_t fpscr; + fp_rnd_t old; + + __asm__("mffs %0" : "=f"(fpscr)); + old = (fp_rnd_t)((fpscr >> 3) & 0x1f); + fpscr = (fpscr & 0xffffff07) | (mask << 3); + __asm__ __volatile("mtfsf 0xff,%0" :: "f"(fpscr)); + return (old); +} +#endif Added: head/lib/libc/powerpc64/gen/fpsetround.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/gen/fpsetround.c Sat Jul 10 14:45:03 2010 (r209878) @@ -0,0 +1,59 @@ +/* $NetBSD: fpsetround.c,v 1.3 2002/01/13 21:45:48 thorpej Exp $ */ + +/* + * Copyright (c) 1999 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Dan Winship. + * + * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#ifndef _SOFT_FLOAT +fp_rnd_t +fpsetround(fp_rnd_t rnd_dir) +{ + u_int64_t fpscr; + fp_rnd_t old; + + __asm__ __volatile("mffs %0" : "=f"(fpscr)); + old = (fp_rnd_t)(fpscr & 0x3); + fpscr = (fpscr & 0xfffffffc) | rnd_dir; + __asm__ __volatile("mtfsf 0xff,%0" :: "f"(fpscr)); + return (old); +} +#endif Added: head/lib/libc/powerpc64/gen/infinity.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/gen/infinity.c Sat Jul 10 14:45:03 2010 (r209878) @@ -0,0 +1,17 @@ +#include +#if 0 +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: infinity.c,v 1.2 1998/11/14 19:31:02 christos Exp $"); +#endif /* LIBC_SCCS and not lint */ +#endif +__FBSDID("$FreeBSD$"); + +/* infinity.c */ + +#include + +/* bytes for +Infinity on powerpc */ +const union __infinity_un __infinity = { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } }; + +/* bytes for NaN */ +const union __nan_un __nan = { { 0xff, 0xc0, 0, 0 } }; Added: head/lib/libc/powerpc64/gen/makecontext.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/gen/makecontext.c Sat Jul 10 14:45:03 2010 (r209878) @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2004 Suleiman Souhlal + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include + +__weak_reference(__makecontext, makecontext); + +void _ctx_done(ucontext_t *ucp); +void _ctx_start(void); + +void +_ctx_done(ucontext_t *ucp) +{ + if (ucp->uc_link == NULL) + exit(0); + else { + /* invalidate context */ + ucp->uc_mcontext.mc_len = 0; + + setcontext((const ucontext_t *)ucp->uc_link); + + abort(); /* should never return from above call */ + } +} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 15:13:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B95EA106564A; Sat, 10 Jul 2010 15:13:49 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F0B88FC13; Sat, 10 Jul 2010 15:13:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6AFDnar090324; Sat, 10 Jul 2010 15:13:49 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6AFDnXo090323; Sat, 10 Jul 2010 15:13:49 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007101513.o6AFDnXo090323@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 10 Jul 2010 15: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: r209880 - in head/lib: libthr/arch/powerpc64 libthread_db/arch/powerpc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 15:13:49 -0000 Author: nwhitehorn Date: Sat Jul 10 15:13:49 2010 New Revision: 209880 URL: http://svn.freebsd.org/changeset/base/209880 Log: Powerpc64 thread libraries support. Added: head/lib/libthr/arch/powerpc64/ - copied from r209845, head/lib/libthr/arch/powerpc/ head/lib/libthread_db/arch/powerpc64/ - copied from r209845, head/lib/libthread_db/arch/powerpc/ From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 15:15:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F974106564A; Sat, 10 Jul 2010 15:15:01 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEC088FC0C; Sat, 10 Jul 2010 15:15:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6AFF07u090638; Sat, 10 Jul 2010 15:15:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6AFF060090634; Sat, 10 Jul 2010 15:15:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007101515.o6AFF060090634@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 10 Jul 2010 15: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: r209881 - head/lib/libkvm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 15:15:01 -0000 Author: nwhitehorn Date: Sat Jul 10 15:15:00 2010 New Revision: 209881 URL: http://svn.freebsd.org/changeset/base/209881 Log: 64-bit PowerPC KVM support. Added: head/lib/libkvm/kvm_powerpc64.c (contents, props changed) Added: head/lib/libkvm/kvm_powerpc64.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libkvm/kvm_powerpc64.c Sat Jul 10 15:15:00 2010 (r209881) @@ -0,0 +1,218 @@ +/*- + * Copyright (c) 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. 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 "kvm_private.h" + +struct vmstate { + void *map; + size_t mapsz; + size_t dmphdrsz; + Elf64_Ehdr *eh; + Elf64_Phdr *ph; +}; + +static int +valid_elf_header(Elf64_Ehdr *eh) +{ + + if (!IS_ELF(*eh)) + return (0); + if (eh->e_ident[EI_CLASS] != ELFCLASS64) + return (0); + if (eh->e_ident[EI_DATA] != ELFDATA2MSB) + return (0); + if (eh->e_ident[EI_VERSION] != EV_CURRENT) + return (0); + if (eh->e_ident[EI_OSABI] != ELFOSABI_STANDALONE) + return (0); + if (be16toh(eh->e_type) != ET_CORE) + return (0); + if (be16toh(eh->e_machine) != EM_PPC64) + return (0); + /* Can't think of anything else to check... */ + return (1); +} + +static size_t +dump_header_size(struct kerneldumpheader *dh) +{ + + if (strcmp(dh->magic, KERNELDUMPMAGIC) != 0) + return (0); + if (strcmp(dh->architecture, "powerpc64") != 0) + return (0); + /* That should do it... */ + return (sizeof(*dh)); +} + +/* + * Map the ELF headers into the process' address space. We do this in two + * steps: first the ELF header itself and using that information the whole + * set of headers. + */ +static int +powerpc_maphdrs(kvm_t *kd) +{ + struct vmstate *vm; + size_t mapsz; + + vm = kd->vmst; + + vm->mapsz = PAGE_SIZE; + vm->map = mmap(NULL, vm->mapsz, PROT_READ, MAP_PRIVATE, kd->pmfd, 0); + if (vm->map == MAP_FAILED) { + _kvm_err(kd, kd->program, "cannot map corefile"); + return (-1); + } + vm->dmphdrsz = 0; + vm->eh = vm->map; + if (!valid_elf_header(vm->eh)) { + /* + * Hmmm, no ELF header. Maybe we still have a dump header. + * This is normal when the core file wasn't created by + * savecore(8), but instead was dumped over TFTP. We can + * easily skip the dump header... + */ + vm->dmphdrsz = dump_header_size(vm->map); + if (vm->dmphdrsz == 0) + goto inval; + vm->eh = (void *)((uintptr_t)vm->map + vm->dmphdrsz); + if (!valid_elf_header(vm->eh)) + goto inval; + } + mapsz = be16toh(vm->eh->e_phentsize) * be16toh(vm->eh->e_phnum) + + be64toh(vm->eh->e_phoff); + munmap(vm->map, vm->mapsz); + + /* Map all headers. */ + vm->mapsz = vm->dmphdrsz + mapsz; + vm->map = mmap(NULL, vm->mapsz, PROT_READ, MAP_PRIVATE, kd->pmfd, 0); + if (vm->map == MAP_FAILED) { + _kvm_err(kd, kd->program, "cannot map corefle headers"); + return (-1); + } + vm->eh = (void *)((uintptr_t)vm->map + vm->dmphdrsz); + vm->ph = (void *)((uintptr_t)vm->eh + be64toh(vm->eh->e_phoff)); + return (0); + + inval: + munmap(vm->map, vm->mapsz); + vm->map = MAP_FAILED; + _kvm_err(kd, kd->program, "invalid corefile"); + return (-1); +} + +/* + * Determine the offset within the corefile corresponding the virtual + * address. Return the number of contiguous bytes in the corefile or + * 0 when the virtual address is invalid. + */ +static size_t +powerpc64_va2off(kvm_t *kd, u_long va, off_t *ofs) +{ + struct vmstate *vm = kd->vmst; + Elf64_Phdr *ph; + int nph; + + ph = vm->ph; + nph = be16toh(vm->eh->e_phnum); + while (nph && (va < be64toh(ph->p_vaddr) || + va >= be64toh(ph->p_vaddr) + be64toh(ph->p_memsz))) { + nph--; + ph = (void *)((uintptr_t)ph + be16toh(vm->eh->e_phentsize)); + } + if (nph == 0) + return (0); + + /* Segment found. Return file offset and range. */ + *ofs = vm->dmphdrsz + be64toh(ph->p_offset) + + (va - be64toh(ph->p_vaddr)); + return (be64toh(ph->p_memsz) - (va - be64toh(ph->p_vaddr))); +} + +void +_kvm_freevtop(kvm_t *kd) +{ + struct vmstate *vm = kd->vmst; + + if (vm == NULL) + return; + + if (vm->eh != MAP_FAILED) { + munmap(vm->eh, vm->mapsz); + vm->eh = MAP_FAILED; + } + free(vm); + kd->vmst = NULL; +} + +int +_kvm_initvtop(kvm_t *kd) +{ + + kd->vmst = (struct vmstate *)_kvm_malloc(kd, sizeof(*kd->vmst)); + if (kd->vmst == NULL) { + _kvm_err(kd, kd->program, "out of virtual memory"); + return (-1); + } + if (powerpc_maphdrs(kd) == -1) { + free(kd->vmst); + kd->vmst = NULL; + return (-1); + } + return (0); +} + +int +_kvm_kvatop(kvm_t *kd, u_long va, off_t *ofs) +{ + struct vmstate *vm; + + vm = kd->vmst; + if (vm->ph->p_paddr == ~0UL) + return ((int)powerpc64_va2off(kd, va, ofs)); + + _kvm_err(kd, kd->program, "Raw corefile not supported"); + return (0); +} From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 15:16:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68D11106564A; Sat, 10 Jul 2010 15:16:36 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F4718FC13; Sat, 10 Jul 2010 15:16:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6AFGaxX091035; Sat, 10 Jul 2010 15:16:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6AFGaGT091033; Sat, 10 Jul 2010 15:16:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007101516.o6AFGaGT091033@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 10 Jul 2010 15:16: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: r209882 - head/lib/libstand X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 15:16:36 -0000 Author: nwhitehorn Date: Sat Jul 10 15:16:35 2010 New Revision: 209882 URL: http://svn.freebsd.org/changeset/base/209882 Log: Teach libstand what to do for powerpc64: the same thing as powerpc. Like amd64, libstand apps for powerpc64 systems are 32-bit, due to 32-bit Open Firmware implementations. Modified: head/lib/libstand/Makefile Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Sat Jul 10 15:15:00 2010 (r209881) +++ head/lib/libstand/Makefile Sat Jul 10 15:16:35 2010 (r209882) @@ -30,10 +30,10 @@ CFLAGS+= -mno-sse3 .if ${MACHINE} == "pc98" CFLAGS+= -Os .endif -.if ${MACHINE_ARCH} == "powerpc" -CFLAGS+= -msoft-float -D_STANDALONE +.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" +CFLAGS+= -msoft-float -D_STANDALONE -DNETIF_DEBUG .endif -.if ${MACHINE_ARCH} == "amd64" +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -m32 -I. .endif .if ${MACHINE_ARCH} == "arm" @@ -55,8 +55,8 @@ SRCS+= ntoh.c # string functions from libc .PATH: ${.CURDIR}/../libc/string .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \ - ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "amd64" || \ - ${MACHINE_ARCH} == "arm" + ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "sparc64" || \ + ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "arm" SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \ memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \ strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \ @@ -78,7 +78,7 @@ SRCS+= bcmp.c bcopy.S bzero.S ffs.S inde SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S .endif -.if ${MACHINE_ARCH} == "powerpc" +.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" .PATH: ${.CURDIR}/../libc/quad SRCS+= ashldi3.c ashrdi3.c .PATH: ${.CURDIR}/../libc/powerpc/gen @@ -92,6 +92,8 @@ SRCS+= uuid_equal.c uuid_is_nil.c # _setjmp/_longjmp .if ${MACHINE_ARCH} == "amd64" .PATH: ${.CURDIR}/i386 +.elif ${MACHINE_ARCH} == "powerpc64" +.PATH: ${.CURDIR}/powerpc .else .PATH: ${.CURDIR}/${MACHINE_ARCH} .endif From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 15:27:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 259EF106564A; Sat, 10 Jul 2010 15:27:28 +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 15DF28FC17; Sat, 10 Jul 2010 15:27:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6AFRRn9093429; Sat, 10 Jul 2010 15:27:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6AFRRxY093427; Sat, 10 Jul 2010 15:27:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201007101527.o6AFRRxY093427@svn.freebsd.org> From: Alexander Motin Date: Sat, 10 Jul 2010 15:27: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: r209883 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 15:27:28 -0000 Author: mav Date: Sat Jul 10 15:27:27 2010 New Revision: 209883 URL: http://svn.freebsd.org/changeset/base/209883 Log: On attach, grab channel lock before setting up interrupt. This fixes crash in ATA_CAM mode if phy connect event arrive before CAM bus initialization completed. Modified: head/sys/dev/ata/ata-all.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Sat Jul 10 15:16:35 2010 (r209882) +++ head/sys/dev/ata/ata-all.c Sat Jul 10 15:27:27 2010 (r209883) @@ -185,27 +185,29 @@ ata_attach(device_t dev) if (ch->dma.alloc) ch->dma.alloc(dev); + mtx_lock(&ch->state_mtx); /* setup interrupt delivery */ rid = ATA_IRQ_RID; ch->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (!ch->r_irq) { device_printf(dev, "unable to allocate interrupt\n"); + mtx_unlock(&ch->state_mtx); return ENXIO; } if ((error = bus_setup_intr(dev, ch->r_irq, ATA_INTR_FLAGS, NULL, ata_interrupt, ch, &ch->ih))) { device_printf(dev, "unable to setup interrupt\n"); - return error; + goto err1; } #ifndef ATA_CAM + mtx_unlock(&ch->state_mtx); /* probe and attach devices on this channel unless we are in early boot */ if (!ata_delayed_attach) ata_identify(dev); return (0); #else - mtx_lock(&ch->state_mtx); /* Create the device queue for our SIM. */ devq = cam_simq_alloc(1); if (devq == NULL) { @@ -239,11 +241,11 @@ err3: xpt_bus_deregister(cam_sim_path(ch->sim)); err2: cam_sim_free(ch->sim, /*free_devq*/TRUE); +#endif err1: bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq); mtx_unlock(&ch->state_mtx); return (error); -#endif } int From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 15:36:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04551106566B; Sat, 10 Jul 2010 15:36:28 +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 E7F658FC1A; Sat, 10 Jul 2010 15:36:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6AFaR4O095435; Sat, 10 Jul 2010 15:36:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6AFaRSb095427; Sat, 10 Jul 2010 15:36:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201007101536.o6AFaRSb095427@svn.freebsd.org> From: Alexander Motin Date: Sat, 10 Jul 2010 15:36: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: r209884 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 15:36:28 -0000 Author: mav Date: Sat Jul 10 15:36:27 2010 New Revision: 209884 URL: http://svn.freebsd.org/changeset/base/209884 Log: If ata_sata_phy_reset() failed and ata_generic_reset() is not called, mark channel as having no devices connected. This improves hot-unplug operation on legacy-emulating SATA controllers. Modified: head/sys/dev/ata/chipsets/ata-intel.c head/sys/dev/ata/chipsets/ata-marvell.c head/sys/dev/ata/chipsets/ata-nvidia.c head/sys/dev/ata/chipsets/ata-promise.c head/sys/dev/ata/chipsets/ata-siliconimage.c head/sys/dev/ata/chipsets/ata-sis.c head/sys/dev/ata/chipsets/ata-via.c Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Sat Jul 10 15:27:27 2010 (r209883) +++ head/sys/dev/ata/chipsets/ata-intel.c Sat Jul 10 15:36:27 2010 (r209884) @@ -554,8 +554,12 @@ ata_intel_31244_tf_write(struct ata_requ static void ata_intel_31244_reset(device_t dev) { + struct ata_channel *ch = device_get_softc(dev); + if (ata_sata_phy_reset(dev, -1, 1)) ata_generic_reset(dev); + else + ch->devices = 0; } ATA_DECLARE_DRIVER(ata_intel); Modified: head/sys/dev/ata/chipsets/ata-marvell.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-marvell.c Sat Jul 10 15:27:27 2010 (r209883) +++ head/sys/dev/ata/chipsets/ata-marvell.c Sat Jul 10 15:36:27 2010 (r209884) @@ -579,6 +579,8 @@ ata_marvell_edma_reset(device_t dev) /* enable channel and test for devices */ if (ata_sata_phy_reset(dev, -1, 1)) ata_generic_reset(dev); + else + ch->devices = 0; /* enable EDMA machinery */ ATA_OUTL(ctlr->r_res1, 0x02028 + ATA_MV_EDMA_BASE(ch), 0x00000001); Modified: head/sys/dev/ata/chipsets/ata-nvidia.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-nvidia.c Sat Jul 10 15:27:27 2010 (r209883) +++ head/sys/dev/ata/chipsets/ata-nvidia.c Sat Jul 10 15:36:27 2010 (r209884) @@ -296,8 +296,12 @@ ata_nvidia_status(device_t dev) static void ata_nvidia_reset(device_t dev) { + struct ata_channel *ch = device_get_softc(dev); + if (ata_sata_phy_reset(dev, -1, 1)) ata_generic_reset(dev); + else + ch->devices = 0; } static int Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Sat Jul 10 15:27:27 2010 (r209883) +++ head/sys/dev/ata/chipsets/ata-promise.c Sat Jul 10 15:36:27 2010 (r209884) @@ -744,6 +744,8 @@ ata_promise_mio_reset(device_t dev) if (ata_sata_phy_reset(dev, -1, 1)) ata_generic_reset(dev); + else + ch->devices = 0; /* reset and enable plug/unplug intr */ ATA_OUTL(ctlr->r_res2, 0x06c, (0x00000011 << ch->unit)); Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-siliconimage.c Sat Jul 10 15:27:27 2010 (r209883) +++ head/sys/dev/ata/chipsets/ata-siliconimage.c Sat Jul 10 15:36:27 2010 (r209884) @@ -364,8 +364,12 @@ ata_sii_status(device_t dev) static void ata_sii_reset(device_t dev) { + struct ata_channel *ch = device_get_softc(dev); + if (ata_sata_phy_reset(dev, -1, 1)) ata_generic_reset(dev); + else + ch->devices = 0; } static int Modified: head/sys/dev/ata/chipsets/ata-sis.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-sis.c Sat Jul 10 15:27:27 2010 (r209883) +++ head/sys/dev/ata/chipsets/ata-sis.c Sat Jul 10 15:36:27 2010 (r209884) @@ -228,8 +228,12 @@ ata_sis_ch_attach(device_t dev) static void ata_sis_reset(device_t dev) { + struct ata_channel *ch = device_get_softc(dev); + if (ata_sata_phy_reset(dev, -1, 1)) ata_generic_reset(dev); + else + ch->devices = 0; } static int Modified: head/sys/dev/ata/chipsets/ata-via.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-via.c Sat Jul 10 15:27:27 2010 (r209883) +++ head/sys/dev/ata/chipsets/ata-via.c Sat Jul 10 15:36:27 2010 (r209884) @@ -290,9 +290,12 @@ ata_via_reset(device_t dev) if ((ctlr->chip->cfg2 & VIABAR) && (ch->unit > 1)) ata_generic_reset(dev); - else + else { if (ata_sata_phy_reset(dev, -1, 1)) ata_generic_reset(dev); + else + ch->devices = 0; + } } static int From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 17:43:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF320106566C; Sat, 10 Jul 2010 17:43:24 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD21B8FC15; Sat, 10 Jul 2010 17:43:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6AHhOrA023643; Sat, 10 Jul 2010 17:43:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6AHhOpj023637; Sat, 10 Jul 2010 17:43:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007101743.o6AHhOpj023637@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 10 Jul 2010 17:43: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: r209885 - in head/libexec/rtld-elf: . powerpc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 17:43:25 -0000 Author: nwhitehorn Date: Sat Jul 10 17:43:24 2010 New Revision: 209885 URL: http://svn.freebsd.org/changeset/base/209885 Log: RTLD support for powerpc64. A few small modifications to the Makefile and symbol map are required to support various consequences of the dot symbol scheme: - Symbols beginning with a dot are reserved, so start private symbols with an underscore. - In order to set RTLD breakpoints, gdb must be able to locate the text entry point, not the data section function descriptor, so add .r_debug_state to the symbol map on powerpc64. Obtained from: projects/ppc64 Added: head/libexec/rtld-elf/powerpc64/ - copied from r209845, head/libexec/rtld-elf/powerpc/ Modified: head/libexec/rtld-elf/Makefile head/libexec/rtld-elf/Symbol.map head/libexec/rtld-elf/powerpc64/reloc.c head/libexec/rtld-elf/powerpc64/rtld_machdep.h head/libexec/rtld-elf/powerpc64/rtld_start.S Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Sat Jul 10 15:36:27 2010 (r209884) +++ head/libexec/rtld-elf/Makefile Sat Jul 10 17:43:24 2010 (r209885) @@ -11,7 +11,11 @@ MAN= rtld.1 CSTD?= gnu99 CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD CFLAGS+= -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR} +.if ${MACHINE_ARCH} == "powerpc64" +LDFLAGS+= -nostdlib -e _rtld_start +.else LDFLAGS+= -nostdlib -e .rtld_start +.endif WARNS?= 2 INSTALLFLAGS= -C -b PRECIOUSPROG= Modified: head/libexec/rtld-elf/Symbol.map ============================================================================== --- head/libexec/rtld-elf/Symbol.map Sat Jul 10 15:36:27 2010 (r209884) +++ head/libexec/rtld-elf/Symbol.map Sat Jul 10 17:43:24 2010 (r209885) @@ -15,6 +15,9 @@ FBSD_1.0 { dlinfo; dl_iterate_phdr; r_debug_state; +#ifdef __powerpc64__ + .r_debug_state; +#endif __tls_get_addr; }; Modified: head/libexec/rtld-elf/powerpc64/reloc.c ============================================================================== --- head/libexec/rtld-elf/powerpc/reloc.c Fri Jul 9 11:27:33 2010 (r209845) +++ head/libexec/rtld-elf/powerpc64/reloc.c Sat Jul 10 17:43:24 2010 (r209885) @@ -43,16 +43,11 @@ #include "debug.h" #include "rtld.h" -#define _ppc_ha(x) ((((u_int32_t)(x) & 0x8000) ? \ - ((u_int32_t)(x) + 0x10000) : (u_int32_t)(x)) >> 16) -#define _ppc_la(x) ((u_int32_t)(x) & 0xffff) - -#define min(a,b) (((a) < (b)) ? (a) : (b)) -#define max(a,b) (((a) > (b)) ? (a) : (b)) - -#define PLT_EXTENDED_BEGIN (1 << 13) -#define JMPTAB_BASE(N) (18 + N*2 + ((N > PLT_EXTENDED_BEGIN) ? \ - (N - PLT_EXTENDED_BEGIN)*2 : 0)) +struct funcdesc { + Elf_Addr addr; + Elf_Addr toc; + Elf_Addr env; +}; /* * Process the R_PPC_COPY relocations @@ -109,7 +104,7 @@ do_copy_relocations(Obj_Entry *dstobj) srcaddr = (const void *) (srcobj->relocbase+srcsym->st_value); memcpy(dstaddr, srcaddr, size); - dbg("copy_reloc: src=%p,dst=%p,size=%d\n",srcaddr,dstaddr,size); + dbg("copy_reloc: src=%p,dst=%p,size=%zd\n",srcaddr,dstaddr,size); } return (0); @@ -168,8 +163,8 @@ reloc_nonplt_object(Obj_Entry *obj_rtld, case R_PPC_NONE: break; - case R_PPC_ADDR32: /* word32 S + A */ - case R_PPC_GLOB_DAT: /* word32 S + A */ + case R_PPC64_ADDR64: /* doubleword64 S + A */ + case R_PPC_GLOB_DAT: def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, false, cache); if (def == NULL) { @@ -185,7 +180,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld, } break; - case R_PPC_RELATIVE: /* word32 B + A */ + case R_PPC_RELATIVE: /* doubleword64 B + A */ tmp = (Elf_Addr)(obj->relocbase + rela->r_addend); /* As above, don't issue write unnecessarily */ @@ -216,7 +211,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld, */ break; - case R_PPC_DTPMOD32: + case R_PPC64_DTPMOD64: def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, false, cache); @@ -227,7 +222,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld, break; - case R_PPC_TPREL32: + case R_PPC64_TPREL64: def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, false, cache); @@ -256,7 +251,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld, break; - case R_PPC_DTPREL32: + case R_PPC64_DTPREL64: def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, false, cache); @@ -269,7 +264,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld, break; default: - _rtld_error("%s: Unsupported relocation type %d" + _rtld_error("%s: Unsupported relocation type %ld" " in non-PLT relocations\n", obj->path, ELF_R_TYPE(rela->r_info)); return (-1); @@ -287,6 +282,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry const Elf_Rela *relalim; const Elf_Rela *rela; SymCache *cache; + int bytes = obj->nchains * sizeof(SymCache); int r = -1; /* @@ -294,8 +290,10 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry * limited amounts of stack available so we cannot use alloca(). */ if (obj != obj_rtld) { - cache = calloc(obj->nchains, sizeof(SymCache)); - /* No need to check for NULL here */ + cache = mmap(NULL, bytes, PROT_READ|PROT_WRITE, MAP_ANON, + -1, 0); + if (cache == MAP_FAILED) + cache = NULL; } else cache = NULL; @@ -311,60 +309,39 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry } r = 0; done: - if (cache != NULL) - free(cache); + if (cache) { + munmap(cache, bytes); + } return (r); } + /* * Initialise a PLT slot to the resolving trampoline */ static int reloc_plt_object(Obj_Entry *obj, const Elf_Rela *rela) { - Elf_Word *where = (Elf_Word *)(obj->relocbase + rela->r_offset); - Elf_Addr *pltresolve, *pltlongresolve, *jmptab; - Elf_Addr distance; - int N = obj->pltrelasize / sizeof(Elf_Rela); - int reloff; + Elf_Addr *where = (Elf_Addr *)(obj->relocbase + rela->r_offset); + Elf_Addr *glink; + long reloff; reloff = rela - obj->pltrela; - if (reloff < 0) - return (-1); - - pltlongresolve = obj->pltgot + 5; - pltresolve = pltlongresolve + 5; - - distance = (Elf_Addr)pltresolve - (Elf_Addr)(where + 1); - - dbg(" reloc_plt_object: where=%p,pltres=%p,reloff=%x,distance=%x", - (void *)where, (void *)pltresolve, reloff, distance); + if (obj->priv == NULL) + obj->priv = malloc(obj->pltrelasize); + glink = obj->priv + reloff*sizeof(Elf_Addr)*2; - if (reloff < PLT_EXTENDED_BEGIN) { - /* li r11,reloff */ - /* b pltresolve */ - where[0] = 0x39600000 | reloff; - where[1] = 0x48000000 | (distance & 0x03fffffc); - } else { - jmptab = obj->pltgot + JMPTAB_BASE(N); - jmptab[reloff] = (u_int)pltlongresolve; - - /* lis r11,jmptab[reloff]@ha */ - /* lwzu r12,jmptab[reloff]@l(r11) */ - /* mtctr r12 */ - /* bctr */ - where[0] = 0x3d600000 | _ppc_ha(&jmptab[reloff]); - where[1] = 0x858b0000 | _ppc_la(&jmptab[reloff]); - where[2] = 0x7d8903a6; - where[3] = 0x4e800420; + if ((reloff < 0) || (reloff >= 0x8000)) { + return (-1); } - - /* - * The icache will be sync'd in init_pltgot, which is called - * after all the slots have been updated - */ + dbg(" reloc_plt_object: where=%p,reloff=%lx,glink=%p", (void *)where, reloff, glink); + + memcpy(where, _rtld_bind_start, sizeof(struct funcdesc)); + ((struct funcdesc *)(where))->env = (Elf_Addr)glink; + *(glink++) = (Elf_Addr)obj; + *(glink++) = reloff*sizeof(Elf_Rela); return (0); } @@ -380,7 +357,6 @@ reloc_plt(Obj_Entry *obj) const Elf_Rela *rela; if (obj->pltrelasize != 0) { - relalim = (const Elf_Rela *)((char *)obj->pltrela + obj->pltrelasize); for (rela = obj->pltrela; rela < relalim; rela++) { @@ -440,150 +416,50 @@ reloc_jmpslots(Obj_Entry *obj) /* - * Update the value of a PLT jump slot. Branch directly to the target if - * it is within +/- 32Mb, otherwise go indirectly via the pltcall - * trampoline call and jump table. + * Update the value of a PLT jump slot. */ Elf_Addr reloc_jmpslot(Elf_Addr *wherep, Elf_Addr target, const Obj_Entry *defobj, const Obj_Entry *obj, const Elf_Rel *rel) { - Elf_Addr offset; - const Elf_Rela *rela = (const Elf_Rela *) rel; - - dbg(" reloc_jmpslot: where=%p, target=%p", - (void *)wherep, (void *)target); + dbg(" reloc_jmpslot: where=%p, target=%p (%#lx + %#lx)", + (void *)wherep, (void *)target, *(Elf_Addr *)target, + (Elf_Addr)defobj->relocbase); /* * At the PLT entry pointed at by `wherep', construct * a direct transfer to the now fully resolved function * address. */ - offset = target - (Elf_Addr)wherep; - - if (abs(offset) < 32*1024*1024) { /* inside 32MB? */ - /* b value # branch directly */ - *wherep = 0x48000000 | (offset & 0x03fffffc); - __syncicache(wherep, 4); - } else { - Elf_Addr *pltcall, *jmptab; - int distance; - int N = obj->pltrelasize / sizeof(Elf_Rela); - int reloff = rela - obj->pltrela; - - if (reloff < 0) - return (-1); - - pltcall = obj->pltgot; - - dbg(" reloc_jmpslot: indir, reloff=%x, N=%x\n", - reloff, N); - jmptab = obj->pltgot + JMPTAB_BASE(N); - jmptab[reloff] = target; - - if (reloff < PLT_EXTENDED_BEGIN) { - /* for extended PLT entries, we keep the old code */ - - distance = (Elf_Addr)pltcall - (Elf_Addr)(wherep + 1); + memcpy(wherep, (void *)target, sizeof(struct funcdesc)); + if (((struct funcdesc *)(wherep))->addr < (Elf_Addr)defobj->relocbase) { + /* + * XXX: It is possible (e.g. LD_BIND_NOW) that the function + * descriptor we are copying has not yet been relocated. + * If this happens, fix it. + */ - /* li r11,reloff */ - /* b pltcall # use indirect pltcall routine */ - wherep[0] = 0x39600000 | reloff; - wherep[1] = 0x48000000 | (distance & 0x03fffffc); - __syncicache(wherep, 8); - } + ((struct funcdesc *)(wherep))->addr += + (Elf_Addr)defobj->relocbase; + ((struct funcdesc *)(wherep))->toc += + (Elf_Addr)defobj->relocbase; } + __asm __volatile("dcbst 0,%0; sync" :: "r"(wherep) : "memory"); + return (target); } - -/* - * Setup the plt glue routines. - */ -#define PLTCALL_SIZE 20 -#define PLTLONGRESOLVE_SIZE 20 -#define PLTRESOLVE_SIZE 24 - void init_pltgot(Obj_Entry *obj) { - Elf_Word *pltcall, *pltresolve, *pltlongresolve; - Elf_Word *jmptab; - int N = obj->pltrelasize / sizeof(Elf_Rela); - - pltcall = obj->pltgot; - - if (pltcall == NULL) { - return; - } - - /* - * From the SVR4 PPC ABI: - * - * 'The first 18 words (72 bytes) of the PLT are reserved for - * use by the dynamic linker. - * ... - * 'If the executable or shared object requires N procedure - * linkage table entries, the link editor shall reserve 3*N - * words (12*N bytes) following the 18 reserved words. The - * first 2*N of these words are the procedure linkage table - * entries themselves. The static linker directs calls to bytes - * (72 + (i-1)*8), for i between 1 and N inclusive. The remaining - * N words (4*N bytes) are reserved for use by the dynamic linker.' - */ - - /* - * Copy the absolute-call assembler stub into the first part of - * the reserved PLT area. - */ - memcpy(pltcall, _rtld_powerpc_pltcall, PLTCALL_SIZE); - - /* - * Determine the address of the jumptable, which is the dyn-linker - * reserved area after the call cells. Write the absolute address - * of the jumptable into the absolute-call assembler code so it - * can determine this address. - */ - jmptab = obj->pltgot + JMPTAB_BASE(N); - pltcall[1] |= _ppc_ha(jmptab); /* addis 11,11,jmptab@ha */ - pltcall[2] |= _ppc_la(jmptab); /* lwz 11,jmptab@l(11) */ - - /* - * Skip down 20 bytes into the initial reserved area and copy - * in the standard resolving assembler call. Into this assembler, - * insert the absolute address of the _rtld_bind_start routine - * and the address of the relocation object. - * - * We place pltlongresolve first, so it can fix up its arguments - * and then fall through to the regular PLT resolver. - */ - pltlongresolve = obj->pltgot + 5; - - memcpy(pltlongresolve, _rtld_powerpc_pltlongresolve, - PLTLONGRESOLVE_SIZE); - pltlongresolve[0] |= _ppc_ha(jmptab); /* lis 12,jmptab@ha */ - pltlongresolve[1] |= _ppc_la(jmptab); /* addi 12,12,jmptab@l */ - - pltresolve = pltlongresolve + PLTLONGRESOLVE_SIZE/sizeof(uint32_t); - memcpy(pltresolve, _rtld_powerpc_pltresolve, PLTRESOLVE_SIZE); - pltresolve[0] |= _ppc_ha(_rtld_bind_start); - pltresolve[1] |= _ppc_la(_rtld_bind_start); - pltresolve[3] |= _ppc_ha(obj); - pltresolve[4] |= _ppc_la(obj); - - /* - * Sync the icache for the byte range represented by the - * trampoline routines and call slots. - */ - __syncicache(pltcall, 72 + N * 8); } void allocate_initial_tls(Obj_Entry *list) { - register Elf_Addr **tp __asm__("r2"); + register Elf_Addr **tp __asm__("r13"); Elf_Addr **_tp; /* @@ -594,7 +470,7 @@ allocate_initial_tls(Obj_Entry *list) tls_static_space = tls_last_offset + tls_last_size + RTLD_STATIC_TLS_EXTRA; - _tp = (Elf_Addr **) ((char *) allocate_tls(list, NULL, TLS_TCB_SIZE, 8) + _tp = (Elf_Addr **) ((char *)allocate_tls(list, NULL, TLS_TCB_SIZE, 16) + TLS_TP_OFFSET + TLS_TCB_SIZE); /* @@ -607,7 +483,7 @@ allocate_initial_tls(Obj_Entry *list) void* __tls_get_addr(tls_index* ti) { - register Elf_Addr **tp __asm__("r2"); + register Elf_Addr **tp __asm__("r13"); char *p; p = tls_get_addr_common((Elf_Addr**)((Elf_Addr)tp - TLS_TP_OFFSET Modified: head/libexec/rtld-elf/powerpc64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/powerpc/rtld_machdep.h Fri Jul 9 11:27:33 2010 (r209845) +++ head/libexec/rtld-elf/powerpc64/rtld_machdep.h Sat Jul 10 17:43:24 2010 (r209885) @@ -54,25 +54,17 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, void _rtld_bind_start(void); /* - * PLT functions. Not really correct prototypes, but the - * symbol values are needed. - */ -void _rtld_powerpc_pltlongresolve(void); -void _rtld_powerpc_pltresolve(void); -void _rtld_powerpc_pltcall(void); - -/* * TLS */ #define TLS_TP_OFFSET 0x7000 #define TLS_DTV_OFFSET 0x8000 -#define TLS_TCB_SIZE 8 +#define TLS_TCB_SIZE 16 #define round(size, align) \ (((size) + (align) - 1) & ~((align) - 1)) #define calculate_first_tls_offset(size, align) \ - round(8, align) + round(16, align) #define calculate_tls_offset(prev_offset, prev_size, size, align) \ round(prev_offset + prev_size, align) #define calculate_tls_end(off, size) ((off) + (size)) Modified: head/libexec/rtld-elf/powerpc64/rtld_start.S ============================================================================== --- head/libexec/rtld-elf/powerpc/rtld_start.S Fri Jul 9 11:27:33 2010 (r209845) +++ head/libexec/rtld-elf/powerpc64/rtld_start.S Sat Jul 10 17:43:24 2010 (r209885) @@ -34,16 +34,16 @@ .extern _GLOBAL_OFFSET_TABLE_ .extern _DYNAMIC -_ENTRY(.rtld_start) - stwu %r1,-48(%r1) /* 16-byte aligned stack for reg saves + +_ENTRY(_rtld_start) + stdu %r1,-96(%r1) /* 16-byte aligned stack for reg saves + exit_proc & obj _rtld args + backchain & lrsave stack frame */ - stw %r3,16(%r1) /* argc */ - stw %r4,20(%r1) /* argv */ - stw %r5,24(%r1) /* envp */ -/* stw %r6,28(%r1) *//* obj (always 0) */ -/* stw %r7,32(%r1) *//* cleanup (always 0) */ - stw %r8,36(%r1) /* ps_strings */ + std %r3,48(%r1) /* argc */ + std %r4,56(%r1) /* argv */ + std %r5,64(%r1) /* envp */ +/* std %r6,72(%r1) *//* obj (always 0) */ +/* std %r7,80(%r1) *//* cleanup (always 0) */ + std %r8,88(%r1) /* ps_strings */ /* * Perform initial relocation of ld-elf.so. Not as easy as it @@ -52,35 +52,21 @@ _ENTRY(.rtld_start) * - use link-time constants to determine offset to the * _DYNAMIC section and the GOT. Add these to the PC to * convert to absolute addresses. - * - sync icache to allow execution of the SVR4 ABI-specified - * blrl instruction preceding the GOT - * - Use this instruction to determine the GOT absolute address - * - read GOT[0], which is the SVR4 ABI-specified link-time - * value of _DYNAMIC. Subtract this value from the absolute - * value to determine the load address * - call reloc_non_plt_self() to fix up ld-elf.so's relocations */ + bl 1f - .long _DYNAMIC-. - .long _GLOBAL_OFFSET_TABLE_-. /* branch lr + 4 */ + .llong _DYNAMIC-. 1: - mflr %r3 /* PC value at .long */ - lwz %r4,4(%r3) - add %r4,%r4,%r3 /* &_GLOBAL_OFFSET_TABLE-4, blrl insn. */ - dcbst %r0,%r4 /* sync i-cache with d-cache */ - sync - icbi %r0,%r4 - isync - - lwz %r4,0(%r3) /* offset to _DYNAMIC */ + mflr %r3 /* PC value at .llong */ + ld %r4,0(%r3) /* offset to _DYNAMIC */ add %r3,%r4,%r3 /* r3 = &_DYNAMIC, absolute value */ - bl _GLOBAL_OFFSET_TABLE_@local-4 - mflr %r4 /* &_GLOBAL_OFFSET_TABLE_, absolute value */ - lwz %r4,0(%r4) /* linker &_DYNAMIC, from got[0] */ - subf %r4,%r4,%r3 /* subtract to calculate relocbase */ + ld %r4,-0x8000(%r2) /* First TOC entry is TOC base */ + subf %r4,%r4,%r2 /* Subtract from real TOC base to get base */ - bl reloc_non_plt_self@plt /* reloc_non_plt_self(&_DYNAMIC,base) */ + bl .reloc_non_plt_self /* reloc_non_plt_self(&_DYNAMIC,base) */ + nop /* * The _rtld() function likes to see a stack layout containing @@ -89,25 +75,27 @@ _ENTRY(.rtld_start) * original stack layout has to be found by moving back a word * from the argv pointer. */ - lwz %r4,20(%r1) /* restore argv */ - addi %r3,%r4,-4 /* locate argc ptr, &argv[-1] */ - - addi %r4,%r1,8 /* &exit_proc on stack */ - addi %r5,%r1,12 /* &obj_main on stack */ - - bl _rtld@plt /* &_start = _rtld(sp, &exit_proc, &obj_main)*/ + ld %r4,56(%r1) + addi %r3,%r4,-8 /* locate argc ptr, &argv[-1] */ + addi %r4,%r1,80 /* &exit_proc on stack */ + addi %r5,%r1,72 /* &obj_main on stack */ + + bl ._rtld /* &_start = _rtld(sp, &exit_proc, &obj_main)*/ + nop + ld %r2,8(%r3) + ld %r11,16(%r3) + ld %r3,0(%r3) mtlr %r3 /* * Restore args, with new obj/exit proc */ - lwz %r3,16(%r1) /* argc */ - lwz %r4,20(%r1) /* argv */ - lwz %r5,24(%r1) /* envp */ - lwz %r6,12(%r1) /* obj */ - lwz %r7,8(%r1) /* exit proc */ - lwz %r8,36(%r1) /* ps_strings */ - addi %r1,%r1,48 /* restore original stackptr */ + ld %r3,48(%r1) /* argc */ + ld %r4,56(%r1) /* argv */ + ld %r5,64(%r1) /* envp */ + ld %r6,72(%r1) /* obj */ + ld %r7,80(%r1) /* exit proc */ + ld %r8,88(%r1) /* ps_strings */ blrl /* _start(argc, argv, envp, obj, cleanup, ps_strings) */ @@ -117,84 +105,57 @@ _ENTRY(.rtld_start) /* * _rtld_bind_start() * - * Call into the MI binder. This routine is reached via the PLT call cell, - * and then _rtld_powerpc_pltresolve(). - * On entry, %r11 contains the index of the PLT cell, and %r12 contains - * a pointer to the ELF object for the file. - * Save all registers, call into the binder to resolve and fixup the external + * Call into the MI binder. This routine is reached via the PLT call cell + * On entry, %r11 contains a pointer to the (object, relocation) tuple. + * + * Save all registers, call into the binder to resolve and fixup the external * routine, and then transfer to the external routine on return. */ .globl _rtld_bind _ENTRY(_rtld_bind_start) - stwu %r1,-160(%r1) # stack space for 29 regs + r0/lr/cr - stw %r0,20(%r1) # save r0 mflr %r0 - stw %r0,16(%r1) # save lr + std %r0,16(%r1) # save lr mfcr %r0 - stw %r0,12(%r1) # save cr - stmw %r3,24(%r1) # save r3-r31 + std %r0,8(%r1) # save cr - mr %r3,%r12 # obj - mulli %r4,%r11,12 # rela index * sizeof(Elf_Rela) - bl _rtld_bind@PLT # target addr = _rtld_bind(obj, reloff) + stdu %r1,-48-9*8(%r1) # stack space for 8 regs + header + std %r3,48+0*8(%r1) # save r3-r31 + std %r4,48+1*8(%r1) + std %r5,48+2*8(%r1) + std %r6,48+3*8(%r1) + std %r7,48+4*8(%r1) + std %r8,48+5*8(%r1) + std %r9,48+6*8(%r1) + std %r10,48+7*8(%r1) + std %r12,48+8*8(%r1) + + ld %r3,0(%r11) + ld %r4,8(%r11) + bl ._rtld_bind # target addr = _rtld_bind(obj, reloff) + nop + + ld %r2,8(%r3) + ld %r11,16(%r3) + ld %r3,0(%r3) mtctr %r3 # move absolute target addr into ctr - lmw %r3,24(%r1) # restore r3-r31 - lwz %r0,12(%r1) # restore cr + ld %r3,48+0*8(%r1) # restore r3-r31 + ld %r4,48+1*8(%r1) + ld %r5,48+2*8(%r1) + ld %r6,48+3*8(%r1) + ld %r7,48+4*8(%r1) + ld %r8,48+5*8(%r1) + ld %r9,48+6*8(%r1) + ld %r10,48+7*8(%r1) + ld %r12,48+8*8(%r1) + + addi %r1,%r1,48+9*8 # restore stack + + ld %r0,8(%r1) # restore cr mtcr %r0 - lwz %r0,16(%r1) # restore lr + ld %r0,16(%r1) # restore lr mtlr %r0 - lwz %r0,20(%r1) # restore r0 - addi %r1,%r1,160 # restore stack bctr # jump to target - -/* - * _rtld_powerpc_pltresolve() - * - * This routine is copied into the latter part of the 72-byte reserved - * area at the start of the PLT. The absolute address of the _rtld_bind_start - * routine, and the ELF object for the loaded file, are inserted into - * the code by the reloc.c:init_pltgot() routine. - * The first time an external routine is called, the PLT slot will - * set up %r11 to the offset of the slot, and will jump to this routine. - * The ELF object is shifted into %r11, and _rtld_bind_start is called - * to complete the binding. - */ -_ENTRY(_rtld_powerpc_pltlongresolve) - lis %r12,0 # lis 12,jmptab@ha - addi %r12,%r12,0 # addi 12,12,jmptab@l - subf %r11,%r12,%r11 # reloff - li %r12,2 - srw %r11,%r11,%r12 # index = reloff/sizeof(Elf_Addr) -_ENTRY(_rtld_powerpc_pltresolve) - lis %r12,0 # lis 12,_rtld_bind_start@ha - addi %r12,%r12,0 # addi 12,12,_rtld_bind_start@l - mtctr %r12 - lis %r12,0 # lis 12,obj@ha - addi %r12,%r12,0 # addi 12,12,obj@l - bctr - -/* - * _rtld_powerpc_pltcall() - * - * This routine is copied into the 72-byte reserved area at the - * start of the PLT. The reloc.c:init_pltgot() routine inserts - * the absolute address of the jumptable. - * Control is transferred to this routine when the binder has - * located the external routine, but determined that it is > 32Mb - * from the PLT slot. Code is inserted into the PLT slot to set up - * %r11 with the jumptable index, and jump to here, where the - * absolute address of the external routine is loaded from the - * jumptable and transferred to - */ -_ENTRY(_rtld_powerpc_pltcall) - slwi %r11,%r11,2 # jmptab offset = index * 4 - addis %r11,%r11,0 # addis 11,11,jmptab@ha - lwz %r11,0(%r11) # lwz 11,jmptab@l(11) - mtctr %r11 - bctr # (*jmptab[index])() - - From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 17:46:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC3F81065670; Sat, 10 Jul 2010 17:46:53 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC0698FC26; Sat, 10 Jul 2010 17:46:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6AHkrQq024451; Sat, 10 Jul 2010 17:46:53 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6AHkrGE024449; Sat, 10 Jul 2010 17:46:53 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007101746.o6AHkrGE024449@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 10 Jul 2010 17:46: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: r209886 - head/lib/bind X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 17:46:54 -0000 Author: nwhitehorn Date: Sat Jul 10 17:46:53 2010 New Revision: 209886 URL: http://svn.freebsd.org/changeset/base/209886 Log: Since powerpc and powerpc64 share an instruction set, bind can and should use the 32-bit atomic operations unmodified. Accomplish this by switching some MACHINE_ARCH values to MACHINE_CPUARCH. Modified: head/lib/bind/config.mk Modified: head/lib/bind/config.mk ============================================================================== --- head/lib/bind/config.mk Sat Jul 10 17:43:24 2010 (r209885) +++ head/lib/bind/config.mk Sat Jul 10 17:46:53 2010 (r209886) @@ -45,7 +45,7 @@ CFLAGS+= -DOPENSSL CFLAGS+= -DUSE_MD5 # Endianness -.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64" +.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "sparc64" CFLAGS+= -DWORDS_BIGENDIAN .endif @@ -67,7 +67,7 @@ CFLAGS+= -I${LIB_BIND_DIR} .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" ISC_ATOMIC_ARCH= x86_32 .else -ISC_ATOMIC_ARCH= ${MACHINE_ARCH} +ISC_ATOMIC_ARCH= ${MACHINE_CPUARCH} .endif # Optional features From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 18:09:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 649051065673 for ; Sat, 10 Jul 2010 18:09:14 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 0BF9D8FC1C for ; Sat, 10 Jul 2010 18:09:13 +0000 (UTC) Received: (qmail 4246 invoked by uid 399); 10 Jul 2010 18:09:12 -0000 Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 10 Jul 2010 18:09:12 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C38B747.9020104@FreeBSD.org> Date: Sat, 10 Jul 2010 11:09:11 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.10) Gecko/20100701 Thunderbird/3.0.5 MIME-Version: 1.0 To: Alexander Motin References: <201007011851.o61IpI9r054345@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.0.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209634 - head/sys/x86/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 18:09:14 -0000 Alexander, Did you see this message from me? Any hope of getting this fixed? Doug On 07/04/10 18:10, Doug Barton wrote: > This commit results in a panic at boot time for me very early on. > Screenshots at: > http://people.freebsd.org/~dougb/panic-01.jpg > http://people.freebsd.org/~dougb/panic-02.jpg > http://people.freebsd.org/~dougb/panic-03.jpg > > Not sure if it's relevant or not, but after the trace is done I typed > 'call reboot()' and it said "panic: privcheck td != curthread" > > This is on -current, Core 2 Duo, i386, SMP. Updating to the revision > immediately before this one is fine, so I'm sure this is the change that > is causing the panic. > > > Doug > > > On Thu, 1 Jul 2010, Alexander Motin wrote: > >> Author: mav >> Date: Thu Jul 1 18:51:18 2010 >> New Revision: 209634 >> URL: http://svn.freebsd.org/changeset/base/209634 >> >> Log: >> Rework r209456: >> Instead of using fake rid (which ISA doesn't like), delete untrusted >> IRQ resource and let it be recreated. >> >> Modified: >> head/sys/x86/isa/atrtc.c >> head/sys/x86/isa/clock.c >> >> Modified: head/sys/x86/isa/atrtc.c >> ============================================================================== >> >> --- head/sys/x86/isa/atrtc.c Thu Jul 1 17:46:12 2010 (r209633) >> +++ head/sys/x86/isa/atrtc.c Thu Jul 1 18:51:18 2010 (r209634) >> @@ -259,7 +259,8 @@ atrtc_attach(device_t dev) >> if (!atrtcclock_disable && >> (resource_int_value(device_get_name(dev), device_get_unit(dev), >> "clock", &i) != 0 || i != 0)) { >> - sc->intr_rid = -1; >> + sc->intr_rid = 0; >> + bus_delete_resource(dev, SYS_RES_IRQ, sc->intr_rid); >> if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, >> &sc->intr_rid, 8, 8, 1, RF_ACTIVE))) { >> device_printf(dev,"Can't map interrupt.\n"); >> >> Modified: head/sys/x86/isa/clock.c >> ============================================================================== >> >> --- head/sys/x86/isa/clock.c Thu Jul 1 17:46:12 2010 (r209633) >> +++ head/sys/x86/isa/clock.c Thu Jul 1 18:51:18 2010 (r209634) >> @@ -535,7 +535,8 @@ attimer_attach(device_t dev) >> tc_init(&sc->tc); >> if (resource_int_value(device_get_name(dev), device_get_unit(dev), >> "clock", &i) != 0 || i != 0) { >> - sc->intr_rid = -1; >> + sc->intr_rid = 0; >> + bus_delete_resource(dev, SYS_RES_IRQ, sc->intr_rid); >> if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, >> &sc->intr_rid, 0, 0, 1, RF_ACTIVE))) { >> device_printf(dev,"Can't map interrupt.\n"); >> >> > > -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 18:15:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6E93106566B; Sat, 10 Jul 2010 18:15:56 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id CD3A18FC21; Sat, 10 Jul 2010 18:15:55 +0000 (UTC) Received: by fxm13 with SMTP id 13so1837046fxm.13 for ; Sat, 10 Jul 2010 11:15:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=MFiF1dHRBvMo1RAZNZz9x6xIASuTmtXuG9Hh/EtZVoQ=; b=Y8JIwFw45TkDgI3JY++Vnu6hHqyW+r3F/h8ak/UJpIQMGbWMTfJyavWsphUttO+Rc7 g4Qyu/v4fMUKfSUiVZC4u42g4M6iE3Wm+3tpCL7tg273D9KTokBac7xk6lgk0dNJ+TkH kwsNfcyY28mITRPwUlkRZ6ge91GBLWSgvrHf8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=DNQic91tXXBFfbp3jAGnqK6Dvn8I72cu0+VCeCbzAqvhDFz+fYISTB0au9iBIszhjJ RVYb1Py1oE2nzCnNlZcz3XL5aVh+R/nTFXBviafcuOeW3GYTbWoEPEE4oAW11ME3uzGD rqclQaAXi00vcSZS757777wPL6SB1hUZjw0YA= Received: by 10.223.123.199 with SMTP id q7mr9659300far.92.1278785752193; Sat, 10 Jul 2010 11:15:52 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id q28sm4801893faa.41.2010.07.10.11.15.50 (version=SSLv3 cipher=RC4-MD5); Sat, 10 Jul 2010 11:15:51 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C38B8D4.1020804@FreeBSD.org> Date: Sat, 10 Jul 2010 21:15:48 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Doug Barton References: <201007011851.o61IpI9r054345@svn.freebsd.org> <4C38B747.9020104@FreeBSD.org> In-Reply-To: <4C38B747.9020104@FreeBSD.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209634 - head/sys/x86/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 18:15:57 -0000 Hi. Doug Barton wrote: > Did you see this message from me? Any hope of getting this fixed? Yes, sorry. I am just not sure how to properly do it. Two previous attempts appeared to be wrong: one for ISA PNP, another for ACPI. :( I'll look on it again tomorrow. > On 07/04/10 18:10, Doug Barton wrote: >> This commit results in a panic at boot time for me very early on. >> Screenshots at: >> http://people.freebsd.org/~dougb/panic-01.jpg >> http://people.freebsd.org/~dougb/panic-02.jpg >> http://people.freebsd.org/~dougb/panic-03.jpg >> >> Not sure if it's relevant or not, but after the trace is done I typed >> 'call reboot()' and it said "panic: privcheck td != curthread" >> >> This is on -current, Core 2 Duo, i386, SMP. Updating to the revision >> immediately before this one is fine, so I'm sure this is the change that >> is causing the panic. >> >> >> Doug >> >> >> On Thu, 1 Jul 2010, Alexander Motin wrote: >> >>> Author: mav >>> Date: Thu Jul 1 18:51:18 2010 >>> New Revision: 209634 >>> URL: http://svn.freebsd.org/changeset/base/209634 >>> >>> Log: >>> Rework r209456: >>> Instead of using fake rid (which ISA doesn't like), delete untrusted >>> IRQ resource and let it be recreated. >>> >>> Modified: >>> head/sys/x86/isa/atrtc.c >>> head/sys/x86/isa/clock.c >>> >>> Modified: head/sys/x86/isa/atrtc.c >>> ============================================================================== >>> >>> --- head/sys/x86/isa/atrtc.c Thu Jul 1 17:46:12 2010 (r209633) >>> +++ head/sys/x86/isa/atrtc.c Thu Jul 1 18:51:18 2010 (r209634) >>> @@ -259,7 +259,8 @@ atrtc_attach(device_t dev) >>> if (!atrtcclock_disable && >>> (resource_int_value(device_get_name(dev), device_get_unit(dev), >>> "clock", &i) != 0 || i != 0)) { >>> - sc->intr_rid = -1; >>> + sc->intr_rid = 0; >>> + bus_delete_resource(dev, SYS_RES_IRQ, sc->intr_rid); >>> if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, >>> &sc->intr_rid, 8, 8, 1, RF_ACTIVE))) { >>> device_printf(dev,"Can't map interrupt.\n"); >>> >>> Modified: head/sys/x86/isa/clock.c >>> ============================================================================== >>> >>> --- head/sys/x86/isa/clock.c Thu Jul 1 17:46:12 2010 (r209633) >>> +++ head/sys/x86/isa/clock.c Thu Jul 1 18:51:18 2010 (r209634) >>> @@ -535,7 +535,8 @@ attimer_attach(device_t dev) >>> tc_init(&sc->tc); >>> if (resource_int_value(device_get_name(dev), device_get_unit(dev), >>> "clock", &i) != 0 || i != 0) { >>> - sc->intr_rid = -1; >>> + sc->intr_rid = 0; >>> + bus_delete_resource(dev, SYS_RES_IRQ, sc->intr_rid); >>> if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, >>> &sc->intr_rid, 0, 0, 1, RF_ACTIVE))) { >>> device_printf(dev,"Can't map interrupt.\n"); >>> >>> >> > > > -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 18:22:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77FD11065672; Sat, 10 Jul 2010 18:22:45 +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 5DF188FC17; Sat, 10 Jul 2010 18:22:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6AIMjmx032401; Sat, 10 Jul 2010 18:22:45 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6AIMjnG032398; Sat, 10 Jul 2010 18:22:45 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201007101822.o6AIMjnG032398@svn.freebsd.org> From: Alan Cox Date: Sat, 10 Jul 2010 18:22: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: r209887 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 18:22:45 -0000 Author: alc Date: Sat Jul 10 18:22:44 2010 New Revision: 209887 URL: http://svn.freebsd.org/changeset/base/209887 Log: Reduce the number of global TLB shootdowns generated by pmap_qenter(). Specifically, teach pmap_qenter() to recognize the case when it is being asked to replace a mapping with the very same mapping and not generate a shootdown. Unfortunately, the buffer cache commonly passes an entire buffer to pmap_qenter() when only a subset of the mappings are changing. For the extension of buffers in allocbuf() this was resulting in unnecessary shootdowns. The addition of new pages to the end of the buffer need not and did not trigger a shootdown, but overwriting the initial mappings with the very same mappings was seen as a change that necessitated a shootdown. With this change, that is no longer so. For a "buildworld" on amd64, this change eliminates 14-15% of the pmap_invalidate_range() shootdowns, and about 4% of the overall shootdowns. MFC after: 3 weeks Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Jul 10 17:46:53 2010 (r209886) +++ head/sys/amd64/amd64/pmap.c Sat Jul 10 18:22:44 2010 (r209887) @@ -1331,19 +1331,22 @@ pmap_map(vm_offset_t *virt, vm_paddr_t s void pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) { - pt_entry_t *endpte, oldpte, *pte; + pt_entry_t *endpte, oldpte, pa, *pte; + vm_page_t m; oldpte = 0; pte = vtopte(sva); endpte = pte + count; while (pte < endpte) { - oldpte |= *pte; - pte_store(pte, VM_PAGE_TO_PHYS(*ma) | PG_G | - pmap_cache_bits((*ma)->md.pat_mode, 0) | PG_RW | PG_V); + m = *ma++; + pa = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(m->md.pat_mode, 0); + if ((*pte & (PG_FRAME | PG_PTE_CACHE)) != pa) { + oldpte |= *pte; + pte_store(pte, pa | PG_G | PG_RW | PG_V); + } pte++; - ma++; } - if ((oldpte & PG_V) != 0) + if (__predict_false((oldpte & PG_V) != 0)) pmap_invalidate_range(kernel_pmap, sva, sva + count * PAGE_SIZE); } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat Jul 10 17:46:53 2010 (r209886) +++ head/sys/i386/i386/pmap.c Sat Jul 10 18:22:44 2010 (r209887) @@ -1461,19 +1461,22 @@ pmap_map(vm_offset_t *virt, vm_paddr_t s void pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) { - pt_entry_t *endpte, oldpte, *pte; + pt_entry_t *endpte, oldpte, pa, *pte; + vm_page_t m; oldpte = 0; pte = vtopte(sva); endpte = pte + count; while (pte < endpte) { - oldpte |= *pte; - pte_store(pte, VM_PAGE_TO_PHYS(*ma) | pgeflag | - pmap_cache_bits((*ma)->md.pat_mode, 0) | PG_RW | PG_V); + m = *ma++; + pa = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(m->md.pat_mode, 0); + if ((*pte & (PG_FRAME | PG_PTE_CACHE)) != pa) { + oldpte |= *pte; + pte_store(pte, pa | pgeflag | PG_RW | PG_V); + } pte++; - ma++; } - if ((oldpte & PG_V) != 0) + if (__predict_false((oldpte & PG_V) != 0)) pmap_invalidate_range(kernel_pmap, sva, sva + count * PAGE_SIZE); } From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 19:05:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66A3F1065673 for ; Sat, 10 Jul 2010 19:05:30 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 6FAE38FC16 for ; Sat, 10 Jul 2010 19:05:29 +0000 (UTC) Received: (qmail 14260 invoked by uid 399); 10 Jul 2010 19:05:28 -0000 Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 10 Jul 2010 19:05:28 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C38C477.3060404@FreeBSD.org> Date: Sat, 10 Jul 2010 12:05:27 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.10) Gecko/20100701 Thunderbird/3.0.5 MIME-Version: 1.0 To: Alexander Motin References: <201007011851.o61IpI9r054345@svn.freebsd.org> <4C38B747.9020104@FreeBSD.org> <4C38B8D4.1020804@FreeBSD.org> In-Reply-To: <4C38B8D4.1020804@FreeBSD.org> X-Enigmail-Version: 1.0.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209634 - head/sys/x86/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 19:05:30 -0000 On 07/10/10 11:15, Alexander Motin wrote: > Hi. > > Doug Barton wrote: >> Did you see this message from me? Any hope of getting this fixed? > > Yes, sorry. I am just not sure how to properly do it. Two previous > attempts appeared to be wrong: one for ISA PNP, another for ACPI. :( > I'll look on it again tomorrow. Ok, thanks. I cc'ed you on the message from the user on -current that's in the same boat, so it looks like the problem is more than just me. If you need patches tested, just let me know. Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 21:39:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F18DA106564A; Sat, 10 Jul 2010 21:39:03 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C71D68FC16; Sat, 10 Jul 2010 21:39:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6ALd3AW075356; Sat, 10 Jul 2010 21:39:03 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6ALd3lw075355; Sat, 10 Jul 2010 21:39:03 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201007102139.o6ALd3lw075355@svn.freebsd.org> From: Weongyo Jeong Date: Sat, 10 Jul 2010 21:39: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: r209888 - head/sys/dev/bwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 21:39:04 -0000 Author: weongyo Date: Sat Jul 10 21:39:03 2010 New Revision: 209888 URL: http://svn.freebsd.org/changeset/base/209888 Log: Fixes a bug for LP PHY that some frames have 2 padding bytes at the start so we should adjust the mbuf if the driver is running in PIO mode. Now it should work well with WPA authentication and association for LP PHY devices. Tested by: Warren Block MFC after: 1 month Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat Jul 10 18:22:44 2010 (r209887) +++ head/sys/dev/bwn/if_bwn.c Sat Jul 10 21:39:03 2010 (r209888) @@ -9072,7 +9072,7 @@ bwn_pio_rxeof(struct bwn_pio_rxqueue *pr struct mbuf *m; uint32_t ctl32, macstat, v32; unsigned int i, padding; - uint16_t ctl16, len, v16; + uint16_t ctl16, len, totlen, v16; unsigned char *mp; char *data; @@ -9131,7 +9131,8 @@ ready: } padding = (macstat & BWN_RX_MAC_PADDING) ? 2 : 0; - KASSERT(len + padding <= MCLBYTES, ("too big..\n")); + totlen = len + padding; + KASSERT(totlen <= MCLBYTES, ("too big..\n")); m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { device_printf(sc->sc_dev, "%s: out of memory", __func__); @@ -9139,12 +9140,12 @@ ready: } mp = mtod(m, unsigned char *); if (prq->prq_rev >= 8) { - siba_read_multi_4(sc->sc_dev, mp + padding, (len & ~3), + siba_read_multi_4(sc->sc_dev, mp, (totlen & ~3), prq->prq_base + BWN_PIO8_RXDATA); - if (len & 3) { + if (totlen & 3) { v32 = bwn_pio_rx_read_4(prq, BWN_PIO8_RXDATA); - data = &(mp[len + padding - 1]); - switch (len & 3) { + data = &(mp[totlen - 1]); + switch (totlen & 3) { case 3: *data = (v32 >> 16); data--; @@ -9156,16 +9157,16 @@ ready: } } } else { - siba_read_multi_2(sc->sc_dev, mp + padding, (len & ~1), + siba_read_multi_2(sc->sc_dev, mp, (totlen & ~1), prq->prq_base + BWN_PIO_RXDATA); - if (len & 1) { + if (totlen & 1) { v16 = bwn_pio_rx_read_2(prq, BWN_PIO_RXDATA); - mp[len + padding - 1] = v16; + mp[totlen - 1] = v16; } } m->m_pkthdr.rcvif = ifp; - m->m_len = m->m_pkthdr.len = len + padding; + m->m_len = m->m_pkthdr.len = totlen; bwn_rxeof(prq->prq_mac, m, &rxhdr); From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 22:06:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00E1C106564A; Sat, 10 Jul 2010 22:06:52 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3F7D8FC15; Sat, 10 Jul 2010 22:06:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6AM6piU081451; Sat, 10 Jul 2010 22:06:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6AM6pSJ081448; Sat, 10 Jul 2010 22:06:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007102206.o6AM6pSJ081448@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 10 Jul 2010 22:06:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209889 - head/usr.sbin/crunch/crunchide X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 22:06:52 -0000 Author: nwhitehorn Date: Sat Jul 10 22:06:51 2010 New Revision: 209889 URL: http://svn.freebsd.org/changeset/base/209889 Log: Teach crunchide(1) about PPC ELF64. Modified: head/usr.sbin/crunch/crunchide/Makefile head/usr.sbin/crunch/crunchide/exec_elf32.c Modified: head/usr.sbin/crunch/crunchide/Makefile ============================================================================== --- head/usr.sbin/crunch/crunchide/Makefile Sat Jul 10 21:39:03 2010 (r209888) +++ head/usr.sbin/crunch/crunchide/Makefile Sat Jul 10 22:06:51 2010 (r209889) @@ -10,7 +10,7 @@ CFLAGS+=-DNLIST_AOUT SRCS+= exec_aout.c .endif -.if ${TARGET_ARCH} == ia64 || \ +.if ${TARGET_ARCH} == ia64 || ${TARGET_ARCH} == powerpc64 || \ ${TARGET_ARCH} == sparc64 || ${TARGET_ARCH} == amd64 CFLAGS+=-DNLIST_ELF64 SRCS+= exec_elf64.c Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c ============================================================================== --- head/usr.sbin/crunch/crunchide/exec_elf32.c Sat Jul 10 21:39:03 2010 (r209888) +++ head/usr.sbin/crunch/crunchide/exec_elf32.c Sat Jul 10 22:06:51 2010 (r209889) @@ -176,6 +176,10 @@ ELFNAMEEND(check)(int fd, const char *fn #define EM_PPC 20 #endif case EM_PPC: break; +#ifndef EM_PPC64 +#define EM_PPC64 21 +#endif + case EM_PPC64: break; #ifndef EM_SPARCV9 #define EM_SPARCV9 43 #endif From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 22:07:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DC5E106564A; Sat, 10 Jul 2010 22:07:49 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CDB68FC1D; Sat, 10 Jul 2010 22:07:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6AM7nNx081686; Sat, 10 Jul 2010 22:07:49 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6AM7n0W081684; Sat, 10 Jul 2010 22:07:49 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201007102207.o6AM7n0W081684@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 10 Jul 2010 22:07: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: r209890 - head/secure/lib/libcrypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 22:07:49 -0000 Author: nwhitehorn Date: Sat Jul 10 22:07:48 2010 New Revision: 209890 URL: http://svn.freebsd.org/changeset/base/209890 Log: OpenSSL configuration for powerpc64 Obtained from: projects/ppc64 Added: head/secure/lib/libcrypto/opensslconf-powerpc64.h - copied, changed from r209845, head/secure/lib/libcrypto/opensslconf-powerpc.h Copied and modified: head/secure/lib/libcrypto/opensslconf-powerpc64.h (from r209845, head/secure/lib/libcrypto/opensslconf-powerpc.h) ============================================================================== --- head/secure/lib/libcrypto/opensslconf-powerpc.h Fri Jul 9 11:27:33 2010 (r209845, copy source) +++ head/secure/lib/libcrypto/opensslconf-powerpc64.h Sat Jul 10 22:07:48 2010 (r209890) @@ -110,13 +110,13 @@ /* If this is set to 'unsigned int' on a DEC Alpha, this gives about a * %20 speed up (longs are 8 bytes, int's are 4). */ #ifndef DES_LONG -#define DES_LONG unsigned long +#define DES_LONG unsigned int #endif #endif #if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) #define CONFIG_HEADER_BN_H -#define BN_LLONG +#undef BN_LLONG /* Should we define BN_DIV2W here? */ @@ -124,9 +124,9 @@ /* The prime number generation stuff may not work when * EIGHT_BIT but I don't care since I've only used this mode * for debuging the bignum libraries */ -#undef SIXTY_FOUR_BIT_LONG +#define SIXTY_FOUR_BIT_LONG #undef SIXTY_FOUR_BIT -#define THIRTY_TWO_BIT +#undef THIRTY_TWO_BIT #undef SIXTEEN_BIT #undef EIGHT_BIT #endif From owner-svn-src-all@FreeBSD.ORG Sat Jul 10 22:37:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5DB7106566C; Sat, 10 Jul 2010 22:37:23 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C54078FC17; Sat, 10 Jul 2010 22:37:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6AMbNJH088257; Sat, 10 Jul 2010 22:37:23 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6AMbNI7088255; Sat, 10 Jul 2010 22:37:23 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201007102237.o6AMbNI7088255@svn.freebsd.org> From: Weongyo Jeong Date: Sat, 10 Jul 2010 22:37:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209892 - head/sys/dev/bwi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 22:37:23 -0000 Author: weongyo Date: Sat Jul 10 22:37:23 2010 New Revision: 209892 URL: http://svn.freebsd.org/changeset/base/209892 Log: Fixes a page fault in bwi_pci_probe() because the array isn't terminated with NULL. PR: kern/148473 Submitted by: Grzegorz Dabrowski MFC after: 1 week Modified: head/sys/dev/bwi/if_bwi_pci.c Modified: head/sys/dev/bwi/if_bwi_pci.c ============================================================================== --- head/sys/dev/bwi/if_bwi_pci.c Sat Jul 10 22:29:05 2010 (r209891) +++ head/sys/dev/bwi/if_bwi_pci.c Sat Jul 10 22:37:23 2010 (r209892) @@ -91,7 +91,8 @@ static const struct bwi_dev { { PCI_VENDOR_BROADCOM, 0x4324,"Broadcom BCM4309 802.11a/b/g Wireless Lan" }, { PCI_VENDOR_BROADCOM, 0x4318,"Broadcom BCM4318 802.11b/g Wireless Lan" }, { PCI_VENDOR_BROADCOM, 0x4319,"Broadcom BCM4318 802.11a/b/g Wireless Lan" }, - { PCI_VENDOR_BROADCOM, 0x431a,"Broadcom BCM4318 802.11a Wireless Lan" } + { PCI_VENDOR_BROADCOM, 0x431a,"Broadcom BCM4318 802.11a Wireless Lan" }, + { 0, 0, NULL } }; static int