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 1izGjA-0003vo-Da for barebox@lists.infradead.org; Wed, 05 Feb 2020 09:12:13 +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 1izGj6-000810-Ks for barebox@lists.infradead.org; Wed, 05 Feb 2020 10:12:04 +0100 Received: from str by dude.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1izGj6-00040N-Bz for barebox@lists.infradead.org; Wed, 05 Feb 2020 10:12:04 +0100 From: Steffen Trumtrar Date: Wed, 5 Feb 2020 10:12:01 +0100 Message-Id: <20200205091201.15248-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 v2] fs: jffs2: add initial support for reading jffs2 To: Barebox List SW1wb3J0IHRoZSBqZmZzMiBmaWxlc3lzdGVtIGNvZGUgZnJvbSBMaW51eCB2NS41LXJjMSBhbmQg Y29udmVydCBpdAp0byB3b3JrIHdpdGggYmFyZWJveC4KCldyaXRpbmcgaXMgKm5vdCogc3VwcG9y dGVkLgoKVGVzdGluZyB3YXMgZG9uZSB3aXRoIGEgbjI1cTI1NmEtY29tcGF0aWJsZSBRdWFkU1BJ IGNoaXAgb24gYQpTb0NGUEdBLWJhc2VkIFNvY3JhdGVzIGJvYXJkLgoKVGVzdGluZyB3YXMgZG9u ZSB3aXRoIGEgY29tYmluYXRpb24gb2Y6Cgl1c2VyQHNvbWVsaW51eGhvc3Q6IG1rZ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KIGZzL2pmZnMyL01ha2VmaWxlICAgICAgfCAgICA5ICsKIGZzL2pmZnMyL2Fj bC5oICAgICAgICAgfCAgIDQyICsrCiBmcy9qZmZzMi9idWlsZC5jICAgICAgIHwgIDQyNSArKysr KysrKysrKysKIGZzL2pmZnMyL2NvbXByLmMgICAgICAgfCAgMTU1ICsrKysrCiBmcy9qZmZzMi9j b21wci5oICAgICAgIHwgIDExMiArKysrCiBmcy9qZmZzMi9jb21wcl9sem8uYyAgIHwgICA1MiAr KwogZnMvamZmczIvY29tcHJfcnRpbWUuYyB8ICAgODYgKysrCiBmcy9qZmZzMi9jb21wcl9ydWJp bi5jIHwgIDI3MCArKysrKysrKwogZnMvamZmczIvY29tcHJfemxpYi5jICB8ICAxMDUgKysrCiBm cy9qZmZzMi9kZWJ1Zy5jICAgICAgIHwgIDg2OCArKysrKysrKysrKysrKysrKysrKysrKysrCiBm cy9qZmZzMi9kZWJ1Zy5oICAgICAgIHwgIDI2OSArKysrKysrKwogZnMvamZmczIvZGlyLmMgICAg ICAgICB8ICAxMzUgKysrKwogZnMvamZmczIvZnMuYyAgICAgICAgICB8ICA0ODMgKysrKysrKysr KysrKysKIGZzL2pmZnMyL2pmZnMyX2ZzX2kuaCAgfCAgIDU1ICsrCiBmcy9qZmZzMi9qZmZzMl9m c19zYi5oIHwgIDE2MCArKysrKwogZnMvamZmczIvbWFsbG9jLmMgICAgICB8ICAzMTUgKysrKysr KysrCiBmcy9qZmZzMi9ub2RlbGlzdC5jICAgIHwgIDkxNSArKysrKysrKysrKysrKysrKysrKysr KysrKwogZnMvamZmczIvbm9kZWxpc3QuaCAgICB8ICA1MDYgKysrKysrKysrKysrKysrCiBmcy9q ZmZzMi9vcy1saW51eC5oICAgIHwgIDE5MyArKysrKysKIGZzL2pmZnMyL3JlYWQuYyAgICAgICAg fCAgMjI5ICsrKysrKysKIGZzL2pmZnMyL3JlYWRpbm9kZS5jICAgfCAxNDAxICsrKysrKysrKysr KysrKysrKysrKysrKysrKys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ZWUgdGhlIGZpbGUgJ0xJQ0VO Q0UnIGluIHRoaXMgZGlyZWN0b3J5LgorICoKKyAqLworCisjaW5jbHVkZSA8Y29tbW9uLmg+Cisj aW5jbHVkZSA8bHpvLmg+CisjaW5jbHVkZSA8bGludXgva2VybmVsLmg+CisjaW5jbHVkZSAiY29t cHIuaCIKKworc3RhdGljIGludCBqZmZzMl9sem9fZGVjb21wcmVzcyh1bnNpZ25lZCBjaGFyICpk YXRhX2luLCB1bnNpZ25lZCBjaGFyICpjcGFnZV9vdXQsCisJCQkJIHVpbnQzMl90IHNyY2xlbiwg dWludDMyX3QgZGVzdGxlbikKK3sKKwlzaXplX3QgZGwgPSBkZXN0bGVuOworCWludCByZXQ7CisK KwlyZXQgPSBsem8xeF9kZWNvbXByZXNzX3NhZmUoZGF0YV9pbiwgc3JjbGVuLCBjcGFnZV9vdXQs ICZkbCk7CisKKwlpZiAocmV0ICE9IExaT19FX09LIHx8IGRsICE9IGRlc3RsZW4pCisJCXJldHVy biAtMTsKKworCXJldHVybiAwOworfQorCitzdGF0aWMgc3RydWN0IGpmZnMyX2NvbXByZXNzb3Ig amZmczJfbHpvX2NvbXAgPSB7CisJLnByaW9yaXR5ID0gSkZGUzJfTFpPX1BSSU9SSVRZLAorCS5u YW1lID0gImx6byIsCisJLmNvbXByID0gSkZGUzJfQ09NUFJfTFpPLAorCS5kZWNvbXByZXNzID0g JmpmZnMyX2x6b19kZWNvbXByZXNzLAorCS5kaXNhYmxlZCA9IDAsCit9OworCitpbnQgX19pbml0 IGpmZnMyX2x6b19pbml0KHZvaWQpCit7CisJaW50IHJldDsKKworCXJldCA9IGpmZnMyX3JlZ2lz dGVyX2NvbXByZXNzb3IoJmpmZnMyX2x6b19jb21wKTsKKworCXJldHVybiByZXQ7Cit9CisKK3Zv aWQgamZmczJfbHpvX2V4aXQodm9pZCkKK3sKKwlqZmZzMl91bnJlZ2lzdGVyX2NvbXByZXNzb3Io JmpmZnMyX2x6b19jb21wKTsKK30KZGl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hdGlvbiAqLwor CWlmIChteV9kaXJ0eV9zaXplICE9IGplYi0+ZGlydHlfc2l6ZSArIGplYi0+d2FzdGVkX3NpemUp IHsKKwkJSkZGUzJfRVJST1IoIkNhbGN1bGF0ZWQgZGlydHkrd2FzdGVkIHNpemUgJSMwOHggIT0g c3RvcmVkIGRpcnR5ICsgd2FzdGVkIHNpemUgJSMwOHhcbiIsCisJCQlteV9kaXJ0eV9zaXplLCBq ZWItPmRpcnR5X3NpemUgKyBqZWItPndhc3RlZF9zaXplKTsKKwkJZ290byBlcnJvcjsKKwl9CisK KwlpZiAoamViLT5mcmVlX3NpemUgPT0gMAorCQkmJiBteV91c2VkX3NpemUgKyBteV91bmNoZWNr ZWRfc2l6ZSArIG15X2RpcnR5X3NpemUgIT0gYy0+c2VjdG9yX3NpemUpIHsKKwkJSkZGUzJfRVJS T1IoIlRoZSBzdW0gb2YgYWxsIG5vZGVzIGluIGJsb2NrICglI3gpICE9IHNpemUgb2YgYmxvY2sg KCUjeClcbiIsCisJCQlteV91c2VkX3NpemUgKyBteV91bmNoZWNrZWRfc2l6ZSArIG15X2RpcnR5 X3NpemUsCisJCQljLT5zZWN0b3Jfc2l6ZSk7CisJCWdvdG8gZXJyb3I7CisJfQorI2VuZGlmCisK KwlpZiAoIShjLT5mbGFncyAmIChKRkZTMl9TQl9GTEFHX0JVSUxESU5HfEpGRlMyX1NCX0ZMQUdf U0NBTk5JTkcpKSkKKwkJX19qZmZzMl9kYmdfc3VwZXJibG9ja19jb3VudHMoYyk7CisKKwlyZXR1 cm47CisKK2Vycm9yOgorCV9famZmczJfZGJnX2R1bXBfbm9kZV9yZWZzX25vbG9jayhjLCBqZWIp OworCV9famZmczJfZGJnX2R1bXBfamViX25vbG9jayhqZWIpOworCV9famZmczJfZGJnX2R1bXBf YmxvY2tfbGlzdHNfbm9sb2NrKGMpOworCUJVRygpOworCit9CisjZW5kaWYgLyogSkZGUzJfREJH X1BBUkFOT0lBX0NIRUNLUyAqLworCisjaWYg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NfUEVSX0xJTkUgLSAx KTsKKworCWlmIChza2lwICE9IDApCisJCXByaW50ayhKRkZTMl9EQkcgIiUjMDh4OiAiLCBvZmZz KTsKKworCXdoaWxlIChza2lwLS0pCisJCXByaW50aygiICAgIik7CisKKwl3aGlsZSAoaSA8IGxl bikgeworCQlpZiAoKGkgJSBKRkZTMl9CVUZEVU1QX0JZVEVTX1BFUl9MSU5FKSA9PSAwICYmIGkg IT0gbGVuIC0xKSB7CisJCQlpZiAoaSAhPSAwKQorCQkJCXByaW50aygiXG4iKTsKKwkJCW9mZnMg Kz0gSkZGUzJfQlVGRFVNUF9CWVRFU19QRVJfTElORTsKKwkJCXByaW50ayhKRkZTMl9EQkcgIiUw Izh4OiAiLCBvZmZzKTsKKwkJfQorCisJCXByaW50aygiJTAyeCAiLCBidWZbaV0pOworCisJCWkg Kz0gMTsKKwl9CisKKwlwcmludGsoIlxuIik7Cit9CisKKy8qCisgKiBEdW1wIGEgSkZGUzIgbm9k ZS4KKyAqLwordm9pZAorX19qZmZzMl9kYmdfZHVtcF9ub2RlKHN0cnVjdCBqZmZzMl9zYl9pbmZv ICpjLCB1aW50MzJfdCBvZnMpCit7CisJdW5pb24gamZmczJfbm9kZV91bmlvbiBub2RlOworCWlu dCBsZW4gPSBzaXplb2YodW5pb24gamZmczJfbm9kZV91bmlvbik7CisJc2l6ZV90IHJldGxlbjsK Kwl1aW50MzJfdCBjcmM7CisJaW50IHJldDsKKworCXByaW50ayhKRkZTMl9EQkdfTVNHX1BSRUZJ WCAiIGR1bXAgbm9kZSBhdCBvZmZzZXQgJSMwOHguXG4iLCBvZnMpOworCisJcmV0ID0gamZmczJf Zmxhc2hfcmVhZChjLCBvZnMsIGxlbiwgJnJldGxlbiwgKHVuc2lnbmVkIGNoYXIgKikmbm9kZSk7 CisJaWYgKHJldCB8fCAocmV0bGVuICE9IGxlbikpIHsKKwkJSkZGUzJfRVJST1IoInJlYWQgJWQg Ynl0ZXMgZmFpbGVkIG9yIHNob3J0LiByZXQgJWQsIHJldGxlbiAlemQuXG4iLAorCQkJbGVuLCBy ZXQsIHJldGxlbik7CisJCXJldHVybjsKKwl9CisKKwlwcmludGsoSkZGUzJfREJHICJtYWdpYzpc dCUjMDR4XG4iLCBqZTE2X3RvX2NwdShub2RlLnUubWFnaWMpKTsKKwlwcmludGsoSkZGUzJfREJH ICJub2RldHlwZTpcdCUjMDR4XG4iLCBqZTE2X3RvX2NwdShub2RlLnUubm9kZXR5cGUpKTsKKwlw cmludGsoSkZGUzJfREJHICJ0b3RsZW46XHQlIzA4eFxuIiwgamUzMl90b19jcHUobm9kZS51LnRv dGxlbikpOworCXByaW50ayhKRkZTMl9EQkcgImhkcl9jcmM6XHQlIzA4eFxuIiwgamUzMl90b19j cHUobm9kZS51Lmhkcl9jcmMpKTsKKworCWNyYyA9IGNyYzMyKDAsICZub2RlLnUsIHNpemVvZihu b2RlLnUpIC0gNCk7CisJaWYgKGNyYyAhPSBqZTMyX3RvX2NwdShub2RlLnUuaGRyX2NyYykpIHsK KwkJSkZGUzJfRVJST1IoIndyb25nIGNvbW1vbiBoZWFkZXIgQ1JDLlxuIik7CisJCXJldHVybjsK Kwl9CisKKwlpZiAoamUxNl90b19jcHUobm9kZS51Lm1hZ2ljKSAhPSBKRkZTMl9NQUdJQ19CSVRN QVNLICYmCisJCWplMTZfdG9fY3B1KG5vZGUudS5tYWdpYykgIT0gSkZGUzJfT0xEX01BR0lDX0JJ VE1BU0spCisJeworCQlKRkZTMl9FUlJPUigid3Jvbmcgbm9kZSBtYWdpYzogJSMwNHggaW5zdGVh ZCBvZiAlIzA0eC5cbiIsCisJCQlqZTE2X3RvX2NwdShub2RlLnUubWFnaWMpLCBKRkZTMl9NQUdJ Q19CSVRNQVNLKTsKKwkJcmV0dXJuOworCX0KKworCXN3aXRjaChqZTE2X3RvX2NwdShub2RlLnUu bm9kZXR5cGUpKSB7CisKKwljYXNlIEpGRlMyX05PREVUWVBFX0lOT0RFOgorCisJCXByaW50ayhK RkZTM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bmZvICpjLAorCQkJICAgCXN0cnVjdCBqZmZzMl9l cmFzZWJsb2NrICpqZWIpOwordm9pZAorX19qZmZzMl9kYmdfYWNjdF9wYXJhbm9pYV9jaGVja19u b2xvY2soc3RydWN0IGpmZnMyX3NiX2luZm8gKmMsCisJCQkJICAgICAgIHN0cnVjdCBqZmZzMl9l cmFzZWJsb2NrICpqZWIpOwordm9pZAorX19qZmZzMl9kYmdfcHJld3JpdGVfcGFyYW5vaWFfY2hl Y2soc3RydWN0IGpmZnMyX3NiX2luZm8gKmMsCisJCQkJICAgIHVpbnQzMl90IG9mcywgaW50IGxl bik7CisKKy8qICJEdW1wIiBmdW5jdGlvbnMgKi8KK3ZvaWQKK19famZmczJfZGJnX2R1bXBfamVi KHN0cnVjdCBqZmZzMl9zYl9pbmZvICpjLCBzdHJ1Y3QgamZmczJfZXJhc2VibG9jayAqamViKTsK K3ZvaWQKK19famZmczJfZGJnX2R1bXBfamViX25vbG9jayhzdHJ1Y3QgamZmczJfZXJhc2VibG9j ayAqamViKTsKK3ZvaWQKK19famZmczJfZGJnX2R1bXBfYmxvY2tfbGlzdHMoc3RydWN0IGpmZnMy X3NiX2luZm8gKmMpOwordm9pZAorX19qZmZzMl9kYmdfZHVtcF9ibG9ja19saXN0c19ub2xvY2so c3RydWN0IGpmZnMyX3NiX2luZm8gKmMpOwordm9pZAorX19qZmZzMl9kYmdfZHVtcF9ub2RlX3Jl ZnMoc3RydWN0IGpmZnMyX3NiX2luZm8gKmMsCisJCSAJICAgc3RydWN0IGpmZnMyX2VyYXNlYmxv Y2sgKmplYik7Cit2b2lkCitfX2pmZnMyX2RiZ19kdW1wX25vZGVfcmVmc19ub2xvY2soc3RydWN0 IGpmZnMyX3NiX2luZm8gKmMsCisJCQkJICBzdHJ1Y3QgamZmczJfZXJhc2VibG9jayAqamViKTsK K3ZvaWQKK19famZmczJfZGJnX2R1bXBfZnJhZ3RyZWUoc3RydWN0IGpmZnMyX2lub2RlX2luZm8g KmYpOwordm9p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qu aCIKKworc3RhdGljIGludCBqZmZzMl9yZWFkZGlyIChzdHJ1Y3QgZmlsZSAqLCBzdHJ1Y3QgZGly X2NvbnRleHQgKik7CisKK3N0YXRpYyBzdHJ1Y3QgZGVudHJ5ICpqZmZzMl9sb29rdXAgKHN0cnVj dCBpbm9kZSAqLHN0cnVjdCBkZW50cnkgKiwKKwkJCQkgICAgdW5zaWduZWQgaW50KTsKKworY29u c3Qgc3RydWN0IGZpbGVfb3BlcmF0aW9ucyBqZmZzMl9kaXJfb3BlcmF0aW9ucyA9Cit7CisJLnJl YWQgCSA9IE5VTEwsCisJLml0ZXJhdGUgPSBqZmZzMl9yZWFkZGlyLAorfTsKKworY29uc3Qgc3Ry dWN0IGlub2RlX29wZXJhdGlvbnMgamZmczJfZGlyX2lub2RlX29wZXJhdGlvbnMgPQoreworCS5s b29rdXAgICAgICA9CWpmZnMyX2xvb2t1cCwKKwkuY3JlYXRlICAgICAgPSBOVUxMLCAvKiBub3Qg cHJlc2VudCBpbiBiYXJlYm94ICovCisJLmxpbmsgICAgICAgID0gTlVMTCwgLyogbm90IHByZXNl bnQgaW4gYmFyZWJveCAqLworCS5zeW1saW5rICAgICA9IE5VTEwsIC8qIG5vdCBwcmVzZW50IGlu IGJhcmVib3ggKi8KKwkudW5saW5rICAgICAgPSBOVUxMLCAvKiBub3QgcHJlc2VudCBpbiBiYXJl Ym94ICovCisJLm1rZGlyICAgICAgID0gTlVMTCwgLyogbm90IHByZXNlbnQgaW4gYmFyZWJveCAq LworCS5ybWRpciAgICAgICA9IE5VTEwsIC8qIG5vdCBwcmVzZW50IGluIGJhcmVib3ggKi8KK307 CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKi8KKworLyogV2Uga2VlcCB0aGUgZGlyZW50IGxpc3Qgc29ydGVk IGluIGluY3JlYXNpbmcgb3JkZXIgb2YgbmFtZSBoYXNoLAorICAgYW5kIHdlIH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lYW51cChjKTsKKwl9CisKKwkvKiBhbmQgSW50ZWwgIlNpYmxleSIgZmxh c2ggKi8KKwlpZiAoamZmczJfbm9yX3didWZfZmxhc2goYykpIHsKKwkJamZmczJfbm9yX3didWZf Zmxhc2hfY2xlYW51cChjKTsKKwl9CisKKwkvKiBhbmQgYW4gVUJJIHZvbHVtZSAqLworCWlmIChq ZmZzMl91Yml2b2woYykpIHsKKwkJamZmczJfdWJpdm9sX2NsZWFudXAoYyk7CisJfQorfQorCitz dGF0aWMgaW50IGpmZnMyX3Byb2JlKHN0cnVjdCBkZXZpY2VfZCAqZGV2KQoreworCXN0cnVjdCBm c19kZXZpY2VfZCAqZnNkZXY7CisJc3RydWN0IHN1cGVyX2Jsb2NrICpzYjsKKwlzdHJ1Y3QgamZm czJfc2JfaW5mbyAqY3R4OworCWludCByZXQ7CisKKwlmc2RldiA9IGRldl90b19mc19kZXZpY2Uo ZGV2KTsKKwlzYiA9ICZmc2Rldi0+c2I7CisKKwlyZXQgPSBmc2Rldl9vcGVuX2NkZXYoZnNkZXYp OworCWlmIChyZXQpCisJCWdvdG8gZXJyX291dDsKKworCWN0eCA9IGt6YWxsb2Moc2l6ZW9mKHN0 cnVjdCBqZmZzMl9zYl9pbmZvKSwgR0ZQX0tFUk5FTCk7CisJaWYgKCFjdHgpCisJCXJldHVybiAt RU5PTUVNOworCisJY3R4LT5tdGQgPSBmc2Rldi0+Y2Rldi0+bXRkOworCisJc2ItPnNfZnNfaW5m byA9IGN0eDsKKworICAgICAgICByZXQgPSBqZmZzMl9jb21wcmVzc29yc19pbml0KCk7CisgICAg ICAgIGlmIChyZXQpIHsKKwkJcHJfZXJyKCJlcnJvcjogRmFpbGVkIHRvIGluaXRpYWxpc2UgY29t cHJlc3NvcnNcbiIpOworCQlnb3RvIGVycl9vdXQ7CisgICAgICAgIH0KKworICAgICAgICByZXQg PSBqZmZzMl9jcmVhdGVfc2xhYl9jYWNoZXMoKTsKKyAgICAgICAgaWYgKHJldCkgeworCQ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YywgamViLCA0KSkpCisJCQkJcmV0dXJuIGVycjsKKwkJCW9mcyArPSA0OworCQkJ Y29udGludWU7CisJCX0KKwkJLyogV2Ugc2VlbSB0byBoYXZlIGEgbm9kZSBvZiBzb3J0cy4gQ2hl Y2sgdGhlIENSQyAqLworCQljcmNub2RlLm1hZ2ljID0gbm9kZS0+bWFnaWM7CisJCWNyY25vZGUu bm9kZXR5cGUgPSBjcHVfdG9famUxNiggamUxNl90b19jcHUobm9kZS0+bm9kZXR5cGUpIHwgSkZG UzJfTk9ERV9BQ0NVUkFURSk7CisJCWNyY25vZGUudG90bGVuID0gbm9kZS0+dG90bGVuOworCQlo ZHJfY3JjID0gY3JjMzIoMCwgJmNyY25vZGUsIHNpemVvZihjcmNub2RlKS00KTsKKworCQlpZiAo aGRyX2NyYyAhPSBqZTMyX3RvX2NwdShub2RlLT5oZHJfY3JjKSkgeworCQkJbm9pc3lfcHJpbnRr KCZub2lzZSwgIiVzKCk6IE5vZGUgYXQgMHglMDh4IHsweCUwNHgsIDB4JTA0eCwgMHglMDh4KSBo YXMgaW52YWxpZCBDUkMgMHglMDh4IChjYWxjdWxhdGVkIDB4JTA4eClcbiIsCisJCQkJICAgICBf X2Z1bmNfXywKKwkJCQkgICAgIG9mcywgamUxNl90b19jcHUobm9kZS0+bWFnaWMpLAorCQkJCSAg ICAgamUxNl90b19jcHUobm9kZS0+bm9kZXR5cGUpLAorCQkJCSAgICAgamUzMl90b19jcHUobm9k ZS0+dG90bGVuKSwKKwkJCQkgICAgIGplMzJfdG9fY3B1KG5vZGUtPmhkcl9jcmMpLAorCQkJCSAg ICAgaGRyX2NyYyk7CisJCQlpZiAoKGVyciA9IGpmZnMyX3NjYW5fZGlydHlfc3BhY2UoYywgamVi LCA0KSkpCisJCQkJcmV0dXJuIGVycjsKKwkJCW9mcyArPSA0OworCQkJY29udGludWU7CisJCX0K KworCQlpZiAob2ZzICsgamUzMl90b19jcHUobm9kZS0+dG90bGVuKSA+IGplYi0+b2Zmc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ydHlfc2l6 ZSArPSBqZWItPndhc3RlZF9zaXplOworCQljLT5kaXJ0eV9zaXplICs9IGplYi0+d2FzdGVkX3Np emU7CisJCWMtPndhc3RlZF9zaXplIC09IGplYi0+d2FzdGVkX3NpemU7CisJCWplYi0+d2FzdGVk X3NpemUgPSAwOworCX0KKworCXJldHVybiBqZmZzMl9zY2FuX2NsYXNzaWZ5X2plYihjLCBqZWIp OworfQorCitzdHJ1Y3QgamZmczJfaW5vZGVfY2FjaGUgKmpmZnMyX3NjYW5fbWFrZV9pbm9fY2Fj aGUoc3RydWN0IGpmZnMyX3NiX2luZm8gKmMsIHVpbnQzMl90IGlubykKK3sKKwlzdHJ1Y3QgamZm czJfaW5vZGVfY2FjaGUgKmljOworCisJaWMgPSBqZmZzMl9nZXRfaW5vX2NhY2hlKGMsIGlubyk7 CisJaWYgKGljKQorCQlyZXR1cm4gaWM7CisKKwlpZiAoaW5vID4gYy0+aGlnaGVzdF9pbm8pCisJ CWMtPmhpZ2hlc3RfaW5vID0gaW5vOworCisJaWMgPSBqZmZzMl9hbGxvY19pbm9kZV9jYWNoZSgp OworCWlmICghaWMpIHsKKwkJcHJfbm90aWNlKCIlcygpOiBhbGxvY2F0aW9uIG9mIGlub2RlIGNh Y2hlIGZhaWxlZFxuIiwgX19mdW5jX18pOworCQlyZXR1cm4gTlVMTDsKKwl9CisJbWVtc2V0KGlj LCAwLCBzaXplb2YoKmljKSk7CisKKwlpYy0+aW5vID0gaW5vOworCWljLT5ub2RlcyA9ICh2b2lk ICopaWM7CisJamZmczJfYWRkX2lub19jYWNoZShjLCBpYyk7CisJaWYgKGlubyA9PSAxKQorCQlp Yy0+cGlub19ubGluayA9IDE7CisJcmV0dXJuIGljOworfQorCitzdGF0aWMgaW50IGpmZnMyX3Nj YW5faW5vZGVfbm9kZShzdHJ1Y3QgamZmczJfc2JfaW5mbyAqYywgc3RydWN0IGpmZnMyX2VyYXNl YmxvY2sgKmplYiwKKwkJCQkgc3RydWN0IGpmZnMy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7CisKK3R5 cGVkZWYgc3RydWN0IHsKKwlfX3UxNiB2MTY7Cit9IF9fYXR0cmlidXRlX18oKHBhY2tlZCkpIGpp bnQxNl90OworCitzdHJ1Y3QgamZmczJfdW5rbm93bl9ub2RlCit7CisJLyogQWxsIHN0YXJ0IGxp a2UgdGhpcyAqLworCWppbnQxNl90IG1hZ2ljOworCWppbnQxNl90IG5vZGV0eXBlOworCWppbnQz Ml90IHRvdGxlbjsgLyogU28gd2UgY2FuIHNraXAgb3ZlciBub2RlcyB3ZSBkb24ndCBncm9rICov CisJamludDMyX3QgaGRyX2NyYzsKK307CisKK3N0cnVjdCBqZmZzMl9yYXdfZGlyZW50Cit7CisJ amludDE2X3QgbWFnaWM7CisJamludDE2X3Qgbm9kZXR5cGU7CS8qID09IEpGRlMyX05PREVUWVBF X0RJUkVOVCAqLworCWppbnQzMl90IHRvdGxlbjsKKwlqaW50MzJfdCBoZHJfY3JjOworCWppbnQz Ml90IHBpbm87CisJamludDMyX3QgdmVyc2lvbjsKKwlqaW50MzJfdCBpbm87IC8qID09IHplcm8g Zm9yIHVubGluayAqLworCWppbnQzMl90IG1jdGltZTsKKwlfX3U4IG5zaXplOworCV9fdTggdHlw ZTsKKwlfX3U4IHVudXNlZFsyXTsKKwlqaW50MzJfdCBub2RlX2NyYzsKKwlqaW50MzJfdCBuYW1l X2NyYzsKKwlfX3U4IG5hbWVbMF07Cit9OworCisvKiBUaGUgSkZGUzIgcmF3IGlub2RlIHN0cnVj dHVyZTogVXNlZCBmb3Igc3RvcmFnZSBvbiBwaHlzaWNhbCBtZWRpYS4gICovCisvKiBUaGUgdWlk LCBnaWQsIGF0aW1lLCBtdGltZSBhbmQgY3RpbWUgbWVtYmVycyBjb3VsZCBiZSBsb25nZXIsIGJ1 dAorICAgYXJlIGxlZnQgbGlrZSB0aGlzIGZvciBzcGFjZSBlZmZpY2llbmN5LiBJZiBhbmQgd2hl biBwZW9wbGUgZGVjaWRlCisgICB0aGV5IHJlYWxseSBuZWVkIHRoZW0gZXh0ZW5kZWQsIGl0J3Mg c2ltcGxlIGVub3VnaCB0byBhZGQgc3VwcG9ydCBmb3IKKyAgIGEgbmV3IHR5cGUgb2YgcmF3IG5v ZGUuCisqLworc3RydWN0IGpmZnMyX3Jhd19pbm9kZQoreworCWppbnQxNl90IG1hZ2ljOyAgICAg IC8qIEEgY29uc3RhbnQgbWFnaWMgbnVtYmVyLiAgKi8KKwlqaW50MTZfdCBub2RldHlwZTsgICAv KiA9PSBKRkZTMl9OT0RFVFlQRV9JTk9ERSAqLworCWppbnQzMl90IHRvdGxlbjsgICAgIC8qIFRv dGFsIGxlbmd0aCBvZiB0aGlzIG5vZGUgKGluYyBkYXRhLCBldGMuKSAqLworCWppbnQzMl90IGhk cl9jcmM7CisJamludDMyX3QgaW5vOyAgICAgICAgLyogSW5vZGUgbnVtYmVyLiAgKi8KKwlqaW50 MzJfdCB2ZXJzaW9uOyAgICAvKiBWZXJzaW9uIG51bWJlci4gICovCisJam1vZGVfdCBtb2RlOyAg ICAgICAvKiBUaGUgZmlsZSdzIHR5cGUgb3IgbW9kZS4gICovCisJamludDE2X3QgdWlkOyAgICAg ICAgLyogVGhlIGZpbGUncyBvd25lci4gICovCisJamludDE2X3QgZ2lkOyAgICAgICAgLyogVGhl IGZpbGUncyBncm91cC4gICovCisJamludDMyX3QgaXNpemU7ICAgICAgLyogVG90YWwgcmVzdWx0 YW50IHNpemUgb2YgdGhpcyBpbm9kZSAodXNlZCBmb3IgdHJ1bmNhdGlvbnMpICAqLworCWppbnQz Ml90IGF0aW1lOyAgICAgIC8qIExhc3QgYWNjZXNzIHRpbWUuICAqLworCWppbnQzMl90IG10aW1l OyAgICAgIC8qIExhc3QgbW9kaWZpY2F0aW9uIHRpbWUuICAqLworCWppbnQzMl90IGN0aW1lOyAg ICAgIC8qIENoYW5nZSB0aW1lLiAgKi8KKwlqaW50MzJfdCBvZmZzZXQ7ICAgICAvKiBXaGVyZSB0 byBiZWdpbiB0byB3cml0ZS4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X3hhdHRyIHg7CisJc3RydWN0IGpmZnMyX3Jhd194 cmVmIHI7CisJc3RydWN0IGpmZnMyX3Jhd19zdW1tYXJ5IHM7CisJc3RydWN0IGpmZnMyX3Vua25v d25fbm9kZSB1OworfTsKKworLyogRGF0YSBwYXlsb2FkIGZvciBkZXZpY2Ugbm9kZXMuICovCit1 bmlvbiBqZmZzMl9kZXZpY2Vfbm9kZSB7CisJamludDE2X3Qgb2xkX2lkOworCWppbnQzMl90IG5l d19pZDsKK307CisKKyNlbmRpZiAvKiBfX0xJTlVYX0pGRlMyX0hfXyAqLwotLSAKMi4yNS4wCgoK X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KYmFyZWJveCBt YWlsaW5nIGxpc3QKYmFyZWJveEBsaXN0cy5pbmZyYWRlYWQub3JnCmh0dHA6Ly9saXN0cy5pbmZy YWRlYWQub3JnL21haWxtYW4vbGlzdGluZm8vYmFyZWJveAo=