From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id B31993858C20 for ; Wed, 3 Aug 2022 12:40:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B31993858C20 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.93,214,1654588800"; d="diff'?scan'208";a="80725678" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 03 Aug 2022 04:40:21 -0800 IronPort-SDR: p1jnlE2O555k6HxhfJ8N38uFMjYgHrFYMRRD4B9mBqAavNXaIjSC1nJBN+wzvvX3hJ4HzNXe2G SD81n6C/Ngxm61bekTORN0mdBWoKB4eAvDlsZ/6/NIB/nHgUJEAniYtUdofp7OJ4gfUO4QDhhq o6pIYfJL8h01BFnsqu2dCN2QAW9Zci0Ny4Ovunb+D75wgc2MXSgQPMbqBsRo3Cqr+kCsrRKpTO +LAzQgi8evRSzptUXug6api3kfWEePkXbtJGEjbLAvY3X/tbMaUk6S12QpqWRf1C2ibTz5rbqb Fes= Content-Type: multipart/mixed; boundary="------------u8fS2iV3N3ySFeUtFWS0tttc" Message-ID: <94d20b62-d841-c4f0-f167-ed76a0b4dbfd@codesourcery.com> Date: Wed, 3 Aug 2022 14:40:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [Patch] OpenMP, libgomp, gimple: omp_get_max_teams, omp_set_num_teams, and omp_{gs}et_teams_thread_limit on offload devices To: Jakub Jelinek References: From: Marcel Vollweiler CC: In-Reply-To: X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Wed, 03 Aug 2022 12:40:41 -0000 --------------u8fS2iV3N3ySFeUtFWS0tttc Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable Hi Jakub, This patch was reduced a bit and most of your comments were considered in t= he last submission of the environment variable syntax extension patch (https://gcc.gnu.org/pipermail/gcc-patches/2022-August/599175.html). This p= atch also builds on that envvar patch version. The nteams-var related content was moved from this patch to the envvar patc= h as that is closely connected. However, additional testing and testing of copy = back device-specific nteams-var ICV values is still included in this patch toget= her with the teams-thread-limit-var content. >> --- a/gcc/gimplify.cc >> +++ b/gcc/gimplify.cc >> @@ -13994,7 +13994,7 @@ optimize_target_teams (tree target, gimple_seq *= pre_p) >> struct gimplify_omp_ctx *target_ctx =3D gimplify_omp_ctxp; >> >> if (teams =3D=3D NULL_TREE) >> - num_teams_upper =3D integer_one_node; >> + num_teams_upper =3D integer_minus_two_node; > > No, please don't introduce this, it is quite costly to have a GC trees > like integer_one_node, so they should stay for the most commonly used > numbers, -2 isn't like that. Just build_int_cst (integer_type_node, -2). integer_minus_two_node was replaced by "build_int_cst (integer_type_node, -= 2)". > >> --- a/gcc/tree-core.h >> +++ b/gcc/tree-core.h >> @@ -642,6 +642,7 @@ enum tree_index { >> TI_INTEGER_ONE, >> TI_INTEGER_THREE, >> TI_INTEGER_MINUS_ONE, >> + TI_INTEGER_MINUS_TWO, >> TI_NULL_POINTER, >> >> TI_SIZE_ZERO, >> diff --git a/gcc/tree.cc b/gcc/tree.cc >> index 8f83ea1..8cb474d 100644 >> --- a/gcc/tree.cc >> +++ b/gcc/tree.cc >> @@ -9345,6 +9345,7 @@ build_common_tree_nodes (bool signed_char) >> integer_one_node =3D build_int_cst (integer_type_node, 1); >> integer_three_node =3D build_int_cst (integer_type_node, 3); >> integer_minus_one_node =3D build_int_cst (integer_type_node, -1); >> + integer_minus_two_node =3D build_int_cst (integer_type_node, -2); >> >> size_zero_node =3D size_int (0); >> size_one_node =3D size_int (1); >> diff --git a/gcc/tree.h b/gcc/tree.h >> index cea49a5..1aeb009 100644 >> --- a/gcc/tree.h >> +++ b/gcc/tree.h >> @@ -4206,6 +4206,7 @@ tree_strip_any_location_wrapper (tree exp) >> #define integer_one_node global_trees[TI_INTEGER_ONE] >> #define integer_three_node global_trees[TI_INTEGER_THREE] >> #define integer_minus_one_node global_trees[TI_INTEGER_MIN= US_ONE] >> +#define integer_minus_two_node global_trees[TI_INTEGER_MIN= US_TWO] >> #define size_zero_node global_trees[TI_SIZE_ZERO] >> #define size_one_node global_trees[TI_SIZE_ONE] >> #define bitsize_zero_node global_trees[TI_BITSIZE_ZERO] > > And drop the above 3 hunks. Removed. > >> --- a/libgomp/config/gcn/icv-device.c >> +++ b/libgomp/config/gcn/icv-device.c >> @@ -37,6 +37,7 @@ volatile int GOMP_DEFAULT_DEVICE_VAR; >> volatile int GOMP_MAX_ACTIVE_LEVELS_VAR; >> volatile omp_proc_bind_t GOMP_BIND_VAR; >> volatile int GOMP_NTEAMS_VAR; >> +volatile int GOMP_TEAMS_THREAD_LIMIT_VAR; > > I really don't like this copying of individual ICVs one by one to the > device, copy a struct containing them and access fields in that struct. I recently changed this in https://gcc.gnu.org/pipermail/gcc-patches/2022-August/599175.html. So there= is one struct containing all ICVs that are copied from host to the device and = back. > >> --- a/libgomp/libgomp-plugin.h >> +++ b/libgomp/libgomp-plugin.h >> @@ -116,6 +116,7 @@ struct addr_pair >> #define GOMP_MAX_ACTIVE_LEVELS_VAR __gomp_max_active_levels >> #define GOMP_BIND_VAR __gomp_bind >> #define GOMP_NTEAMS_VAR __gomp_nteams >> +#define GOMP_TEAMS_THREAD_LIMIT_VAR __gomp_teams_thread_limit_var > > Likewise here. Those were all removed. > >> @@ -527,13 +538,19 @@ struct gomp_icv_list { >> >> extern void *gomp_get_icv_value_ptr (struct gomp_icv_list **list, >> int device_num); >> -extern struct gomp_icv_list *gomp_run_sched_var_dev_list; >> -extern struct gomp_icv_list *gomp_run_sched_chunk_size_dev_list; >> +extern struct gomp_icv_list* gomp_add_device_specific_icv (int dev_num, >> + size_t size, >> + struct gomp_icv= _list **list); >> +extern struct gomp_icv_list *gomp_initial_run_sched_var_dev_list; >> +extern struct gomp_icv_list *gomp_initial_run_sched_chunk_size_dev_list= ; >> +extern struct gomp_icv_list *gomp_initial_max_active_levels_var_dev_lis= t; >> +extern struct gomp_icv_list *gomp_initial_proc_bind_var_dev_list; >> +extern struct gomp_icv_list *gomp_initial_proc_bind_var_list_dev_list; >> +extern struct gomp_icv_list *gomp_initial_proc_bind_var_list_len_dev_li= st; >> +extern struct gomp_icv_list *gomp_initial_nteams_var_dev_list; >> + >> extern struct gomp_icv_list *gomp_nteams_var_dev_list; >> -extern struct gomp_icv_list *gomp_max_active_levels_var_dev_list; >> -extern struct gomp_icv_list *gomp_proc_bind_var_dev_list; >> -extern struct gomp_icv_list *gomp_proc_bind_var_list_dev_list; >> -extern struct gomp_icv_list *gomp_proc_bind_var_list_len_dev_list; >> +extern struct gomp_icv_list *gomp_teams_thread_limit_var_dev_list; > > Nor these per-var lists. For a specific device, walk the list with > all the vars in it, start with the most specific (matching dev number), > then just dev and then all and fill in from it what is going to be copied= . The above lists were removed and instead one list for device-specific ICV structs was introduced in the above mentioned patch. >> --- a/libgomp/plugin/plugin-gcn.c >> +++ b/libgomp/plugin/plugin-gcn.c >> @@ -572,7 +572,8 @@ static char *GOMP_ICV_STRINGS[] =3D >> XSTRING (GOMP_DYN_VAR), >> XSTRING (GOMP_MAX_ACTIVE_LEVELS_VAR), >> XSTRING (GOMP_BIND_VAR), >> - XSTRING (GOMP_NTEAMS_VAR) >> + XSTRING (GOMP_NTEAMS_VAR), >> + XSTRING (GOMP_TEAMS_THREAD_LIMIT_VAR) > > Then you don't need to e.g. track the names of the individual vars, just > one for the whole ICV block. That array was also removed. The patch was tested on x86_64-linux with nvptx and amdgcn offloading without regression. 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 --------------u8fS2iV3N3ySFeUtFWS0tttc 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 VGhpcyBwYXRjaCBhZGRzIHN1cHBvcnQgZm9yIG9tcF9nZXRfbWF4X3RlYW1zLCBvbXBfc2V0 X251bV90ZWFtcywgYW5kCm9tcF97Z3N9ZXRfdGVhbXNfdGhyZWFkX2xpbWl0IG9uIG9mZmxv YWQgZGV2aWNlcy4gVGhhdCBpbmNsdWRlcyB0aGUgdXNhZ2Ugb2YKZGV2aWNlLXNwZWNpZmlj IElDViB2YWx1ZXMgKHNwZWNpZmllZCBhcyBlbnZpcm9ubWVudCB2YXJpYWJsZXMgb3IgY2hh bmdlZCBvbiBhCmRldmljZSkuIEluIG9yZGVyIHRvIHJldXNlIGRldmljZS1zcGVjaWZpYyBJ Q1YgdmFsdWVzLCBhIGNvcHkgYmFjayBtZWNoYW5pc20gaXMKaW1wbGVtZW50ZWQgdGhhdCBj b3BpZXMgSUNWIHZhbHVlcyBiYWNrIGZyb20gZGV2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b25nZXIgcHJlc2VudCwKICAgIGFuZCBzZXZlcmFsIGFyZ3VtZW50cyBoYXZlIGJlZW4gYWRk ZWQ6CiAgICBGTEFHUyBpcyBhIGJpdG1hc2ssIHNlZSBHT01QX1RBUkdFVF9GTEFHXyogaW4g Z29tcC1jb25zdGFudHMuaC4KQEAgLTI3ODksNiArMjgyMywxNDIgQEAgR09NUF90YXJnZXRf ZXh0IChpbnQgZGV2aWNlLCB2b2lkICgqZm4pICh2b2lkICopLCBzaXplX3QgbWFwbnVtLAog ICBzaXplX3QgdGd0X2FsaWduID0gMCwgdGd0X3NpemUgPSAwOwogICBib29sIGZwY19kb25l ID0gZmFsc2U7CiAKKyAgLyogT2J0YWluIHRoZSBvcmlnaW5hbCBURUFNUyBhbmQgVEhSRUFE UyB2YWx1ZXMgZnJvbSBBUkdTLiAqLworICBpbnRwdHJfdCBvcmlnX3RlYW1zID0gMSwgb3Jp Z190aHJlYWRzID0gMDsKKyAgc2l6ZV90IG51bV9hcmdzID0gMCwgbGVuID0gMSwgdGVhbXNf bGVuID0gMSwgdGhyZWFkc19sZW4gPSAxOworICB2b2lkICoqdG1wYXJncyA9IGFyZ3M7Cisg IHdoaWxlICgqdG1wYXJncykKKyAgICB7CisgICAgICBpbnRwdHJfdCBpZCA9IChpbnRwdHJf dCkgKnRtcGFyZ3MrKywgdmFsOworICAgICAgaWYgKGlkICYgR09NUF9UQVJHRVRfQVJHX1NV QlNFUVVFTlRfUEFSQU0pCisJeworCSAgdmFsID0gKGludHB0cl90KSAqdG1wYXJncysrOwor CSAgbGVuID0gMjsKKwl9CisgICAgICBlbHNlCisJeworCSAgdmFsID0gaWQgPj4gR09NUF9U QVJHRVRfQVJHX1ZBTFVFX1NISUZUOworCSAgbGVuID0gMTsKKwl9CisgICAgICBudW1fYXJn cyArPSBsZW47CisgICAgICBpZiAoKGlkICYgR09NUF9UQVJHRVRfQVJHX0RFVklDRV9NQVNL KSAhPSBHT01QX1RBUkdFVF9BUkdfREVWSUNFX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gJiYgb3JpZ190aHJlYWRzICE9IG5ld190aHJlYWRzKSkKKwkgICAg eworCSAgICAgIHRtcGFyZ3MrKzsKKwkgICAgICBpZiAoaWQgJiBHT01QX1RBUkdFVF9BUkdf U1VCU0VRVUVOVF9QQVJBTSkKKwkJdG1wYXJncysrOworCSAgICB9CisJICBlbHNlCisJICAg IHsKKwkgICAgICAqdG1wX25ld19hcmdzKysgPSAqdG1wYXJncysrOworCSAgICAgIGlmIChp ZCAmIEdPTVBfVEFSR0VUX0FSR19TVUJTRVFVRU5UX1BBUkFNKQorCQkqdG1wX25ld19hcmdz KysgPSAqdG1wYXJncysrOworCSAgICB9CisJfQorCisgICAgICBpZiAob3JpZ190ZWFtcyAh PSBuZXdfdGVhbXMpCisJeworCSAgaW50cHRyX3QgbmV3X3ZhbCA9IG5ld190ZWFtczsKKwkg IGlmICh0bXNfbGVuID09IDEpCisJICAgIHsKKwkgICAgICBuZXdfdmFsID0gKG5ld192YWwg PDwgR09NUF9UQVJHRVRfQVJHX1ZBTFVFX1NISUZUKQorCQkJIHwgR09NUF9UQVJHRVRfQVJH X05VTV9URUFNUzsKKwkgICAgICAqdG1wX25ld19hcmdzKysgPSAodm9pZCAqKSBuZXdfdmFs OworCSAgICB9CisJICBlbHNlCisJICAgIHsKKwkgICAgICAqdG1wX25ld19hcmdzKysgPSAo dm9pZCAqKSAoR09NUF9UQVJHRVRfQVJHX1NVQlNFUVVFTlRfUEFSQU0KKwkJCQkJICB8IEdP TVBfVEFSR0VUX0FSR19OVU1fVEVBTVMpOworCSAgICAgICp0bXBfbmV3X2FyZ3MrKyA9ICh2 b2lkICopIG5ld192YWw7CisJICAgIH0KKwl9CisKKyAgICAgIGlmIChvcmlnX3RocmVhZHMg IT0gbmV3X3RocmVhZHMpCisJeworCSAgaW50cHRyX3QgbmV3X3ZhbCA9IG5ld190aHJlYWRz OworCSAgaWYgKHRoc19sZW4gPT0gMSkKKwkgICAgeworCSAgICAgIG5ld192YWwgPSAobmV3 X3Z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21wX2dldF90ZWFtX251bSAoKSA+PSA1KQorICAgIGFib3J0ICgpOworICAgICNw cmFnbWEgb21wIHBhcmFsbGVsCisgICAgaWYgKG9tcF9nZXRfdGhyZWFkX2xpbWl0ICgpID4g NAorCXx8IG9tcF9nZXRfdGhyZWFkX251bSAoKSA+PSA0KQorICAgICAgYWJvcnQgKCk7Cisg IH0KKwogICBpbnQgbnVtX2RldmljZXMgPSBvbXBfZ2V0X251bV9kZXZpY2VzICgpID4gMyA/ IDMgOiBvbXBfZ2V0X251bV9kZXZpY2VzICgpOworICBpZiAobnVtX2RldmljZXMgPD0gMCkK KyAgICByZXR1cm4gMDsKKwogICBmb3IgKGludCBpPTA7IGkgPCBudW1fZGV2aWNlczsgaSsr KQotICAgICNwcmFnbWEgb21wIHRhcmdldCBkZXZpY2UgKGkpCi0gICAgICBpZiAob21wX2dl dF9tYXhfdGVhbXMgKCkgIT0gNDIgKyBpKQorICAgIHsKKyAgICAgICNwcmFnbWEgb21wIHRh cmdldCBkZXZpY2UgKGkpCisgICAgICBpZiAob21wX2dldF9tYXhfdGVhbXMgKCkgIT0gNiAr IGkKKwkgIHx8IG9tcF9nZXRfdGVhbXNfdGhyZWFkX2xpbWl0ICgpICE9IDUgKyBpKQogCWFi b3J0ICgpOworICAgICAgI3ByYWdtYSBvbXAgdGFyZ2V0IGRldmljZSAoaSkKKyAgICAgICNw cmFnbWEgb21wIHRlYW1zCisJI3ByYWdtYSBvbXAgcGFyYWxsZWwKKwlpZiAob21wX2dldF90 aHJlYWRfbGltaXQgKCkgPiA1ICsgaQorCSAgICB8fCBvbXBfZ2V0X3RocmVhZF9udW0gKCkg Pj0gNSArIGkpCisJICBhYm9ydCAoKTsKKworICAgICAgI3ByYWdtYSBvbXAgdGFyZ2V0IGRl dmljZSAoaSkKKyAgICAgIHsKKwlvbXBfc2V0X251bV90ZWFtcyAoNSArIGkpOworCW9tcF9z ZXRfdGVhbXNfdGhyZWFkX2xpbWl0ICg0ICsgaSk7CisJaWY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3RlYW1z KDYgKyBpKSB0aHJlYWRfbGltaXQoNSArIGkpCisgICAgICB7CisJaWYgKG9tcF9nZXRfbnVt X3RlYW1zICgpID4gNiArIGkKKwkgICAgfHwgb21wX2dldF90ZWFtX251bSAoKSA+PSA2ICsg aSkKKwkgIGFib3J0ICgpOworCSNwcmFnbWEgb21wIHBhcmFsbGVsCisJICBpZiAob21wX2dl dF90aHJlYWRfbGltaXQgKCkgPiA1ICsgaQorCSAgICAgIHx8IG9tcF9nZXRfdGhyZWFkX251 bSAoKSA+PSA1ICsgaQorCSAgICAgIHx8IG9tcF9nZXRfbnVtX3RlYW1zICgpID4gNiArIGkK KwkgICAgICB8fCBvbXBfZ2V0X3RlYW1fbnVtICgpID49IDYgKyBpKQorCSAgICBhYm9ydCAo KTsKKyAgICAgIH0KKworICAgICAgI3ByYWdtYSBvbXAgdGFyZ2V0IGRldmljZSAoaSkKKyAg ICAgICNwcmFnbWEgb21wIHRlYW1zIG51bV90ZWFtcyg0ICsgaSkgdGhyZWFkX2xpbWl0KDMg KyBpKQorICAgICAgeworCWlmIChvbXBfZ2V0X251bV90ZWFtcyAoKSA+IDQgKyBpCisJICAg IHx8IG9tcF9nZXRfdGVhbV9udW0gKCkgPj0gNCArIGkpCisJICBhYm9ydCAoKTsKKwkjcHJh Z21hIG9tcCBwYXJhbGxlbAorCSAgaWYgKG9tcF9nZXRfdGhyZWFkX2xpbWl0ICgpID4gMyAr IGkKKwkgICAgICB8fCBvbXBfZ2V0X3RocmVhZF9udW0gKCkgPj0gMyArIGkKKwkgICAgICB8 fCBvbXBfZ2V0X251bV90ZWFtcyAoKSA+IDQgKyBpCisJICAgICAgfHwgb21wX2dldF90ZWFt X251bSAoKSA+PSA0ICsgaSkKKwkgICAgYWJvcnQgKCk7CisgICAgICB9CisKKyAgICAgICNw cmFnbWEgb21wIHRhcmdldCBkZXZpY2UgKGkpCisgICAgICAjcHJhZ21hIG9tcCB0ZWFtcyB0 aHJlYWRfbGltaXQoMyArIGkp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dGVhbXMgKCkgIT0gNworICAgICAgfHwgb21wX2dldF90ZWFtc190aHJlYWRfbGlt aXQgKCkgIT0gMikKKyAgICBhYm9ydCAoKTsKKworICAjcHJhZ21hIG9tcCB0ZWFtcworICBp ZiAob21wX2dldF9udW1fdGVhbXMgKCkgPiA3CisgICAgICB8fCBvbXBfZ2V0X3RlYW1fbnVt ICgpID49IDcpCisgICAgYWJvcnQgKCk7CisKKyAgb21wX3NldF9udW1fdGVhbXMgKDkpOwor ICBvbXBfc2V0X3RlYW1zX3RocmVhZF9saW1pdCAoMyk7CisgIGlmIChvbXBfZ2V0X21heF90 ZWFtcyAoKSAhPSA5CisgICAgICB8fCBvbXBfZ2V0X3RlYW1zX3RocmVhZF9saW1pdCAoKSAh PSAzKQorICAgIGFib3J0ICgpOworCisgICNwcmFnbWEgb21wIHRlYW1zCisgIGlmIChvbXBf Z2V0X251bV90ZWFtcyAoKSA+IDkKKyAgICAgIHx8IG9tcF9nZXRfdGVhbV9udW0gKCkgPj0g OSkKKyAgICBhYm9ydCAoKTsKKworICAjcHJhZ21hIG9tcCB0ZWFtcyBudW1fdGVhbXMoNSkK KyAgaWYgKG9tcF9nZXRfbnVtX3RlYW1zICgpID4gNQorICAgICAgfHwgb21wX2dldF90ZWFt X251bSAoKSA+PSA1KQogICAgIGFib3J0ICgpOwogCiAgIGludCBudW1fZGV2aWNlcyA9IG9t cF9nZXRfbnVtX2RldmljZXMgKCkgPiAzID8gMyA6IG9tcF9nZXRfbnVtX2RldmljZXMgKCk7 CiAgIGZvciAoaW50IGk9MDsgaSA8IG51bV9kZXZpY2VzOyBpKyspCi0gICAgI3ByYWdtYSBv bXAgdGFyZ2V0IGRldmljZSAoaSkKLSAgICAgIGlmIChvbXBfZ2V0X21heF90ZWFtcyAoKSAh PSA0MikKKyAgICB7CisgICAgICAjcHJhZ21hIG9tcCB0YXJnZXQgZGV2aWNlIChpKQorICAg ICAgaWYgKG9tcF9nZXRfbWF4X3RlYW1zICgpICE9IDcKKwkgIHx8IG9tcF9nZXRfdGVhbXNf dGhyZWFkX2xpbWl0ICgpICE9IDIpCisJYWJvcnQgKCk7CisKKyAgICAgICNwcmFnbWEgb21w IHRhcmdldCBkZXZpY2UgKGkpCisgICAgICAjcHJhZ21hIG9tcCB0ZWFtcworICAgICAgaWYg KG9tcF9nZXRfbnVtX3RlYW1zICgpID4gNworCSAgfHwgb21wX2dldF90ZWFtX251bSAoKSA+ PSA3KQorCWFib3J0ICgpOworCisgICAgICAjcHJhZ21hIG9tcCB0YXJnZXQgZGV2aWNlIChp KQorICAgICAgeworCW9tcF9zZXRfbnVtX3RlYW1zICg4ICsgaSk7CisJb21wX3NldF90ZWFt c190aHJlYWRfbGltaXQgKDQgKyBpKTsKKwlpZiAob21wX2dldF9tYXhfdGVhbXMgKCkgIT0g OCArIGkKKwkgICAgfHwgb21wX2dldF90ZWFtc190aHJlYWRfbGltaXQgKCkgIT0gNCArIGkp CisJICBhYm9ydCAoKTsKKyAgICAgIH0KKworICAgICAvKiBvbXBfc2V0X251bV90ZWFtcyBh Ym92ZSBzZXQgdGhlIHZhbHVlIG9mIG50ZWFtcy12YXIgSUNWIG9uIGRldmljZSAnaScsCisJ IHdoaWNoIGhhcyBzY29wZSAnZGV2aWNlJyBhbmQgc2hvdWxkIGJlIGF2YWlibGUgaW4gc3Vi c2VxdWVudCB0YXJnZXQKKwkgcmVnaW9ucy4gICovCisgICAgICAjcHJhZ21hIG9tcCB0YXJn ZXQgZGV2aWNlIChpKQorICAgICAgaWYgKG9tcF9nZXRfbWF4X3RlYW1zICgpICE9IDggKyBp CisJICB8fCBvbXBfZ2V0X3RlYW1zX3RocmVhZF9saW1pdCAoKSAhPSA0ICsgaSkKKwlhYm9y dCAoKTsKKworICAgICAgI3ByYWdtYSBvbXAgdGFyZ2V0IGRldmljZSAoaSkKKyAgICAgICNw cmFnbWEgb21wIHRlYW1zCisgICAgICBpZiAob21wX2dldF9udW1fdGVhbXMgKCkgPiA4ICsg aQorCSAgfHwg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pICE9IDkKKyAgICAgIHx8IG9tcF9nZXRfdGVhbXNfdGhyZWFkX2xpbWl0 ICgpICE9IDIpCisgICAgYWJvcnQgKCk7CisKKyAgI3ByYWdtYSBvbXAgdGVhbXMKKyAgaWYg KG9tcF9nZXRfbnVtX3RlYW1zICgpID4gOQorICAgICAgfHwgb21wX2dldF90ZWFtX251bSAo KSA+PSA5KQorICAgIGFib3J0ICgpOworCisgICNwcmFnbWEgb21wIHRlYW1zIG51bV90ZWFt cyg1KQorICBpZiAob21wX2dldF9udW1fdGVhbXMgKCkgPiA1CisgICAgICB8fCBvbXBfZ2V0 X3RlYW1fbnVtICgpID49IDUpCisgICAgYWJvcnQgKCk7CisKKyAgaW50IG51bV9kZXZpY2Vz ID0gb21wX2dldF9udW1fZGV2aWNlcyAoKSA+IDMgPyAzIDogb21wX2dldF9udW1fZGV2aWNl cyAoKTsKKyAgZm9yIChpbnQgaT0wOyBpIDwgbnVtX2RldmljZXM7IGkrKykKKyAgICB7Cisg ICAgICAjcHJhZ21hIG9tcCB0YXJnZXQgZGV2aWNlIChpKQorICAgICAgaWYgKG9tcF9nZXRf bWF4X3RlYW1zICgpICE9IDAKKwkgIHx8IG9tcF9nZXRfdGVhbXNfdGhyZWFkX2xpbWl0ICgp ICE9IDApCisJYWJvcnQgKCk7CisKKyAgICAgICNwcmFnbWEgb21wIHRhcmdldCBkZXZpY2Ug KGkpCisgICAgICB7CisJb21wX3NldF9udW1fdGVhbXMgKDggKyBpKTsKKwlvbXBfc2V0X3Rl YW1zX3RocmVhZF9saW1pdCAoMyArIGkpOworCWlmIChvbXBfZ2V0X21heF90ZWFtcyAoKSAh PSA4ICsgaQorCSAgICB8fCBvbXBfZ2V0X3RlYW1zX3RocmVhZF9saW1pdCAoKSAhPSAzICsg aSkKKwkgIGFib3J0ICgpOworICAgICAgfQorCisgICAgIC8qIG9tcF9zZXRfbnVtX3RlYW1z IGFib3ZlIHNldCB0aGUgdmFsdWUgb2YgbnRlYW1zLXZhciBJQ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pbWl0CisgIGxvZ2ljYWwgOjogZXJyCisKKyAgaWYgKG9tcF9nZXRfbnVtX2Rl dmljZXMgKCkgPiAzKSB0aGVuCisgICAgbnVtX2RldmljZXMgPSAzCisgIGVsc2UKKyAgICBu dW1fZGV2aWNlcyA9IG9tcF9nZXRfbnVtX2RldmljZXMgKCkKKyAgZW5kIGlmCisKKyAgZG8g aT0wLG51bV9kZXZpY2VzLTEKKworICAgICEgVGVzdGluZyBOVU1fVEVBTVMuCisgICAgaWYg KGVudl9pc19zZXRfZGV2ICgiT01QX05VTV9URUFNU19ERVZfIiwgaSwgNiArIGkpKSB0aGVu CisgICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9tcCB0YXJnZXQgZGV2aWNlKGkpIG1h cCh0b2Zyb206IGVycikKKyAgICAgIGlmIChvbXBfZ2V0X21heF90ZWFtcyAoKSAvPSA2ICsg aSkgZXJyID0gLnRydWUuCisgICAgICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJy KSBzdG9wIDEKKworICAgICAgZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRl dmljZShpKSBtYXAodG9mcm9tOiBlcnIpCisgICAgICAhJG9tcCB0ZWFtcworICAgICAgaWYg KG9tcF9nZXRfbnVtX3RlYW1zICgpID4gNiArIGkgLm9yLiBvbXBfZ2V0X3RlYW1fbnVtICgp ID49IDYgKyBpKSAmCisgICAgICAgIGVyciA9IC50cnVlLgorICAgICAgISRvbXAgZW5kIHRl YW1zCisgICAgICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDIKKwor ICAgICAgZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAo dG9mcm9tOiBlcnIpCisgICAgICBjYWxsIG9tcF9zZXRfbnVtX3RlYW1zICg1ICsgaSkKKyAg ICAgIGlmIChvbXBfZ2V0X21heF90ZWFtcyAoKSAvPSA1ICsgaSkgZXJyID0gLnRydWUuCisg ICAgICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDMKKworICAgICAg ZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9t OiBlcnIpCisgICAgICBpZiAob21wX2dldF9tYXhfdGVhbXMgKCkgLz0gNSArIGkpIGVyciA9 IC50cnVlLgorICAgICAgISRvbXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCA0 CisKKyAgICAgIGVyciA9IC5mYWxzZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkg bWFwKHRvZnJvbTogZXJyKQorICAgICAgISRvbXAgdGVhbXMKKyAgICAgIGlmIChvbXBfZ2V0 X251bV90ZWFtcyAoKSA+IDUgKyBpIC5vci4gb21wX2dldF90ZWFtX251bSAoKSA+PSA1ICsg aSkgJgorICAgICAgICBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0ZWFtcworICAg ICAgISRvbXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCA1CisKKyAgICAgIGVy ciA9IC5mYWxzZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTog ZXJyKQorICAgICAgISRvbXAgdGVhbXMgbnVtX3RlYW1zKDYgKyBpKQorICAgICAgaWYgKG9t cF9nZXRfbnVtX3RlYW1zICgpID4gNiArIGkgLm9yLiBvbXBfZ2V0X3RlYW1fbnVtICgpID49 IDYgKyBpKSAmCisgICAgICAgIGVyciA9IC50cnVlLgorICAgICAgISRvbXAgZW5kIHRlYW1z CisgICAgICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDYKKworICAg ICAgZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9m cm9tOiBlcnIpCisgICAgICAhJG9tcCB0ZWFtcyBudW1fdGVhbXMoNCArIGkpCisgICAgICBp ZiAob21wX2dldF9udW1fdGVhbXMgKCkgPiA0ICsgaSAub3IuIG9tcF9nZXRfdGVhbV9udW0g KCkgPj0gNCArIGkpICYKKyAgICAgICAgZXJyID0gLnRydWUuCisgICAgICAhJG9tcCBlbmQg dGVhbXMKKyAgICAgICEkb21wIGVuZCB0YXJnZXQKKyAgICAgIGlmIChlcnIpIHN0b3AgNwor CisgICAgICBsYXJnZV9udW1fdGVhbXMgPSA2NjAwMAorICAgICAgZXJyID0gLmZhbHNlLgor ICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBlcnIpCisgICAgICBj YWxsIG9tcF9zZXRfbnVtX3RlYW1zIChsYXJnZV9udW1fdGVhbXMgKyBpKQorICAgICAgaWYg KG9tcF9nZXRfbWF4X3RlYW1zICgpIC89IGxhcmdlX251bV90ZWFtcyArIGkpIGVyciA9IC50 cnVlLgorICAgICAgISRvbXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCA4CisK KyAgICAgIGVyciA9IC5mYWxzZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFw KHRvZnJvbTogZXJyKQorICAgICAgaWYgKG9tcF9nZXRfbWF4X3RlYW1zICgpIC89IGxhcmdl X251bV90ZWFtcyArIGkpIGVyciA9IC50cnVlLgorICAgICAgISRvbXAgZW5kIHRhcmdldAor ICAgICAgaWYgKGVycikgc3RvcCA5CisKKyAgICAgIGVyciA9IC5mYWxzZS4KKyAgICAgICEk b21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJyKQorICAgICAgISRvbXAgdGVh bXMKKyAgICAgIGlmIChvbXBfZ2V0X251bV90ZWFtcyAoKSA+IGxhcmdlX251bV90ZWFtcyAr IGkgJgorICAgICAgICAgIC5vci4gb21wX2dldF90ZWFtX251bSAoKSA+PSBsYXJnZV9udW1f dGVhbXMgKyBpKSBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0ZWFtcworICAgICAg ISRvbXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCAxMAorICAgIGVuZCBpZgor CisgICAgISBUZXN0aW5nIFRFQU1TLVRIUkVBRC1MSU1JVAorICAgIGlmIChlbnZfaXNfc2V0 X2RldiAoIk9NUF9URUFNU19USFJFQURfTElNSVRfREVWXyIsIGksIDUgKyBpKSkgdGhlbgor ICAgICAgZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAo dG9mcm9tOiBlcnIpCisgICAgICBpZiAob21wX2dldF90ZWFtc190aHJlYWRfbGltaXQgKCkg Lz0gNSArIGkpIGVyciA9IC50cnVlLgorICAgICAgISRvbXAgZW5kIHRhcmdldAorICAgICAg aWYgKGVycikgc3RvcCAxMQorCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9tcCB0 YXJnZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgICEkb21wIHRlYW1zCisg ICAgICAhJG9tcCBwYXJhbGxlbAorICAgICAgaWYgKG9tcF9nZXRfdGhyZWFkX2xpbWl0ICgp ID4gNSArIGkgLm9yLiBvbXBfZ2V0X3RocmVhZF9udW0gKCkgPj0gNSArIGkpICYKKyAgICAg ICAgZXJyID0gLnRydWUuCisgICAgICAhJG9tcCBlbmQgcGFyYWxsZWwKKyAgICAgICEkb21w IGVuZCB0ZWFtcworICAgICAgISRvbXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3Rv cCAxMgorCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9tcCB0YXJnZXQgZGV2aWNl KGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgIGNhbGwgb21wX3NldF90ZWFtc190aHJlYWRf bGltaXQgKDQgKyBpKQorICAgICAgaWYgKG9tcF9nZXRfdGVhbXNfdGhyZWFkX2xpbWl0ICgp IC89IDQgKyBpKSBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0YXJnZXQKKyAgICAg IGlmIChlcnIpIHN0b3AgMTMKKworICAgICAgZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAg dGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBlcnIpCisgICAgICBpZiAob21wX2dldF90 ZWFtc190aHJlYWRfbGltaXQgKCkgLz0gNCArIGkpIGVyciA9IC50cnVlLgorICAgICAgISRv bXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCAxNAorCisgICAgICBlcnIgPSAu ZmFsc2UuCisgICAgICAhJG9tcCB0YXJnZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikK KyAgICAgICEkb21wIHRlYW1zCisgICAgICAhJG9tcCBwYXJhbGxlbAorICAgICAgaWYgKG9t cF9nZXRfdGhyZWFkX2xpbWl0ICgpID4gNCArIGkgLm9yLiBvbXBfZ2V0X3RocmVhZF9udW0g KCkgPj0gNCArIGkpICYKKyAgICAgICAgZXJyID0gLnRydWUuCisgICAgICAhJG9tcCBlbmQg cGFyYWxsZWwKKyAgICAgICEkb21wIGVuZCB0ZWFtcworICAgICAgISRvbXAgZW5kIHRhcmdl dAorICAgICAgaWYgKGVycikgc3RvcCAxNQorCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAg ICAhJG9tcCB0YXJnZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgICEkb21w IHRlYW1zIHRocmVhZF9saW1pdCg1ICsgaSkKKyAgICAgICEkb21wIHBhcmFsbGVsCisgICAg ICBpZiAob21wX2dldF90aHJlYWRfbGltaXQgKCkgPiA1ICsgaSAub3IuIG9tcF9nZXRfdGhy ZWFkX251bSAoKSA+PSA1ICsgaSkgJgorICAgICAgICBlcnIgPSAudHJ1ZS4KKyAgICAgICEk b21wIGVuZCBwYXJhbGxlbAorICAgICAgISRvbXAgZW5kIHRlYW1zCisgICAgICAhJG9tcCBl bmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDE2CisKKyAgICAgIGVyciA9IC5mYWxz ZS4KKyAgICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJyKQorICAg ICAgISRvbXAgdGVhbXMgdGhyZWFkX2xpbWl0KDMgKyBpKQorICAgICAgISRvbXAgcGFyYWxs ZWwKKyAgICAgIGlmIChvbXBfZ2V0X3RocmVhZF9saW1pdCAoKSA+IDMgKyBpIC5vci4gb21w X2dldF90aHJlYWRfbnVtICgpID49IDMgKyBpKSAmCisgICAgICAgIGVyciA9IC50cnVlLgor ICAgICAgISRvbXAgZW5kIHBhcmFsbGVsCisgICAgICAhJG9tcCBlbmQgdGVhbXMKKyAgICAg ICEkb21wIGVuZCB0YXJnZXQKKyAgICAgIGlmIChlcnIpIHN0b3AgMTcKKworICAgICAgbGFy Z2VfdGhyZWFkc19saW1pdCA9IDY3MDAwCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAh JG9tcCB0YXJnZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgIGNhbGwgb21w X3NldF90ZWFtc190aHJlYWRfbGltaXQgKGxhcmdlX3RocmVhZHNfbGltaXQgKyBpKQorICAg ICAgaWYgKG9tcF9nZXRfdGVhbXNfdGhyZWFkX2xpbWl0ICgpIC89IGxhcmdlX3RocmVhZHNf bGltaXQgKyBpKSBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0YXJnZXQKKyAgICAg IGlmIChlcnIpIHN0b3AgMTgKKworICAgICAgZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAg dGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBlcnIpCisgICAgICBpZiAob21wX2dldF90 ZWFtc190aHJlYWRfbGltaXQgKCkgLz0gbGFyZ2VfdGhyZWFkc19saW1pdCArIGkpIGVyciA9 IC50cnVlLgorICAgICAgISRvbXAgZW5kIHRhcmdldAorICAgICAgaWYgKGVycikgc3RvcCAx OQorCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9tcCB0YXJnZXQgZGV2aWNlKGkp IG1hcCh0b2Zyb206IGVycikKKyAgICAgICEkb21wIHRlYW1zCisgICAgICAhJG9tcCBwYXJh bGxlbAorICAgICAgaWYgKG9tcF9nZXRfdGhyZWFkX2xpbWl0ICgpID4gbGFyZ2VfdGhyZWFk c19saW1pdCArIGkgJgorICAgICAgICAgIC5vci4gb21wX2dldF90aHJlYWRfbnVtICgpID49 IGxhcmdlX3RocmVhZHNfbGltaXQgKyBpKSBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVu ZCBwYXJhbGxlbAorICAgICAgISRvbXAgZW5kIHRlYW1zCisgICAgICAhJG9tcCBlbmQgdGFy Z2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDIwCisgICAgZW5kIGlmCisKKyAgZW5kIGRvCisK K2NvbnRhaW5zCisgIGxvZ2ljYWwgZnVuY3Rpb24gZW52X2lzX3NldCAobmFtZSwgdmFsKQor ICAgIGNoYXJhY3RlcihsZW49KikgOjogbmFtZSwgdmFsCisgICAgY2hhcmFjdGVyKGxlbj00 MCkgOjogdmFsMgorICAgIGludGVnZXIgOjogc3RhdAorICAgIGNhbGwgZ2V0X2Vudmlyb25t ZW50X3ZhcmlhYmxlIChuYW1lLCB2YWwyLCBzdGF0dXM9c3RhdCkKKyAgICBpZiAoc3RhdCA9 PSAwKSB0aGVuCisgICAgICBpZiAodmFsID09IHZhbDIpIHRoZW4KKyAgICAgICAgZW52X2lz X3NldCA9IC50cnVlLgorICAgICAgICByZXR1cm4KKyAgICAgIGVuZCBpZgorICAgIGVsc2Ug aWYgKHN0YXQgLz0gMSkgdGhlbgorICAgICAgZXJyb3Igc3RvcCAzMAorICAgIGVuZGlmCisg ICAgZW52X2lzX3NldCA9IC5mYWxzZS4KKyAgZW5kCisgIGxvZ2ljYWwgZnVuY3Rpb24gZW52 X2lzX3NldF9kZX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1TX1RIUkVBRF9MSU1JVF9ERVZfMSIsIHZhbCwgc3RhdHVzPXN0 YXQpCisgIGlmIChzdGF0IC89IDEpIHJldHVybgorICBjYWxsIGdldF9lbnZpcm9ubWVudF92 YXJpYWJsZSAoIk9NUF9URUFNU19USFJFQURfTElNSVRfREVWXzIiLCB2YWwsIHN0YXR1cz1z dGF0KQorICBpZiAoc3RhdCAvPSAxKSByZXR1cm4KKworICBpZiAob21wX2dldF9udW1fZGV2 aWNlcyAoKSA+IDMpIHRoZW4KKyAgICBudW1fZGV2aWNlcyA9IDMKKyAgZWxzZQorICAgIG51 bV9kZXZpY2VzID0gb21wX2dldF9udW1fZGV2aWNlcyAoKQorICBlbmQgaWYKKworICBkbyBp PTAsbnVtX2RldmljZXMtMQorCisgICAgISBUZXN0aW5nIE5VTV9URUFNUy4KKyAgICBpZiAo ZW52X2lzX3NldCAoIk9NUF9OVU1fVEVBTVNfREVWIiwgIjQiKSkgdGhlbgorICAgICAgZXJy ID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9tOiBl cnIpCisgICAgICBpZiAob21wX2dldF9tYXhfdGVhbXMgKCkgLz0gNCkgZXJyID0gLnRydWUu CisgICAgICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDEKKworICAg ICAgZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9m cm9tOiBlcnIpCisgICAgICAhJG9tcCB0ZWFtcworICAgICAgaWYgKG9tcF9nZXRfbnVtX3Rl YW1zICgpID4gNCAub3IuIG9tcF9nZXRfdGVhbV9udW0gKCkgPj0gNCkgJgorICAgICAgICBl cnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0ZWFtcworICAgICAgISRvbXAgZW5kIHRh cmdldAorICAgICAgaWYgKGVycikgc3RvcCAyCisKKyAgICAgIGVyciA9IC5mYWxzZS4KKyAg ICAgICEkb21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJyKQorICAgICAgY2Fs bCBvbXBfc2V0X251bV90ZWFtcyAoMyArIGkpCisgICAgICBpZiAob21wX2dldF9tYXhfdGVh bXMgKCkgLz0gMyArIGkpIGVyciA9IC50cnVlLgorICAgICAgISRvbXAgZW5kIHRhcmdldAor ICAgICAgaWYgKGVycikgc3RvcCAzCisKKyAgICAgIGVyciA9IC5mYWxzZS4KKyAgICAgICEk b21wIHRhcmdldCBkZXZpY2UoaSkgbWFwKHRvZnJvbTogZXJyKQorICAgICAgaWYgKG9tcF9n ZXRfbWF4X3RlYW1zICgpIC89IDMgKyBpKSBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVu ZCB0YXJnZXQKKyAgICAgIGlmIChlcnIpIHN0b3AgNAorCisgICAgICBlcnIgPSAuZmFsc2Uu CisgICAgICAhJG9tcCB0YXJnZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAg ICEkb21wIHRlYW1zCisgICAgICBpZiAob21wX2dldF9udW1fdGVhbXMgKCkgPiAzICsgaSAu b3IuIG9tcF9nZXRfdGVhbV9udW0gKCkgPj0gMyArIGkpICYKKyAgICAgICAgZXJyID0gLnRy dWUuCisgICAgICAhJG9tcCBlbmQgdGVhbXMKKyAgICAgICEkb21wIGVuZCB0YXJnZXQKKyAg ICAgIGlmIChlcnIpIHN0b3AgNQorICAgIGVuZCBpZgorCisgICAgISBUZXN0aW5nIFRFQU1T LVRIUkVBRC1MSU1JVAorICAgIGlmIChlbnZfaXNfc2V0ICgiT01QX1RFQU1TX1RIUkVBRF9M SU1JVF9ERVYiLCAiMyIpKSB0aGVuCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9t cCB0YXJnZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgIGlmIChvbXBfZ2V0 X3RlYW1zX3RocmVhZF9saW1pdCAoKSAvPSAzKSBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21w IGVuZCB0YXJnZXQKKyAgICAgIGlmIChlcnIpIHN0b3AgNgorCisgICAgICBlcnIgPSAuZmFs c2UuCisgICAgICAhJG9tcCB0YXJnZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAg ICAgICEkb21wIHRlYW1zCisgICAgICAhJG9tcCBwYXJhbGxlbAorICAgICAgaWYgKG9tcF9n ZXRfdGhyZWFkX2xpbWl0ICgpID4gMyAub3IuIG9tcF9nZXRfdGhyZWFkX251bSAoKSA+PSAz KSAmCisgICAgICAgIGVyciA9IC50cnVlLgorICAgICAgISRvbXAgZW5kIHBhcmFsbGVsCisg ICAgICAhJG9tcCBlbmQgdGVhbXMKKyAgICAgICEkb21wIGVuZCB0YXJnZXQKKyAgICAgIGlm IChlcnIpIHN0b3AgNworCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAgICAhJG9tcCB0YXJn ZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgIGNhbGwgb21wX3NldF90ZWFt c190aHJlYWRfbGltaXQgKDIgKyBpKQorICAgICAgaWYgKG9tcF9nZXRfdGVhbXNfdGhyZWFk X2xpbWl0ICgpIC89IDIgKyBpKSBlcnIgPSAudHJ1ZS4KKyAgICAgICEkb21wIGVuZCB0YXJn ZXQKKyAgICAgIGlmIChlcnIpIHN0b3AgOAorCisgICAgICBlcnIgPSAuZmFsc2UuCisgICAg ICAhJG9tcCB0YXJnZXQgZGV2aWNlKGkpIG1hcCh0b2Zyb206IGVycikKKyAgICAgIGlmIChv bXBfZ2V0X3RlYW1zX3RocmVhZF9saW1pdCAoKSAvPSAyICsgaSkgZXJyID0gLnRydWUuCisg ICAgICAhJG9tcCBlbmQgdGFyZ2V0CisgICAgICBpZiAoZXJyKSBzdG9wIDkKKworICAgICAg ZXJyID0gLmZhbHNlLgorICAgICAgISRvbXAgdGFyZ2V0IGRldmljZShpKSBtYXAodG9mcm9t OiBlcnIpCisgICAgICAhJG9tcCB0ZWFtcworICAgICAgISRvbXAgcGFyYWxsZWwKKyAgICAg IGlmIChvbXBfZ2V0X3RocmVhZF9saW1pdCAoKSA+IDIgKyBpIC5vci4gb21wX2dldF90aHJl YWRfbnVtICgpID49IDIgKyBpKSAmCisgICAgICAgIGVyciA9IC50cnVlLgorICAgICAgISRv bXAgZW5kIHBhcmFsbGVsCisgICAgICAhJG9tcCBlbmQgdGVhbXMKKyAgICAgICEkb21wIGVu ZCB0YXJnZXQKKyAgICAgIGlmIChlcnIpIHN0b3AgMTAKKyAgICBlbmQgaWYKKworICBlbmQg ZG8KKworY29udGFpbnMKKyAgbG9naWNhbCBmdW5jdGlvbiBlbnZfaXNfc2V0IChuYW1lLCB2 YWwpCisgICAgY2hhcmFjdGVyKGxlbj0qKSA6OiBuYW1lLCB2YWwKKyAgICBjaGFyYWN0ZXIo bGVuPTQwKSA6OiB2YWwyCisgICAgaW50ZWdlciA6OiBzdGF0CisgICAgY2FsbCBnZXRfZW52 aXJvbm1lbnRfdmFyaWFibGUgKG5hbWUsIHZhbDIsIHN0YXR1cz1zdGF0KQorICAgIGlmIChz dGF0ID09IDApIHRoZW4KKyAgICAgIGlmICh2YWwgPT0gdmFsMikgdGhlbgorICAgICAgICBl bnZfaXNfc2V0ID0gLnRydWUuCisgICAgICAgIHJldHVybgorICAgICAgZW5kIGlmCisgICAg ZWxzZSBpZiAoc3RhdCAvPSAxKSB0aGVuCisgICAgICBlcnJvciBzdG9wIDEwCisgICAgZW5k aWYKKyAgICBlbnZfaXNfc2V0ID0gLmZhbHNlLgorICBlbmQKK2VuZAo= --------------u8fS2iV3N3ySFeUtFWS0tttc--