From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id C47CE3857827 for ; Thu, 14 Apr 2022 16:06:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C47CE3857827 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.90,260,1643702400"; d="diff'?scan'208";a="74285680" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 14 Apr 2022 08:06:40 -0800 IronPort-SDR: lZ972IDExcjIz+Wr74jPdsYLJq7OXJMd5IHfuBs0zYwA08uvXOpnMS3PI8PUlWsG1v1C7NhL3w FPe+U4IvEyV59p5wjOTl1w4kjOirAsJIBSQJn20HbhpJV4/3+5tckLdWumq/ccy2H994WMYca2 SiWmjmfmmsUF0yWOkifKqb+pId+wvrn82cJVU8fizazWB2bG3/38SWzGToeqXHVEsYkSxADSRL e7NLaTgooTWPtrGR7UcycQ8AntMEKKsnM+18vXoXA/acP5bsoHSoAfa0dOmF/TyZiTTWt7yRad rqc= Content-Type: multipart/mixed; boundary="------------4P03w0g10v1hTY5q6jMOZP0p" Message-ID: Date: Thu, 14 Apr 2022 18:06:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 From: Marcel Vollweiler Subject: [Patch] OpenMP, libgomp, gimple: omp_get_max_teams, omp_set_num_teams, and omp_{gs}et_teams_thread_limit on offload devices To: X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-15.mgc.mentorg.com (139.181.222.15) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2022 16:06:47 -0000 --------------4P03w0g10v1hTY5q6jMOZP0p Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable Hi, This patch adds support for omp_get_max_teams, omp_set_num_teams, and omp_{gs}et_teams_thread_limit on offload devices. The patch builds on the following patches which are submitted, but not yet approved/committed: - [PATCH] OpenMP, libgomp: Environment variable syntax extension. https://gcc.gnu.org/pipermail/gcc-patches/2022-January/588728.html - [PATCH] OpenMP, libgomp: Add new runtime routine omp_get_mapped_ptr. https://gcc.gnu.org/pipermail/gcc-patches/2022-March/591556.html The OpenMP runtime routines omp_get_max_teams, omp_set_num_teams, and omp_{gs}et_teams_thread_limit were introduced in OpenMP 5.1 and where alrea= dy implemented for the host usage with patch https://gcc.gnu.org/pipermail/gcc-patches/2021-October/581283.html The new patch extends the functionality of these OpenMP runtime routines by= the usage also on the device, i.e. device-specific values for nteams-var and teams-thread-limit-var ICVs can now be retrieved and set also on the device= . The updated number of teams/threads are then used when launching the kernel. The following main aspects are considered: (a) Implemented the functions in the according icv-device files. (b) Added structures to not only store initial device-specific values (they= have to be kept for omp_display_env) but also device-specific ICV values that ca= n be changed on the device at runtime. (c) Changed the gimplification: (c.1) Introduced integer_minus_two_node. (c.2) For target regions that do not include teams constructs, now the clau= se num_teams(-2) is added instead num_teams(1). This was necessary as num_team= s(1) is ambigious: it can also mean that a teams construct with explicit num_tea= ms(1) clause was specified inside the target region. The disambiguation is needed= in order to choose the correct thread limit: teams-thread-limit-var is only intended for teams constructs such that if there is no teams construct, the= n the number of threads is limited by thread-limit-var. (d) Extend GOMP_target_ext. The host needs to set the device-specific ICV v= alues before the kernel is launched. The number of teams and threads are members = of the args list and are modified when no value was specified in an explicit c= lause and the computation of the value was not postponed due to mapped variables. (d.1) The arguments list is copied in order to guarantee immutability. (e) Added copy back mechanism for ICVs which are modified on the device. Th= e only way to change device-specific ICVs is to do it on the device. As the device-specific values are sometimes needed also on the host when the kerne= l is launched (particularly number of teams and threads) they have to be copied = back. The patch was tested on x86_64-linux with nvptx and gcn offloading. All wit= h no regressions. Marcel ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955 --------------4P03w0g10v1hTY5q6jMOZP0p Content-Type: text/plain; charset="UTF-8"; name="teams_and_threads_on_device.diff" Content-Disposition: attachment; filename="teams_and_threads_on_device.diff" Content-Transfer-Encoding: base64 Z2NjL0NoYW5nZUxvZzoKCgkqIGdpbXBsaWZ5LmNjIChvcHRpbWl6ZV90YXJnZXRfdGVhbXMp OiBDaGFuZ2VkIGludGVnZXJfb25lX25vZGUgdG8KCWludGVnZXJfbWludXNfdHdvX25vZGUg aW4gY2FzZSBvZiBub24tZXhpc3RpbmcgdGVhbXMgY29uc3RydWN0IGluIHRhcmdldAoJcmVn aW9uIGR1ZSB0byBkaXNhbWJpZ3VhdGlvbi4gUHJldmlvdXNseSwgbnVtX3RlYW1zKDEpIHdh cyB1c2VkIGFzCgljbGF1c2Ugb24gdGhlIHRhcmdldCBjb25zdHJ1Y3Qgd2hlbiAoYSkgbm8g dGVhbXMgY29uc3RydWN0IGV4aXN0cyBpbiB0aGUKCXRhcmdldCByZWdpb24gb3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ld190ZWFt cyB8fCBvcmlnX3RocmVhZHMgIT0gbmV3X3RocmVhZHMpCisgICAgeworICAgICAgc2l6ZV90 IHRtc19sZW4gPSAob3JpZ190ZWFtcyA9PSBuZXdfdGVhbXMKKwkJCT8gdGVhbXNfbGVuCisJ CQk6IChuZXdfdGVhbXMgPiAtKDEgPDwgMTUpICYmIG5ld190ZWFtcyA8ICgxIDw8IDE1KQor CQkJICAgPyAxIDogMikpOworICAgICAgc2l6ZV90IHRoc19sZW4gPSAob3JpZ190aHJlYWRz ID09IG5ld190aHJlYWRzCisJCQk/IHRocmVhZHNfbGVuCisJCQk6IChuZXdfdGhyZWFkcyA+ IC0oMSA8PCAxNSkgJiYgbmV3X3RocmVhZHMgPCAoMSA8PCAxNSkKKwkJCSAgID8gMSA6IDIp KTsKKyAgICAgIC8qIE9uZSBhZGRpdGlvbmFsIGl0ZW0gc2luY2UgdGhlIGxhc3QgYXJnIG11 c3QgYmUgTlVMTC4gICovCisgICAgICBzaXplX3QgbmV3X2FyZ3NfY250ID0gbnVtX2FyZ3Mg LSB0ZWFtc19sZW4gLSB0aHJlYWRzX2xlbiArIHRtc19sZW4KKwkJCSAgICArIHRoc19sZW4g KyAxOworICAgICAgbmV3X2FyZ3MgPSAodm9pZCAqKikgZ29tcF9hbGxvY2EgKG5ld19hcmdz X2NudCAqIHNpemVvZiAodm9pZCopKTsKKworICAgICAgdG1wYXJncyA9IGFyZ3M7CisgICAg ICB2b2lkICoqdG1wX25ld19hcmdzID0gbmV3X2FyZ3M7CisgICAgICB3aGlsZSAoKnRtcGFy Z3MpCisJeworCSAgaW50cHRyX3QgaWQgPSAoaW50cHRyX3QpICp0bXBhcmdzOworCSAgaWYg KCgoaWQgJiBHT01QX1RBUkdFVF9BUkdfSURfTUFTSykgPT0gR09NUF9UQVJHRVRfQVJHX05V TV9URUFNUworCSAgICAgICAmJiBvcmlnX3RlYW1zICE9IG5ld190ZWFtcykKKwkgICAgICB8 fCAoKGlkICYgR09NUF9UQVJHRVRfQVJHX0lEX01BU0spID09IEdPTVBfVEFSR0VUX0FSR19U SFJFQURfTElNSVQKKwkJICAmJiBvcmlnX3RocmVhZHMgIT0gbmV3X3RocmVhZHMpKQorCSAg ICB7CisJICAgICAgdG1wYXJncysrOworCSAgICAgIGlmIChpZCAmIEdPTVBfVEFSR0VUX0FS R19TVUJTRVFVRU5UX1BBUkFNKQorCQl0bXBhcmdzKys7CisJICAgIH0KKwkgIGVsc2UKKwkg ICAgeworCSAgICAgICp0bXBfbmV3X2FyZ3MrKyA9ICp0bXBhcmdzKys7CisJICAgICAgaWYg KGlkICYgR09NUF9UQVJHRVRfQVJHX1NVQlNFUVVFTlRfUEFSQU0pCisJCSp0bXBfbmV3X2Fy Z3MrKyA9ICp0bXBhcmdzKys7CisJICAgIH0KKwl9CisKKyAgICAgIGlmIChvcmlnX3RlYW1z ICE9IG5ld190ZWFtcykKKwl7CisJICBpbnRwdHJfdCBuZXdfdmFsID0gbmV3X3RlYW1zOwor CSAgaWYgKHRtc19sZW4gPT0gMSkKKwkgICAgeworCSAgICAgIG5ld192YWwgPSAobmV3X3Zh bCA8PCBHT01QX1RBUkdFVF9BUkdfVkFMVUVfU0hJRlQpCisJCQkgfCBHT01QX1RBUkdFVF9B UkdfTlVNX1RFQU1TOworCSAgICAgICp0bXBfbmV3X2FyZ3MrKyA9ICh2b2lkICopIG5ld192 YWw7CisJICAgIH0KKwkgIGVsc2UKKwkgICAgeworCSAgICAgICp0bXBfbmV3X2FyZ3MrKyA9 ICh2b2lkICopIChHT01QX1RBUkdFVF9BUkdfU1VCU0VRVUVOVF9QQVJBTQorCQkJCQkgIHwg R09NUF9UQVJHRVRfQVJHX05VTV9URUFNUyk7CisJICAgICAgKnRtcF9uZXdfYXJncysrID0g KHZvaWQgKikgbmV3X3ZhbDsKKwkgICAgfQorCX0KKworICAgICAgaWYgKG9yaWdfdGhyZWFk cyAhPSBuZXdfdGhyZWFkcykKKwl7CisJICBpbnRwdHJfdCBuZXdfdmFsID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LAotICAiT01QX05VTV9URUFN U19ERVYiLAotICAiT01QX05VTV9URUFNUyIKKyAgIk9NUF9URUFNU19USFJFQURfTElNSVRf QUxMIiwKKyAgIk9NUF9URUFNU19USFJFQURfTElNSVRfREVWIiwKKyAgIk9NUF9URUFNU19U SFJFQURfTElNSVQiLAorICAiT01QX1RFQU1TX1RIUkVBRF9MSU1JVF9ERVZfMCIsCisgICJP TVBfVEVBTVNfVEhSRUFEX0xJTUlUX0RFVl8xIiwKKyAgIk9NUF9URUFNU19USFJFQURfTElN SVRfREVWXzIiCiB9OwotY2hhciBjb25zdCAqdmFsdWVzW10gPSB7ICI0MiIsICI0MyIsICI0 NCIsICI0NSIsICI0NiIsICI0NyIgfTsKLWNvbnN0IGludCBjbnQgPSA2OworY2hhciBjb25z dCAqdmFsdWVzW10gPSB7ICIzIiwgIjQiLCAiNSIsICI2IiwgIjciLCAiOCIsCisJCQkgIjIi LCAiMyIsICI0IiwgIjUiLCAiNiIsICI3IiB9OworY29uc3QgaW50IGNudCA9IDEyOwogCiBp bnQKIG1haW4gKGludCBhcmdjLCBjaGFyICpjb25zdCAqYXJndikKQEAgLTM1LDE0ICs0Mywx OTIgQEAgbWFpbiAoaW50IGFyZ2MsIGNoYXIgKmNvbnN0ICphcmd2KQogICAgICAgYWJvcnQg KCk7CiAgICAgfQogCi0gIGlmIChvbXBfZ2V0X21heF90ZWFtcyAoKSAhPSA0NykKKyAgaWYg KG9tcF9nZXRfbWF4X3RlYW1zICgpICE9IDUKKyAgICAgIHx8IG9tcF9nZXRfdGVhbXNfdGhy ZWFkX2xpbWl0ICgpICE9IDQpCisgICAgYWJvcnQgKCk7CisKKyAgI3ByYWdtYSBvbXAgdGVh bXMKKyAgeworICAgIGlmIChvbXBfZ2V0X251bV90ZWFtcyAoKSA+IDUKKwl8fCBvbXBfZ2V0 X3RlYW1fbnVtICgpID49IDUpCisgICAgICBhYm9ydCAoKTsKKyAgICAjcHJhZ21hIG9tcCBw YXJhbGxlbAorICAgIGlmIChvbXBfZ2V0X3RocmVhZF9saW1pdCAoKSA+IDQKKwl8fCBvbXBf Z2V0X3RocmVhZF9udW0gKCkgPj0gNCkKKyAgICAgIGFib3J0ICgpOworICB9CisKKyAgb21w X3NldF9udW1fdGVhbXMgKDQpOworICBvbXBfc2V0X3RlYW1zX3RocmVhZF9saW1pdCAoMyk7 CisgIGlmIChvbXBfZ2V0X21heF90ZWFtcyAoKSAhPSA0CisgICAgICB8fCBvbXBfZ2V0X3Rl YW1zX3RocmVhZF9saW1pdCAoKSAhPSAzKQorICAgIGFib3J0ICgpOworCisgICNwcmFnbWEg b21wIHRlYW1zCisgIHsKKyAgICBpZiAob21wX2dldF9udW1fdGVhbXMgKCkgPiA0CisJfHwg b21wX2dldF90ZWFtX251bSAoKSA+PSA0KQorICAgICAgYWJvcnQgKCk7CisgICAgI3ByYWdt YSBvbXAgcGFyYWxsZWwKKyAgICBpZiAob21wX2dldF90aHJlYWRfbGltaXQgKCkgPiAzCisJ fHwgb21wX2dldF90aHJlYWRfbnVtICgpID49IDMpCisgICAgICBhYm9ydCAoKTsKKyAgfQor CisgICNwcmFnbWEgb21wIHRlYW1zIG51bV90ZWFtcygzKSB0aHJlYWRfbGltaXQoMikKKyAg eworICAgIGlmIChvbXBfZ2V0X251bV90ZWFtcyAoKSAhPSAzCisJfHwgb21wX2dldF90ZWFt X251bSAoKSA+PSAzKQorICAgIGFib3J0ICgpOworICAgICNwcmFnbWEgb21wIHBhcmFsbGVs CisgICAgaWYgKG9tcF9nZXRfdGhyZWFkX2xpbWl0ICgpID4gMgorCXx8IG9tcF9nZXRfdGhy ZWFkX251bSAoKSA+PSAyKQorICAgICAgYWJvcnQgKCk7CisgIH0KKworICAjcHJhZ21hIG9t cCB0ZWFtcyBudW1fdGVhbXMoNSkgdGhyZWFkX2xpbWl0KDQpCisgIHsKKyAgICBpZiAob21w X2dldF9udW1fdGVhbXMgKCkgIT0gNQorCXx8IG9tcF9nZXRfdGVhbV9udW0gKCkgPj0gNSkK ICAgICBhYm9ydCAoKTsKKyAgICAjcHJhZ21hIG9tcCBwYXJhbGxlbAorICAgIGlmIChvbXBf Z2V0X3RocmVhZF9saW1pdCAoKSA+IDQKKwl8fCBvbXBfZ2V0X3RocmVhZF9udW0gKCkgPj0g NCkKKyAgICAgIGFib3J0ICgpOworICB9CiAKICAgaW50IG51bV9kZXZpY2VzID0gb21wX2dl dF9udW1fZGV2aWNlcyAoKSA+IDMgPyAzIDogb21wX2dldF9udW1fZGV2aWNlcyAoKTsKKyAg aWYgKG51bV9kZXZpY2VzIDw9IDApCisgICAgcmV0dXJuIDA7CisKICAgZm9yIChpbnQgaT0w OyBpIDwgbnVtX2RldmljZXM7IGkrKykKLSAgICAjcHJhZ21hIG9tcCB0YXJnZXQgZGV2aWNl IChpKQotICAgICAgaWYgKG9tcF9nZXRfbWF4X3RlYW1zICgpICE9IDQyICsgaSkKKyAgICB7 CisgICAgICAjcHJhZ21hIG9tcCB0YXJnZXQgZGV2aWNlIChpKQorICAgICAgaWYgKG9tcF9n ZXRfbWF4X3RlYW1zICgpICE9IDYgKyBpCisJICB8fCBvbXBfZ2V0X3RlYW1zX3RocmVhZF9s aW1pdCAoKSAhPSA1ICsgaSkKIAlhYm9ydCAoKTsKIAorICAgICAgI3ByYWdtYSBvbXAgdGFy Z2V0IGRldmljZSAoaSkKKyAgICAgICNwcmFnbWEgb21wIHRlYW1zCisgICAgICB7CisJaWYg KG9tcF9nZXRfbnVtX3RlYW1zICgpID4gNiArIGkKKwkgICAgfHwgb21wX2dldF90ZWFtX251 bSAoKSA+PSA2ICsgaSkKKwkgIGFib3J0ICgpOworCSNwcmFnbWEgb21wIHBhcmFsbGVsCisJ aWYgKG9tcF9nZXRfdGhyZWFkX2xpbWl0ICgpID4gNSArIGkKKwkgICAgfHwgb21wX2dldF90 aHJlYWRfbnVtICgpID49IDUgKyBpKQorCSAgYWJvcnQgKCk7CisgICAgICB9CisKKyAgICAg ICNwcmFnbWEgb21wIHRhcmdldCBk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Ym9ydCAoKTsKKyAgICAg IH0KKworICAgICAgI3ByYWdtYSBvbXAgdGFyZ2V0IGRldmljZSAoaSkKKyAgICAgICNwcmFn bWEgb21wIHRlYW1zIG51bV90ZWFtcyg2ICsgaSkgdGhyZWFkX2xpbWl0KDUgKyBpKQorICAg ICAgeworCWlmIChvbXBfZ2V0X251bV90ZWFtcyAoKSA+IDYgKyBpCisJICAgIHx8IG9tcF9n ZXRfdGVhbV9udW0gKCkgPj0gNiArIGkpCisJICBhYm9ydCAoKTsKKwkjcHJhZ21hIG9tcCBw YXJhbGxlbAorCSAgaWYgKG9tcF9nZXRfdGhyZWFkX2xpbWl0ICgpID4gNSArIGkKKwkgICAg ICB8fCBvbXBfZ2V0X3RocmVhZF9udW0gKCkgPj0gNSArIGkKKwkgICAgICB8fCBvbXBfZ2V0 X251bV90ZWFtcyAoKSA+IDYgKyBpCisJICAgICAgfHwgb21wX2dldF90ZWFtX251bSAoKSA+ PSA2ICsgaSkKKwkgICAgYWJvcnQgKCk7CisgICAgICB9CisKKyAgICAgICNwcmFnbWEgb21w IHRhcmdldCBkZXZpY2UgKGkpCisgICAgICAjcHJhZ21hIG9tcCB0ZWFtcyBudW1fdGVhbXMo NCArIGkpIHRocmVhZF9saW1pdCgzICsgaSkKKyAgICAgIHsKKwlpZiAob21wX2dldF9udW1f dGVhbXMgKCkgPiA0ICsgaQorCSAgICB8fCBvbXBfZ2V0X3RlYW1fbnVtICgpID49IDQgKyBp KQorCSAgYWJvcnQgKCk7CisJI3ByYWdtYSBvbXAgcGFyYWxsZWwKKwkgIGlmIChvbXBfZ2V0 X3RocmVhZF9saW1pdCAoKSA+IDMgKyBpCisJICAgICAgfHwgb21wX2dldF90aHJlYWRfbnVt ICgpID49IDMgKyBpCisJICAgICAgfHwgb21wX2dldF9udW1fdGVhbXMgKCkgPiA0ICsgaQor CSAgICAgIHx8IG9tcF9nZXRfdGVhbV9udW0gKCkgPj0gNCArIGkpCisJICAgIGFib3J0ICgp OworICAgICAg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A/IDMgOiBvbXBfZ2V0X251bV9kZXZpY2VzICgpOwogICBmb3Ig KGludCBpPTA7IGkgPCBudW1fZGV2aWNlczsgaSsrKQotICAgICNwcmFnbWEgb21wIHRhcmdl dCBkZXZpY2UgKGkpCi0gICAgICBpZiAob21wX2dldF9tYXhfdGVhbXMgKCkgIT0gNDMpCisg ICAgeworICAgICAgI3ByYWdtYSBvbXAgdGFyZ2V0IGRldmljZSAoaSkKKyAgICAgIGlmIChv bXBfZ2V0X21heF90ZWFtcyAoKSAhPSA0CisJICB8fCBvbXBfZ2V0X3RlYW1zX3RocmVhZF9s aW1pdCAoKSAhPSAzKQorCWFib3J0ICgpOworCisgICAgICAjcHJhZ21hIG9tcCB0YXJnZXQg ZGV2aWNlIChpKQorICAgICAgI3ByYWdtYSBvbXAgdGVhbXMKKyAgICAgIHsKKwlpZiAob21w X2dldF9udW1fdGVhbXMgKCkgPiA0CisJICAgIHx8IG9tcF9nZXRfdGVhbV9udW0gKCkgPj0g NCkKKwkgIGFib3J0ICgpOworCSNwcmFnbWEgb21wIHBhcmFsbGVsCisJaWYgKG9tcF9nZXRf dGhyZWFkX2xpbWl0ICgpID4gMworCSAgICB8fCBvbXBfZ2V0X3RocmVhZF9udW0gKCkgPj0g MykKKwkgIGFib3J0ICgpOworICAgICAgfQorCisgICAgICAjcHJhZ21hIG9tcCB0YXJnZXQg ZGV2aWNlIChpKQorICAgICAgeworCW9tcF9zZXRfbnVtX3RlYW1zICgzICsgaSk7CisJb21w X3NldF90ZWFtc190aHJlYWRfbGltaXQgKDIgKyBpKTsKKwlpZiAob21wX2dldF9tYXhfdGVh bXMgKCkgIT0gMyArIGkKKwkgICAgfHwgb21wX2dldF90ZWFtc190aHJlYWRfbGltaXQgKCkg IT0gMiArIGkpCisJICBhYm9ydCAoKTsKKyAgICAgIH0KKworICAgICAvKiBvbXBfc2V0X251 bV90ZWFtcyBhYm92ZSBzZXQgdGhlIHZhbHVlIG9mIG50ZWFtcy12YXIgSUNWIG9u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aWYgKG9tcF9nZXRfbWF4X3RlYW1zICgpICE9IDcK KyAgICAgIHx8IG9tcF9nZXRfdGVhbXNfdGhyZWFkX2xpbWl0ICgpICE9IDIpCisgICAgYWJv cnQgKCk7CisKKyAgI3ByYWdtYSBvbXAgdGVhbXMKKyAgaWYgKG9tcF9nZXRfbnVtX3RlYW1z ICgpID4gNworICAgICAgfHwgb21wX2dldF90ZWFtX251bSAoKSA+PSA3KQorICAgIGFib3J0 ICgpOworCisgIG9tcF9zZXRfbnVtX3RlYW1zICg5KTsKKyAgb21wX3NldF90ZWFtc190aHJl YWRfbGltaXQgKDMpOworICBpZiAob21wX2dldF9tYXhfdGVhbXMgKCkgIT0gOQorICAgICAg fHwgb21wX2dldF90ZWFtc190aHJlYWRfbGltaXQgKCkgIT0gMykKKyAgICBhYm9ydCAoKTsK KworICAjcHJhZ21hIG9tcCB0ZWFtcworICBpZiAob21wX2dldF9udW1fdGVhbXMgKCkgPiA5 CisgICAgICB8fCBvbXBfZ2V0X3RlYW1fbnVtICgpID49IDkpCisgICAgYWJvcnQgKCk7CisK KyAgI3ByYWdtYSBvbXAgdGVhbXMgbnVtX3RlYW1zKDUpCisgIGlmIChvbXBfZ2V0X251bV90 ZWFtcyAoKSA+IDUKKyAgICAgIHx8IG9tcF9nZXRfdGVhbV9udW0gKCkgPj0gNSkKICAgICBh Ym9ydCAoKTsKIAogICBpbnQgbnVtX2RldmljZXMgPSBvbXBfZ2V0X251bV9kZXZpY2VzICgp ID4gMyA/IDMgOiBvbXBfZ2V0X251bV9kZXZpY2VzICgpOwogICBmb3IgKGludCBpPTA7IGkg PCBudW1fZGV2aWNlczsgaSsrKQotICAgICNwcmFnbWEgb21wIHRhcmdldCBkZXZpY2UgKGkp Ci0gICAgICBpZiAob21wX2dldF9tYXhfdGVhbXMgKCkgIT0gNDIpCisgICAgeworICAgICAg I3ByYWdtYSBvbXAgdGFyZ2V0IGRldmljZSAoaSkKKyAgICAgIGlmIChvbXBfZ2V0X21heF90 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AorICAiT01QX05VTV9URUFNU19ERVZfMiIsCisgICJPTVBfTlVNX1RF QU1TX0RFViIsCisgICJPTVBfTlVNX1RFQU1TX0FMTCIsCisgICJPTVBfTlVNX1RFQU1TIiwK KyAgIk9NUF9URUFNU19USFJFQURfTElNSVRfREVWXzAiLAorICAiT01QX1RFQU1TX1RIUkVB RF9MSU1JVF9ERVZfMSIsCisgICJPTVBfVEVBTVNfVEhSRUFEX0xJTUlUX0RFVl8yIiwKKyAg Ik9NUF9URUFNU19USFJFQURfTElNSVRfREVWIiwKKyAgIk9NUF9URUFNU19USFJFQURfTElN SVRfQUxMIiwKKyAgIk9NUF9URUFNU19USFJFQURfTElNSVQiCit9OworY29uc3QgaW50IGNu dF9leGx1ZGVzID0gMTI7CisKK2ludAorbWFpbiAoaW50IGFyZ2MsIGNoYXIgKmNvbnN0ICph cmd2KQoreworICBpbnQgdXBkYXRlZCA9IDA7CisgIGZvciAoaW50IGkgPSAwOyBpIDwgY250 X2V4bHVkZXM7IGkrKykKKyAgICBpZiAoZ2V0ZW52IChleGNsdWRlc1tpXSkgIT0gTlVMTCkK KyAgICAgIHsKKwl1bnNldGVudiAoZXhjbHVkZXNbaV0pOworCXVwZGF0ZWQgPSAxOworICAg ICAgfQorICBpZiAodXBkYXRlZCkKKyAgICB7CisgICAgICBleGVjdiAoYXJndlswXSwgYXJn dik7CisgICAgICBhYm9ydCAoKTsKKyAgICB9CisKKyAgaWYgKG9tcF9nZXRfbWF4X3RlYW1z ICgpICE9IDAKKyAgICAgIHx8IG9tcF9nZXRfdGVhbXNfdGhyZWFkX2xpbWl0ICgpICE9IDAp CisgICAgYWJvcnQgKCk7CisKKyAgb21wX3NldF9udW1fdGVhbXMgKDkpOworICBvbXBfc2V0 X3RlYW1zX3RocmVhZF9saW1pdCAoMik7CisgIGlmIChvbXBfZ2V0X21heF90ZWFtcyAoKSAh PSA5CisgICAgICB8fCBvbXBfZ2V0X3RlYW1zX3RocmVhZF9saW1pdCAoKSAhPSAyKQorICAg IGFib3J0ICgpOworCisgICNwcmFnbWEgb21wIHRlYW1zCisgIGlmIChvbXBfZ2V0X251bV90 ZWFtcyAoKSA+IDkKKyAgICAgIHx8IG9tcF9nZXRfdGVhbV9udW0gKCkgPj0gOSkKKyAgICBh Ym9ydCAoKTsKKworICAjcHJhZ21hIG9tcCB0ZWFtcyBudW1fdGVhbXMoNSkKKyAgaWYgKG9t cF9nZXRfbnVtX3RlYW1zICgpID4gNQorICAgICAgfHwgb21wX2dldF90ZWFtX251bSAoKSA+ PSA1KQorICAgIGFib3J0ICgpOworCisgIGludCBudW1fZGV2aWNlcyA9IG9tcF9nZXRfbnVt X2RldmljZXMgKCkgPiAzID8gMyA6IG9tcF9nZXRfbnVtX2RldmljZXMgKCk7CisgIGZvciAo aW50IGk9MDsgaSA8IG51bV9kZXZpY2VzOyBpKyspCisgICAgeworICAgICAgI3ByYWdtYSBv bXAgdGFyZ2V0IGRldmljZSAoaSkKKyAgICAgIGlmIChvbXBfZ2V0X21heF90ZWFtcyAoKSAh PSAwCisJICB8fCBvbXBfZ2V0X3RlYW1zX3RocmVhZF9saW1pdCAoKSAhPSAwKQorCWFib3J0 ICgpOworCisgICAgICAjcHJhZ21hIG9tcCB0YXJnZXQgZGV2aWNlIChpKQorICAgICAgewor CW9tcF9zZXRfbnVtX3RlYW1zICg4ICsgaSk7CisJb21wX3NldF90ZWFtc190aHJlYWRfbGlt aXQgKDMgKyBpKTsKKwlpZiAob21wX2dldF9tYXhfdGVhbXMgKCkgIT0gOCArIGkKKwkgICAg fHwgb21wX2dldF90ZWFtc190aHJlYWRfbGltaXQgKCkgIT0gMyArIGkpCisJICBhYm9ydCAo KTsKKyAgICAgIH0KKworICAgICAvKiBvbXBfc2V0X251bV90ZWFtcyBhYm92ZSBzZXQgdGhl IHZhbHVlIG9mIG50ZWFtcy12YXIgSUNWIG9uIGRldmljZSAnaScsCisJIHdoaWNoIGhhcyBz Y29wZSAnZGV2aWNlJyBhbmQgc2hvdWxkIGJ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GhlbgorICAgIG51bV9kZXZpY2VzID0gMworICBlbHNlCisgICAgbnVtX2RldmljZXMgPSBv bXBfZ2V0X251bV9kZXZpY2VzICgpCisgIGVuZCBpZgorCisgIGRvIGk9MCxudW1fZGV2aWNl cy0xCisKKyAgICAhIFRlc3RpbmcgTlVNX1RFQU1TLgorICAgIGlmIChlbnZfaXNfc2V0X2Rl diAoIk9NUF9OVU1fVEVBTVNfREVWXyIsIGksIDYgKyBpKSkgdGhlbgorICAgICAgZXJyID0g LmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBlcnIp CisgICAgICBpZiAob21wX2dldF9tYXhfdGVhbXMgKCkgLz0gNiArIGkpIGVyciA9IC50cnVl LgorICAgICAgISRvbXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCAxCisKKyAg ICAgIGVyciA9IC5mYWxzZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRv ZnJvbTogZXJyKQorICAgICAgISRvbXAgdGVhbXMKKyAgICAgIGlmIChvbXBfZ2V0X251bV90 ZWFtcyAoKSA+IDYgKyBpIC5vci4gb21wX2dldF90ZWFtX251bSAoKSA+PSA2ICsgaSkgJgor ICAgICAgICBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0ZWFtcworICAgICAgISRv bXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCAyCisKKyAgICAgIGVyciA9IC5m YWxzZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJyKQor ICAgICAgY2FsbCBvbXBfc2V0X251bV90ZWFtcyAoNSArIGkpCisgICAgICBpZiAob21wX2dl dF9tYXhfdGVhbXMgKCkgLz0gNSArIGkpIGVyciA9IC50cnVlLgorICAgICAgISRvbXAgZW5k IHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCAzCisKKyAgICAgIGVyciA9IC5mYWxzZS4K KyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJyKQorICAgICAg aWYgKG9tcF9nZXRfbWF4X3RlYW1zICgpIC89IDUgKyBpKSBlcnIgPSAudHJ1ZS4KKyAgICAg ICEkb21wIGVuZCB0YXJnZXQKKyAgICAgIGlmIChlcnIpIHN0b3AgNAorCisgICAgICBlcnIg PSAuZmFsc2UuCisgICAgICAhJG9tcCB0YXJnZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVy cikKKyAgICAgICEkb21wIHRlYW1zCisgICAgICBpZiAob21wX2dldF9udW1fdGVhbXMgKCkg PiA1ICsgaSAub3IuIG9tcF9nZXRfdGVhbV9udW0gKCkgPj0gNSArIGkpICYKKyAgICAgICAg ZXJyID0gLnRydWUuCisgICAgICAhJG9tcCBlbmQgdGVhbXMKKyAgICAgICEkb21wIGVuZCB0 YXJnZXQKKyAgICAgIGlmIChlcnIpIHN0b3AgNQorCisgICAgICBlcnIgPSAuZmFsc2UuCisg ICAgICAhJG9tcCB0YXJnZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgICEk b21wIHRlYW1zIG51bV90ZWFtcyg2ICsgaSkKKyAgICAgIGlmIChvbXBfZ2V0X251bV90ZWFt cyAoKSA+IDYgKyBpIC5vci4gb21wX2dldF90ZWFtX251bSAoKSA+PSA2ICsgaSkgJgorICAg ICAgICBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0ZWFtcworICAgICAgISRvbXAg ZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCA2CisKKyAgICAgIGVyciA9IC5mYWxz ZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJyKQorICAg ICAgISRvbXAgdGVhbXMgbnVtX3RlYW1zKDQgKyBpKQorICAgICAgaWYgKG9tcF9nZXRfbnVt X3RlYW1zICgpID4gNCArIGkgLm9yLiBvbX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ZCB0YXJn ZXQKKyAgICAgIGlmIChlcnIpIHN0b3AgMTAKKyAgICBlbmQgaWYKKworICAgICEgVGVzdGlu ZyBURUFNUy1USFJFQUQtTElNSVQKKyAgICBpZiAoZW52X2lzX3NldF9kZXYgKCJPTVBfVEVB TVNfVEhSRUFEX0xJTUlUX0RFVl8iLCBpLCA1ICsgaSkpIHRoZW4KKyAgICAgIGVyciA9IC5m YWxzZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJyKQor ICAgICAgaWYgKG9tcF9nZXRfdGVhbXNfdGhyZWFkX2xpbWl0ICgpIC89IDUgKyBpKSBlcnIg PSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0YXJnZXQKKyAgICAgIGlmIChlcnIpIHN0b3Ag MTEKKworICAgICAgZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShp KSBtYXAodG9mcm9tOiBlcnIpCisgICAgICAhJG9tcCB0ZWFtcworICAgICAgISRvbXAgcGFy YWxsZWwKKyAgICAgIGlmIChvbXBfZ2V0X3RocmVhZF9saW1pdCAoKSA+IDUgKyBpIC5vci4g b21wX2dldF90aHJlYWRfbnVtICgpID49IDUgKyBpKSAmCisgICAgICAgIGVyciA9IC50cnVl LgorICAgICAgISRvbXAgZW5kIHBhcmFsbGVsCisgICAgICAhJG9tcCBlbmQgdGVhbXMKKyAg ICAgICEkb21wIGVuZCB0YXJnZXQKKyAgICAgIGlmIChlcnIpIHN0b3AgMTIKKworICAgICAg ZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9t OiBlcnIpCisgICAgICBjYWxsIG9tcF9zZXRfdGVhbXNfdGhyZWFkX2xpbWl0ICg0ICsgaSkK KyAgICAgIGlmIChvbXBfZ2V0X3RlYW1zX3RocmVhZF9saW1pdCAoKSAvPSA0ICsgaSkgZXJy ID0gLnRydWUuCisgICAgICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9w IDEzCisKKyAgICAgIGVyciA9IC5mYWxzZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2Uo aSkgbWFwKHRvZnJvbTogZXJyKQorICAgICAgaWYgKG9tcF9nZXRfdGVhbXNfdGhyZWFkX2xp bWl0ICgpIC89IDQgKyBpKSBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0YXJnZXQK KyAgICAgIGlmIChlcnIpIHN0b3AgMTQKKworICAgICAgZXJyID0gLmZhbHNlLgorICAgICAg ISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBlcnIpCisgICAgICAhJG9tcCB0 ZWFtcworICAgICAgISRvbXAgcGFyYWxsZWwKKyAgICAgIGlmIChvbXBfZ2V0X3RocmVhZF9s aW1pdCAoKSA+IDQgKyBpIC5vci4gb21wX2dldF90aHJlYWRfbnVtICgpID49IDQgKyBpKSAm CisgICAgICAgIGVyciA9IC50cnVlLgorICAgICAgISRvbXAgZW5kIHBhcmFsbGVsCisgICAg ICAhJG9tcCBlbmQgdGVhbXMKKyAgICAgICEkb21wIGVuZCB0YXJnZXQKKyAgICAgIGlmIChl cnIpIHN0b3AgMTUKKworICAgICAgZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0 IGRldmljZShpKSBtYXAodG9mcm9tOiBlcnIpCisgICAgICAhJG9tcCB0ZWFtcyB0aHJlYWRf bGltaXQoNSArIGkpCisgICAgICAhJG9tcCBwYXJhbGxlbAorICAgICAgaWYgKG9tcF9nZXRf dGhyZWFkX2xpbWl0ICgpID4gNSArIGkgLm9yLiBvbXBfZ2V0X3RocmVhZF9udW0gKCkgPj0g NSArIGkpICYKKyAgICAgICAgZXJyID0gLnRydWUuCisgICAgICAhJG9tcCBlbmQgcGFyYWxs ZWwKKyAgICAgICEkb21wIGVuZCB0ZWFtcworICAgICAgISRvbXAgZW5kIHRhcmdldAorICAg ICAgaWYgKGVycikgc3RvcCAxNgorCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9t cCB0YXJnZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgICEkb21wIHRlYW1z IHRocmVhZF9saW1pdCgzICsgaSkKKyAgICAgICEkb21wIHBhcmFsbGVsCisgICAgICBpZiAo b21wX2dldF90aHJlYWRfbGltaXQgKCkgPiAzICsgaSAub3IuIG9tcF9nZXRfdGhyZWFkX251 bSAoKSA+PSAzICsgaSkgJgorICAgICAgICBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVu ZCBwYXJhbGxlbAorICAgICAgISRvbXAgZW5kIHRlYW1zCisgICAgICAhJG9tcCBlbmQgdGFy Z2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDE3CisKKyAgICAgIGxhcmdlX3RocmVhZHNfbGlt aXQgPSA2NzAwMAorICAgICAgZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRl dmljZShpKSBtYXAodG9mcm9tOiBlcnIpCisgICAgICBjYWxsIG9tcF9zZXRfdGVhbXNfdGhy ZWFkX2xpbWl0IChsYXJnZV90aHJlYWRzX2xpbWl0ICsgaSkKKyAgICAgIGlmIChvbXBfZ2V0 X3RlYW1zX3RocmVhZF9saW1pdCAoKSAvPSBsYXJnZV90aHJlYWRzX2xpbWl0ICsgaSkgZXJy ID0gLnRydWUuCisgICAgICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9w IDE4CisKKyAgICAgIGVyciA9IC5mYWxzZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2Uo aSkgbWFwKHRvZnJvbTogZXJyKQorICAgICAgaWYgKG9tcF9nZXRfdGVhbXNfdGhyZWFkX2xp bWl0ICgpIC89IGxhcmdlX3RocmVhZHNfbGltaXQgKyBpKSBlcnIgPSAudHJ1ZS4KKyAgICAg ICEkb21wIGVuZCB0YXJnZXQKKyAgICAgIGlmIChlcnIpIHN0b3AgMTkKKworICAgICAgZXJy ID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBl cnIpCisgICAgICAhJG9tcCB0ZWFtcworICAgICAgISRvbXAgcGFyYWxsZWwKKyAgICAgIGlm IChvbXBfZ2V0X3RocmVhZF9saW1pdCAoKSA+IGxhcmdlX3RocmVhZHNfbGltaXQgKyBpICYK KyAgICAgICAgICAub3IuIG9tcF9nZXRfdGhyZWFkX251bSAoKSA+PSBsYXJnZV90aHJlYWRz X2xpbWl0ICsgaSkgZXJyID0gLnRydWUuCisgICAgICAhJG9tcCBlbmQgcGFyYWxsZWwKKyAg ICAgICEkb21wIGVuZCB0ZWFtcworICAgICAgISRvbXAgZW5kIHRhcmdldAorICAgICAgaWYg KGVycikgc3RvcCAyMAorICAgIGVuZCBpZgorCisgIGVuZCBkbworCitjb250YWlucworICBs b2dpY2FsIGZ1bmN0aW9uIGVudl9pc19zZXQgKG5hbWUsIHZhbCkKKyAgICBjaGFyYWN0ZXIo bGVuPSopIDo6IG5hbWUsIHZhbAorICAgIGNoYXJhY3RlcihsZW49NDApIDo6IHZhbDIKKyAg ICBpbnRlZ2VyIDo6IHN0YXQKKyAgICBjYWxsIGdldF9lbnZpcm9ubWVudF92YXJpYWJsZSAo bmFtZSwgdmFsMiwgc3RhdHVzPXN0YXQpCisgICAgaWYgKHN0YXQgPT0gMCkgdGhlbgorICAg ICAgaWYgKHZhbCA9PSB2YWwyKSB0aGVuCisgICAgICAgIGVudl9pc19zZXQgPSAudHJ1ZS4K KyAgICAgICAgcmV0dXJuCisgICAgICBlbmQgaWYKKyAgICBlbHNlIGlmIChzdGF0IC89IDEp IHRoZW4KKyAgICAgIGVycm9yIHN0b3AgMzAKKyAgICBlbmRpZgorICAgIGVudl9pc19zZXQg PSAuZmFsc2UuCisgIGVuZAorICBsb2dpY2FsIGZ1bmN0aW9uIGVudl9pc19zZXRfZGV2IChu YW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ZWFtcyAoKSAvPSA0KSBl cnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0YXJnZXQKKyAgICAgIGlmIChlcnIpIHN0 b3AgMQorCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9tcCB0YXJnZXQgZGV2aWNl KGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgICEkb21wIHRlYW1zCisgICAgICBpZiAob21w X2dldF9udW1fdGVhbXMgKCkgPiA0IC5vci4gb21wX2dldF90ZWFtX251bSAoKSA+PSA0KSAm CisgICAgICAgIGVyciA9IC50cnVlLgorICAgICAgISRvbXAgZW5kIHRlYW1zCisgICAgICAh JG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDIKKworICAgICAgZXJyID0g LmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBlcnIp CisgICAgICBjYWxsIG9tcF9zZXRfbnVtX3RlYW1zICgzICsgaSkKKyAgICAgIGlmIChvbXBf Z2V0X21heF90ZWFtcyAoKSAvPSAzICsgaSkgZXJyID0gLnRydWUuCisgICAgICAhJG9tcCBl bmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDMKKworICAgICAgZXJyID0gLmZhbHNl LgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBlcnIpCisgICAg ICBpZiAob21wX2dldF9tYXhfdGVhbXMgKCkgLz0gMyArIGkpIGVyciA9IC50cnVlLgorICAg ICAgISRvbXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCA0CisKKyAgICAgIGVy ciA9IC5mYWxzZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTog ZXJyKQorICAgICAgISRvbXAgdGVhbXMKKyAgICAgIGlmIChvbXBfZ2V0X251bV90ZWFtcyAo KSA+IDMgKyBpIC5vci4gb21wX2dldF90ZWFtX251bSAoKSA+PSAzICsgaSkgJgorICAgICAg ICBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0ZWFtcworICAgICAgISRvbXAgZW5k IHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCA1CisgICAgZW5kIGlmCisKKyAgICAhIFRl c3RpbmcgVEVBTVMtVEhSRUFELUxJTUlUCisgICAgd3JpdGUgKCosKikgJ2Vudl9pc19zZXQg KCJPTVBfVEVBTVNfVEhSRUFEX0xJTUlUX0RFViIsICIzIik6ICcsIGVudl9pc19zZXQgKCJP TVBfVEVBTVNfVEhSRUFEX0xJTUlUX0RFViIsICIzIikKKyAgICBpZiAoZW52X2lzX3NldCAo Ik9NUF9URUFNU19USFJFQURfTElNSVRfREVWIiwgIjMiKSkgdGhlbgorICAgICAgZXJyID0g LmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBlcnIp CisgICAgICBpZiAob21wX2dldF90ZWFtc190aHJlYWRfbGltaXQgKCkgLz0gMykgZXJyID0g LnRydWUuCisgICAgICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDYK KworICAgICAgZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBt YXAodG9mcm9tOiBlcnIpCisgICAgICAhJG9tcCB0ZWFtcworICAgICAgISRvbXAgcGFyYWxs ZWwKKyAgICAgIGlmIChvbXBfZ2V0X3RocmVhZF9saW1pdCAoKSA+IDMgLm9yLiBvbXBfZ2V0 X3RocmVhZF9udW0gKCkgPj0gMykgJgorICAgICAgICBlcnIgPSAudHJ1ZS4KKyAgICAgICEk b21wIGVuZCBwYXJhbGxlbAorICAgICAgISRvbXAgZW5kIHRlYW1zCisgICAgICAhJG9tcCBl bmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDcKKworICAgICAgZXJyID0gLmZhbHNl LgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBlcnIpCisgICAg ICBjYWxsIG9tcF9zZXRfdGVhbXNfdGhyZWFkX2xpbWl0ICgyICsgaSkKKyAgICAgIGlmIChv bXBfZ2V0X3RlYW1zX3RocmVhZF9saW1pdCAoKSAvPSAyICsgaSkgZXJyID0gLnRydWUuCisg ICAgICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDgKKworICAgICAg ZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9t OiBlcnIpCisgICAgICBpZiAob21wX2dldF90ZWFtc190aHJlYWRfbGltaXQgKCkgLz0gMiAr IGkpIGVyciA9IC50cnVlLgorICAgICAgISRvbXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVy cikgc3RvcCA5CisKKyAgICAgIGVyciA9IC5mYWxzZS4KKyAgICAgICEkb21wIHRhcmdldCBk ZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJyKQorICAgICAgISRvbXAgdGVhbXMKKyAgICAgICEk b21wIHBhcmFsbGVsCisgICAgICBpZiAob21wX2dldF90aHJlYWRfbGltaXQgKCkgPiAyICsg aSAub3IuIG9tcF9nZXRfdGhyZWFkX251bSAoKSA+PSAyICsgaSkgJgorICAgICAgICBlcnIg PSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCBwYXJhbGxlbAorICAgICAgISRvbXAgZW5kIHRl YW1zCisgICAgICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDEwCisg ICAgZW5kIGlmCisKKyAgZW5kIGRvCisKK2NvbnRhaW5zCisgIGxvZ2ljYWwgZnVuY3Rpb24g ZW52X2lzX3NldCAobmFtZSwgdmFsKQorICAgIGNoYXJhY3RlcihsZW49KikgOjogbmFtZSwg dmFsCisgICAgY2hhcmFjdGVyKGxlbj00MCkgOjogdmFsMgorICAgIGludGVnZXIgOjogc3Rh dAorICAgIGNhbGwgZ2V0X2Vudmlyb25tZW50X3ZhcmlhYmxlIChuYW1lLCB2YWwyLCBzdGF0 dXM9c3RhdCkKKyAgICBpZiAoc3RhdCA9PSAwKSB0aGVuCisgICAgICBpZiAodmFsID09IHZh bDIpIHRoZW4KKyAgICAgICAgZW52X2lzX3NldCA9IC50cnVlLgorICAgICAgICByZXR1cm4K KyAgICAgIGVuZCBpZgorICAgIGVsc2UgaWYgKHN0YXQgLz0gMSkgdGhlbgorICAgICAgZXJy b3Igc3RvcCAxMAorICAgIGVuZGlmCisgICAgZW52X2lzX3NldCA9IC5mYWxzZS4KKyAgZW5k CitlbmQK --------------4P03w0g10v1hTY5q6jMOZP0p--