From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1is3Dv-0002Fb-F8 for barebox@lists.infradead.org; Thu, 16 Jan 2020 11:22:20 +0000 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1is3Ds-0005GA-4u for barebox@lists.infradead.org; Thu, 16 Jan 2020 12:22:00 +0100 Received: from str by dude.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1is3Dr-0004Mf-S4 for barebox@lists.infradead.org; Thu, 16 Jan 2020 12:21:59 +0100 From: Steffen Trumtrar Date: Thu, 16 Jan 2020 12:21:55 +0100 Message-Id: <20200116112155.19663-1-s.trumtrar@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH] fs: jffs2: add initial support for reading jffs2 To: Barebox List SW1wb3J0IHRoZSBqZmZzMiBmaWxlc3lzdGVtIGNvZGUgZnJvbSBMaW51eCB2NS41LXJjMSBhbmQg Y29udmVydCBpdAp0byB3b3JrIHdpdGggYmFyZWJveC4KCldyaXRpbmcgaXMgKm5vdCogc3VwcG9y dGVkLgoKVGVzdGluZyB3YXMgZG9uZSB3aXRoIGEgbjI1cTI1NmEtY29tcGF0aWJsZSBRdWFkU1BJ IGNoaXAgb24gYQpTb0NGUEdBLWJhc2VkIFNvY3JhdGVzIGJvYXJkLgoKVGVzdGluZyB3YXMgZG9u ZSB3aXRoIGEgY29tYmluYXRpb24gb2Y6Cgl1c2VyQHNvbWVsaW51eGhvc3Q6IG1rZnMuamZmczIg LS1lcmFzZWJsb2NrPTQgLWQgZnMvamZmczIvIC1vIGpmZnMyLmltZwoJcm9vdEB0YXJnZXQ6fiBm bGFzaF9lcmFzZSAtaiAvZGV2L210ZDUgMCAwCglyb290QHRhcmdldDp+IGRkIGlmPWpmZnMyLmlt ZyBvZj0vZGV2L210ZDUKCWJhcmVib3hARUJWIFNPQ3JhdGVzOi8gbW91bnQgL2Rldi9tdGQwLmRh dGEKCSguLi4pCgltb3VudGVkIC9kZXYvbXRkMC5kYXRhIG9uIC9tbnQvbXRkMC5kYXRhCgpTaWdu ZWQtb2ZmLWJ5OiBTdGVmZmVuIFRydW10cmFyIDxzLnRydW10cmFyQHBlbmd1dHJvbml4LmRlPgot LS0KIGZzL0tjb25maWcgICAgICAgICAgICAgfCAgICAxICsKIGZzL01ha2VmaWxlICAgICAgICAg ICAgfCAgICAxICsKIGZzL2pmZnMyL0tjb25maWcgICAgICAgfCAgIDQ4ICsrCiBmcy9qZmZzMi9N YWtlZmlsZSAgICAgIHwgICAgOSArCiBmcy9qZmZzMi9hY2wuaCAgICAgICAgIHwgICA0MiArKwog ZnMvamZmczIvYnVpbGQuYyAgICAgICB8ICA0MjUgKysrKysrKysrKysrCiBmcy9qZmZzMi9jb21w ci5jICAgICAgIHwgIDE2MCArKysrKwogZnMvamZmczIvY29tcHIuaCAgICAgICB8ICAxMTIgKysr KwogZnMvamZmczIvY29tcHJfbHpvLmMgICB8ICAgNTIgKysKIGZzL2pmZnMyL2NvbXByX3J0aW1l LmMgfCAgIDg2ICsrKwogZnMvamZmczIvY29tcHJfcnViaW4uYyB8ICAyNzAgKysrKysrKysKIGZz L2pmZnMyL2NvbXByX3psaWIuYyAgfCAgMTA0ICsrKwogZnMvamZmczIvZGVidWcuYyAgICAgICB8 ICA4NjggKysrKysrKysrKysrKysrKysrKysrKysrKwogZnMvamZmczIvZGVidWcuaCAgICAgICB8 ICAyNjkgKysrKysrKysKIGZzL2pmZnMyL2Rpci5jICAgICAgICAgfCAgMTM0ICsrKysKIGZzL2pm ZnMyL2ZzLmMgICAgICAgICAgfCAgNDU1ICsrKysrKysrKysrKysKIGZzL2pmZnMyL2pmZnMyX2Zz X2kuaCAgfCAgIDU1ICsrCiBmcy9qZmZzMi9qZmZzMl9mc19zYi5oIHwgIDE2MCArKysrKwogZnMv amZmczIvbWFsbG9jLmMgICAgICB8ICAzMTUgKysrKysrKysrCiBmcy9qZmZzMi9ub2RlbGlzdC5j ICAgIHwgIDkxNSArKysrKysrKysrKysrKysrKysrKysrKysrKwogZnMvamZmczIvbm9kZWxpc3Qu aCAgICB8ICA1MDYgKysrKysrKysrKysrKysrCiBmcy9qZmZzMi9vcy1saW51eC5oICAgIHwgIDE5 MyArKysrKysKIGZzL2pmZnMyL3JlYWQuYyAgICAgICAgfCAgMjI5ICsrKysrKysKIGZzL2pmZnMy L3JlYWRpbm9kZS5jICAgfCAxNDAxICsrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr KysrKysKIGZzL2pmZnMyL3NjYW4uYyAgICAgICAgfCAxMTU3ICsrKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKwogZnMvamZmczIvc3VtbWFyeS5oICAgICB8ICAyMTIgKysrKysrCiBmcy9q ZmZzMi9zdXBlci5jICAgICAgIHwgIDE0OSArKysrKwogZnMvamZmczIveGF0dHIuaCAgICAgICB8 ICAxMjYgKysrKwogaW5jbHVkZS9saW51eC9oYXNoLmggICB8ICAxMDQgKysrCiBpbmNsdWRlL2xp bnV4L2pmZnMyLmggIHwgIDIxOCArKysrKysrCiAzMCBmaWxlcyBjaGFuZ2VkLCA4Nzc2IGluc2Vy dGlvbnMoKykKIGNyZWF0ZSBtb2RlIDEwMDY0NCBmcy9qZmZzMi9LY29uZmlnCiBjcmVhdGUgbW9k ZSAxMDA2NDQgZnMvamZmczIvTWFrZWZpbGUKIGNyZWF0ZSBtb2RlIDEwMDY0NCBmcy9qZmZzMi9h Y2wuaAogY3JlYXRlIG1vZGUgM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HVybiAwOworfQor CitpbnQgamZmczJfdW5yZWdpc3Rlcl9jb21wcmVzc29yKHN0cnVjdCBqZmZzMl9jb21wcmVzc29y ICpjb21wKQoreworCUQyKHN0cnVjdCBqZmZzMl9jb21wcmVzc29yICp0aGlzKTsKKworCWpmZnMy X2RiZygxLCAiVW5yZWdpc3RlcmluZyBKRkZTMiBjb21wcmVzc29yIFwiJXNcIlxuIiwgY29tcC0+ bmFtZSk7CisKKwlpZiAoY29tcC0+dXNlY291bnQpIHsKKwkJcHJfd2FybigiQ29tcHJlc3NvciBt b2R1bGUgaXMgaW4gdXNlLiBVbnJlZ2lzdGVyIGZhaWxlZC5cbiIpOworCQlyZXR1cm4gLTE7CisJ fQorCWxpc3RfZGVsKCZjb21wLT5saXN0KTsKKworCUQyKGxpc3RfZm9yX2VhY2hfZW50cnkodGhp cywgJmpmZnMyX2NvbXByZXNzb3JfbGlzdCwgbGlzdCkgeworCQlwcmludGsoS0VSTl9ERUJVRyAi Q29tcHJlc3NvciBcIiVzXCIsIHByaW8gJWRcbiIsIHRoaXMtPm5hbWUsIHRoaXMtPnByaW9yaXR5 KTsKKwl9KQorCXJldHVybiAwOworfQorCit2b2lkIGpmZnMyX2ZyZWVfY29tcHJidWYodW5zaWdu ZWQgY2hhciAqY29tcHJidWYsIHVuc2lnbmVkIGNoYXIgKm9yaWcpCit7CisJaWYgKG9yaWcgIT0g Y29tcHJidWYpCisJCWtmcmVlKGNvbXByYnVmKTsKK30KKworaW50IF9faW5pdCBqZmZzMl9jb21w cmVzc29yc19pbml0KHZvaWQpCit7CisvKiBSZWdpc3RlcmluZyBjb21wcmVzc29ycyAqLworI2lm ZGVmIENPTkZJR19GU19KRkZTMl9DT01QUkVTU0lPTl9aTElCCisJamZmczJfemxpYl9pbml0KCk7 CisjZW5kaWYKKyNpZmRlZiBDT05GSUdfRlNfSkZGUzJfQ09NUFJFU1NJT05fTFpPCisJamZmczJf bHpvX2luaXQoKTsKKyNlbmRpZgorI2lmZGVmIENP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fQklUX1JVQklOKSk7CisKKwlycy0+cCA9IHA7CisJcnMt PnEgPSBxOworCisJcnMtPmJpdF9udW1iZXIgKz0gYml0czsKKworCS8qCisJICogTm93IGdldCB0 aGUgYml0cy4gIFdlIHJlYWxseSB3YW50IHRoaXMgdG8gYmUgImdldCBuIGJpdHMiLgorCSAqLwor CXJlY19xID0gcnMtPnJlY19xOworCWRvIHsKKwkJYyA9IHB1bGxiaXQoJnJzLT5wcCk7CisJCXJl Y19xICY9IGxvd2VyX2JpdHNfcnViaW47CisJCXJlY19xIDw8PSAxOworCQlyZWNfcSArPSBjOwor CX0gd2hpbGUgKC0tYml0cyk7CisJcnMtPnJlY19xID0gcmVjX3E7Cit9CisKK3N0YXRpYyBpbnQg ZGVjb2RlKHN0cnVjdCBydWJpbl9zdGF0ZSAqcnMsIGxvbmcgQSwgbG9uZyBCKQoreworCXVuc2ln bmVkIGxvbmcgcCA9IHJzLT5wLCBxID0gcnMtPnE7CisJbG9uZyBpMCwgdGhyZXNob2xkOworCWlu dCBzeW1ib2w7CisKKwlpZiAocSA+PSBVUFBFUl9CSVRfUlVCSU4gfHwgKChwICsgcSkgPD0gVVBQ RVJfQklUX1JVQklOKSkKKwkJX19kb19kZWNvZGUocnMsIHAsIHEpOworCisJaTAgPSBBICogcnMt PnAgLyAoQSArIEIpOworCWlmIChpMCA8PSAwKQorCQlpMCA9IDE7CisKKwlpZiAoaTAgPj0gcnMt PnApCisJCWkwID0gcnMtPnAgLSAxOworCisJdGhyZXNob2xkID0gcnMtPnEgKyBpMDsKKwlzeW1i b2wgPSBycy0+cmVjX3EgPj0gdGhyZXNob2xkOworCWlmIChycy0+cmVjX3EgPj0gdGhyZXNob2xk KSB7CisJCXJzLT5xICs9IGkwOworCQlpMCA9IHJzLT5wIC0gaTA7CisJfQorCisJcnMtPnAgPSBp MDsKKworCXJldHVybiBzeW1ib2w7Cit9CisKK3N0YXRpYyBpbnQgaW5fYnl0ZShzdHJ1Y3QgcnVi aW5fc3RhdG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CkpID09IFpfT0spCisJCTsKKwlpZiAocmV0ICE9IFpfU1RS RUFNX0VORCkgeworCQlwcl9ub3RpY2UoImluZmxhdGUgcmV0dXJuZWQgJWRcbiIsIHJldCk7CisJ fQorCXpsaWJfaW5mbGF0ZUVuZCgmaW5mX3N0cm0pOworCXJldHVybiAwOworfQorCitzdGF0aWMg c3RydWN0IGpmZnMyX2NvbXByZXNzb3IgamZmczJfemxpYl9jb21wID0geworICAgIC5wcmlvcml0 eSA9IEpGRlMyX1pMSUJfUFJJT1JJVFksCisgICAgLm5hbWUgPSAiemxpYiIsCisgICAgLmNvbXBy ID0gSkZGUzJfQ09NUFJfWkxJQiwKKyAgICAuZGVjb21wcmVzcyA9ICZqZmZzMl96bGliX2RlY29t cHJlc3MsCisjaWZkZWYgSkZGUzJfWkxJQl9ESVNBQkxFRAorICAgIC5kaXNhYmxlZCA9IDEsCisj ZWxzZQorICAgIC5kaXNhYmxlZCA9IDAsCisjZW5kaWYKK307CisKK2ludCBfX2luaXQgamZmczJf emxpYl9pbml0KHZvaWQpCit7CisgICAgaW50IHJldDsKKworICAgIGluZl9zdHJtLndvcmtzcGFj ZSA9IHZtYWxsb2MoemxpYl9pbmZsYXRlX3dvcmtzcGFjZXNpemUoKSk7CisgICAgamZmczJfZGJn KDEsICJBbGxvY2F0ZWQgJWQgYnl0ZXMgZm9yIGluZmxhdGUgd29ya3NwYWNlXG4iLAorCSAgICAg IHpsaWJfaW5mbGF0ZV93b3Jrc3BhY2VzaXplKCkpOworCisgICAgcmV0ID0gamZmczJfcmVnaXN0 ZXJfY29tcHJlc3NvcigmamZmczJfemxpYl9jb21wKTsKKworICAgIHJldHVybiByZXQ7Cit9CisK K3ZvaWQgamZmczJfemxpYl9leGl0KHZvaWQpCit7CisJamZmczJfdW5yZWdpc3Rlcl9jb21wcmVz c29yKCZqZmZzMl96bGliX2NvbXApOworCXZmcmVlKGluZl9zdHJtLndvcmtzcGFjZSk7Cit9CmRp ZmYgLS1naXQgYS9mcy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m9p ZAorX19qZmZzMl9kYmdfZHVtcF9ub2RlX3JlZnNfbm9sb2NrKHN0cnVjdCBqZmZzMl9zYl9pbmZv ICpjLAorCQkJCSAgc3RydWN0IGpmZnMyX2VyYXNlYmxvY2sgKmplYikKK3sKKwlzdHJ1Y3QgamZm czJfcmF3X25vZGVfcmVmICpyZWY7CisJaW50IGkgPSAwOworCisJcHJpbnRrKEpGRlMyX0RCR19N U0dfUFJFRklYICIgRHVtcCBub2RlX3JlZnMgb2YgdGhlIGVyYXNlYmxvY2sgJSMwOHhcbiIsIGpl Yi0+b2Zmc2V0KTsKKwlpZiAoIWplYi0+Zmlyc3Rfbm9kZSkgeworCQlwcmludGsoSkZGUzJfREJH X01TR19QUkVGSVggIiBubyBub2RlcyBpbiB0aGUgZXJhc2VibG9jayAlIzA4eFxuIiwgamViLT5v ZmZzZXQpOworCQlyZXR1cm47CisJfQorCisJcHJpbnRrKEpGRlMyX0RCRyk7CisJZm9yIChyZWYg PSBqZWItPmZpcnN0X25vZGU7IDsgcmVmID0gcmVmX25leHQocmVmKSkgeworCQlwcmludGsoIiUj MDh4IiwgcmVmX29mZnNldChyZWYpKTsKKyNpZmRlZiBURVNUX1RPVExFTgorCQlwcmludGsoIigl eCkiLCByZWYtPl9fdG90bGVuKTsKKyNlbmRpZgorCQlpZiAocmVmX25leHQocmVmKSkKKwkJCXBy aW50aygiLT4iKTsKKwkJZWxzZQorCQkJYnJlYWs7CisJCWlmICgrK2kgPT0gNCkgeworCQkJaSA9 IDA7CisJCQlwcmludGsoIlxuIiBKRkZTMl9EQkcpOworCQl9CisJfQorCXByaW50aygiXG4iKTsK K30KKworLyoKKyAqIER1bXAgYW4gZXJhc2VibG9jaydzIHNwYWNlIGFjY291bnRpbmcuCisgKi8K K3ZvaWQKK19famZmczJfZGJnX2R1bXBfamViKHN0cnVjdCBqZmZzMl9zYl9pbmZvICpjLCBzdHJ1 Y3QgamZmczJfZXJhc2VibG9jayAqamViKQoreworCXNwaW5fbG9jayg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xvb2t1cCAgICAgID0JamZmczJfbG9va3VwLAorCS5jcmVh dGUgICAgICA9IE5VTEwsIC8qIG5vdCBwcmVzZW50IGluIGJhcmVib3ggKi8KKwkubGluayAgICAg ICAgPSBOVUxMLCAvKiBub3QgcHJlc2VudCBpbiBiYXJlYm94ICovCisJLnN5bWxpbmsgICAgID0g TlVMTCwgLyogbm90IHByZXNlbnQgaW4gYmFyZWJveCAqLworCS51bmxpbmsgICAgICA9IE5VTEws IC8qIG5vdCBwcmVzZW50IGluIGJhcmVib3ggKi8KKwkubWtkaXIgICAgICAgPSBOVUxMLCAvKiBu b3QgcHJlc2VudCBpbiBiYXJlYm94ICovCisJLnJtZGlyICAgICAgID0gTlVMTCwgLyogbm90IHBy ZXNlbnQgaW4gYmFyZWJveCAqLworfTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKiBXZSBrZWVw IHRoZSBkaXJlbnQgbGlzdCBzb3J0ZWQgaW4gaW5jcmVhc2luZyBvcmRlciBvZiBuYW1lIGhhc2gs CisgICBhbmQgd2UgdXNlIHRoZSBzYW1lIGhhc2ggZnVuY3Rpb24gYXMgdGhlIGRlbnRyaWVzLiBN YWtlcyB0aGlzCisgICBuaWNlIGFuZCBzaW1wbGUKKyovCitzdGF0aWMgc3RydWN0IGRlbnRyeSAq amZmczJfbG9va3VwKHN0cnVjdCBpbm9kZSAqZGlyX2ksIHN0cnVjdCBkZW50cnkgKnRhcmdldCwK KwkJCQkgICB1bnNpZ25lZCBpbnQgZmxhZ3MpCit7CisJc3RydWN0IGpmZnMyX2lub2RlX2luZm8g KmRpcl9mOworCXN0cnVjdCBqZmZzMl9mdWxsX2RpcmVudCAqZmQgPSBOVUxMLCAqZmRfbGlzdDsK Kwl1aW50MzJfdCBpbm8gPSAwOworCXN0cnVjdCBpbm9kZSAqaW5vZGUgPSBOVUxMOworCXVuc2ln bmVkIGludCBuaGFzaD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QorICAgICAgICByZXR1cm4gMDsKK30KKwordm9pZCBqZmZzMl9tYXJrX25vZGVf b2Jzb2xldGUoc3RydWN0IGpmZnMyX3NiX2luZm8gKmMsIHN0cnVjdCBqZmZzMl9yYXdfbm9kZV9y ZWYgKnJlZikKK3sKKwlzdHJ1Y3QgamZmczJfZXJhc2VibG9jayAqamViOworCWludCBibG9ja25y OworCWludCBhZGRlZHNpemU7CisJdWludDMyX3QgZnJlZWRfbGVuOworCisJaWYodW5saWtlbHko IXJlZikpIHsKKwkJcHJfbm90aWNlKCJFRUVFRUsuIGpmZnMyX21hcmtfbm9kZV9vYnNvbGV0ZSBj YWxsZWQgd2l0aCBOVUxMIG5vZGVcbiIpOworCQlyZXR1cm47CisJfQorCWlmIChyZWZfb2Jzb2xl dGUocmVmKSkgeworCQlqZmZzMl9kYmcoMSwgIiVzKCk6IGNhbGxlZCB3aXRoIGFscmVhZHkgb2Jz b2xldGUgbm9kZSBhdCAweCUwOHhcbiIsCisJCQkgIF9fZnVuY19fLCByZWZfb2Zmc2V0KHJlZikp OworCQlyZXR1cm47CisJfQorCWJsb2NrbnIgPSByZWYtPmZsYXNoX29mZnNldCAvIGMtPnNlY3Rv cl9zaXplOworCWlmIChibG9ja25yID49IGMtPm5yX2Jsb2NrcykgeworCQlwcl9ub3RpY2UoInJh dyBub2RlIGF0IDB4JTA4eCBpcyBvZmYgdGhlIGVuZCBvZiBkZXZpY2UhXG4iLAorCQkJICByZWYt PmZsYXNoX29mZnNldCk7CisJCUJVRygpOworCX0KKwlqZWIgPSAmYy0+YmxvY2tzW2Jsb2NrbnJd OworCisJc3Bpbl9sb2NrKCZjLT5lcmFzZV9jb21wbGV0aW9uX2xvY2spOworCisJZnJlZWRfbGVu ID0gcmVmX3RvdGxlbihjLCBqZWIsIHJlZik7CisKKwlpZiAocmVmX2ZsYWdzKHJlZikgPT0gUkVG X1VOQ0hFQ0tFRCkgeworCQlEMShpZiAodW5saWtlbHkoamViLT51bmNoZWNrZWRfc2l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X0KKworCXJldHVybiAwOworfQorCisvKiBDYWxjdWxhdGUgdG90bGVuIGZyb20gc3Vycm91 bmRpbmcgbm9kZXMgb3IgZXJhc2VibG9jayAqLworc3RhdGljIGlubGluZSB1aW50MzJfdCBfX3Jl Zl90b3RsZW4oc3RydWN0IGpmZnMyX3NiX2luZm8gKmMsCisJCQkJICAgIHN0cnVjdCBqZmZzMl9l cmFzZWJsb2NrICpqZWIsCisJCQkJICAgIHN0cnVjdCBqZmZzMl9yYXdfbm9kZV9yZWYgKnJlZikK K3sKKwl1aW50MzJfdCByZWZfZW5kOworCXN0cnVjdCBqZmZzMl9yYXdfbm9kZV9yZWYgKm5leHRf cmVmID0gcmVmX25leHQocmVmKTsKKworCWlmIChuZXh0X3JlZikKKwkJcmVmX2VuZCA9IHJlZl9v ZmZzZXQobmV4dF9yZWYpOworCWVsc2UgeworCQlpZiAoIWplYikKKwkJCWplYiA9ICZjLT5ibG9j a3NbcmVmLT5mbGFzaF9vZmZzZXQgLyBjLT5zZWN0b3Jfc2l6ZV07CisKKwkJLyogTGFzdCBub2Rl IGluIGJsb2NrLiBVc2UgZnJlZV9zcGFjZSAqLworCQlpZiAodW5saWtlbHkocmVmICE9IGplYi0+ bGFzdF9ub2RlKSkgeworCQkJcHJfY3JpdCgicmVmICVwIEAweCUwOHggaXMgbm90IGplYi0+bGFz dF9ub2RlICglcCBAMHglMDh4KVxuIiwKKwkJCQlyZWYsIHJlZl9vZmZzZXQocmVmKSwgamViLT5s YXN0X25vZGUsCisJCQkJamViLT5sYXN0X25vZGUgPworCQkJCXJlZl9vZmZzZXQoamViLT5sYXN0 X25vZGUpIDogMCk7CisJCQlCVUcoKTsKKwkJfQorCQlyZWZfZW5kID0gamViLT5vZmZzZXQgKyBj LT5zZWN0b3Jfc2l6ZSAtIGplYi0+ZnJlZV9zaXplOworCX0KKwlyZXR1cm4gcmVmX2VuZCAtIHJl Zl9vZmZzZXQocmVmKTsKK30KKwordWludDMyX3QgX19qZmZzMl9yZW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K3sKKwlzdHJ1Y3QgamZmczJfcmF3X2lub2RlIG47CisJc3RydWN0IGpmZnMyX2lu b2RlX2luZm8gKmYgPSBremFsbG9jKHNpemVvZigqZiksIEdGUF9LRVJORUwpOworCWludCByZXQ7 CisKKwlpZiAoIWYpCisJCXJldHVybiAtRU5PTUVNOworCisJbXV0ZXhfaW5pdCgmZi0+c2VtKTsK KwltdXRleF9sb2NrKCZmLT5zZW0pOworCWYtPmlub2NhY2hlID0gaWM7CisKKwlyZXQgPSBqZmZz Ml9kb19yZWFkX2lub2RlX2ludGVybmFsKGMsIGYsICZuKTsKKwltdXRleF91bmxvY2soJmYtPnNl bSk7CisJamZmczJfZG9fY2xlYXJfaW5vZGUoYywgZik7CisJamZmczJfeGF0dHJfZG9fY3JjY2hl Y2tfaW5vZGUoYywgaWMpOworCWtmcmVlIChmKTsKKwlyZXR1cm4gcmV0OworfQorCit2b2lkIGpm ZnMyX2RvX2NsZWFyX2lub2RlKHN0cnVjdCBqZmZzMl9zYl9pbmZvICpjLCBzdHJ1Y3QgamZmczJf aW5vZGVfaW5mbyAqZikKK3sKKwlzdHJ1Y3QgamZmczJfZnVsbF9kaXJlbnQgKmZkLCAqZmRzOwor CWludCBkZWxldGVkOworCisJamZmczJfeGF0dHJfZGVsZXRlX2lub2RlKGMsIGYtPmlub2NhY2hl KTsKKwltdXRleF9sb2NrKCZmLT5zZW0pOworCWRlbGV0ZWQgPSBmLT5pbm9jYWNoZSAmJiAhZi0+ aW5vY2FjaGUtPnBpbm9fbmxpbms7CisKKwlpZiAoZi0+aW5vY2FjaGUgJiYgZi0+aW5vY2FjaGUt PnN0YXRlICE9IElOT19TVEFURV9DSEVDS0lORykKKwkJamZmczJfc2V0X2lub2NhY2hlX3N0YXRl KGMsIGYtPmlub2NhY2hlLCBJTk9fU1RBVEVfQ0xFQVJJTkcpOworCisJaWYgKGYtPm1ldGFkYXRh KSB7CisJCWlmIChkZWxldGVkKQorCQkJamZmczJfbWFya19ub2RlX29ic29sZ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ZlcnNpb24gKi8KKwlqaW50MzJfdCBvZmZzZXQ7CS8qIG9mZnNldCBvbiBq ZWIgKi8KKwlqaW50MzJfdCB0b3RsZW47IAkvKiByZWNvcmQgbGVuZ3RoICovCit9IF9fYXR0cmli dXRlX18oKHBhY2tlZCkpOworCitzdHJ1Y3QgamZmczJfc3VtX2RpcmVudF9mbGFzaAoreworCWpp bnQxNl90IG5vZGV0eXBlOwkvKiA9PSBKRkZTX05PREVUWVBFX0RJUkVOVCAqLworCWppbnQzMl90 IHRvdGxlbjsJLyogcmVjb3JkIGxlbmd0aCAqLworCWppbnQzMl90IG9mZnNldDsJLyogb2Zmc2V0 IG9uIGplYiAqLworCWppbnQzMl90IHBpbm87CQkvKiBwYXJlbnQgaW5vZGUgKi8KKwlqaW50MzJf dCB2ZXJzaW9uOwkvKiBkaXJlbnQgdmVyc2lvbiAqLworCWppbnQzMl90IGlubzsgCQkvKiA9PSB6 ZXJvIGZvciB1bmxpbmsgKi8KKwl1aW50OF90IG5zaXplOwkJLyogZGlyZW50IG5hbWUgc2l6ZSAq LworCXVpbnQ4X3QgdHlwZTsJCS8qIGRpcmVudCB0eXBlICovCisJdWludDhfdCBuYW1lWzBdOwkv KiBkaXJlbnQgbmFtZSAqLworfSBfX2F0dHJpYnV0ZV9fKChwYWNrZWQpKTsKKworc3RydWN0IGpm ZnMyX3N1bV94YXR0cl9mbGFzaAoreworCWppbnQxNl90IG5vZGV0eXBlOwkvKiA9PSBKRkZTMl9O T0RFVFlQRV9YQVRSICovCisJamludDMyX3QgeGlkOwkJLyogeGF0dHIgaWRlbnRpZmllciAqLwor CWppbnQzMl90IHZlcnNpb247CS8qIHZlcnNpb24gbnVtYmVyICovCisJamludDMyX3Qgb2Zmc2V0 OwkvKiBvZmZzZXQgb24gamViICovCisJamludDMyX3QgdG90bGVuOwkvKiBub2RlIGxlbmd0aCAq LworfSBfX2F0dHJpYnV0ZV9fKChwYWNrZWQpKTsKKworc3RydWN0IGpmZnMyX3N1bV94cm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1fbWVtICpuZXh0OworCWppbnQxNl90IG5vZGV0eXBlOwkvKiA9PSBK RkZTX05PREVUWVBFX0RJUkVOVCAqLworCWppbnQzMl90IHRvdGxlbjsJLyogcmVjb3JkIGxlbmd0 aCAqLworCWppbnQzMl90IG9mZnNldDsJLyogb2ZzZXQgb24gamViICovCisJamludDMyX3QgcGlu bzsJCS8qIHBhcmVudCBpbm9kZSAqLworCWppbnQzMl90IHZlcnNpb247CS8qIGRpcmVudCB2ZXJz aW9uICovCisJamludDMyX3QgaW5vOyAJCS8qID09IHplcm8gZm9yIHVubGluayAqLworCXVpbnQ4 X3QgbnNpemU7CQkvKiBkaXJlbnQgbmFtZSBzaXplICovCisJdWludDhfdCB0eXBlOwkJLyogZGly ZW50IHR5cGUgKi8KKwl1aW50OF90IG5hbWVbMF07CS8qIGRpcmVudCBuYW1lICovCit9IF9fYXR0 cmlidXRlX18oKHBhY2tlZCkpOworCitzdHJ1Y3QgamZmczJfc3VtX3hhdHRyX21lbQoreworCXVu aW9uIGpmZnMyX3N1bV9tZW0gKm5leHQ7CisJamludDE2X3Qgbm9kZXR5cGU7CisJamludDMyX3Qg eGlkOworCWppbnQzMl90IHZlcnNpb247CisJamludDMyX3Qgb2Zmc2V0OworCWppbnQzMl90IHRv dGxlbjsKK30gX19hdHRyaWJ1dGVfXygocGFja2VkKSk7CisKK3N0cnVjdCBqZmZzMl9zdW1feHJl Zl9tZW0KK3sKKwl1bmlvbiBqZmZzMl9zdW1fbWVtICpuZXh0OworCWppbnQxNl90IG5vZGV0eXBl OworCWppbnQzMl90IG9mZnNldDsKK30gX19hdHRyaWJ1dGVfXygocGFja2VkKSk7CisKK3VuaW9u IGpmZnMyX3N1bV9tZW0KK3sKKwlzdHJ1Y3QgamZmczJfc3VtX3Vua25vd25fbWVtIHU7CisJc3Ry dWN0IGpmZnMyX3N1bV9pbm9kZV9tZW0gaTsKKwlzdHJ1Y3QgamZmczJfc3VtX2RpcmVudF9tZW0g ZDsKKwlzdHJ1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ZSBjYXVnaHQgYWxsIHVzZXMgd2l0aG91 dAorICAgYnl0ZXN3YXBwaW5nICovCisKK3R5cGVkZWYgc3RydWN0IHsKKwlfX3UzMiB2MzI7Cit9 IF9fYXR0cmlidXRlX18oKHBhY2tlZCkpIGppbnQzMl90OworCit0eXBlZGVmIHN0cnVjdCB7CisJ X191MzIgbTsKK30gX19hdHRyaWJ1dGVfXygocGFja2VkKSkgam1vZGVfdDsKKwordHlwZWRlZiBz dHJ1Y3QgeworCV9fdTE2IHYxNjsKK30gX19hdHRyaWJ1dGVfXygocGFja2VkKSkgamludDE2X3Q7 CisKK3N0cnVjdCBqZmZzMl91bmtub3duX25vZGUKK3sKKwkvKiBBbGwgc3RhcnQgbGlrZSB0aGlz ICovCisJamludDE2X3QgbWFnaWM7CisJamludDE2X3Qgbm9kZXR5cGU7CisJamludDMyX3QgdG90 bGVuOyAvKiBTbyB3ZSBjYW4gc2tpcCBvdmVyIG5vZGVzIHdlIGRvbid0IGdyb2sgKi8KKwlqaW50 MzJfdCBoZHJfY3JjOworfTsKKworc3RydWN0IGpmZnMyX3Jhd19kaXJlbnQKK3sKKwlqaW50MTZf dCBtYWdpYzsKKwlqaW50MTZfdCBub2RldHlwZTsJLyogPT0gSkZGUzJfTk9ERVRZUEVfRElSRU5U ICovCisJamludDMyX3QgdG90bGVuOworCWppbnQzMl90IGhkcl9jcmM7CisJamludDMyX3QgcGlu bzsKKwlqaW50MzJfdCB2ZXJzaW9uOworCWppbnQzMl90IGlubzsgLyogPT0gemVybyBmb3IgdW5s aW5rICovCisJamludDMyX3QgbWN0aW1lOworCV9fdTggbnNpemU7CisJX191OCB0eXBlOworCV9f dTggdW51c2VkWzJdOworCWppbnQzMl90IG5vZGVfY3JjOworCWppbnQzMl90IG5hbWVfY3JjOwor CV9fdTggbmFtZVswXTsKK307CisKKy8qIFRoZSBKRkZTMiByYXcgaW5vZGUgc3RydWN0dXJlOiBV c2VkIGZvciBzdG9yYWdlIG9uIHBoeXNpY2Fs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YXRp bWU7ICAgICAgLyogTGFzdCBhY2Nlc3MgdGltZS4gICovCisJamludDMyX3QgbXRpbWU7ICAgICAg LyogTGFzdCBtb2RpZmljYXRpb24gdGltZS4gICovCisJamludDMyX3QgY3RpbWU7ICAgICAgLyog Q2hhbmdlIHRpbWUuICAqLworCWppbnQzMl90IG9mZnNldDsgICAgIC8qIFdoZXJlIHRvIGJlZ2lu IHRvIHdyaXRlLiAgKi8KKwlqaW50MzJfdCBjc2l6ZTsgICAgICAvKiAoQ29tcHJlc3NlZCkgZGF0 YSBzaXplICovCisJamludDMyX3QgZHNpemU7CSAgICAgLyogU2l6ZSBvZiB0aGUgbm9kZSdzIGRh dGEuIChhZnRlciBkZWNvbXByZXNzaW9uKSAqLworCV9fdTggY29tcHI7ICAgICAgIC8qIENvbXBy ZXNzaW9uIGFsZ29yaXRobSB1c2VkICovCisJX191OCB1c2VyY29tcHI7ICAgLyogQ29tcHJlc3Np b24gYWxnb3JpdGhtIHJlcXVlc3RlZCBieSB0aGUgdXNlciAqLworCWppbnQxNl90IGZsYWdzOwkg ICAgIC8qIFNlZSBKRkZTMl9JTk9fRkxBR18qICovCisJamludDMyX3QgZGF0YV9jcmM7ICAgLyog Q1JDIGZvciB0aGUgKGNvbXByZXNzZWQpIGRhdGEuICAqLworCWppbnQzMl90IG5vZGVfY3JjOyAg IC8qIENSQyBmb3IgdGhlIHJhdyBpbm9kZSAoZXhjbHVkaW5nIGRhdGEpICAqLworCV9fdTggZGF0 YVswXTsKK307CisKK3N0cnVjdCBqZmZzMl9yYXdfeGF0dHIgeworCWppbnQxNl90IG1hZ2ljOwor CWppbnQxNl90IG5vZGV0eXBlOwkvKiA9IEpGRlMyX05PREVUWVBFX1hBVFRSICovCisJamludDMy X3QgdG90bGVuOworCWppbnQzMl90IGhkcl9jcmM7CisJamludDMyX3QgeGlkOwkJLyogWEFUVFIg aWRlbnRpZmllciBudW1iZXIgKi8KKwlqaW50MzJfdCB2ZXJzaW9uOworCV9fdTggeHByZWZpeDsK KwlfX3U4IG5hbWVfbGVuOworCWppbnQxNl90IHZhbHVlX2xlbjsKKwlqaW50MzJfdCBkYXRhX2Ny YzsKKwlqaW50MzJfdCBub2RlX2NyYzsKKwlfX3U4IGRhdGFbMF07Cit9IF9fYXR0cmlidXRlX18o KHBhY2tlZCkpOworCitzdHJ1Y3QgamZmczJfcmF3X3hyZWYKK3sKKwlqaW50MTZfdCBtYWdpYzsK KwlqaW50MTZfdCBub2RldHlwZTsJLyogPSBKRkZTMl9OT0RFVFlQRV9YUkVGICovCisJamludDMy X3QgdG90bGVuOworCWppbnQzMl90IGhkcl9jcmM7CisJamludDMyX3QgaW5vOwkJLyogaW5vZGUg bnVtYmVyICovCisJamludDMyX3QgeGlkOwkJLyogWEFUVFIgaWRlbnRpZmllciBudW1iZXIgKi8K KwlqaW50MzJfdCB4c2Vxbm87CS8qIHhyZWYgc2VxdWVudGlhbCBudW1iZXIgKi8KKwlqaW50MzJf dCBub2RlX2NyYzsKK30gX19hdHRyaWJ1dGVfXygocGFja2VkKSk7CisKK3N0cnVjdCBqZmZzMl9y YXdfc3VtbWFyeQoreworCWppbnQxNl90IG1hZ2ljOworCWppbnQxNl90IG5vZGV0eXBlOyAJLyog PSBKRkZTMl9OT0RFVFlQRV9TVU1NQVJZICovCisJamludDMyX3QgdG90bGVuOworCWppbnQzMl90 IGhkcl9jcmM7CisJamludDMyX3Qgc3VtX251bTsJLyogbnVtYmVyIG9mIHN1bSBlbnRyaWVzKi8K KwlqaW50MzJfdCBjbG5fbWtyOwkvKiBjbGVhbiBtYXJrZXIgc2l6ZSwgMCA9IG5vIGNsZWFubWFy a2VyICovCisJamludDMyX3QgcGFkZGVkOwkvKiBzdW0gb2YgdGhlIHNpemUgb2YgcGFkZGluZyBu b2RlcyAqLworCWppbnQzMl90IHN1bV9jcmM7CS8qIHN1bW1hcnkgaW5mb3JtYXRpb24gY3JjICov CisJamludDMyX3Qgbm9kZV9jcmM7IAkvKiBub2RlIGNyYyAqLworCWppbnQzMl90IHN1bVswXTsg CS8qIGlub2RlIHN1bW1hcnkgaW5mbyAqLworfTsKKwordW5pb24gamZmczJfbm9kZV91bmlvbgor eworCXN0cnVjdCBqZmZzMl9yYXdfaW5vZGUgaTsKKwlzdHJ1Y3QgamZmczJfcmF3X2RpcmVudCBk OworCXN0cnVjdCBqZmZzMl9yYXdfeGF0dHIgeDsKKwlzdHJ1Y3QgamZmczJfcmF3X3hyZWYgcjsK KwlzdHJ1Y3QgamZmczJfcmF3X3N1bW1hcnkgczsKKwlzdHJ1Y3QgamZmczJfdW5rbm93bl9ub2Rl IHU7Cit9OworCisvKiBEYXRhIHBheWxvYWQgZm9yIGRldmljZSBub2Rlcy4gKi8KK3VuaW9uIGpm ZnMyX2RldmljZV9ub2RlIHsKKwlqaW50MTZfdCBvbGRfaWQ7CisJamludDMyX3QgbmV3X2lkOwor fTsKKworI2VuZGlmIC8qIF9fTElOVVhfSkZGUzJfSF9fICovCi0tIAoyLjI1LjAKCgpfX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpiYXJlYm94IG1haWxpbmcg bGlzdApiYXJlYm94QGxpc3RzLmluZnJhZGVhZC5vcmcKaHR0cDovL2xpc3RzLmluZnJhZGVhZC5v cmcvbWFpbG1hbi9saXN0aW5mby9iYXJlYm94Cg==