From owner-svn-src-vendor@FreeBSD.ORG Mon Jun 15 00:54:54 2015 Return-Path: Delivered-To: svn-src-vendor@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3F04C6B; Mon, 15 Jun 2015 00:54:54 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B549587C; Mon, 15 Jun 2015 00:54:54 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5F0ssi3046376; Mon, 15 Jun 2015 00:54:54 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5F0srI0046371; Mon, 15 Jun 2015 00:54:53 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201506150054.t5F0srI0046371@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Mon, 15 Jun 2015 00:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r284395 - vendor/tzdata/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 00:54:55 -0000 Author: edwin Date: Mon Jun 15 00:54:52 2015 New Revision: 284395 URL: https://svnweb.freebsd.org/changeset/base/284395 Log: Vendor import of tzdata2015e: Update to tzdata2015e: Changes affecting future time stamps Morocco will suspend DST from 2015-06-14 03:00 through 2015-07-19 02:00, not 06-13 and 07-18 as we had guessed. (Thanks to Milamber.) Assume Cayman Islands will observe DST starting next year, using US rules. Although it isn't guaranteed, it is the most likely. Obtained from: ftp://ftp.iana.org/tz/releases/ Modified: vendor/tzdata/dist/africa vendor/tzdata/dist/iso3166.tab vendor/tzdata/dist/northamerica vendor/tzdata/dist/southamerica vendor/tzdata/dist/zone1970.tab Modified: vendor/tzdata/dist/africa ============================================================================== --- vendor/tzdata/dist/africa Sun Jun 14 22:36:27 2015 (r284394) +++ vendor/tzdata/dist/africa Mon Jun 15 00:54:52 2015 (r284395) @@ -338,9 +338,10 @@ Rule Egypt 2007 only - Sep Thu>=1 24:00 # time this summer, and carry out studies on the possibility of canceling the # practice altogether in future years." # -# From Paul Eggert (2015-04-20): -# For now, assume DST will be canceled. Any resumption would likely -# use different rules anyway. +# From Paul Eggert (2015-04-24): +# Yesterday the office of Egyptian President El-Sisi announced his +# decision to abandon DST permanently. See Ahram Online 2015-04-24. +# http://english.ahram.org.eg/NewsContent/1/64/128509/Egypt/Politics-/Sisi-cancels-daylight-saving-time-in-Egypt.aspx Rule Egypt 2008 only - Aug lastThu 24:00 0 - Rule Egypt 2009 only - Aug 20 24:00 0 - @@ -787,20 +788,41 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # will resume again at 02:00 on Saturday, August 2, 2014.... # http://www.mmsp.gov.ma/fr/actualites.aspx?id=586 -# From Paul Eggert (2014-06-05): -# For now, guess that later spring and fall transitions will use 2014's rules, +# From Milamber (2015-06-08): +# (Google Translation) The hour will thus be delayed 60 minutes +# Sunday, June 14 at 3:00, the ministry said in a statement, adding +# that the time will be advanced again 60 minutes Sunday, July 19, +# 2015 at 2:00. The move comes under 2.12.126 Decree of 26 Jumada I +# 1433 (18 April 2012) and the decision of the Head of Government of +# 16 N. 3-29-15 Chaaban 1435 (4 June 2015). +# Source (french): +# http://lnt.ma/le-maroc-reculera-dune-heure-le-dimanche-14-juin/ +# +# From Milamber (2015-06-09): +# http://www.mmsp.gov.ma/fr/actualites.aspx?id=863 +# +# From Michael Deckers (2015-06-09): +# [The gov.ma announcement] would (probably) make the switch on 2015-07-19 go +# from 03:00 to 04:00 rather than from 02:00 to 03:00, as in the patch.... +# I think the patch is correct and the quoted text is wrong; the text in +# agrees +# with the patch. + +# From Paul Eggert (2015-06-08): +# For now, guess that later spring and fall transitions will use 2015's rules, # and guess that Morocco will switch to standard time at 03:00 the last -# Saturday before Ramadan, and back to DST at 02:00 the first Saturday after -# Ramadan. To implement this, transition dates for 2015 through 2037 were +# Sunday before Ramadan, and back to DST at 02:00 the first Sunday after +# Ramadan. To implement this, transition dates for 2016 through 2037 were # determined by running the following program under GNU Emacs 24.3, with the # results integrated by hand into the table below. -# (let ((islamic-year 1436)) +# (let ((islamic-year 1437)) +# (require 'cal-islam) # (while (< islamic-year 1460) # (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) # (b (calendar-islamic-to-absolute (list 10 1 islamic-year))) -# (saturday 6)) -# (while (/= saturday (mod (setq a (1- a)) 7))) -# (while (/= saturday (mod b 7)) +# (sunday 0)) +# (while (/= sunday (mod (setq a (1- a)) 7))) +# (while (/= sunday (mod b 7)) # (setq b (1+ b))) # (setq a (calendar-gregorian-from-absolute a)) # (setq b (calendar-gregorian-from-absolute b)) @@ -844,32 +866,30 @@ Rule Morocco 2012 only - Aug 20 2:00 1: Rule Morocco 2013 only - Jul 7 3:00 0 - Rule Morocco 2013 only - Aug 10 2:00 1:00 S Rule Morocco 2013 max - Oct lastSun 3:00 0 - -Rule Morocco 2014 2022 - Mar lastSun 2:00 1:00 S +Rule Morocco 2014 2021 - Mar lastSun 2:00 1:00 S Rule Morocco 2014 only - Jun 28 3:00 0 - Rule Morocco 2014 only - Aug 2 2:00 1:00 S -Rule Morocco 2015 only - Jun 13 3:00 0 - -Rule Morocco 2015 only - Jul 18 2:00 1:00 S -Rule Morocco 2016 only - Jun 4 3:00 0 - -Rule Morocco 2016 only - Jul 9 2:00 1:00 S -Rule Morocco 2017 only - May 20 3:00 0 - -Rule Morocco 2017 only - Jul 1 2:00 1:00 S -Rule Morocco 2018 only - May 12 3:00 0 - -Rule Morocco 2018 only - Jun 16 2:00 1:00 S -Rule Morocco 2019 only - May 4 3:00 0 - -Rule Morocco 2019 only - Jun 8 2:00 1:00 S -Rule Morocco 2020 only - Apr 18 3:00 0 - -Rule Morocco 2020 only - May 30 2:00 1:00 S -Rule Morocco 2021 only - Apr 10 3:00 0 - -Rule Morocco 2021 only - May 15 2:00 1:00 S -Rule Morocco 2022 only - Apr 2 3:00 0 - -Rule Morocco 2022 only - May 7 2:00 1:00 S -Rule Morocco 2023 only - Apr 22 2:00 1:00 S -Rule Morocco 2024 only - Apr 13 2:00 1:00 S -Rule Morocco 2025 only - Apr 5 2:00 1:00 S +Rule Morocco 2015 only - Jun 14 3:00 0 - +Rule Morocco 2015 only - Jul 19 2:00 1:00 S +Rule Morocco 2016 only - Jun 5 3:00 0 - +Rule Morocco 2016 only - Jul 10 2:00 1:00 S +Rule Morocco 2017 only - May 21 3:00 0 - +Rule Morocco 2017 only - Jul 2 2:00 1:00 S +Rule Morocco 2018 only - May 13 3:00 0 - +Rule Morocco 2018 only - Jun 17 2:00 1:00 S +Rule Morocco 2019 only - May 5 3:00 0 - +Rule Morocco 2019 only - Jun 9 2:00 1:00 S +Rule Morocco 2020 only - Apr 19 3:00 0 - +Rule Morocco 2020 only - May 24 2:00 1:00 S +Rule Morocco 2021 only - Apr 11 3:00 0 - +Rule Morocco 2021 only - May 16 2:00 1:00 S +Rule Morocco 2022 only - May 8 2:00 1:00 S +Rule Morocco 2023 only - Apr 23 2:00 1:00 S +Rule Morocco 2024 only - Apr 14 2:00 1:00 S +Rule Morocco 2025 only - Apr 6 2:00 1:00 S Rule Morocco 2026 max - Mar lastSun 2:00 1:00 S -Rule Morocco 2035 only - Oct 27 3:00 0 - -Rule Morocco 2036 only - Oct 18 3:00 0 - -Rule Morocco 2037 only - Oct 10 3:00 0 - +Rule Morocco 2036 only - Oct 19 3:00 0 - +Rule Morocco 2037 only - Oct 4 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 Modified: vendor/tzdata/dist/iso3166.tab ============================================================================== --- vendor/tzdata/dist/iso3166.tab Sun Jun 14 22:36:27 2015 (r284394) +++ vendor/tzdata/dist/iso3166.tab Mon Jun 15 00:54:52 2015 (r284395) @@ -3,11 +3,10 @@ # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. # -# From Paul Eggert (2014-07-18): +# From Paul Eggert (2015-05-02): # This file contains a table of two-letter country codes. Columns are # separated by a single tab. Lines beginning with '#' are comments. -# Although all text currently uses ASCII encoding, this is planned to -# change to UTF-8 soon. The columns of the table are as follows: +# All text uses UTF-8 encoding. The columns of the table are as follows: # # 1. ISO 3166-1 alpha-2 country code, current as of # ISO 3166-1 Newsletter VI-16 (2013-07-11). See: Updates on ISO 3166 @@ -38,7 +37,7 @@ AS Samoa (American) AT Austria AU Australia AW Aruba -AX Aaland Islands +AX Åland Islands AZ Azerbaijan BA Bosnia & Herzegovina BB Barbados @@ -67,7 +66,7 @@ CD Congo (Dem. Rep.) CF Central African Rep. CG Congo (Rep.) CH Switzerland -CI Cote d'Ivoire +CI Côte d'Ivoire CK Cook Islands CL Chile CM Cameroon @@ -211,7 +210,7 @@ PT Portugal PW Palau PY Paraguay QA Qatar -RE Reunion +RE Réunion RO Romania RS Serbia RU Russia Modified: vendor/tzdata/dist/northamerica ============================================================================== --- vendor/tzdata/dist/northamerica Sun Jun 14 22:36:27 2015 (r284394) +++ vendor/tzdata/dist/northamerica Mon Jun 15 00:54:52 2015 (r284395) @@ -2661,7 +2661,17 @@ Zone Atlantic/Bermuda -4:19:18 - LMT 193 -4:00 US A%sT # Cayman Is -# See America/Panama. + +# From Paul Eggert (2015-05-15): +# The Cayman government has decided to introduce DST in 2016, the idea being +# to keep in sync with New York. The legislation hasn't passed but the change +# seems quite likely. See: Meade B. Cayman 27. +# http://www.cayman27.com.ky/2015/05/15/clock-ticks-toward-daylight-saving-time-in-cayman + +Zone America/Cayman -5:25:32 - LMT 1890 # Georgetown + -5:07:11 - KMT 1912 Feb # Kingston Mean Time + -5:00 - EST 2016 + -5:00 US E%sT # Costa Rica @@ -3184,7 +3194,6 @@ Zone America/Managua -5:45:08 - LMT 1890 Zone America/Panama -5:18:08 - LMT 1890 -5:19:36 - CMT 1908 Apr 22 # Colón Mean Time -5:00 - EST -Link America/Panama America/Cayman # Puerto Rico # There are too many San Juans elsewhere, so we'll use 'Puerto_Rico'. Modified: vendor/tzdata/dist/southamerica ============================================================================== --- vendor/tzdata/dist/southamerica Sun Jun 14 22:36:27 2015 (r284394) +++ vendor/tzdata/dist/southamerica Mon Jun 15 00:54:52 2015 (r284395) @@ -30,7 +30,7 @@ # I suggest the use of _Summer time_ instead of the more cumbersome # _daylight-saving time_. _Summer time_ seems to be in general use # in Europe and South America. -# -- E O Cutler, _New York Times_ (1937-02-14), quoted in +# -- E O Cutler, _New York Times_ (1937-02-14), quoted in # H L Mencken, _The American Language: Supplement I_ (1960), p 466 # # Earlier editions of these tables also used the North American style Modified: vendor/tzdata/dist/zone1970.tab ============================================================================== --- vendor/tzdata/dist/zone1970.tab Sun Jun 14 22:36:27 2015 (r284394) +++ vendor/tzdata/dist/zone1970.tab Mon Jun 15 00:54:52 2015 (r284395) @@ -206,6 +206,7 @@ KI -0308-17105 Pacific/Enderbury Phoenix KI +0152-15720 Pacific/Kiritimati Line Islands KP +3901+12545 Asia/Pyongyang KR +3733+12658 Asia/Seoul +KY +1918-08123 America/Cayman KZ +4315+07657 Asia/Almaty most locations KZ +4448+06528 Asia/Qyzylorda Qyzylorda (Kyzylorda, Kzyl-Orda) KZ +5017+05710 Asia/Aqtobe Aqtobe (Aktobe) @@ -259,7 +260,7 @@ NR -0031+16655 Pacific/Nauru NU -1901-16955 Pacific/Niue NZ,AQ -3652+17446 Pacific/Auckland New Zealand time NZ -4357-17633 Pacific/Chatham Chatham Islands -PA,KY +0858-07932 America/Panama +PA +0858-07932 America/Panama PE -1203-07703 America/Lima PF -1732-14934 Pacific/Tahiti Society Islands PF -0900-13930 Pacific/Marquesas Marquesas Islands From owner-svn-src-vendor@FreeBSD.ORG Mon Jun 15 00:55:04 2015 Return-Path: Delivered-To: svn-src-vendor@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9BEA4D91; Mon, 15 Jun 2015 00:55:04 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 710B287D; Mon, 15 Jun 2015 00:55:04 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5F0t4QQ046518; Mon, 15 Jun 2015 00:55:04 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5F0t4lv046517; Mon, 15 Jun 2015 00:55:04 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201506150055.t5F0t4lv046517@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Mon, 15 Jun 2015 00:55:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r284396 - vendor/tzdata/tzdata2015e X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 00:55:04 -0000 Author: edwin Date: Mon Jun 15 00:55:03 2015 New Revision: 284396 URL: https://svnweb.freebsd.org/changeset/base/284396 Log: Tag of tzdata 2015e Added: - copied from r284395, vendor/tzdata/dist/ Directory Properties: vendor/tzdata/tzdata2015e/ (props changed) From owner-svn-src-vendor@FreeBSD.ORG Mon Jun 15 12:50:45 2015 Return-Path: Delivered-To: svn-src-vendor@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B08FBD7; Mon, 15 Jun 2015 12:50:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CBB69B4; Mon, 15 Jun 2015 12:50:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5FCojqk019082; Mon, 15 Jun 2015 12:50:45 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5FCoifP019075; Mon, 15 Jun 2015 12:50:44 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201506151250.t5FCoifP019075@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Jun 2015 12:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r284412 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 12:50:45 -0000 Author: avg Date: Mon Jun 15 12:50:43 2015 New Revision: 284412 URL: https://svnweb.freebsd.org/changeset/base/284412 Log: 5911 ZFS "hangs" while deleting file Reviewed by: Bayard Bell Reviewed by: Alek Pinchuk Reviewed by: Simon Klinkert Reviewed by: Dan McDonald Approved by: Richard Lowe Author: Matthew Ahrens illumos/illumos-gate@46e1baa6cf6d5432f5fd231bb588df8f9570c858 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Mon Jun 15 12:18:11 2015 (r284411) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Mon Jun 15 12:50:43 2015 (r284412) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. @@ -1374,6 +1374,16 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_ dbuf_dirty_record_t *dr, **drp; ASSERT(txg != 0); + + /* + * Due to our use of dn_nlevels below, this can only be called + * in open context, unless we are operating on the MOS. + * From syncing context, dn_nlevels may be different from the + * dn_nlevels used when dbuf was dirtied. + */ + ASSERT(db->db_objset == + dmu_objset_pool(db->db_objset)->dp_meta_objset || + txg != spa_syncing_txg(dmu_objset_spa(db->db_objset))); ASSERT(db->db_blkid != DMU_BONUS_BLKID); ASSERT0(db->db_level); ASSERT(MUTEX_HELD(&db->db_mtx)); @@ -1396,11 +1406,8 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_ ASSERT(db->db.db_size != 0); - /* - * Any space we accounted for in dp_dirty_* will be cleaned up by - * dsl_pool_sync(). This is relatively rare so the discrepancy - * is not a big deal. - */ + dsl_pool_undirty_space(dmu_objset_pool(dn->dn_objset), + dr->dr_accounted, txg); *drp = dr->dr_next; @@ -1415,7 +1422,7 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_ list_remove(&dr->dr_parent->dt.di.dr_children, dr); mutex_exit(&dr->dr_parent->dt.di.dr_mtx); } else if (db->db_blkid == DMU_SPILL_BLKID || - db->db_level+1 == dn->dn_nlevels) { + db->db_level + 1 == dn->dn_nlevels) { ASSERT(db->db_blkptr == NULL || db->db_parent == dn->dn_dbuf); mutex_enter(&dn->dn_mtx); list_remove(&dn->dn_dirty_records[txg & TXG_MASK], dr); @@ -1432,11 +1439,6 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_ VERIFY(arc_buf_remove_ref(dr->dt.dl.dr_data, db)); } - if (db->db_level != 0) { - mutex_destroy(&dr->dt.di.dr_mtx); - list_destroy(&dr->dt.di.dr_children); - } - kmem_free(dr, sizeof (dbuf_dirty_record_t)); ASSERT(db->db_dirtycnt > 0); @@ -2400,7 +2402,7 @@ dbuf_sync_indirect(dbuf_dirty_record_t * zio = dr->dr_zio; mutex_enter(&dr->dt.di.dr_mtx); - dbuf_sync_list(&dr->dt.di.dr_children, tx); + dbuf_sync_list(&dr->dt.di.dr_children, db->db_level - 1, tx); ASSERT(list_head(&dr->dt.di.dr_children) == NULL); mutex_exit(&dr->dt.di.dr_mtx); zio_nowait(zio); @@ -2542,7 +2544,7 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr, } void -dbuf_sync_list(list_t *list, dmu_tx_t *tx) +dbuf_sync_list(list_t *list, int level, dmu_tx_t *tx) { dbuf_dirty_record_t *dr; @@ -2559,6 +2561,10 @@ dbuf_sync_list(list_t *list, dmu_tx_t *t DMU_META_DNODE_OBJECT); break; } + if (dr->dr_dbuf->db_blkid != DMU_BONUS_BLKID && + dr->dr_dbuf->db_blkid != DMU_SPILL_BLKID) { + VERIFY3U(dr->dr_dbuf->db_level, ==, level); + } list_remove(list, dr); if (dr->dr_dbuf->db_level > 0) dbuf_sync_indirect(dr, tx); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Mon Jun 15 12:18:11 2015 (r284411) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Mon Jun 15 12:50:43 2015 (r284412) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. */ #include @@ -685,7 +685,7 @@ dmu_tx_hold_free(dmu_tx_t *tx, uint64_t uint64_t ibyte = i << shift; err = dnode_next_offset(dn, 0, &ibyte, 2, 1, 0); i = ibyte >> shift; - if (err == ESRCH) + if (err == ESRCH || i > end) break; if (err) { tx->tx_err = err; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Mon Jun 15 12:18:11 2015 (r284411) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Mon Jun 15 12:50:43 2015 (r284412) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. */ @@ -1510,6 +1510,16 @@ out: rw_downgrade(&dn->dn_struct_rwlock); } +static void +dnode_dirty_l1(dnode_t *dn, uint64_t l1blkid, dmu_tx_t *tx) +{ + dmu_buf_impl_t *db = dbuf_hold_level(dn, 1, l1blkid, FTAG); + if (db != NULL) { + dmu_buf_will_dirty(&db->db, tx); + dbuf_rele(db, FTAG); + } +} + void dnode_free_range(dnode_t *dn, uint64_t off, uint64_t len, dmu_tx_t *tx) { @@ -1630,27 +1640,67 @@ dnode_free_range(dnode_t *dn, uint64_t o nblks += 1; /* - * Dirty the first and last indirect blocks, as they (and/or their - * parents) will need to be written out if they were only - * partially freed. Interior indirect blocks will be themselves freed, - * by free_children(), so they need not be dirtied. Note that these - * interior blocks have already been prefetched by dmu_tx_hold_free(). + * Dirty all the indirect blocks in this range. Note that only + * the first and last indirect blocks can actually be written + * (if they were partially freed) -- they must be dirtied, even if + * they do not exist on disk yet. The interior blocks will + * be freed by free_children(), so they will not actually be written. + * Even though these interior blocks will not be written, we + * dirty them for two reasons: + * + * - It ensures that the indirect blocks remain in memory until + * syncing context. (They have already been prefetched by + * dmu_tx_hold_free(), so we don't have to worry about reading + * them serially here.) + * + * - The dirty space accounting will put pressure on the txg sync + * mechanism to begin syncing, and to delay transactions if there + * is a large amount of freeing. Even though these indirect + * blocks will not be written, we could need to write the same + * amount of space if we copy the freed BPs into deadlists. */ if (dn->dn_nlevels > 1) { uint64_t first, last; first = blkid >> epbs; - if (db = dbuf_hold_level(dn, 1, first, FTAG)) { - dmu_buf_will_dirty(&db->db, tx); - dbuf_rele(db, FTAG); - } + dnode_dirty_l1(dn, first, tx); if (trunc) last = dn->dn_maxblkid >> epbs; else last = (blkid + nblks - 1) >> epbs; - if (last > first && (db = dbuf_hold_level(dn, 1, last, FTAG))) { - dmu_buf_will_dirty(&db->db, tx); - dbuf_rele(db, FTAG); + if (last != first) + dnode_dirty_l1(dn, last, tx); + + int shift = dn->dn_datablkshift + dn->dn_indblkshift - + SPA_BLKPTRSHIFT; + for (uint64_t i = first + 1; i < last; i++) { + /* + * Set i to the blockid of the next non-hole + * level-1 indirect block at or after i. Note + * that dnode_next_offset() operates in terms of + * level-0-equivalent bytes. + */ + uint64_t ibyte = i << shift; + int err = dnode_next_offset(dn, DNODE_FIND_HAVELOCK, + &ibyte, 2, 1, 0); + i = ibyte >> shift; + if (i >= last) + break; + + /* + * Normally we should not see an error, either + * from dnode_next_offset() or dbuf_hold_level() + * (except for ESRCH from dnode_next_offset). + * If there is an i/o error, then when we read + * this block in syncing context, it will use + * ZIO_FLAG_MUSTSUCCEED, and thus hang/panic according + * to the "failmode" property. dnode_next_offset() + * doesn't have a flag to indicate MUSTSUCCEED. + */ + if (err != 0) + break; + + dnode_dirty_l1(dn, i, tx); } } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c Mon Jun 15 12:18:11 2015 (r284411) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c Mon Jun 15 12:50:43 2015 (r284412) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. */ @@ -700,7 +700,7 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) mutex_exit(&dn->dn_mtx); } - dbuf_sync_list(list, tx); + dbuf_sync_list(list, dn->dn_phys->dn_nlevels - 1, tx); if (!DMU_OBJECT_IS_SPECIAL(dn->dn_object)) { ASSERT3P(list_head(list), ==, NULL); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h Mon Jun 15 12:18:11 2015 (r284411) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h Mon Jun 15 12:50:43 2015 (r284412) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. */ @@ -287,7 +287,7 @@ void dbuf_evict(dmu_buf_impl_t *db); void dbuf_setdirty(dmu_buf_impl_t *db, dmu_tx_t *tx); void dbuf_unoverride(dbuf_dirty_record_t *dr); -void dbuf_sync_list(list_t *list, dmu_tx_t *tx); +void dbuf_sync_list(list_t *list, int level, dmu_tx_t *tx); void dbuf_release_bp(dmu_buf_impl_t *db); void dbuf_free_range(struct dnode *dn, uint64_t start, uint64_t end, From owner-svn-src-vendor@FreeBSD.ORG Mon Jun 15 13:01:07 2015 Return-Path: Delivered-To: svn-src-vendor@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28F75E61; Mon, 15 Jun 2015 13:01:07 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ie0-x231.google.com (mail-ie0-x231.google.com [IPv6:2607:f8b0:4001:c03::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7F6CCC4; Mon, 15 Jun 2015 13:01:06 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by iebgx4 with SMTP id gx4so61658542ieb.0; Mon, 15 Jun 2015 06:01:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=1TkEK95he/41p6OD79ynJQjLwZZBB6oK+E+spCQjuto=; b=z0utqCSpYN/zDZCVuLBGxKxM7FktTouuG3tV6iHFrDSp5hMq9BoIZeXOOnD4FIDl34 XZTX/rgKQRprgw6WDA0xMx2hqXajgNnFQtPbygw7l1oxPfdHcL5Tt9laQoYlp02/aBH4 faa3JiBwngx1oxLffJ5yuIDWcQrXjhONgfIDJWTDdnMx8R2wUOWsERsIMuOLsIlD42Q0 fgqp3VHVf/47e2PCKGPdi5nQ6U7ZSU/r2XBv/a+cMj1/+sZe4vjSRpVwT5JJGa1riOzI 9KDAjiJ6bzOXM2gV+PQZqS+Gid3aqnnG9cMRe4hbsOzZIApn5SK3M4SxmYViY7G+SB1y phjw== X-Received: by 10.50.132.3 with SMTP id oq3mr20310237igb.21.1434373266273; Mon, 15 Jun 2015 06:01:06 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.48.3 with HTTP; Mon, 15 Jun 2015 06:00:45 -0700 (PDT) In-Reply-To: <201506151250.t5FCoifP019075@svn.freebsd.org> References: <201506151250.t5FCoifP019075@svn.freebsd.org> From: Ed Maste Date: Mon, 15 Jun 2015 09:00:45 -0400 X-Google-Sender-Auth: -zuz1UzmnZSHud1ZyeitBUQjez8 Message-ID: Subject: Re: svn commit: r284412 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys To: Andriy Gapon Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-vendor@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 13:01:07 -0000 On 15 June 2015 at 08:50, Andriy Gapon wrote: > Author: avg > Date: Mon Jun 15 12:50:43 2015 > New Revision: 284412 > URL: https://svnweb.freebsd.org/changeset/base/284412 > > Log: > 5911 ZFS "hangs" while deleting file > > Reviewed by: Bayard Bell > Reviewed by: Alek Pinchuk > Reviewed by: Simon Klinkert > Reviewed by: Dan McDonald > Approved by: Richard Lowe > Author: Matthew Ahrens > > illumos/illumos-gate@46e1baa6cf6d5432f5fd231bb588df8f9570c858 It'd be useful to have some more context in the (FreeBSD) commit message for these sorts of changes. I believe 5911 is an upstream bug ID but it's not clear from the context, and I wonder about the scare quotes on "hangs" -- i.e., does it actually hang, or do the scare quotes indicate it actually makes slow progress? From owner-svn-src-vendor@FreeBSD.ORG Mon Jun 15 13:04:30 2015 Return-Path: Delivered-To: svn-src-vendor@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DF6C270; Mon, 15 Jun 2015 13:04:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2F543D8C; Mon, 15 Jun 2015 13:04:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA16444; Mon, 15 Jun 2015 16:04:26 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Z4U3u-0008p5-Av; Mon, 15 Jun 2015 16:04:26 +0300 Message-ID: <557ECD22.8090402@FreeBSD.org> Date: Mon, 15 Jun 2015 16:03:30 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Ed Maste CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-vendor@FreeBSD.org Subject: Re: svn commit: r284412 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys References: <201506151250.t5FCoifP019075@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 13:04:30 -0000 On 15/06/2015 16:00, Ed Maste wrote: > On 15 June 2015 at 08:50, Andriy Gapon wrote: >> Author: avg >> Date: Mon Jun 15 12:50:43 2015 >> New Revision: 284412 >> URL: https://svnweb.freebsd.org/changeset/base/284412 >> >> Log: >> 5911 ZFS "hangs" while deleting file >> >> Reviewed by: Bayard Bell >> Reviewed by: Alek Pinchuk >> Reviewed by: Simon Klinkert >> Reviewed by: Dan McDonald >> Approved by: Richard Lowe >> Author: Matthew Ahrens >> >> illumos/illumos-gate@46e1baa6cf6d5432f5fd231bb588df8f9570c858 > > It'd be useful to have some more context in the (FreeBSD) commit > message for these sorts of changes. I believe 5911 is an upstream bug > ID but it's not clear from the context, and I wonder about the scare > quotes on "hangs" -- i.e., does it actually hang, or do the scare > quotes indicate it actually makes slow progress? > I guess I could extend my script to expand 5911 to https://www.illumos.org/issues/5911 -- Andriy Gapon From owner-svn-src-vendor@FreeBSD.ORG Mon Jun 15 13:43:12 2015 Return-Path: Delivered-To: svn-src-vendor@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54B39269; Mon, 15 Jun 2015 13:43:12 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ig0-x232.google.com (mail-ig0-x232.google.com [IPv6:2607:f8b0:4001:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E5519A2; Mon, 15 Jun 2015 13:43:12 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by igblz2 with SMTP id lz2so50524353igb.1; Mon, 15 Jun 2015 06:43:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=RaLNvc27RohVLYsEvf/71VHjnY4s2z7OcirnEKdjB/s=; b=o1Pww0GINa/etPVyzp2VqfXiOMLFPmMWenzNe6ZP1eT0Ii5ieQWjItkdTd+b97Yq2H 0NBd+iq8WusK0bIALc1oFUyfIHLtdwi5i/RDqwPhYX8o7eAEQrBHCtoz/D8PrTahUid7 LcuyHOq+7cV+eAe1xGwgMJqtnwMw0yo5jOiP+oQt5xISEvJTbE9KA/6QgAZUwQAa0CeA 5Pa3l3VWLKFuAbK2Vn4hXkWTavbq2eZ9gQGrtjiKKdX05c3YAAugIz1/MGpe/zGz4vIU H29pWyprWvp8+IL6K07I49ifIGWK1rFeGqLyGzU4exGYoPx9ruFrMNMrh9czvOFVMXEK 3aEg== X-Received: by 10.50.64.147 with SMTP id o19mr20440163igs.33.1434375791473; Mon, 15 Jun 2015 06:43:11 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.48.3 with HTTP; Mon, 15 Jun 2015 06:42:51 -0700 (PDT) In-Reply-To: <557ECD22.8090402@FreeBSD.org> References: <201506151250.t5FCoifP019075@svn.freebsd.org> <557ECD22.8090402@FreeBSD.org> From: Ed Maste Date: Mon, 15 Jun 2015 09:42:51 -0400 X-Google-Sender-Auth: sxhghZbE11kimKUXPgonSEmmJGw Message-ID: Subject: Re: svn commit: r284412 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys To: Andriy Gapon Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-vendor@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 13:43:12 -0000 On 15 June 2015 at 09:03, Andriy Gapon wrote: > > I guess I could extend my script to expand 5911 to > https://www.illumos.org/issues/5911 Yeah, I think that would be useful -- although it's probably too long to go in the first line, then. I guess the problem is that the upstream Illumos commits follow a certain convention, and that meaning/context is lost when they come into FreeBSD. Linking to the original issue should take care of that. From owner-svn-src-vendor@FreeBSD.ORG Mon Jun 15 13:50:00 2015 Return-Path: Delivered-To: svn-src-vendor@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69DE3593; Mon, 15 Jun 2015 13:50:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id ECED49F8; Mon, 15 Jun 2015 13:49:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA16999; Mon, 15 Jun 2015 16:49:57 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Z4Ulw-0008s4-CN; Mon, 15 Jun 2015 16:49:56 +0300 Message-ID: <557ED7CC.7030002@FreeBSD.org> Date: Mon, 15 Jun 2015 16:49:00 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Ed Maste CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-vendor@FreeBSD.org Subject: Re: svn commit: r284412 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys References: <201506151250.t5FCoifP019075@svn.freebsd.org> <557ECD22.8090402@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 13:50:00 -0000 On 15/06/2015 16:42, Ed Maste wrote: > On 15 June 2015 at 09:03, Andriy Gapon wrote: >> >> I guess I could extend my script to expand 5911 to >> https://www.illumos.org/issues/5911 > > Yeah, I think that would be useful -- although it's probably too long > to go in the first line, then. > > I guess the problem is that the upstream Illumos commits follow a > certain convention, and that meaning/context is lost when they come > into FreeBSD. Linking to the original issue should take care of that. > Yes, indeed. Regular ZFS/FreeBSD hackers are aware of the conventions and places to look, but most of committers do not necessarily know of them. So, this is the format that I will try use (using this commit as an example): ======================================== 5911 ZFS "hangs" while deleting file Reviewed by: Bayard Bell Reviewed by: Alek Pinchuk Reviewed by: Simon Klinkert Reviewed by: Dan McDonald Approved by: Richard Lowe Author: Matthew Ahrens illumos/illumos-gate@46e1baa6cf6d5432f5fd231bb588df8f9570c858 https://www.illumos.org/issues/5911 ======================================== -- Andriy Gapon From owner-svn-src-vendor@FreeBSD.ORG Mon Jun 15 14:38:49 2015 Return-Path: Delivered-To: svn-src-vendor@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BDB93C0; Mon, 15 Jun 2015 14:38:49 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DA12F84E; Mon, 15 Jun 2015 14:38:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t5FEck4C015505 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 Jun 2015 17:38:46 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t5FEckmE015504; Mon, 15 Jun 2015 17:38:46 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 15 Jun 2015 17:38:46 +0300 From: Gleb Smirnoff To: Andriy Gapon Cc: Ed Maste , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-vendor@FreeBSD.org Subject: Re: svn commit: r284412 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys Message-ID: <20150615143846.GZ73119@FreeBSD.org> References: <201506151250.t5FCoifP019075@svn.freebsd.org> <557ECD22.8090402@FreeBSD.org> <557ED7CC.7030002@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <557ED7CC.7030002@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 14:38:49 -0000 On Mon, Jun 15, 2015 at 04:49:00PM +0300, Andriy Gapon wrote: A> On 15/06/2015 16:42, Ed Maste wrote: A> > On 15 June 2015 at 09:03, Andriy Gapon wrote: A> >> A> >> I guess I could extend my script to expand 5911 to A> >> https://www.illumos.org/issues/5911 A> > A> > Yeah, I think that would be useful -- although it's probably too long A> > to go in the first line, then. A> > A> > I guess the problem is that the upstream Illumos commits follow a A> > certain convention, and that meaning/context is lost when they come A> > into FreeBSD. Linking to the original issue should take care of that. A> > A> A> Yes, indeed. Regular ZFS/FreeBSD hackers are aware of the conventions and A> places to look, but most of committers do not necessarily know of them. A> A> So, this is the format that I will try use (using this commit as an example): A> ======================================== A> 5911 ZFS "hangs" while deleting file A> A> Reviewed by: Bayard Bell A> Reviewed by: Alek Pinchuk A> Reviewed by: Simon Klinkert A> Reviewed by: Dan McDonald A> Approved by: Richard Lowe A> Author: Matthew Ahrens A> A> illumos/illumos-gate@46e1baa6cf6d5432f5fd231bb588df8f9570c858 A> https://www.illumos.org/issues/5911 A> ======================================== Is it possible to expand your script to fetch https://www.illumos.org/issues/$issue into your text editor, so that you can quickly cut the issue text and produce a paragraph describing the change? -- Totus tuus, Glebius. From owner-svn-src-vendor@FreeBSD.ORG Mon Jun 15 14:43:45 2015 Return-Path: Delivered-To: svn-src-vendor@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98E90ED7; Mon, 15 Jun 2015 14:43:45 +0000 (UTC) (envelope-from mahrens@gmail.com) Received: from mail-la0-x234.google.com (mail-la0-x234.google.com [IPv6:2a00:1450:4010:c03::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B2E29E4; Mon, 15 Jun 2015 14:43:45 +0000 (UTC) (envelope-from mahrens@gmail.com) Received: by lacny3 with SMTP id ny3so39471603lac.3; Mon, 15 Jun 2015 07:43:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=zWscDV6RGTtp/9Z6mX5AIY/Luu978KMV3SDih0VgDeU=; b=OF+n1vBPvfCBQsc58Y/gevj90TKY1fqpWfCYvQU82sKhGoPbRgDKCpYeqlF7kPM66y XmFbUm942XQ0jGqHrOV8Et0QTEk9YQwuQCek1Fa4pkBJwXR6nKtHEPpGgkV/JRA89pIE ECALu90XkJNELP1I5hxkxKq4bS7V2DOOKMRoMXAwgQtztEMq5Pt3HVjmzrXtOdaQ4YDk eafao2jWZa3lo4Rw5cgIwR/4JyDGwIAnFkWnxgiz7c+uRCiFWgTCCNogCYZcUfkw4Uco +kvtQhnHiB+1OceWqKyeAOSzfDfbua1atascozfdvvIEge5m2blBFL6TJKuIbmBZxo5+ uGvQ== MIME-Version: 1.0 X-Received: by 10.152.37.37 with SMTP id v5mr26900296laj.11.1434379423204; Mon, 15 Jun 2015 07:43:43 -0700 (PDT) Sender: mahrens@gmail.com Received: by 10.112.163.65 with HTTP; Mon, 15 Jun 2015 07:43:43 -0700 (PDT) In-Reply-To: References: <201506151250.t5FCoifP019075@svn.freebsd.org> <557ECD22.8090402@FreeBSD.org> Date: Mon, 15 Jun 2015 10:43:43 -0400 X-Google-Sender-Auth: fcyPSUyJXl_z9N6YHdapsAuDGow Message-ID: Subject: Re: svn commit: r284412 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys From: Matthew Ahrens To: Ed Maste Cc: Andriy Gapon , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-vendor@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 14:43:45 -0000 On Mon, Jun 15, 2015 at 9:42 AM, Ed Maste wrote: > On 15 June 2015 at 09:03, Andriy Gapon wrote: > > > > I guess I could extend my script to expand 5911 to > > https://www.illumos.org/issues/5911 > > Yeah, I think that would be useful -- although it's probably too long > to go in the first line, then. > > I guess the problem is that the upstream Illumos commits follow a > certain convention, and that meaning/context is lost when they come > into FreeBSD. Linking to the original issue should take care of that. > > You might also consider copy/pasting the description of the illumos bug into the FreeBSD commit message. And yes, the scare quotes around "hang" are because it isn't really hung but that's how customers report it. --matt From owner-svn-src-vendor@FreeBSD.ORG Tue Jun 16 19:48:25 2015 Return-Path: Delivered-To: svn-src-vendor@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D226FE31; Tue, 16 Jun 2015 19:48:25 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC52E2B5; Tue, 16 Jun 2015 19:48:25 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5GJmPQa060768; Tue, 16 Jun 2015 19:48:25 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5GJmHvR060699; Tue, 16 Jun 2015 19:48:17 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201506161948.t5GJmHvR060699@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 16 Jun 2015 19:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r284458 - in vendor-sys/acpica/dist: . source/common source/compiler source/components/debugger source/components/disassembler source/components/dispatcher source/components/events sour... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2015 19:48:25 -0000 Author: jkim Date: Tue Jun 16 19:48:16 2015 New Revision: 284458 URL: https://svnweb.freebsd.org/changeset/base/284458 Log: Import ACPICA 20150616. Added: vendor-sys/acpica/dist/source/include/platform/acefiex.h (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/source/common/adisasm.c vendor-sys/acpica/dist/source/common/ahids.c vendor-sys/acpica/dist/source/common/ahpredef.c vendor-sys/acpica/dist/source/common/ahuuids.c vendor-sys/acpica/dist/source/common/dmextern.c vendor-sys/acpica/dist/source/common/dmrestag.c vendor-sys/acpica/dist/source/common/dmtable.c vendor-sys/acpica/dist/source/common/dmtbdump.c vendor-sys/acpica/dist/source/common/dmtbinfo.c vendor-sys/acpica/dist/source/common/getopt.c vendor-sys/acpica/dist/source/compiler/aslanalyze.c vendor-sys/acpica/dist/source/compiler/aslascii.c vendor-sys/acpica/dist/source/compiler/aslcodegen.c vendor-sys/acpica/dist/source/compiler/aslcompile.c vendor-sys/acpica/dist/source/compiler/aslcompiler.h vendor-sys/acpica/dist/source/compiler/aslcompiler.l vendor-sys/acpica/dist/source/compiler/asldefine.h vendor-sys/acpica/dist/source/compiler/aslerror.c vendor-sys/acpica/dist/source/compiler/aslfileio.c vendor-sys/acpica/dist/source/compiler/aslfiles.c vendor-sys/acpica/dist/source/compiler/aslfold.c vendor-sys/acpica/dist/source/compiler/aslglobal.h vendor-sys/acpica/dist/source/compiler/aslmain.c vendor-sys/acpica/dist/source/compiler/aslmapenter.c vendor-sys/acpica/dist/source/compiler/aslmapoutput.c vendor-sys/acpica/dist/source/compiler/aslmethod.c vendor-sys/acpica/dist/source/compiler/aslopcodes.c vendor-sys/acpica/dist/source/compiler/asloperands.c vendor-sys/acpica/dist/source/compiler/aslopt.c vendor-sys/acpica/dist/source/compiler/asloptions.c vendor-sys/acpica/dist/source/compiler/aslprintf.c vendor-sys/acpica/dist/source/compiler/aslstartup.c vendor-sys/acpica/dist/source/compiler/aslsupport.l vendor-sys/acpica/dist/source/compiler/asltypes.h vendor-sys/acpica/dist/source/compiler/aslutils.c vendor-sys/acpica/dist/source/compiler/asluuid.c vendor-sys/acpica/dist/source/compiler/dtcompile.c vendor-sys/acpica/dist/source/compiler/dtexpress.c vendor-sys/acpica/dist/source/compiler/dtfield.c vendor-sys/acpica/dist/source/compiler/dtio.c vendor-sys/acpica/dist/source/compiler/dtparser.y vendor-sys/acpica/dist/source/compiler/dtsubtable.c vendor-sys/acpica/dist/source/compiler/dttable.c vendor-sys/acpica/dist/source/compiler/dttemplate.c vendor-sys/acpica/dist/source/compiler/dttemplate.h vendor-sys/acpica/dist/source/compiler/dtutils.c vendor-sys/acpica/dist/source/compiler/prparser.y vendor-sys/acpica/dist/source/compiler/prscan.c vendor-sys/acpica/dist/source/compiler/prutils.c vendor-sys/acpica/dist/source/components/debugger/dbcmds.c vendor-sys/acpica/dist/source/components/debugger/dbconvert.c vendor-sys/acpica/dist/source/components/debugger/dbdisply.c vendor-sys/acpica/dist/source/components/debugger/dbexec.c vendor-sys/acpica/dist/source/components/debugger/dbfileio.c vendor-sys/acpica/dist/source/components/debugger/dbhistry.c vendor-sys/acpica/dist/source/components/debugger/dbinput.c vendor-sys/acpica/dist/source/components/debugger/dbmethod.c vendor-sys/acpica/dist/source/components/debugger/dbnames.c vendor-sys/acpica/dist/source/components/debugger/dbtest.c vendor-sys/acpica/dist/source/components/debugger/dbutils.c vendor-sys/acpica/dist/source/components/debugger/dbxface.c vendor-sys/acpica/dist/source/components/disassembler/dmbuffer.c vendor-sys/acpica/dist/source/components/disassembler/dmcstyle.c vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c vendor-sys/acpica/dist/source/components/dispatcher/dsfield.c vendor-sys/acpica/dist/source/components/dispatcher/dsinit.c vendor-sys/acpica/dist/source/components/dispatcher/dsobject.c vendor-sys/acpica/dist/source/components/dispatcher/dsutils.c vendor-sys/acpica/dist/source/components/dispatcher/dswload.c vendor-sys/acpica/dist/source/components/events/evgpe.c vendor-sys/acpica/dist/source/components/events/evgpeinit.c vendor-sys/acpica/dist/source/components/executer/exconfig.c vendor-sys/acpica/dist/source/components/executer/exconvrt.c vendor-sys/acpica/dist/source/components/executer/exdebug.c vendor-sys/acpica/dist/source/components/executer/exdump.c vendor-sys/acpica/dist/source/components/executer/exfield.c vendor-sys/acpica/dist/source/components/executer/exfldio.c vendor-sys/acpica/dist/source/components/executer/exmisc.c vendor-sys/acpica/dist/source/components/executer/exnames.c vendor-sys/acpica/dist/source/components/executer/exoparg2.c vendor-sys/acpica/dist/source/components/executer/exoparg3.c vendor-sys/acpica/dist/source/components/executer/exregion.c vendor-sys/acpica/dist/source/components/executer/exstorob.c vendor-sys/acpica/dist/source/components/executer/exutils.c vendor-sys/acpica/dist/source/components/hardware/hwgpe.c vendor-sys/acpica/dist/source/components/hardware/hwxfsleep.c vendor-sys/acpica/dist/source/components/namespace/nsaccess.c vendor-sys/acpica/dist/source/components/namespace/nsconvert.c vendor-sys/acpica/dist/source/components/namespace/nsdump.c vendor-sys/acpica/dist/source/components/namespace/nseval.c vendor-sys/acpica/dist/source/components/namespace/nsinit.c vendor-sys/acpica/dist/source/components/namespace/nsparse.c vendor-sys/acpica/dist/source/components/namespace/nsrepair2.c vendor-sys/acpica/dist/source/components/namespace/nssearch.c vendor-sys/acpica/dist/source/components/namespace/nsutils.c vendor-sys/acpica/dist/source/components/namespace/nsxfeval.c vendor-sys/acpica/dist/source/components/namespace/nsxfname.c vendor-sys/acpica/dist/source/components/parser/psutils.c vendor-sys/acpica/dist/source/components/resources/rscreate.c vendor-sys/acpica/dist/source/components/resources/rsmisc.c vendor-sys/acpica/dist/source/components/resources/rsutils.c vendor-sys/acpica/dist/source/components/resources/rsxface.c vendor-sys/acpica/dist/source/components/tables/tbdata.c vendor-sys/acpica/dist/source/components/tables/tbfadt.c vendor-sys/acpica/dist/source/components/tables/tbfind.c vendor-sys/acpica/dist/source/components/tables/tbinstal.c vendor-sys/acpica/dist/source/components/tables/tbprint.c vendor-sys/acpica/dist/source/components/tables/tbutils.c vendor-sys/acpica/dist/source/components/tables/tbxface.c vendor-sys/acpica/dist/source/components/tables/tbxfload.c vendor-sys/acpica/dist/source/components/utilities/utalloc.c vendor-sys/acpica/dist/source/components/utilities/utbuffer.c vendor-sys/acpica/dist/source/components/utilities/utcache.c vendor-sys/acpica/dist/source/components/utilities/utclib.c vendor-sys/acpica/dist/source/components/utilities/utcopy.c vendor-sys/acpica/dist/source/components/utilities/utids.c vendor-sys/acpica/dist/source/components/utilities/utmisc.c vendor-sys/acpica/dist/source/components/utilities/utosi.c vendor-sys/acpica/dist/source/components/utilities/utpredef.c vendor-sys/acpica/dist/source/components/utilities/utprint.c vendor-sys/acpica/dist/source/components/utilities/utstring.c vendor-sys/acpica/dist/source/components/utilities/uttrack.c vendor-sys/acpica/dist/source/components/utilities/utxface.c vendor-sys/acpica/dist/source/include/acglobal.h vendor-sys/acpica/dist/source/include/acinterp.h vendor-sys/acpica/dist/source/include/aclocal.h vendor-sys/acpica/dist/source/include/acnames.h vendor-sys/acpica/dist/source/include/acnamesp.h vendor-sys/acpica/dist/source/include/acobject.h vendor-sys/acpica/dist/source/include/acoutput.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/acstruct.h vendor-sys/acpica/dist/source/include/actbl.h vendor-sys/acpica/dist/source/include/actbl1.h vendor-sys/acpica/dist/source/include/actbl2.h vendor-sys/acpica/dist/source/include/actbl3.h vendor-sys/acpica/dist/source/include/actypes.h vendor-sys/acpica/dist/source/include/acutils.h vendor-sys/acpica/dist/source/include/platform/acefi.h vendor-sys/acpica/dist/source/include/platform/acenv.h vendor-sys/acpica/dist/source/include/platform/acenvex.h vendor-sys/acpica/dist/source/include/platform/acgcc.h vendor-sys/acpica/dist/source/include/platform/acmsvc.h vendor-sys/acpica/dist/source/os_specific/service_layers/osbsdtbl.c vendor-sys/acpica/dist/source/os_specific/service_layers/osefitbl.c vendor-sys/acpica/dist/source/os_specific/service_layers/osefixf.c vendor-sys/acpica/dist/source/os_specific/service_layers/oslinuxtbl.c vendor-sys/acpica/dist/source/os_specific/service_layers/osunixmap.c vendor-sys/acpica/dist/source/os_specific/service_layers/oswintbl.c vendor-sys/acpica/dist/source/tools/acpidump/acpidump.h vendor-sys/acpica/dist/source/tools/acpidump/apdump.c vendor-sys/acpica/dist/source/tools/acpidump/apfiles.c vendor-sys/acpica/dist/source/tools/acpidump/apmain.c vendor-sys/acpica/dist/source/tools/acpiexec/aeexec.c vendor-sys/acpica/dist/source/tools/acpiexec/aehandlers.c vendor-sys/acpica/dist/source/tools/acpiexec/aeinitfile.c vendor-sys/acpica/dist/source/tools/acpiexec/aeregion.c vendor-sys/acpica/dist/source/tools/acpiexec/aetables.c vendor-sys/acpica/dist/source/tools/acpihelp/ahamlops.c vendor-sys/acpica/dist/source/tools/acpihelp/ahdecode.c vendor-sys/acpica/dist/source/tools/acpinames/antables.c vendor-sys/acpica/dist/source/tools/acpisrc/acpisrc.h vendor-sys/acpica/dist/source/tools/acpisrc/asconvrt.c vendor-sys/acpica/dist/source/tools/acpisrc/asfile.c vendor-sys/acpica/dist/source/tools/acpisrc/asremove.c vendor-sys/acpica/dist/source/tools/acpisrc/astable.c vendor-sys/acpica/dist/source/tools/acpisrc/asutils.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/changes.txt Tue Jun 16 19:48:16 2015 (r284458) @@ -1,5 +1,114 @@ ---------------------------------------- -08 April 2015. Summary of changes for version 20150515: +16 June 2015. Summary of changes for version 20150616: + + +1) ACPICA kernel-resident subsystem: + +Across the entire ACPICA source code base, the various macros for the C +library functions (such as ACPI_STRLEN, etc.) have been removed and +replaced by the standard C library names (strlen, etc.) The original +purpose for these macros is no longer applicable. This simplification +reduces the number of macros used in the ACPICA source code +significantly, improving readability and maintainability. + +Implemented support for a new ACPI table, the OSDT. This table, the +"override" SDT, can be loaded directly by the host OS at boot time. It +enables the replacement of existing namespace objects that were installed +via the DSDT and/or SSDTs. The primary purpose for this is to replace +buggy or incorrect ASL/AML code obtained via the BIOS. The OSDT is slated +for inclusion in a future version of the ACPI Specification. Lv Zheng/Bob +Moore. + +Added support for systems with (improperly) two FACS tables -- a "32-bit" +table (via FADT 32-bit legacy field) and a "64-bit" table (via the 64-bit +X field). This change will support both automatically. There continues to +be systems found with this issue. This support requires a change to the +AcpiSetFirmwareWakingVector interface. Also, a public global variable has +been added to allow the host to select which FACS is desired +(AcpiGbl_Use32BitFacsAddresses). See the ACPICA reference for more +details Lv Zheng. + +Added a new feature to allow for systems that do not contain an FACS. +Although this is already supported on hardware-reduced platforms, the +feature has been extended for all platforms. The reasoning is that we do +not want to abort the entire ACPICA initialization just because the +system is seriously buggy and has no FACS. + +Fixed a problem where the GUID strings for NFIT tables (in acuuid.h) were +not correctly transcribed from the ACPI specification in ACPICA version +20150515. + +Implemented support for the _CLS object in the AcpiGetObjectInfo external +interface. + +Updated the definitions of the TCPA and TPM2 ACPI tables to the more +recent TCG ACPI Specification, December 14, 2014. Table disassembler and +compiler also updated. Note: The TCPA "server" table is not supported by +the disassembler/table-compiler at this time. + +ACPI 6.0: Added definitions for the new GIC version field in the MADT. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.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. + + Current Release: + Non-Debug Version: 100.6K Code, 27.6K Data, 128.2K Total + Debug Version: 196.2K Code, 81.0K Data, 277.2K Total + Previous Release: + Non-Debug Version: 99.9K Code, 27.5K Data, 127.4K Total + Debug Version: 195.2K Code, 80.8K Data, 276.0K Total + + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: Fixed a problem with the new symbolic operator disassembler +where incorrect ASL code could be emitted in some cases for the "non- +commutative" operators -- Subtract, Divide, Modulo, ShiftLeft, and +ShiftRight. The actual problem cases seem to be rather unusual in common +ASL code, however. David Box. + +Modified the linux version of acpidump to obtain ACPI tables from not +just /dev/mem (which may not exist) and /sys/firmware/acpi/tables. Lv +Zheng. + +iASL: Fixed a problem where the user preprocessor output file (.i) +contained extra data that was not expected. The compiler was using this +file as a temporary file and passed through #line directives in order to +keep compiler error messages in sync with the input file and line number +across multiple include files. The (.i) is no longer a temporary file as +the compiler uses a new, different file for the original purpose. + +iASL: Fixed a problem where comments within the original ASL source code +file were not passed through to the preprocessor output file, nor any +listing files. + +iASL: Fixed some issues for the handling of the "#include" preprocessor +directive and the similar (but not the same) "Include" ASL operator. + +iASL: Add support for the new OSDT in both the disassembler and compiler. + +iASL: Fixed a problem with the constant folding support where a Buffer +object could be incorrectly generated (incorrectly formed) during a +conversion to a Store() operator. + +AcpiHelp: Updated for new NFIT GUIDs, "External" AML opcode, and new +description text for the _REV predefined name. _REV now permanently +returns 2, as per the ACPI 6.0 specification. + +Debugger: Enhanced the output of the Debug ASL object for references +produced by the Index operator. For Buffers and strings, only output the +actual byte pointed to by the index. For packages, only print the single +package element decoded by the index. Previously, the entire +buffer/string/package was emitted. + +iASL/Table-compiler: Fixed a regression where the "generic" data types +were no longer recognized, causing errors. + + +---------------------------------------- +15 May 2015. Summary of changes for version 20150515: This release implements most of ACPI 6.0 as described below. @@ -34,7 +143,7 @@ iASL disassembler and table compiler: Ad tables: FADT, MADT. iASL preprocessor: Added a new directive to enable inclusion of binary -blobs into ASL code. The new directive is #includebinary. It takes a +blobs into ASL code. The new directive is #includebuffer. It takes a binary file as input and emits a named ascii buffer object into the ASL code. Modified: vendor-sys/acpica/dist/source/common/adisasm.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adisasm.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/common/adisasm.c Tue Jun 16 19:48:16 2015 (r284458) @@ -243,7 +243,7 @@ AdAmlDisassemble ( while (ExternalFileList) { ExternalFilename = ExternalFileList->Path; - if (!ACPI_STRCMP (ExternalFilename, Filename)) + if (!strcmp (ExternalFilename, Filename)) { /* Next external file */ Modified: vendor-sys/acpica/dist/source/common/ahids.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahids.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/common/ahids.c Tue Jun 16 19:48:16 2015 (r284458) @@ -230,7 +230,7 @@ AcpiAhMatchHardwareId ( for (Info = AslDeviceIds; Info->Name; Info++) { - if (!ACPI_STRCMP (HardwareId, Info->Name)) + if (!strcmp (HardwareId, Info->Name)) { return (Info); } Modified: vendor-sys/acpica/dist/source/common/ahpredef.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahpredef.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/common/ahpredef.c Tue Jun 16 19:48:16 2015 (r284458) @@ -249,7 +249,7 @@ const AH_PREDEFINED_NAME AslPredefine AH_PREDEF ("_RBW", "Register Bit Width", "Resource Descriptor field"), AH_PREDEF ("_RDI", "Resource Dependencies for Idle", "Returns a list of dependencies for idle states"), AH_PREDEF ("_REG", "Region Availability", "Inform AML code of an operation region availability change"), - AH_PREDEF ("_REV", "Supported ACPI Revision", "Returns the revision of the ACPI specification that is implemented"), + AH_PREDEF ("_REV", "Supported Integer Width", "Returns the supported integer width (<= 1: 32 bits only, >=2: both 32 and 64 bits"), AH_PREDEF ("_RMV", "Removal Status", "Returns a device's removal ability status (docking)"), AH_PREDEF ("_RNG", "Range", "Memory range type, Resource Descriptor field"), AH_PREDEF ("_RST", "Device Reset", "Executes a reset on a device"), Modified: vendor-sys/acpica/dist/source/common/ahuuids.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahuuids.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/common/ahuuids.c Tue Jun 16 19:48:16 2015 (r284458) @@ -122,7 +122,7 @@ AcpiAhMatchUuid ( AcpiUtConvertStringToUuid (Info->String, UuidBuffer); - if (!ACPI_MEMCMP (Data, UuidBuffer, UUID_BUFFER_LENGTH)) + if (!memcmp (Data, UuidBuffer, UUID_BUFFER_LENGTH)) { return (Info->Description); } Modified: vendor-sys/acpica/dist/source/common/dmextern.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmextern.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/common/dmextern.c Tue Jun 16 19:48:16 2015 (r284458) @@ -224,7 +224,7 @@ AcpiDmNormalizeParentPrefix ( return (NULL); } - Length = (ACPI_STRLEN (ParentPath) + ACPI_STRLEN (Path) + 1); + Length = (strlen (ParentPath) + strlen (Path) + 1); if (ParentPath[1]) { /* @@ -253,7 +253,7 @@ AcpiDmNormalizeParentPrefix ( * * Copy the parent path */ - ACPI_STRCPY (Fullpath, &ParentPath[Index]); + strcpy (Fullpath, &ParentPath[Index]); /* * Add dot separator @@ -261,12 +261,12 @@ AcpiDmNormalizeParentPrefix ( */ if (ParentPath[1]) { - ACPI_STRCAT (Fullpath, "."); + strcat (Fullpath, "."); } /* Copy child path (carat parent prefix(es) were skipped above) */ - ACPI_STRCAT (Fullpath, Path); + strcat (Fullpath, Path); Cleanup: ACPI_FREE (ParentPath); @@ -648,13 +648,13 @@ AcpiDmAddNodeToExternalList ( if ((*ExternalPath == AML_ROOT_PREFIX) && (ExternalPath[1])) { - Temp = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (ExternalPath) + 1); + Temp = ACPI_ALLOCATE_ZEROED (strlen (ExternalPath) + 1); if (!Temp) { return_VOID; } - ACPI_STRCPY (Temp, &ExternalPath[1]); + strcpy (Temp, &ExternalPath[1]); ACPI_FREE (ExternalPath); ExternalPath = Temp; } @@ -806,7 +806,7 @@ AcpiDmCreateNewExternal ( NextExternal = AcpiGbl_ExternalList; while (NextExternal) { - if (!ACPI_STRCMP (ExternalPath, NextExternal->Path)) + if (!strcmp (ExternalPath, NextExternal->Path)) { /* Duplicate method, check that the Value (ArgCount) is the same */ @@ -849,7 +849,7 @@ AcpiDmCreateNewExternal ( NewExternal->Value = Value; NewExternal->Path = ExternalPath; NewExternal->Type = Type; - NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath); + NewExternal->Length = (UINT16) strlen (ExternalPath); NewExternal->InternalPath = InternalPath; /* Link the new descriptor into the global list, alphabetically ordered */ Modified: vendor-sys/acpica/dist/source/common/dmrestag.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmrestag.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/common/dmrestag.c Tue Jun 16 19:48:16 2015 (r284458) @@ -679,10 +679,10 @@ AcpiGetTagPathname ( * end up in the final compiled AML, it's just an appearance issue for the * disassembled code. */ - Pathname[ACPI_STRLEN (Pathname) - ACPI_NAME_SIZE] = 0; - ACPI_STRNCAT (Pathname, ResourceNode->Name.Ascii, ACPI_NAME_SIZE); - ACPI_STRCAT (Pathname, "."); - ACPI_STRNCAT (Pathname, Tag, ACPI_NAME_SIZE); + Pathname[strlen (Pathname) - ACPI_NAME_SIZE] = 0; + strncat (Pathname, ResourceNode->Name.Ascii, ACPI_NAME_SIZE); + strcat (Pathname, "."); + strncat (Pathname, Tag, ACPI_NAME_SIZE); /* Internalize the namepath to AML format */ Modified: vendor-sys/acpica/dist/source/common/dmtable.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtable.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/common/dmtable.c Tue Jun 16 19:48:16 2015 (r284458) @@ -528,7 +528,7 @@ AcpiDmDumpDataTable ( TableData = AcpiDmGetTableData (Table->Signature); if (!TableData) { - if (!ACPI_STRNCMP (Table->Signature, "OEM", 3)) + if (!strncmp (Table->Signature, "OEM", 3)) { AcpiOsPrintf ("\n**** OEM-defined ACPI table [%4.4s], unknown contents\n\n", Table->Signature); @@ -856,7 +856,7 @@ AcpiDmDumpTable ( case ACPI_DMT_STRING: - ByteLength = ACPI_STRLEN (ACPI_CAST_PTR (char, Target)) + 1; + ByteLength = strlen (ACPI_CAST_PTR (char, Target)) + 1; break; case ACPI_DMT_GAS: Modified: vendor-sys/acpica/dist/source/common/dmtbdump.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbdump.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/common/dmtbdump.c Tue Jun 16 19:48:16 2015 (r284458) @@ -155,7 +155,7 @@ AcpiDmDumpUnicode ( for (i = 0; i < Length; i += 2) { - if (!ACPI_IS_PRINT (Buffer[i])) + if (!isprint (Buffer[i])) { goto DumpRawBuffer; } @@ -1701,7 +1701,7 @@ AcpiDmDumpIort ( InfoTable = AcpiDmTableInfoIort1; Length = ACPI_OFFSET (ACPI_IORT_NAMED_COMPONENT, DeviceName); String = ACPI_ADD_PTR (char, IortNode, NodeOffset + Length); - Length += ACPI_STRLEN (String) + 1; + Length += strlen (String) + 1; break; case ACPI_IORT_NODE_PCI_ROOT_COMPLEX: @@ -3344,7 +3344,7 @@ AcpiDmDumpStao ( while (Offset < Table->Length) { Namepath = ACPI_ADD_PTR (char, Table, Offset); - StringLength = ACPI_STRLEN (Namepath) + 1; + StringLength = strlen (Namepath) + 1; AcpiDmLineHeader (Offset, StringLength, "Namestring"); AcpiOsPrintf ("\"%s\"\n", Namepath); Modified: vendor-sys/acpica/dist/source/common/dmtbinfo.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbinfo.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/common/dmtbinfo.c Tue Jun 16 19:48:16 2015 (r284458) @@ -113,7 +113,7 @@ #define ACPI_SPMI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPMI,f) #define ACPI_SRAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SRAT,f) #define ACPI_STAO_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_STAO,f) -#define ACPI_TCPA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA,f) +#define ACPI_TCPA_CLIENT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_CLIENT,f) #define ACPI_TPM2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TPM2,f) #define ACPI_UEFI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_UEFI,f) #define ACPI_WAET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WAET,f) @@ -2611,15 +2611,15 @@ ACPI_DMTABLE_INFO AcpiDmTableI /******************************************************************************* * - * TCPA - Trusted Computing Platform Alliance table + * TCPA - Trusted Computing Platform Alliance table (Client) * ******************************************************************************/ ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[] = { - {ACPI_DMT_UINT16, ACPI_TCPA_OFFSET (Reserved), "Reserved", 0}, - {ACPI_DMT_UINT32, ACPI_TCPA_OFFSET (MaxLogLength), "Max Event Log Length", 0}, - {ACPI_DMT_UINT64, ACPI_TCPA_OFFSET (LogAddress), "Event Log Address", 0}, + {ACPI_DMT_UINT16, ACPI_TCPA_CLIENT_OFFSET (PlatformClass), "Platform Class", 0}, + {ACPI_DMT_UINT32, ACPI_TCPA_CLIENT_OFFSET (MinimumLogLength), "Min Event Log Length", 0}, + {ACPI_DMT_UINT64, ACPI_TCPA_CLIENT_OFFSET (LogAddress), "Event Log Address", 0}, ACPI_DMT_TERMINATOR }; @@ -2632,7 +2632,8 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[] = { - {ACPI_DMT_UINT32, ACPI_TPM2_OFFSET (Flags), "Flags", 0}, + {ACPI_DMT_UINT16, ACPI_TPM2_OFFSET (PlatformClass), "Platform Class", 0}, + {ACPI_DMT_UINT16, ACPI_TPM2_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT64, ACPI_TPM2_OFFSET (ControlAddress), "Control Address", 0}, {ACPI_DMT_UINT32, ACPI_TPM2_OFFSET (StartMethod), "Start Method", 0}, ACPI_DMT_TERMINATOR Modified: vendor-sys/acpica/dist/source/common/getopt.c ============================================================================== --- vendor-sys/acpica/dist/source/common/getopt.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/common/getopt.c Tue Jun 16 19:48:16 2015 (r284458) @@ -145,7 +145,7 @@ AcpiGetopt( { return (ACPI_OPT_END); } - else if (ACPI_STRCMP (argv[AcpiGbl_Optind], "--") == 0) + else if (strcmp (argv[AcpiGbl_Optind], "--") == 0) { AcpiGbl_Optind++; return (ACPI_OPT_END); @@ -159,7 +159,7 @@ AcpiGetopt( /* Make sure that the option is legal */ if (CurrentChar == ':' || - (OptsPtr = ACPI_STRCHR (opts, CurrentChar)) == NULL) + (OptsPtr = strchr (opts, CurrentChar)) == NULL) { ACPI_OPTION_ERROR ("Illegal option: -", CurrentChar); Modified: vendor-sys/acpica/dist/source/compiler/aslanalyze.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslanalyze.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslanalyze.c Tue Jun 16 19:48:16 2015 (r284458) @@ -67,8 +67,8 @@ AnIsInternalMethod ( ACPI_PARSE_OBJECT *Op) { - if ((!ACPI_STRCMP (Op->Asl.ExternalName, "\\_OSI")) || - (!ACPI_STRCMP (Op->Asl.ExternalName, "_OSI"))) + if ((!strcmp (Op->Asl.ExternalName, "\\_OSI")) || + (!strcmp (Op->Asl.ExternalName, "_OSI"))) { return (TRUE); } @@ -94,8 +94,8 @@ AnGetInternalMethodReturnType ( ACPI_PARSE_OBJECT *Op) { - if ((!ACPI_STRCMP (Op->Asl.ExternalName, "\\_OSI")) || - (!ACPI_STRCMP (Op->Asl.ExternalName, "_OSI"))) + if ((!strcmp (Op->Asl.ExternalName, "\\_OSI")) || + (!strcmp (Op->Asl.ExternalName, "_OSI"))) { return (ACPI_BTYPE_STRING); } @@ -462,7 +462,7 @@ ApCheckForGpeNameConflict ( /* Verify 3rd/4th chars are a valid hex value */ - GpeNumber = ACPI_STRTOUL (&Name[2], NULL, 16); + GpeNumber = strtoul (&Name[2], NULL, 16); if (GpeNumber == ACPI_UINT32_MAX) { return; Modified: vendor-sys/acpica/dist/source/compiler/aslascii.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslascii.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslascii.c Tue Jun 16 19:48:16 2015 (r284458) @@ -226,7 +226,7 @@ FlCheckForAscii ( /* Ensure character is either printable or a "space" char */ - else if (!ACPI_IS_PRINT (Byte) && !ACPI_IS_SPACE (Byte)) + else if (!isprint (Byte) && !isspace (Byte)) { if ((BadBytes < 10) && (DisplayErrors)) { Modified: vendor-sys/acpica/dist/source/compiler/aslcodegen.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcodegen.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslcodegen.c Tue Jun 16 19:48:16 2015 (r284458) @@ -110,7 +110,7 @@ CgGenerateAmlOutput ( DbgPrint (ASL_TREE_OUTPUT, "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr" - " Parent Child Next Flags AcTyp Final Col L\n", + " Parent Child Next Flags AcTyp Final Col L# EL# LL# ELL#\n", 76, " "); CgCloseTable (); @@ -145,7 +145,7 @@ CgAmlWriteWalk ( "Final parse tree used for AML output:\n"); DbgPrint (ASL_TREE_OUTPUT, "%*s Value P_Op A_Op OpLen PByts Len SubLen PSubLen OpPtr" - " Parent Child Next Flags AcTyp Final Col L\n", + " Parent Child Next Flags AcTyp Final Col L# EL# LL# ELL#\n", 76, " "); } @@ -169,7 +169,7 @@ CgAmlWriteWalk ( DbgPrint (ASL_TREE_OUTPUT, "%08X %04X %04X %01X %04X %04X %04X %04X " - "%08X %08X %08X %08X %08X %08X %04X %02d %02d\n", + "%08X %08X %08X %08X %08X %08X %04X %02d %02d %02d %02d %02d\n", /* 1 */ (UINT32) Op->Asl.Value.Integer, /* 2 */ Op->Asl.ParseOpcode, /* 3 */ Op->Asl.AmlOpcode, @@ -186,7 +186,10 @@ CgAmlWriteWalk ( /* 14 */ Op->Asl.AcpiBtype, /* 15 */ Op->Asl.FinalAmlLength, /* 16 */ Op->Asl.Column, - /* 17 */ Op->Asl.LineNumber); + /* 17 */ Op->Asl.LineNumber, + /* 18 */ Op->Asl.EndLine, + /* 19 */ Op->Asl.LogicalLineNumber, + /* 20 */ Op->Asl.EndLogicalLine); /* Generate the AML for this node */ Modified: vendor-sys/acpica/dist/source/compiler/aslcompile.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompile.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslcompile.c Tue Jun 16 19:48:16 2015 (r284458) @@ -103,6 +103,9 @@ CmDoCompile ( /* Preprocessor */ PrDoPreprocess (); + Gbl_CurrentLineNumber = 1; + Gbl_LogicalLineNumber = 1; + if (Gbl_PreprocessOnly) { UtEndEvent (Event); @@ -112,6 +115,7 @@ CmDoCompile ( } UtEndEvent (Event); + /* Build the parse tree */ Event = UtBeginEvent ("Parse source code and build parse tree"); @@ -708,7 +712,7 @@ CmCleanupAndExit ( /* Close all open files */ /* - * Take care with the preprocessor file (.i), it might be the same + * Take care with the preprocessor file (.pre), it might be the same * as the "input" file, depending on where the compiler has terminated * or aborted. Prevent attempt to close the same file twice in * loop below. @@ -733,10 +737,9 @@ CmCleanupAndExit ( FlDeleteFile (ASL_FILE_AML_OUTPUT); } - /* Delete the preprocessor output file (.i) unless -li flag is set */ + /* Delete the preprocessor temp file unless full debug was specified */ - if (!Gbl_PreprocessorOutputFlag && - Gbl_PreprocessFlag) + if (Gbl_PreprocessFlag && !Gbl_KeepPreprocessorTempFile) { FlDeleteFile (ASL_FILE_PREPROCESSOR); } @@ -752,8 +755,6 @@ CmCleanupAndExit ( * Note: Handles are cleared by FlCloseFile above, so we look at the * filename instead, to determine if the .SRC file was actually * created. - * - * TBD: SourceOutput should be .TMP, then rename if we want to keep it? */ if (!Gbl_SourceOutputFlag) { Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.h Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.h Tue Jun 16 19:48:16 2015 (r284458) @@ -1003,7 +1003,7 @@ UtDoConstant ( char *String); ACPI_STATUS -UtStrtoul64 ( +stroul64 ( char *String, UINT32 Base, UINT64 *RetInteger); Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.l ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.l Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.l Tue Jun 16 19:48:16 2015 (r284458) @@ -709,7 +709,7 @@ NamePathTail [.]{NameSeg} return (PARSEOP_NAMESTRING); } . { count (1); - if (ACPI_IS_PRINT (*AslCompilertext)) + if (isprint (*AslCompilertext)) { sprintf (MsgBuffer, "Invalid character (%c), expecting ASL keyword or name", Modified: vendor-sys/acpica/dist/source/compiler/asldefine.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asldefine.h Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/asldefine.h Tue Jun 16 19:48:16 2015 (r284458) @@ -105,7 +105,8 @@ /* filename suffixes for output files */ -#define FILE_SUFFIX_PREPROCESSOR "i" +#define FILE_SUFFIX_PREPROC_USER "i " +#define FILE_SUFFIX_PREPROCESSOR "pre" #define FILE_SUFFIX_AML_CODE "aml" #define FILE_SUFFIX_MAP "map" #define FILE_SUFFIX_LISTING "lst" @@ -136,6 +137,8 @@ #define ASL_ABORT TRUE #define ASL_NO_ABORT FALSE #define ASL_EOF ACPI_UINT32_MAX +#define ASL_WITHIN_COMMENT (ACPI_UINT32_MAX -1) +#define ASL_BLANK_LINE (ACPI_UINT32_MAX -1) /* Listings */ Modified: vendor-sys/acpica/dist/source/compiler/aslerror.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslerror.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslerror.c Tue Jun 16 19:48:16 2015 (r284458) @@ -561,11 +561,11 @@ AslCommonError2 ( /* Keep a copy of the extra message */ - ACPI_STRCPY (MessageBuffer, ExtraMessage); + strcpy (MessageBuffer, ExtraMessage); } LineBuffer = UtLocalCalloc (strlen (SourceLine) + 1); - ACPI_STRCPY (LineBuffer, SourceLine); + strcpy (LineBuffer, SourceLine); /* Initialize the error node */ @@ -647,7 +647,7 @@ AslCommonError ( /* Keep a copy of the extra message */ - ACPI_STRCPY (MessageBuffer, ExtraMessage); + strcpy (MessageBuffer, ExtraMessage); } /* Initialize the error node */ Modified: vendor-sys/acpica/dist/source/compiler/aslfileio.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslfileio.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslfileio.c Tue Jun 16 19:48:16 2015 (r284458) @@ -218,6 +218,19 @@ FlWriteFile ( FlFileError (FileId, ASL_MSG_WRITE); AslAbort (); } + + if ((FileId == ASL_FILE_PREPROCESSOR) && Gbl_PreprocessorOutputFlag) + { + /* Duplicate the output to the user preprocessor (.i) file */ + + Actual = fwrite ((char *) Buffer, 1, Length, + Gbl_Files[ASL_FILE_PREPROCESSOR_USER].Handle); + if (Actual != Length) + { + FlFileError (FileId, ASL_MSG_WRITE); + AslAbort (); + } + } } @@ -247,7 +260,6 @@ FlPrintFile ( va_start (Args, Format); - Actual = vfprintf (Gbl_Files[FileId].Handle, Format, Args); va_end (Args); @@ -256,6 +268,30 @@ FlPrintFile ( FlFileError (FileId, ASL_MSG_WRITE); AslAbort (); } + + if ((FileId == ASL_FILE_PREPROCESSOR) && Gbl_PreprocessorOutputFlag) + { + /* + * Duplicate the output to the user preprocessor (.i) file, + * except: no #line directives. + */ + if (!strncmp (Format, "#line", 5)) + { + return; + } + + va_start (Args, Format); + Actual = vfprintf (Gbl_Files[ASL_FILE_PREPROCESSOR_USER].Handle, + Format, Args); + va_end (Args); + + if (Actual == -1) + { + FlFileError (FileId, ASL_MSG_WRITE); + AslAbort (); + } + } + } Modified: vendor-sys/acpica/dist/source/compiler/aslfiles.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslfiles.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslfiles.c Tue Jun 16 19:48:16 2015 (r284458) @@ -43,6 +43,7 @@ #include "aslcompiler.h" #include "acapps.h" +#include "dtcompiler.h" #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslfiles") @@ -84,7 +85,6 @@ FlSetLineNumber ( LineNumber, Gbl_LogicalLineNumber); Gbl_CurrentLineNumber = LineNumber; - Gbl_LogicalLineNumber = LineNumber; } @@ -303,6 +303,7 @@ FlOpenIncludeWithPrefix ( { FILE *IncludeFile; char *Pathname; + UINT32 OriginalLineNumber; /* Build the full pathname to the file */ @@ -322,13 +323,20 @@ FlOpenIncludeWithPrefix ( return (NULL); } -#ifdef _MUST_HANDLE_COMMENTS /* - * Check entire include file for any # preprocessor directives. + * Check the entire include file for any # preprocessor directives. * This is because there may be some confusion between the #include - * preprocessor directive and the ASL Include statement. + * preprocessor directive and the ASL Include statement. A file included + * by the ASL include cannot contain preprocessor directives because + * the preprocessor has already run by the time the ASL include is + * recognized (by the compiler, not the preprocessor.) + * + * Note: DtGetNextLine strips/ignores comments. + * Save current line number since DtGetNextLine modifies it. */ - while (fgets (Gbl_CurrentLineBuffer, Gbl_LineBufferSize, IncludeFile)) + Gbl_CurrentLineNumber--; + OriginalLineNumber = Gbl_CurrentLineNumber; + while (DtGetNextLine (IncludeFile) != ASL_EOF) { if (Gbl_CurrentLineBuffer[0] == '#') { @@ -336,7 +344,7 @@ FlOpenIncludeWithPrefix ( Op, "use #include instead"); } } -#endif + Gbl_CurrentLineNumber = OriginalLineNumber; /* Must seek back to the start of the file */ @@ -579,8 +587,6 @@ FlOpenMiscOutputFiles ( /* Open the debug file as STDERR, text mode */ - /* TBD: hide this behind a FlReopenFile function */ - Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Filename = Filename; Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle = freopen (Filename, "w+t", stderr); @@ -588,13 +594,15 @@ FlOpenMiscOutputFiles ( if (!Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle) { /* - * A problem with freopen is that on error, - * we no longer have stderr. + * A problem with freopen is that on error, we no longer + * have stderr and cannot emit normal error messages. + * Emit error to stdout, close files, and exit. */ - Gbl_DebugFlag = FALSE; - memcpy (stderr, stdout, sizeof (FILE)); - FlFileError (ASL_FILE_DEBUG_OUTPUT, ASL_MSG_DEBUG_FILENAME); - AslAbort (); + fprintf (stdout, + "\nCould not open debug output file: %s\n\n", Filename); + + CmCleanupAndExit (); + exit (1); } AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT); @@ -621,7 +629,7 @@ FlOpenMiscOutputFiles ( AslCompilerFileHeader (ASL_FILE_LISTING_OUTPUT); } - /* Create the preprocessor output file if preprocessor enabled */ + /* Create the preprocessor output temp file if preprocessor enabled */ if (Gbl_PreprocessFlag) { @@ -636,6 +644,23 @@ FlOpenMiscOutputFiles ( FlOpenFile (ASL_FILE_PREPROCESSOR, Filename, "w+t"); } + /* + * Create the "user" preprocessor output file if -li flag set. + * Note, this file contains no embedded #line directives. + */ + if (Gbl_PreprocessorOutputFlag) + { + Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_PREPROC_USER); + if (!Filename) + { + AslCommonError (ASL_ERROR, ASL_MSG_PREPROCESSOR_FILENAME, + 0, 0, 0, 0, NULL, NULL); + return (AE_ERROR); + } + + FlOpenFile (ASL_FILE_PREPROCESSOR_USER, Filename, "w+t"); + } + /* All done for data table compiler */ if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_DATA) Modified: vendor-sys/acpica/dist/source/compiler/aslfold.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslfold.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslfold.c Tue Jun 16 19:48:16 2015 (r284458) @@ -380,10 +380,12 @@ TrSimpleConstantReduction ( return (Status); } + /* Disconnect any existing children, install new constant */ + + Op->Asl.Child = NULL; TrInstallReducedConstant (Op, ObjDesc); UtSetParseOpName (Op); - Op->Asl.Child = NULL; return (AE_OK); } @@ -547,7 +549,8 @@ TrInstallReducedConstant ( ACPI_PARSE_OBJECT *Op, ACPI_OPERAND_OBJECT *ObjDesc) { - ACPI_PARSE_OBJECT *RootOp; + ACPI_PARSE_OBJECT *LengthOp; + ACPI_PARSE_OBJECT *DataOp; TotalFolds++; @@ -574,17 +577,22 @@ TrInstallReducedConstant ( Op->Asl.ParseOpcode = PARSEOP_STRING_LITERAL; Op->Common.AmlOpcode = AML_STRING_OP; - Op->Asl.AmlLength = ACPI_STRLEN (ObjDesc->String.Pointer) + 1; + Op->Asl.AmlLength = strlen (ObjDesc->String.Pointer) + 1; Op->Common.Value.String = ObjDesc->String.Pointer; DbgPrint (ASL_PARSE_OUTPUT, "Constant expression reduced to (STRING) %s\n\n", Op->Common.Value.String); - break; case ACPI_TYPE_BUFFER: - + /* + * Create a new parse subtree of the form: + * + * BUFFER (Buffer AML opcode) + * INTEGER (Buffer length in bytes) + * RAW_DATA (Buffer byte data) + */ Op->Asl.ParseOpcode = PARSEOP_BUFFER; Op->Common.AmlOpcode = AML_BUFFER_OP; Op->Asl.CompileFlags = NODE_AML_PACKAGE; @@ -592,28 +600,24 @@ TrInstallReducedConstant ( /* Child node is the buffer length */ - RootOp = TrAllocateNode (PARSEOP_INTEGER); - - RootOp->Asl.AmlOpcode = AML_DWORD_OP; - RootOp->Asl.Value.Integer = ObjDesc->Buffer.Length; - RootOp->Asl.Parent = Op; + LengthOp = TrAllocateNode (PARSEOP_INTEGER); - (void) OpcSetOptimalIntegerSize (RootOp); + LengthOp->Asl.AmlOpcode = AML_DWORD_OP; + LengthOp->Asl.Value.Integer = ObjDesc->Buffer.Length; + LengthOp->Asl.Parent = Op; + (void) OpcSetOptimalIntegerSize (LengthOp); - Op->Asl.Child = RootOp; - Op = RootOp; - UtSetParseOpName (Op); + Op->Asl.Child = LengthOp; - /* Peer to the child is the raw buffer data */ + /* Next child is the raw buffer data */ - RootOp = TrAllocateNode (PARSEOP_RAW_DATA); - RootOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER; - RootOp->Asl.AmlLength = ObjDesc->Buffer.Length; - RootOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer; - RootOp->Asl.Parent = Op->Asl.Parent; + DataOp = TrAllocateNode (PARSEOP_RAW_DATA); + DataOp->Asl.AmlOpcode = AML_RAW_DATA_BUFFER; + DataOp->Asl.AmlLength = ObjDesc->Buffer.Length; + DataOp->Asl.Value.String = (char *) ObjDesc->Buffer.Pointer; + DataOp->Asl.Parent = Op; - Op->Asl.Next = RootOp; - Op = RootOp; + LengthOp->Asl.Next = DataOp; DbgPrint (ASL_PARSE_OUTPUT, "Constant expression reduced to (BUFFER) length %X\n\n", Modified: vendor-sys/acpica/dist/source/compiler/aslglobal.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslglobal.h Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslglobal.h Tue Jun 16 19:48:16 2015 (r284458) @@ -73,6 +73,7 @@ ASL_FILE_INFO Gbl_ {NULL, NULL, "Binary Output:", "AML Output"}, {NULL, NULL, "Source Output:", "Source Output"}, {NULL, NULL, "Preprocessor: ", "Preprocessor Output"}, + {NULL, NULL, "Preprocessor: ", "Preprocessor Temp File"}, {NULL, NULL, "Listing File: ", "Listing Output"}, {NULL, NULL, "Hex Dump: ", "Hex Table Output"}, {NULL, NULL, "Namespace: ", "Namespace Output"}, @@ -123,10 +124,10 @@ ASL_EXTERN char ASL_ ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_LineBufPtr, NULL); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_LineBufferSize, ASL_DEFAULT_LINE_BUFFER_SIZE); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentColumn, 0); -ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_PreviousLineNumber, 0); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineNumber, 1); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_LogicalLineNumber, 1); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineOffset, 0); +ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_OriginalInputFileSize, 0); ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_SyntaxError, 0); /* Exception reporting */ @@ -146,6 +147,7 @@ ASL_EXTERN BOOLEAN ASL_ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_MapfileFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NsOutputFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PreprocessorOutputFlag, FALSE); +ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_KeepPreprocessorTempFile, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DebugFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AsmOutputFlag, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_C_OutputFlag, FALSE); Modified: vendor-sys/acpica/dist/source/compiler/aslmain.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmain.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslmain.c Tue Jun 16 19:48:16 2015 (r284458) @@ -261,7 +261,7 @@ AslSignalHandler ( /* Close all open files */ - Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .i file is same as source file */ + Gbl_Files[ASL_FILE_PREPROCESSOR].Handle = NULL; /* the .pre file is same as source file */ for (i = ASL_FILE_INPUT; i < ASL_MAX_FILE_TYPE; i++) { Modified: vendor-sys/acpica/dist/source/compiler/aslmapenter.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmapenter.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslmapenter.c Tue Jun 16 19:48:16 2015 (r284458) @@ -239,7 +239,7 @@ MpCreateGpioInfo ( /* Sort on source DeviceName first */ while (NextGpio && - (ACPI_STRCMP (DeviceName, NextGpio->DeviceName) > 0)) + (strcmp (DeviceName, NextGpio->DeviceName) > 0)) { PrevGpio = NextGpio; NextGpio = NextGpio->Next; @@ -249,7 +249,7 @@ MpCreateGpioInfo ( while (NextGpio && (NextGpio->PinNumber < PinNumber) && - !ACPI_STRCMP (DeviceName, NextGpio->DeviceName)) + !strcmp (DeviceName, NextGpio->DeviceName)) { PrevGpio = NextGpio; NextGpio = NextGpio->Next; @@ -316,7 +316,7 @@ MpCreateSerialInfo ( /* Sort on source DeviceName */ while (NextSerial && - (ACPI_STRCMP (DeviceName, NextSerial->DeviceName) > 0)) + (strcmp (DeviceName, NextSerial->DeviceName) > 0)) { PrevSerial = NextSerial; NextSerial = NextSerial->Next; @@ -326,7 +326,7 @@ MpCreateSerialInfo ( while (NextSerial && (NextSerial->Address < Address) && - !ACPI_STRCMP (DeviceName, NextSerial->DeviceName)) + !strcmp (DeviceName, NextSerial->DeviceName)) { PrevSerial = NextSerial; NextSerial = NextSerial->Next; Modified: vendor-sys/acpica/dist/source/compiler/aslmapoutput.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmapoutput.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslmapoutput.c Tue Jun 16 19:48:16 2015 (r284458) @@ -207,7 +207,7 @@ MpEmitGpioInfo ( /* Print header info for the controller itself */ if (!PrevDeviceName || - ACPI_STRCMP (PrevDeviceName, Info->DeviceName)) + strcmp (PrevDeviceName, Info->DeviceName)) { FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\nGPIO Controller: %-8s %-28s", @@ -360,7 +360,7 @@ MpEmitSerialInfo ( /* Print header info for the controller itself */ if (!PrevDeviceName || - ACPI_STRCMP (PrevDeviceName, Info->DeviceName)) + strcmp (PrevDeviceName, Info->DeviceName)) { FlPrintFile (ASL_FILE_MAP_OUTPUT, "\n\n%s Controller: ", Type); Modified: vendor-sys/acpica/dist/source/compiler/aslmethod.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmethod.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslmethod.c Tue Jun 16 19:48:16 2015 (r284458) @@ -430,7 +430,7 @@ MtMethodAnalysisWalkBegin ( /* Special typechecking for _HID */ - if (!ACPI_STRCMP (METHOD_NAME__HID, Op->Asl.NameSeg)) + if (!strcmp (METHOD_NAME__HID, Op->Asl.NameSeg)) { Next = Op->Asl.Child->Asl.Next; AnCheckId (Next, ASL_TYPE_HID); @@ -438,7 +438,7 @@ MtMethodAnalysisWalkBegin ( /* Special typechecking for _CID */ - else if (!ACPI_STRCMP (METHOD_NAME__CID, Op->Asl.NameSeg)) + else if (!strcmp (METHOD_NAME__CID, Op->Asl.NameSeg)) { Next = Op->Asl.Child->Asl.Next; Modified: vendor-sys/acpica/dist/source/compiler/aslopcodes.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslopcodes.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/aslopcodes.c Tue Jun 16 19:48:16 2015 (r284458) @@ -636,7 +636,7 @@ OpcDoEisaId ( * The EISAID string must be exactly 7 characters and of the form * "UUUXXXX" -- 3 uppercase letters and 4 hex digits (e.g., "PNP0001") */ - if (ACPI_STRLEN (InString) != 7) + if (strlen (InString) != 7) { Status = AE_BAD_PARAMETER; } @@ -855,7 +855,7 @@ OpcFindName ( for (i = 0, Str = List[0]; Str; i++, Str = List[i]) { - if (!(ACPI_STRNCMP (Str, Name, ACPI_STRLEN (Name)))) + if (!(strncmp (Str, Name, strlen (Name)))) { *Index = i; return (TRUE); @@ -907,7 +907,7 @@ OpcDoPld ( return; } - ACPI_MEMSET (&PldInfo, 0, sizeof (ACPI_PLD_INFO)); + memset (&PldInfo, 0, sizeof (ACPI_PLD_INFO)); Node = Op->Asl.Child; while (Node) Modified: vendor-sys/acpica/dist/source/compiler/asloperands.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asloperands.c Tue Jun 16 19:23:34 2015 (r284457) +++ vendor-sys/acpica/dist/source/compiler/asloperands.c Tue Jun 16 19:48:16 2015 (r284458) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@FreeBSD.ORG Tue Jun 16 19:49:12 2015 Return-Path: Delivered-To: svn-src-vendor@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D559FF7B; Tue, 16 Jun 2015 19:49:12 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9CAA2DA; Tue, 16 Jun 2015 19:49:12 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5GJnCUD060931; Tue, 16 Jun 2015 19:49:12 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5GJnCFl060929; Tue, 16 Jun 2015 19:49:12 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201506161949.t5GJnCFl060929@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 16 Jun 2015 19:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r284459 - vendor-sys/acpica/20150616 X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2015 19:49:12 -0000 Author: jkim Date: Tue Jun 16 19:49:12 2015 New Revision: 284459 URL: https://svnweb.freebsd.org/changeset/base/284459 Log: Tag ACPICA 20150616. Added: vendor-sys/acpica/20150616/ - copied from r284458, vendor-sys/acpica/dist/ From owner-svn-src-vendor@FreeBSD.ORG Wed Jun 17 17:11:48 2015 Return-Path: Delivered-To: svn-src-vendor@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6EA1AAA6; Wed, 17 Jun 2015 17:11:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A90686B; Wed, 17 Jun 2015 17:11:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5HHBm7I008233; Wed, 17 Jun 2015 17:11:48 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5HHBio3008199; Wed, 17 Jun 2015 17:11:44 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201506171711.t5HHBio3008199@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 17 Jun 2015 17:11:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r284519 - in vendor-sys/acpica/dist/source: compiler components/debugger components/disassembler components/namespace components/tables components/utilities include include/platform too... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2015 17:11:48 -0000 Author: jkim Date: Wed Jun 17 17:11:44 2015 New Revision: 284519 URL: https://svnweb.freebsd.org/changeset/base/284519 Log: Remove all internal macros and cast various invocations as necessary. https://github.com/acpica/acpica/commit/47d22a7 Modified: vendor-sys/acpica/dist/source/compiler/dtutils.c vendor-sys/acpica/dist/source/components/debugger/dbinput.c vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c vendor-sys/acpica/dist/source/components/namespace/nsdump.c vendor-sys/acpica/dist/source/components/namespace/nsrepair2.c vendor-sys/acpica/dist/source/components/tables/tbprint.c vendor-sys/acpica/dist/source/components/utilities/utprint.c vendor-sys/acpica/dist/source/components/utilities/utstring.c vendor-sys/acpica/dist/source/include/acutils.h vendor-sys/acpica/dist/source/include/platform/acenv.h vendor-sys/acpica/dist/source/tools/acpidump/apfiles.c vendor-sys/acpica/dist/source/tools/acpisrc/asutils.c Modified: vendor-sys/acpica/dist/source/compiler/dtutils.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dtutils.c Wed Jun 17 16:39:12 2015 (r284518) +++ vendor-sys/acpica/dist/source/compiler/dtutils.c Wed Jun 17 17:11:44 2015 (r284519) @@ -241,7 +241,7 @@ DtStrtoul64 ( while (*ThisChar) { - if (isdigit (*ThisChar)) + if (isdigit ((int) *ThisChar)) { /* Convert ASCII 0-9 to Decimal value */ @@ -249,8 +249,8 @@ DtStrtoul64 ( } else /* Letter */ { - ThisDigit = (UINT32) toupper (*ThisChar); - if (!isxdigit ((char) ThisDigit)) + ThisDigit = (UINT32) toupper ((int) *ThisChar); + if (!isxdigit ((int) ThisDigit)) { /* Not A-F */ Modified: vendor-sys/acpica/dist/source/components/debugger/dbinput.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbinput.c Wed Jun 17 16:39:12 2015 (r284518) +++ vendor-sys/acpica/dist/source/components/debugger/dbinput.c Wed Jun 17 17:11:44 2015 (r284519) @@ -361,7 +361,7 @@ AcpiDbMatchCommandHelp ( while ((*Command) && (*Invocation) && (*Invocation != ' ')) { - if (tolower (*Command) != tolower (*Invocation)) + if (tolower ((int) *Command) != tolower ((int) *Invocation)) { return (FALSE); } Modified: vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c ============================================================================== --- vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c Wed Jun 17 16:39:12 2015 (r284518) +++ vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c Wed Jun 17 17:11:44 2015 (r284519) @@ -269,10 +269,10 @@ AcpiDmPredefinedDescription ( * Note: NameString is guaranteed to be upper case here. */ LastCharIsDigit = - (isdigit (NameString[3])); /* d */ + (isdigit ((int) NameString[3])); /* d */ LastCharsAreHex = - (isxdigit (NameString[2]) && /* xx */ - isxdigit (NameString[3])); + (isxdigit ((int) NameString[2]) && /* xx */ + isxdigit ((int) NameString[3])); switch (NameString[1]) { Modified: vendor-sys/acpica/dist/source/components/namespace/nsdump.c ============================================================================== --- vendor-sys/acpica/dist/source/components/namespace/nsdump.c Wed Jun 17 16:39:12 2015 (r284518) +++ vendor-sys/acpica/dist/source/components/namespace/nsdump.c Wed Jun 17 17:11:44 2015 (r284519) @@ -122,7 +122,7 @@ AcpiNsPrintPathname ( { for (i = 0; i < 4; i++) { - isprint (Pathname[i]) ? + isprint ((int) Pathname[i]) ? AcpiOsPrintf ("%c", Pathname[i]) : AcpiOsPrintf ("?"); } Modified: vendor-sys/acpica/dist/source/components/namespace/nsrepair2.c ============================================================================== --- vendor-sys/acpica/dist/source/components/namespace/nsrepair2.c Wed Jun 17 16:39:12 2015 (r284518) +++ vendor-sys/acpica/dist/source/components/namespace/nsrepair2.c Wed Jun 17 17:11:44 2015 (r284519) @@ -637,7 +637,7 @@ AcpiNsRepair_HID ( */ for (Dest = NewString->String.Pointer; *Source; Dest++, Source++) { - *Dest = (char) toupper (*Source); + *Dest = (char) toupper ((int) *Source); } AcpiUtRemoveReference (ReturnObject); Modified: vendor-sys/acpica/dist/source/components/tables/tbprint.c ============================================================================== --- vendor-sys/acpica/dist/source/components/tables/tbprint.c Wed Jun 17 16:39:12 2015 (r284518) +++ vendor-sys/acpica/dist/source/components/tables/tbprint.c Wed Jun 17 17:11:44 2015 (r284519) @@ -84,7 +84,7 @@ AcpiTbFixString ( while (Length && *String) { - if (!isprint (*String)) + if (!isprint ((int) *String)) { *String = '?'; } Modified: vendor-sys/acpica/dist/source/components/utilities/utprint.c ============================================================================== --- vendor-sys/acpica/dist/source/components/utilities/utprint.c Wed Jun 17 16:39:12 2015 (r284518) +++ vendor-sys/acpica/dist/source/components/utilities/utprint.c Wed Jun 17 17:11:44 2015 (r284519) @@ -227,7 +227,7 @@ AcpiUtScanNumber ( UINT64 Number = 0; - while (isdigit (*String)) + while (isdigit ((int) *String)) { Number *= 10; Number += *(String++) - '0'; @@ -505,7 +505,7 @@ AcpiUtVsnprintf ( /* Process width */ Width = -1; - if (isdigit (*Format)) + if (isdigit ((int) *Format)) { Format = AcpiUtScanNumber (Format, &Number); Width = (INT32) Number; @@ -527,7 +527,7 @@ AcpiUtVsnprintf ( if (*Format == '.') { ++Format; - if (isdigit(*Format)) + if (isdigit ((int) *Format)) { Format = AcpiUtScanNumber (Format, &Number); Precision = (INT32) Number; Modified: vendor-sys/acpica/dist/source/components/utilities/utstring.c ============================================================================== --- vendor-sys/acpica/dist/source/components/utilities/utstring.c Wed Jun 17 16:39:12 2015 (r284518) +++ vendor-sys/acpica/dist/source/components/utilities/utstring.c Wed Jun 17 17:11:44 2015 (r284519) @@ -89,7 +89,7 @@ AcpiUtStrlwr ( for (String = SrcString; *String; String++) { - *String = (char) tolower (*String); + *String = (char) tolower ((int) *String); } return; @@ -168,7 +168,7 @@ AcpiUtStrupr ( for (String = SrcString; *String; String++) { - *String = (char) toupper (*String); + *String = (char) toupper ((int) *String); } return; @@ -234,7 +234,7 @@ AcpiUtStrtoul64 ( /* Skip over any white space in the buffer */ - while ((*String) && (isspace (*String) || *String == '\t')) + while ((*String) && (isspace ((int) *String) || *String == '\t')) { String++; } @@ -245,7 +245,7 @@ AcpiUtStrtoul64 ( * Base equal to ACPI_ANY_BASE means 'ToInteger operation case'. * We need to determine if it is decimal or hexadecimal. */ - if ((*String == '0') && (tolower (*(String + 1)) == 'x')) + if ((*String == '0') && (tolower ((int) *(String + 1)) == 'x')) { SignOf0x = 1; Base = 16; @@ -261,7 +261,7 @@ AcpiUtStrtoul64 ( /* Any string left? Check that '0x' is not followed by white space. */ - if (!(*String) || isspace (*String) || *String == '\t') + if (!(*String) || isspace ((int) *String) || *String == '\t') { if (ToIntegerOp) { @@ -283,7 +283,7 @@ AcpiUtStrtoul64 ( while (*String) { - if (isdigit (*String)) + if (isdigit ((int) *String)) { /* Convert ASCII 0-9 to Decimal value */ @@ -297,8 +297,8 @@ AcpiUtStrtoul64 ( } else { - ThisDigit = (UINT8) toupper (*String); - if (isxdigit ((char) ThisDigit)) + ThisDigit = (UINT8) toupper ((int) *String); + if (isxdigit ((int) ThisDigit)) { /* Convert ASCII Hex char to value */ @@ -469,7 +469,7 @@ AcpiUtPrintString ( /* Check for printable character or hex escape */ - if (isprint (String[i])) + if (isprint ((int) String[i])) { /* This is a normal character */ Modified: vendor-sys/acpica/dist/source/include/acutils.h ============================================================================== --- vendor-sys/acpica/dist/source/include/acutils.h Wed Jun 17 16:39:12 2015 (r284518) +++ vendor-sys/acpica/dist/source/include/acutils.h Wed Jun 17 17:11:44 2015 (r284519) @@ -379,24 +379,6 @@ extern const UINT8 _acpi_ctype[]; #define isprint(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU)) #define isalpha(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) -#ifndef ACPI_CLIBRARY -#define strstr(s1,s2) strstr ((s1), (s2)) -#define strchr(s1,c) strchr ((s1), (c)) -#define strlen(s) (ACPI_SIZE) strlen ((s)) -#define strcpy(d,s) (void) strcpy ((d), (s)) -#define strncpy(d,s,n) (void) strncpy ((d), (s), (ACPI_SIZE)(n)) -#define strncmp(d,s,n) strncmp ((d), (s), (ACPI_SIZE)(n)) -#define strcmp(d,s) strcmp ((d), (s)) -#define strcat(d,s) (void) strcat ((d), (s)) -#define strncat(d,s,n) strncat ((d), (s), (ACPI_SIZE)(n)) -#define strtoul(d,s,n) strtoul ((d), (s), (ACPI_SIZE)(n)) -#define memcmp(s1,s2,n) memcmp((void *)(s1), (void *)(s2), (ACPI_SIZE)(n)) -#define memcpy(d,s,n) (void) memcpy ((d), (s), (ACPI_SIZE)(n)) -#define memset(d,v,n) (void) memset ((d), (v), (ACPI_SIZE)(n)) -#define toupper(c) toupper ((int) (c)) -#define tolower(c) tolower ((int) (c)) -#endif /* ACPI_CLIBRARY */ - #endif /* !ACPI_USE_SYSTEM_CLIBRARY */ #define ACPI_IS_ASCII(c) ((c) < 0x80) Modified: vendor-sys/acpica/dist/source/include/platform/acenv.h ============================================================================== --- vendor-sys/acpica/dist/source/include/platform/acenv.h Wed Jun 17 16:39:12 2015 (r284518) +++ vendor-sys/acpica/dist/source/include/platform/acenv.h Wed Jun 17 17:11:44 2015 (r284519) @@ -349,50 +349,6 @@ /* We will be linking to the standard Clib functions */ -#undef strstr -#undef strchr -#undef strlen -#undef strcpy -#undef strncpy -#undef strncmp -#undef strcmp -#undef strcat -#undef strncat -#undef strtoul -#undef memcmp -#undef memcpy -#undef memset -#undef toupper -#undef tolower -#undef isxdigit -#undef isdigit -#undef isspace -#undef isupper -#undef isprint -#undef isalpha - -#define strstr(s1,s2) strstr((s1), (s2)) -#define strchr(s1,c) strchr((s1), (c)) -#define strlen(s) (ACPI_SIZE) strlen((s)) -#define strcpy(d,s) (void) strcpy((d), (s)) -#define strncpy(d,s,n) (void) strncpy((d), (s), (ACPI_SIZE)(n)) -#define strncmp(d,s,n) strncmp((d), (s), (ACPI_SIZE)(n)) -#define strcmp(d,s) strcmp((d), (s)) -#define strcat(d,s) (void) strcat((d), (s)) -#define strncat(d,s,n) strncat((d), (s), (ACPI_SIZE)(n)) -#define strtoul(d,s,n) strtoul((d), (s), (ACPI_SIZE)(n)) -#define memcmp(s1,s2,n) memcmp((const char *)(s1), (const char *)(s2), (ACPI_SIZE)(n)) -#define memcpy(d,s,n) (void) memcpy((d), (s), (ACPI_SIZE)(n)) -#define memset(d,s,n) (void) memset((d), (s), (ACPI_SIZE)(n)) -#define toupper(i) toupper((int) (i)) -#define tolower(i) tolower((int) (i)) -#define isxdigit(i) isxdigit((int) (i)) -#define isdigit(i) isdigit((int) (i)) -#define isspace(i) isspace((int) (i)) -#define isupper(i) isupper((int) (i)) -#define isprint(i) isprint((int) (i)) -#define isalpha(i) isalpha((int) (i)) - #else /****************************************************************************** Modified: vendor-sys/acpica/dist/source/tools/acpidump/apfiles.c ============================================================================== --- vendor-sys/acpica/dist/source/tools/acpidump/apfiles.c Wed Jun 17 16:39:12 2015 (r284518) +++ vendor-sys/acpica/dist/source/tools/acpidump/apfiles.c Wed Jun 17 17:11:44 2015 (r284519) @@ -159,10 +159,10 @@ ApWriteToBinaryFile ( { ACPI_MOVE_NAME (Filename, Table->Signature); } - Filename[0] = (char) tolower (Filename[0]); - Filename[1] = (char) tolower (Filename[1]); - Filename[2] = (char) tolower (Filename[2]); - Filename[3] = (char) tolower (Filename[3]); + Filename[0] = (char) tolower ((int) Filename[0]); + Filename[1] = (char) tolower ((int) Filename[1]); + Filename[2] = (char) tolower ((int) Filename[2]); + Filename[3] = (char) tolower ((int) Filename[3]); Filename[ACPI_NAME_SIZE] = 0; /* Handle multiple SSDTs - create different filenames for each */ Modified: vendor-sys/acpica/dist/source/tools/acpisrc/asutils.c ============================================================================== --- vendor-sys/acpica/dist/source/tools/acpisrc/asutils.c Wed Jun 17 16:39:12 2015 (r284518) +++ vendor-sys/acpica/dist/source/tools/acpisrc/asutils.c Wed Jun 17 17:11:44 2015 (r284519) @@ -72,7 +72,7 @@ AsStrlwr ( { for (String = SrcString; *String; String++) { - *String = (char) tolower (*String); + *String = (char) tolower ((int) *String); } } } From owner-svn-src-vendor@FreeBSD.ORG Thu Jun 18 14:00:45 2015 Return-Path: Delivered-To: svn-src-vendor@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58CE8266; Thu, 18 Jun 2015 14:00:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46658762; Thu, 18 Jun 2015 14:00:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5IE0jZP028267; Thu, 18 Jun 2015 14:00:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5IE0iFN028265; Thu, 18 Jun 2015 14:00:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201506181400.t5IE0iFN028265@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 18 Jun 2015 14:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r284549 - vendor/libcxxrt/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2015 14:00:45 -0000 Author: emaste Date: Thu Jun 18 14:00:44 2015 New Revision: 284549 URL: https://svnweb.freebsd.org/changeset/base/284549 Log: Import libcxxrt master e64e93fe5bba67a6d52cbe5a97f8770c054bfa65 This includes a number of fixes to the C++ demangler (obtained from upstream ELF Tool Chain). Modified: vendor/libcxxrt/dist/dwarf_eh.h vendor/libcxxrt/dist/libelftc_dem_gnu3.c Modified: vendor/libcxxrt/dist/dwarf_eh.h ============================================================================== --- vendor/libcxxrt/dist/dwarf_eh.h Thu Jun 18 13:46:32 2015 (r284548) +++ vendor/libcxxrt/dist/dwarf_eh.h Thu Jun 18 14:00:44 2015 (r284549) @@ -218,15 +218,17 @@ static int64_t read_sleb128(dw_eh_ptr_t static uint64_t read_value(char encoding, dw_eh_ptr_t *data) { enum dwarf_data_encoding type = get_encoding(encoding); - uint64_t v; switch (type) { // Read fixed-length types #define READ(dwarf, type) \ case dwarf:\ - v = static_cast(*reinterpret_cast(*data));\ - *data += sizeof(type);\ - break; + {\ + type t;\ + memcpy(&t, *data, sizeof t);\ + *data += sizeof t;\ + return static_cast(t);\ + } READ(DW_EH_PE_udata2, uint16_t) READ(DW_EH_PE_udata4, uint32_t) READ(DW_EH_PE_udata8, uint64_t) @@ -237,15 +239,11 @@ static uint64_t read_value(char encoding #undef READ // Read variable-length types case DW_EH_PE_sleb128: - v = read_sleb128(data); - break; + return read_sleb128(data); case DW_EH_PE_uleb128: - v = read_uleb128(data); - break; + return read_uleb128(data); default: abort(); } - - return v; } /** Modified: vendor/libcxxrt/dist/libelftc_dem_gnu3.c ============================================================================== --- vendor/libcxxrt/dist/libelftc_dem_gnu3.c Thu Jun 18 13:46:32 2015 (r284548) +++ vendor/libcxxrt/dist/libelftc_dem_gnu3.c Thu Jun 18 14:00:44 2015 (r284549) @@ -59,7 +59,7 @@ struct vector_str { enum type_qualifier { TYPE_PTR, TYPE_REF, TYPE_CMX, TYPE_IMG, TYPE_EXT, TYPE_RST, TYPE_VAT, - TYPE_CST + TYPE_CST, TYPE_VEC }; struct vector_type_qualifier { @@ -397,6 +397,8 @@ static int cpp_demangle_read_array(struc static int cpp_demangle_read_encoding(struct cpp_demangle_data *); static int cpp_demangle_read_expr_primary(struct cpp_demangle_data *); static int cpp_demangle_read_expression(struct cpp_demangle_data *); +static int cpp_demangle_read_expression_flat(struct cpp_demangle_data *, + char **); static int cpp_demangle_read_expression_binary(struct cpp_demangle_data *, const char *, size_t); static int cpp_demangle_read_expression_unary(struct cpp_demangle_data *, @@ -408,8 +410,12 @@ static int cpp_demangle_read_function(st static int cpp_demangle_local_source_name(struct cpp_demangle_data *ddata); static int cpp_demangle_read_local_name(struct cpp_demangle_data *); static int cpp_demangle_read_name(struct cpp_demangle_data *); +static int cpp_demangle_read_name_flat(struct cpp_demangle_data *, + char**); static int cpp_demangle_read_nested_name(struct cpp_demangle_data *); static int cpp_demangle_read_number(struct cpp_demangle_data *, long *); +static int cpp_demangle_read_number_as_string(struct cpp_demangle_data *, + char **); static int cpp_demangle_read_nv_offset(struct cpp_demangle_data *); static int cpp_demangle_read_offset(struct cpp_demangle_data *); static int cpp_demangle_read_offset_number(struct cpp_demangle_data *); @@ -423,6 +429,8 @@ static int cpp_demangle_read_tmpl_arg(st static int cpp_demangle_read_tmpl_args(struct cpp_demangle_data *); static int cpp_demangle_read_tmpl_param(struct cpp_demangle_data *); static int cpp_demangle_read_type(struct cpp_demangle_data *, int); +static int cpp_demangle_read_type_flat(struct cpp_demangle_data *, + char **); static int cpp_demangle_read_uqname(struct cpp_demangle_data *); static int cpp_demangle_read_v_offset(struct cpp_demangle_data *); static char *decode_fp_to_double(const char *, size_t); @@ -601,17 +609,18 @@ cpp_demangle_push_fp(struct cpp_demangle fp = ddata->cur; while (*ddata->cur != 'E') ++ddata->cur; - ++ddata->cur; if ((f = decoder(fp, ddata->cur - fp)) == NULL) return (0); rtn = 0; if ((len = strlen(f)) > 0) - rtn = cpp_demangle_push_str(ddata, f, len); + rtn = cpp_demangle_push_str(ddata, f, len); free(f); + ++ddata->cur; + return (rtn); } @@ -695,7 +704,8 @@ cpp_demangle_push_type_qualifier(struct if (type_str != NULL) { if (!vector_str_push(&subst_v, "*", 1)) goto clean; - if (!cpp_demangle_push_subst_v(ddata, &subst_v)) + if (!cpp_demangle_push_subst_v(ddata, + &subst_v)) goto clean; } break; @@ -706,7 +716,8 @@ cpp_demangle_push_type_qualifier(struct if (type_str != NULL) { if (!vector_str_push(&subst_v, "&", 1)) goto clean; - if (!cpp_demangle_push_subst_v(ddata, &subst_v)) + if (!cpp_demangle_push_subst_v(ddata, + &subst_v)) goto clean; } break; @@ -717,7 +728,8 @@ cpp_demangle_push_type_qualifier(struct if (type_str != NULL) { if (!vector_str_push(&subst_v, " complex", 8)) goto clean; - if (!cpp_demangle_push_subst_v(ddata, &subst_v)) + if (!cpp_demangle_push_subst_v(ddata, + &subst_v)) goto clean; } break; @@ -726,23 +738,26 @@ cpp_demangle_push_type_qualifier(struct if (!cpp_demangle_push_str(ddata, " imaginary", 10)) goto clean; if (type_str != NULL) { - if (!vector_str_push(&subst_v, " imaginary", 10)) + if (!vector_str_push(&subst_v, " imaginary", + 10)) goto clean; - if (!cpp_demangle_push_subst_v(ddata, &subst_v)) + if (!cpp_demangle_push_subst_v(ddata, + &subst_v)) goto clean; } break; case TYPE_EXT: - if (e_idx > v->ext_name.size - 1) + if (v->ext_name.size == 0 || + e_idx > v->ext_name.size - 1) goto clean; - if ((e_len = strlen(v->ext_name.container[e_idx])) == 0) + if ((e_len = strlen(v->ext_name.container[e_idx])) == + 0) goto clean; - if ((buf = malloc(sizeof(char) * (e_len + 1))) == NULL) + if ((buf = malloc(e_len + 2)) == NULL) goto clean; - - memcpy(buf, " ", 1); - memcpy(buf + 1, v->ext_name.container[e_idx], e_len); + snprintf(buf, e_len + 2, " %s", + v->ext_name.container[e_idx]); if (!cpp_demangle_push_str(ddata, buf, e_len + 1)) { free(buf); @@ -755,7 +770,8 @@ cpp_demangle_push_type_qualifier(struct free(buf); goto clean; } - if (!cpp_demangle_push_subst_v(ddata, &subst_v)) { + if (!cpp_demangle_push_subst_v(ddata, + &subst_v)) { free(buf); goto clean; } @@ -770,7 +786,8 @@ cpp_demangle_push_type_qualifier(struct if (type_str != NULL) { if (!vector_str_push(&subst_v, " restrict", 9)) goto clean; - if (!cpp_demangle_push_subst_v(ddata, &subst_v)) + if (!cpp_demangle_push_subst_v(ddata, + &subst_v)) goto clean; } break; @@ -781,7 +798,8 @@ cpp_demangle_push_type_qualifier(struct if (type_str != NULL) { if (!vector_str_push(&subst_v, " volatile", 9)) goto clean; - if (!cpp_demangle_push_subst_v(ddata, &subst_v)) + if (!cpp_demangle_push_subst_v(ddata, + &subst_v)) goto clean; } break; @@ -792,11 +810,42 @@ cpp_demangle_push_type_qualifier(struct if (type_str != NULL) { if (!vector_str_push(&subst_v, " const", 6)) goto clean; - if (!cpp_demangle_push_subst_v(ddata, &subst_v)) + if (!cpp_demangle_push_subst_v(ddata, + &subst_v)) goto clean; } break; + case TYPE_VEC: + if (v->ext_name.size == 0 || + e_idx > v->ext_name.size - 1) + goto clean; + if ((e_len = strlen(v->ext_name.container[e_idx])) == + 0) + goto clean; + if ((buf = malloc(e_len + 12)) == NULL) + goto clean; + snprintf(buf, e_len + 12, " __vector(%s)", + v->ext_name.container[e_idx]); + if (!cpp_demangle_push_str(ddata, buf, e_len + 11)) { + free(buf); + goto clean; + } + if (type_str != NULL) { + if (!vector_str_push(&subst_v, buf, + e_len + 11)) { + free(buf); + goto clean; + } + if (!cpp_demangle_push_subst_v(ddata, + &subst_v)) { + free(buf); + goto clean; + } + } + free(buf); + ++e_idx; + break; }; --idx; } @@ -947,10 +996,14 @@ cpp_demangle_read_expr_primary(struct cp switch (*ddata->cur) { case 'b': + if (*(ddata->cur + 2) != 'E') + return (0); switch (*(++ddata->cur)) { case '0': + ddata->cur += 2; return (cpp_demangle_push_str(ddata, "false", 5)); case '1': + ddata->cur += 2; return (cpp_demangle_push_str(ddata, "true", 4)); default: return (0); @@ -999,7 +1052,8 @@ cpp_demangle_read_expr_primary(struct cp ++ddata->cur; } ++ddata->cur; - return (cpp_demangle_push_str(ddata, num, ddata->cur - num)); + return (cpp_demangle_push_str(ddata, num, + ddata->cur - num - 1)); default: return (0); @@ -1291,6 +1345,38 @@ cpp_demangle_read_expression(struct cpp_ } static int +cpp_demangle_read_expression_flat(struct cpp_demangle_data *ddata, char **str) +{ + struct vector_str *output; + size_t i, p_idx, idx, exp_len; + char *exp; + + output = ddata->push_head > 0 ? &ddata->output_tmp : + &ddata->output; + + p_idx = output->size; + + if (!cpp_demangle_read_expression(ddata)) + return (0); + + if ((exp = vector_str_substr(output, p_idx, output->size - 1, + &exp_len)) == NULL) + return (0); + + idx = output->size; + for (i = p_idx; i < idx; ++i) { + if (!vector_str_pop(output)) { + free(exp); + return (0); + } + } + + *str = exp; + + return (1); +} + +static int cpp_demangle_read_expression_binary(struct cpp_demangle_data *ddata, const char *name, size_t len) { @@ -1419,12 +1505,65 @@ cpp_demangle_read_function(struct cpp_de static int cpp_demangle_read_encoding(struct cpp_demangle_data *ddata) { + char *name, *type, *num_str; + long offset; + int rtn; if (ddata == NULL || *ddata->cur == '\0') return (0); /* special name */ switch (SIMPLE_HASH(*ddata->cur, *(ddata->cur + 1))) { + case SIMPLE_HASH('G', 'A'): + if (!cpp_demangle_push_str(ddata, "hidden alias for ", 17)) + return (0); + ddata->cur += 2; + if (*ddata->cur == '\0') + return (0); + return (cpp_demangle_read_encoding(ddata)); + + case SIMPLE_HASH('G', 'R'): + if (!cpp_demangle_push_str(ddata, "reference temporary #", 21)) + return (0); + ddata->cur += 2; + if (*ddata->cur == '\0') + return (0); + if (!cpp_demangle_read_name_flat(ddata, &name)) + return (0); + rtn = 0; + if (!cpp_demangle_read_number_as_string(ddata, &num_str)) + goto clean1; + if (!cpp_demangle_push_str(ddata, num_str, strlen(num_str))) + goto clean2; + if (!cpp_demangle_push_str(ddata, " for ", 5)) + goto clean2; + if (!cpp_demangle_push_str(ddata, name, strlen(name))) + goto clean2; + rtn = 1; + clean2: + free(num_str); + clean1: + free(name); + return (rtn); + + case SIMPLE_HASH('G', 'T'): + ddata->cur += 2; + if (*ddata->cur == '\0') + return (0); + switch (*ddata->cur) { + case 'n': + if (!cpp_demangle_push_str(ddata, + "non-transaction clone for ", 26)) + return (0); + case 't': + default: + if (!cpp_demangle_push_str(ddata, + "transaction clone for ", 22)) + return (0); + } + ++ddata->cur; + return (cpp_demangle_read_encoding(ddata)); + case SIMPLE_HASH('G', 'V'): /* sentry object for 1 time init */ if (!cpp_demangle_push_str(ddata, "guard variable for ", 20)) @@ -1446,14 +1585,49 @@ cpp_demangle_read_encoding(struct cpp_de return (0); return (cpp_demangle_read_encoding(ddata)); + case SIMPLE_HASH('T', 'C'): + /* construction vtable */ + if (!cpp_demangle_push_str(ddata, "construction vtable for ", + 24)) + return (0); + ddata->cur += 2; + if (*ddata->cur == '\0') + return (0); + if (!cpp_demangle_read_type_flat(ddata, &type)) + return (0); + rtn = 0; + if (!cpp_demangle_read_number(ddata, &offset)) + goto clean3; + if (*ddata->cur++ != '_') + goto clean3; + if (!cpp_demangle_read_type(ddata, 0)) + goto clean3; + if (!cpp_demangle_push_str(ddata, "-in-", 4)) + goto clean3; + if (!cpp_demangle_push_str(ddata, type, strlen(type))) + goto clean3; + rtn = 1; + clean3: + free(type); + return (rtn); + case SIMPLE_HASH('T', 'D'): /* typeinfo common proxy */ break; + case SIMPLE_HASH('T', 'F'): + /* typeinfo fn */ + if (!cpp_demangle_push_str(ddata, "typeinfo fn for ", 16)) + return (0); + ddata->cur += 2; + if (*ddata->cur == '\0') + return (0); + return (cpp_demangle_read_type(ddata, 0)); + case SIMPLE_HASH('T', 'h'): /* virtual function non-virtual override thunk */ - if (cpp_demangle_push_str(ddata, - "virtual function non-virtual override ", 38) == 0) + if (!cpp_demangle_push_str(ddata, + "virtual function non-virtual override ", 38)) return (0); ddata->cur += 2; if (*ddata->cur == '\0') @@ -1462,24 +1636,51 @@ cpp_demangle_read_encoding(struct cpp_de return (0); return (cpp_demangle_read_encoding(ddata)); + case SIMPLE_HASH('T', 'H'): + /* TLS init function */ + if (!cpp_demangle_push_str(ddata, "TLS init function for ", + 22)) + return (0); + ddata->cur += 2; + if (*ddata->cur == '\0') + return (0); + break; + case SIMPLE_HASH('T', 'I'): /* typeinfo structure */ - /* FALLTHROUGH */ + if (!cpp_demangle_push_str(ddata, "typeinfo for ", 13)) + return (0); + ddata->cur += 2; + if (*ddata->cur == '\0') + return (0); + return (cpp_demangle_read_type(ddata, 0)); + + case SIMPLE_HASH('T', 'J'): + /* java class */ + if (!cpp_demangle_push_str(ddata, "java Class for ", 15)) + return (0); + ddata->cur += 2; + if (*ddata->cur == '\0') + return (0); + return (cpp_demangle_read_type(ddata, 0)); + case SIMPLE_HASH('T', 'S'): /* RTTI name (NTBS) */ - if (!cpp_demangle_push_str(ddata, "typeinfo for ", 14)) + if (!cpp_demangle_push_str(ddata, "typeinfo name for ", 18)) return (0); ddata->cur += 2; if (*ddata->cur == '\0') return (0); - return (cpp_demangle_read_type(ddata, 1)); + return (cpp_demangle_read_type(ddata, 0)); case SIMPLE_HASH('T', 'T'): /* VTT table */ if (!cpp_demangle_push_str(ddata, "VTT for ", 8)) return (0); ddata->cur += 2; - return (cpp_demangle_read_type(ddata, 1)); + if (*ddata->cur == '\0') + return (0); + return (cpp_demangle_read_type(ddata, 0)); case SIMPLE_HASH('T', 'v'): /* virtual function virtual override thunk */ @@ -1500,7 +1701,17 @@ cpp_demangle_read_encoding(struct cpp_de ddata->cur += 2; if (*ddata->cur == '\0') return (0); - return (cpp_demangle_read_type(ddata, 1)); + return (cpp_demangle_read_type(ddata, 0)); + + case SIMPLE_HASH('T', 'W'): + /* TLS wrapper function */ + if (!cpp_demangle_push_str(ddata, "TLS wrapper function for ", + 25)) + return (0); + ddata->cur += 2; + if (*ddata->cur == '\0') + return (0); + break; }; return (cpp_demangle_read_name(ddata)); @@ -1618,6 +1829,38 @@ clean: } static int +cpp_demangle_read_name_flat(struct cpp_demangle_data *ddata, char **str) +{ + struct vector_str *output; + size_t i, p_idx, idx, name_len; + char *name; + + output = ddata->push_head > 0 ? &ddata->output_tmp : + &ddata->output; + + p_idx = output->size; + + if (!cpp_demangle_read_name(ddata)) + return (0); + + if ((name = vector_str_substr(output, p_idx, output->size - 1, + &name_len)) == NULL) + return (0); + + idx = output->size; + for (i = p_idx; i < idx; ++i) { + if (!vector_str_pop(output)) { + free(name); + return (0); + } + } + + *str = name; + + return (1); +} + +static int cpp_demangle_read_nested_name(struct cpp_demangle_data *ddata) { struct vector_str *output, v; @@ -1743,6 +1986,24 @@ cpp_demangle_read_number(struct cpp_dema } static int +cpp_demangle_read_number_as_string(struct cpp_demangle_data *ddata, char **str) +{ + long n; + + if (!cpp_demangle_read_number(ddata, &n)) { + *str = NULL; + return (0); + } + + if (asprintf(str, "%ld", n) < 0) { + *str = NULL; + return (0); + } + + return (1); +} + +static int cpp_demangle_read_nv_offset(struct cpp_demangle_data *ddata) { @@ -1877,11 +2138,11 @@ cpp_demangle_read_sname(struct cpp_deman len <= 0) return (0); - if (len == 12 && (memcmp("_GLOBAL__N_1", ddata->cur, 12) == 0)) + if (len == 12 && (memcmp("_GLOBAL__N_1", ddata->cur, 12) == 0)) err = cpp_demangle_push_str(ddata, "(anonymous namespace)", 21); else err = cpp_demangle_push_str(ddata, ddata->cur, len); - + if (err == 0) return (0); @@ -2232,7 +2493,7 @@ cpp_demangle_read_type(struct cpp_demang size_t p_idx, type_str_len; int extern_c, is_builtin; long len; - char *type_str; + char *type_str, *exp_str, *num_str; if (ddata == NULL) return (0); @@ -2274,7 +2535,7 @@ cpp_demangle_read_type(struct cpp_demang extern_c = 0; is_builtin = 1; p_idx = output->size; - type_str = NULL; + type_str = exp_str = num_str = NULL; again: /* builtin type */ switch (*ddata->cur) { @@ -2320,6 +2581,82 @@ again: ++ddata->cur; goto rtn; + case 'D': + ++ddata->cur; + switch (*ddata->cur) { + case 'd': + /* IEEE 754r decimal floating point (64 bits) */ + if (!cpp_demangle_push_str(ddata, "decimal64", 9)) + goto clean; + ++ddata->cur; + break; + case 'e': + /* IEEE 754r decimal floating point (128 bits) */ + if (!cpp_demangle_push_str(ddata, "decimal128", 10)) + goto clean; + ++ddata->cur; + break; + case 'f': + /* IEEE 754r decimal floating point (32 bits) */ + if (!cpp_demangle_push_str(ddata, "decimal32", 9)) + goto clean; + ++ddata->cur; + break; + case 'h': + /* IEEE 754r half-precision floating point (16 bits) */ + if (!cpp_demangle_push_str(ddata, "half", 4)) + goto clean; + ++ddata->cur; + break; + case 'i': + /* char32_t */ + if (!cpp_demangle_push_str(ddata, "char32_t", 8)) + goto clean; + ++ddata->cur; + break; + case 'n': + /* std::nullptr_t (i.e., decltype(nullptr)) */ + if (!cpp_demangle_push_str(ddata, "decltype(nullptr)", + 17)) + goto clean; + ++ddata->cur; + break; + case 's': + /* char16_t */ + if (!cpp_demangle_push_str(ddata, "char16_t", 8)) + goto clean; + ++ddata->cur; + break; + case 'v': + /* gcc vector_size extension. */ + ++ddata->cur; + if (*ddata->cur == '_') { + ++ddata->cur; + if (!cpp_demangle_read_expression_flat(ddata, + &exp_str)) + goto clean; + if (!vector_str_push(&v.ext_name, exp_str, + strlen(exp_str))) + goto clean; + } else { + if (!cpp_demangle_read_number_as_string(ddata, + &num_str)) + goto clean; + if (!vector_str_push(&v.ext_name, num_str, + strlen(num_str))) + goto clean; + } + if (*ddata->cur != '_') + goto clean; + ++ddata->cur; + if (!vector_type_qualifier_push(&v, TYPE_VEC)) + goto clean; + goto again; + default: + goto clean; + } + goto rtn; + case 'e': /* long double */ if (!cpp_demangle_push_str(ddata, "long double", 11)) @@ -2414,7 +2751,7 @@ again: case 'o': /* unsigned __int128 */ - if (!cpp_demangle_push_str(ddata, "unsigned _;int128", 17)) + if (!cpp_demangle_push_str(ddata, "unsigned __int128", 17)) goto clean; ++ddata->cur; goto rtn; @@ -2485,6 +2822,8 @@ again: if (!vector_str_push(&v.ext_name, ddata->cur, len)) return (0); ddata->cur += len; + if (!vector_type_qualifier_push(&v, TYPE_EXT)) + goto clean; goto again; case 'v': @@ -2549,6 +2888,8 @@ rtn: goto clean; free(type_str); + free(exp_str); + free(num_str); vector_type_qualifier_dest(&v); if (ddata->push_head > 0) { @@ -2580,11 +2921,45 @@ rtn: return (1); clean: free(type_str); + free(exp_str); + free(num_str); vector_type_qualifier_dest(&v); return (0); } +static int +cpp_demangle_read_type_flat(struct cpp_demangle_data *ddata, char **str) +{ + struct vector_str *output; + size_t i, p_idx, idx, type_len; + char *type; + + output = ddata->push_head > 0 ? &ddata->output_tmp : + &ddata->output; + + p_idx = output->size; + + if (!cpp_demangle_read_type(ddata, 0)) + return (0); + + if ((type = vector_str_substr(output, p_idx, output->size - 1, + &type_len)) == NULL) + return (0); + + idx = output->size; + for (i = p_idx; i < idx; ++i) { + if (!vector_str_pop(output)) { + free(type); + return (0); + } + } + + *str = type; + + return (1); +} + /* * read unqualified-name, unqualified name are operator-name, ctor-dtor-name, * source-name @@ -3008,39 +3383,38 @@ cpp_demangle_read_uqname(struct cpp_dema if (ELFTC_ISDIGIT(*ddata->cur) != 0) return (cpp_demangle_read_sname(ddata)); - - /* local source name */ - if (*ddata->cur == 'L') - return (cpp_demangle_local_source_name(ddata)); - - return (1); -} - -/* - * Read local source name. - * - * References: - * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31775 - * http://gcc.gnu.org/viewcvs?view=rev&revision=124467 - */ -static int -cpp_demangle_local_source_name(struct cpp_demangle_data *ddata) -{ - /* L */ - if (ddata == NULL || *ddata->cur != 'L') - return (0); - ++ddata->cur; - - /* source name */ - if (!cpp_demangle_read_sname(ddata)) - return (0); - - /* discriminator */ - if (*ddata->cur == '_') { - ++ddata->cur; - while (ELFTC_ISDIGIT(*ddata->cur) != 0) - ++ddata->cur; - } + /* local source name */ + if (*ddata->cur == 'L') + return (cpp_demangle_local_source_name(ddata)); + + return (1); +} + +/* + * Read local source name. + * + * References: + * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31775 + * http://gcc.gnu.org/viewcvs?view=rev&revision=124467 + */ +static int +cpp_demangle_local_source_name(struct cpp_demangle_data *ddata) +{ + /* L */ + if (ddata == NULL || *ddata->cur != 'L') + return (0); + ++ddata->cur; + + /* source name */ + if (!cpp_demangle_read_sname(ddata)) + return (0); + + /* discriminator */ + if (*ddata->cur == '_') { + ++ddata->cur; + while (ELFTC_ISDIGIT(*ddata->cur) != 0) + ++ddata->cur; + } return (1); } From owner-svn-src-vendor@FreeBSD.ORG Thu Jun 18 14:02:20 2015 Return-Path: Delivered-To: svn-src-vendor@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 535EA39E; Thu, 18 Jun 2015 14:02:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FD728D7; Thu, 18 Jun 2015 14:02:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5IE2K07030895; Thu, 18 Jun 2015 14:02:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5IE2JO2030886; Thu, 18 Jun 2015 14:02:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201506181402.t5IE2JO2030886@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 18 Jun 2015 14:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r284550 - vendor/libcxxrt/2015-06-18-e64e93fe5bba67a6d52cbe5a97f8770c054bfa65 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2015 14:02:20 -0000 Author: emaste Date: Thu Jun 18 14:02:19 2015 New Revision: 284550 URL: https://svnweb.freebsd.org/changeset/base/284550 Log: Tag libcxxrt master e64e93fe5bba67a6d52cbe5a97f8770c054bfa65. Added: vendor/libcxxrt/2015-06-18-e64e93fe5bba67a6d52cbe5a97f8770c054bfa65/ - copied from r284545, vendor/libcxxrt/dist/ Replaced: vendor/libcxxrt/2015-06-18-e64e93fe5bba67a6d52cbe5a97f8770c054bfa65/dwarf_eh.h - copied unchanged from r284549, vendor/libcxxrt/dist/dwarf_eh.h vendor/libcxxrt/2015-06-18-e64e93fe5bba67a6d52cbe5a97f8770c054bfa65/libelftc_dem_gnu3.c - copied unchanged from r284549, vendor/libcxxrt/dist/libelftc_dem_gnu3.c Copied: vendor/libcxxrt/2015-06-18-e64e93fe5bba67a6d52cbe5a97f8770c054bfa65/dwarf_eh.h (from r284549, vendor/libcxxrt/dist/dwarf_eh.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libcxxrt/2015-06-18-e64e93fe5bba67a6d52cbe5a97f8770c054bfa65/dwarf_eh.h Thu Jun 18 14:02:19 2015 (r284550, copy of r284549, vendor/libcxxrt/dist/dwarf_eh.h) @@ -0,0 +1,477 @@ +/* + * Copyright 2010-2011 PathScale, 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 COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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. + */ +/** + * dwarf_eh.h - Defines some helper functions for parsing DWARF exception + * handling tables. + * + * This file contains various helper functions that are independent of the + * language-specific code. It can be used in any personality function for the + * Itanium ABI. + */ +#include + +// TODO: Factor out Itanium / ARM differences. We probably want an itanium.h +// and arm.h that can be included by this file depending on the target ABI. + +// _GNU_SOURCE must be defined for unwind.h to expose some of the functions +// that we want. If it isn't, then we define it and undefine it to make sure +// that it doesn't impact the rest of the program. +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +# include "unwind.h" +# undef _GNU_SOURCE +#else +# include "unwind.h" +#endif + +#include + +/// Type used for pointers into DWARF data +typedef unsigned char *dw_eh_ptr_t; + +// Flag indicating a signed quantity +#define DW_EH_PE_signed 0x08 +/// DWARF data encoding types. +enum dwarf_data_encoding +{ + /// Absolute pointer value + DW_EH_PE_absptr = 0x00, + /// Unsigned, little-endian, base 128-encoded (variable length). + DW_EH_PE_uleb128 = 0x01, + /// Unsigned 16-bit integer. + DW_EH_PE_udata2 = 0x02, + /// Unsigned 32-bit integer. + DW_EH_PE_udata4 = 0x03, + /// Unsigned 64-bit integer. + DW_EH_PE_udata8 = 0x04, + /// Signed, little-endian, base 128-encoded (variable length) + DW_EH_PE_sleb128 = DW_EH_PE_uleb128 | DW_EH_PE_signed, + /// Signed 16-bit integer. + DW_EH_PE_sdata2 = DW_EH_PE_udata2 | DW_EH_PE_signed, + /// Signed 32-bit integer. + DW_EH_PE_sdata4 = DW_EH_PE_udata4 | DW_EH_PE_signed, + /// Signed 32-bit integer. + DW_EH_PE_sdata8 = DW_EH_PE_udata8 | DW_EH_PE_signed +}; + +/** + * Returns the encoding for a DWARF EH table entry. The encoding is stored in + * the low four of an octet. The high four bits store the addressing mode. + */ +static inline enum dwarf_data_encoding get_encoding(unsigned char x) +{ + return static_cast(x & 0xf); +} + +/** + * DWARF addressing mode constants. When reading a pointer value from a DWARF + * exception table, you must know how it is stored and what the addressing mode + * is. The low four bits tell you the encoding, allowing you to decode a + * number. The high four bits tell you the addressing mode, allowing you to + * turn that number into an address in memory. + */ +enum dwarf_data_relative +{ + /// Value is omitted + DW_EH_PE_omit = 0xff, + /// Value relative to program counter + DW_EH_PE_pcrel = 0x10, + /// Value relative to the text segment + DW_EH_PE_textrel = 0x20, + /// Value relative to the data segment + DW_EH_PE_datarel = 0x30, + /// Value relative to the start of the function + DW_EH_PE_funcrel = 0x40, + /// Aligned pointer (Not supported yet - are they actually used?) + DW_EH_PE_aligned = 0x50, + /// Pointer points to address of real value + DW_EH_PE_indirect = 0x80 +}; +/** + * Returns the addressing mode component of this encoding. + */ +static inline enum dwarf_data_relative get_base(unsigned char x) +{ + return static_cast(x & 0x70); +} +/** + * Returns whether an encoding represents an indirect address. + */ +static int is_indirect(unsigned char x) +{ + return ((x & DW_EH_PE_indirect) == DW_EH_PE_indirect); +} + +/** + * Returns the size of a fixed-size encoding. This function will abort if + * called with a value that is not a fixed-size encoding. + */ +static inline int dwarf_size_of_fixed_size_field(unsigned char type) +{ + switch (get_encoding(type)) + { + default: abort(); + case DW_EH_PE_sdata2: + case DW_EH_PE_udata2: return 2; + case DW_EH_PE_sdata4: + case DW_EH_PE_udata4: return 4; + case DW_EH_PE_sdata8: + case DW_EH_PE_udata8: return 8; + case DW_EH_PE_absptr: return sizeof(void*); + } +} + +/** + * Read an unsigned, little-endian, base-128, DWARF value. Updates *data to + * point to the end of the value. Stores the number of bits read in the value + * pointed to by b, allowing you to determine the value of the highest bit, and + * therefore the sign of a signed value. + * + * This function is not intended to be called directly. Use read_sleb128() or + * read_uleb128() for reading signed and unsigned versions, respectively. + */ +static uint64_t read_leb128(dw_eh_ptr_t *data, int *b) +{ + uint64_t uleb = 0; + unsigned int bit = 0; + unsigned char digit = 0; + // We have to read at least one octet, and keep reading until we get to one + // with the high bit unset + do + { + // This check is a bit too strict - we should also check the highest + // bit of the digit. + assert(bit < sizeof(uint64_t) * 8); + // Get the base 128 digit + digit = (**data) & 0x7f; + // Add it to the current value + uleb += digit << bit; + // Increase the shift value + bit += 7; + // Proceed to the next octet + (*data)++; + // Terminate when we reach a value that does not have the high bit set + // (i.e. which was not modified when we mask it with 0x7f) + } while ((*(*data - 1)) != digit); + *b = bit; + + return uleb; +} + +/** + * Reads an unsigned little-endian base-128 value starting at the address + * pointed to by *data. Updates *data to point to the next byte after the end + * of the variable-length value. + */ +static int64_t read_uleb128(dw_eh_ptr_t *data) +{ + int b; + return read_leb128(data, &b); +} + +/** + * Reads a signed little-endian base-128 value starting at the address pointed + * to by *data. Updates *data to point to the next byte after the end of the + * variable-length value. + */ +static int64_t read_sleb128(dw_eh_ptr_t *data) +{ + int bits; + // Read as if it's signed + uint64_t uleb = read_leb128(data, &bits); + // If the most significant bit read is 1, then we need to sign extend it + if ((uleb >> (bits-1)) == 1) + { + // Sign extend by setting all bits in front of it to 1 + uleb |= static_cast(-1) << bits; + } + return static_cast(uleb); +} +/** + * Reads a value using the specified encoding from the address pointed to by + * *data. Updates the value of *data to point to the next byte after the end + * of the data. + */ +static uint64_t read_value(char encoding, dw_eh_ptr_t *data) +{ + enum dwarf_data_encoding type = get_encoding(encoding); + switch (type) + { + // Read fixed-length types +#define READ(dwarf, type) \ + case dwarf:\ + {\ + type t;\ + memcpy(&t, *data, sizeof t);\ + *data += sizeof t;\ + return static_cast(t);\ + } + READ(DW_EH_PE_udata2, uint16_t) + READ(DW_EH_PE_udata4, uint32_t) + READ(DW_EH_PE_udata8, uint64_t) + READ(DW_EH_PE_sdata2, int16_t) + READ(DW_EH_PE_sdata4, int32_t) + READ(DW_EH_PE_sdata8, int64_t) + READ(DW_EH_PE_absptr, intptr_t) +#undef READ + // Read variable-length types + case DW_EH_PE_sleb128: + return read_sleb128(data); + case DW_EH_PE_uleb128: + return read_uleb128(data); + default: abort(); + } +} + +/** + * Resolves an indirect value. This expects an unwind context, an encoding, a + * decoded value, and the start of the region as arguments. The returned value + * is a pointer to the address identified by the encoded value. + * + * If the encoding does not specify an indirect value, then this returns v. + */ +static uint64_t resolve_indirect_value(_Unwind_Context *c, + unsigned char encoding, + int64_t v, + dw_eh_ptr_t start) +{ + switch (get_base(encoding)) + { + case DW_EH_PE_pcrel: + v += reinterpret_cast(start); + break; + case DW_EH_PE_textrel: + v += static_cast(static_cast(_Unwind_GetTextRelBase(c))); + break; + case DW_EH_PE_datarel: + v += static_cast(static_cast(_Unwind_GetDataRelBase(c))); + break; + case DW_EH_PE_funcrel: + v += static_cast(static_cast(_Unwind_GetRegionStart(c))); + default: + break; + } + // If this is an indirect value, then it is really the address of the real + // value + // TODO: Check whether this should really always be a pointer - it seems to + // be a GCC extensions, so not properly documented... + if (is_indirect(encoding)) + { + v = static_cast(reinterpret_cast(*reinterpret_cast(v))); + } + return v; +} + + +/** + * Reads an encoding and a value, updating *data to point to the next byte. + */ +static inline void read_value_with_encoding(_Unwind_Context *context, + dw_eh_ptr_t *data, + uint64_t *out) +{ + dw_eh_ptr_t start = *data; + unsigned char encoding = *((*data)++); + // If this value is omitted, skip it and don't touch the output value + if (encoding == DW_EH_PE_omit) { return; } + + *out = read_value(encoding, data); + *out = resolve_indirect_value(context, encoding, *out, start); +} + +/** + * Structure storing a decoded language-specific data area. Use parse_lsda() + * to generate an instance of this structure from the address returned by the + * generic unwind library. + * + * You should not need to inspect the fields of this structure directly if you + * are just using this header. The structure stores the locations of the + * various tables used for unwinding exceptions and is used by the functions + * for reading values from these tables. + */ +struct dwarf_eh_lsda +{ + /// The start of the region. This is a cache of the value returned by + /// _Unwind_GetRegionStart(). + dw_eh_ptr_t region_start; + /// The start of the landing pads table. + dw_eh_ptr_t landing_pads; + /// The start of the type table. + dw_eh_ptr_t type_table; + /// The encoding used for entries in the type tables. + unsigned char type_table_encoding; + /// The location of the call-site table. + dw_eh_ptr_t call_site_table; + /// The location of the action table. + dw_eh_ptr_t action_table; + /// The encoding used for entries in the call-site table. + unsigned char callsite_encoding; +}; + +/** + * Parse the header on the language-specific data area and return a structure + * containing the addresses and encodings of the various tables. + */ +static inline struct dwarf_eh_lsda parse_lsda(_Unwind_Context *context, + unsigned char *data) +{ + struct dwarf_eh_lsda lsda; + + lsda.region_start = reinterpret_cast(_Unwind_GetRegionStart(context)); + + // If the landing pads are relative to anything other than the start of + // this region, find out where. This is @LPStart in the spec, although the + // encoding that GCC uses does not quite match the spec. + uint64_t v = static_cast(reinterpret_cast(lsda.region_start)); + read_value_with_encoding(context, &data, &v); + lsda.landing_pads = reinterpret_cast(static_cast(v)); + + // If there is a type table, find out where it is. This is @TTBase in the + // spec. Note: we find whether there is a type table pointer by checking + // whether the leading byte is DW_EH_PE_omit (0xff), which is not what the + // spec says, but does seem to be how G++ indicates this. + lsda.type_table = 0; + lsda.type_table_encoding = *data++; + if (lsda.type_table_encoding != DW_EH_PE_omit) + { + v = read_uleb128(&data); + dw_eh_ptr_t type_table = data; + type_table += v; + lsda.type_table = type_table; + //lsda.type_table = (uintptr_t*)(data + v); + } +#if defined(__arm__) && !defined(__ARM_DWARF_EH__) + lsda.type_table_encoding = (DW_EH_PE_pcrel | DW_EH_PE_indirect); +#endif + + lsda.callsite_encoding = static_cast(*(data++)); + + // Action table is immediately after the call site table + lsda.action_table = data; + uintptr_t callsite_size = static_cast(read_uleb128(&data)); + lsda.action_table = data + callsite_size; + // Call site table is immediately after the header + lsda.call_site_table = static_cast(data); + + + return lsda; +} + +/** + * Structure representing an action to be performed while unwinding. This + * contains the address that should be unwound to and the action record that + * provoked this action. + */ +struct dwarf_eh_action +{ + /** + * The address that this action directs should be the new program counter + * value after unwinding. + */ + dw_eh_ptr_t landing_pad; + /// The address of the action record. + dw_eh_ptr_t action_record; +}; + +/** + * Look up the landing pad that corresponds to the current invoke. + * Returns true if record exists. The context is provided by the generic + * unwind library and the lsda should be the result of a call to parse_lsda(). + * + * The action record is returned via the result parameter. + */ +static bool dwarf_eh_find_callsite(struct _Unwind_Context *context, + struct dwarf_eh_lsda *lsda, + struct dwarf_eh_action *result) +{ + result->action_record = 0; + result->landing_pad = 0; + // The current instruction pointer offset within the region + uint64_t ip = _Unwind_GetIP(context) - _Unwind_GetRegionStart(context); + unsigned char *callsite_table = static_cast(lsda->call_site_table); + + while (callsite_table <= lsda->action_table) + { + // Once again, the layout deviates from the spec. + uint64_t call_site_start, call_site_size, landing_pad, action; + call_site_start = read_value(lsda->callsite_encoding, &callsite_table); + call_site_size = read_value(lsda->callsite_encoding, &callsite_table); + + // Call site entries are sorted, so if we find a call site that's after + // the current instruction pointer then there is no action associated + // with this call and we should unwind straight through this frame + // without doing anything. + if (call_site_start > ip) { break; } + + // Read the address of the landing pad and the action from the call + // site table. + landing_pad = read_value(lsda->callsite_encoding, &callsite_table); + action = read_uleb128(&callsite_table); + + // We should not include the call_site_start (beginning of the region) + // address in the ip range. For each call site: + // + // address1: call proc + // address2: next instruction + // + // The call stack contains address2 and not address1, address1 can be + // at the end of another EH region. + if (call_site_start < ip && ip <= call_site_start + call_site_size) + { + if (action) + { + // Action records are 1-biased so both no-record and zeroth + // record can be stored. + result->action_record = lsda->action_table + action - 1; + } + // No landing pad means keep unwinding. + if (landing_pad) + { + // Landing pad is the offset from the value in the header + result->landing_pad = lsda->landing_pads + landing_pad; + } + return true; + } + } + return false; +} + +/// Defines an exception class from 8 bytes (endian independent) +#define EXCEPTION_CLASS(a,b,c,d,e,f,g,h) \ + ((static_cast(a) << 56) +\ + (static_cast(b) << 48) +\ + (static_cast(c) << 40) +\ + (static_cast(d) << 32) +\ + (static_cast(e) << 24) +\ + (static_cast(f) << 16) +\ + (static_cast(g) << 8) +\ + (static_cast(h))) + +#define GENERIC_EXCEPTION_CLASS(e,f,g,h) \ + (static_cast(e) << 24) +\ + (static_cast(f) << 16) +\ + (static_cast(g) << 8) +\ + (static_cast(h)) Copied: vendor/libcxxrt/2015-06-18-e64e93fe5bba67a6d52cbe5a97f8770c054bfa65/libelftc_dem_gnu3.c (from r284549, vendor/libcxxrt/dist/libelftc_dem_gnu3.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libcxxrt/2015-06-18-e64e93fe5bba67a6d52cbe5a97f8770c054bfa65/libelftc_dem_gnu3.c Thu Jun 18 14:02:19 2015 (r284550, copy of r284549, vendor/libcxxrt/dist/libelftc_dem_gnu3.c) @@ -0,0 +1,3893 @@ +/*- + * Copyright (c) 2007, 2008 Hyogeol Lee + * 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 + * in this position and unchanged. + * 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 AUTHORS ``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 +#include +#include +#include +#include +#include +#include +#include +#include + +/** + * @file cpp_demangle.c + * @brief Decode IA-64 C++ ABI style implementation. + * + * IA-64 standard ABI(Itanium C++ ABI) references. + * + * http://www.codesourcery.com/cxx-abi/abi.html#mangling \n + * http://www.codesourcery.com/cxx-abi/abi-mangling.html + */ + +/** @brief Dynamic vector data for string. */ +struct vector_str { + /** Current size */ + size_t size; + /** Total capacity */ + size_t capacity; + /** String array */ + char **container; +}; + +#define BUFFER_GROWFACTOR 1.618 +#define VECTOR_DEF_CAPACITY 8 +#define ELFTC_ISDIGIT(C) (isdigit((C) & 0xFF)) + +enum type_qualifier { + TYPE_PTR, TYPE_REF, TYPE_CMX, TYPE_IMG, TYPE_EXT, TYPE_RST, TYPE_VAT, + TYPE_CST, TYPE_VEC +}; + +struct vector_type_qualifier { + size_t size, capacity; + enum type_qualifier *q_container; + struct vector_str ext_name; +}; + +enum read_cmd { + READ_FAIL, READ_NEST, READ_TMPL, READ_EXPR, READ_EXPL, READ_LOCAL, + READ_TYPE, READ_FUNC, READ_PTRMEM +}; + +struct vector_read_cmd { + size_t size, capacity; + enum read_cmd *r_container; +}; + +struct cpp_demangle_data { + struct vector_str output; /* output string vector */ + struct vector_str output_tmp; + struct vector_str subst; /* substitution string vector */ + struct vector_str tmpl; + struct vector_str class_type; + struct vector_read_cmd cmd; + bool paren; /* parenthesis opened */ + bool pfirst; /* first element of parameter */ + bool mem_rst; /* restrict member function */ + bool mem_vat; /* volatile member function */ + bool mem_cst; /* const member function */ + int func_type; + const char *cur; /* current mangled name ptr */ + const char *last_sname; /* last source name */ + int push_head; +}; + +#define CPP_DEMANGLE_TRY_LIMIT 128 +#define FLOAT_SPRINTF_TRY_LIMIT 5 +#define FLOAT_QUADRUPLE_BYTES 16 +#define FLOAT_EXTENED_BYTES 10 + +#define SIMPLE_HASH(x,y) (64 * x + y) + +static size_t get_strlen_sum(const struct vector_str *v); +static bool vector_str_grow(struct vector_str *v); + +static size_t +get_strlen_sum(const struct vector_str *v) +{ + size_t i, len = 0; + + if (v == NULL) + return (0); + + assert(v->size > 0); + + for (i = 0; i < v->size; ++i) + len += strlen(v->container[i]); + + return (len); +} + +/** + * @brief Deallocate resource in vector_str. + */ +static void +vector_str_dest(struct vector_str *v) +{ + size_t i; + + if (v == NULL) + return; + + for (i = 0; i < v->size; ++i) + free(v->container[i]); + + free(v->container); +} + +/** + * @brief Find string in vector_str. + * @param v Destination vector. + * @param o String to find. + * @param l Length of the string. + * @return -1 at failed, 0 at not found, 1 at found. + */ +static int +vector_str_find(const struct vector_str *v, const char *o, size_t l) +{ + size_t i; + + if (v == NULL || o == NULL) + return (-1); + + for (i = 0; i < v->size; ++i) + if (strncmp(v->container[i], o, l) == 0) + return (1); + + return (0); +} + +/** + * @brief Get new allocated flat string from vector. + * + * If l is not NULL, return length of the string. + * @param v Destination vector. + * @param l Length of the string. + * @return NULL at failed or NUL terminated new allocated string. + */ +static char * +vector_str_get_flat(const struct vector_str *v, size_t *l) +{ + ssize_t elem_pos, elem_size, rtn_size; + size_t i; + char *rtn; + + if (v == NULL || v->size == 0) + return (NULL); + + if ((rtn_size = get_strlen_sum(v)) == 0) + return (NULL); + + if ((rtn = malloc(sizeof(char) * (rtn_size + 1))) == NULL) + return (NULL); + + elem_pos = 0; + for (i = 0; i < v->size; ++i) { + elem_size = strlen(v->container[i]); + + memcpy(rtn + elem_pos, v->container[i], elem_size); + + elem_pos += elem_size; + } + + rtn[rtn_size] = '\0'; + + if (l != NULL) + *l = rtn_size; + + return (rtn); +} + +static bool +vector_str_grow(struct vector_str *v) +{ + size_t i, tmp_cap; + char **tmp_ctn; + + if (v == NULL) + return (false); + + assert(v->capacity > 0); + + tmp_cap = v->capacity * BUFFER_GROWFACTOR; + + assert(tmp_cap > v->capacity); + + if ((tmp_ctn = malloc(sizeof(char *) * tmp_cap)) == NULL) + return (false); + + for (i = 0; i < v->size; ++i) + tmp_ctn[i] = v->container[i]; + + free(v->container); + + v->container = tmp_ctn; + v->capacity = tmp_cap; + + return (true); +} + +/** + * @brief Initialize vector_str. + * @return false at failed, true at success. + */ +static bool +vector_str_init(struct vector_str *v) +{ + + if (v == NULL) + return (false); + + v->size = 0; + v->capacity = VECTOR_DEF_CAPACITY; + + assert(v->capacity > 0); + + if ((v->container = malloc(sizeof(char *) * v->capacity)) == NULL) + return (false); + + assert(v->container != NULL); + + return (true); +} + +/** + * @brief Remove last element in vector_str. + * @return false at failed, true at success. + */ +static bool +vector_str_pop(struct vector_str *v) +{ + + if (v == NULL) + return (false); + + if (v->size == 0) + return (true); + + --v->size; + + free(v->container[v->size]); + v->container[v->size] = NULL; + + return (true); +} + +/** + * @brief Push back string to vector. + * @return false at failed, true at success. + */ +static bool +vector_str_push(struct vector_str *v, const char *str, size_t len) +{ + + if (v == NULL || str == NULL) + return (false); + + if (v->size == v->capacity && vector_str_grow(v) == false) + return (false); + + if ((v->container[v->size] = malloc(sizeof(char) * (len + 1))) == NULL) + return (false); + + snprintf(v->container[v->size], len + 1, "%s", str); + + ++v->size; + + return (true); +} + +/** + * @brief Push front org vector to det vector. + * @return false at failed, true at success. + */ +static bool +vector_str_push_vector_head(struct vector_str *dst, struct vector_str *org) +{ + size_t i, j, tmp_cap; + char **tmp_ctn; + + if (dst == NULL || org == NULL) + return (false); + + tmp_cap = (dst->size + org->size) * BUFFER_GROWFACTOR; + + if ((tmp_ctn = malloc(sizeof(char *) * tmp_cap)) == NULL) + return (false); + + for (i = 0; i < org->size; ++i) + if ((tmp_ctn[i] = strdup(org->container[i])) == NULL) { + for (j = 0; j < i; ++j) + free(tmp_ctn[j]); + + free(tmp_ctn); + + return (false); + } + + for (i = 0; i < dst->size; ++i) + tmp_ctn[i + org->size] = dst->container[i]; + + free(dst->container); + + dst->container = tmp_ctn; + dst->capacity = tmp_cap; + dst->size += org->size; + + return (true); +} + +/** + * @brief Get new allocated flat string from vector between begin and end. + * + * If r_len is not NULL, string length will be returned. + * @return NULL at failed or NUL terminated new allocated string. + */ +static char * +vector_str_substr(const struct vector_str *v, size_t begin, size_t end, + size_t *r_len) +{ + size_t cur, i, len; + char *rtn; + + if (v == NULL || begin > end) + return (NULL); + + len = 0; + for (i = begin; i < end + 1; ++i) + len += strlen(v->container[i]); + + if ((rtn = malloc(sizeof(char) * (len + 1))) == NULL) + return (NULL); + + if (r_len != NULL) + *r_len = len; + + cur = 0; + for (i = begin; i < end + 1; ++i) { + len = strlen(v->container[i]); + memcpy(rtn + cur, v->container[i], len); + cur += len; + } + rtn[cur] = '\0'; + + return (rtn); +} + +static void cpp_demangle_data_dest(struct cpp_demangle_data *); +static int cpp_demangle_data_init(struct cpp_demangle_data *, + const char *); +static int cpp_demangle_get_subst(struct cpp_demangle_data *, size_t); +static int cpp_demangle_get_tmpl_param(struct cpp_demangle_data *, size_t); +static int cpp_demangle_push_fp(struct cpp_demangle_data *, + char *(*)(const char *, size_t)); +static int cpp_demangle_push_str(struct cpp_demangle_data *, const char *, + size_t); +static int cpp_demangle_push_subst(struct cpp_demangle_data *, + const char *, size_t); +static int cpp_demangle_push_subst_v(struct cpp_demangle_data *, + struct vector_str *); +static int cpp_demangle_push_type_qualifier(struct cpp_demangle_data *, + struct vector_type_qualifier *, const char *); +static int cpp_demangle_read_array(struct cpp_demangle_data *); +static int cpp_demangle_read_encoding(struct cpp_demangle_data *); +static int cpp_demangle_read_expr_primary(struct cpp_demangle_data *); +static int cpp_demangle_read_expression(struct cpp_demangle_data *); +static int cpp_demangle_read_expression_flat(struct cpp_demangle_data *, + char **); +static int cpp_demangle_read_expression_binary(struct cpp_demangle_data *, + const char *, size_t); +static int cpp_demangle_read_expression_unary(struct cpp_demangle_data *, + const char *, size_t); +static int cpp_demangle_read_expression_trinary(struct cpp_demangle_data *, + const char *, size_t, const char *, size_t); +static int cpp_demangle_read_function(struct cpp_demangle_data *, int *, + struct vector_type_qualifier *); +static int cpp_demangle_local_source_name(struct cpp_demangle_data *ddata); +static int cpp_demangle_read_local_name(struct cpp_demangle_data *); +static int cpp_demangle_read_name(struct cpp_demangle_data *); +static int cpp_demangle_read_name_flat(struct cpp_demangle_data *, + char**); +static int cpp_demangle_read_nested_name(struct cpp_demangle_data *); +static int cpp_demangle_read_number(struct cpp_demangle_data *, long *); +static int cpp_demangle_read_number_as_string(struct cpp_demangle_data *, + char **); +static int cpp_demangle_read_nv_offset(struct cpp_demangle_data *); +static int cpp_demangle_read_offset(struct cpp_demangle_data *); +static int cpp_demangle_read_offset_number(struct cpp_demangle_data *); +static int cpp_demangle_read_pointer_to_member(struct cpp_demangle_data *); +static int cpp_demangle_read_sname(struct cpp_demangle_data *); +static int cpp_demangle_read_subst(struct cpp_demangle_data *); +static int cpp_demangle_read_subst_std(struct cpp_demangle_data *); +static int cpp_demangle_read_subst_stdtmpl(struct cpp_demangle_data *, + const char *, size_t); +static int cpp_demangle_read_tmpl_arg(struct cpp_demangle_data *); +static int cpp_demangle_read_tmpl_args(struct cpp_demangle_data *); +static int cpp_demangle_read_tmpl_param(struct cpp_demangle_data *); +static int cpp_demangle_read_type(struct cpp_demangle_data *, int); +static int cpp_demangle_read_type_flat(struct cpp_demangle_data *, + char **); +static int cpp_demangle_read_uqname(struct cpp_demangle_data *); +static int cpp_demangle_read_v_offset(struct cpp_demangle_data *); +static char *decode_fp_to_double(const char *, size_t); +static char *decode_fp_to_float(const char *, size_t); +static char *decode_fp_to_float128(const char *, size_t); +static char *decode_fp_to_float80(const char *, size_t); +static char *decode_fp_to_long_double(const char *, size_t); +static int hex_to_dec(char); +static void vector_read_cmd_dest(struct vector_read_cmd *); +static int vector_read_cmd_find(struct vector_read_cmd *, enum read_cmd); +static int vector_read_cmd_init(struct vector_read_cmd *); +static int vector_read_cmd_pop(struct vector_read_cmd *); +static int vector_read_cmd_push(struct vector_read_cmd *, enum read_cmd); +static void vector_type_qualifier_dest(struct vector_type_qualifier *); +static int vector_type_qualifier_init(struct vector_type_qualifier *); +static int vector_type_qualifier_push(struct vector_type_qualifier *, + enum type_qualifier); + +/** + * @brief Decode the input string by IA-64 C++ ABI style. + * + * GNU GCC v3 use IA-64 standard ABI. + * @return New allocated demangled string or NULL if failed. + * @todo 1. Testing and more test case. 2. Code cleaning. + */ +char * +__cxa_demangle_gnu3(const char *org) +{ + struct cpp_demangle_data ddata; + ssize_t org_len; + unsigned int limit; + char *rtn = NULL; + + if (org == NULL) + return (NULL); + + org_len = strlen(org); + if (org_len > 11 && !strncmp(org, "_GLOBAL__I_", 11)) { + if ((rtn = malloc(org_len + 19)) == NULL) + return (NULL); + snprintf(rtn, org_len + 19, + "global constructors keyed to %s", org + 11); + return (rtn); + } + + // Try demangling as a type for short encodings + if ((org_len < 2) || (org[0] != '_' || org[1] != 'Z' )) { + if (!cpp_demangle_data_init(&ddata, org)) + return (NULL); + if (!cpp_demangle_read_type(&ddata, 0)) + goto clean; + rtn = vector_str_get_flat(&ddata.output, (size_t *) NULL); + goto clean; + } + + + if (!cpp_demangle_data_init(&ddata, org + 2)) + return (NULL); + + rtn = NULL; + + if (!cpp_demangle_read_encoding(&ddata)) + goto clean; + + limit = 0; + while (*ddata.cur != '\0') { + /* + * Breaking at some gcc info at tail. e.g) @@GLIBCXX_3.4 + */ + if (*ddata.cur == '@' && *(ddata.cur + 1) == '@') + break; + if (!cpp_demangle_read_type(&ddata, 1)) + goto clean; + if (limit++ > CPP_DEMANGLE_TRY_LIMIT) + goto clean; + } + + if (ddata.output.size == 0) + goto clean; + if (ddata.paren && !vector_str_push(&ddata.output, ")", 1)) + goto clean; + if (ddata.mem_vat && !vector_str_push(&ddata.output, " volatile", 9)) + goto clean; + if (ddata.mem_cst && !vector_str_push(&ddata.output, " const", 6)) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@FreeBSD.ORG Thu Jun 18 17:27:46 2015 Return-Path: Delivered-To: svn-src-vendor@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2AE4A96F; Thu, 18 Jun 2015 17:27:46 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 160DA379; Thu, 18 Jun 2015 17:27:46 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5IHRkmO029725; Thu, 18 Jun 2015 17:27:46 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5IHRffR029691; Thu, 18 Jun 2015 17:27:41 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201506181727.t5IHRffR029691@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 18 Jun 2015 17:27:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r284563 - in vendor-sys/acpica/dist: . source/compiler source/components/hardware source/components/namespace source/components/tables source/components/utilities source/include source/... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2015 17:27:46 -0000 Author: jkim Date: Thu Jun 18 17:27:40 2015 New Revision: 284563 URL: https://svnweb.freebsd.org/changeset/base/284563 Log: Import ACPICA 20150619. Added: vendor-sys/acpica/dist/source/include/acclib.h (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/source/compiler/aslcompiler.l vendor-sys/acpica/dist/source/compiler/aslfiles.c vendor-sys/acpica/dist/source/compiler/aslfold.c vendor-sys/acpica/dist/source/compiler/dtcompiler.h vendor-sys/acpica/dist/source/compiler/dtio.c vendor-sys/acpica/dist/source/components/hardware/hwxfsleep.c vendor-sys/acpica/dist/source/components/namespace/nssearch.c vendor-sys/acpica/dist/source/components/tables/tbutils.c vendor-sys/acpica/dist/source/components/utilities/utclib.c vendor-sys/acpica/dist/source/components/utilities/utxfinit.c vendor-sys/acpica/dist/source/include/accommon.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/actypes.h vendor-sys/acpica/dist/source/include/acutils.h vendor-sys/acpica/dist/source/include/platform/acefi.h Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Thu Jun 18 16:51:49 2015 (r284562) +++ vendor-sys/acpica/dist/changes.txt Thu Jun 18 17:27:40 2015 (r284563) @@ -1,4 +1,20 @@ ---------------------------------------- +19 June 2015. Summary of changes for version 20150619: + +Two regressions in version 20150616 have been addressed: + +Fixes some problems/issues with the C library macro removal (ACPI_STRLEN, +etc.) This update changes ACPICA to only use the standard headers for +functions, or the prototypes for the local versions of the C library +functions. Across the source code, this required some additional casts +for some Clib invocations for portability. Moved all local prototypes to +a new file, acclib.h + +Fixes several problems with recent changes to the handling of the FACS +table that could cause some systems not to boot. + + +---------------------------------------- 16 June 2015. Summary of changes for version 20150616: Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.l ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.l Thu Jun 18 16:51:49 2015 (r284562) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.l Thu Jun 18 17:27:40 2015 (r284563) @@ -709,7 +709,7 @@ NamePathTail [.]{NameSeg} return (PARSEOP_NAMESTRING); } . { count (1); - if (isprint (*AslCompilertext)) + if (isprint ((int) *AslCompilertext)) { sprintf (MsgBuffer, "Invalid character (%c), expecting ASL keyword or name", Modified: vendor-sys/acpica/dist/source/compiler/aslfiles.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslfiles.c Thu Jun 18 16:51:49 2015 (r284562) +++ vendor-sys/acpica/dist/source/compiler/aslfiles.c Thu Jun 18 17:27:40 2015 (r284563) @@ -336,7 +336,7 @@ FlOpenIncludeWithPrefix ( */ Gbl_CurrentLineNumber--; OriginalLineNumber = Gbl_CurrentLineNumber; - while (DtGetNextLine (IncludeFile) != ASL_EOF) + while (DtGetNextLine (IncludeFile, DT_ALLOW_MULTILINE_QUOTES) != ASL_EOF) { if (Gbl_CurrentLineBuffer[0] == '#') { Modified: vendor-sys/acpica/dist/source/compiler/aslfold.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslfold.c Thu Jun 18 16:51:49 2015 (r284562) +++ vendor-sys/acpica/dist/source/compiler/aslfold.c Thu Jun 18 17:27:40 2015 (r284563) @@ -236,6 +236,8 @@ OpcAmlCheckForConstant ( */ if (WalkState->Opcode == AML_BUFFER_OP) { + DbgPrint (ASL_PARSE_OUTPUT, + "\nBuffer+Buffer->Buffer constant reduction is not supported yet"); Status = AE_TYPE; goto CleanupAndExit; } @@ -496,6 +498,10 @@ TrTransformToStoreOp ( goto EvalError; } + /* Truncate any subtree expressions, they have been evaluated */ + + Child1->Asl.Child = NULL; + /* Folded constant is in ObjDesc, store into Child1 */ TrInstallReducedConstant (Child1, ObjDesc); @@ -507,11 +513,6 @@ TrTransformToStoreOp ( UtSetParseOpName (Op); Op->Common.Parent = OriginalParent; - /* Truncate any subtree expressions, they have been evaluated */ - - Child1->Asl.Child = NULL; - Child2->Asl.Child = NULL; - /* First child is the folded constant */ /* Second child will be the target */ Modified: vendor-sys/acpica/dist/source/compiler/dtcompiler.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dtcompiler.h Thu Jun 18 16:51:49 2015 (r284562) +++ vendor-sys/acpica/dist/source/compiler/dtcompiler.h Thu Jun 18 17:27:40 2015 (r284563) @@ -181,7 +181,13 @@ DtCompilePadding ( UINT32 DtGetNextLine ( - FILE *Handle); + FILE *Handle, + UINT32 Flags); + +/* Flags for DtGetNextLine */ + +#define DT_ALLOW_MULTILINE_QUOTES 0x01 + DT_FIELD * DtScanFile ( Modified: vendor-sys/acpica/dist/source/compiler/dtio.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dtio.c Thu Jun 18 16:51:49 2015 (r284562) +++ vendor-sys/acpica/dist/source/compiler/dtio.c Thu Jun 18 17:27:40 2015 (r284563) @@ -406,7 +406,8 @@ DtParseLine ( UINT32 DtGetNextLine ( - FILE *Handle) + FILE *Handle, + UINT32 Flags) { BOOLEAN LineNotAllBlanks = FALSE; UINT32 State = DT_NORMAL_TEXT; @@ -550,9 +551,12 @@ DtGetNextLine ( case '\n': - AcpiOsPrintf ("ERROR at line %u: Unterminated quoted string\n", - Gbl_CurrentLineNumber++); - State = DT_NORMAL_TEXT; + if (!(Flags & DT_ALLOW_MULTILINE_QUOTES)) + { + AcpiOsPrintf ("ERROR at line %u: Unterminated quoted string\n", + Gbl_CurrentLineNumber++); + State = DT_NORMAL_TEXT; + } break; default: /* Get next character */ @@ -746,7 +750,7 @@ DtScanFile ( /* Scan line-by-line */ - while ((Offset = DtGetNextLine (Handle)) != ASL_EOF) + while ((Offset = DtGetNextLine (Handle, 0)) != ASL_EOF) { ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Line %2.2u/%4.4X - %s", Gbl_CurrentLineNumber, Offset, Gbl_CurrentLineBuffer)); Modified: vendor-sys/acpica/dist/source/components/hardware/hwxfsleep.c ============================================================================== --- vendor-sys/acpica/dist/source/components/hardware/hwxfsleep.c Thu Jun 18 16:51:49 2015 (r284562) +++ vendor-sys/acpica/dist/source/components/hardware/hwxfsleep.c Thu Jun 18 17:27:40 2015 (r284563) @@ -51,11 +51,13 @@ /* Local prototypes */ +#if (!ACPI_REDUCED_HARDWARE) static ACPI_STATUS AcpiHwSetFirmwareWakingVector ( ACPI_TABLE_FACS *Facs, ACPI_PHYSICAL_ADDRESS PhysicalAddress, ACPI_PHYSICAL_ADDRESS PhysicalAddress64); +#endif static ACPI_STATUS AcpiHwSleepDispatch ( @@ -171,7 +173,7 @@ AcpiSetFirmwareWakingVector ( if (AcpiGbl_ReducedHardware) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } if (AcpiGbl_Facs32) Modified: vendor-sys/acpica/dist/source/components/namespace/nssearch.c ============================================================================== --- vendor-sys/acpica/dist/source/components/namespace/nssearch.c Thu Jun 18 16:51:49 2015 (r284562) +++ vendor-sys/acpica/dist/source/components/namespace/nssearch.c Thu Jun 18 17:27:40 2015 (r284563) @@ -349,6 +349,11 @@ AcpiNsSearchAndEnter ( */ if (Flags & ACPI_NS_OVERRIDE_IF_FOUND) { + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, + "Namespace override: %4.4s pass %u type %X Owner %X\n", + ACPI_CAST_PTR(char, &TargetName), InterpreterMode, + (*ReturnNode)->Type, WalkState->OwnerId)); + AcpiNsDeleteChildren (*ReturnNode); if (AcpiGbl_RuntimeNamespaceOverride) { @@ -361,11 +366,6 @@ AcpiNsSearchAndEnter ( AcpiNsRemoveNode (*ReturnNode); *ReturnNode = ACPI_ENTRY_NOT_FOUND; } - - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, - "Namespace override: %4.4s pass %u type %X Owner %X\n", - ACPI_CAST_PTR(char, &TargetName), InterpreterMode, - (*ReturnNode)->Type, WalkState->OwnerId)); } /* Return an error if we don't expect to find the object */ Modified: vendor-sys/acpica/dist/source/components/tables/tbutils.c ============================================================================== --- vendor-sys/acpica/dist/source/components/tables/tbutils.c Thu Jun 18 16:51:49 2015 (r284562) +++ vendor-sys/acpica/dist/source/components/tables/tbutils.c Thu Jun 18 17:27:40 2015 (r284563) @@ -76,13 +76,6 @@ AcpiTbInitializeFacs ( void) { - /* If there is no FACS, just continue. There was already an error msg */ - - if (!AcpiGbl_FACS) - { - return (AE_OK); - } - /* If Hardware Reduced flag is set, there is no FACS */ if (AcpiGbl_ReducedHardware) @@ -95,20 +88,18 @@ AcpiTbInitializeFacs ( ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &AcpiGbl_Facs32)); (void) AcpiGetTableByIndex (ACPI_TABLE_INDEX_X_FACS, ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &AcpiGbl_Facs64)); - if (!AcpiGbl_Facs32 && !AcpiGbl_Facs64) - { - return (AE_NO_MEMORY); - } - if (AcpiGbl_Use32BitFacsAddresses) + if (AcpiGbl_Facs64 && (!AcpiGbl_Facs32 || !AcpiGbl_Use32BitFacsAddresses)) { - AcpiGbl_FACS = AcpiGbl_Facs32 ? AcpiGbl_Facs32 : AcpiGbl_Facs64; + AcpiGbl_FACS = AcpiGbl_Facs64; } - else + else if (AcpiGbl_Facs32) { - AcpiGbl_FACS = AcpiGbl_Facs64 ? AcpiGbl_Facs64 : AcpiGbl_Facs32; + AcpiGbl_FACS = AcpiGbl_Facs32; } + /* If there is no FACS, just continue. There was already an error msg */ + return (AE_OK); } #endif /* !ACPI_REDUCED_HARDWARE */ Modified: vendor-sys/acpica/dist/source/components/utilities/utclib.c ============================================================================== --- vendor-sys/acpica/dist/source/components/utilities/utclib.c Thu Jun 18 16:51:49 2015 (r284562) +++ vendor-sys/acpica/dist/source/components/utilities/utclib.c Thu Jun 18 17:27:40 2015 (r284563) @@ -64,7 +64,6 @@ * instead of the functions in this module. */ - /******************************************************************************* * * Functions implemented in this module: @@ -88,7 +87,6 @@ * ******************************************************************************/ - #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("utclib") @@ -772,13 +770,13 @@ tolower ( /******************************************************************************* * - * FUNCTION: is* functions + * FUNCTION: is* function array * * DESCRIPTION: is* functions use the ctype table below * ******************************************************************************/ -const UINT8 _acpi_ctype[257] = { +const UINT8 AcpiGbl_Ctypes[257] = { _ACPI_CN, /* 0x00 0 NUL */ _ACPI_CN, /* 0x01 1 SOH */ _ACPI_CN, /* 0x02 2 STX */ Modified: vendor-sys/acpica/dist/source/components/utilities/utxfinit.c ============================================================================== --- vendor-sys/acpica/dist/source/components/utilities/utxfinit.c Thu Jun 18 16:51:49 2015 (r284562) +++ vendor-sys/acpica/dist/source/components/utilities/utxfinit.c Thu Jun 18 17:27:40 2015 (r284563) @@ -194,11 +194,14 @@ AcpiEnableSubsystem ( * Obtain a permanent mapping for the FACS. This is required for the * Global Lock and the Firmware Waking Vector */ - Status = AcpiTbInitializeFacs (); - if (ACPI_FAILURE (Status)) + if (!(Flags & ACPI_NO_FACS_INIT)) { - ACPI_WARNING ((AE_INFO, "Could not map the FACS table")); - return_ACPI_STATUS (Status); + Status = AcpiTbInitializeFacs (); + if (ACPI_FAILURE (Status)) + { + ACPI_WARNING ((AE_INFO, "Could not map the FACS table")); + return_ACPI_STATUS (Status); + } } #endif /* !ACPI_REDUCED_HARDWARE */ Added: vendor-sys/acpica/dist/source/include/acclib.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/acpica/dist/source/include/acclib.h Thu Jun 18 17:27:40 2015 (r284563) @@ -0,0 +1,167 @@ +/****************************************************************************** + * + * Name: acclib.h -- C library support. Prototypes for the (optional) local + * implementations of required C library functions. + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2015, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +#ifndef _ACCLIB_H +#define _ACCLIB_H + + +/* + * Prototypes and macros for local implementations of C library functions + */ + +/* is* functions. The AcpiGbl_Ctypes array is defined in utclib.c */ + +extern const UINT8 AcpiGbl_Ctypes[]; + +#define _ACPI_XA 0x00 /* extra alphabetic - not supported */ +#define _ACPI_XS 0x40 /* extra space */ +#define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */ +#define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */ +#define _ACPI_DI 0x04 /* '0'-'9' */ +#define _ACPI_LO 0x02 /* 'a'-'z' */ +#define _ACPI_PU 0x10 /* punctuation */ +#define _ACPI_SP 0x08 /* space, tab, CR, LF, VT, FF */ +#define _ACPI_UP 0x01 /* 'A'-'Z' */ +#define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ + +#define isdigit(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_DI)) +#define isspace(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_SP)) +#define isxdigit(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_XD)) +#define isupper(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_UP)) +#define islower(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_LO)) +#define isprint(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU)) +#define isalpha(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) + + +/* Strings */ + +char * +strcat ( + char *DstString, + const char *SrcString); + +char * +strchr ( + const char *String, + int ch); + +char * +strcpy ( + char *DstString, + const char *SrcString); + +int +strcmp ( + const char *String1, + const char *String2); + +ACPI_SIZE +strlen ( + const char *String); + +char * +strncat ( + char *DstString, + const char *SrcString, + ACPI_SIZE Count); + +int +strncmp ( + const char *String1, + const char *String2, + ACPI_SIZE Count); + +char * +strncpy ( + char *DstString, + const char *SrcString, + ACPI_SIZE Count); + +char * +strstr ( + char *String1, + char *String2); + + +/* Conversion */ + +UINT32 +strtoul ( + const char *String, + char **Terminator, + UINT32 Base); + + +/* Memory */ + +int +memcmp ( + void *Buffer1, + void *Buffer2, + ACPI_SIZE Count); + +void * +memcpy ( + void *Dest, + const void *Src, + ACPI_SIZE Count); + +void * +memset ( + void *Dest, + int Value, + ACPI_SIZE Count); + + +/* upper/lower case */ + +int +tolower ( + int c); + +int +toupper ( + int c); + +#endif /* _ACCLIB_H */ Modified: vendor-sys/acpica/dist/source/include/accommon.h ============================================================================== --- vendor-sys/acpica/dist/source/include/accommon.h Thu Jun 18 16:51:49 2015 (r284562) +++ vendor-sys/acpica/dist/source/include/accommon.h Thu Jun 18 17:27:40 2015 (r284563) @@ -59,6 +59,9 @@ #include "acglobal.h" /* All global variables */ #include "achware.h" /* Hardware defines and interfaces */ #include "acutils.h" /* Utility interfaces */ +#ifndef ACPI_USE_SYSTEM_CLIBRARY +#include "acclib.h" /* C library interfaces */ +#endif /* !ACPI_USE_SYSTEM_CLIBRARY */ #endif /* __ACCOMMON_H__ */ Modified: vendor-sys/acpica/dist/source/include/acpixf.h ============================================================================== --- vendor-sys/acpica/dist/source/include/acpixf.h Thu Jun 18 16:51:49 2015 (r284562) +++ vendor-sys/acpica/dist/source/include/acpixf.h Thu Jun 18 17:27:40 2015 (r284563) @@ -46,7 +46,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20150616 +#define ACPI_CA_VERSION 0x20150619 #include "acconfig.h" #include "actypes.h" Modified: vendor-sys/acpica/dist/source/include/actypes.h ============================================================================== --- vendor-sys/acpica/dist/source/include/actypes.h Thu Jun 18 16:51:49 2015 (r284562) +++ vendor-sys/acpica/dist/source/include/actypes.h Thu Jun 18 17:27:40 2015 (r284563) @@ -582,6 +582,7 @@ typedef UINT64 #define ACPI_NO_ACPI_ENABLE 0x10 #define ACPI_NO_DEVICE_INIT 0x20 #define ACPI_NO_OBJECT_INIT 0x40 +#define ACPI_NO_FACS_INIT 0x80 /* * Initialization state Modified: vendor-sys/acpica/dist/source/include/acutils.h ============================================================================== --- vendor-sys/acpica/dist/source/include/acutils.h Thu Jun 18 16:51:49 2015 (r284562) +++ vendor-sys/acpica/dist/source/include/acutils.h Thu Jun 18 17:27:40 2015 (r284563) @@ -246,144 +246,8 @@ AcpiUtSubsystemShutdown ( void); -/* - * utclib - Local implementations of C library functions - */ -#ifndef ACPI_USE_SYSTEM_CLIBRARY - -#ifdef memcmp -#error memcmp defined! -#endif - -#undef strstr -#undef strchr -#undef strlen -#undef strcpy -#undef strncpy -#undef strncmp -#undef strcmp -#undef strcat -#undef strncat -#undef strtoul -#undef memcmp -#undef memcpy -#undef memset -#undef toupper -#undef tolower -#undef isxdigit -#undef isdigit -#undef isspace -#undef isupper -#undef isprint -#undef isalpha - -ACPI_SIZE -strlen ( - const char *String); - -char * -strchr ( - const char *String, - int ch); - -char * -strcpy ( - char *DstString, - const char *SrcString); - -char * -strncpy ( - char *DstString, - const char *SrcString, - ACPI_SIZE Count); - -int -strncmp ( - const char *String1, - const char *String2, - ACPI_SIZE Count); - -int -strcmp ( - const char *String1, - const char *String2); - -char * -strcat ( - char *DstString, - const char *SrcString); - -char * -strncat ( - char *DstString, - const char *SrcString, - ACPI_SIZE Count); - -UINT32 -strtoul ( - const char *String, - char **Terminator, - UINT32 Base); - -char * -strstr ( - char *String1, - char *String2); - -int -memcmp ( - void *Buffer1, - void *Buffer2, - ACPI_SIZE Count); - -void * -memcpy ( - void *Dest, - const void *Src, - ACPI_SIZE Count); - -void * -memset ( - void *Dest, - int Value, - ACPI_SIZE Count); - -int -toupper ( - int c); - -int -tolower ( - int c); - - - -extern const UINT8 _acpi_ctype[]; - -#define _ACPI_XA 0x00 /* extra alphabetic - not supported */ -#define _ACPI_XS 0x40 /* extra space */ -#define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */ -#define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */ -#define _ACPI_DI 0x04 /* '0'-'9' */ -#define _ACPI_LO 0x02 /* 'a'-'z' */ -#define _ACPI_PU 0x10 /* punctuation */ -#define _ACPI_SP 0x08 /* space, tab, CR, LF, VT, FF */ -#define _ACPI_UP 0x01 /* 'A'-'Z' */ -#define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ - -#define isdigit(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) -#define isspace(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) -#define isxdigit(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD)) -#define isupper(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP)) -#define islower(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) -#define isprint(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU)) -#define isalpha(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) - -#endif /* !ACPI_USE_SYSTEM_CLIBRARY */ - #define ACPI_IS_ASCII(c) ((c) < 0x80) - /* * utcopy - Object construction and conversion interfaces */ Modified: vendor-sys/acpica/dist/source/include/platform/acefi.h ============================================================================== --- vendor-sys/acpica/dist/source/include/platform/acefi.h Thu Jun 18 16:51:49 2015 (r284562) +++ vendor-sys/acpica/dist/source/include/platform/acefi.h Thu Jun 18 17:27:40 2015 (r284563) @@ -64,17 +64,17 @@ #define EFIAPI #endif -typedef uint8_t UINT8; -typedef uint16_t UINT16; -typedef int16_t INT16; -typedef uint32_t UINT32; -typedef int32_t INT32; -typedef uint64_t UINT64; -typedef int64_t INT64; -typedef uint8_t BOOLEAN; -typedef uint16_t CHAR16; +typedef uint8_t UINT8; +typedef uint16_t UINT16; +typedef int16_t INT16; +typedef uint32_t UINT32; +typedef int32_t INT32; +typedef uint64_t UINT64; +typedef int64_t INT64; +typedef uint8_t BOOLEAN; +typedef uint16_t CHAR16; -#define VOID void +#define VOID void #if defined(__ia64__) || defined(__x86_64__) @@ -89,13 +89,13 @@ typedef uint16_t CHAR16; #endif #ifdef _MSC_EXTENSIONS -#pragma warning ( disable : 4731 ) // Suppress warnings about modification of EBP +#pragma warning ( disable : 4731 ) /* Suppress warnings about modification of EBP */ #endif #endif -typedef uint64_t UINTN; -typedef int64_t INTN; +typedef uint64_t UINTN; +typedef int64_t INTN; #define EFIERR(a) (0x8000000000000000 | a) @@ -130,6 +130,7 @@ typedef int32_t INTN; prefix ## nargs /* Prototypes of EFI cdecl -> stdcall trampolines */ + UINT64 efi_call0(void *func); UINT64 efi_call1(void *func, UINT64 arg1); UINT64 efi_call2(void *func, UINT64 arg1, UINT64 arg2); @@ -153,6 +154,7 @@ UINT64 efi_call10(void *func, UINT64 arg UINT64 arg8, UINT64 arg9, UINT64 arg10); /* Front-ends to efi_callX to avoid compiler warnings */ + #define _cast64_efi_call0(f) \ efi_call0(f) #define _cast64_efi_call1(f,a1) \ @@ -185,6 +187,7 @@ UINT64 efi_call10(void *func, UINT64 arg (UINT64)(a9), (UINT64)(a10)) /* main wrapper (va_num ignored) */ + #define uefi_call_wrapper(func,va_num,...) \ __VA_ARG_NSUFFIX__(_cast64_efi_call, __VA_ARGS__) (func , ##__VA_ARGS__) From owner-svn-src-vendor@FreeBSD.ORG Thu Jun 18 17:28:16 2015 Return-Path: Delivered-To: svn-src-vendor@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 345D3AA3; Thu, 18 Jun 2015 17:28:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0961F384; Thu, 18 Jun 2015 17:28:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5IHSFJm029905; Thu, 18 Jun 2015 17:28:15 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5IHSFqp029904; Thu, 18 Jun 2015 17:28:15 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201506181728.t5IHSFqp029904@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 18 Jun 2015 17:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r284564 - vendor-sys/acpica/20150619 X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jun 2015 17:28:16 -0000 Author: jkim Date: Thu Jun 18 17:28:15 2015 New Revision: 284564 URL: https://svnweb.freebsd.org/changeset/base/284564 Log: Tag ACPICA 20150619. Added: vendor-sys/acpica/20150619/ - copied from r284563, vendor-sys/acpica/dist/ From owner-svn-src-vendor@FreeBSD.ORG Fri Jun 19 07:08:34 2015 Return-Path: Delivered-To: svn-src-vendor@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56F1D3E9; Fri, 19 Jun 2015 07:08:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id A1A9BF4; Fri, 19 Jun 2015 07:08:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA29557; Fri, 19 Jun 2015 10:08:22 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Z5qPW-000ETm-GY; Fri, 19 Jun 2015 10:08:22 +0300 Message-ID: <5583BF95.4010408@FreeBSD.org> Date: Fri, 19 Jun 2015 10:07:01 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Matthew Ahrens , Ed Maste , Gleb Smirnoff CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-vendor@FreeBSD.org Subject: Re: svn commit: r284412 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys References: <201506151250.t5FCoifP019075@svn.freebsd.org> <557ECD22.8090402@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2015 07:08:34 -0000 On 15/06/2015 17:43, Matthew Ahrens wrote: > You might also consider copy/pasting the description of the illumos bug into the > FreeBSD commit message. Gleb Smirnoff wrote: > Is it possible to expand your script to > > fetch https://www.illumos.org/issues/$issue > > into your text editor, so that you can quickly cut the issue text and > produce a paragraph describing the change? How do you like this format? https://svnweb.freebsd.org/base?view=revision&revision=284593 In future I'll probably include the illumos review / approve information only in vendor area commits. I think that the original commit ID and the vendor area commit ID should be sufficient for a main tree commit. -- Andriy Gapon From owner-svn-src-vendor@FreeBSD.ORG Fri Jun 19 10:40:33 2015 Return-Path: Delivered-To: svn-src-vendor@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A137690E; Fri, 19 Jun 2015 10:40:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 27397B19; Fri, 19 Jun 2015 10:40:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id t5JAeLL4042548 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 19 Jun 2015 13:40:21 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id t5JAeLfm042547; Fri, 19 Jun 2015 13:40:21 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 19 Jun 2015 13:40:21 +0300 From: Gleb Smirnoff To: Andriy Gapon Cc: Matthew Ahrens , Ed Maste , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-vendor@FreeBSD.org Subject: Re: svn commit: r284412 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys Message-ID: <20150619104021.GE73119@FreeBSD.org> References: <201506151250.t5FCoifP019075@svn.freebsd.org> <557ECD22.8090402@FreeBSD.org> <5583BF95.4010408@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5583BF95.4010408@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2015 10:40:33 -0000 On Fri, Jun 19, 2015 at 10:07:01AM +0300, Andriy Gapon wrote: A> Gleb Smirnoff wrote: A> > Is it possible to expand your script to A> > A> > fetch https://www.illumos.org/issues/$issue A> > A> > into your text editor, so that you can quickly cut the issue text and A> > produce a paragraph describing the change? A> A> How do you like this format? A> https://svnweb.freebsd.org/base?view=revision&revision=284593 This looks much better. Now reading ZFS commits will be interesting. The block of tags should be moved to the bottom, however. A> In future I'll probably include the illumos review / approve information only in A> vendor area commits. I think that the original commit ID and the vendor area A> commit ID should be sufficient for a main tree commit. This would also work good. Thanks! -- Totus tuus, Glebius.