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CBzZXQKICMgQ09ORklHX1JGRF9GVEwgaXMgbm90IHNldAogCiAjCiAjIFJBTS9ST00vRmxhc2ggY2hpcCBkcml2ZXJzCiAjCi1DT05GSUdfTVREX0NGST1tCi1DT05GSUdfTVREX0pFREVDUFJPQkU9bQotQ09ORklHX01URF9HRU5fUFJPQkU9bQotIyBDT05GSUdfTVREX0NGSV9BRFZfT1BUSU9OUyBpcyBub3Qgc2V0CisjIENPTkZJR19NVERfQ0ZJIGlzIG5vdCBzZXQKKyMgQ09ORklHX01URF9KRURFQ1BST0JFIGlzIG5vdCBzZXQKIENPTkZJR19NVERfTUFQX0JBTktfV0lEVEhfMT15CiBDT05GSUdfTVREX01BUF9CQU5LX1dJRFRIXzI9eQogQ09ORklHX01URF9NQVBfQkFOS19XSURUSF80PXkKQEAgLTYxNywzNiArNTIyLDI3IEBACiBDT05GSUdfTVREX0NGSV9JMj15CiAjIENPTkZJR19NVERfQ0ZJX0k0IGlzIG5vdCBzZXQKICMgQ09ORklHX01URF9DRklfSTggaXMgbm90IHNldAotQ09ORklHX01URF9DRklfSU5URUxFWFQ9bQotQ09ORklHX01URF9DRklfQU1EU1REPW0KLUNPTkZJR19NVERfQ0ZJX1NUQUE9bQotQ09ORklHX01URF9DRklfVVRJTD1tCi1DT05GSUdfTVREX1JBTT1tCi1DT05GSUdfTVREX1JPTT1tCi1DT05GSUdfTVREX0FCU0VOVD1tCisjIENPTkZJR19NVERfUkFNIGlzIG5vdCBzZXQKKyMgQ09ORklHX01URF9ST00gaXMgbm90IHNldAorIyBDT05GSUdfTVREX0FCU0VOVCBpcyBub3Qgc2V0CiAjIENPTkZJR19NVERfT0JTT0xFVEVfQ0hJUFMgaXMgbm90IHNldAogCiAjCiAjIE1hcHBpbmcgZHJpdmVycyBmb3IgY2hpcCBhY2Nlc3MKICMKLUNPTkZJR19NVERfQ09NUExFWF9NQVBQSU5HUz15Ci1DT05GSUdfTVREX1BIWVNNQVA9bQotQ09ORklHX01URF9QSFlTTUFQX1NUQVJUPTB4ODAwMDAwMAotQ09ORklHX01URF9QSFlTTUFQX0xFTj0weDQwMDAwMDAKLUNPTkZJR19NVERfUEhZU01BUF9CQU5LV0lEVEg9MgotIyBDT05GSUdfTVREX0FSTV9JTlRFR1JBVE9SIGlzIG5vdCBzZXQKLSMgQ09ORklHX01URF9JTVBBNyBpcyBub3Qgc2V0CisjIENPTkZJR19NVERfQ09NUExFWF9NQVBQSU5HUyBpcyBub3Qgc2V0CiAjIENPTkZJR19NVERfUExBVFJBTSBpcyBub3Qgc2V0CiAKICMKICMgU2VsZi1jb250YWluZWQgTVREIGRldmljZSBkcml2ZXJzCiAjCisjIENPTkZJR19NVERfREFUQUZMQVNIIGlzIG5vdCBzZXQKKyMgQ09ORklHX01URF9NMjVQODAgaXMgbm90IHNldAogQ09ORklHX01URF9TTFJBTT1tCiBDT05GSUdfTVREX1BIUkFNPW0KIENPTkZJR19NVERfTVREUkFNPW0KIENPTkZJR19NVERSQU1fVE9UQUxfU0laRT00MDk2CiBDT05GSUdfTVREUkFNX0VSQVNFX1NJWkU9MTI4Ci1DT05GSUdfTVREX0JMS01URD1tCiAjIENPTkZJR19NVERfQkxPQ0syTVREIGlzIG5vdCBzZXQKIAogIwpAQCAtNjYzLDE0ICs1NTksMTIgQEAKICMKICMgTkFORCBGbGFzaCBEZXZpY2UgRHJpdmVycwogIwotQ09ORklHX01URF9OQU5EPW0KK0NPTkZJR19NVERfTkFORD15CiAjIENPTkZJR19NVERfTkFORF9WRVJJRllfV1JJVEUgaXMgbm90IHNldAotQ09ORklHX01URF9OQU5EX0lEUz1tCi1DT05GSUdfTVREX05BTkRfRElTS09OQ0hJUD1tCi0jIENPTkZJR19NVERfTkFORF9ESVNLT05DSElQX1BST0JFX0FEVkFOQ0VEIGlzIG5vdCBzZXQKLUNPTkZJR19NVERfTkFORF9ESVNLT05DSElQX1BST0JFX0FERFJFU1M9MAotIyBDT05GSUdfTVREX05BTkRfRElTS09OQ0hJUF9CQlRXUklURSBpcy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W5kZXggMDAwMDAwMC4uMzliOThlZAotLS0gL2Rldi9udWxsCisrKyBiL2FyY2gvaTM4Ni9jcnlwdG8vdHdvZmlzaC1pNTg2LWFzbS5TCkBAIC0wLDAgKzEsMzM1IEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqICAgQ29weXJpZ2h0IChDKSAyMDA2IGJ5IEpvYWNoaW0gRnJpdHNjaGksIDxqZnJpdHNjaGlAZnJlZW5ldC5kZT4gICAgICAgICoKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKiAgIFRoaXMgcHJvZ3JhbSBpcyBmcmVlIHNvZnR3YXJlOyB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5ICAqCisqICAgaXQgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhcyBwdWJsaXNoZWQgYnkgICoKKyogICB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uOyBlaXRoZXIgdmVyc2lvbiAyIG9mIHRoZSBMaWNlbnNlLCBvciAgICAgKgorKiAgIChhdCB5b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyogICBUaGlzIHByb2dyYW0gaXMgZGlzdHJpYnV0ZWQgaW4gdGhlIGhvcGUgdGhhdCBpdCB3aWxsIGJlIHVzZWZ1bCwgICAgICAgKgorKiAgIGJ1dCBXSVRIT1VUIEFOWSBXQVJSQU5UWTsgd2l0aG91dCBldmVuIHRoZSBpbXBsaWVkIHdhcnJhbnR5IG9mICAgICAgICAqCisqICAgTUVSQ0hBTlRBQklMSVRZIG9yIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFLiAgU2VlIHRoZSAgICAgICAgICoKKyogICBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBmb3IgbW9yZSBkZXRhaWxzLiAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqICAgWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkIGEgY29weSBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgICAgICoKKyogICBhbG9uZyB3aXRoIHRoaXMgcHJvZ3JhbTsgaWYgbm90LCB3cml0ZSB0byB0aGUgICAgICAgICAgICAgICAgICAgICAgICAgKgorKiAgIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbiwgSW5jLiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqICAgNTkgVGVtcGxlIFBsYWNlIC0gU3VpdGUgMzMwLCBCb3N0b24sIE1BICAwMjExMS0xMzA3LCBVU0EuICAgICAgICAgICAgICoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLmZpbGUgInR3b2Zpc2gtaTU4Ni1hc20uUyIKKy50ZXh0CisKKyNpbmNsdWRlIDxhc20vYXNtLW9mZnNldHMuaD4KKworLyogcmV0dXJuIGFkcmVzcyBhdCAwICovCisKKyNkZWZpbmUgaW5fYmxrICAgIDEyICAvKiBpbnB1dCBieXRlIGFycmF5IGFkZHJlc3MgcGFyYW1ldGVyKi8KKyNkZWZpbmUgb3V0X2JsayAgIDggIC8qIG91dHB1dCBieXRlIGFycmF5IGFkZHJlc3MgcGFyYW1ldGVyKi8KKyNkZWZpbmUgdGZtICAgICAg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IENPTkZJR19IV01PTl9WSUQgaXMgbm90IHNldAorIyBDT05GSUdfU0VOU09SU19BQklUVUdVUlUgaXMgbm90IHNldAogIyBDT05GSUdfU0VOU09SU19GNzE4MDVGIGlzIG5vdCBzZXQKICMgQ09ORklHX0hXTU9OX0RFQlVHX0NISVAgaXMgbm90IHNldAogCkBAIC02MjAsNiArNjQyLDcgQEAKICMgTXVsdGltZWRpYSBkZXZpY2VzCiAjCiAjIENPTkZJR19WSURFT19ERVYgaXMgbm90IHNldAorQ09ORklHX1ZJREVPX1Y0TDI9eQogCiAjCiAjIERpZ2l0YWwgVmlkZW8gQnJvYWRjYXN0aW5nIERldmljZXMKQEAgLTYyOSw3ICs2NTIsOSBAQAogIwogIyBHcmFwaGljcyBzdXBwb3J0CiAjCitDT05GSUdfRklSTVdBUkVfRURJRD15CiAjIENPTkZJR19GQiBpcyBub3Qgc2V0CisjIENPTkZJR19CQUNLTElHSFRfTENEX1NVUFBPUlQgaXMgbm90IHNldAogCiAjCiAjIFNvdW5kCkBAIC02NjQsNiArNjg5LDE0IEBACiAjIENPTkZJR19ORVdfTEVEUyBpcyBub3Qgc2V0CiAKICMKKyMgTEVEIGRyaXZlcnMKKyMKKworIworIyBMRUQgVHJpZ2dlcnMKKyMKKworIwogIyBJbmZpbmlCYW5kIHN1cHBvcnQKICMKICMgQ09ORklHX0lORklOSUJBTkQgaXMgbm90IHNldApAQCAtNjc4LDYgKzcxMSwxOSBAQAogIyBDT05GSUdfUlRDX0NMQVNTIGlzIG5vdCBzZXQKIAogIworIyBETUEgRW5naW5lIHN1cHBvcnQKKyMKKyMgQ09ORklHX0RNQV9FTkdJTkUgaXMgbm90IHNldAorCisjCisjIERNQSBDbGllbnRzCisjCisKKyMKKyMgRE1BIERldmljZXMKKyMKKworIwogIyBGaWxlIHN5c3RlbXMKICMKIENPTkZJR19FWFQyX0ZTPXkKQEAgLTY5OCw2ICs3NDQsNyBAQAogIyBDT05GSUdfTUlOSVhfRlMgaXMgbm90IHN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CisJcHJpbnRrKEtFUk5fREVCVUcgIlVzaW5nIGRlZmF1bHQgaWRsZSBsb29wXG4iKTsKK30KKworc3RhdGljIHZvaWQgaW9tbXVfZGV2X3NldHVwX251bGwoc3RydWN0IHBjaV9kZXYgKmRldikgeyB9CitzdGF0aWMgdm9pZCBpb21tdV9idXNfc2V0dXBfbnVsbChzdHJ1Y3QgcGNpX2J1cyAqYnVzKSB7IH0KKworc3RhdGljIHZvaWQgX19pbml0IHBhc19pbml0X2Vhcmx5KHZvaWQpCit7CisJLyogTm8gaW9tbXUgY29kZSB5ZXQgKi8KKwlwcGNfbWQuaW9tbXVfZGV2X3NldHVwID0gaW9tbXVfZGV2X3NldHVwX251bGw7CisJcHBjX21kLmlvbW11X2J1c19zZXR1cCA9IGlvbW11X2J1c19zZXR1cF9udWxsOworCXBjaV9kaXJlY3RfaW9tbXVfaW5pdCgpOworfQorCisvKiBObyBsZWdhY3kgSU8gb24gb3VyIHBhcnRzICovCitzdGF0aWMgaW50IHBhc19jaGVja19sZWdhY3lfaW9wb3J0KHVuc2lnbmVkIGludCBiYXNlcG9ydCkKK3sKKwlyZXR1cm4gLUVOT0RFVjsKK30KKworc3RhdGljIF9faW5pdCB2b2lkIHBhc19pbml0X0lSUSh2b2lkKQoreworCXN0cnVjdCBkZXZpY2Vfbm9kZSAqbnA7CisJc3RydWN0IGRldmljZV9ub2RlICpyb290LCAqbXBpY19ub2RlOworCXVuc2lnbmVkIGxvbmcgb3BlbnBpY19hZGRyOworCWNvbnN0IHVuc2lnbmVkIGludCAqb3Bwcm9wOworCWludCBuYWRkciwgb3BwbGVuOworCXN0cnVjdCBtcGljICptcGljOworCisJbXBpY19ub2RlID0gTlVMTDsKKworCWZvcl9lYWNoX25vZGVfYnlfdHlwZShucCwgImludGVycnVwdC1jb250cm9sbGVyIikKKwkJaWYgKGRldmljZV9pc19jb21wYXRpYmxlKG5wLCAib3Blbi1waWMiKSkgeworCQkJbXBpY19ub2RlID0gbnA7CisJCQlicmVh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m4gMDsKK30KKworI2RlZmluZSBTSFVURE9XTl9PTl9QQU5JQ19QUklPIDAKKworc3RhdGljIGludCBzaHV0ZG93bl9vbl9wYW5pY19ub3RpZnkoc3RydWN0IG5vdGlmaWVyX2Jsb2NrICpzZWxmLAorCQkJCSAgICB1bnNpZ25lZCBsb25nIGV2ZW50LCB2b2lkICpkYXRhKQoreworCWlmIChvbl9wYW5pY19hY3Rpb24gPT0gU0hVVERPV05fRFVNUCkKKwkJZG9fZHVtcCgpOworCWVsc2UgaWYgKG9uX3BhbmljX2FjdGlvbiA9PSBTSFVURE9XTl9SRUlQTCkKKwkJZG9fcmVpcGwoKTsKKwlyZXR1cm4gTk9USUZZX09LOworfQorCitzdGF0aWMgc3RydWN0IG5vdGlmaWVyX2Jsb2NrIHNodXRkb3duX29uX3BhbmljX25iID0geworCS5ub3RpZmllcl9jYWxsID0gc2h1dGRvd25fb25fcGFuaWNfbm90aWZ5LAorCS5wcmlvcml0eSA9IFNIVVRET1dOX09OX1BBTklDX1BSSU8KK307CisKK3N0YXRpYyBpbnQgX19pbml0IGR1bXBfaW5pdCh2b2lkKQoreworCWludCByYzsKKworCXJjID0gZmlybXdhcmVfcmVnaXN0ZXIoJmR1bXBfc3Vic3lzKTsKKwlpZiAocmMpCisJCXJldHVybiByYzsKKwlyYyA9IHN1YnN5c19jcmVhdGVfZmlsZSgmZHVtcF9zdWJzeXMsICZkdW1wX3R5cGVfYXR0cik7CisJaWYgKHJjKSB7CisJCWZpcm13YXJlX3VucmVnaXN0ZXIoJmR1bXBfc3Vic3lzKTsKKwkJcmV0dXJuIHJjOworCX0KKwlyYyA9IGR1bXBfY2N3X2luaXQoKTsKKwlpZiAocmMpCisJCXJldHVybiByYzsKKwlyYyA9IGR1bXBfZmNwX2luaXQoKTsKKwlpZiAocmMpCisJCXJldHVybiByYzsKKwlkdW1wX3NldF90eXBlKElQTF9UWVBFX05PTkUpOworCXJldHVybiAwOworfQorCitzdGF0aWMgaW50IF9faW5pdCBzaH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YWdlcyhQQUdFX1NJWkUpOwogCi0gICAgICAgICAgICAgICAgcGdfZGlyLT5wZ2QwID0gIChfUEFHRV9UQUJMRSB8IF9fcGEocGdfdGFibGUpKTsKLSAgICAgICAgICAgICAgICBwZ19kaXItPnBnZDEgPSAgKF9QQUdFX1RBQkxFIHwgKF9fcGEocGdfdGFibGUpKzEwMjQpKTsKLSAgICAgICAgICAgICAgICBwZ19kaXItPnBnZDIgPSAgKF9QQUdFX1RBQkxFIHwgKF9fcGEocGdfdGFibGUpKzIwNDgpKTsKLSAgICAgICAgICAgICAgICBwZ19kaXItPnBnZDMgPSAgKF9QQUdFX1RBQkxFIHwgKF9fcGEocGdfdGFibGUpKzMwNzIpKTsKKwkJcG1kX3BvcHVsYXRlX2tlcm5lbCgmaW5pdF9tbSwgKHBtZF90ICopIHBnX2RpciwgcGdfdGFibGUpOwogICAgICAgICAgICAgICAgIHBnX2RpcisrOwogCiAgICAgICAgICAgICAgICAgZm9yICh0bXAgPSAwIDsgdG1wIDwgUFRSU19QRVJfUFRFIDsgdG1wKysscGdfdGFibGUrKykgewpAQCAtMTQzLDggKzE0Nyw4IEBACiAJCQllbHNlCiAJCQkJcHRlID0gcGZuX3B0ZShwZm4sIFBBR0VfS0VSTkVMKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwZm4gPj0gbWF4X2xvd19wZm4pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0ZV9jbGVhcigmaW5pdF9tbSwgMCwgJnB0ZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzZXRfcHRlKHBnX3RhYmxlLCBwdGUpOworCQkJCXB0ZV92YWwocHRlKSA9IF9QQUdFX1RZUEVfRU1QVFk7CisJCQlzZXRfcHRlKHBnX3RhYmxlLCBwdGUpOwogICAgICAgICAgICAgICAgICAgICAgICAgcGZuKys7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICB9CkBAIC0xNTksMTYgKzE2Myw2IEBACiAJCQkgICAgIDogOiAibSIgKHBnZGlyX2spLCAibSIgKHNzbV9tYXNrKSk7CiAKICAgICAgICAgbG9jYWxfZmx1c2hfdGxiKCk7Ci0KLQl7Ci0JCXVuc2lnbmVkIGxvbmcgem9uZXNfc2l6ZVtNQVhfTlJfWk9ORVNdOwotCi0JCW1lbXNldCh6b25lc19zaXplLCAwLCBzaXplb2Yoem9uZXNfc2l6ZSkpOwotCQl6b25lc19zaXplW1pPTkVfRE1BXSA9IG1heF9sb3dfcGZuOwotCQlmcmVlX2FyZWFfaW5pdF9ub2RlKDAsICZjb250aWdfcGFnZV9kYXRhLCB6b25lc19zaXplLAotCQkJCSAgICBfX3BhKFBBR0VfT0ZGU0VUKSA+PiBQQUdFX1NISUZULAotCQkJCSAgICB6aG9sZXNfc2l6ZSk7Ci0JfQogICAgICAgICByZXR1cm47CiB9CiAKQEAgLTIzNiwxMCArMjMwLDggQEAKIAkJCQkJcHRlID0gcGZuX3B0ZShwZm4sIF9fcGdwcm90KF9QQUdFX1JPKSk7CiAJCQkJZWxzZQogCQkJCQlwdGUgPSBwZm5fcHRlKHBmbiwgUEFHRV9LRVJORUwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGZuID49IG1heF9sb3dfcGZuKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRlX2NsZWFyKCZpbml0X21tLCAwLCAmcHRlKTsgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKwkJCQlpZiAocGZuID49IG1heF9sb3dfcGZuKQorCQkJCQlwdGVfdmFsKHB0ZSkgPSBfUEFHRV9UWVBFX0VNUFRZOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRfcHRlKHB0X2RpciwgcHRlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGZuKys7CiAgICAgICAgICAgICAgICAgICAg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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiAgIENvcHlyaWdodCAoQykgMjAwNiBieSBKb2FjaGltIEZyaXRzY2hpLCA8amZyaXRzY2hpQGZyZWVuZXQuZGU+ICAgICAgICAqCisqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyogICBUaGlzIHByb2dyYW0gaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeSAgKgorKiAgIGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMgcHVibGlzaGVkIGJ5ICAqCisqICAgdGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbjsgZWl0aGVyIHZlcnNpb24gMiBvZiB0aGUgTGljZW5zZSwgb3IgICAgICoKKyogICAoYXQgeW91ciBvcHRpb24pIGFueSBsYXRlciB2ZXJzaW9uLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisqICAgVGhpcyBwcm9ncmFtIGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRoYXQgaXQgd2lsbCBiZSB1c2VmdWwsICAgICAgICoKKyogICBidXQgV0lUSE9VVCBBTlkgV0FSUkFOVFk7IHdpdGhvdXQgZXZlbiB0aGUgaW1wbGllZCB3YXJyYW50eSBvZiAgICAgICAgKgorKiAgIE1FUkNIQU5UQUJJTElUWSBvciBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRS4gIFNlZSB0aGUgICAgICAgICAqCisqICAgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgZm9yIG1vcmUgZGV0YWlscy4gICAgICAgICAgICAgICAgICAgICAgICAgICoKKyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKiAgIFlvdSBzaG91bGQgaGF2ZSByZWNlaXZlZCBhIGNvcHkgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlICAgICAqCisqICAgYWxvbmcgd2l0aCB0aGlzIHByb2dyYW07IGlmIG5vdCwgd3JpdGUgdG8gdGhlICAgICAgICAgICAgICAgICAgICAgICAgICoKKyogICBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb24sIEluYy4sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorKiAgIDU5IFRlbXBsZSBQbGFjZSAtIFN1aXRlIDMzMCwgQm9zdG9uLCBNQSAgMDIxMTEtMTMwNywgVVNBLiAgICAgICAgICAgICAqCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy5maWxlICJ0d29maXNoLXg4Nl82NC1hc20uUyIKKy50ZXh0CisKKyNpbmNsdWRlIDxhc20vYXNtLW9mZnNldHMuaD4KKworI2RlZmluZSBhX29mZnNldAkwCisjZGVmaW5lIGJfb2Zmc2V0CTQKKyNkZWZpbmUgY19vZmZzZXQJOAorI2RlZmluZSBkX29mZnNldAkxMgorCisvKiBTdHJ1Y3R1cmUgb2YgdGhlIGNyeXB0byBjb250ZXh0IHN0cnVjdCovCisKKyNkZWZpbmUgczAJMAkvKiBTMCBBcnJheSAyNTYgV29yZHMgZWFjaCAqLworI2RlZmluZSBzMQkxMDI0CS8qIFMxIEFycmF5ICovCisjZGVmaW5lIHMyCTIwNDgJLyogUzIgQXJyYXkgKi8KKyNkZWZpbmUgczMJMzA3MgkvKiBTMyBBcnJheSAqLworI2RlZmluZSB3CTQwOTYJLy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XplICAgICAgICAgICAgID0gaW50ZWxfaTk2NV9mZXRjaF9zaXplLAorICAgICAgIC5jbGVhbnVwICAgICAgICAgICAgICAgID0gaW50ZWxfaTkxNV9jbGVhbnVwLAorICAgICAgIC50bGJfZmx1c2ggICAgICAgICAgICAgID0gaW50ZWxfaTgxMF90bGJmbHVzaCwKKyAgICAgICAubWFza19tZW1vcnkgICAgICAgICAgICA9IGludGVsX2k4MTBfbWFza19tZW1vcnksCisgICAgICAgLm1hc2tzICAgICAgICAgICAgICAgICAgPSBpbnRlbF9pODEwX21hc2tzLAorICAgICAgIC5hZ3BfZW5hYmxlICAgICAgICAgICAgID0gaW50ZWxfaTgxMF9hZ3BfZW5hYmxlLAorICAgICAgIC5jYWNoZV9mbHVzaCAgICAgICAgICAgID0gZ2xvYmFsX2NhY2hlX2ZsdXNoLAorICAgICAgIC5jcmVhdGVfZ2F0dF90YWJsZSAgICAgID0gaW50ZWxfaTk2NV9jcmVhdGVfZ2F0dF90YWJsZSwKKyAgICAgICAuZnJlZV9nYXR0X3RhYmxlICAgICAgICA9IGludGVsX2k4MzBfZnJlZV9nYXR0X3RhYmxlLAorICAgICAgIC5pbnNlcnRfbWVtb3J5ICAgICAgICAgID0gaW50ZWxfaTkxNV9pbnNlcnRfZW50cmllcywKKyAgICAgICAucmVtb3ZlX21lbW9yeSAgICAgICAgICA9IGludGVsX2k5MTVfcmVtb3ZlX2VudHJpZXMsCisgICAgICAgLmFsbG9jX2J5X3R5cGUgICAgICAgICAgPSBpbnRlbF9pODMwX2FsbG9jX2J5X3R5cGUsCisgICAgICAgLmZyZWVfYnlfdHlwZSAgICAgICAgICAgPSBpbnRlbF9pODEwX2ZyZWVfYnlfdHlwZSwKKyAgICAgICAuYWdwX2FsbG9jX3BhZ2UgICAgICAgICA9IGFncF9nZW5lcmljX2FsbG9jX3BhZ2UsCisgICAgICAgLmFncF9kZXN0cm95X3BhZ2UgICAgICAgPSBhZ3BfZ2VuZXJpY19kZXN0cm95X3BhZ2U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ZW1hcF9ub2NhY2hlKHJlZzRfc3RhcnQgKyBDMl9QQ0lfUkVHU19PRkZTRVQsCisJCQkJICAgICBrdmFfbWFwX3NpemUpOworCWlmIChjMmRldi0+a3ZhID09IDBVTCkgeworCQlwcmludGsoS0VSTl9FUlIgUEZYICJVbmFibGUgdG8gcmVtYXAgQkFSNFxuIik7CisJCXJldCA9IC1FSU87CisJCWdvdG8gYmFpbDk7CisJfQorCisJLyogUHJpbnQgb3V0IHRoZSBNQUMgYWRkcmVzcyAqLworCWMyX3ByaW50X21hY2FkZHIobmV0ZGV2KTsKKworCXJldCA9IGMyX3JuaWNfaW5pdChjMmRldik7CisJaWYgKHJldCkgeworCQlwcmludGsoS0VSTl9FUlIgUEZYICJjMl9ybmljX2luaXQgZmFpbGVkOiAlZFxuIiwgcmV0KTsKKwkJZ290byBiYWlsMTA7CisJfQorCisJYzJfcmVnaXN0ZXJfZGV2aWNlKGMyZGV2KTsKKworCXJldHVybiAwOworCisgYmFpbDEwOgorCWlvdW5tYXAoYzJkZXYtPmt2YSk7CisKKyBiYWlsOToKKwlpb3VubWFwKGMyZGV2LT5yZWdzKTsKKworIGJhaWw4OgorCWlvdW5tYXAoYzJkZXYtPm1taW9fdHhwX3JpbmcpOworCisgYmFpbDc6CisJaW91bm1hcChjMmRldi0+bW1pb19yeHBfcmluZyk7CisKKyBiYWlsNjoKKwl1bnJlZ2lzdGVyX25ldGRldihuZXRkZXYpOworCisgYmFpbDU6CisJZnJlZV9uZXRkZXYobmV0ZGV2KTsKKworIGJhaWw0OgorCWZyZWVfaXJxKHBjaWRldi0+aXJxLCBjMmRldik7CisKKyBiYWlsMzoKKwlpYl9kZWFsbG9jX2RldmljZSgmYzJkZXYtPmliZGV2KTsKKworIGJhaWwyOgorCXBjaV9yZWxlYXNlX3JlZ2lvbnMocGNpZGV2KTsKKworIGJhaWwxOgorCXBjaV9kaXNhYmxlX2RldmljZShwY2lkZXYpOworCisgYmFpbDA6CisJcmV0dXJuIHJldDsKK30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9zZXRfaWQoJndyLCBDQ1dSX1NUQUdfREVBTExPQyk7CisJd3IuaGRyLmNvbnRleHQgPSAodTY0KSAodW5zaWduZWQgbG9uZykgdnFfcmVxOworCXdyLnJuaWNfaGFuZGxlID0gYzJkZXYtPmFkYXB0ZXJfaGFuZGxlOworCXdyLnN0YWdfaW5kZXggPSBjcHVfdG9fYmUzMihzdGFnX2luZGV4KTsKKworCS8qCisJICogcmVmZXJlbmNlIHRoZSByZXF1ZXN0IHN0cnVjdC4gIGRlcmVmZXJlbmNlZCBpbiB0aGUgaW50IGhhbmRsZXIuCisJICovCisJdnFfcmVxX2dldChjMmRldiwgdnFfcmVxKTsKKworCS8qCisJICogU2VuZCBXUiB0byBhZGFwdGVyCisJICovCisJZXJyID0gdnFfc2VuZF93cihjMmRldiwgKHVuaW9uIGMyd3IgKikgJiB3cik7CisJaWYgKGVycikgeworCQl2cV9yZXFfcHV0KGMyZGV2LCB2cV9yZXEpOworCQlnb3RvIGJhaWwwOworCX0KKworCS8qCisJICogV2FpdCBmb3IgcmVwbHkgZnJvbSBhZGFwdGVyCisJICovCisJZXJyID0gdnFfd2FpdF9mb3JfcmVwbHkoYzJkZXYsIHZxX3JlcSk7CisJaWYgKGVycikgeworCQlnb3RvIGJhaWwwOworCX0KKworCS8qCisJICogUHJvY2VzcyByZXBseQorCSAqLworCXJlcGx5ID0gKHN0cnVjdCBjMndyX3N0YWdfZGVhbGxvY19yZXAgKikgKHVuc2lnbmVkIGxvbmcpIHZxX3JlcS0+cmVwbHlfbXNnOworCWlmICghcmVwbHkpIHsKKwkJZXJyID0gLUVOT01FTTsKKwkJZ290byBiYWlsMDsKKwl9CisKKwllcnIgPSBjMl9lcnJubyhyZXBseSk7CisKKwl2cV9yZXBidWZfZnJlZShjMmRldiwgcmVwbHkpOworICAgICAgYmFpbDA6CisJdnFfcmVxX2ZyZWUoYzJkZXYsIHZxX3JlcSk7CisJcmV0dXJuIGVycjsKK30KZGlmZiAtLWdpdCBhL2RyaXZl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1RJT05fXywgX19MSU5FX18pOworCisJZXJyID0gYzJfbGxwX3JlamVjdChjbV9pZCwgcGRhdGEsIHBkYXRhX2xlbik7CisJcmV0dXJuIGVycjsKK30KKworc3RhdGljIGludCBjMl9zZXJ2aWNlX2NyZWF0ZShzdHJ1Y3QgaXdfY21faWQgKmNtX2lkLCBpbnQgYmFja2xvZykKK3sKKwlpbnQgZXJyOworCisJcHJfZGVidWcoIiVzOiV1XG4iLCBfX0ZVTkNUSU9OX18sIF9fTElORV9fKTsKKwllcnIgPSBjMl9sbHBfc2VydmljZV9jcmVhdGUoY21faWQsIGJhY2tsb2cpOworCXByX2RlYnVnKCIlczoldSBlcnI9JWRcbiIsCisJCV9fRlVOQ1RJT05fXywgX19MSU5FX18sCisJCWVycik7CisJcmV0dXJuIGVycjsKK30KKworc3RhdGljIGludCBjMl9zZXJ2aWNlX2Rlc3Ryb3koc3RydWN0IGl3X2NtX2lkICpjbV9pZCkKK3sKKwlpbnQgZXJyOworCXByX2RlYnVnKCIlczoldVxuIiwgX19GVU5DVElPTl9fLCBfX0xJTkVfXyk7CisKKwllcnIgPSBjMl9sbHBfc2VydmljZV9kZXN0cm95KGNtX2lkKTsKKworCXJldHVybiBlcnI7Cit9CisKK3N0YXRpYyBpbnQgYzJfcHNldWRvX3VwKHN0cnVjdCBuZXRfZGV2aWNlICpuZXRkZXYpCit7CisJc3RydWN0IGluX2RldmljZSAqaW5kOworCXN0cnVjdCBjMl9kZXYgKmMyZGV2ID0gbmV0ZGV2LT5wcml2OworCisJaW5kID0gaW5fZGV2X2dldChuZXRkZXYpOworCWlmICghaW5kKQorCQlyZXR1cm4gMDsKKworCXByX2RlYnVnKCJhZGRpbmcuLi5cbiIpOworCWZvcl9pZmEoaW5kKSB7CisjaWZkZWYgREVCVUcKKwkJdTggKmlwID0gKHU4ICopICYgaWZhLT5pZmFfYWRkcmVzczsKKworCQlwcl9kZWJ1ZygiJXM6ICVkLiVkLiVkLiVkXG4iLAorCQkgICAgICAgaW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cy0+dmVuZG9yX3BhcnRfaWQgICAgICA9IGJlMzJfdG9fY3B1KHJlcGx5LT5wYXJ0X251bWJlcik7CisJcHJvcHMtPmh3X3ZlciAgICAgICAgICAgICAgPSBiZTMyX3RvX2NwdShyZXBseS0+aHdfdmVyc2lvbik7CisJcHJvcHMtPm1heF9xcCAgICAgICAgICAgICAgPSBiZTMyX3RvX2NwdShyZXBseS0+bWF4X3Fwcyk7CisJcHJvcHMtPm1heF9xcF93ciAgICAgICAgICAgPSBiZTMyX3RvX2NwdShyZXBseS0+bWF4X3FwX2RlcHRoKTsKKwlwcm9wcy0+ZGV2aWNlX2NhcF9mbGFncyAgICA9IGMyZGV2LT5kZXZpY2VfY2FwX2ZsYWdzOworCXByb3BzLT5tYXhfc2dlICAgICAgICAgICAgID0gQzJfTUFYX1NHRVM7CisJcHJvcHMtPm1heF9zZ2VfcmQgICAgICAgICAgPSBDMl9NQVhfU0dFX1JEOworCXByb3BzLT5tYXhfY3EgICAgICAgICAgICAgID0gYmUzMl90b19jcHUocmVwbHktPm1heF9jcXMpOworCXByb3BzLT5tYXhfY3FlICAgICAgICAgICAgID0gYmUzMl90b19jcHUocmVwbHktPm1heF9jcV9kZXB0aCk7CisJcHJvcHMtPm1heF9tciAgICAgICAgICAgICAgPSBiZTMyX3RvX2NwdShyZXBseS0+bWF4X21ycyk7CisJcHJvcHMtPm1heF9wZCAgICAgICAgICAgICAgPSBiZTMyX3RvX2NwdShyZXBseS0+bWF4X3Bkcyk7CisJcHJvcHMtPm1heF9xcF9yZF9hdG9tICAgICAgPSBiZTMyX3RvX2NwdShyZXBseS0+bWF4X3FwX2lyZCk7CisJcHJvcHMtPm1heF9lZV9yZF9hdG9tICAgICAgPSAwOworCXByb3BzLT5tYXhfcmVzX3JkX2F0b20gICAgID0gYmUzMl90b19jcHUocmVwbHktPm1heF9nbG9iYWxfaXJkKTsKKwlwcm9wcy0+bWF4X3FwX2luaXRfcmRfYXRvbSA9IGJlMzJfdG9fY3B1KHJlcGx5LT5tYXhfcXBfb3JkKTsKKwlwcm9wcy0+bWF4X2VlX2luaXRfcmRfYXRvbSA9IDA7CisJcHJvcHMtPmF0b21pY19jYXAgICAgICAgICAgPSBJQl9BVE9NSUNfTk9ORTsKKwlwcm9wcy0+bWF4X2VlICAgICAgICAgICAgICA9IDA7CisJcHJvcHMtPm1heF9yZGQgICAgICAgICAgICAgPSAwOworCXByb3BzLT5tYXhfbXcgICAgICAgICAgICAgID0gYmUzMl90b19jcHUocmVwbHktPm1heF9td3MpOworCXByb3BzLT5tYXhfcmF3X2lwdjZfcXAgICAgID0gMDsKKwlwcm9wcy0+bWF4X3Jhd19ldGh5X3FwICAgICA9IDA7CisJcHJvcHMtPm1heF9tY2FzdF9ncnAgICAgICAgPSAwOworCXByb3BzLT5tYXhfbWNhc3RfcXBfYXR0YWNoID0gMDsKKwlwcm9wcy0+bWF4X3RvdGFsX21jYXN0X3FwX2F0dGFjaCA9IDA7CisJcHJvcHMtPm1heF9haCAgICAgICAgICAgICAgPSAwOworCXByb3BzLT5tYXhfZm1yICAgICAgICAgICAgID0gMDsKKwlwcm9wcy0+bWF4X21hcF9wZXJfZm1yICAgICA9IDA7CisJcHJvcHMtPm1heF9zcnEgICAgICAgICAgICAgPSAwOworCXByb3BzLT5tYXhfc3JxX3dyICAgICAgICAgID0gMDsKKwlwcm9wcy0+bWF4X3NycV9zZ2UgICAgICAgICA9IDA7CisJcHJvcHMtPm1heF9wa2V5cyAgICAgICAgICAgPSAwOworCXByb3BzLT5sb2NhbF9jYV9hY2tfZGVsYXkgID0gMDsKKworIGJhaWwyOgorCXZxX3JlcGJ1Zl9mcmVlKGMyZGV2LCByZXBseSk7CisKKyBiYWlsMToKKwl2cV9yZXFfZnJlZShjMmRldiwgdnFfcmVxKTsKKwlyZXR1cm4gZXJyOworfQorCisvKgorICogQWRkIGFuIElQIGFkZHJlc3MgdG8gdGhlIFJOSUMgaW50ZXJmYWNlCisgKi8KK2ludCBjMl9hZGRfYWRkcihzd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nQ7ICAgICAgICAgICAgIC8qIDA1ICovCisJdTMyIHByaW1fcF9rZXlfaWR4OyAgICAgICAgICAgIC8qIDA2ICovCisJdTMyIGFsdF9wX2tleV9pZHg7ICAgICAgICAgICAgIC8qIDA3ICovCisJdTMyIHJkbWFfYXRvbWljX2N0cmw7ICAgICAgICAgIC8qIDA4ICovCisJdTMyIHFwX3N0YXRlOyAgICAgICAgICAgICAgICAgIC8qIDA5ICovCisJdTMyIHJlc2VydmVkXzEwOyAgICAgICAgICAgICAgIC8qIDEwICovCisJdTMyIHJkbWFfbnJfYXRvbWljX3Jlc3BfcmVzOyAgIC8qIDExICovCisJdTMyIHBhdGhfbWlncmF0aW9uX3N0YXRlOyAgICAgIC8qIDEyICovCisJdTMyIHJkbWFfYXRvbWljX291dHN0X2Rlc3RfcXA7IC8qIDEzICovCisJdTMyIGRlc3RfcXBfbnI7ICAgICAgICAgICAgICAgIC8qIDE0ICovCisJdTMyIG1pbl9ybnJfbmFrX3RpbWVyX2ZpZWxkOyAgIC8qIDE1ICovCisJdTMyIHNlcnZpY2VfbGV2ZWw7ICAgICAgICAgICAgIC8qIDE2ICovCisJdTMyIHNlbmRfZ3JoX2ZsYWc7ICAgICAgICAgICAgIC8qIDE3ICovCisJdTMyIHJldHJ5X2NvdW50OyAgICAgICAgICAgICAgIC8qIDE4ICovCisJdTMyIHRpbWVvdXQ7ICAgICAgICAgICAgICAgICAgIC8qIDE5ICovCisJdTMyIHBhdGhfbXR1OyAgICAgICAgICAgICAgICAgIC8qIDIwICovCisJdTMyIG1heF9zdGF0aWNfcmF0ZTsgICAgICAgICAgIC8qIDIxICovCisJdTMyIGRsaWQ7ICAgICAgICAgICAgICAgICAgICAgIC8qIDIyICovCisJdTMyIHJucl9yZXRyeV9jb3VudDsgICAgICAgICAgIC8qIDIzICovCisJdTMyIHNvdXJjZV9wYXRoX2JpdHM7ICAgICAgICAgIC8qIDI0ICovCisJdTMyIHRyYWZmaWNfY2xhc3M7ICAgICAgICAgICAgIC8qIDI1ICovCisJdTMyIGhvcF9saW1pdDsgICAgICAgICAgICAgICAgIC8qIDI2ICovCisJdTMyIHNvdXJjZV9naWRfaWR4OyAgICAgICAgICAgIC8qIDI3ICovCisJdTMyIGZsb3dfbGFiZWw7ICAgICAgICAgICAgICAgIC8qIDI4ICovCisJdTMyIHJlc2VydmVkXzI5OyAgICAgICAgICAgICAgIC8qIDI5ICovCisJdW5pb24geyAgICAgICAgICAgICAgICAgICAgICAgIC8qIDMwICovCisJCXU2NCBkd1syXTsKKwkJdTggYnl0ZVsxNl07CisJfSBkZXN0X2dpZDsKKwl1MzIgc2VydmljZV9sZXZlbF9hbDsgICAgICAgICAgLyogMzQgKi8KKwl1MzIgc2VuZF9ncmhfZmxhZ19hbDsgICAgICAgICAgLyogMzUgKi8KKwl1MzIgcmV0cnlfY291bnRfYWw7ICAgICAgICAgICAgLyogMzYgKi8KKwl1MzIgdGltZW91dF9hbDsgICAgICAgICAgICAgICAgLyogMzcgKi8KKwl1MzIgbWF4X3N0YXRpY19yYXRlX2FsOyAgICAgICAgLyogMzggKi8KKwl1MzIgZGxpZF9hbDsgICAgICAgICAgICAgICAgICAgLyogMzkgKi8KKwl1MzIgcm5yX3JldHJ5X2NvdW50X2FsOyAgICAgICAgLyogNDAgKi8KKwl1MzIgc291cmNlX3BhdGhfYml0c19hbDsgICAgICAgLyogNDEgKi8KKwl1MzIgdHJhZmZpY19jbGFzc19hbDsgICAgICAgICAgLyogNDIgKi8KKwl1MzIgaG9wX2xpbWl0X2FsOyAgICAgICAgICAgICAgLyogNDMgKi8KKwl1MzIgc291cmNlX2dpZF9pZHhfYWw7ICAgICAgICAgLyogNDQgKi8KKwl1MzIgZmxvd19sYWJlbF9hbDsgICAgICAgICAgICAgLyogNDUgKi8KKwl1MzIgcmVzZXJ2ZWRfNDY7ICAgICAgICAgICAgICAgLyogNDYgKi8KKwl1MzIgcmVzZXJ2ZWRfNDc7ICAgICAgICAgICAgICAgLyogNDcgKi8KKwl1bmlvbiB7ICAgICAgICAgICAgICAgICAgICAgICAgLyogNDggKi8KKwkJdTY0IGR3WzJdOworCQl1OCBieXRlWzE2XTsKKwl9IGRlc3RfZ2lkX2FsOworCXUzMiBtYXhfbnJfb3V0c3Rfc2VuZF93cjsgICAgICAvKiA1MiAqLworCXUzMiBtYXhfbnJfb3V0c3RfcmVjdl93cjsgICAgICAvKiA1MyAqLworCXUzMiBkaXNhYmxlX2V0ZV9jcmVkaXRfY2hlY2s7ICAvKiA1NCAqLworCXUzMiBxcF9udW1iZXI7ICAgICAgICAgICAgICAgICAvKiA1NSAqLworCXU2NCBzZW5kX3F1ZXVlX2hhbmRsZTsgICAgICAgICAvKiA1NiAqLworCXU2NCByZWN2X3F1ZXVlX2hhbmRsZTsgICAgICAgICAvKiA1OCAqLworCXUzMiBhY3R1YWxfbnJfc2dlc19pbl9zcV93cWU7ICAvKiA2MCAqLworCXUzMiBhY3R1YWxfbnJfc2dlc19pbl9ycV93cWU7ICAvKiA2MSAqLworCXUzMiBxcF9lbmFibGU7ICAgICAgICAgICAgICAgICAvKiA2MiAqLworCXUzMiBjdXJyX3NycV9saW1pdDsgICAgICAgICAgICAvKiA2MyAqLworCXU2NCBxcF9hZmZfYXN5bl9ldl9sb2dfcmVnOyAgICAvKiA2NCAqLworCXU2NCBzaGFyZWRfcnFfaG5kbDsgICAgICAgICAgICAvKiA2NiAqLworCXU2NCB0cmlnZ19kb29yYmVsbF9xcF9obmRsOyAgICAvKiA2OCAqLworCXUzMiByZXNlcnZlZF83MF8xMjdbNThdOyAgICAgICAvKiA3MCAqLworfTsKKworI2RlZmluZSBNUVBDQl9NQVNLX1FLRVkgICAgICAgICAgICAgICAgICAgICAgICAgRUhDQV9CTUFTS19JQk0oMCwwKQorI2RlZmluZSBNUVBDQl9NQVNLX1NFTkRfUFNOICAgICAgICAgICAgICAgICAgICAgRUhDQV9CTUFTS19JQk0oMiwyKQorI2RlZmluZSBNUVBDQl9NQVNLX1JFQ0VJVkVfUFNOICA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U6ICV4IChDUFVfREVBRCkiLCBjcHUpOworCQlkZXN0cm95X2NvbXBfdGFzayhwb29sLCBjcHUpOworCQl0YWtlX292ZXJfd29yayhwb29sLCBjcHUpOworCQlicmVhazsKKwl9CisKKwlyZXR1cm4gTk9USUZZX09LOworfQorCisjZW5kaWYKKworaW50IGVoY2FfY3JlYXRlX2NvbXBfcG9vbCh2b2lkKQoreworI2lmZGVmIENPTkZJR19JTkZJTklCQU5EX0VIQ0FfU0NBTElORworCWludCBjcHU7CisJc3RydWN0IHRhc2tfc3RydWN0ICp0YXNrOworCisJcG9vbCA9IGt6YWxsb2Moc2l6ZW9mKHN0cnVjdCBlaGNhX2NvbXBfcG9vbCksIEdGUF9LRVJORUwpOworCWlmIChwb29sID09IE5VTEwpCisJCXJldHVybiAtRU5PTUVNOworCisJc3Bpbl9sb2NrX2luaXQoJnBvb2wtPmxhc3RfY3B1X2xvY2spOworCXBvb2wtPmxhc3RfY3B1ID0gYW55X29ubGluZV9jcHUoY3B1X29ubGluZV9tYXApOworCisJcG9vbC0+Y3B1X2NvbXBfdGFza3MgPSBhbGxvY19wZXJjcHUoc3RydWN0IGVoY2FfY3B1X2NvbXBfdGFzayk7CisJaWYgKHBvb2wtPmNwdV9jb21wX3Rhc2tzID09IE5VTEwpIHsKKwkJa2ZyZWUocG9vbCk7CisJCXJldHVybiAtRUlOVkFMOworCX0KKworCWZvcl9lYWNoX29ubGluZV9jcHUoY3B1KSB7CisJCXRhc2sgPSBjcmVhdGVfY29tcF90YXNrKHBvb2wsIGNwdSk7CisJCWlmICh0YXNrKSB7CisJCQlrdGhyZWFkX2JpbmQodGFzaywgY3B1KTsKKwkJCXdha2VfdXBfcHJvY2Vzcyh0YXNrKTsKKwkJfQorCX0KKworCWNvbXBfcG9vbF9jYWxsYmFja19uYi5ub3RpZmllcl9jYWxsID0gY29tcF9wb29sX2NhbGxiYWNrOworCWNvbXBfcG9vbF9jYWxsYmFja19uYi5wcmlvcml0eSA9MDsKKwlyZWdp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cgInBtYzU1MV9yZWFkKCkgc29mZl9oaTogJWxkLCBlb2ZmX2hpOiAlbGRcbiIsIChsb25nKXNvZmZfaGksIChsb25nKWVvZmZfaGkpOworCQkJcHJpbnRrKEtFUk5fREVCVUcgInBtYzU1MV9yZWFkKCkgc29mZl9oaTogJWxkLCAiCisJCQkJImVvZmZfaGk6ICVsZFxuIiwgKGxvbmcpc29mZl9oaSwgKGxvbmcpZW9mZl9oaSk7CiAjZW5kaWYKLSAgICAgICAgICAgICAgICAgICAgICAgIG1lbWNweShjb3B5dG8sIHB0ciwgcHJpdi0+YXNpemUpOwotICAgICAgICAgICAgICAgICAgICAgICAgY29weXRvICs9IHByaXYtPmFzaXplOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNvZmZfaGkgKyBwcml2LT5hc2l6ZSA+PSBtdGQtPnNpemUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ290byBvdXQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBzb2ZmX2hpICs9IHByaXYtPmFzaXplOwotCQkJcG1jNTUxX3BvaW50IChtdGQsIHNvZmZfaGksIHByaXYtPmFzaXplLCByZXRsZW4sICZwdHIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtZW1jcHkoY29weXRvLCBwdHIsIGVvZmZfbG8pOwotICAgICAgICAgICAgICAgIGNvcHl0byArPSBlb2ZmX2xvOwotICAgICAgICB9CisJCQltZW1jcHkoY29weXRvLCBwdHIsIHByaXYtPmFzaXplKTsKKwkJCWNvcHl0byArPSBwcml2LT5hc2l6ZTsKKwkJCWlmIChzb2ZmX2hpICsgcHJpdi0+YXNpemUgPj0gbXRkLT5zaXplKSB7CisJCQkJZ290byBvdXQ7CisJCQl9CisJCQlzb2ZmX2hpICs9IHByaXYtPmFzaXplOworCQkJcG1jNTUxX3BvaW50KG10ZCwgc29mZl9oaSwgcHJpdi0+YXNpemUsIHJldG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iAlbGQsIHRvOiAlbGQpXG4iLCAobG9uZyllbmQsIChsb25nKW10ZC0+c2l6ZSwKKwkJCShsb25nKXRvKTsKICNlbmRpZgotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICB9CisJCXJldHVybiAtRUlOVkFMOworCX0KIAotICAgICAgICBzb2ZmX2hpID0gdG8gJiB+KHByaXYtPmFzaXplIC0gMSk7Ci0gICAgICAgIGVvZmZfaGkgPSBlbmQgJiB+KHByaXYtPmFzaXplIC0gMSk7Ci0gICAgICAgIHNvZmZfbG8gPSB0byAmIChwcml2LT5hc2l6ZSAtIDEpOwotICAgICAgICBlb2ZmX2xvID0gZW5kICYgKHByaXYtPmFzaXplIC0gMSk7CisJc29mZl9oaSA9IHRvICYgfihwcml2LT5hc2l6ZSAtIDEpOworCWVvZmZfaGkgPSBlbmQgJiB+KHByaXYtPmFzaXplIC0gMSk7CisJc29mZl9sbyA9IHRvICYgKHByaXYtPmFzaXplIC0gMSk7CisJZW9mZl9sbyA9IGVuZCAmIChwcml2LT5hc2l6ZSAtIDEpOwogCi0JcG1jNTUxX3BvaW50IChtdGQsIHRvLCBsZW4sIHJldGxlbiwgJnB0cik7CisJcG1jNTUxX3BvaW50KG10ZCwgdG8sIGxlbiwgcmV0bGVuLCAmcHRyKTsKIAotICAgICAgICBpZiAoc29mZl9oaSA9PSBlb2ZmX2hpKSB7Ci0gICAgICAgICAgICAgICAgLyogVGhlIHdob2xlIHRoaW5nIGZpdHMgd2l0aGluIG9uZSBhY2Nlc3MsIHNvIGp1c3Qgb25lIHNob3QKLSAgICAgICAgICAgICAgICAgICB3aWxsIGRvIGl0LiAqLwotICAgICAgICAgICAgICAgIG1lbWNweShwdHIsIGNvcHlmcm9tLCBsZW4pOwotICAgICAgICAgICAgICAgIGNvcHlmcm9tICs9IGxlbjsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAvKiBXZSBoYXZlIHRvIGRvIG11bHRpcGxlIHdya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aWYgKChQQ0lfRGV2aWNlID0gcGNpX2ZpbmRfZGV2aWNlKFBDSV9WRU5ET1JfSURfVjNfU0VNSSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUENJX0RFVklDRV9JRF9WM19TRU1JX1YzNzBQREMsCi0JCQkJCQkgIFBDSV9EZXZpY2UgKSApID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KKwkJaWYgKChQQ0lfRGV2aWNlID0gcGNpX2dldF9kZXZpY2UoUENJX1ZFTkRPUl9JRF9WM19TRU1JLAorCQkJCQkJICBQQ0lfREVWSUNFX0lEX1YzX1NFTUlfVjM3MFBEQywKKwkJCQkJCSAgUENJX0RldmljZSkpID09IE5VTEwpIHsKKwkJCWJyZWFrOworCQl9CiAKLSAgICAgICAgICAgICAgICBwcmludGsoS0VSTl9OT1RJQ0UgInBtYzU1MTogRm91bmQgUENJIFYzNzBQREMgYXQgMHglbGx4XG4iLAotCQkJCSAgICAodW5zaWduZWQgbG9uZyBsb25nKVBDSV9EZXZpY2UtPnJlc291cmNlWzBdLnN0YXJ0KTsKKwkJcHJpbnRrKEtFUk5fTk9USUNFICJwbWM1NTE6IEZvdW5kIFBDSSBWMzcwUERDIGF0IDB4JWxseFxuIiwKKwkJCSh1bnNpZ25lZCBsb25nIGxvbmcpcGNpX3Jlc291cmNlX3N0YXJ0KFBDSV9EZXZpY2UsIDApKTsKIAotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogVGhlIFBNQzU1MSBkZXZpY2UgYWN0cyBWRVJZIHdlaXJkIGlmIHlvdSBkb24ndCBpbml0IGl0Ci0gICAgICAgICAgICAgICAgICogZmlyc3QuICBpLmUuIGl0IHdpbGwgbm90IGNvcnJlY3RseSByZXBvcnQgZGV2c2VsLiAgSWYgZm9yCi0gICAgICAgICAgICAgICAgICogc29tZSByZWFzb24gdGhlIHNkc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xuIik7CisJCQlicmVhazsKKwkJfQogCiAJCS8qCiAJCSAqIFRoaXMgaXMgbmVlZGVkIHVudGlsIHRoZSBkcml2ZXIgaXMgY2FwYWJsZSBvZiByZWFkaW5nIHRoZQogCQkgKiBvbmJvYXJkIEkyQyBTUk9NIHRvIGRpc2NvdmVyIHRoZSAicmVhbCIgbWVtb3J5IHNpemUuCiAJCSAqLwotCQlpZihtc2l6ZSkgeworCQlpZiAobXNpemUpIHsKIAkJCWxlbmd0aCA9IG1zaXplOwotCQkJcHJpbnRrKEtFUk5fTk9USUNFICJwbWM1NTE6IFVzaW5nIHNwZWNpZmllZCBtZW1vcnkgc2l6ZSAweCV4XG4iLCBsZW5ndGgpOworCQkJcHJpbnRrKEtFUk5fTk9USUNFICJwbWM1NTE6IFVzaW5nIHNwZWNpZmllZCBtZW1vcnkgIgorCQkJCSJzaXplIDB4JXhcbiIsIGxlbmd0aCk7CiAJCX0gZWxzZSB7CiAJCQltc2l6ZSA9IGxlbmd0aDsKIAkJfQogCi0gICAgICAgICAgICAgICAgbXRkID0ga21hbGxvYyhzaXplb2Yoc3RydWN0IG10ZF9pbmZvKSwgR0ZQX0tFUk5FTCk7Ci0gICAgICAgICAgICAgICAgaWYgKCFtdGQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ayhLRVJOX05PVElDRSAicG1jNTUxOiBDYW5ub3QgYWxsb2NhdGUgbmV3IE1URCBkZXZpY2UuXG4iKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIG1lbXNldChtdGQsIDAsIHNpemVvZihzdHJ1Y3QgbXRkX2luZm8pKTsKLQotICAgICAgICAgICAgICAgIHByaXYgPSBrbWFsbG9jIChzaXplb2Yoc3RydWN0IG15cHJpdiksIEdGUF9LRVJORUwpOwotICAgICAgICAgICAgICAgIGlmICghcHJpdikgewotICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRrKEt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TV9NQVNLKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpdi0+YXNpemUpOwotCi0JCWlmICghcHJpdi0+c3RhcnQpIHsKLQkJCXByaW50ayhLRVJOX05PVElDRSAicG1jNTUxOiBVbmFibGUgdG8gbWFwIElPIHNwYWNlXG4iKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGtmcmVlKG10ZC0+cHJpdik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBrZnJlZShtdGQpOworCQltdGQgPSBremFsbG9jKHNpemVvZihzdHJ1Y3QgbXRkX2luZm8pLCBHRlBfS0VSTkVMKTsKKwkJaWYgKCFtdGQpIHsKKwkJCXByaW50ayhLRVJOX05PVElDRSAicG1jNTUxOiBDYW5ub3QgYWxsb2NhdGUgbmV3IE1URCAiCisJCQkJImRldmljZS5cbiIpOwogCQkJYnJlYWs7CiAJCX0KIAorCQlwcml2ID0ga3phbGxvYyhzaXplb2Yoc3RydWN0IG15cHJpdiksIEdGUF9LRVJORUwpOworCQlpZiAoIXByaXYpIHsKKwkJCXByaW50ayhLRVJOX05PVElDRSAicG1jNTUxOiBDYW5ub3QgYWxsb2NhdGUgbmV3IE1URCAiCisJCQkJImRldmljZS5cbiIpOworCQkJa2ZyZWUobXRkKTsKKwkJCWJyZWFrOworCQl9CisJCW10ZC0+cHJpdiA9IHByaXY7CisJCXByaXYtPmRldiA9IFBDSV9EZXZpY2U7CisKKwkJaWYgKGFzaXplID4gbGVuZ3RoKSB7CisJCQlwcmludGsoS0VSTl9OT1RJQ0UgInBtYzU1MTogcmVkdWNpbmcgYXBlcnR1cmUgc2l6ZSB0byAiCisJCQkJImZpdCAlZE1cbiIsIGxlbmd0aCA+PiAyMCk7CisJCQlwcml2LT5hc2l6ZSA9IGFzaXplID0gbGVuZ3RoOworCQl9IGVsc2UgaWYgKGFzaXplID09IDAgfHwgYXNpemUgPT0gbGVuZ3RoKSB7CisJCQlwcmludGsoS0VSTl9OT1RJQ0UgInB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lX21hcDA7Ci0gICAgICAgICAgICAgICAgcGNpX3dyaXRlX2NvbmZpZ19kd29yZCAoIHByaXYtPmRldiwgUE1DNTUxX1BDSV9NRU1fTUFQMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpdi0+Y3Vycl9tYXAwICk7CisJCXByaXYtPmJhc2VfbWFwMCA9IChQTUM1NTFfUENJX01FTV9NQVBfUkVHX0VOCisJCQkJICAgfCBQTUM1NTFfUENJX01FTV9NQVBfRU5BQkxFCisJCQkJICAgfCAoZmZzKHByaXYtPmFzaXplID4+IDIwKSAtIDEpIDw8IDQpOworCQlwcml2LT5jdXJyX21hcDAgPSBwcml2LT5iYXNlX21hcDA7CisJCXBjaV93cml0ZV9jb25maWdfZHdvcmQocHJpdi0+ZGV2LCBQTUM1NTFfUENJX01FTV9NQVAwLAorCQkJCQlwcml2LT5jdXJyX21hcDApOwogCiAjaWZkZWYgQ09ORklHX01URF9QTUM1NTFfREVCVUcKLQkJcHJpbnRrKCBLRVJOX0RFQlVHICJwbWM1NTE6IGFwZXJ0dXJlIHNldCB0byAlZFxuIiwKLQkJCShwcml2LT5iYXNlX21hcDAgJiAweEYwKT4+NCApOworCQlwcmludGsoS0VSTl9ERUJVRyAicG1jNTUxOiBhcGVydHVyZSBzZXQgdG8gJWRcbiIsCisJCQkocHJpdi0+YmFzZV9tYXAwICYgMHhGMCkgPj4gNCk7CiAjZW5kaWYKIAotICAgICAgICAgICAgICAgIG10ZC0+c2l6ZSAJPSBtc2l6ZTsKLSAgICAgICAgICAgICAgICBtdGQtPmZsYWdzIAk9IE1URF9DQVBfUkFNOwotICAgICAgICAgICAgICAgIG10ZC0+ZXJhc2UgCT0gcG1jNTUxX2VyYXNlOwotICAgICAgICAgICAgICAgIG10ZC0+cmVhZCAJPSBwbWM1NTFfcmVhZDsKLSAgICAgICAgICAgICAgICBtdGQtPndyaXRlIAk9IHBtYzU1MV93cml0ZTsKLSAgICAgICAgICAgICAgICBtdGQtPnBvaW50IAk9IHBtYzU1MV9wb2ludDsKLSAgICAgICAgICAgICAgICBtdGQtPnVucG9pbnQgCT0gcG1jNTUxX3VucG9pbnQ7Ci0gICAgICAgICAgICAgICAgbXRkLT50eXBlIAk9IE1URF9SQU07Ci0gICAgICAgICAgICAgICAgbXRkLT5uYW1lIAk9ICJQTUM1NTEgUkFNIGJvYXJkIjsKLSAgICAgICAgICAgICAgICBtdGQtPmVyYXNlc2l6ZSAJPSAweDEwMDAwOwotICAgICAgICAgICAgICAgIG10ZC0+d3JpdGVzaXplICA9IDE7Ci0gICAgICAgICAgICAgICAgbXRkLT5vd25lciA9IFRISVNfTU9EVUxFOworCQltdGQtPnNpemUgPSBtc2l6ZTsKKwkJbXRkLT5mbGFncyA9IE1URF9DQVBfUkFNOworCQltdGQtPmVyYXNlID0gcG1jNTUxX2VyYXNlOworCQltdGQtPnJlYWQgPSBwbWM1NTFfcmVhZDsKKwkJbXRkLT53cml0ZSA9IHBtYzU1MV93cml0ZTsKKwkJbXRkLT5wb2ludCA9IHBtYzU1MV9wb2ludDsKKwkJbXRkLT51bnBvaW50ID0gcG1jNTUxX3VucG9pbnQ7CisJCW10ZC0+dHlwZSA9IE1URF9SQU07CisJCW10ZC0+bmFtZSA9ICJQTUM1NTEgUkFNIGJvYXJkIjsKKwkJbXRkLT5lcmFzZXNpemUgPSAweDEwMDAwOworCQltdGQtPndyaXRlc2l6ZSA9IDE7CisJCW10ZC0+b3duZXIgPSBUSElTX01PRFVMRTsKIAotICAgICAgICAgICAgICAgIGlmIChhZGRfbXRkX2RldmljZShtdGQpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcmludGsoS0VSTl9OT1RJQ0UgInBtYzU1MTogRmFpbGVkIHRvIHJlZ2lzdGVyIG5ldyBkZXZpY2VcbiIpOwotCQkJaW91bm1hcChwcml2LT5zdGFydCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBrZnJlZShtdGQtPnByaXYpOwotICAgICAgICAgICAgICAgICAgICAgICAga2ZyZWUobXRkKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBwcmludGsoS0VSTl9OT1RJQ0UgIlJlZ2lzdGVyZWQgcG1jNTUxIG1lbW9yeSBkZXZpY2UuXG4iKTsKLSAgICAgICAgICAgICAgICBwcmludGsoS0VSTl9OT1RJQ0UgIk1hcHBlZCAlZE0gb2YgbWVtb3J5IGZyb20gMHglcCB0byAweCVwXG4iLAotICAgICAgICAgICAgICAgICAgICAgICBwcml2LT5hc2l6ZT4+MjAsCi0gICAgICAgICAgICAgICAgICAgICAgIHByaXYtPnN0YXJ0LAotICAgICAgICAgICAgICAgICAgICAgICBwcml2LT5zdGFydCArIHByaXYtPmFzaXplKTsKLSAgICAgICAgICAgICAgICBwcmludGsoS0VSTl9OT1RJQ0UgIlRvdGFsIG1lbW9yeSBpcyAlZCVjXG4iLAotCSAgICAgICAJCShsZW5ndGg8MTAyNCk/bGVuZ3RoOgotCQkJCShsZW5ndGg8MTA0ODU3Nik/bGVuZ3RoPj4xMDpsZW5ndGg+PjIwLAotICAgICAgICAgICAgICAgCQkobGVuZ3RoPDEwMjQpPydCJzoobGVuZ3RoPDEwNDg1NzYpPydLJzonTScpOworCQlpZiAoYWRkX210ZF9kZXZpY2UobXRkKSkgeworCQkJcHJpbnRrKEtFUk5fTk9USUNFICJwbWM1NTE6IEZhaWxlZCB0byByZWdpc3RlciBuZXcgIgorCQkJCSJkZXZpY2VcbiIpOworCQkJcGNpX2lvdW5tYXAoUENJX0RldmljZSwgcHJpdi0+c3RhcnQpOworCQkJa2ZyZWUobXRkLT5wcml2KTsKKwkJCWtmcmVlKG10ZCk7CisJCQlicmVhazsKKwkJfQorCisJCS8qIEtlZXAgYSByZWZlcmVuY2UgYXMgdGhlIGFkZF9tdGRfZGV2aWNlIHdvcmtlZCAqLworCQlwY2lfZGV2X2dldChQQ0lfRGV2aWNlKTsKKworCQ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5tYXAyOwogCX0KIAogCWludGVsX210ZCA9IGRvX21hcF9wcm9iZSgiY2ZpX3Byb2JlIiwgJm5ldHRlbF9pbnRlbF9tYXApOwogCWlmICghIGludGVsX210ZCkgewotCQlpb3VubWFwKCh2b2lkICopIG5ldHRlbF9pbnRlbF9tYXAudmlydCk7Ci0JCXJldHVybigtRU5YSU8pOworCQlyYyA9IC1FTlhJTzsKKwkJZ290byBvdXRfdW5tYXAxOwogCX0KIAogCWludGVsMXNpemUgPSBpbnRlbF9tdGQtPnNpemUgLSBpbnRlbDBzaXplOwpAQCAtNDU2LDYgKzQ2MCwxOCBAQAogI2VuZGlmCiAKIAlyZXR1cm4ocmMpOworCisjaWZkZWYgQ09ORklHX01URF9DRklfSU5URUxFWFQKK291dF91bm1hcDE6CisJaW91bm1hcCgodm9pZCAqKSBuZXR0ZWxfaW50ZWxfbWFwLnZpcnQpOworI2VuZGlmCisKK291dF91bm1hcDI6CisJaW91bm1hcChuZXR0ZWxfbW1jcnApOworCWlvdW5tYXAobmV0dGVsX2FtZF9tYXAudmlydCk7CisKKwlyZXR1cm4ocmMpOworCQkKIH0KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCkBAIC00NjksNiArNDg1LDEwIEBACiAJCWRlbF9tdGRfcGFydGl0aW9ucyhhbWRfbXRkKTsKIAkJbWFwX2Rlc3Ryb3koYW1kX210ZCk7CiAJfQorCWlmIChuZXR0ZWxfbW1jcnApIHsKKwkJaW91bm1hcChuZXR0ZWxfbW1jcnApOworCQluZXR0ZWxfbW1jcnAgPSBOVUxMOworCX0KIAlpZiAobmV0dGVsX2FtZF9tYXAudmlydCkgewogCQlpb3VubWFwKG5ldHRlbF9hbWRfbWFwLnZpcnQpOwogCQluZXR0ZWxfYW1kX21hcC52aXJ0ID0gTlVMTDsKZGlmZiAtLWdpdCBhL2RyaXZlcnMvbXRkL21hcHMvb2NvdGVh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yBpIDwgbGVuOyBpKyspCisJCWhsICs9IHNwcmludGYob3V0YWRkcitobCwgIiUwMXgiLCAodW5zaWduZWQgaW50KSBhZGRyW2ldKTsKKwlobCArPSBzcHJpbnRmKG91dGFkZHIraGwsICIgIik7CisJcmV0dXJuIGhsOworfQorCitzdGF0aWMgaW5saW5lIGludCBzcHJpbnRydyh1bnNpZ25lZCBjaGFyICpvdXRhZGRyLCB1bnNpZ25lZCBjaGFyICphZGRyLAorCQkJICAgdW5zaWduZWQgaW50IGxlbikKK3sKKwlpbnQgaGwsIGlubCwgYywgY3g7CisKKwlobCA9IHNwcmludGYob3V0YWRkciwgIgkgICAiKTsKKwlpbmwgPSAwOworCWZvciAoYyA9IDA7IGMgPCAobGVuIC8gMTYpOyBjKyspIHsKKwkJaGwgKz0gc3ByaW50Y2wob3V0YWRkcitobCwgYWRkcitpbmwsIDE2KTsKKwkJaW5sICs9IDE2OworCX0KKwljeCA9IGxlbiUxNjsKKwlpZiAoY3gpIHsKKwkJaGwgKz0gc3ByaW50Y2wob3V0YWRkcitobCwgYWRkcitpbmwsIGN4KTsKKwkJaW5sICs9IGN4OworCX0KKwlobCArPSBzcHJpbnRmKG91dGFkZHIraGwsICJcbiIpOworCXJldHVybiBobDsKK30KKworc3RhdGljIGlubGluZSBpbnQgc3ByaW50aHgodW5zaWduZWQgY2hhciAqdGl0bGUsIHVuc2lnbmVkIGNoYXIgKm91dGFkZHIsCisJCQkgICB1bnNpZ25lZCBjaGFyICphZGRyLCB1bnNpZ25lZCBpbnQgbGVuKQoreworCWludCBobCwgaW5sLCByLCByeDsKKworCWhsID0gc3ByaW50ZihvdXRhZGRyLCAiXG4lc1xuIiwgdGl0bGUpOworCWlubCA9IDA7CisJZm9yIChyID0gMDsgciA8IChsZW4gLyA2NCk7IHIrKykgeworCQlobCArPSBzcHJpbnRydyhvdXRhZGRyK2hsLCBhZGRyK2lubCwgNjQpOworCQlpbmwgKz0gNjQ7CisJfQorCXJ4ID0gbGVuICUgNjQ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IHsKQEAgLTIwMzgsNiArMjA4Miw3IEBACiAgICAgICAgIH0KICAgICAgICAgbmFtZVtpXSA9ICdcMCc7CiAKKwlyZWFkX2xvY2tfaXJxc2F2ZSgmaXVjdl9jb25ucy5pdWN2X3J3bG9jaywgZmxhZ3MpOwogICAgICAgICB3aGlsZSAoKmNsaXN0KSB7CiAgICAgICAgICAgICAgICAgbmRldiA9ICgqY2xpc3QpLT5uZXRkZXY7CiAgICAgICAgICAgICAgICAgcHJpdiA9IChzdHJ1Y3QgbmV0aXVjdl9wcml2KiluZGV2LT5wcml2OwpAQCAtMjA0Nyw2ICsyMDkyLDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIGNsaXN0ID0gJigoKmNsaXN0KS0+bmV4dCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgICB9CisJCXJlYWRfdW5sb2NrX2lycXJlc3RvcmUoJml1Y3ZfY29ubnMuaXVjdl9yd2xvY2ssIGZsYWdzKTsKICAgICAgICAgICAgICAgICBpZiAobmRldi0+ZmxhZ3MgJiAoSUZGX1VQIHwgSUZGX1JVTk5JTkcpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBQUklOVF9XQVJOKAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibmV0aXVjdjogbmV0IGRldmljZSAlcyBhY3RpdmUgd2l0aCBwZWVyICVzXG4iLApAQCAtMjA2MCw2ICsyMTA2LDcgQEAKICAgICAgICAgICAgICAgICBuZXRpdWN2X3VucmVnaXN0ZXJfZGV2aWNlKGRldik7CiAgICAgICAgICAgICAgICAgcmV0dXJuIGNvdW50OwogICAgICAgICB9CisJcmVhZF91bmxvY2tfaXJxcmVzdG9yZSgmaXVjdl9jb25ucy5pdWN2X3J3bG9jaywgZmxhZ3MpOwogICAgICAgICBQUklOVF9XQVJOKCJuZXRpdWN2OiBuZXQgZGV2aWNlICVzIHVua25vd25cbiIsIG5hbWUpOwogCUlVQ1ZfREJGX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2tfYnVmZiAqCitxZXRoX3JlYWxsb2NfaGVhZHJvb20oc3RydWN0IHFldGhfY2FyZCAqY2FyZCwgc3RydWN0IHNrX2J1ZmYgKnNrYiwgaW50IHNpemUpCiB7Ci0Jc3RydWN0IHNrX2J1ZmYgKm5ld19za2IgPSBOVUxMOworCXN0cnVjdCBza19idWZmICpuZXdfc2tiID0gc2tiOwogCi0JaWYgKHNrYl9oZWFkcm9vbSgqc2tiKSA8IHNpemUpewotCQluZXdfc2tiID0gc2tiX3JlYWxsb2NfaGVhZHJvb20oKnNrYiwgc2l6ZSk7Ci0JCWlmICghbmV3X3NrYikgewotICAgICAgICAgICAgICAgICAgICAgICAgUFJJTlRfRVJSKCJxZXRoX3ByZXBhcmVfc2tiOiBjb3VsZCAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm5vdCByZWFsbG9jIGhlYWRyb29tIGZvciBxZXRoX2hkciAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm9uIGludGVyZmFjZSAlcyIsIFFFVEhfQ0FSRF9JRk5BTUUoY2FyZCkpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FTk9NRU07Ci0gICAgICAgICAgICAgICAgfQotCQlrZnJlZV9za2IoKnNrYik7Ci0gICAgICAgICAgICAgICAgKnNrYiA9IG5ld19za2I7Ci0JfQotCXJldHVybiAwOworCWlmIChza2JfaGVhZHJvb20oc2tiKSA+PSBzaXplKQorCQlyZXR1cm4gc2tiOworCW5ld19za2IgPSBza2JfcmVhbGxvY19oZWFkcm9vbShza2IsIHNpemUpOworCWlmICghbmV3X3NrYikgCisJCVBSSU5UX0VSUigiQ291bGQgbm90IHJlYWxsb2MgaGVhZHJvb20gZm9yIHFldGhfaGRyICIKKwkJCSAgIm9uIGludGVyZmFjZSAlcyIsIFFFVEhfQ0FSRF9JRk5BTUUoY2FyZCkpOworCXJldHVybiBuZXdfc2tiOwogfQogCiBzdGF0aWMgaW5saW5lIHN0cnVjdCBza19idWZmICoKQEAgLTg4NSwxNiArODgxLDE1IEBACiAgICAgICAgIGlmICghc2tiX2Nsb25lZChza2IpKQogICAgICAgICAgICAgICAgIHJldHVybiBza2I7CiAgICAgICAgIG5za2IgPSBza2JfY29weShza2IsIHByaSk7Ci0gICAgICAgIGtmcmVlX3NrYihza2IpOyAvKiBmcmVlIG91ciBzaGFyZWQgY29weSAqLwogICAgICAgICByZXR1cm4gbnNrYjsKIH0KIAogc3RhdGljIGlubGluZSB2b2lkICoKLXFldGhfcHVzaF9za2Ioc3RydWN0IHFldGhfY2FyZCAqY2FyZCwgc3RydWN0IHNrX2J1ZmYgKipza2IsIGludCBzaXplKQorcWV0aF9wdXNoX3NrYihzdHJ1Y3QgcWV0aF9jYXJkICpjYXJkLCBzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCBpbnQgc2l6ZSkKIHsKICAgICAgICAgdm9pZCAqaGRyOwogCi0JaGRyID0gKHZvaWQgKikgc2tiX3B1c2goKnNrYiwgc2l6ZSk7CisJaGRyID0gKHZvaWQgKikgc2tiX3B1c2goc2tiLCBzaXplKTsKICAgICAgICAgLyoKICAgICAgICAgICogc2FuaXR5IGNoZWNrLCB0aGUgTGludXggbWVtb3J5IGFsbG9jYXRpb24gc2NoZW1lIHNob3VsZAogICAgICAgICAgKiBuZXZlciBwcmVzZW50IHVzIGNhc2VzIGxpa2UgdGhpcyBvbmUgKHRoZSBxZGlvIGhlYWRlciBzaXplIHBsdXMKQEAgLTkwMyw4ICs4OTgsNyBAQAogICAgICAgICBpZiAoKCgodW5zaWduZWQgbG9uZykgaGRyKSAmICh+KFBBR0VfU0laRSAtIDEpKSkgIT0KICAgICAgICAgICAgICgoKHVuc2lnbmVkIGxvbmcpIGhkciArIHNpemUgKwogICAgICAgICAgICAgICBRRVRIX0lQX0hFQURFUl9TSVpFKSAmICh+KFBBR0VfU0laRSAtIDEpKSkpIHsKLSAgICAgICAgICAgICAgICBQUklOVF9FUlIoInFldGhfcHJlcG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291bnQrKykgewogCQlpZiAoaW5bY291bnRdID4gMjU1KQpAQCAtMTEyMywyNCArMTExNiwyOCBAQAogc3RhdGljIGlubGluZSBpbnQKIHFldGhfc3RyaW5nX3RvX2lwYWRkcjYoY29uc3QgY2hhciAqYnVmLCBfX3U4ICphZGRyKQogewotCWNoYXIgKmVuZCwgKnN0YXJ0OworCWNvbnN0IGNoYXIgKmVuZCwgKmVuZF90bXAsICpzdGFydDsKIAlfX3UxNiAqaW47CiAgICAgICAgIGNoYXIgbnVtWzVdOwogICAgICAgICBpbnQgbnVtMiwgY250LCBvdXQsIGZvdW5kLCBzYXZlX2NudDsKICAgICAgICAgdW5zaWduZWQgc2hvcnQgaW5fdG1wWzhdID0gezAsIH07CiAKIAljbnQgPSBvdXQgPSBmb3VuZCA9IHNhdmVfY250ID0gbnVtMiA9IDA7Ci0gICAgICAgIGVuZCA9IHN0YXJ0ID0gKGNoYXIgKikgYnVmOworICAgICAgICBlbmQgPSBzdGFydCA9IGJ1ZjsKIAlpbiA9IChfX3UxNiAqKSBhZGRyOwogCW1lbXNldChpbiwgMCwgMTYpOwotICAgICAgICB3aGlsZSAoZW5kKSB7Ci0gICAgICAgICAgICAgICAgZW5kID0gc3RyY2hyKGVuZCwnOicpOworICAgICAgICB3aGlsZSAoKmVuZCkgeworICAgICAgICAgICAgICAgIGVuZCA9IHN0cmNocihzdGFydCwnOicpOwogICAgICAgICAgICAgICAgIGlmIChlbmQgPT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICAgICAgZW5kID0gKGNoYXIgKilidWYgKyAoc3RybGVuKGJ1ZikpOwotICAgICAgICAgICAgICAgICAgICAgICAgb3V0ID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVuZCA9IGJ1ZiArIHN0cmxlbihidWYpOworCQkJaWYgKChlbmRfdG1wID0gc3RyY2hyKHN0YXJ0LCAnXG4nKSkgIT0gTlVMTCkKKwkJCQllbmQgPSBlbmRfdG1wOworCQkJb3V0ID0gMTsKIC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lyZXR1cm4gMTsKIAkJCX0KKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHN0cm5pY21wKGRhdGEsICJwcmVmaXhwYXRoIiwgMTApID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdmFsdWUgfHwgISp2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGsoS0VSTl9XQVJOSU5HCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiQ0lGUzogaW52YWxpZCBwYXRoIHByZWZpeFxuIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAxOyAgICAgICAvKiBuZWVkc19hcmc7ICovCisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHRlbXBfbGVuID0gc3Rybmxlbih2YWx1ZSwgMTAyNCkpIDwgMTAyNCkgeworCQkJCWlmKHZhbHVlWzBdICE9ICcvJykKKwkJCQkJdGVtcF9sZW4rKzsgIC8qIG1pc3NpbmcgbGVhZGluZyBzbGFzaCAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2wtPnByZXBhdGggPSBrbWFsbG9jKHRlbXBfbGVuKzEsR0ZQX0tFUk5FTCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHZvbC0+cHJlcGF0aCA9PSBOVUxMKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAxOworCQkJCWlmKHZhbHVlWzBdICE9ICcvJykgeworCQkJCQl2b2wtPnByZXBhdGhbMF0gPSAnLyc7CisJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJjcHkodm9sLT5wcmVwYXRoKzEsdmFsdWUpOworCQkJCX0gZWxzZQorCQkJCQlzdHJjcHkodm9sLT5wcmVwYXRoLHZhbHVlKTsKKwkJCQljRllJKDEsKCJwcmVmaXggcGF0aCAlcyIsdm9sLT5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A0LXg3RgogCiAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0vLyBDQUNIRV9MSU5FXzQtNSAweDAxMDAgLSAweDAxRkYgQ29udGFpbnMgUE1DIGludGVycnVwdCBkYXRhCisvLyBDQUNIRV9MSU5FXzQtNSAweDAxODAgLSAweDAyN0YgQ29udGFpbnMgUE1DIGludGVycnVwdCBkYXRhCiAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAJdTgJcG1jX3NhdmVfYXJlYVsyNTZdOwkvLyBQTUMgaW50ZXJydXB0IEFyZWEgICAgICAgICAgIHgwMC14RkYKIH0gX19hdHRyaWJ1dGVfXygoX19hbGlnbmVkX18oMHg0MDApKSk7CiAKIGV4dGVybiBzdHJ1Y3QgbHBwYWNhIGxwcGFjYVtdOwogCisvKgorICogU0xCIHNoYWRvdyBidWZmZXIgc3RydWN0dXJlIGFzIGRlZmluZWQgaW4gdGhlIFBBUFIuICBUaGUgc2F2ZV9hcmVhCisgKiBjb250YWlucyBhZGphY2VudCBFU0lEIGFuZCBWU0lEIHBhaXJzIGZvciBlYWNoIHNoYWRvd2VkIFNMQi4gIFRoZQorICogRVNJRCBpcyBzdG9yZWQgaW4gdGhlIGxvd2VyIDY0Yml0cywgdGhlbiB0aGUgVlNJRC4KKyAqLworc3RydWN0IHNsYl9zaGFkb3cgeworCXUzMglwZXJzaXN0ZW50OwkJLy8gTnVtYmVyIG9mIHBlcnNpc3RlbnQgU0xCcwl4MDAteDAzCisJdTMyCWJ1ZmZlcl9sZW5ndGg7CQkvLyBUb3RhbCBzaGFkb3cgYnVmZmVyIGxlbmd0aAl4MDQteDA3CisJdTY0CXJlc2VydmVkOwkJLy8gQWxpZ25tZW50CQkJeDA4LXgwZgorCXN0cnVjdAl7CisJCXU2NCAgICAgZXNpZDsK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gICAgICAgIDIxCiAjZGVmaW5lIF9fTlJfdW1vdW50ICAgICAgICAgICAgICAyMgotI2RlZmluZSBfX05SX3NldHVpZCAgICAgICAgICAgICAgMjMKLSNkZWZpbmUgX19OUl9nZXR1aWQgICAgICAgICAgICAgIDI0Ci0jZGVmaW5lIF9fTlJfc3RpbWUgICAgICAgICAgICAgICAyNQogI2RlZmluZSBfX05SX3B0cmFjZSAgICAgICAgICAgICAgMjYKICNkZWZpbmUgX19OUl9hbGFybSAgICAgICAgICAgICAgIDI3CiAjZGVmaW5lIF9fTlJfcGF1c2UgICAgICAgICAgICAgICAyOQpAQCAtNTEsMTEgKzQ2LDcgQEAKICNkZWZpbmUgX19OUl9waXBlICAgICAgICAgICAgICAgIDQyCiAjZGVmaW5lIF9fTlJfdGltZXMgICAgICAgICAgICAgICA0MwogI2RlZmluZSBfX05SX2JyayAgICAgICAgICAgICAgICAgNDUKLSNkZWZpbmUgX19OUl9zZXRnaWQgICAgICAgICAgICAgIDQ2Ci0jZGVmaW5lIF9fTlJfZ2V0Z2lkICAgICAgICAgICAgICA0NwogI2RlZmluZSBfX05SX3NpZ25hbCAgICAgICAgICAgICAgNDgKLSNkZWZpbmUgX19OUl9nZXRldWlkICAgICAgICAgICAgIDQ5Ci0jZGVmaW5lIF9fTlJfZ2V0ZWdpZCAgICAgICAgICAgICA1MAogI2RlZmluZSBfX05SX2FjY3QgICAgICAgICAgICAgICAgNTEKICNkZWZpbmUgX19OUl91bW91bnQyICAgICAgICAgICAgIDUyCiAjZGVmaW5lIF9fTlJfaW9jdGwgICAgICAgICAgICAgICA1NApAQCAtNjksMTggKzYwLDEzIEBACiAjZGVmaW5lIF9fTlJfZ2V0cGdycCAgICAgICAgICAgICA2NQogI2RlZmluZSBfX05SX3NldHNpZCAgICAgICAgICAgICAgNjYKICNkZWZpbmUgX19OUl9zaWdhY3Rpb24gICAgICAgICAgIDY3Ci0jZGVmaW5lIF9fTlJfc2V0cmV1aWQgICAgICAgICAgICA3MAotI2RlZmluZSBfX05SX3NldHJlZ2lkICAgICAgICAgICAgNzEKICNkZWZpbmUgX19OUl9zaWdzdXNwZW5kICAgICAgICAgIDcyCiAjZGVmaW5lIF9fTlJfc2lncGVuZGluZyAgICAgICAgICA3MwogI2RlZmluZSBfX05SX3NldGhvc3RuYW1lICAgICAgICAgNzQKICNkZWZpbmUgX19OUl9zZXRybGltaXQgICAgICAgICAgIDc1Ci0jZGVmaW5lIF9fTlJfZ2V0cmxpbWl0ICAgICAgICAgICA3NgogI2RlZmluZSBfX05SX2dldHJ1c2FnZSAgICAgICAgICAgNzcKICNkZWZpbmUgX19OUl9nZXR0aW1lb2ZkYXkgICAgICAgIDc4CiAjZGVmaW5lIF9fTlJfc2V0dGltZW9mZGF5ICAgICAgICA3OQotI2RlZmluZSBfX05SX2dldGdyb3VwcyAgICAgICAgICAgODAKLSNkZWZpbmUgX19OUl9zZXRncm91cHMgICAgICAgICAgIDgxCiAjZGVmaW5lIF9fTlJfc3ltbGluayAgICAgICAgICAgICA4MwogI2RlZmluZSBfX05SX3JlYWRsaW5rICAgICAgICAgICAgODUKICNkZWZpbmUgX19OUl91c2VsaWIgICAgICAgICAgICAgIDg2CkBAIC05MiwxMiArNzgsMTAgQEAKICNkZWZpbmUgX19OUl90cnVuY2F0ZSAgICAgICAgICAgIDkyCiAjZGVmaW5lIF9fTlJfZnRydW5jYXRlICAgICAgICAgICA5MwogI2RlZmluZSBfX05SX2ZjaG1vZCAgICAgICAgICAgICAgOTQKLSNkZWZpbmUgX19OUl9mY2hvd24gICAgICAgICAgICAgIDk1CiAjZGVmaW5lIF9fTlJfZ2V0cHJpb3JpdHkgICAgICAgICA5NgogI2RlZmluZSBfX05SX3NldHByaW9yaXR5ICAgICAgICAgOTcKICNkZWZpbmUgX19OUl9zdGF0ZnMgICAgICAgICAgICAgIDk5CiAjZGVmaW5lIF9fTlJfZnN0YXRmcyAgICAgICAgICAgIDEwMAotI2RlZmluZSBfX05SX2lvcGVybSAgICAgICAgICAgICAxMDEKICNkZWZpbmUgX19OUl9zb2NrZXRjYWxsICAgICAgICAgMTAyCiAjZGVmaW5lIF9fTlJfc3lzbG9nICAgICAgICAgICAgIDEwMwogI2RlZmluZSBfX05SX3NldGl0aW1lciAgICAgICAgICAxMDQKQEAgLTEzMSwxMSArMTE1LDcgQEAKICNkZWZpbmUgX19OUl9zeXNmcyAgICAgICAgICAgICAgMTM1CiAjZGVmaW5lIF9fTlJfcGVyc29uYWxpdHkgICAgICAgIDEzNgogI2RlZmluZSBfX05SX2Fmc19zeXNjYWxsICAgICAgICAxMzcgLyogU3lzY2FsbCBmb3IgQW5kcmV3IEZpbGUgU3lzdGVtICovCi0jZGVmaW5lIF9fTlJfc2V0ZnN1aWQgICAgICAgICAgIDEzOAotI2RlZmluZSBfX05SX3NldGZzZ2lkICAgICAgICAgICAxMzkKLSNkZWZpbmUgX19OUl9fbGxzZWVrICAgICAgICAgICAgMTQwCiAjZGVmaW5lIF9fTlJfZ2V0ZGVudHMgICAgICAgICAgIDE0MQotI2RlZmluZSBfX05SX19uZXdzZWxlY3QgICAgICAgICAxNDIKICNkZWZpbmUgX19OUl9mbG9jayAgICAgICAgICAgICAgMTQzCiAjZGVmaW5lIF9fTlJfbXN5bmMgICAgICAgICAgICAgIDE0NAogI2RlZmluZSBfX05SX3JlYWR2ICAgICAgICAgICAgICAxNDUKQEAgLTE1NywxMyArMTM3LDkgQEAKICNkZWZpbmUgX19OUl9zY2hlZF9ycl9nZXRfaW50ZXJ2YWwgICAgICAxNjEKICNkZWZpbmUgX19OUl9uYW5vc2xlZXAgICAgICAgICAgMTYyCiAjZGVmaW5lIF9fTlJfbXJlbWFwICAgICAgICAgICAgIDE2MwotI2RlZmluZSBfX05SX3NldHJlc3VpZCAgICAgICAgICAxNjQKLSNkZWZpbmUgX19OUl9nZXRyZXN1aWQgICAgICAgICAgMTY1CiAjZGVmaW5lIF9fTlJfcXVlcnlfbW9kdWxlICAgICAgIDE2NwogI2RlZmluZSBfX05SX3B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lwdG9fY29tcF9uYW1lKHN0cnVjdCBjcnlwdG9fY29tcCAqdGZtKQoreworCXJldHVybiBjcnlwdG9fdGZtX2FsZ19uYW1lKGNyeXB0b19jb21wX3RmbSh0Zm0pKTsKK30KKworc3RhdGljIGlubGluZSBzdHJ1Y3QgY29tcHJlc3NfdGZtICpjcnlwdG9fY29tcF9jcnQoc3RydWN0IGNyeXB0b19jb21wICp0Zm0pCit7CisJcmV0dXJuICZjcnlwdG9fY29tcF90Zm0odGZtKS0+Y3J0X2NvbXByZXNzOworfQorCitzdGF0aWMgaW5saW5lIGludCBjcnlwdG9fY29tcF9jb21wcmVzcyhzdHJ1Y3QgY3J5cHRvX2NvbXAgKnRmbSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICpzcmMsIHVuc2lnbmVkIGludCBzbGVuLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTggKmRzdCwgdW5zaWduZWQgaW50ICpkbGVuKQogewotCUJVR19PTihjcnlwdG9fdGZtX2FsZ190eXBlKHRmbSkgIT0gQ1JZUFRPX0FMR19UWVBFX0NPTVBSRVNTKTsKLQlyZXR1cm4gdGZtLT5jcnRfY29tcHJlc3MuY290X2NvbXByZXNzKHRmbSwgc3JjLCBzbGVuLCBkc3QsIGRsZW4pOworCXJldHVybiBjcnlwdG9fY29tcF9jcnQodGZtKS0+Y290X2NvbXByZXNzKHRmbSwgc3JjLCBzbGVuLCBkc3QsIGRsZW4pOwogfQogCi1zdGF0aWMgaW5saW5lIGludCBjcnlwdG9fY29tcF9kZWNvbXByZXNzKHN0cnVjdCBjcnlwdG9fdGZtICp0Zm0sCitzdGF0aWMgaW5saW5lIGludCBjcnlwdG9fY29tcF9kZWNvbXByZXNzKHN0cnVjdCBjcnlwdG9fY29tcCAqdGZtLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1OCAqc3JjLCB1bnNpZ25lZCBp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sOCBAQAogCiAJdTMyICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxhZ3M7CiAKKwlzdHJ1Y3QgaXdfY21fdmVyYnMJICAgICAqaXdjbTsKKwogCWludAkJICAgICAgICAgICAoKnF1ZXJ5X2RldmljZSkoc3RydWN0IGliX2RldmljZSAqZGV2aWNlLAogCQkJCQkJICAgc3RydWN0IGliX2RldmljZV9hdHRyICpkZXZpY2VfYXR0cik7CiAJaW50CQkgICAgICAgICAgICgqcXVlcnlfcG9ydCkoc3RydWN0IGliX2RldmljZSAqZGV2aWNlLApAQCAtODg4LDcgKzkwNSw4IEBACiAJCQkJCQkgc3RydWN0IGliX3VkYXRhICp1ZGF0YSk7CiAJaW50ICAgICAgICAgICAgICAgICAgICAgICAgKCptb2RpZnlfc3JxKShzdHJ1Y3QgaWJfc3JxICpzcnEsCiAJCQkJCQkgc3RydWN0IGliX3NycV9hdHRyICpzcnFfYXR0ciwKLQkJCQkJCSBlbnVtIGliX3NycV9hdHRyX21hc2sgc3JxX2F0dHJfbWFzayk7CisJCQkJCQkgZW51bSBpYl9zcnFfYXR0cl9tYXNrIHNycV9hdHRyX21hc2ssCisJCQkJCQkgc3RydWN0IGliX3VkYXRhICp1ZGF0YSk7CiAJaW50ICAgICAgICAgICAgICAgICAgICAgICAgKCpxdWVyeV9zcnEpKHN0cnVjdCBpYl9zcnEgKnNycSwKIAkJCQkJCXN0cnVjdCBpYl9zcnFfYXR0ciAqc3JxX2F0dHIpOwogCWludCAgICAgICAgICAgICAgICAgICAgICAgICgqZGVzdHJveV9zcnEpKHN0cnVjdCBpYl9zcnEgKnNycSk7CkBAIC05MDAsNyArOTE4LDggQEAKIAkJCQkJCXN0cnVjdCBpYl91ZGF0YSAqdWRhdGEpOwogCWludCAgICAgICAgICAgICAgICAgICAgICAgICgqbW9kaWZ5X3FwKShzdHJ1Y3QgaWJfcXAgKnFwLAogCQkJCQkJc3RydWN0IGliX3FwX2F0dHIgKnFwX2F0dHIsCi0JCQkJCQl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KIHsKLSAgICAgICAgLm5hbWUgPSAic2VycGVudCIsCisgICAgICAgIC5uYW1lID0gImNiYyhzZXJwZW50KSIsCisgICAgICAgIC5jb21wYXQgPSAic2VycGVudCIsCiAKICAgICAgICAgLnVpbmZvID0gewogICAgICAgICAgICAgICAgIC5lbmNyID0gewpAQCAtMjM3LDcgKzI0OSw4IEBACiAgICAgICAgIH0KIH0sCiB7Ci0gICAgICAgIC5uYW1lID0gInR3b2Zpc2giLAorICAgICAgICAubmFtZSA9ICJjYmModHdvZmlzaCkiLAorICAgICAgICAuY29tcGF0ID0gInR3b2Zpc2giLAogICAgICAgICAgICAgICAgICAKICAgICAgICAgLnVpbmZvID0gewogICAgICAgICAgICAgICAgIC5lbmNyID0gewpAQCAtMzUwLDggKzM2Myw4IEBACiBFWFBPUlRfU1lNQk9MX0dQTCh4ZnJtX2NhbGdfZ2V0X2J5aWQpOwogCiBzdGF0aWMgc3RydWN0IHhmcm1fYWxnb19kZXNjICp4ZnJtX2dldF9ieW5hbWUoc3RydWN0IHhmcm1fYWxnb19kZXNjICpsaXN0LAotCQkJCQkgICAgICBpbnQgZW50cmllcywgY2hhciAqbmFtZSwKLQkJCQkJICAgICAgaW50IHByb2JlKQorCQkJCQkgICAgICBpbnQgZW50cmllcywgdTMyIHR5cGUsIHUzMiBtYXNrLAorCQkJCQkgICAgICBjaGFyICpuYW1lLCBpbnQgcHJvYmUpCiB7CiAJaW50IGksIHN0YXR1czsKIApAQCAtMzU5LDcgKzM3Miw4IEBACiAJCXJldHVybiBOVUxMOwogCiAJZm9yIChpID0gMDsgaSA8IGVudHJpZXM7IGkrKykgewotCQlpZiAoc3RyY21wKG5hbWUsIGxpc3RbaV0ubmFtZSkpCisJCWlmIChzdHJjbXAobmFtZSwgbGlzdFtpXS5uYW1lKSAmJgorCQkgICAgKCFsaXN0W2ldLmNvbXBhdCB8fCBzdHJjbXAobmFtZSwgbGlzdFtpXS5jb21wYXQpKSkKIAkJCWNvbnRpbnVlOwogCiAJ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