From owner-svn-src-head@FreeBSD.ORG Sun Jul 4 05:58:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jul 4 07:42:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jul 4 08:09:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jul 4 11:13:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jul 4 11:26:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jul 4 11:43:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jul 4 11:48:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jul 4 12:08:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jul 4 12:09:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jul 4 12:43:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jul 4 18:16:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jul 4 19:02:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jul 4 20:39:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jul 4 22:17:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Mon Jul 5 01:10:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BDD21065677 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 D8C188FC17 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jul 5 03:55:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jul 5 16:23:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jul 5 19:01:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jul 5 21:13:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Tue Jul 6 02:07:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 03:48:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 07:07:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 07:11:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 08:56:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 10:28:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 10:45:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 12:13:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 15:27:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 15:31:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 15:38:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 16:42:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 16:55:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 16:56:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 17:00:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 17:20:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 18:05:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 18:06:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 18:07:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 18:08:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 18:17:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 18:20:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 18:22:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 19:03:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 19:05:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 19:43:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 20:57:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 21:41:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 22:33:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 23:13:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 23:29:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jul 6 23:31:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Wed Jul 7 00:03:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jul 7 06:06:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jul 7 07:09:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jul 7 09:23:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jul 7 11:19:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jul 7 12:00:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jul 7 12:09:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jul 7 12:44:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jul 7 15:05:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jul 7 17:44:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jul 7 17:48:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 400AC10656CD for ; Wed, 7 Jul 2010 17:48:42 +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 C28B78FC1E 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jul 7 17:59:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jul 7 19:06:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jul 7 19:34:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jul 7 20:06:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jul 7 20:07:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jul 7 21:49:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jul 7 22:53:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jul 7 23:01:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Thu Jul 8 03:28:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 03:35:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 05:11:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19CF7106566B; Thu, 8 Jul 2010 05:11:07 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [204.109.60.94]) by mx1.freebsd.org (Postfix) with ESMTP id D0F388FC17; Thu, 8 Jul 2010 05:11:06 +0000 (UTC) Received: from unknown (client-82-31-2-50.midd.adsl.virginmedia.com [82.31.2.50]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 8E0FE5D42; Thu, 8 Jul 2010 05:10:57 +0000 (UTC) Date: Thu, 8 Jul 2010 06:11:01 +0100 From: Bruce Cran To: Randi Harper Message-ID: <20100708061101.00005e8b@unknown> In-Reply-To: <201007072253.o67MrxkL028447@svn.freebsd.org> References: <201007072253.o67MrxkL028447@svn.freebsd.org> X-Mailer: Claws Mail 3.7.4cvs1 (GTK+ 2.16.0; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org Subject: Re: svn commit: r209782 - head/usr.sbin/sysinstall X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 05:11:07 -0000 On Wed, 7 Jul 2010 22:53:59 +0000 (UTC) Randi Harper wrote: > + 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)); > + I'm wondering if server.sin_len should be set too? sendto in uipc_syscalls.c appears to want it set (it calls sendit() which calls getsockaddr() which gets passed mp->msg_namelen). -- Bruce From owner-svn-src-head@FreeBSD.ORG Thu Jul 8 08:13:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 08:31:46 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 08:37:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 08:39:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 08:53:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 90E3A1065680 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 3126415013D 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 09:15:32 2010 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 09:35:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 09:43:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 13:07:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 14:08:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 14:19:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 14:29:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 14:34:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 14:35:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 14:40:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 14:49:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 14:56:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 14:59:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 15:05:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 15:20:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 15:22:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 15:37:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 15:38:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 16:06:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 16:11:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 16:39:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 16:53:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 18:15:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 18:22:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 19:15:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 19:22:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 21:26:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 21:28:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 21:36:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 22:13:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 22:21:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jul 8 23:26:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D28CB106566C for ; Thu, 8 Jul 2010 23:26:36 +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 75FC38FC1D 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 23:26:36 -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-head@FreeBSD.ORG Fri Jul 9 00:35:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 00:36:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 00:38:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 03:03:16 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 05:25:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 10:57:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 11:27:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 13:46:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 13:53:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 13:59:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 14:00:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 14:01:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 14:02:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 14:02:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 14:04:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 15:04:17 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 17:11:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 17:38:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 18:50:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EA841065677; Fri, 9 Jul 2010 18:50:30 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 49A228FC1C; Fri, 9 Jul 2010 18:50:30 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id C4F9446BA1; Fri, 9 Jul 2010 14:50:29 -0400 (EDT) Date: Fri, 9 Jul 2010 19:50:29 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Gabor PALI In-Reply-To: <4C376B0E.9050505@FreeBSD.org> Message-ID: References: <4C376B0E.9050505@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 Subject: Re: svn commit: r209119 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 18:50:30 -0000 On Fri, 9 Jul 2010, Gabor PALI wrote: > On 06/18/10 14:08, Robert Watson wrote: >> The only reservation I have, really, is that 64-bit writes are > non-atomic on >> i386 and other 32-bit architectures (or, at least, I think they are). > This >> means DPCPU_SUM may encounter non-atomicity rather than just staleness > in the >> values it reads as it iterates. That said, we should probably use 64-bit >> anyway, because 32-bit counters are gauche. :-) > > What is about introducing 64-bit atomic counters? There's no native 64-bit atomic add primitive on most 32-bit platforms; however, I think I have an e-mail in my in queue from you suggesting an alternative approach that I haven't yet gotten to due to utter saturation here. I assume there are reasonable alternatives that work around the potential race with a small probability of a missed or extra update, or similar, which would be fine. Robert From owner-svn-src-head@FreeBSD.ORG Fri Jul 9 18:58:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AA3F1065673 for ; Fri, 9 Jul 2010 18:58:54 +0000 (UTC) (envelope-from pali.gabor@googlemail.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 019DE8FC18 for ; Fri, 9 Jul 2010 18:58:53 +0000 (UTC) Received: by bwz12 with SMTP id 12so1593613bwz.13 for ; Fri, 09 Jul 2010 11:58:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :organization:user-agent:mime-version:to:cc:subject :x-enigmail-version:content-type:content-transfer-encoding; bh=f2z6lB2gSqdyOx/SEdJA+54QnMl85Zzbsyl+ZZUCnDM=; b=TH4cIczddt3komU9CD8Y8HmGrlhqUXUAB4YeEwDHU9t2mGtjpFTYiTAHtry9GaFqt6 PDpdO20yJU8eBzDHN6evCf7/0Kjbqz3DkweRQZYtUcn2oNMezfZZb3X7Aj7vu3hFpRPB ONxGOFm8kTUQXdkJ98MGk8yT6Dvsw1l0J/Dv4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=sender:message-id:date:from:organization:user-agent:mime-version:to :cc:subject:x-enigmail-version:content-type :content-transfer-encoding; b=ZZMG4wt8UjRqANsr7/qHu74iNAa/vM2FrgMbwQUA9WTmoMIbxESizMnER9rTEccjJ4 Fnhzc6yobczur0Zwh8kGJZ71zkIo2o4uVu6fjDzUAtGMMuTJu62XRc8QX/lpwVo8FvwL JL6Pi4DMk9tRcJeXNymA/+nI/wn1DYX0xSP/4= Received: by 10.204.162.204 with SMTP id w12mr7588440bkx.135.1278700607902; Fri, 09 Jul 2010 11:36:47 -0700 (PDT) Received: from [129.16.199.244] (dhcp-199-244.nomad.chalmers.se [129.16.199.244]) by mx.google.com with ESMTPS id y2sm4848308bkx.20.2010.07.09.11.36.45 (version=SSLv3 cipher=RC4-MD5); Fri, 09 Jul 2010 11:36:46 -0700 (PDT) Sender: =?UTF-8?B?UMOBTEkgR8OhYm9yIErDoW5vcw==?= Message-ID: <4C376B0E.9050505@FreeBSD.org> Date: Fri, 09 Jul 2010 20:31:42 +0200 From: Gabor PALI Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100331 Thunderbird/3.0.4 MIME-Version: 1.0 To: Robert Watson X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org Subject: Re: svn commit: r209119 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 18:58:54 -0000 On 06/18/10 14:08, Robert Watson wrote: > The only reservation I have, really, is that 64-bit writes are non-atomic on > i386 and other 32-bit architectures (or, at least, I think they are). This > means DPCPU_SUM may encounter non-atomicity rather than just staleness in the > values it reads as it iterates. That said, we should probably use 64-bit > anyway, because 32-bit counters are gauche. :-) What is about introducing 64-bit atomic counters? Cheers, :g From owner-svn-src-head@FreeBSD.ORG Fri Jul 9 19:03:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1834106564A; Fri, 9 Jul 2010 19:03:14 +0000 (UTC) (envelope-from pali.gabor@googlemail.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 199B08FC13; Fri, 9 Jul 2010 19:03:13 +0000 (UTC) Received: by bwz12 with SMTP id 12so1596766bwz.13 for ; Fri, 09 Jul 2010 12:03:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :organization:user-agent:mime-version:to:cc:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=Y2FagyTeZyaJ5qtPNLWv2lWR5l2vBPLDRnjZ3qMJ9lE=; b=xbho+ydClF3xmgQhd55tJo4cZXiHWQByM9PV/otuVVhudPGNWbYJwqhRAnQ5umAtVC 6uVZQXBE/QcU/rNGRgzNOIP/SP80QXb6un1vDYQHlMjdY0z1X36rY2iZ0xPDTgvgNGXb IoZELdimNJoz5J2RSGlnSptWl39Yh1ByPzaPA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=sender:message-id:date:from:organization:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=ZE5DoSEoQyZ+34rNcbC9+LGk8MRdxhCu25Z+BVbrbsAGLR3OXB8Bn2wac8lXkAc6in Q64FdrQK8BZS1xxrNVHgczEPf3PsaTWwJmohTgh6esdr7g9nWr/h2Qo2YoEK6OFWx5ea 04dlaLWLS5VPUW16BZ/iylsbiqw8o3mDFnH2Y= Received: by 10.204.83.167 with SMTP id f39mr7872077bkl.151.1278702190118; Fri, 09 Jul 2010 12:03:10 -0700 (PDT) Received: from [129.16.199.244] (dhcp-199-244.nomad.chalmers.se [129.16.199.244]) by mx.google.com with ESMTPS id x19sm4940144bkv.21.2010.07.09.12.03.09 (version=SSLv3 cipher=RC4-MD5); Fri, 09 Jul 2010 12:03:09 -0700 (PDT) Sender: =?UTF-8?B?UMOBTEkgR8OhYm9yIErDoW5vcw==?= Message-ID: <4C37713D.5060202@FreeBSD.org> Date: Fri, 09 Jul 2010 20:58:05 +0200 From: Gabor PALI Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100331 Thunderbird/3.0.4 MIME-Version: 1.0 To: Robert Watson References: <4C376B0E.9050505@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org Subject: Re: svn commit: r209119 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 19:03:14 -0000 On 07/09/10 20:50, Robert Watson wrote: > I think I have an e-mail in my in queue from you suggesting an > alternative approach that I haven't yet gotten to due to utter > saturation here. That is why I CC'ed svn-src-head@ :) (But I do not see any sign whether my last email reached it -- I am not an that list.) I hope other committers will help me with this, because I would like to use it in my project, and I think it would be useful in general. > I assume there are reasonable alternatives that work around the > potential race with a small probability of a missed or extra update, > or similar, which would be fine. In a few words: As far as I know, 64-bit atomic counters could be implemented by using cmpxchg8b or by a plain uint64_t variable protected by some kind of locking(9). Cheers, :g From owner-svn-src-head@FreeBSD.ORG Fri Jul 9 19:38:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 20:05:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 20:48:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 21:06:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 21:21:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 21:25:00 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 21:27:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 21:28:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 21:33:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 21:36:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jul 9 23:22:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Sat Jul 10 02:29:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 02:32:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 03:45:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 11:40:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 13:32:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 13:46:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 14:31:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 14:33:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 14:34:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 14:39:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 14:40:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 14:45:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 15:13:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 15:15:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 15:16:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 15:24:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB4FB106564A; Sat, 10 Jul 2010 15:24:46 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C5FD68FC12; Sat, 10 Jul 2010 15:24:46 +0000 (UTC) Received: from [192.168.2.105] (host86-162-156-210.range86-162.btcentralplus.com [86.162.156.210]) by cyrus.watson.org (Postfix) with ESMTPSA id EE03246BA7; Sat, 10 Jul 2010 11:24:45 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: <4C37713D.5060202@FreeBSD.org> Date: Sat, 10 Jul 2010 16:24:43 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <4A28A601-C87F-47C6-8CBE-5F1BF866CA4A@FreeBSD.org> References: <4C376B0E.9050505@FreeBSD.org> <4C37713D.5060202@FreeBSD.org> To: Gabor PALI X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@freebsd.org Subject: Re: svn commit: r209119 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 15:24:47 -0000 On 9 Jul 2010, at 19:58, Gabor PALI wrote: >> I assume there are reasonable alternatives that work around the >> potential race with a small probability of a missed or extra update, >> or similar, which would be fine. >=20 > In a few words: As far as I know, 64-bit atomic counters could be > implemented by using cmpxchg8b or by a plain uint64_t variable = protected > by some kind of locking(9). If we can do it in one atomic in the common case, and two atomics in an = edge case, that sounds fine. I think any use of locking(9) would be = sufficiently costly as to not be worth the improvements in consistency, = given the frequency of statistics operations. Robert= From owner-svn-src-head@FreeBSD.ORG Sat Jul 10 15:27:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 15:36:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 17:43:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 17:46:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 18:09:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DFB71065674 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 0BF178FC1B 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 18:15:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 18:22:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 19:05:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66DB51065674 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 72FFE8FC19 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 21:39:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 22:06:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 22:07:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jul 10 22:37:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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